From 843644393dde53d888e60c767059667fd018b59b Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Tue, 25 Feb 2020 08:43:47 -0500 Subject: [PATCH 0001/3088] phpDynDNS.inc: Fix missing break statement in switch case for Linode Commit ab0ccc3be92ff4b716296d0d683cc0e1c8975030 seems to have mistakenly removed the `break` statement for the `switch` case for Linode. This commit adds it back, which fixes dynamic DNS updates for Linode. Signed-off-by: Andrew Gunnerson --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 5173554fbe..afa798a595 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -97,8 +97,8 @@ * dynv6 v6 - Last Tested: 25 June 2019 * DigitalOcean - Last Tested: 25 June 2019 * Azure DNS - Last Tested: 16 October 2019 - * Linode - Last Tested: 12 November 2019 - * Linode v6 - Last Tested: 12 November 2019 + * Linode - Last Tested: 25 February 2020 + * Linode v6 - Last Tested: 25 February 2020 * +====================================================+ * * @author E.Kristensen @@ -990,6 +990,7 @@ class updatedns } else { log_error("Dynamic DNS($fqdn): No zone found for domain"); } + break; case 'azurev6': case 'azure': $hostname = "{$this->_dnsHost}"; From 8b1441958787e3842fdbfe2c5537ec43d42daf12 Mon Sep 17 00:00:00 2001 From: Johan Pramming Date: Sun, 26 Jan 2020 16:48:05 +0100 Subject: [PATCH 0002/3088] GratisDNS URL updated --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index afa798a595..5a2784c5a5 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -82,7 +82,7 @@ * CloudFlare - Last Tested: 16 April 2019 * CloudFlare IPv6 - Last Tested: 16 April 2019 * Eurodns - Last Tested: 25 July 2018 - * GratisDNS - Last Tested: 15 August 2012 + * GratisDNS - Last Tested: 26 January 2020 * OVH DynHOST - Last Tested: NEVER * City Network - Last Tested: 13 November 2013 * Duck DNS - Last Tested: 04 March 2015 @@ -818,10 +818,10 @@ class updatedns curl_setopt($ch, CURLOPT_URL, $server . $port . '?hostname=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); break; case 'gratisdns': - $server = "https://ssl.gratisdns.dk/ddns.phtml"; + $server = "https://admin.gratisdns.com/ddns.php"; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); list($hostname, $domain) = explode(".", $this->_dnsHost, 2); - curl_setopt($ch, CURLOPT_URL, $server . '?u=' . urlencode($this->_dnsUser) . '&p=' . $this->_dnsPass . '&h=' . $this->_dnsHost . '&d=' . $domain); + curl_setopt($ch, CURLOPT_URL, $server . '?u=' . urlencode($this->_dnsUser) . '&p=' . $this->_dnsPass . '&h=' . $this->_dnsHost . '&d=' . $domain . '&i=' . $this->_dnsIP); break; case 'ovh-dynhost': if (isset($this->_dnsWildcard) && $this->_dnsWildcard != "OFF") { From 7ceecaadbaface1df6aadd8d85cb808400941677 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 26 Feb 2020 10:07:20 +0100 Subject: [PATCH 0003/3088] dns/dyndns: bump revision for changes --- dns/dyndns/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 4f03fc2899..da86abedac 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.19 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From 2a034326a80c81bef7fafe92d9e96448819c8680 Mon Sep 17 00:00:00 2001 From: NOYB <1977521+NOYB@users.noreply.github.com> Date: Wed, 26 Feb 2020 04:22:54 -0800 Subject: [PATCH 0004/3088] DynDNS Custom Updater: Un-restrict Verify Peer & IPv4 Resolve Verify peer and IP resolve have value aside from authentication. For cases where authentication is not used it can still be desirable to confirm identity and prevent MITM. --- .../etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 5a2784c5a5..1b0c7b698b 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -733,15 +733,15 @@ class updatedns break; case 'custom': case 'custom-v6': + if ($this->_curlIpresolveV4) { + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + } + if ($this->_curlSslVerifypeer) { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + } else { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + } if ($this->_dnsUser != '') { - if ($this->_curlIpresolveV4) { - curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); - } - if ($this->_curlSslVerifypeer) { - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - } else { - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - } curl_setopt($ch, CURLOPT_USERPWD, "{$this->_dnsUser}:{$this->_dnsPass}"); } $server = str_replace("%IP%", $this->_dnsIP, $this->_dnsUpdateURL); From 56d3a991cb46a71508e4d608986bbf053a4d67d8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 28 Feb 2020 10:22:02 +0100 Subject: [PATCH 0005/3088] LICENSE: sync --- LICENSE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index b1f3e57416..0b7a99dd6c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Ad Schellevis +Copyright (c) 2015-2020 Ad Schellevis Copyright (c) 2019 Cloudfence - Julio Camargo (JCC) Copyright (c) 2005-2006 Colin Smith Copyright (c) 2011 Dan Myers @@ -26,6 +26,7 @@ Copyright (c) 2017-2019 Smart-Soft Copyright (c) 2013 Stanley P. Miller \ stan-qaz Copyright (c) 2010 Yehuda Katz Copyright (c) 2015 YoungJoo.Kim +Copyright (c) 2020 devNan0 All rights reserved. Redistribution and use in source and binary forms, with or without From e72efeead133a685e99ec495fb7617df39a7739d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 28 Feb 2020 10:22:17 +0100 Subject: [PATCH 0006/3088] Framework: allow diff and mfc targets for subdirs --- Makefile | 36 ------------------------------------ Mk/defaults.mk | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index f5b95c2e5a..8e31ab3a0e 100644 --- a/Makefile +++ b/Makefile @@ -51,42 +51,6 @@ ${TARGET}: . endfor .endfor -ARGS= diff mfc - -# handle argument expansion for required targets -.for TARGET in ${.TARGETS} -_TARGET= ${TARGET:C/\-.*//} -.if ${_TARGET} != ${TARGET} -.for ARGUMENT in ${ARGS} -.if ${_TARGET} == ${ARGUMENT} -${_TARGET}_ARGS+= ${TARGET:C/^[^\-]*(\-|\$)//:S/,/ /g} -${TARGET}: ${_TARGET} -.endif -.endfor -${_TARGET}_ARG= ${${_TARGET}_ARGS:[0]} -.endif -.endfor - -diff: - @git diff --stat -p stable/${PLUGIN_ABI} ${.CURDIR}/${diff_ARGS:[1]} - -mfc: -.for MFC in ${mfc_ARGS} -.if exists(${MFC}) - @git diff --stat -p stable/${PLUGIN_ABI} ${.CURDIR}/${MFC} > /tmp/mfc.diff - @git checkout stable/${PLUGIN_ABI} - @git apply /tmp/mfc.diff - @git add ${.CURDIR} - @if ! git diff --quiet HEAD; then \ - git commit -m "${MFC}: sync with master"; \ - fi -.else - @git checkout stable/${PLUGIN_ABI} - @git cherry-pick -x ${MFC} -.endif - @git checkout master -.endfor - license: @${.CURDIR}/Scripts/license . > ${.CURDIR}/LICENSE diff --git a/Mk/defaults.mk b/Mk/defaults.mk index be747ef1b8..1368f70ff3 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -48,3 +48,39 @@ SED_REPLACE= # empty .for REPLACEMENT in ${REPLACEMENTS} SED_REPLACE+= -e "s=%%${REPLACEMENT}%%=${${REPLACEMENT}}=g" .endfor + +ARGS= diff mfc + +# handle argument expansion for required targets +.for TARGET in ${.TARGETS} +_TARGET= ${TARGET:C/\-.*//} +.if ${_TARGET} != ${TARGET} +.for ARGUMENT in ${ARGS} +.if ${_TARGET} == ${ARGUMENT} +${_TARGET}_ARGS+= ${TARGET:C/^[^\-]*(\-|\$)//:S/,/ /g} +${TARGET}: ${_TARGET} +.endif +.endfor +${_TARGET}_ARG= ${${_TARGET}_ARGS:[0]} +.endif +.endfor + +diff: + @git diff --stat -p stable/${PLUGIN_ABI} ${.CURDIR}/${diff_ARGS:[1]} + +mfc: +.for MFC in ${mfc_ARGS} +.if exists(${MFC}) + @git diff --stat -p stable/${PLUGIN_ABI} ${.CURDIR}/${MFC} > /tmp/mfc.diff + @git checkout stable/${PLUGIN_ABI} + @git apply /tmp/mfc.diff + @git add ${.CURDIR} + @if ! git diff --quiet HEAD; then \ + git commit -m "${MFC}: sync with master"; \ + fi +.else + @git checkout stable/${PLUGIN_ABI} + @git cherry-pick -x ${MFC} +.endif + @git checkout master +.endfor From 4d6bb2d44252d2cbda9d5e2203920f8f16f6a7b6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 28 Feb 2020 10:24:38 +0100 Subject: [PATCH 0007/3088] dns/dyndns: warrants version bump now --- dns/dyndns/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index da86abedac..5d6d6b59c7 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= dyndns -PLUGIN_VERSION= 1.19 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.20 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From 58c43a9802ec0d05204ec5f957b76ff8baf882e4 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 3 Mar 2020 13:40:00 +0100 Subject: [PATCH 0008/3088] security/maltrail: switch python version (#1727) --- security/maltrail/Makefile | 2 +- security/maltrail/pkg-descr | 4 ++++ security/maltrail/src/etc/rc.d/opnsense-maltrailsensor | 2 +- security/maltrail/src/etc/rc.d/opnsense-maltrailserver | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/security/maltrail/Makefile b/security/maltrail/Makefile index 69197eb50c..e688bcf70b 100644 --- a/security/maltrail/Makefile +++ b/security/maltrail/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= maltrail -PLUGIN_VERSION= 1.3 +PLUGIN_VERSION= 1.4 PLUGIN_COMMENT= Malicious traffic detection system PLUGIN_DEPENDS= maltrail PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/maltrail/pkg-descr b/security/maltrail/pkg-descr index ed7cf39a49..c84a0a8efa 100644 --- a/security/maltrail/pkg-descr +++ b/security/maltrail/pkg-descr @@ -11,6 +11,10 @@ WWW: https://github.com/stamparm/maltrail Changelog --------- +1.4 + +* Switch Python to version 3 + 1.3 * Fix a typo in model labeling preventing to use remote server logging diff --git a/security/maltrail/src/etc/rc.d/opnsense-maltrailsensor b/security/maltrail/src/etc/rc.d/opnsense-maltrailsensor index 852046b29a..b064c35b4d 100755 --- a/security/maltrail/src/etc/rc.d/opnsense-maltrailsensor +++ b/security/maltrail/src/etc/rc.d/opnsense-maltrailsensor @@ -14,7 +14,7 @@ name=maltrailsensor rcvar=maltrailsensor_enable pidfile=/var/run/${name}.pid command=/usr/sbin/daemon -command_args="-f -P /var/run/maltrailsensor.pid python2.7 /usr/local/share/maltrail/sensor.py" +command_args="-f -P /var/run/maltrailsensor.pid python3 /usr/local/share/maltrail/sensor.py" load_rc_config opnsense-maltrailsensor diff --git a/security/maltrail/src/etc/rc.d/opnsense-maltrailserver b/security/maltrail/src/etc/rc.d/opnsense-maltrailserver index 23cd811af0..aa3de2883a 100755 --- a/security/maltrail/src/etc/rc.d/opnsense-maltrailserver +++ b/security/maltrail/src/etc/rc.d/opnsense-maltrailserver @@ -14,7 +14,7 @@ name=maltrailserver rcvar=maltrailserver_enable pidfile=/var/run/${name}.pid command=/usr/sbin/daemon -command_args="-f -P /var/run/maltrailserver.pid python2.7 /usr/local/share/maltrail/server.py" +command_args="-f -P /var/run/maltrailserver.pid python3 /usr/local/share/maltrail/server.py" load_rc_config opnsense-maltrailserver From 3e02ddc2ca2352d0780978bc213c7a2f6752189c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 4 Mar 2020 09:26:10 +0100 Subject: [PATCH 0009/3088] dns/dnscrypt-proxy: _var_script only if enabled --- .../service/templates/OPNsense/Dnscryptproxy/dnscrypt_proxy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt_proxy b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt_proxy index 6cee01a3b4..96c051b26a 100644 --- a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt_proxy +++ b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt_proxy @@ -1,4 +1,5 @@ {% if helpers.exists('OPNsense.dnscryptproxy.general.enabled') and OPNsense.dnscryptproxy.general.enabled == '1' %} +dnscrypt_proxy_var_script="/usr/local/opnsense/scripts/OPNsense/Dnscryptproxy/setup.sh" dnscrypt_proxy_enable="YES" {% if helpers.exists('OPNsense.dnscryptproxy.general.allowprivileged') and OPNsense.dnscryptproxy.general.allowprivileged == '1' %} dnscrypt_proxy_suexec="YES" @@ -11,4 +12,3 @@ dnscrypt_proxy_dnsbl="{{ OPNsense.dnscryptproxy.dnsbl.type }}" {% else %} dnscrypt_proxy_enable="NO" {% endif %} -dnscrypt_proxy_var_script="/usr/local/opnsense/scripts/OPNsense/Dnscryptproxy/setup.sh" From b1e26a5d845ca1c164b4c37b0d8c17c58c8a9aae Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 4 Mar 2020 09:29:43 +0100 Subject: [PATCH 0010/3088] net-mgmt/nrpe: register setup.sh for _var_script --- net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe | 1 + 1 file changed, 1 insertion(+) diff --git a/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe b/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe index d1afd25d21..256738cbb8 100644 --- a/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe +++ b/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe @@ -1,4 +1,5 @@ {% if helpers.exists('OPNsense.nrpe.general.enabled') and OPNsense.nrpe.general.enabled == '1' %} +nrpe3_var_script="/usr/local/opnsense/scripts/OPNsense/Nrpe/setup.sh" nrpe3_enable="YES" {% else %} nrpe3_enable="NO" From 169927ac045d01dcc7fc14ae264695ebc16a9987 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 4 Mar 2020 09:31:57 +0100 Subject: [PATCH 0011/3088] net-mgmt/telegraf: whitespace nit --- net-mgmt/telegraf/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 5d25b2c7a1..3f381da7ea 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -12,6 +12,7 @@ Plugin Changelog ================ 1.7.7 + * Fix log not properly parsed 1.7.6 From 86b0a81fab2539688c2b9bbb67eb1e64dda54b19 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 4 Mar 2020 09:32:36 +0100 Subject: [PATCH 0012/3088] net/freeradius: whitespace nit --- net/freeradius/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index 4d00cdad0e..efb4406873 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -16,6 +16,7 @@ Plugin Changelog ================ 1.9.6 + * Fix log not properly parsed 1.9.5 From c58730761de22a2c2988a5f0af2f4ff935b56475 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 4 Mar 2020 09:34:37 +0100 Subject: [PATCH 0013/3088] security/tinc: latest change warrants a version bump --- security/tinc/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/tinc/Makefile b/security/tinc/Makefile index ce034c019a..fe9f6ac4be 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= tinc -PLUGIN_VERSION= 1.4 -PLUGIN_REVISION= 5 +PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org From 8f6a9a66ba8da0878cef4c821023fccc20e3ef1b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 6 Mar 2020 12:31:34 +0100 Subject: [PATCH 0014/3088] Framework: accept selected build-time flavour --- Mk/defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 1368f70ff3..0f6f3b1c3d 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -37,7 +37,7 @@ ARCH!= uname -p PLUGIN_ABI?= 20.1 PLUGIN_ARCH?= ${ARCH} -PLUGIN_FLAVOUR= ${FLAVOUR} +PLUGIN_FLAVOUR?=${FLAVOUR} REPLACEMENTS= PLUGIN_ABI \ PLUGIN_ARCH \ From 156be04aae6c8615c1cd8294f9eff2c97a4a5d74 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 Mar 2020 10:53:11 +0100 Subject: [PATCH 0015/3088] sysutils/munin-node: release 1.0 \o/ --- sysutils/munin-node/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile index fafe82704e..4540d03cc2 100644 --- a/sysutils/munin-node/Makefile +++ b/sysutils/munin-node/Makefile @@ -1,8 +1,7 @@ PLUGIN_NAME= munin-node -PLUGIN_VERSION= 0.1 +PLUGIN_VERSION= 1.0 PLUGIN_COMMENT= Munin monitorin agent PLUGIN_DEPENDS= munin-node -PLUGIN_DEVEL= yes PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" From 48bcb85124b4e5b6187a4151be06b1d4bce0035f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 10 Mar 2020 13:17:53 +0100 Subject: [PATCH 0016/3088] net/tayga: add interface commands to rc.conf (#1700) --- net/tayga/Makefile | 2 +- net/tayga/src/etc/rc.d/opnsense-tayga | 12 +++++++++++ .../OPNsense/Tayga/forms/general.xml | 20 +++++++++++++++---- .../mvc/app/models/OPNsense/Tayga/General.xml | 17 +++++++++++----- .../service/templates/OPNsense/Tayga/tayga | 5 +++++ 5 files changed, 46 insertions(+), 10 deletions(-) diff --git a/net/tayga/Makefile b/net/tayga/Makefile index b29b67d690..f57fd502f9 100644 --- a/net/tayga/Makefile +++ b/net/tayga/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= tayga -PLUGIN_VERSION= 0.1 +PLUGIN_VERSION= 0.2 PLUGIN_DEVEL= yes PLUGIN_COMMENT= Tayga IPv6 64NAT PLUGIN_DEPENDS= tayga diff --git a/net/tayga/src/etc/rc.d/opnsense-tayga b/net/tayga/src/etc/rc.d/opnsense-tayga index 78ed736fc6..0bc0834d74 100755 --- a/net/tayga/src/etc/rc.d/opnsense-tayga +++ b/net/tayga/src/etc/rc.d/opnsense-tayga @@ -11,6 +11,7 @@ name=tayga +start_cmd=tayga_start stop_cmd=tayga_stop rcvar=tayga_enable @@ -21,6 +22,17 @@ command_args="-p ${pidfile}" [ -z "$tayga_enable" ] && tayga_enable="NO" +tayga_start() +{ + echo "starting tayga" + ${command} ${command_args} + sleep 1 + ifconfig nat64 inet ${tayga_v4destination}/32 ${tayga_v4address} + ifconfig nat64 inet6 ${tayga_v6estination}/128 + route -6 add ${tayga_v6prefix} -interface nat64 + route -4 add ${tayga_v4pool} -interface nat64 +} + tayga_stop() { if [ -n "$rc_pid" ]; then diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml index e75b05a161..14a6c52724 100644 --- a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml @@ -9,24 +9,36 @@ general.v4address text - This is not your router's IPv4 address. Tayga requires its own address because it acts as an IPv4 and IPv6 router, and needs to be able to send ICMP messages. This address can safely be located inside the dynamic-pool prefix. + Should be located in Tayga's IPv4 pool. Tayga requires its own IPv4 address because it acts as a router and needs to be able to send ICMP messages. Tayga will also respond to ICMPv4 echo requests at this address. + + + general.v4destination + + text + IPv4 address of the NAT64 interface. Must not be located in Tayga's IPv4 pool. Only used for ICMP. general.v6address text - This is not your routers IPv6 address. Tayga requires its own address because it acts as an IPv4 and IPv6 router, and needs to be able to send ICMP messages. Tayga will also respond to ICMP echo requests (ping6) at this address. You can leave it unspecified and Tayga will construct its IPv6 address using IPv4 address and the NAT64 prefix. + If left unspecified, Tayga will construct its IPv6 address by using its IPv4 address and the IPv6 prefix (default). Tayga requires its own IPv6 address because it acts as a router and needs to be able to send ICMP messages. Tayga will also respond to ICMPv6 echo requests at this address. + + + general.v6destination + + text + IPv6 address of the NAT64 interface. Must not have Tayga's IPv6 prefix. Only used for ICMP. general.v6prefix text - This must be a prefix selected from your organizations IPv6 address space or the Well-Known Prefix 64:ff9b::/96. The IPv4 address space is mapped into the IPv6 address space by prepending this prefix to the IPv4 address. + This must be a /96 prefix selected from your organization's IPv6 address space or the Well-Known Prefix 64:ff9b::/96. The IPv4 address space is mapped into the IPv6 address space by prepending this prefix to the IPv4 address. general.v4pool text - Dynamic pool prefix. IPv6 hosts which send traffic through Tayga will be assigned an IPv4 address from the dynamic pool. + IPv6 hosts which send traffic through Tayga will be dynamically assigned an IPv4 address from this pool. Can be any size, but each IPv6 host requires one address. diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml index 5f9ff3d26a..63fdb0c3dd 100644 --- a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml @@ -1,7 +1,7 @@ //OPNsense/tayga/general Tayga configuration - 0.0.2 + 0.0.4 0 @@ -9,19 +9,26 @@ 192.168.255.1 - N + Y + + 192.168.254.1 + Y + - 2001:db8:1::2 N + + 2001:db8:1:ffff::1 + Y + 2001:db8:1:ffff::/96 - N + Y 192.168.255.0/24 - N + Y diff --git a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga index 45e40deac0..cc5d8c68c1 100644 --- a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga +++ b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga @@ -1,6 +1,11 @@ {% if helpers.exists('OPNsense.tayga.general.enabled') and OPNsense.tayga.general.enabled == '1' %} tayga_var_script="/usr/local/opnsense/scripts/OPNsense/Tayga/setup.sh" tayga_enable="YES" +tayga_v4address={{ OPNsense.tayga.general.v4address }} +tayga_v4destination={{ OPNsense.tayga.general.v4destination }} +tayga_v4pool={{ OPNsense.tayga.general.v4pool }} +tayga_v6prefix={{ OPNsense.tayga.general.v6prefix }} +tayga_v6address={{ OPNsense.tayga.general.v6address }} {% else %} tayga_enable="NO" {% endif %} From aca3e2b4db9bf1a427b1d2d7ef250e812947213a Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 10 Mar 2020 13:23:30 +0100 Subject: [PATCH 0017/3088] mail/postfix: add more antispam features (#1723) --- mail/postfix/Makefile | 2 +- mail/postfix/pkg-descr | 3 ++ .../OPNsense/Postfix/forms/general.xml | 30 +++++++++++++++++++ .../app/models/OPNsense/Postfix/General.xml | 24 +++++++++++++++ .../templates/OPNsense/Postfix/main.cf | 28 +++++++++++++++++ 5 files changed, 86 insertions(+), 1 deletion(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index ca8860ddb5..a86fe025c4 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= postfix -PLUGIN_VERSION= 1.13 +PLUGIN_VERSION= 1.14 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix-sasl PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/pkg-descr b/mail/postfix/pkg-descr index b319d42372..38f254a7de 100644 --- a/mail/postfix/pkg-descr +++ b/mail/postfix/pkg-descr @@ -6,6 +6,9 @@ is completely different. Plugin Changelog ================ +1.14 + +* Add more anti-spam features into postfix itself 1.13 diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml index 2432b7b13f..008bd8eabe 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml @@ -150,6 +150,36 @@ true If you enable this, every entry in Recipients will be checked against. When there is no match mail will be rejected. Be aware that it does not matter if the action is "OK" or "REJECT". This setup allows you to run postfix in front of an internal system and already rejecting unsolicited mail at the border. + + general.extensive_helo_restrictions + + checkbox + + + general.extensive_sender_restrictions + + checkbox + + + general.reject_unknown_client_hostname + + checkbox + + + general.reject_non_fqdn_helo_hostname + + checkbox + + + general.reject_invalid_helo_hostname + + checkbox + + + general.reject_unknown_helo_hostname + + checkbox + general.reject_unauth_pipelining diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml index e2d2a99e59..4a0bd65e4e 100644 --- a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml @@ -111,6 +111,30 @@ 0 Y + + 0 + Y + + + 0 + Y + + + 0 + Y + + + 0 + Y + + + 0 + Y + + + 0 + Y + 1 Y diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf index fed2225dbf..d744346027 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf @@ -134,6 +134,18 @@ relay_recipient_maps = hash:/usr/local/etc/postfix/recipient_access {% if helpers.exists('OPNsense.postfix.recipient.recipients.recipient') %} {% do smtpd_recipient_restrictions.append('check_recipient_access hash:/usr/local/etc/postfix/recipient_access') %} {% endif %} +{% if helpers.exists('OPNsense.postfix.general.reject_unknown_client_hostname') and OPNsense.postfix.general.reject_unknown_client_hostname == '1' %} +{% do smtpd_recipient_restrictions.append('reject_unknown_client_hostname') %} +{% endif %} +{% if helpers.exists('OPNsense.postfix.general.reject_non_fqdn_helo_hostname') and OPNsense.postfix.general.reject_non_fqdn_helo_hostname == '1' %} +{% do smtpd_recipient_restrictions.append('reject_non_fqdn_helo_hostname') %} +{% endif %} +{% if helpers.exists('OPNsense.postfix.general.reject_invalid_helo_hostname') and OPNsense.postfix.general.reject_invalid_helo_hostname == '1' %} +{% do smtpd_recipient_restrictions.append('reject_invalid_helo_hostname') %} +{% endif %} +{% if helpers.exists('OPNsense.postfix.general.reject_unknown_helo_hostname') and OPNsense.postfix.general.reject_unknown_helo_hostname == '1' %} +{% do smtpd_recipient_restrictions.append('reject_unknown_helo_hostname') %} +{% endif %} {% if helpers.exists('OPNsense.postfix.general.reject_unauth_pipelining') and OPNsense.postfix.general.reject_unauth_pipelining == '1' %} {% do smtpd_recipient_restrictions.append('reject_unauth_pipelining') %} {% endif %} @@ -168,6 +180,22 @@ smtpd_recipient_restrictions = {{ smtpd_recipient_restrictions | join(', ') }} smtpd_helo_required = yes +{% if helpers.exists('OPNsense.postfix.general.extensive_helo_restrictions') and OPNsense.postfix.general.extensive_helo_restrictions == '1' %} +smtpd_helo_restrictions = + permit_mynetworks, + permit_sasl_authenticated, + reject_invalid_helo_hostname, + reject_non_fqdn_hostname, + reject_unknown_hostname +{% endif %} +{% if helpers.exists('OPNsense.postfix.general.extensive_sender_restrictions') and OPNsense.postfix.general.extensive_sender_restrictions == '1' %} +smtpd_sender_restrictions = + permit_mynetworks, + permit_sasl_authenticated, + reject_unknown_reverse_client_hostname, + reject_unknown_sender_domain, + reject_non_fqdn_sender +{% endif %} syslog_facility = mail syslog_name = postfix From 81f254b878725cd1d04d47ce4221cc5d5448837f Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 27 Feb 2020 18:42:23 +0100 Subject: [PATCH 0018/3088] Firewall: add boilerplate for https://github.com/opnsense/plugins/issues/1720 --- net/firewall/Makefile | 6 ++ net/firewall/pkg-descr | 4 ++ .../Firewall/Api/FilterController.php | 66 +++++++++++++++++++ .../OPNsense/Firewall/FilterController.php | 38 +++++++++++ .../Firewall/forms/dialogFilterRule.xml | 18 +++++ .../app/models/OPNsense/Firewall/Filter.php | 35 ++++++++++ .../app/models/OPNsense/Firewall/Filter.xml | 28 ++++++++ .../models/OPNsense/Firewall/Menu/Menu.xml | 7 ++ .../app/views/OPNsense/Firewall/filter.volt | 46 +++++++++++++ 9 files changed, 248 insertions(+) create mode 100644 net/firewall/Makefile create mode 100644 net/firewall/pkg-descr create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml create mode 100644 net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php create mode 100644 net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml create mode 100644 net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml create mode 100644 net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt diff --git a/net/firewall/Makefile b/net/firewall/Makefile new file mode 100644 index 0000000000..3f314e675d --- /dev/null +++ b/net/firewall/Makefile @@ -0,0 +1,6 @@ +PLUGIN_NAME= firewall +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= Firewall API supplemental package +PLUGIN_MAINTAINER= ad@opnsense.org + +.include "../../Mk/plugins.mk" diff --git a/net/firewall/pkg-descr b/net/firewall/pkg-descr new file mode 100644 index 0000000000..30776806e4 --- /dev/null +++ b/net/firewall/pkg-descr @@ -0,0 +1,4 @@ +This package extends the standard OPNsense firewall system with endpoints for machine to machine management tasks. +Gui components are initially only intended to ease testing and to explain current functionality. + +In the long term this might replace the default firewall in OPNsense. diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php new file mode 100644 index 0000000000..27a684b60c --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php @@ -0,0 +1,66 @@ +searchBase("rules.rule", array('enabled', 'sequence', 'description'), "sequence"); + } + + public function setItemAction($uuid) + { + return $this->setBase("rule", "rules.rule", $uuid); + } + + public function addItemAction() + { + return $this->addBase("rule", "rules.rule"); + } + + public function getItemAction($uuid = null) + { + return $this->getBase("rule", "rules.rule", $uuid); + } + + public function delItemAction($uuid) + { + return $this->delBase("rules.rule", $uuid); + } + + public function toggleItemAction($uuid, $enabled = null) + { + return $this->toggleBase("rules.rule", $uuid, $enabled); + } +} \ No newline at end of file diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php new file mode 100644 index 0000000000..f236de95fe --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php @@ -0,0 +1,38 @@ +view->pick('OPNsense/Firewall/filter'); + $this->view->formDialogFilterRule = $this->getForm("dialogFilterRule"); + } +} \ No newline at end of file diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml new file mode 100644 index 0000000000..8f9b870571 --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml @@ -0,0 +1,18 @@ +
+ + rule.enabled + + checkbox + Enable this rule + + + rule.sequence + + text + + + rule.description + + text + +
\ No newline at end of file diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php new file mode 100644 index 0000000000..ebe4b7394a --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -0,0 +1,35 @@ + + //OPNsense/Firewall/FilterRule + + OPNsense firewall filter rules + + + + + + 1 + Y + + + 1 + 1000000 + provide a valid sequence for sorting + Y + 1 + + + N + /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u + Description should be a string between 1 and 255 characters + + + + + \ No newline at end of file diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml new file mode 100644 index 0000000000..1348a80d5f --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt new file mode 100644 index 0000000000..beb717c6ca --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt @@ -0,0 +1,46 @@ + + + + +
+
+ + + + + + + + + + + + + + + + + + + +
{{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Sequence') }}{{ lang._('Description') }}{{ lang._('Commands') }}
+ + +
+
+
+ +{{ partial("layout_partials/base_dialog",['fields':formDialogFilterRule,'id':'DialogFilterRule','label':lang._('Edit rule')])}} From 09c84d7ceb4b2726d3f6eff651bea0ab41c1fc86 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 28 Feb 2020 16:14:29 +0100 Subject: [PATCH 0019/3088] firewall: add fields to model and mark todo's for https://github.com/opnsense/plugins/issues/1720 --- .../Firewall/forms/dialogFilterRule.xml | 90 ++++++++++++++++++ .../app/models/OPNsense/Firewall/Filter.xml | 95 +++++++++++++++++++ 2 files changed, 185 insertions(+) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml index 8f9b870571..6dfcb8ab12 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml @@ -10,6 +10,96 @@ text
+ + rule.action + + dropdown + Choose what to do with packets that match the criteria specified below. + Hint: the difference between block and reject is that with reject, a packet (TCP RST or ICMP port unreachable for UDP) is returned to the sender, whereas with block the packet is dropped silently. In either case, the original packet is discarded. + + + + rule.quick + + checkbox + + If a packet matches a rule specifying quick, then that rule is considered the last matching rule and the specified action is taken. + When a rule does not have quick enabled, the last matching rule wins. + + + + rule.interface + + select_multiple + + + rule.direction + + dropdown + + Direction of the traffic. The default policy is to filter inbound traffic, which sets the policy to the interface originally receiving the traffic. + + + + rule.ipprotocol + + dropdown + + + rule.protocol + + dropdown + + + rule.source_net + + text + + + rule.source_port + + text + true + Source port number or well known name (imap, imaps, http, https, ...), for ranges use a dash + + + rule.source_not + + checkbox + Use this option to invert the sense of the match. + + + rule.destination_net + + text + + + rule.destination_not + + checkbox + Use this option to invert the sense of the match. + + + rule.destination_port + + text + Destination port number or well known name (imap, imaps, http, https, ...), for ranges use a dash + + + rule.gateway + + dropdown + + Leave as 'default' to use the system routing table. Or choose a gateway to utilize policy based routing. + + + + rule.log + + checkbox + Log packets that are handled by this rule + + rule.description diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index ac824f219d..73469f9e53 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -17,6 +17,101 @@ Y 1 + + Y + pass + + Pass + Block + Reject + + + + 1 + Y + + + Y + Y + lan + + + Y + in + + In + Out + + + + Y + inet + + IPv4 + IPv6 + + + + + Y + any + + any + TCP + UDP + + + + + any + Y + + + 0 + Y + + + + N + Y + Y + Please specify a valid port number, range or known service name + + + + any + Y + + + 0 + Y + + + + N + Y + Y + Please specify a valid port number, range or known service name + + + N + interface gateways list + /tmp/gateway_list.json + 20 + Specify a valid gateway from the list matching the networks ip protocol. + + + 0 + Y + N /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u From 831e51855b54be46a7939e8f5125a63bdff77f7a Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 28 Feb 2020 17:15:16 +0100 Subject: [PATCH 0020/3088] firewall: switch protocol field for https://github.com/opnsense/plugins/issues/1720 --- .../mvc/app/models/OPNsense/Firewall/Filter.xml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index 73469f9e53..ef6ff5c469 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -51,17 +51,9 @@ IPv6 - - + Y any - - any - TCP - UDP - - + + any Y @@ -72,13 +69,9 @@ N Y Y - Please specify a valid port number, range or known service name - - + + any Y @@ -91,7 +84,6 @@ N Y Y - Please specify a valid port number, range or known service name N From 00e242f0683a44cf257573c39701a515f0f35e7d Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 3 Mar 2020 18:08:20 +0100 Subject: [PATCH 0022/3088] firewall: open dialog with uuid link, for https://github.com/opnsense/plugins/issues/1720 --- .../opnsense/mvc/app/models/OPNsense/Firewall/Filter.php | 1 - .../opnsense/mvc/app/views/OPNsense/Firewall/filter.volt | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php index 51390347c1..d474928636 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -78,7 +78,6 @@ public function performValidation($validateFullModel = false) $rule->source_net->__reference )); } - } } return $messages; diff --git a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt index beb717c6ca..5976c1cf2d 100644 --- a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt +++ b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt @@ -1,6 +1,6 @@ From 2ef75761fdf6867bccd4118d05683c0752bb4b59 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 4 Mar 2020 18:49:17 +0100 Subject: [PATCH 0023/3088] firewall: add custom ArrayField type to contain rules and add serializer to internal firewall format. Example usage: ``` $mdlFilter = new OPNsense\Firewall\Filter(); foreach ($mdlFilter->rules->rule->iterateItems() as $key => $rule) { print_r($rule->serialize()); } ``` for https://github.com/opnsense/plugins/issues/1720 --- .../Firewall/FieldTypes/FilterRuleField.php | 103 ++++++++++++++++++ .../app/models/OPNsense/Firewall/Filter.xml | 4 +- 2 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php new file mode 100644 index 0000000000..5f989c56cc --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php @@ -0,0 +1,103 @@ +iterateItems() as $key => $node) { + if (!in_array($key, $map_manual)) { + if (is_a($node, "OPNsense\\Base\\FieldTypes\\BooleanField")) { + $result[$key] = !empty((string)$node); + } else { + $result[$key] = (string)$node; + } + } + } + // source / destination mapping + $result['source'] = array(); + if (!empty((string)$this->source_net)) { + $result['source']['network'] = (string)$this->source_net; + $result['source']['not'] = !empty((string)$this->source_not); + if (!empty((string)$this->source_port)) { + $result['source']['port'] = (string)$this->source_port; + } + } + $result['destination'] = array(); + if (!empty((string)$this->destination_net)) { + $result['destination']['network'] = (string)$this->destination_net; + $result['destination']['not'] = !empty((string)$this->destination_not); + if (!empty((string)$this->source_port)) { + $result['destination']['port'] = (string)$this->destination_port; + } + } + // swap enabled + $result['disabled'] = empty((string)$this->enabled); + // + $result['descr'] = (string)$this->description; + $result['type'] = (string)$this->action; + return $result; + } +} + +/** + * Class FilterRuleField + * @package OPNsense\Firewall\FieldTypes + */ +class FilterRuleField extends ArrayField +{ + /** + * @inheritDoc + */ + public function newContainerField($ref, $tagname) + { + $container_node = new FilterRuleContainerField($ref, $tagname); + $parentmodel = $this->getParentModel(); + $container_node->setParentModel($parentmodel); + return $container_node; + } +} diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index 0404af5dd1..0c07fe8557 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -5,14 +5,14 @@ - + 1 Y 1 - 1000000 + 99999 provide a valid sequence for sorting Y 1 From 4d5aea8e63378f0c0f0e9224342446e5d0cb31a0 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 5 Mar 2020 15:10:23 +0100 Subject: [PATCH 0024/3088] firewall: add priority method similar to the legacy priority choices and allow dynamic type interfaces for https://github.com/opnsense/plugins/issues/1720 --- .../Firewall/FieldTypes/FilterRuleField.php | 28 +++++++++++++++++++ .../app/models/OPNsense/Firewall/Filter.xml | 1 + 2 files changed, 29 insertions(+) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php index 5f989c56cc..4a73c35fcf 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php @@ -30,6 +30,7 @@ namespace OPNsense\Firewall\FieldTypes; +use OPNsense\Core\Config; use OPNsense\Base\FieldTypes\ArrayField; use OPNsense\Base\FieldTypes\ContainerField; @@ -80,8 +81,35 @@ public function serialize() // $result['descr'] = (string)$this->description; $result['type'] = (string)$this->action; + if (strpos((string)$this->interface, ",") !== false) { + $result['floating'] = true; + } return $result; } + + /** + * rule priority is threaded equally to the legacy rules, first "floating" then groups and single interface + * rules are handled last + * @return int priority in the ruleset, sequence should determine sort order. + */ + public function getPriority() + { + $configObj = Config::getInstance()->object(); + $interface = (string)$this->interface; + if (strpos($interface, ",") !== false) { + // floating (multiple interfaces involved) + return 1000; + } elseif (!empty($configObj->interfaces) && + !empty($configObj->interfaces->$interface) && + !empty($configObj->interfaces->$interface->type) && + $configObj->interfaces->$interface->type == 'group') { + // group type + return 2000; + } else { + // default + return 3000; + } + } } /** diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index 0c07fe8557..0dcced43c2 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -34,6 +34,7 @@ Y Y lan + Y Y From 01543474a9ceb0ca8b5d79a11b0011dbcab3f527 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 5 Mar 2020 17:22:42 +0100 Subject: [PATCH 0025/3088] os-firewall: fix open with uuid (https://github.com/opnsense/plugins/issues/1720) --- .../src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt index 5976c1cf2d..213d54746b 100644 --- a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt +++ b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt @@ -12,7 +12,7 @@ // open edit dialog when opened with a uuid reference if (window.location.hash !== "" && window.location.hash.split("-").length >= 4) { grid.on('loaded.rs.jquery.bootgrid', function(){ - $(".command-edit:eq(0)").clone(true).data('row-id', window.location.hash).click(); + $(".command-edit:eq(0)").clone(true).data('row-id', window.location.hash.substr(1)).click(); }); } }); From 66e2b7a340ffd0345721f9b84dd938a8dc9d531e Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 5 Mar 2020 17:26:32 +0100 Subject: [PATCH 0026/3088] os-firewall: hook in rules and minor changes to FilterRuleField (https://github.com/opnsense/plugins/issues/1720) --- .../src/etc/inc/plugins.inc.d/pfplugin.inc | 41 +++++++++++++++++++ .../Firewall/FieldTypes/FilterRuleField.php | 7 +++- 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc diff --git a/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc b/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc new file mode 100644 index 0000000000..a9c1948066 --- /dev/null +++ b/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc @@ -0,0 +1,41 @@ +rules->rule->sortedBy(["sequence"]) as $key => $rule) { + $content = $rule->serialize(); + $content["#ref"] = "ui/firewall/filter#" . (string)$rule->getAttributes()['uuid']; + $fw->registerFilterRule($rule->getPriority(), $content); + } + } diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php index 4a73c35fcf..6556ae488e 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php @@ -54,6 +54,10 @@ public function serialize() if (!in_array($key, $map_manual)) { if (is_a($node, "OPNsense\\Base\\FieldTypes\\BooleanField")) { $result[$key] = !empty((string)$node); + } elseif (is_a($node, "OPNsense\\Base\\FieldTypes\\ProtocolField")) { + if ((string)$node != 'any') { + $result[$key] = (string)$node; + } } else { $result[$key] = (string)$node; } @@ -76,9 +80,8 @@ public function serialize() $result['destination']['port'] = (string)$this->destination_port; } } - // swap enabled + // field mappings and differences $result['disabled'] = empty((string)$this->enabled); - // $result['descr'] = (string)$this->description; $result['type'] = (string)$this->action; if (strpos((string)$this->interface, ",") !== false) { From 8d53eece0b855c40342d953570f6b255ce96bfcd Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 5 Mar 2020 17:39:28 +0100 Subject: [PATCH 0027/3088] os-firewall: only use uuid reference on initial load (https://github.com/opnsense/plugins/issues/1720) --- .../opnsense/mvc/app/views/OPNsense/Firewall/filter.volt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt index 213d54746b..fb9809b3a0 100644 --- a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt +++ b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt @@ -1,5 +1,6 @@ @@ -29,7 +31,7 @@
- +
@@ -51,6 +53,19 @@
{{ lang._('ID') }}
+
+ +
+ +

+
From 9f7954b24897ceb066f7757320deb22951a4eb6d Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 9 Mar 2020 18:40:24 +0100 Subject: [PATCH 0030/3088] os-firewall: add savepoint / revert actions including simple ui test calls for https://github.com/opnsense/plugins/issues/1720 --- .../Firewall/Api/FilterController.php | 34 ++++++++++++ .../app/models/OPNsense/Firewall/Filter.php | 23 ++++++++ .../app/views/OPNsense/Firewall/filter.volt | 53 +++++++++++++++++++ 3 files changed, 110 insertions(+) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php index d2ed30745c..4c06d3e392 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php @@ -29,6 +29,7 @@ use OPNsense\Base\ApiMutableModelControllerBase; use OPNsense\Core\Backend; +use OPNsense\Core\Config; class FilterController extends ApiMutableModelControllerBase { @@ -73,4 +74,37 @@ public function applyAction() return array("status" => "error"); } } + + public function savepointAction() + { + if ($this->request->isPost()) { + // trigger a save, so we know revision->time matches our running config + Config::getInstance()->save(); + return array( + "status" => "ok", + "retention" => (string)Config::getInstance()->backupCount(), + "revision" => (string)Config::getInstance()->object()->revision->time + ); + } else { + return array("status" => "error"); + } + } + + public function revertAction($revision) + { + if ($this->request->isPost()) { + Config::getInstance()->lock(); + $filename = Config::getInstance()->getBackupFilename($revision); + if (!$filename) { + Config::getInstance()->unlock(); + return ["status" => gettext("unknown (or removed) savepoint")]; + } + $this->getModel()->rollback($revision); + Config::getInstance()->unlock(); + (new Backend())->configdRun('filter reload'); + return ["status" => "ok"]; + } else { + return array("status" => "error"); + } + } } diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php index d474928636..5294bb4d44 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -28,6 +28,7 @@ namespace OPNsense\Firewall; +use OPNsense\Core\Config; use Phalcon\Validation\Message; use OPNsense\Base\BaseModel; use OPNsense\Firewall\Util; @@ -82,4 +83,26 @@ public function performValidation($validateFullModel = false) } return $messages; } + + /** + * Rollback this model to a previous version. + * Make sure to remove this object afterwards, since its contents won't be updated. + * @param $revision float|string revision number + */ + public function rollback($revision) + { + $filename = Config::getInstance()->getBackupFilename($revision); + if ($filename) { + // fiddle with the dom, copy OPNsense->Firewall->FilterRule from backup to current config + $sourcexml = simplexml_load_file($filename); + if ($sourcexml->OPNsense->Firewall->FilterRule) { + $sourcedom = dom_import_simplexml($sourcexml->OPNsense->Firewall->FilterRule); + $targetxml = Config::getInstance()->object(); + $targetdom = dom_import_simplexml($targetxml->OPNsense->Firewall->FilterRule); + $node = $targetdom->ownerDocument->importNode($sourcedom, TRUE); + $targetdom->parentNode->replaceChild($node, $targetdom); + Config::getInstance()->save(); + } + } + } } \ No newline at end of file diff --git a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt index 1e3389e9f9..e6191dba6b 100644 --- a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt +++ b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt @@ -21,6 +21,47 @@ } $("#reconfigureAct").SimpleActionButton(); + $("#savepointAct").SimpleActionButton({ + onAction: function(data, status){ + stdDialogInform( + "{{ lang._('Savepoint created') }}", + data['revision'], + "{{ lang._('Close') }}" + ); + } + }); + + $("#revertAction").on('click', function(){ + BootstrapDialog.show({ + type: BootstrapDialog.TYPE_DEFAULT, + title: "{{ lang._('Revert to savepoint') }}", + message: "

{{ lang._('Enter a savepoint to rollback to.') }}

" + + '
' + + '' + + ''+ + '
', + buttons: [{ + label: "{{ lang._('Revert') }}", + cssClass: 'btn-primary', + action: function(dialogRef) { + ajaxCall("/api/firewall/filter/revert/" + $("#revertToTime").val(), {}, function (data, status) { + if (data.status !== "ok") { + $("#revertToTime").parent().addClass("has-error"); + $("#revertToTimeError").html(data.status); + } else { + std_bootgrid_reload("grid-rules"); + dialogRef.close(); + } + }); + } + }], + onshown: function(dialogRef) { + $("#revertToTime").parent().removeClass("has-error"); + $("#revertToTimeError").html(""); + $("#revertToTime").val(""); + } + }); + }); }); @@ -64,6 +105,18 @@ data-error-title="{{ lang._('Filter load error') }}" type="button" > + +
+ + +


From 1652bc6935b2210c6283d475e21483a95e4e3577 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 10 Mar 2020 14:48:10 +0100 Subject: [PATCH 0031/3088] os-firewall: add support for "cancelation tokens" apply endpoint can request a rollback point, which will be reverted to if there's no call on cancelRollback with the same timestamp within 60 seconds. for https://github.com/opnsense/plugins/issues/1720 --- .../Firewall/Api/FilterController.php | 15 +++++- .../app/models/OPNsense/Firewall/Filter.php | 5 +- .../opnsense/scripts/pfplugin/rollback_cancel | 40 ++++++++++++++ .../opnsense/scripts/pfplugin/rollback_timer | 54 +++++++++++++++++++ .../conf/actions.d/actions_pfplugin.conf | 11 ++++ 5 files changed, 123 insertions(+), 2 deletions(-) create mode 100755 net/firewall/src/opnsense/scripts/pfplugin/rollback_cancel create mode 100755 net/firewall/src/opnsense/scripts/pfplugin/rollback_timer create mode 100644 net/firewall/src/opnsense/service/conf/actions.d/actions_pfplugin.conf diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php index 4c06d3e392..62116a88de 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php @@ -66,15 +66,28 @@ public function toggleItemAction($uuid, $enabled = null) return $this->toggleBase("rules.rule", $uuid, $enabled); } - public function applyAction() + public function applyAction($rollback_revision = null) { if ($this->request->isPost()) { + if ($rollback_revision != null) { + // background rollback timer + (new Backend())->configdpRun('pfplugin rollback_timer', [$rollback_revision], true); + } return array("status" => (new Backend())->configdRun('filter reload')); } else { return array("status" => "error"); } } + public function cancelRollbackAction($rollback_revision) + { + if ($this->request->isPost()) { + return array("status" => (new Backend())->configdpRun('pfplugin cancel_rollback', [$rollback_revision])); + } else { + return array("status" => "error"); + } + } + public function savepointAction() { if ($this->request->isPost()) { diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php index 5294bb4d44..ccaa644ed8 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -88,6 +88,7 @@ public function performValidation($validateFullModel = false) * Rollback this model to a previous version. * Make sure to remove this object afterwards, since its contents won't be updated. * @param $revision float|string revision number + * @return bool action performed (backup revision existed) */ public function rollback($revision) { @@ -102,7 +103,9 @@ public function rollback($revision) $node = $targetdom->ownerDocument->importNode($sourcedom, TRUE); $targetdom->parentNode->replaceChild($node, $targetdom); Config::getInstance()->save(); + return true; } } + return false; } -} \ No newline at end of file +} diff --git a/net/firewall/src/opnsense/scripts/pfplugin/rollback_cancel b/net/firewall/src/opnsense/scripts/pfplugin/rollback_cancel new file mode 100755 index 0000000000..c47f74b074 --- /dev/null +++ b/net/firewall/src/opnsense/scripts/pfplugin/rollback_cancel @@ -0,0 +1,40 @@ +#!/usr/local/bin/php += 2) { + $revision = preg_replace("/[^0-9.]/", "", $argv[1]); + if (!empty($revision)) { + $lckfile = "/tmp/pfplugin_{$revision}.lock"; + if (file_exists($lckfile)) { + unlink($lckfile); + exit(0); + } + } +} +exit(1); diff --git a/net/firewall/src/opnsense/scripts/pfplugin/rollback_timer b/net/firewall/src/opnsense/scripts/pfplugin/rollback_timer new file mode 100755 index 0000000000..819a1f12cf --- /dev/null +++ b/net/firewall/src/opnsense/scripts/pfplugin/rollback_timer @@ -0,0 +1,54 @@ +#!/usr/local/bin/php += 2) { + $revision = preg_replace("/[^0-9.]/", "", $argv[1]); + if (!empty($revision)) { + $lckfile = "/tmp/pfplugin_{$revision}.lock"; + file_put_contents($lckfile, ""); + // give the api 60 seconds to callback + for ($i=0; $i < 60 ; ++$i) { + if (!file_exists($lckfile)) { + // got feedback + exit(0); + } + sleep(1); + } + @unlink($lckfile); + // no feedback, revert + $mdlFilter = new OPNsense\Firewall\Filter(); + if ($mdlFilter->rollback($revision)) { + (new OPNsense\Core\Backend())->configdRun('filter reload'); + } else { + syslog(LOG_WARNING, "unable to revert to unexisting revision : {$revision}"); + } + } +} diff --git a/net/firewall/src/opnsense/service/conf/actions.d/actions_pfplugin.conf b/net/firewall/src/opnsense/service/conf/actions.d/actions_pfplugin.conf new file mode 100644 index 0000000000..61a13f477a --- /dev/null +++ b/net/firewall/src/opnsense/service/conf/actions.d/actions_pfplugin.conf @@ -0,0 +1,11 @@ +[rollback_timer] +command:/usr/local/bin/flock -n -E 0 -o /tmp/pfplugin_rollback_timer.lock /usr/local/opnsense/scripts/pfplugin/rollback_timer +parameters: %s +type:script +message:wait for api feedback or revert to previous filter plugin config + +[cancel_rollback] +command: /usr/local/opnsense/scripts/pfplugin/rollback_cancel +parameters: %s +type:script_output +message:cancel pfplugin rollback From cf05d85eb3351b48583589484f507ca6de4e7288 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 Mar 2020 15:24:26 +0100 Subject: [PATCH 0032/3088] net/firewall: sync --- LICENSE | 2 +- README.md | 1 + .../mvc/app/controllers/OPNsense/Firewall/FilterController.php | 2 +- .../controllers/OPNsense/Firewall/forms/dialogFilterRule.xml | 2 +- .../src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 0b7a99dd6c..b47b3f8908 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ Copyright (c) 2019 Cloudfence - Julio Camargo (JCC) Copyright (c) 2005-2006 Colin Smith Copyright (c) 2011 Dan Myers Copyright (c) 2017-2018 David Harrigan -Copyright (c) 2014-2019 Deciso B.V. +Copyright (c) 2014-2020 Deciso B.V. Copyright (c) 2008 Donovan Schonknecht Copyright (c) 2016-2019 EURO-LOG AG Copyright (c) 2006 Eric Friesen diff --git a/README.md b/README.md index 5464e9a951..71e43f862f 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ net-mgmt/nrpe -- Execute nagios plugins net-mgmt/telegraf -- Agent for collecting metrics and data net-mgmt/zabbix-agent -- Zabbix monitoring agent net-mgmt/zabbix4-proxy -- Zabbix Proxy enables decentralized monitoring +net/firewall -- Firewall API supplemental package net/freeradius -- RADIUS Authentication, Authorization and Accounting Server net/frr -- The FRRouting Protocol Suite net/ftp-proxy -- Control ftp-proxy processes diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php index f236de95fe..789f32a499 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php @@ -35,4 +35,4 @@ public function indexAction() $this->view->pick('OPNsense/Firewall/filter'); $this->view->formDialogFilterRule = $this->getForm("dialogFilterRule"); } -} \ No newline at end of file +} diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml index 6dfcb8ab12..f299cc1c42 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml @@ -105,4 +105,4 @@ text
- \ No newline at end of file + diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index 0dcced43c2..3e4ac83737 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -105,4 +105,4 @@ - \ No newline at end of file + From 8609dfb8e8c124ef20f0ad82cfb7e552af57c34c Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 11 Mar 2020 12:36:29 +0100 Subject: [PATCH 0033/3088] os-firewall: rename endpoints for https://github.com/opnsense/plugins/issues/1720 --- .../OPNsense/Firewall/Api/FilterController.php | 12 ++++++------ .../mvc/app/views/OPNsense/Firewall/filter.volt | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php index 62116a88de..8bc560b126 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php @@ -36,32 +36,32 @@ class FilterController extends ApiMutableModelControllerBase protected static $internalModelName = 'filter'; protected static $internalModelClass = 'OPNsense\Firewall\Filter'; - public function searchItemAction() + public function searchRuleAction() { return $this->searchBase("rules.rule", array('enabled', 'sequence', 'description'), "sequence"); } - public function setItemAction($uuid) + public function setRuleAction($uuid) { return $this->setBase("rule", "rules.rule", $uuid); } - public function addItemAction() + public function addRuleAction() { return $this->addBase("rule", "rules.rule"); } - public function getItemAction($uuid = null) + public function getRuleAction($uuid = null) { return $this->getBase("rule", "rules.rule", $uuid); } - public function delItemAction($uuid) + public function delRuleAction($uuid) { return $this->delBase("rules.rule", $uuid); } - public function toggleItemAction($uuid, $enabled = null) + public function toggleRuleAction($uuid, $enabled = null) { return $this->toggleBase("rules.rule", $uuid, $enabled); } diff --git a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt index e6191dba6b..b498372440 100644 --- a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt +++ b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt @@ -2,12 +2,12 @@ $( document ).ready(function() { let initial_load = true; let grid = $("#grid-rules").UIBootgrid({ - search:'/api/firewall/filter/searchItem/', - get:'/api/firewall/filter/getItem/', - set:'/api/firewall/filter/setItem/', - add:'/api/firewall/filter/addItem/', - del:'/api/firewall/filter/delItem/', - toggle:'/api/firewall/filter/toggleItem/' + search:'/api/firewall/filter/searchRule/', + get:'/api/firewall/filter/getRule/', + set:'/api/firewall/filter/setRule/', + add:'/api/firewall/filter/addRule/', + del:'/api/firewall/filter/delRule/', + toggle:'/api/firewall/filter/toggleRule/' }); // open edit dialog when opened with a uuid reference From 64f3ed99e88493412c97b75dd78493beb1f6781e Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 11 Mar 2020 17:29:46 +0100 Subject: [PATCH 0034/3088] os-firewall: style cleanup for https://github.com/opnsense/plugins/issues/1720 --- .../controllers/OPNsense/Firewall/Api/FilterController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php index 8bc560b126..2ab47ee699 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php @@ -82,7 +82,9 @@ public function applyAction($rollback_revision = null) public function cancelRollbackAction($rollback_revision) { if ($this->request->isPost()) { - return array("status" => (new Backend())->configdpRun('pfplugin cancel_rollback', [$rollback_revision])); + return array( + "status" => (new Backend())->configdpRun('pfplugin cancel_rollback', [$rollback_revision]) + ); } else { return array("status" => "error"); } From f2baaedd11e78259b977c133255bb18e3766c57b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 12 Mar 2020 10:47:49 +0100 Subject: [PATCH 0035/3088] os-firewall: parse error on invert options. "not" is treated being set or unset in core. https://github.com/opnsense/plugins/issues/1720 --- .../OPNsense/Firewall/FieldTypes/FilterRuleField.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php index 6556ae488e..06afc60f63 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php @@ -67,7 +67,9 @@ public function serialize() $result['source'] = array(); if (!empty((string)$this->source_net)) { $result['source']['network'] = (string)$this->source_net; - $result['source']['not'] = !empty((string)$this->source_not); + if (!empty((string)$this->source_not)) { + $result['source']['not'] = true; + } if (!empty((string)$this->source_port)) { $result['source']['port'] = (string)$this->source_port; } @@ -75,7 +77,9 @@ public function serialize() $result['destination'] = array(); if (!empty((string)$this->destination_net)) { $result['destination']['network'] = (string)$this->destination_net; - $result['destination']['not'] = !empty((string)$this->destination_not); + if (!empty((string)$this->destination_not)) { + $result['destination']['not'] = true; + } if (!empty((string)$this->source_port)) { $result['destination']['port'] = (string)$this->destination_port; } From b4cb311bdba45574443897875abb3bbae23169ba Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 13 Mar 2020 08:12:16 +0100 Subject: [PATCH 0036/3088] net/tayga: bugfixes for TUN interface and Tayga IPv6 addresses (#1738) --- net/tayga/src/etc/rc.d/opnsense-tayga | 2 +- net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga | 1 + .../src/opnsense/service/templates/OPNsense/Tayga/tayga.conf | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/net/tayga/src/etc/rc.d/opnsense-tayga b/net/tayga/src/etc/rc.d/opnsense-tayga index 0bc0834d74..d86a7dca3e 100755 --- a/net/tayga/src/etc/rc.d/opnsense-tayga +++ b/net/tayga/src/etc/rc.d/opnsense-tayga @@ -28,7 +28,7 @@ tayga_start() ${command} ${command_args} sleep 1 ifconfig nat64 inet ${tayga_v4destination}/32 ${tayga_v4address} - ifconfig nat64 inet6 ${tayga_v6estination}/128 + ifconfig nat64 inet6 ${tayga_v6destination}/128 route -6 add ${tayga_v6prefix} -interface nat64 route -4 add ${tayga_v4pool} -interface nat64 } diff --git a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga index cc5d8c68c1..c84c7881d7 100644 --- a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga +++ b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga @@ -6,6 +6,7 @@ tayga_v4destination={{ OPNsense.tayga.general.v4destination }} tayga_v4pool={{ OPNsense.tayga.general.v4pool }} tayga_v6prefix={{ OPNsense.tayga.general.v6prefix }} tayga_v6address={{ OPNsense.tayga.general.v6address }} +tayga_v6destination={{ OPNsense.tayga.general.v6destination }} {% else %} tayga_enable="NO" {% endif %} diff --git a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga.conf b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga.conf index ae027a4074..2c8a3bd580 100644 --- a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga.conf +++ b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga.conf @@ -4,7 +4,9 @@ tun-device nat64 data-dir /var/db/tayga ipv4-addr {{ OPNsense.tayga.general.v4address }} +{% if helpers.exists('OPNsense.tayga.general.v6address') and OPNsense.tayga.general.v6address != '' %} ipv6-addr {{ OPNsense.tayga.general.v6address }} +{% endif %} prefix {{ OPNsense.tayga.general.v6prefix }} dynamic-pool {{ OPNsense.tayga.general.v4pool }} From b7497011938f926433082e2ab5b1e7521813b728 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 13 Mar 2020 08:27:10 +0100 Subject: [PATCH 0037/3088] net: style sweep --- .../src/etc/inc/plugins.inc.d/pfplugin.inc | 18 +++++++++--------- .../OPNsense/Firewall/FilterController.php | 1 - .../Firewall/FieldTypes/FilterRuleField.php | 6 ++++-- .../app/models/OPNsense/Firewall/Filter.php | 8 ++++---- .../mvc/app/models/OPNsense/Tayga/General.xml | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc b/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc index a9c1948066..8f68a6b131 100644 --- a/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc +++ b/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc @@ -30,12 +30,12 @@ /** * @param $fw */ - function pfplugin_firewall($fw) - { - $mdlFilter = new OPNsense\Firewall\Filter(); - foreach ($mdlFilter->rules->rule->sortedBy(["sequence"]) as $key => $rule) { - $content = $rule->serialize(); - $content["#ref"] = "ui/firewall/filter#" . (string)$rule->getAttributes()['uuid']; - $fw->registerFilterRule($rule->getPriority(), $content); - } - } +function pfplugin_firewall($fw) +{ + $mdlFilter = new OPNsense\Firewall\Filter(); + foreach ($mdlFilter->rules->rule->sortedBy(["sequence"]) as $key => $rule) { + $content = $rule->serialize(); + $content["#ref"] = "ui/firewall/filter#" . (string)$rule->getAttributes()['uuid']; + $fw->registerFilterRule($rule->getPriority(), $content); + } +} diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php index 789f32a499..a3b711e8f5 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php @@ -27,7 +27,6 @@ */ namespace OPNsense\Firewall; - class FilterController extends \OPNsense\Base\IndexController { public function indexAction() diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php index 06afc60f63..e49d452d6e 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php @@ -106,10 +106,12 @@ public function getPriority() if (strpos($interface, ",") !== false) { // floating (multiple interfaces involved) return 1000; - } elseif (!empty($configObj->interfaces) && + } elseif ( + !empty($configObj->interfaces) && !empty($configObj->interfaces->$interface) && !empty($configObj->interfaces->$interface->type) && - $configObj->interfaces->$interface->type == 'group') { + $configObj->interfaces->$interface->type == 'group' + ) { // group type return 2000; } else { diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php index ccaa644ed8..90cf019d95 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -45,18 +45,18 @@ public function performValidation($validateFullModel = false) foreach ($this->rules->rule->iterateItems() as $rule) { // validate changed rules $rule_changed = false; - foreach($rule->iterateItems() as $field) { + foreach ($rule->iterateItems() as $field) { $rule_changed = $rule_changed ? $rule_changed : $field->isFieldChanged(); } if ($validateFullModel || $rule_changed) { // port / protocol validation - if (!empty((string)$rule->source_port) && !in_array( $rule->protocol, ['TCP', 'UDP'])) { + if (!empty((string)$rule->source_port) && !in_array($rule->protocol, ['TCP', 'UDP'])) { $messages->appendMessage(new Message( gettext("Source ports are only valid for tcp or udp type rules."), $rule->source_port->__reference )); } - if (!empty((string)$rule->destination_port) && !in_array( $rule->protocol, ['TCP', 'UDP'])) { + if (!empty((string)$rule->destination_port) && !in_array($rule->protocol, ['TCP', 'UDP'])) { $messages->appendMessage(new Message( gettext("Destination ports are only valid for tcp or udp type rules."), $rule->destination_port->__reference @@ -100,7 +100,7 @@ public function rollback($revision) $sourcedom = dom_import_simplexml($sourcexml->OPNsense->Firewall->FilterRule); $targetxml = Config::getInstance()->object(); $targetdom = dom_import_simplexml($targetxml->OPNsense->Firewall->FilterRule); - $node = $targetdom->ownerDocument->importNode($sourcedom, TRUE); + $node = $targetdom->ownerDocument->importNode($sourcedom, true); $targetdom->parentNode->replaceChild($node, $targetdom); Config::getInstance()->save(); return true; diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml index 63fdb0c3dd..8ce7919d6d 100644 --- a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml @@ -21,7 +21,7 @@ 2001:db8:1:ffff::1 Y - + 2001:db8:1:ffff::/96 Y From 5ec04f9e54b6e4413983a50b561943ee122ae410 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 13 Mar 2020 16:54:23 +0100 Subject: [PATCH 0038/3088] os-firewall: fix typo in https://github.com/opnsense/plugins/issues/1720 leading to missing destination ports --- .../app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php index e49d452d6e..70996125ed 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/FilterRuleField.php @@ -80,7 +80,7 @@ public function serialize() if (!empty((string)$this->destination_not)) { $result['destination']['not'] = true; } - if (!empty((string)$this->source_port)) { + if (!empty((string)$this->destination_port)) { $result['destination']['port'] = (string)$this->destination_port; } } From a5ecf3c098aa04c118f23f151756afef0e1e0bef Mon Sep 17 00:00:00 2001 From: Mikael Falkvidd Date: Mon, 16 Mar 2020 10:38:02 +0100 Subject: [PATCH 0039/3088] net/wol: add validation message + support for uppercase hex (#1741) --- net/wol/src/opnsense/mvc/app/models/OPNsense/Wol/Wol.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wol/src/opnsense/mvc/app/models/OPNsense/Wol/Wol.xml b/net/wol/src/opnsense/mvc/app/models/OPNsense/Wol/Wol.xml index 544b6c147f..d4fb195305 100644 --- a/net/wol/src/opnsense/mvc/app/models/OPNsense/Wol/Wol.xml +++ b/net/wol/src/opnsense/mvc/app/models/OPNsense/Wol/Wol.xml @@ -15,8 +15,9 @@ Y N - /^((?:[a-f0-9]{2}:){5}(?:[a-f0-9]{2}))$/ + /^((?:[a-fA-F0-9]{2}:){5}(?:[a-fA-F0-9]{2}))$/ 00:00:00:00:00:00 + Should be 6 groups of 2 hex characters (a-fA-F0-9) separated by ':' N From 4e1c83bf8fe78bdb4e24edf58f4b9a559da88079 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 17 Mar 2020 23:36:44 -0500 Subject: [PATCH 0040/3088] Update Github Link to Reflect Repo rename Updated Github Web Link to Reflect Github Repository rebrand/rename from: https://github.com/Neilpang/acme.sh to https://github.com/acmesh-official/acme.sh --- security/acme-client/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index f99ecd5da6..78dc22cf21 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -3,4 +3,4 @@ acme.sh project. Acording to the authors, it's probably "the easiest and smallest and smartest shell script" to automatically issue and renew the free certificates from Let's Encrypt. -WWW: https://github.com/Neilpang/acme.sh +WWW: https://github.com/acmesh-official/acme.sh From 25a124a8f1091386e7ff89d914b1df0c41f10eb4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 18 Mar 2020 07:45:52 +0100 Subject: [PATCH 0041/3088] net/firewall: prep for first dev release --- net/firewall/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/firewall/Makefile b/net/firewall/Makefile index 3f314e675d..bf15b18205 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -1,6 +1,7 @@ PLUGIN_NAME= firewall PLUGIN_VERSION= 0.1 -PLUGIN_COMMENT= Firewall API supplemental package +PLUGIN_COMMENT= Firewall API supplemental package PLUGIN_MAINTAINER= ad@opnsense.org +PLUGIN_DEVEL= yes .include "../../Mk/plugins.mk" From 15b5864828dcb54a3afdfdf61bef54fba9ea65c1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 18 Mar 2020 08:04:24 +0100 Subject: [PATCH 0042/3088] security/acme-client: bump revision for minor release --- security/acme-client/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index d3fbada38b..86732ea088 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= acme-client PLUGIN_VERSION= 1.29 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From a91c65f2fe4bdb6beeb5b44e27e0dfaa110ada75 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 18 Mar 2020 08:11:52 +0100 Subject: [PATCH 0043/3088] net/wol: bump revision --- net/wol/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wol/Makefile b/net/wol/Makefile index 87e6d0c593..e4184ba927 100644 --- a/net/wol/Makefile +++ b/net/wol/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wol PLUGIN_VERSION= 2.2 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= wol PLUGIN_COMMENT= Wake on LAN Service PLUGIN_MAINTAINER= franco@opnsense.org From 3254979038832f742d35b2a9ccb9e34ed92ff2eb Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 18 Mar 2020 19:43:35 +0100 Subject: [PATCH 0044/3088] www/nginx: add NAXSI rule ID to volt (#1737) * Update Makefile * Update pkg-descr * Update SettingsController.php * Update index.volt --- www/nginx/Makefile | 2 +- www/nginx/pkg-descr | 4 ++++ .../app/controllers/OPNsense/Nginx/Api/SettingsController.php | 2 +- .../src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 283a6d312f..ae386bc6cb 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.18 +PLUGIN_VERSION= 1.19 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 6855dab0ca..a23083ed2a 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -8,6 +8,10 @@ reuse, SSL offload and HTTP media streaming. Plugin Changelog ================ +1.19 + +* Display NAXSI rule ID in volt + 1.18 * Add proxy header for CloudFlare diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php index ffaf56d35f..4bec574e9e 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php @@ -266,7 +266,7 @@ public function setstreamserverAction($uuid) // naxsi rules public function searchnaxsiruleAction() { - return $this->searchBase('naxsi_rule', array('description', 'ruletype', 'message')); + return $this->searchBase('naxsi_rule', array('description', 'identifier', 'ruletype', 'message')); } public function getnaxsiruleAction($uuid = null) diff --git a/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt b/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt index e95fbaf3d1..b46e20485d 100644 --- a/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt +++ b/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt @@ -439,6 +439,7 @@ {{ lang._('Description') }} {{ lang._('Rule Type') }} + {{ lang._('ID') }} {{ lang._('Message') }} {{ lang._('Commands') }} From b706df5e97a66a6629e8566a1ce88f22bc9c94ea Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 19 Mar 2020 11:05:26 +0100 Subject: [PATCH 0045/3088] dns/bind: update plugin to version 9.16 (#1746) --- dns/bind/Makefile | 4 ++-- dns/bind/pkg-descr | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 3b6ed1adc2..0cf5b7689e 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.12 +PLUGIN_VERSION= 1.13 PLUGIN_COMMENT= BIND domain name service -PLUGIN_DEPENDS= bind914 +PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index bb0f46fb27..99d74dce55 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -8,6 +8,10 @@ necessary for asking and answering name service questions. Plugin Changelog ================ +1.13 + +* Update BIND to 9.16 + 1.12 * Add checkbox to disable prefetch option From 0186f548f8d116ce171179f602a659cd14211ae4 Mon Sep 17 00:00:00 2001 From: Fabian Franz BSc Date: Sun, 22 Mar 2020 11:02:45 +0100 Subject: [PATCH 0046/3088] www/nginx: SNI proxying (#1747) --- www/nginx/pkg-descr | 1 + .../app/controllers/OPNsense/Nginx/forms/location.xml | 7 +++++++ .../src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml | 6 +++++- .../service/templates/OPNsense/Nginx/location.conf | 9 +++++++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index a23083ed2a..71fe052e54 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -10,6 +10,7 @@ Plugin Changelog 1.19 +* Add possibility to configure SNI proxying. * Display NAXSI rule ID in volt 1.18 diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml index b4b76dd605..05adce9381 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml @@ -242,6 +242,13 @@ true Enter a custom timout between data received from the client after which the connection is closed. + + location.proxy_ssl_server_name + + checkbox + true + Check this box, if you want the client SNI header to be used instead of your backend hostname. This settings overrides the configured hostname in the upstream configuration. + location.proxy_buffer_size diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index 06a471a39b..f81fbcdcf6 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -1,6 +1,6 @@ //OPNsense/Nginx - 1.17.0 + 1.19.0 nginx web server, reverse proxy and waf @@ -460,6 +460,10 @@ N 0 + + Y + 0 + diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf index 197cde8ceb..b4482c5370 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf @@ -174,9 +174,14 @@ location {{ location.matchtype }} {{ location.urlpattern }} { proxy_ssl_certificate_key /usr/local/etc/nginx/key/{{ upstream.tls_client_certificate }}.key; proxy_ssl_certificate /usr/local/etc/nginx/key/{{ upstream.tls_client_certificate }}.pem; {% endif %} -{% if upstream.tls_name_override is defined and upstream.tls_name_override != '' %} +{% if location.proxy_ssl_server_name is defined and location.proxy_ssl_server_name == '1' %} + proxy_ssl_server_name on; +{% else %} + proxy_ssl_server_name off; +{% if upstream.tls_name_override is defined and upstream.tls_name_override != '' %} proxy_ssl_name {{ upstream.tls_name_override }}; -{% endif %} +{% endif %} +{% endif%} {% if upstream.tls_protocol_versions is defined and upstream.tls_protocol_versions != '' %} proxy_ssl_protocols {{ upstream.tls_protocol_versions.replace(',', ' ') }}; {% endif %} From f9e8a166d736be45bcd3d992f54118ad05580109 Mon Sep 17 00:00:00 2001 From: Johann Richard <189003+johannrichard@users.noreply.github.com> Date: Sun, 22 Mar 2020 19:51:53 +0100 Subject: [PATCH 0047/3088] Add usernames for admin and monitor users to help Add the correct usernames for the two users with `admin` and `monitoring` rights in the help text. --- .../mvc/app/controllers/OPNsense/Nut/forms/settings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml b/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml index d581b2c179..444cb42a59 100644 --- a/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml +++ b/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml @@ -33,13 +33,13 @@ nut.account.admin_password text - Set the admin password. + Set the password for admin user "admin". nut.account.mon_password text - Set the monitor password. + Set the password for monitoring user "monuser". From 1c952b3f7ca2baae8712fdee0fa23116f9fe6676 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 25 Mar 2020 15:14:08 +0100 Subject: [PATCH 0048/3088] os-firewall: move mountpoint for https://github.com/opnsense/plugins/issues/1749 It's probably better to keep (filter)rules and source nat rules combined, so we can stick to the same rollback pattern and guarantee a consistent set when performing a rollback. --- .../app/models/OPNsense/Firewall/Filter.xml | 4 +- .../OPNsense/Firewall/Migrations/MFP1_0_0.php | 57 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index 3e4ac83737..378926025b 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -1,5 +1,7 @@ - //OPNsense/Firewall/FilterRule + //OPNsense/Firewall/Filter + 1.0.0 + MFP OPNsense firewall filter rules diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php new file mode 100644 index 0000000000..d6118f1e51 --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php @@ -0,0 +1,57 @@ +Firewall->FilterRule ---> OPNsense->Firewall->Filter + $cfgObj = Config::getInstance()->object(); + if (!empty($cfgObj->OPNsense) && !empty($cfgObj->OPNsense->Firewall) + && !empty($cfgObj->OPNsense->Firewall->FilterRule)) { + // model migration created a new, empty rules section + if (empty($cfgObj->OPNsense->Firewall->Filter->rules)) { + unset($cfgObj->OPNsense->Firewall->Filter->rules); + $targetdom = dom_import_simplexml($cfgObj->OPNsense->Firewall->Filter); + foreach ($cfgObj->OPNsense->Firewall->FilterRule->children() as $child) { + $sourcedom = dom_import_simplexml($child); + $targetdom->appendChild($sourcedom); + } + unset($cfgObj->OPNsense->Firewall->FilterRule); + Config::getInstance()->save(); + } + } + } +} \ No newline at end of file From 53ac1c7e60c2ae66ab668a285efb5914e56ee10c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 27 Mar 2020 09:50:23 +0100 Subject: [PATCH 0049/3088] dns/unbound-plus: ready for release --- dns/unbound-plus/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dns/unbound-plus/Makefile b/dns/unbound-plus/Makefile index 1d12ddf601..e49cf95d91 100644 --- a/dns/unbound-plus/Makefile +++ b/dns/unbound-plus/Makefile @@ -1,7 +1,6 @@ PLUGIN_NAME= unbound-plus -PLUGIN_VERSION= 0.5 +PLUGIN_VERSION= 1.0 PLUGIN_COMMENT= Unbound additions PLUGIN_MAINTAINER= m.muenz@gmail.com -PLUGIN_DEVEL= yes .include "../../Mk/plugins.mk" From 5e760e16960159d9d8943bc87b65d278031a4647 Mon Sep 17 00:00:00 2001 From: Bjorn Peeters Date: Sat, 28 Mar 2020 12:54:40 +0100 Subject: [PATCH 0050/3088] letsencrypt/upload_sftp add export of fullchain.pem --- .../opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php index 70c62cdf72..8f3a80a74a 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php @@ -66,7 +66,7 @@ "options" => [ "host::", "port::", "host-key::", "user::", "identity-type::", "remote-path::", "certificates::", "files::", "chgrp::", "chmod::", "chmod-key::", - "cert-name::", "key-name::", "ca-name::"], + "cert-name::", "key-name::", "ca-name::", "fullchain-name::"], "implementation" => "commandUpload", "default" => true, ], @@ -119,6 +119,8 @@ "cert" => ["default" => "{{name}}/cert.pem", "option" => "cert-name"], "key" => ["default" => "{{name}}/key.pem", "option" => "key-name"], "ca" => ["default" => "{{name}}/ca.pem", "option" => "ca-name"], + "fullchain" => ["default" => "{{name}}/fullchain.pem", "option" => "fullchain-name"], + ]; // Exit codes @@ -420,6 +422,7 @@ function getOptionsById($automation_id, $silent = false) "cert-name" => trim((string)$action->sftp_filename_cert), "key-name" => trim((string)$action->sftp_filename_key), "ca-name" => trim((string)$action->sftp_filename_ca), + "fullchain-name" => trim((string)$action->sftp_filename_fullchain), "certificates" => "", // defaults to all (= empty), may be overridden via CLI ]; } elseif (!$silent) { @@ -582,6 +585,8 @@ function exportCertificates(array $cert_refids) if (!empty((string)$cert->caref)) { $cert = (array)$cert; $item["ca"] = ca_chain($cert); + // combine files to export a fullchain.pem + $item["fullchain"] = $item["cert"].$item["ca"]; } $result[$refid] = $item; } From 05a4ff8a0c6dd9d8ebbe720668bf318e02305ea0 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 30 Mar 2020 13:00:00 +0200 Subject: [PATCH 0051/3088] security/acme-client: style fixes, refs #1753 --- .../src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php index 8f3a80a74a..b18596edc4 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php @@ -585,8 +585,8 @@ function exportCertificates(array $cert_refids) if (!empty((string)$cert->caref)) { $cert = (array)$cert; $item["ca"] = ca_chain($cert); - // combine files to export a fullchain.pem - $item["fullchain"] = $item["cert"].$item["ca"]; + // combine files to export a fullchain.pem + $item["fullchain"] = $item["cert"] . $item["ca"]; } $result[$refid] = $item; } From f1042b463bade3290dbb7e0e3eaf25227e58c1c8 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 30 Mar 2020 13:00:29 +0200 Subject: [PATCH 0052/3088] security/acme-client: bump bersion --- security/acme-client/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 86732ea088..b7b4b5cf0f 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 1.29 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.30 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From df5934d4d29b42a44f6b7026d9c743c67961a0c0 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 30 Mar 2020 14:24:17 +0200 Subject: [PATCH 0053/3088] net/haproxy: override "graceful" restart if required, fixes #1745 --- .../src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh index 3ade2075d4..017581fc6c 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh @@ -19,6 +19,13 @@ reload) rcprefix="hard" fi ;; +restart) + # The RC script always performs a "graceful" stop when using the + # "restart" command. This behaviour cannot be altered. So we have to + # manually perform a "hardstop" now. + if [ "${haproxy_hardstop}" == "YES" ]; then + /usr/local/etc/rc.d/haproxy hardstop + fi esac /usr/local/etc/rc.d/haproxy ${rcprefix}${1} From 78bf26c045f7e092dd2c9338cba1745e84c6c3e2 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 30 Mar 2020 14:35:50 +0200 Subject: [PATCH 0054/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 2ed4ea9f88..eee2f29f11 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 2.20 +PLUGIN_VERSION= 2.21 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de From 98362e395ed0769a5278a5324ab763073bde3c9e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 30 Mar 2020 15:20:05 +0200 Subject: [PATCH 0055/3088] net/tayga: ready for release --- net/tayga/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/tayga/Makefile b/net/tayga/Makefile index f57fd502f9..b499deb846 100644 --- a/net/tayga/Makefile +++ b/net/tayga/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= tayga -PLUGIN_VERSION= 0.2 -PLUGIN_DEVEL= yes +PLUGIN_VERSION= 1.0 PLUGIN_COMMENT= Tayga IPv6 64NAT PLUGIN_DEPENDS= tayga PLUGIN_MAINTAINER= m.muenz@gmail.com From cbd04067d127b8ad6b2b5dfe97bf6972e1155b4a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 30 Mar 2020 15:28:35 +0200 Subject: [PATCH 0056/3088] net/firewall: whitespace sweep --- .../mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php index d6118f1e51..d3db9e86f2 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php @@ -54,4 +54,4 @@ public function post($model) } } } -} \ No newline at end of file +} From 13978ece6478442f7b2da76c1080492034bbdec7 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 30 Mar 2020 19:00:01 +0200 Subject: [PATCH 0057/3088] os-firewall: initial wireframe for https://github.com/opnsense/plugins/issues/1749 - reuse filter template, link endpoint to selected controller (filter/snat) - push shared code to FilterBaseController --- .../Firewall/Api/FilterBaseController.php | 99 +++++++++++++++++++ .../Firewall/Api/FilterController.php | 65 +----------- .../Firewall/Api/SourceNatController.php | 62 ++++++++++++ .../OPNsense/Firewall/FilterController.php | 1 + .../OPNsense/Firewall/SourceNatController.php | 38 +++++++ .../Firewall/forms/dialogSNatRule.xml | 88 +++++++++++++++++ .../app/models/OPNsense/Firewall/ACL/ACL.xml | 7 ++ .../app/models/OPNsense/Firewall/Filter.xml | 75 ++++++++++++++ .../models/OPNsense/Firewall/Menu/Menu.xml | 3 + .../app/views/OPNsense/Firewall/filter.volt | 20 ++-- 10 files changed, 384 insertions(+), 74 deletions(-) create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterBaseController.php create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/SourceNatController.php create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogSNatRule.xml diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterBaseController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterBaseController.php new file mode 100644 index 0000000000..d939a990d5 --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterBaseController.php @@ -0,0 +1,99 @@ +request->isPost()) { + if ($rollback_revision != null) { + // background rollback timer + (new Backend())->configdpRun('pfplugin rollback_timer', [$rollback_revision], true); + } + return array("status" => (new Backend())->configdRun('filter reload')); + } else { + return array("status" => "error"); + } + } + + public function cancelRollbackAction($rollback_revision) + { + if ($this->request->isPost()) { + return array( + "status" => (new Backend())->configdpRun('pfplugin cancel_rollback', [$rollback_revision]) + ); + } else { + return array("status" => "error"); + } + } + + public function savepointAction() + { + if ($this->request->isPost()) { + // trigger a save, so we know revision->time matches our running config + Config::getInstance()->save(); + return array( + "status" => "ok", + "retention" => (string)Config::getInstance()->backupCount(), + "revision" => (string)Config::getInstance()->object()->revision->time + ); + } else { + return array("status" => "error"); + } + } + + public function revertAction($revision) + { + if ($this->request->isPost()) { + Config::getInstance()->lock(); + $filename = Config::getInstance()->getBackupFilename($revision); + if (!$filename) { + Config::getInstance()->unlock(); + return ["status" => gettext("unknown (or removed) savepoint")]; + } + $this->getModel()->rollback($revision); + Config::getInstance()->unlock(); + (new Backend())->configdRun('filter reload'); + return ["status" => "ok"]; + } else { + return array("status" => "error"); + } + } +} diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php index 2ab47ee699..28e4151a78 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php @@ -27,15 +27,9 @@ */ namespace OPNsense\Firewall\Api; -use OPNsense\Base\ApiMutableModelControllerBase; -use OPNsense\Core\Backend; -use OPNsense\Core\Config; -class FilterController extends ApiMutableModelControllerBase +class FilterController extends FilterBaseController { - protected static $internalModelName = 'filter'; - protected static $internalModelClass = 'OPNsense\Firewall\Filter'; - public function searchRuleAction() { return $this->searchBase("rules.rule", array('enabled', 'sequence', 'description'), "sequence"); @@ -65,61 +59,4 @@ public function toggleRuleAction($uuid, $enabled = null) { return $this->toggleBase("rules.rule", $uuid, $enabled); } - - public function applyAction($rollback_revision = null) - { - if ($this->request->isPost()) { - if ($rollback_revision != null) { - // background rollback timer - (new Backend())->configdpRun('pfplugin rollback_timer', [$rollback_revision], true); - } - return array("status" => (new Backend())->configdRun('filter reload')); - } else { - return array("status" => "error"); - } - } - - public function cancelRollbackAction($rollback_revision) - { - if ($this->request->isPost()) { - return array( - "status" => (new Backend())->configdpRun('pfplugin cancel_rollback', [$rollback_revision]) - ); - } else { - return array("status" => "error"); - } - } - - public function savepointAction() - { - if ($this->request->isPost()) { - // trigger a save, so we know revision->time matches our running config - Config::getInstance()->save(); - return array( - "status" => "ok", - "retention" => (string)Config::getInstance()->backupCount(), - "revision" => (string)Config::getInstance()->object()->revision->time - ); - } else { - return array("status" => "error"); - } - } - - public function revertAction($revision) - { - if ($this->request->isPost()) { - Config::getInstance()->lock(); - $filename = Config::getInstance()->getBackupFilename($revision); - if (!$filename) { - Config::getInstance()->unlock(); - return ["status" => gettext("unknown (or removed) savepoint")]; - } - $this->getModel()->rollback($revision); - Config::getInstance()->unlock(); - (new Backend())->configdRun('filter reload'); - return ["status" => "ok"]; - } else { - return array("status" => "error"); - } - } } diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php new file mode 100644 index 0000000000..f55640e989 --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php @@ -0,0 +1,62 @@ +searchBase("snatrules.rule", array('enabled', 'sequence', 'description'), "sequence"); + } + + public function setRuleAction($uuid) + { + return $this->setBase("rule", "snatrules.rule", $uuid); + } + + public function addRuleAction() + { + return $this->addBase("rule", "snatrules.rule"); + } + + public function getRuleAction($uuid = null) + { + return $this->getBase("rule", "snatrules.rule", $uuid); + } + + public function delRuleAction($uuid) + { + return $this->delBase("snatrules.rule", $uuid); + } + + public function toggleRuleAction($uuid, $enabled = null) + { + return $this->toggleBase("snatrules.rule", $uuid, $enabled); + } +} diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php index a3b711e8f5..74c0479b3b 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/FilterController.php @@ -32,6 +32,7 @@ class FilterController extends \OPNsense\Base\IndexController public function indexAction() { $this->view->pick('OPNsense/Firewall/filter'); + $this->view->ruleController = "filter"; $this->view->formDialogFilterRule = $this->getForm("dialogFilterRule"); } } diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/SourceNatController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/SourceNatController.php new file mode 100644 index 0000000000..5b5927a064 --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/SourceNatController.php @@ -0,0 +1,38 @@ +view->pick('OPNsense/Firewall/filter'); + $this->view->ruleController = "source_nat"; + $this->view->formDialogFilterRule = $this->getForm("dialogSNatRule"); + } +} diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogSNatRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogSNatRule.xml new file mode 100644 index 0000000000..48e1b9a5f1 --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogSNatRule.xml @@ -0,0 +1,88 @@ +
+ + rule.enabled + + checkbox + Enable this rule + + + rule.sequence + + text + + + rule.interface + + dropdown + + + rule.ipprotocol + + dropdown + + + rule.protocol + + dropdown + + + rule.source_net + + text + + + rule.source_port + + text + true + Source port number or well known name (imap, imaps, http, https, ...), for ranges use a dash + + + rule.source_not + + checkbox + Use this option to invert the sense of the match. + + + rule.destination_net + + text + + + rule.destination_not + + checkbox + Use this option to invert the sense of the match. + + + rule.destination_port + + text + Destination port number or well known name (imap, imaps, http, https, ...), for ranges use a dash + + + rule.target + + text + + Packets matching this rule will be mapped to the IP address given here. + + + + rule.target_port + + text + Destination port number or well known name (imap, imaps, http, https, ...) + + + rule.log + + checkbox + Log packets that are handled by this rule + + + rule.description + + text + +
diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/ACL/ACL.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/ACL/ACL.xml index e063715bdf..070ce99e95 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/ACL/ACL.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/ACL/ACL.xml @@ -6,4 +6,11 @@ api/firewall/filter/* + + Firewall: SourceNat: API + + ui/firewall/source_nat/* + api/firewall/source_nat/* + + diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index 378926025b..a9961b45a0 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -106,5 +106,80 @@ + + + + 1 + Y + + + 1 + 99999 + provide a valid sequence for sorting + Y + 1 + + + Y + lan + Y + + + Y + inet + + IPv4 + IPv6 + + + + Y + any + + + any + Y + + + 0 + Y + + + N + Y + Y + + + any + Y + + + 0 + Y + + + N + Y + Y + + + wanip + Y + + + N + Y + + + 0 + Y + + + N + /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u + Description should be a string between 1 and 255 characters + + +
diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml index 3667041201..a551652542 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml @@ -4,6 +4,9 @@ + + + diff --git a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt index b498372440..567eff3362 100644 --- a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt +++ b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt @@ -2,12 +2,12 @@ $( document ).ready(function() { let initial_load = true; let grid = $("#grid-rules").UIBootgrid({ - search:'/api/firewall/filter/searchRule/', - get:'/api/firewall/filter/getRule/', - set:'/api/firewall/filter/setRule/', - add:'/api/firewall/filter/addRule/', - del:'/api/firewall/filter/delRule/', - toggle:'/api/firewall/filter/toggleRule/' + search:'/api/firewall/{{ruleController}}/searchRule/', + get:'/api/firewall/{{ruleController}}/getRule/', + set:'/api/firewall/{{ruleController}}/setRule/', + add:'/api/firewall/{{ruleController}}/addRule/', + del:'/api/firewall/{{ruleController}}/delRule/', + toggle:'/api/firewall/{{ruleController}}/toggleRule/' }); // open edit dialog when opened with a uuid reference @@ -44,7 +44,7 @@ label: "{{ lang._('Revert') }}", cssClass: 'btn-primary', action: function(dialogRef) { - ajaxCall("/api/firewall/filter/revert/" + $("#revertToTime").val(), {}, function (data, status) { + ajaxCall("/api/firewall/{{ruleController}}/revert/" + $("#revertToTime").val(), {}, function (data, status) { if (data.status !== "ok") { $("#revertToTime").parent().addClass("has-error"); $("#revertToTimeError").html(data.status); @@ -71,7 +71,7 @@
- + @@ -100,7 +100,7 @@
+ + + + + + + + + + + + + + + + + + + + + + +
{{ lang._('Enabled') }}{{ lang._('Interfaces') }}{{ lang._('Multicast Addresses') }}{{ lang._('Source Address') }}{{ lang._('Listen Port') }}{{ lang._('ID') }}{{ lang._('Description') }}{{ lang._('ID') }}{{ lang._('Use ID as TTL') }}{{ lang._('Commands') }}
+ + +
+
+
+ +{# include dialog #} +{{ partial("layout_partials/base_dialog",['fields':formDialogEdit,'id':'DialogEdit','label':lang._('Edit Relay')])}} diff --git a/net/udpbroadcastrelay/src/opnsense/service/conf/actions.d/actions_udpbroadcastrelay.conf b/net/udpbroadcastrelay/src/opnsense/service/conf/actions.d/actions_udpbroadcastrelay.conf new file mode 100644 index 0000000000..0ec66ac4ae --- /dev/null +++ b/net/udpbroadcastrelay/src/opnsense/service/conf/actions.d/actions_udpbroadcastrelay.conf @@ -0,0 +1,29 @@ +[start] +command:/usr/local/etc/rc.d/os-udpbroadcastrelay start +parameters:%s +type:script +message:starting udpbroadcastrelay instance + +[stop] +command:/usr/local/etc/rc.d/os-udpbroadcastrelay stop +parameters:%s +type:script +message:stopping udpbroadcastrelay instance + +[status] +command:/usr/local/etc/rc.d/os-udpbroadcastrelay status +parameters:%s +type:script +message:get udpbroadcastrelay instance status + +[restart] +command:/usr/local/etc/rc.d/os-udpbroadcastrelay restart +parameters:%s +type:script +message:restarting udpbroadcastrelay instance + +[reload] +command:/usr/local/etc/rc.d/os-udpbroadcastrelay reload +parameters:%s +type:script +message:reload udpbroadcastrelay diff --git a/net/udpbroadcastrelay/src/opnsense/service/templates/OPNsense/UDPBroadcastRelay/+TARGETS b/net/udpbroadcastrelay/src/opnsense/service/templates/OPNsense/UDPBroadcastRelay/+TARGETS new file mode 100644 index 0000000000..9377f1753e --- /dev/null +++ b/net/udpbroadcastrelay/src/opnsense/service/templates/OPNsense/UDPBroadcastRelay/+TARGETS @@ -0,0 +1 @@ +rc.conf.d:/etc/rc.conf.d/osudpbroadcastrelay diff --git a/net/udpbroadcastrelay/src/opnsense/service/templates/OPNsense/UDPBroadcastRelay/rc.conf.d b/net/udpbroadcastrelay/src/opnsense/service/templates/OPNsense/UDPBroadcastRelay/rc.conf.d new file mode 100644 index 0000000000..918016c811 --- /dev/null +++ b/net/udpbroadcastrelay/src/opnsense/service/templates/OPNsense/UDPBroadcastRelay/rc.conf.d @@ -0,0 +1,37 @@ +{% if helpers.exists('OPNsense.udpbroadcastrelays.udpbroadcastrelay') %} +{% from 'OPNsense/Macros/interface.macro' import physical_interface %} +osudpbroadcastrelay_enable="YES" +{% set Instances=[] %} +{% for osudpbroadcastrelay in helpers.toList('OPNsense.udpbroadcastrelays.udpbroadcastrelay') %} +{% if osudpbroadcastrelay.enabled|default('0') == '1' %} +{% set Parameters=[] %} +{% if osudpbroadcastrelay.InstanceID %} +{% do Parameters.append("--id " ~ osudpbroadcastrelay.InstanceID) %} +{% endif %} +{% set osifnames = osudpbroadcastrelay.interfaces.split(',') %} +{% set interface_list=[] %} +{% for i in osifnames %} +{% do interface_list.append(physical_interface(i)) %} +{% do Parameters.append("--dev " ~ physical_interface(i)) %} +{% endfor %} +{% do Parameters.append("--port " ~ osudpbroadcastrelay.listenport) %} +{% if osudpbroadcastrelay.multicastaddress %} +{% set osmcastaddresses = osudpbroadcastrelay.multicastaddress.split(',') %} +{% for mcastaddress in osmcastaddresses %} +{% do Parameters.append("--multicast " ~ mcastaddress) %} +{% endfor %} +{% endif %} +{% if osudpbroadcastrelay.sourceaddress %} +{% do Parameters.append("-s " ~ osudpbroadcastrelay.sourceaddress) %} +{% endif %} +{% if osudpbroadcastrelay.RevertTTL|default('0') == '1' %} +{% do Parameters.append("-t ") %} +{% endif %} +{% do Parameters.append("-f") %} +{% set Instance=osudpbroadcastrelay.InstanceID %} +osudpbroadcastrelay_{{Instance}}="{% for Parameter in Parameters %} {{Parameter}}{% endfor %}" +{% do Instances.append(Instance) %} +{% endif %} +{% endfor %} +osudpbroadcastrelay_instances="{% for Instance in Instances %} {{Instance}}{% endfor %}" +{% endif %} From d9c01dbf222ef0350c17f3254c8add2fc8338ea6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Apr 2020 14:28:19 +0200 Subject: [PATCH 0084/3088] net/udpbroadcastdelay: style sweep, align Makefile --- LICENSE | 1 + README.md | 1 + net/udpbroadcastrelay/Makefile | 6 +++--- net/udpbroadcastrelay/pkg-descr | 6 +++--- .../etc/inc/plugins.inc.d/udpbroadcastrelay.inc | 14 +++++++------- .../src/etc/rc.d/os-udpbroadcastrelay | 6 +++--- .../UDPBroadcastRelay/Api/SettingsController.php | 14 +++++++------- .../UDPBroadcastRelay/forms/dialogEdit.xml | 4 ++-- .../views/OPNsense/UDPBroadcastRelay/index.volt | 2 +- 9 files changed, 28 insertions(+), 26 deletions(-) diff --git a/LICENSE b/LICENSE index b47b3f8908..6da3cfdf3f 100644 --- a/LICENSE +++ b/LICENSE @@ -18,6 +18,7 @@ Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça Copyright (c) 2019 Juergen Kellerer Copyright (c) 2003-2006 Manuel Kasper +Copyright (c) 2020 Martin Wasley Copyright (c) 2017-2020 Michael Muenz Copyright (c) 2004-2012 Scott Ullrich Copyright (c) 2010-2012 Seth Mos diff --git a/README.md b/README.md index 514ce14fcf..199d6918bf 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ net/relayd -- Relayd Load Balancer net/shadowsocks -- Secure socks5 proxy net/siproxd -- Siproxd is a proxy daemon for the SIP protocol net/tayga -- Tayga IPv6 64NAT +net/udpbroadcastrelay -- Control ubpbroadcastrelay processes (development only) net/upnp -- Universal Plug and Play Service net/vnstat -- vnStat is a console-based network traffic monitor net/wireguard -- WireGuard VPN service diff --git a/net/udpbroadcastrelay/Makefile b/net/udpbroadcastrelay/Makefile index 22783a4894..b90f1cfd0b 100644 --- a/net/udpbroadcastrelay/Makefile +++ b/net/udpbroadcastrelay/Makefile @@ -1,6 +1,6 @@ -PLUGIN_NAME= os-udpbroadcastrelay -PLUGIN_VERSION= 0.7 -PLUGIN_DEVEL= YES +PLUGIN_NAME= udpbroadcastrelay +PLUGIN_VERSION= 0.1 +PLUGIN_DEVEL= yes PLUGIN_COMMENT= Control ubpbroadcastrelay processes PLUGIN_DEPENDS= udpbroadcastrelay PLUGIN_MAINTAINER= mjwasley@gmail.com diff --git a/net/udpbroadcastrelay/pkg-descr b/net/udpbroadcastrelay/pkg-descr index 1a1c37af0a..684ef947f6 100644 --- a/net/udpbroadcastrelay/pkg-descr +++ b/net/udpbroadcastrelay/pkg-descr @@ -1,13 +1,13 @@ udbproadcastrelay is a UDP multicast relayer. Its intended use is to rebroadbcast udp packets on a specific port across interfaces, be those -interfaces physical or VLAN. +interfaces physical or VLAN. -It is used where devices such as Sonos or Sky are spread accross +It is used where devices such as Sonos or Sky are spread accross different subnets and are not able to detect the servers or devices. Examples of different devices and the ports are as follows: -Syncthing discovery +Syncthing discovery udp_vars="--id 1 --port 21027 --dev igb1 --dev igb2" mDNS / Broadcast DNS (Chromecast Discovery + Bonjour + More) diff --git a/net/udpbroadcastrelay/src/etc/inc/plugins.inc.d/udpbroadcastrelay.inc b/net/udpbroadcastrelay/src/etc/inc/plugins.inc.d/udpbroadcastrelay.inc index 1a3b3aa821..d859316fc6 100644 --- a/net/udpbroadcastrelay/src/etc/inc/plugins.inc.d/udpbroadcastrelay.inc +++ b/net/udpbroadcastrelay/src/etc/inc/plugins.inc.d/udpbroadcastrelay.inc @@ -25,7 +25,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ - + function udpbroadcastrelay_enabled() { $model = new \OPNsense\UDPBroadcastRelay\UDPBroadcastRelay(); @@ -53,17 +53,17 @@ function udpbroadcastrelay_services() if (!udpbroadcastrelay_enabled()) { return $services; } - + $model = new \OPNsense\UDPBroadcastRelay\UDPBroadcastRelay(); foreach ($model->udpbroadcastrelay->iterateItems() as $server) { - + if ($server->enabled == '0'){ continue; } $services[] = array( - + 'description' => $server->description, 'id' => $server->InstanceID, 'pidfile' => "/var/run/udpbroadcastrelay_{$server->InstanceID}.pid", @@ -71,13 +71,13 @@ function udpbroadcastrelay_services() 'restart' => array('udpbroadcastrelay restart '.$server->InstanceID), 'start' => array('udpbroadcastrelay start '.$server->InstanceID), 'stop' => array('udpbroadcastrelay stop '.$server->InstanceID), - + ), - + 'name' => 'udpbroadcastrelay', ); } - + return $services; } diff --git a/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay b/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay index d076d6901d..e16cab0c38 100644 --- a/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay +++ b/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay @@ -81,7 +81,7 @@ udpbroadcastrelay_reload () { # get instance flags instance_flags="${line#*udpbroadcastrelay}" # check if it should run - echo + echo eval osudpbroadcastrelay_flags=\$osudpbroadcastrelay_${instance} if [ -n "$osudpbroadcastrelay_flags" -a "$osudpbroadcastrelay_flags" = "$instance_flags" ]; then @@ -94,9 +94,9 @@ udpbroadcastrelay_reload () { udpbroadcastrelay_stop done # start configured instances - + if [ -n "$osudpbroadcastrelay_instances" ]; then - + for i in $osudpbroadcastrelay_instances; do eval osudpbroadcastrelay_flags=\$osudpbroadcastrelay_${i} pidfile="/var/run/udpbroadcastrelay_$i.pid" diff --git a/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/SettingsController.php b/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/SettingsController.php index 8f08921d31..48c76094e2 100644 --- a/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/SettingsController.php +++ b/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/SettingsController.php @@ -99,7 +99,7 @@ public function setRelayAction($uuid) if (count($result['validations']) == 0) { // check for duplicates - + foreach ($CurrentProxies['udpbroadcastrelay'] as $CurrentUUID => &$CurrentRelay) { if ( $node->InstanceID->__toString() == $CurrentRelay['InstanceID'] && @@ -135,7 +135,7 @@ public function setRelayAction($uuid) "udpbroadcastrelay.InstanceID" => "Instance ID already In use." ) ); - } + } $result = count(explode(',',$node->interfaces)); if ( $result < 2 && @@ -147,9 +147,9 @@ public function setRelayAction($uuid) "udpbroadcastrelay.interfaces" => "At least two interfaces must be selected." ) ); - } + } } - + // save config if validated correctly $mdlUDPBroadcastRelay->serializeToConfig(); Config::getInstance()->save(); @@ -189,7 +189,7 @@ public function addRelayAction() foreach ($CurrentProxies['udpbroadcastrelay'] as &$CurrentRelay) { if ( $node->InstanceID->__toString() == $CurrentRelay['InstanceID'] && - $node->listenport->__toString() == $CurrentRelay['listenport'] + $node->listenport->__toString() == $CurrentRelay['listenport'] ) { return array( "result" => "failed", @@ -219,9 +219,9 @@ public function addRelayAction() ) ); } - + $result = count(explode(',',$node->interfaces)); - if ( + if ( $result < 2 ) { return array( diff --git a/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/forms/dialogEdit.xml b/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/forms/dialogEdit.xml index f39ae51118..f8e5a0cdd9 100644 --- a/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/forms/dialogEdit.xml +++ b/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/forms/dialogEdit.xml @@ -21,8 +21,8 @@ udpbroadcastrelay.multicastaddress select_multiple - true - + true + diff --git a/net/udpbroadcastrelay/src/opnsense/mvc/app/views/OPNsense/UDPBroadcastRelay/index.volt b/net/udpbroadcastrelay/src/opnsense/mvc/app/views/OPNsense/UDPBroadcastRelay/index.volt index 1904a31459..f8c106948f 100644 --- a/net/udpbroadcastrelay/src/opnsense/mvc/app/views/OPNsense/UDPBroadcastRelay/index.volt +++ b/net/udpbroadcastrelay/src/opnsense/mvc/app/views/OPNsense/UDPBroadcastRelay/index.volt @@ -91,7 +91,7 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Interfaces') }} {{ lang._('Multicast Addresses') }} {{ lang._('Source Address') }} - {{ lang._('Listen Port') }} + {{ lang._('Listen Port') }} {{ lang._('ID') }} {{ lang._('Description') }} {{ lang._('ID') }} From 152b6e1ffe2762ef4508f8bdce01b29543a7b6a5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Apr 2020 14:32:10 +0200 Subject: [PATCH 0085/3088] net/udpbroadcastrelay: style sweep while here --- .../inc/plugins.inc.d/udpbroadcastrelay.inc | 12 ++++------- .../Api/ServiceController.php | 10 +++++----- .../Api/SettingsController.php | 20 +++++++++---------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/net/udpbroadcastrelay/src/etc/inc/plugins.inc.d/udpbroadcastrelay.inc b/net/udpbroadcastrelay/src/etc/inc/plugins.inc.d/udpbroadcastrelay.inc index d859316fc6..bb8a14f9f0 100644 --- a/net/udpbroadcastrelay/src/etc/inc/plugins.inc.d/udpbroadcastrelay.inc +++ b/net/udpbroadcastrelay/src/etc/inc/plugins.inc.d/udpbroadcastrelay.inc @@ -57,26 +57,22 @@ function udpbroadcastrelay_services() $model = new \OPNsense\UDPBroadcastRelay\UDPBroadcastRelay(); foreach ($model->udpbroadcastrelay->iterateItems() as $server) { - - if ($server->enabled == '0'){ + if ($server->enabled == '0') { continue; } $services[] = array( - 'description' => $server->description, 'id' => $server->InstanceID, 'pidfile' => "/var/run/udpbroadcastrelay_{$server->InstanceID}.pid", 'configd' => array( - 'restart' => array('udpbroadcastrelay restart '.$server->InstanceID), - 'start' => array('udpbroadcastrelay start '.$server->InstanceID), - 'stop' => array('udpbroadcastrelay stop '.$server->InstanceID), + 'restart' => array('udpbroadcastrelay restart ' . $server->InstanceID), + 'start' => array('udpbroadcastrelay start ' . $server->InstanceID), + 'stop' => array('udpbroadcastrelay stop ' . $server->InstanceID), ), - 'name' => 'udpbroadcastrelay', ); - } return $services; diff --git a/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/ServiceController.php b/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/ServiceController.php index d14f101f46..b64d378d5f 100644 --- a/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/ServiceController.php +++ b/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/ServiceController.php @@ -27,9 +27,10 @@ */ namespace OPNsense\UDPBroadcastRelay\Api; -use \OPNsense\Base\ApiMutableModelControllerBase; -use \OPNsense\UDPBroadcastRelay\UDPBroadcastRelay; -use \OPNsense\Core\Backend; + +use OPNsense\Base\ApiMutableModelControllerBase; +use OPNsense\UDPBroadcastRelay\UDPBroadcastRelay; +use OPNsense\Core\Backend; /** * Class ServiceController Handles settings related API actions for the UDPBroadcastRelay @@ -38,7 +39,7 @@ class ServiceController extends ApiMutableModelControllerBase { protected static $internalModelName = 'udpbroadcastrelay'; - protected static $internalModelClass = '\OPNsense\\UDPBroadcastRelay\\UDPBroadcastRelay'; + protected static $internalModelClass = '\OPNsense\UDPBroadcastRelay\UDPBroadcastRelay'; protected static $internalModelUseSafeDelete = true; public function statusAction($uuid) @@ -167,7 +168,6 @@ protected function callBackend($action, &$node = null) } if ($action == 'reload') { return trim($backend->configdRun('udpbroadcastrelay reload')); - } return "Wrong action defined"; } diff --git a/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/SettingsController.php b/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/SettingsController.php index 48c76094e2..4f63375ccb 100644 --- a/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/SettingsController.php +++ b/net/udpbroadcastrelay/src/opnsense/mvc/app/controllers/OPNsense/UDPBroadcastRelay/Api/SettingsController.php @@ -28,11 +28,11 @@ namespace OPNsense\UDPBroadcastRelay\Api; +use OPNsense\Base\ApiMutableModelControllerBase; +use OPNsense\Core\Config; +use OPNsense\UDPBroadcastRelay\UDPBroadcastRelay; +use OPNsense\Base\UIModelGrid; -use \OPNsense\Base\ApiMutableModelControllerBase; -use \OPNsense\Core\Config; -use \OPNsense\UDPBroadcastRelay\UDPBroadcastRelay; -use \OPNsense\Base\UIModelGrid; /** * Class SettingsController Handles settings related API actions for the UDPBroadcastRelay * @package OPNsense\UDPBroadcastRelay @@ -115,7 +115,7 @@ public function setRelayAction($uuid) ); } if ( - $node->listenport->__toString() == $CurrentRelay['listenport'] && + $node->listenport->__toString() == $CurrentRelay['listenport'] && $uuid != $CurrentUUID ) { return array( @@ -136,7 +136,7 @@ public function setRelayAction($uuid) ) ); } - $result = count(explode(',',$node->interfaces)); + $result = count(explode(',', $node->interfaces)); if ( $result < 2 && $uuid != $CurrentUUID @@ -190,7 +190,7 @@ public function addRelayAction() if ( $node->InstanceID->__toString() == $CurrentRelay['InstanceID'] && $node->listenport->__toString() == $CurrentRelay['listenport'] - ) { + ) { return array( "result" => "failed", "validations" => array( @@ -198,9 +198,9 @@ public function addRelayAction() "udpbroadcastrelay.listenport" => "Listen port already in use." ) ); - } + } if ( - $node->listenport->__toString() == $CurrentRelay['listenport'] + $node->listenport->__toString() == $CurrentRelay['listenport'] ) { return array( "result" => "failed", @@ -220,7 +220,7 @@ public function addRelayAction() ); } - $result = count(explode(',',$node->interfaces)); + $result = count(explode(',', $node->interfaces)); if ( $result < 2 ) { From 83f2841fba509bfbd7be41f9e44d248d690a09fb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Apr 2020 18:36:32 +0200 Subject: [PATCH 0086/3088] net/firewall: bump version after changes --- net/firewall/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/firewall/Makefile b/net/firewall/Makefile index 5898e58862..b77fe65064 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= firewall -PLUGIN_VERSION= 0.2 +PLUGIN_VERSION= 0.3 PLUGIN_COMMENT= Firewall API supplemental package PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEVEL= yes From f8bd08e12c699e877b739185d7e29d8dbe4e150d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Apr 2020 20:02:43 +0200 Subject: [PATCH 0087/3088] Framework: deploy same package logic as core.git has now The idea was to have a shared default.mk between both repositories, but for the time being this has an issue with the different prefixes used by core.git and plugins.git, namely CORE_ and PLUGIN_. --- Mk/defaults.mk | 37 ++++++++++++++++++++++++++++++------- Mk/plugins.mk | 8 ++------ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 0f6f3b1c3d..815b7c4060 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -26,18 +26,41 @@ LOCALBASE?= /usr/local PAGER?= less +PKG!= which pkg || echo true +GIT!= which git || echo true + +_PLUGIN_ARCH!= uname -p +PLUGIN_ARCH?= ${_PLUGIN_ARCH} + OPENSSL?= ${LOCALBASE}/bin/openssl -_FLAVOUR!= if [ -f ${OPENSSL} ]; then ${OPENSSL} version; fi -FLAVOUR?= ${_FLAVOUR:[1]} +.if ! defined(PLUGIN_FLAVOUR) +.if exists(${OPENSSL}) +_PLUGIN_FLAVOUR!= ${OPENSSL} version +PLUGIN_FLAVOUR?= ${_PLUGIN_FLAVOUR:[1]} +.else +.warning "Detected 'Base' flavour is not currently supported" +PLUGIN_FLAVOUR?= Base +.endif +.endif + +PHPBIN= ${LOCALBASE}/bin/php -PKG!= which pkg || echo true -GIT!= which git || echo true -ARCH!= uname -p +.if exists(${PHPBIN}) +_PLUGIN_PHP!= ${PHPBIN} -v +PLUGIN_PHP?= ${_PLUGIN_PHP:[2]:S/./ /g:[1..2]:tW:S/ //} +.endif + +PYTHONLINK= ${LOCALBASE}/bin/python3 + +.if exists(${PYTHONLINK}) +_PLUGIN_PYTHON!=${PYTHONLINK} -V +PLUGIN_PYTHON?= ${_PLUGIN_PYTHON:[2]:S/./ /g:[1..2]:tW:S/ //} +.endif PLUGIN_ABI?= 20.1 -PLUGIN_ARCH?= ${ARCH} -PLUGIN_FLAVOUR?=${FLAVOUR} +PLUGIN_PHP?= 72 +PLUGIN_PYTHON?= 37 REPLACEMENTS= PLUGIN_ABI \ PLUGIN_ARCH \ diff --git a/Mk/plugins.mk b/Mk/plugins.mk index bb6942c55a..6722b8727e 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -27,10 +27,6 @@ all: check .include "defaults.mk" -PLUGIN_ARCH?= ${ARCH} -PLUGIN_PHP?= 72 -PLUGIN_PYTHON?= 37 - PLUGIN_DESC= pkg-descr PLUGIN_SCRIPTS= +PRE_INSTALL +POST_INSTALL \ +PRE_DEINSTALL +POST_DEINSTALL @@ -236,10 +232,10 @@ package: check @if ! ${PKG} info ${DEP} > /dev/null; then ${PKG} install -yA ${DEP}; fi .endfor @echo -n ">>> Generating metadata for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}..." - @${MAKE} DESTDIR=${WRKSRC} FLAVOUR=${FLAVOUR} metadata + @${MAKE} DESTDIR=${WRKSRC} metadata @echo " done" @echo -n ">>> Staging files for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}..." - @${MAKE} DESTDIR=${WRKSRC} FLAVOUR=${FLAVOUR} install + @${MAKE} DESTDIR=${WRKSRC} install @echo " done" @echo ">>> Packaging files for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}:" @${PKG} create -v -m ${WRKSRC} -r ${WRKSRC} \ From b10ffbaceb22267559ca541b2c45c4b1601097f9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Apr 2020 20:11:02 +0200 Subject: [PATCH 0088/3088] Framework: small output for directory change --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index cf1ed5acee..2b9da252c5 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ TARGETS= clean lint style style-fix style-python sweep test .for TARGET in ${TARGETS} ${TARGET}: . for PLUGIN_DIR in ${PLUGIN_DIRS} + @echo ">>> Entering ${PLUGIN_DIR}" @${MAKE} -C ${PLUGIN_DIR} ${TARGET} . endfor .endfor From 61391097b30072fd1167f8ebcd3bddb8038f7eee Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 16 Apr 2020 00:00:58 +0200 Subject: [PATCH 0089/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index eee2f29f11..9cd8c47016 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 2.21 +PLUGIN_VERSION= 2.22 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de From f1b7285b0666558e8e67269945b330ba70a2b8fb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 16 Apr 2020 13:03:39 +0200 Subject: [PATCH 0090/3088] net/udpbroadcastrelay: fix permission --- net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay diff --git a/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay b/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay old mode 100644 new mode 100755 From adb0dcad2076b2b33ab7b4bb9050170e36068f13 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 16 Apr 2020 14:40:55 +0200 Subject: [PATCH 0091/3088] dns/unbound-plus: small change to parse copyright --- LICENSE | 1 + .../src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 6da3cfdf3f..d4dd30ef24 100644 --- a/LICENSE +++ b/LICENSE @@ -20,6 +20,7 @@ Copyright (c) 2019 Juergen Kellerer Copyright (c) 2003-2006 Manuel Kasper Copyright (c) 2020 Martin Wasley Copyright (c) 2017-2020 Michael Muenz +Copyright (c) 2020 Petr Kejval Copyright (c) 2004-2012 Scott Ullrich Copyright (c) 2010-2012 Seth Mos Copyright (c) 2008 Shrew Soft Inc. diff --git a/dns/unbound-plus/src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py b/dns/unbound-plus/src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py index 811a6ebc13..f933ad6877 100755 --- a/dns/unbound-plus/src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py +++ b/dns/unbound-plus/src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py @@ -1,7 +1,7 @@ #!/usr/local/bin/python3 # DNS BL script -# Copyright 2020 Petr Kejval +# Copyright (c) 2020 Petr Kejval # Downloads blacklisted domains from user specified URLs and "compile" them into unbound.conf compatible file From 65abab88daf5c7dc2bea8824419e396ccdf38cf2 Mon Sep 17 00:00:00 2001 From: prunkster Date: Thu, 16 Apr 2020 23:10:48 +0200 Subject: [PATCH 0092/3088] security/acme-client: add support for dnsapi "Euserv.eu" - added option "--insecure" - increased maximum dns sleep time --- .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 4 ++-- .../src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 3ac2719109..4bf12717fd 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -420,9 +420,9 @@ 1 - 10000 + 84600 120 - Please specify a value between 1 and 10000. + Please specify a value between 1 and 84600. Y diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index f9a648ee52..9abdd32e8e 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -735,6 +735,7 @@ function run_acme_validation($certObj, $valObj, $acctObj) case 'dns_euserv': $proc_env['EUSERV_Username'] = (string)$valObj->dns_euserv_user; $proc_env['EUSERV_Password'] = (string)$valObj->dns_euserv_password; + $acme_hook_options[] = "--insecure"; break; case 'dns_freedns': $proc_env['FREEDNS_User'] = (string)$valObj->dns_freedns_user; From d380ee2df14014276c6ea5e18fef4a12cc8e9296 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 20 Apr 2020 14:37:18 +0200 Subject: [PATCH 0093/3088] net/firewall: version 1.0 --- README.md | 2 +- net/firewall/Makefile | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 199d6918bf..31cc612ce8 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ net-mgmt/nrpe -- Execute nagios plugins net-mgmt/telegraf -- Agent for collecting metrics and data net-mgmt/zabbix-agent -- Zabbix monitoring agent net-mgmt/zabbix4-proxy -- Zabbix Proxy enables decentralized monitoring -net/firewall -- Firewall API supplemental package (development only) +net/firewall -- Firewall API supplemental package net/freeradius -- RADIUS Authentication, Authorization and Accounting Server net/frr -- The FRRouting Protocol Suite net/ftp-proxy -- Control ftp-proxy processes diff --git a/net/firewall/Makefile b/net/firewall/Makefile index b77fe65064..5c667b1ee0 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -1,7 +1,6 @@ PLUGIN_NAME= firewall -PLUGIN_VERSION= 0.3 +PLUGIN_VERSION= 1.0 PLUGIN_COMMENT= Firewall API supplemental package PLUGIN_MAINTAINER= ad@opnsense.org -PLUGIN_DEVEL= yes .include "../../Mk/plugins.mk" From df2628338888087308344be766d0f52723049135 Mon Sep 17 00:00:00 2001 From: Gauss23 Date: Mon, 20 Apr 2020 10:33:34 +0200 Subject: [PATCH 0094/3088] wake_on_lan widget: find macs case-insensitive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Find mac addresses case-insensitive. When mac addresses are added, they are saved like the users enters them. If the user used upper-case letters, this results in showing the host offline in the dashboard, although it´s online. Other fix would be to make all mac inputs lowercase while saving. --- net/wol/src/www/widgets/widgets/wake_on_lan.widget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wol/src/www/widgets/widgets/wake_on_lan.widget.php b/net/wol/src/www/widgets/widgets/wake_on_lan.widget.php index 8d77e89696..adef5d97a5 100644 --- a/net/wol/src/www/widgets/widgets/wake_on_lan.widget.php +++ b/net/wol/src/www/widgets/widgets/wake_on_lan.widget.php @@ -45,7 +45,7 @@ wolentry->iterateItems() as $wolent): - $is_active = exec("/usr/sbin/arp -an |/usr/bin/grep {$wolent->mac}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'");?> + $is_active = exec("/usr/sbin/arp -an |/usr/bin/grep -i {$wolent->mac}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'");?> descr) ? $wolent->descr : gettext('Unnamed entry') ?>
mac ?> interface));?> From 6a58d19c49e12008960e5a78870652256666335b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 22 Apr 2020 13:24:29 +0200 Subject: [PATCH 0095/3088] net/wol: next version --- net/wol/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/wol/Makefile b/net/wol/Makefile index e4184ba927..bbae997f3f 100644 --- a/net/wol/Makefile +++ b/net/wol/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= wol -PLUGIN_VERSION= 2.2 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 2.3 PLUGIN_DEPENDS= wol PLUGIN_COMMENT= Wake on LAN Service PLUGIN_MAINTAINER= franco@opnsense.org From 7178da958bcd56f14a63bdc1d65f9127708c707c Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 29 Apr 2020 11:37:20 +0200 Subject: [PATCH 0096/3088] dns/unbound-plus: fix DoT validations (#1803) --- .../mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml b/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml index 3a4e3cb4fb..1ae1f590ae 100644 --- a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml +++ b/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml @@ -8,7 +8,7 @@ N - /^[a-fA-F0-9\.\@]{1,46}$/ + /^[a-fA-F0-9\.\,\:\@]{1,512}$/ From 4c07622fbde1c39d378f49dd05187311edb44fce Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Apr 2020 11:38:33 +0200 Subject: [PATCH 0097/3088] dns/unbound-plus: advertise fix --- dns/unbound-plus/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/dns/unbound-plus/Makefile b/dns/unbound-plus/Makefile index c0ffdf6ec0..b12f8cf3db 100644 --- a/dns/unbound-plus/Makefile +++ b/dns/unbound-plus/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= unbound-plus PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Unbound additions PLUGIN_MAINTAINER= m.muenz@gmail.com From 930995ba3a18667830b046adef6c69ac6d419a17 Mon Sep 17 00:00:00 2001 From: Johann Richard <189003+johannrichard@users.noreply.github.com> Date: Tue, 5 May 2020 07:25:34 +0200 Subject: [PATCH 0098/3088] Make doc for password more explicit, group options logically (#1765) It may be obvious to some, but I think there's some value in making it more explicit that the password required here is for the *remote* shadowsocks server. Furthermore, I would suggest moving the password in the form closer to the remove server info. --- .../controllers/OPNsense/Shadowsocks/forms/local.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/shadowsocks/src/opnsense/mvc/app/controllers/OPNsense/Shadowsocks/forms/local.xml b/net/shadowsocks/src/opnsense/mvc/app/controllers/OPNsense/Shadowsocks/forms/local.xml index fd8d43bbd4..1030a427cd 100644 --- a/net/shadowsocks/src/opnsense/mvc/app/controllers/OPNsense/Shadowsocks/forms/local.xml +++ b/net/shadowsocks/src/opnsense/mvc/app/controllers/OPNsense/Shadowsocks/forms/local.xml @@ -17,6 +17,12 @@ text Port of the remote server.
+ + local.password + + text + Password to authenticate against the remote server. + local.localaddress @@ -29,12 +35,6 @@ text The local port of the daemon, default is fine. - - local.password - - text - Password to authenticate against the server. - local.cipher From dc7980a3e063992f7500b9ab33c7eae9564681d4 Mon Sep 17 00:00:00 2001 From: Patrik Kernstock Date: Sun, 3 May 2020 01:13:41 +0100 Subject: [PATCH 0099/3088] unboundplus: Use 'forward-tls-upstream' config key While 'forward-ssl-upstream' is indeed an alias/alternative syntax for the '*tls*' option, therefore it's more a cosmetic thing - specially because it's called DNS over TLS. Just to be consistent with terms used. --- .../opnsense/service/templates/OPNsense/Unboundplus/dot.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dot.conf b/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dot.conf index ae59c336b8..8837f8fd76 100644 --- a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dot.conf +++ b/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dot.conf @@ -3,7 +3,7 @@ server: tls-cert-bundle: /etc/ssl/cert.pem forward-zone: name: "." - forward-ssl-upstream: yes + forward-tls-upstream: yes {% for dot in OPNsense.unboundplus.miscellaneous.dotservers.split(',') %} forward-addr: {{ dot }} {% endfor %} From f2db771984ac5b5ce4c5c4fa11121bb4476e4d93 Mon Sep 17 00:00:00 2001 From: vnxme <46669194+vnxme@users.noreply.github.com> Date: Tue, 12 May 2020 13:49:01 +0300 Subject: [PATCH 0100/3088] security/tinc: Fix switch mode (#1733) * security/tinc: Allow empty subnet for switch mode A Host class with empty self._payload['subnet'] is considered invalid (lines 38-39). Thus, we can remove self._payload['subnet'] = None from __init__() and add a check for existance to config_text(). * security/tinc: Allow empty subnet for switch mode Set network.subnet.required and host.subnet.required to N, add a required constraint for network.subnet if network.mode is router. * security/tinc: Trigger configctl on tinc-up In order to support various dual-stack configs (primary IPv4/v6 assigned by VPN/Tinc and any combination of alias IPv4/v6 assigned by Firewall/VIP) we need to trigger configctl: - Primary IPv4: /usr/local/opnsense/service/configd_ctl.py interface newip $interface - Primary IPv6: /usr/local/opnsense/service/configd_ctl.py interface newipv6 $interface * security/tinc: Destroy tun/tap interface on stop Destroying tun/tap interface each time Tinc daemon stops/restarts resolves the issue of losing IPv6 network routes (see #3972). * security/Tinc: Add a missing reference constraint The network.mode field is now linked to the network.subnet field. * security/Tinc: Refactor tincd.py --- .../mvc/app/models/OPNsense/Tinc/Tinc.xml | 17 +++++++++++++++-- .../scripts/OPNsense/Tinc/lib/objects.py | 8 ++++---- .../src/opnsense/scripts/OPNsense/Tinc/tincd.py | 11 +++++++++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml index 9741c5d3b8..e8abbc0c0c 100644 --- a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml +++ b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml @@ -37,10 +37,18 @@ N - Y + N N Y , + + + Subnet field must be set in router mode. + SetIfConstraint + mode + router + + Y @@ -69,6 +77,11 @@ router switch + + + subnet.check001 + + 1 @@ -123,7 +136,7 @@ /^([0-9a-zA-Z\.,_\-:]){0,1024}$/u - Y + N N Y , diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py index 81cb8e563d..6b9ccfcd3c 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py @@ -123,7 +123,6 @@ class Host(NetwConfObject): def __init__(self): super(Host, self).__init__() self._connectTo = "0" - self._payload['subnet'] = None self._payload['pubkey'] = None self._payload['cipher'] = None @@ -139,9 +138,10 @@ def set_connectto(self, value): def config_text(self): result = list() result.append('Address=%(address)s %(port)s'%self._payload) - networks = self._payload['subnet'].split(',') - for network in networks: - result.append('Subnet=%s' % network) + if 'subnet' in self._payload: + networks = self._payload['subnet'].split(',') + for network in networks: + result.append('Subnet=%s' % network) result.append('Cipher=%(cipher)s'%self._payload) result.append('Digest=sha256') result.append(self._payload['pubkey']) diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py index f34ae87eff..3f5f887f49 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py @@ -86,11 +86,14 @@ def deploy(config_filename): # write tinc-up file interface_address = network.get_local_address() - interface_family = "inet6" if ipaddress.ip_network(interface_address, False).version == 6 else "inet" + interface_network = ipaddress.ip_network(interface_address, False) + interface_family = "inet6" if interface_network.version == 6 else "inet" + interface_configd = "newipv6" if interface_network.version == 6 else "newip" if_up = list() if_up.append("#!/bin/sh") - if_up.append("ifconfig %s %s %s " % (interface_name, interface_family, pipes.quote(interface_address))) + if_up.append("ifconfig %s %s %s" % (interface_name, interface_family, pipes.quote(interface_address))) + if_up.append("configctl interface %s %s" % (interface_configd, interface_name)) write_file("%s/tinc-up" % network.get_basepath(), '\n'.join(if_up) + "\n", 0o700) # configure and rename new tun device, place all in group "tinc" symlink associated tun device @@ -108,6 +111,10 @@ def deploy(config_filename): if sys.argv[1] == 'stop': for instance in glob.glob('/usr/local/etc/tinc/*'): subprocess.run(['/usr/local/sbin/tincd','-n',instance.split('/')[-1], '-k']) + if os.path.exists('%s/tinc.conf' % instance): + interface_name = open('%s/tinc.conf' % instance).read().split('Device=')[-1].split()[0].split('/')[-1] + if interface_name.startswith('tinc'): + subprocess.run(['/sbin/ifconfig',interface_name,'destroy']) elif sys.argv[1] == 'start': for netwrk in deploy('/usr/local/etc/tinc_deploy.xml'): subprocess.run(['/usr/local/sbin/tincd','-n',netwrk.get_network(), '-R', '-d', netwrk.get_debuglevel()]) From faa23ffae97eb6e3a57e4a9a06c5778d11da19d4 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 12 May 2020 13:55:27 +0200 Subject: [PATCH 0101/3088] Syslog-NG: add templates for https://github.com/opnsense/core/issues/4068 --- .../service/templates/OPNsense/Syslog/local/postfix.conf | 6 ++++++ .../service/templates/OPNsense/Syslog/local/haproxy.conf | 6 ++++++ .../service/templates/OPNsense/Syslog/local/tinc.conf | 6 ++++++ 3 files changed, 18 insertions(+) create mode 100644 mail/postfix/src/opnsense/service/templates/OPNsense/Syslog/local/postfix.conf create mode 100644 net/haproxy/src/opnsense/service/templates/OPNsense/Syslog/local/haproxy.conf create mode 100644 security/tinc/src/opnsense/service/templates/OPNsense/Syslog/local/tinc.conf diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Syslog/local/postfix.conf b/mail/postfix/src/opnsense/service/templates/OPNsense/Syslog/local/postfix.conf new file mode 100644 index 0000000000..2e8e746c5a --- /dev/null +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Syslog/local/postfix.conf @@ -0,0 +1,6 @@ +################################################################### +# Local syslog-ng configuration filter definition [postfix]. +################################################################### +filter f_local_postfix { + program("postfix"); +}; \ No newline at end of file diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/Syslog/local/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/Syslog/local/haproxy.conf new file mode 100644 index 0000000000..73f07d402e --- /dev/null +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/Syslog/local/haproxy.conf @@ -0,0 +1,6 @@ +################################################################### +# Local syslog-ng configuration filter definition [haproxy]. +################################################################### +filter f_local_haproxy { + program("haproxy"); +}; \ No newline at end of file diff --git a/security/tinc/src/opnsense/service/templates/OPNsense/Syslog/local/tinc.conf b/security/tinc/src/opnsense/service/templates/OPNsense/Syslog/local/tinc.conf new file mode 100644 index 0000000000..a29f98756a --- /dev/null +++ b/security/tinc/src/opnsense/service/templates/OPNsense/Syslog/local/tinc.conf @@ -0,0 +1,6 @@ +################################################################### +# Local syslog-ng configuration filter definition [tinc]. +################################################################### +filter f_local_tinc { + program("tinc.*"); +}; \ No newline at end of file From c6de3851f55912aee11e40e1c3f49febcf59cfe8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 13 May 2020 08:42:51 +0200 Subject: [PATCH 0102/3088] plugins: style sweep --- .../service/templates/OPNsense/Syslog/local/postfix.conf | 2 +- .../service/templates/OPNsense/Syslog/local/haproxy.conf | 2 +- .../opnsense/service/templates/OPNsense/Syslog/local/tinc.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Syslog/local/postfix.conf b/mail/postfix/src/opnsense/service/templates/OPNsense/Syslog/local/postfix.conf index 2e8e746c5a..caf523956a 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Syslog/local/postfix.conf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Syslog/local/postfix.conf @@ -3,4 +3,4 @@ ################################################################### filter f_local_postfix { program("postfix"); -}; \ No newline at end of file +}; diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/Syslog/local/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/Syslog/local/haproxy.conf index 73f07d402e..a2691d2c18 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/Syslog/local/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/Syslog/local/haproxy.conf @@ -3,4 +3,4 @@ ################################################################### filter f_local_haproxy { program("haproxy"); -}; \ No newline at end of file +}; diff --git a/security/tinc/src/opnsense/service/templates/OPNsense/Syslog/local/tinc.conf b/security/tinc/src/opnsense/service/templates/OPNsense/Syslog/local/tinc.conf index a29f98756a..48fd37a414 100644 --- a/security/tinc/src/opnsense/service/templates/OPNsense/Syslog/local/tinc.conf +++ b/security/tinc/src/opnsense/service/templates/OPNsense/Syslog/local/tinc.conf @@ -3,4 +3,4 @@ ################################################################### filter f_local_tinc { program("tinc.*"); -}; \ No newline at end of file +}; From 0c67e9db298649fba190d2fddbf69e7dd5c1923e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=84?= <1109954+Xeroxxx@users.noreply.github.com> Date: Fri, 15 May 2020 11:19:53 +0200 Subject: [PATCH 0103/3088] snort-vrt: Update rulesfile (#1835) Update rulesfile. 2990 does not exist anymore. 29151 works best with suricata 4.1.8 and 5.0.3 --- .../src/opnsense/scripts/suricata/metadata/rules/snort-vrt.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/intrusion-detection-content-snort-vrt/src/opnsense/scripts/suricata/metadata/rules/snort-vrt.xml b/security/intrusion-detection-content-snort-vrt/src/opnsense/scripts/suricata/metadata/rules/snort-vrt.xml index d1a9ab81ba..699ef07494 100644 --- a/security/intrusion-detection-content-snort-vrt/src/opnsense/scripts/suricata/metadata/rules/snort-vrt.xml +++ b/security/intrusion-detection-content-snort-vrt/src/opnsense/scripts/suricata/metadata/rules/snort-vrt.xml @@ -123,6 +123,6 @@ - + From 4c79d89c8f07b78eb2bca955b67ead727c67406f Mon Sep 17 00:00:00 2001 From: Maarten den Braber Date: Sat, 16 May 2020 23:36:37 +0200 Subject: [PATCH 0104/3088] Add Acmeproxy DNS provider dialogs --- .../AcmeClient/forms/dialogValidation.xml | 20 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 12 ++++++++++- .../OPNsense/AcmeClient/certhelper.php | 7 ++++++- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 3b2f618ef2..25d472bfb9 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1008,6 +1008,26 @@ text Specify the custom ACME DNS Update URL, i.e. https://auth.acme-dns.io/update (optional) + + + header + + + + validation.dns_acmeproxy_endpoint + + text + Specify the acmeproxy endpoint URL, i.e. https://acmeproxy.examp + + validation.dns_acmeproxy_username + + text + + + validation.dns_acmeproxy_password + + password + header diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 4bf12717fd..3b4228b3a0 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -358,6 +358,7 @@ dns_nsupdate ACME DNS API + Acmeproxy API Alwaysdata.com API aliyun.com API AutoDNS (InterNetX) API @@ -847,7 +848,16 @@ N - + + N + + + N + + + N + + N diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 9abdd32e8e..d297b4ade2 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -653,7 +653,12 @@ function run_acme_validation($certObj, $valObj, $acctObj) $proc_env['ACMEDNS_SUBDOMAIN'] = (string)$valObj->dns_acmedns_subdomain; $proc_env['ACMEDNS_UPDATE_URL'] = (string)$valObj->dns_acmedns_updateurl; break; - case 'dns_ad': + case 'dns_acmeproxy': + $proc_env['ACMEPROXY_ENDPOINT'] = (string)$valObj->dns_acmeproxy_endpoint; + $proc_env['ACMEPROXY_USERNAME'] = (string)$valObj->dns_acmeproxy_username; + $proc_env['ACMEPROXY_PASSWORD'] = (string)$valObj->dns_acmeproxy_password; + break; + case 'dns_ad': $proc_env['AD_API_KEY'] = (string)$valObj->dns_ad_key; break; case 'dns_ali': From ce5c6be647bc171fffa65c03b50b28650f656f6c Mon Sep 17 00:00:00 2001 From: Maarten den Braber Date: Sat, 16 May 2020 23:38:14 +0200 Subject: [PATCH 0105/3088] Fix formatting issue --- .../src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index d297b4ade2..e5a2657ff1 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -658,7 +658,7 @@ function run_acme_validation($certObj, $valObj, $acctObj) $proc_env['ACMEPROXY_USERNAME'] = (string)$valObj->dns_acmeproxy_username; $proc_env['ACMEPROXY_PASSWORD'] = (string)$valObj->dns_acmeproxy_password; break; - case 'dns_ad': + case 'dns_ad': $proc_env['AD_API_KEY'] = (string)$valObj->dns_ad_key; break; case 'dns_ali': From 6628f93fc11570cb0c5b35b24651fb738bba3274 Mon Sep 17 00:00:00 2001 From: Maarten den Braber Date: Sat, 16 May 2020 23:39:28 +0200 Subject: [PATCH 0106/3088] Tabs to spaces --- .../opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 3b4228b3a0..e093a34948 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -857,7 +857,7 @@ N - + N From cf1828bc028017d66c57a876eebfe899fac7f4da Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 18 May 2020 09:49:50 +0200 Subject: [PATCH 0107/3088] post merge fixes for #1838 --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 25d472bfb9..c45394a474 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1009,7 +1009,7 @@ Specify the custom ACME DNS Update URL, i.e. https://auth.acme-dns.io/update (optional) - + header @@ -1017,8 +1017,9 @@ validation.dns_acmeproxy_endpoint text - Specify the acmeproxy endpoint URL, i.e. https://acmeproxy.examp - + Specify the acmeproxy endpoint URL, i.e. https://acmeproxy.example.com/ + + validation.dns_acmeproxy_username text From 8611398aaa8340439bcd9514346195a329e9285a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 18 May 2020 09:50:05 +0200 Subject: [PATCH 0108/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 32c1cd94f0..f85e6913ac 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 1.31 +PLUGIN_VERSION= 1.32 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From 2a8b0a58edbd9386b8951b6201e1fa913fe88a4c Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 18 May 2020 15:31:18 +0200 Subject: [PATCH 0109/3088] stunnel: initial release (#1840) * stunnel: boilerplate for https://github.com/opnsense/plugins/issues/1829 * stunnel: work in progress for https://github.com/opnsense/plugins/issues/1829 * stunnel: add service control and acl for https://github.com/opnsense/plugins/issues/1829 * stunnel: add cipher selection for https://github.com/opnsense/plugins/issues/1829 Since stunnel uses different parameter pairs for TLSv1.[1,2] and TLSv1.3, we'll try to sort them out in our config template. When no TLSv1.3 ciphers are allowed, we should limit the sslVersionMax parameter as well as it seems. * stunnel: set TLS1.2 as minimum * stunnel: disable rc conf when no services are active https://github.com/opnsense/plugins/issues/1829 * stunnel: CRL support for https://github.com/opnsense/plugins/issues/1829 * stunnel: simplify cert creation, combine cert+key in one file. for https://github.com/opnsense/plugins/issues/1829 * stunnel: syslog and log viewer for https://github.com/opnsense/plugins/issues/1829 * stunnel: add hasync anchor, for https://github.com/opnsense/plugins/issues/1829 --- security/stunnel/Makefile | 8 ++ security/stunnel/pkg-descr | 2 + .../src/etc/inc/plugins.inc.d/stunnel.inc | 107 ++++++++++++++++++ .../Stunnel/Api/ServiceController.php | 42 +++++++ .../Stunnel/Api/ServicesController.php | 80 +++++++++++++ .../OPNsense/Stunnel/ServicesController.php | 39 +++++++ .../OPNsense/Stunnel/forms/dialogService.xml | 69 +++++++++++ .../app/models/OPNsense/Stunnel/ACL/ACL.xml | 9 ++ .../app/models/OPNsense/Stunnel/Menu/Menu.xml | 8 ++ .../app/models/OPNsense/Stunnel/Stunnel.php | 35 ++++++ .../app/models/OPNsense/Stunnel/Stunnel.xml | 73 ++++++++++++ .../app/views/OPNsense/Stunnel/services.volt | 89 +++++++++++++++ .../scripts/stunnel/generate_certs.php | 82 ++++++++++++++ .../conf/actions.d/actions_stunnel.conf | 29 +++++ .../templates/OPNsense/Stunnel/+TARGETS | 2 + .../templates/OPNsense/Stunnel/rc.conf.d | 12 ++ .../templates/OPNsense/Stunnel/stunnel.conf | 44 +++++++ .../OPNsense/Syslog/local/stunnel.conf | 6 + 18 files changed, 736 insertions(+) create mode 100644 security/stunnel/Makefile create mode 100644 security/stunnel/pkg-descr create mode 100644 security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc create mode 100644 security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServiceController.php create mode 100644 security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php create mode 100644 security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php create mode 100644 security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml create mode 100644 security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/ACL/ACL.xml create mode 100644 security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Menu/Menu.xml create mode 100644 security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.php create mode 100644 security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml create mode 100644 security/stunnel/src/opnsense/mvc/app/views/OPNsense/Stunnel/services.volt create mode 100755 security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php create mode 100644 security/stunnel/src/opnsense/service/conf/actions.d/actions_stunnel.conf create mode 100644 security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/+TARGETS create mode 100644 security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/rc.conf.d create mode 100644 security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf create mode 100644 security/stunnel/src/opnsense/service/templates/OPNsense/Syslog/local/stunnel.conf diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile new file mode 100644 index 0000000000..d2a57c52b5 --- /dev/null +++ b/security/stunnel/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= stunnel +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= stunnel TLS proxy +PLUGIN_MAINTAINER= ad@opnsense.org +PLUGIN_DEPENDS= stunnel +PLUGIN_DEVEL= yes + +.include "../../Mk/plugins.mk" diff --git a/security/stunnel/pkg-descr b/security/stunnel/pkg-descr new file mode 100644 index 0000000000..c25f04950c --- /dev/null +++ b/security/stunnel/pkg-descr @@ -0,0 +1,2 @@ +Stunnel is a proxy designed to add TLS encryption functionality to existing clients and servers without any changes in the programs' code. +(https://www.stunnel.org/) diff --git a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc new file mode 100644 index 0000000000..822abd73db --- /dev/null +++ b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc @@ -0,0 +1,107 @@ + array('stunnel_refresh_crls') + ); +} + +function stunnel_refresh_crls() +{ + $stunnel = new OPNsense\Stunnel\Stunnel(); + $configObj = OPNsense\Core\Config::getInstance()->object(); + foreach ($stunnel->services->service->__items as $service) { + if (!empty((string)$service->enabled) && !empty((string)$service->enableCRL)) { + foreach (explode(",", (string)$service->cacert) as $cacert) { + $this_ca = null; + if (!empty($configObj->ca)) { + foreach ($configObj->ca as $ca) { + if ((string)$ca->refid == $cacert && !empty((string)$ca->prv)) { + $this_ca = $ca; + } + } + } + if ($this_ca) { + $ca_hash = null; + $ca_crt = base64_decode((string)$this_ca->crt); + $ca_key = base64_decode((string)$this_ca->prv); + $process = proc_open("openssl x509 -hash -noout", [["pipe", "r"], ["pipe", "w"]], $pipes); + if (is_resource($process)) { + fwrite($pipes[0], $ca_crt); + fclose($pipes[0]); + $ca_hash = trim(stream_get_contents($pipes[1])); + fclose($pipes[1]); + proc_close($process); + } + if ($ca_hash) { + $crlres = openssl_crl_new($ca_crt, 0, 9999); + if (!empty($configObj->crl)) { + foreach ($configObj->crl as $crl) { + if ($crl->caref == $cacert && !empty((string)$crl->cert)) { + foreach ($crl->cert as $cert) { + openssl_crl_revoke_cert( + $crlres, + base64_decode((string)$cert->crt), + (string)$cert->revoke_time, + (string)$cert->reason + ); + } + } + } + } + $crl_text = ""; + openssl_crl_export($crlres, $crl_text, $ca_key); + file_put_contents("/var/run/stunnel/certs/{$ca_hash}.r0", $crl_text); + } + } + } + } + } +} + +function stunnel_syslog() +{ + $logfacilities = array(); + $logfacilities['stunnel'] = array( + 'facility' => array('stunnel') + ); + return $logfacilities; +} + +function stunnel_xmlrpc_sync() +{ + $result = array(); + $result[] = array( + 'description' => gettext('Stunnel'), + 'section' => 'OPNsense.Stunnel', + 'id' => 'stunnel', + ); + return $result; +} diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServiceController.php b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServiceController.php new file mode 100644 index 0000000000..dc1ba13c9e --- /dev/null +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServiceController.php @@ -0,0 +1,42 @@ +getModel()->general->enabled = "0"; + foreach ($this->getModel()->services->service->__items as $service) { + if ((string)$service->enabled == "1") { + $this->getModel()->general->enabled = "1"; + break; + } + } + parent::save(); + } + + public function searchItemAction() + { + return $this->searchBase("services.service", array('enabled', 'description'), "description"); + } + + public function setItemAction($uuid) + { + return $this->setBase("service", "services.service", $uuid); + } + + public function addItemAction() + { + return $this->addBase("service", "services.service"); + } + + public function getItemAction($uuid = null) + { + return $this->getBase("service", "services.service", $uuid); + } + + public function delItemAction($uuid) + { + return $this->delBase("services.service", $uuid); + } + + public function toggleItemAction($uuid, $enabled = null) + { + return $this->toggleBase("services.service", $uuid, $enabled); + } +} diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php new file mode 100644 index 0000000000..dfb898991b --- /dev/null +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php @@ -0,0 +1,39 @@ +view->pick('OPNsense/Stunnel/services'); + $this->view->formDialogService = $this->getForm("dialogService"); + } +} diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml new file mode 100644 index 0000000000..9d32302804 --- /dev/null +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml @@ -0,0 +1,69 @@ +
+ + service.enabled + + checkbox + Enable this rule + + + service.accept_address + + text + If possible, a loopback address is the safest choice here, you can forward traffic to it using the firewall. + + + service.accept_port + + text + The port on which connections will be accepted. + + + service.connect_address + + text + The other end of this tunnel. + + + service.connect_port + + text + The port to forward traffic to. + + + service.servercert + + dropdown + + + + service.cacert + + select_multiple + CA Manager.]]> + + + service.enableCRL + + checkbox + + + + service.ciphers + + select_multiple + + true + + + service.description + + text + +
diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/ACL/ACL.xml b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/ACL/ACL.xml new file mode 100644 index 0000000000..8193662ca0 --- /dev/null +++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + Services: Stunnel + + ui/stunnel/* + api/stunnel/* + + + diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Menu/Menu.xml b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Menu/Menu.xml new file mode 100644 index 0000000000..6cd50fa8c7 --- /dev/null +++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Menu/Menu.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.php b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.php new file mode 100644 index 0000000000..b4075e267a --- /dev/null +++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.php @@ -0,0 +1,35 @@ + + //OPNsense/Stunnel + 1.0.0 + MFP + + OPNsense firewall filter rules + + + + + 1 + Y + + + + + + 1 + Y + + + 1 + 65535 + port needs to be an integer value between 1 and 65535 + Y + + + Y + N + 127.0.0.1 + + + Y + + + 1 + 65535 + port needs to be an integer value between 1 and 65535 + Y + + + N + Y + ca + Please select a valid certificate from the list + + + 0 + Y + + + TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,DHE-RSA-AES128-GCM-SHA256,DHE-RSA-AES256-GCM-SHA384 + Y + Y + stunnel ssl ciphers + /tmp/stunnel_ciphers_list.json + 360 + Please specify valid tls ciphers. + + + Y + cert + Please select a valid certificate from the list + + + N + /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u + Description should be a string between 1 and 255 characters + + + + + diff --git a/security/stunnel/src/opnsense/mvc/app/views/OPNsense/Stunnel/services.volt b/security/stunnel/src/opnsense/mvc/app/views/OPNsense/Stunnel/services.volt new file mode 100644 index 0000000000..fd6ba46c47 --- /dev/null +++ b/security/stunnel/src/opnsense/mvc/app/views/OPNsense/Stunnel/services.volt @@ -0,0 +1,89 @@ +{# + # Copyright (c) 2020 Deciso B.V. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} + + + + + +
+
+ + + + + + + + + + + + + + + + + + +
{{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Description') }}{{ lang._('Commands') }}
+ + +
+
+
+ +
+ +

+
+
+ + +{{ partial("layout_partials/base_dialog",['fields':formDialogService, 'id':'DialogService','label':lang._('Edit Service')])}} diff --git a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php new file mode 100755 index 0000000000..b84979a964 --- /dev/null +++ b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php @@ -0,0 +1,82 @@ +#!/usr/local/bin/php +object(); +$all_certs = []; +foreach ($stunnel->services->service->__items as $service) { + if (!empty((string)$service->enabled)) { + $this_uuid = $service->getAttributes()['uuid']; + $srv_certid = (string)$service->servercert; + foreach ($configObj->cert as $cert) { + if ($srv_certid == (string)$cert->refid) { + $all_certs["{$base_path}/{$this_uuid}.crt"] = + base64_decode((string)$cert->crt) . "\n" . base64_decode((string)$cert->prv); + } + } + if (!empty((string)$service->cacert)) { + $all_certs["{$base_path}/{$this_uuid}.ca"] = ""; + foreach (explode(",", (string)$service->cacert) as $caid) { + foreach ($configObj->ca as $ca) { + if ((string)$ca->refid == $caid) { + $all_certs["{$base_path}/{$this_uuid}.ca"] .= base64_decode((string)$ca->crt)."\n"; + } + } + } + } + } +} + +if (!is_dir("/usr/local/etc/stunnel/certs")) { + mkdir("/usr/local/etc/stunnel/certs", 0700, true); + chown("/usr/local/etc/stunnel/certs", "stunnel"); + chgrp("/usr/local/etc/stunnel/certs", "stunnel"); +} + +// cleanup stunnel cert directory +foreach (glob("{$base_path}/*") as $filename) { + if (!isset($all_certs[$filename])) { + unlink($filename); + } +} + +foreach($all_certs as $filename => $content) { + file_put_contents($filename, $content); + chown($filename, "stunnel"); +} + +// trigger certificate revocation lists update +plugins_configure('crl'); diff --git a/security/stunnel/src/opnsense/service/conf/actions.d/actions_stunnel.conf b/security/stunnel/src/opnsense/service/conf/actions.d/actions_stunnel.conf new file mode 100644 index 0000000000..ac583ea670 --- /dev/null +++ b/security/stunnel/src/opnsense/service/conf/actions.d/actions_stunnel.conf @@ -0,0 +1,29 @@ +[ssl.ciphers] +command:/usr/local/opnsense/scripts/system/ssl_ciphers.py --format=key_value +parameters: +type:script_output +message:List SSL ciphers + +[start] +command:/usr/local/etc/rc.d/stunnel start +parameters: +type:script +message:stunnel service start + +[stop] +command:/usr/local/etc/rc.d/stunnel stop +parameters: +type:script +message:stunnel service stop + +[restart] +command:/usr/local/etc/rc.d/stunnel restart +parameters: +type:script +message:stunnel service restart + +[status] +command:/usr/local/etc/rc.d/stunnel status; exit 0 +parameters: +type:script_output +message:stunnel status diff --git a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/+TARGETS b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/+TARGETS new file mode 100644 index 0000000000..177c36ce4a --- /dev/null +++ b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/+TARGETS @@ -0,0 +1,2 @@ +stunnel.conf:/usr/local/etc/stunnel/stunnel.conf +rc.conf.d:/etc/rc.conf.d/stunnel diff --git a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/rc.conf.d b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/rc.conf.d new file mode 100644 index 0000000000..874ae1b74d --- /dev/null +++ b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/rc.conf.d @@ -0,0 +1,12 @@ +{% if not helpers.empty('OPNsense.Stunnel.general.enabled') %} +stunnel_enable="YES" +stunnel_pidfile="/var/run/stunnel/stunnel.pid" + +mkdir -p /var/run/stunnel/certs +chown -R stunnel:stunnel /var/run/stunnel +chmod -R 700 /var/run/stunnel + +/usr/local/opnsense/scripts/stunnel/generate_certs.php > /dev/null 2>&1 +{% else %} +stunnel_enable="NO" +{% endif %} diff --git a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf new file mode 100644 index 0000000000..4f89d541e7 --- /dev/null +++ b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf @@ -0,0 +1,44 @@ +setuid = stunnel +setgid = stunnel +chroot = /var/run/stunnel +pid = /stunnel.pid +debug = info +logId = unique + + +{% if helpers.exists('OPNsense.Stunnel.services.service') %} +{% for service in helpers.toList('OPNsense.Stunnel.services.service') %} +{% if service.enabled|default('0') == '1' %} + + +; ************************************************************************** +; * {{ service.description }} +; ************************************************************************** +[{{service['@uuid']}}] +accept = {% if service.accept_address %}{{service.accept_address}}:{% endif %}{{service.accept_port}} +connect = {% if service.connect_address.find(":") > -1 %}[{{service.connect_address}}]{% else %}{{service.connect_address}}{% endif %}:{{service.connect_port}} +cert = /usr/local/etc/stunnel/certs/{{service['@uuid']}}.crt +{% if service.cacert|default('') != '' %} +CAfile = /usr/local/etc/stunnel/certs/{{service['@uuid']}}.ca +requireCert = yes +verifyChain = yes +{% if service.enableCRL|default('0') == '1' %} +CRLpath = /certs/ +{% endif %} +{% endif %} +{% set ciphers =[] %} +{% set ciphersuites =[] %} +{% for cipher in service.ciphers.split(',') %} +{% if cipher.startswith('TLS') %} +{% do ciphersuites.append(cipher) %} +{% else %} +{% do ciphers.append(cipher) %} +{% endif %} +{% endfor %} +ciphers = {{ ciphers|join(':') }} +ciphersuites = {{ ciphersuites|join(':') }} +sslVersionMin=TLSv1.2 +sslVersionMax={% if ciphersuites %}TLSv1.3{% else %}TLSv1.2{% endif %} +{% endif %} +{% endfor %} +{% endif %} diff --git a/security/stunnel/src/opnsense/service/templates/OPNsense/Syslog/local/stunnel.conf b/security/stunnel/src/opnsense/service/templates/OPNsense/Syslog/local/stunnel.conf new file mode 100644 index 0000000000..96af65e4d1 --- /dev/null +++ b/security/stunnel/src/opnsense/service/templates/OPNsense/Syslog/local/stunnel.conf @@ -0,0 +1,6 @@ +################################################################### +# Local syslog-ng configuration filter definition [stunnel]. +################################################################### +filter f_local_stunnel { + program("stunnel"); +}; From 1a791fb9986a31ed19bd2c8f3becc16615240c6d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 18 May 2020 16:38:36 +0200 Subject: [PATCH 0110/3088] net/firewall: style update --- .../controllers/OPNsense/Firewall/Api/FilterController.php | 1 - .../OPNsense/Firewall/Api/SourceNatController.php | 1 - .../OPNsense/Firewall/FieldTypes/SourceNatRuleField.php | 1 - .../app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php | 6 ++++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php index 28e4151a78..225a07b723 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php @@ -27,7 +27,6 @@ */ namespace OPNsense\Firewall\Api; - class FilterController extends FilterBaseController { public function searchRuleAction() diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php index f55640e989..151bf14db6 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php @@ -27,7 +27,6 @@ */ namespace OPNsense\Firewall\Api; - class SourceNatController extends FilterBaseController { public function searchRuleAction() diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/SourceNatRuleField.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/SourceNatRuleField.php index 7d7b6df4b9..f00fb1c980 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/SourceNatRuleField.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/SourceNatRuleField.php @@ -28,7 +28,6 @@ * */ - namespace OPNsense\Firewall\FieldTypes; use OPNsense\Base\FieldTypes\ArrayField; diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php index d3db9e86f2..2e33d2f7c4 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_0.php @@ -39,8 +39,10 @@ public function post($model) { // Move OPNsense->Firewall->FilterRule ---> OPNsense->Firewall->Filter $cfgObj = Config::getInstance()->object(); - if (!empty($cfgObj->OPNsense) && !empty($cfgObj->OPNsense->Firewall) - && !empty($cfgObj->OPNsense->Firewall->FilterRule)) { + if ( + !empty($cfgObj->OPNsense) && !empty($cfgObj->OPNsense->Firewall) + && !empty($cfgObj->OPNsense->Firewall->FilterRule) + ) { // model migration created a new, empty rules section if (empty($cfgObj->OPNsense->Firewall->Filter->rules)) { unset($cfgObj->OPNsense->Firewall->Filter->rules); From 7f90141b600b3fd3e8597816d83bb686cf959834 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 18 May 2020 16:40:47 +0200 Subject: [PATCH 0111/3088] security/stunnel: style and sync --- README.md | 1 + security/stunnel/Makefile | 2 +- security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc | 4 ++-- .../controllers/OPNsense/Stunnel/Api/ServicesController.php | 2 +- .../app/controllers/OPNsense/Stunnel/ServicesController.php | 1 + .../stunnel/src/opnsense/scripts/stunnel/generate_certs.php | 4 ++-- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 31cc612ce8..809eb8cc35 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ security/intrusion-detection-content-snort-vrt -- IDS Snort VRT ruleset (needs r security/maltrail -- Malicious traffic detection system security/openconnect -- OpenConnect Client security/softether -- Cross-platform Multi-protocol VPN Program (development only) +security/stunnel -- stunnel TLS proxy (development only) security/tinc -- Tinc VPN security/tor -- The Onion Router sysutils/api-backup -- Provide the functionality to download the config.xml diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index d2a57c52b5..25f1769de3 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -2,7 +2,7 @@ PLUGIN_NAME= stunnel PLUGIN_VERSION= 0.1 PLUGIN_COMMENT= stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org -PLUGIN_DEPENDS= stunnel +PLUGIN_DEPENDS= stunnel PLUGIN_DEVEL= yes .include "../../Mk/plugins.mk" diff --git a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc index 822abd73db..364caa028d 100644 --- a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc +++ b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc @@ -28,9 +28,9 @@ function stunnel_configure() { - return array( + return array( 'crl' => array('stunnel_refresh_crls') - ); + ); } function stunnel_refresh_crls() diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php index 30a0047b99..c0ed5b2dbb 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php @@ -28,7 +28,7 @@ namespace OPNsense\Stunnel\Api; -use \OPNsense\Base\ApiMutableModelControllerBase; +use OPNsense\Base\ApiMutableModelControllerBase; class ServicesController extends ApiMutableModelControllerBase { diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php index dfb898991b..caf2b73be1 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php @@ -27,6 +27,7 @@ */ namespace OPNsense\Stunnel; + use OPNsense\Base\{IndexController}; class ServicesController extends IndexController diff --git a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php index b84979a964..b1166611ec 100755 --- a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php +++ b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php @@ -52,7 +52,7 @@ foreach (explode(",", (string)$service->cacert) as $caid) { foreach ($configObj->ca as $ca) { if ((string)$ca->refid == $caid) { - $all_certs["{$base_path}/{$this_uuid}.ca"] .= base64_decode((string)$ca->crt)."\n"; + $all_certs["{$base_path}/{$this_uuid}.ca"] .= base64_decode((string)$ca->crt) . "\n"; } } } @@ -73,7 +73,7 @@ } } -foreach($all_certs as $filename => $content) { +foreach ($all_certs as $filename => $content) { file_put_contents($filename, $content); chown($filename, "stunnel"); } From 5c004cae08daaa7f2ac743eade1dbe2c1372528d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 May 2020 08:55:21 +0200 Subject: [PATCH 0112/3088] security/tinc: bump revision after changes --- security/tinc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/security/tinc/Makefile b/security/tinc/Makefile index fe9f6ac4be..b624156459 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= tinc PLUGIN_VERSION= 1.5 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org From 85329069be8fda10412be2f730a1b04a522671e9 Mon Sep 17 00:00:00 2001 From: Maurice Walker Date: Wed, 20 May 2020 10:48:11 +0200 Subject: [PATCH 0113/3088] net/tayga, register virtual interface (#1826) --- net/tayga/Makefile | 4 ++-- net/tayga/pkg-descr | 4 ++++ net/tayga/src/etc/inc/plugins.inc.d/tayga.inc | 16 ++++++++++++++++ .../mvc/app/models/OPNsense/Tayga/General.xml | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/net/tayga/Makefile b/net/tayga/Makefile index b499deb846..6945498327 100644 --- a/net/tayga/Makefile +++ b/net/tayga/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= tayga -PLUGIN_VERSION= 1.0 -PLUGIN_COMMENT= Tayga IPv6 64NAT +PLUGIN_VERSION= 1.1 +PLUGIN_COMMENT= Tayga NAT64 PLUGIN_DEPENDS= tayga PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/tayga/pkg-descr b/net/tayga/pkg-descr index 712b410c67..0ba5d319c5 100644 --- a/net/tayga/pkg-descr +++ b/net/tayga/pkg-descr @@ -7,6 +7,10 @@ networks where dedicated NAT64 hardware would be overkill. Plugin Changelog ================ +1.1 + +* Register Tayga virtual interface + 1.0 * Support for IPv6 prefix and IPv4 pool diff --git a/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc b/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc index 9938b03cf6..88f8e5bcda 100644 --- a/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc +++ b/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc @@ -61,3 +61,19 @@ function tayga_xmlrpc_sync() $result['description'] = gettext('Tayga'); return array($result); } + +function tayga_interfaces() +{ + $interfaces = array(); + if (!tayga_enabled()) { + return $interfaces; + } + $oic = array('enable' => true); + $oic['if'] = 'nat64'; + $oic['descr'] = 'Tayga'; + $oic['type'] = 'none'; + $oic['virtual'] = true; + $oic['networks'] = array(); + $interfaces['tayga'] = $oic; + return $interfaces; +} diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml index 8ce7919d6d..63680a3dbb 100644 --- a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml @@ -23,7 +23,7 @@ Y - 2001:db8:1:ffff::/96 + 64:ff9b::/96 Y From ee799d8c75f7aaffaee97439c95fd98263eb1b38 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 22 May 2020 09:16:47 +0200 Subject: [PATCH 0114/3088] security/acme-client: fix #1844 --- .../scripts/OPNsense/AcmeClient/certhelper.php | 6 +++--- .../scripts/OPNsense/AcmeClient/upload_sftp.php | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index e5a2657ff1..997b7fb3c2 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -1418,14 +1418,14 @@ function run_restart_actions($certlist, $modelObj) if (empty((string)$action->configd)) { log_error("AcmeClient: no configd command specified for automation: " . $action->name); $result = '1'; - continue; // Continue with next action. + } else { + $response = $backend->configdRun((string)$action->configd); } - $response = $backend->configdRun((string)$action->configd); break; default: log_error("AcmeClient: an invalid automation was specified: " . (string)$action->type); $return = 1; - continue; // Continue with next action. + break; } } } diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php index ede2859817..e7899a4364 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php @@ -296,16 +296,17 @@ function uploadCertificatesToHost(array $options): int Utils::log()->error("Failed on " . json_encode($uploader->current(), JSON_UNESCAPED_SLASHES)); switch ($result) { - case SftpUploader::UPLOAD_ERROR_CHGRP_FAILED: - case SftpUploader::UPLOAD_ERROR_CHMOD_FAILED: - case SftpUploader::UPLOAD_ERROR_NO_OVERWRITE: - continue; - case SftpUploader::UPLOAD_ERROR_NO_PERMISSION: return EXITCODE_ERROR_NO_PERMISSION; case SftpUploader::UPLOAD_ERROR: return EXITCODE_ERROR; + + case SftpUploader::UPLOAD_ERROR_CHGRP_FAILED: + case SftpUploader::UPLOAD_ERROR_CHMOD_FAILED: + case SftpUploader::UPLOAD_ERROR_NO_OVERWRITE: + default: + break; } } else { break; From aa8ff3e50869a1c37ad8d056a7d210c5f3aaf4f6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 22 May 2020 09:18:24 +0200 Subject: [PATCH 0115/3088] security/acme-client: also bump revision --- security/acme-client/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index f85e6913ac..b0a5d54064 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= acme-client PLUGIN_VERSION= 1.32 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From 3d4416cf260d40112afca1996db139932342ec5a Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 22 May 2020 13:12:28 +0200 Subject: [PATCH 0116/3088] Stunnel: add identd (#1845) stunnel: add identd service and plumbing --- .../src/etc/inc/plugins.inc.d/stunnel.inc | 35 +++- security/stunnel/src/etc/rc.d/identd_stunnel | 55 ++++++ .../Stunnel/Api/ServicesController.php | 11 +- .../OPNsense/Stunnel/ServicesController.php | 1 + .../OPNsense/Stunnel/forms/general.xml | 21 ++ .../app/models/OPNsense/Stunnel/Stunnel.xml | 8 + .../app/views/OPNsense/Stunnel/services.volt | 22 ++- .../scripts/stunnel/identd_stunnel.py | 183 ++++++++++++++++++ .../conf/actions.d/actions_stunnel.conf | 8 +- .../templates/OPNsense/Stunnel/+TARGETS | 2 + .../OPNsense/Stunnel/identd.rc.conf.d | 6 + .../templates/OPNsense/Stunnel/rc.conf.d | 1 + .../templates/OPNsense/Stunnel/stunnel.conf | 6 +- .../Stunnel/syslog-ng-stunnel-ident.conf | 22 +++ 14 files changed, 372 insertions(+), 9 deletions(-) create mode 100755 security/stunnel/src/etc/rc.d/identd_stunnel create mode 100644 security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/general.xml create mode 100755 security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py create mode 100644 security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/identd.rc.conf.d create mode 100644 security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/syslog-ng-stunnel-ident.conf diff --git a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc index 364caa028d..faa26282eb 100644 --- a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc +++ b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc @@ -33,6 +33,39 @@ function stunnel_configure() ); } +function stunnel_services() +{ + $services = array(); + $mdl = new \OPNsense\Stunnel\Stunnel(); + if ($mdl->general->enabled == '1') { + $services[] = array( + 'description' => gettext('Stunnel'), + 'stunnel' => array( + 'restart' => array('stunnel restart'), + 'start' => array('stunnel start'), + 'stop' => array('stunnel stop'), + ), + 'name' => 'stunnel', + 'pidfile' => '/var/run/stunnel/stunnel.pid', + ); + if ($mdl->general->enable_ident_server == '1') { + // only report status from identd seperately, control is combined with stunnel + $services[] = array( + 'description' => gettext('Identd (stunnel)'), + 'stunnel' => array( + 'restart' => array('stunnel restart'), + 'start' => array('stunnel start'), + 'stop' => array('stunnel stop'), + ), + 'name' => 'identd_stunnel', + 'pidfile' => '/var/run/stunnel_identd.pid', + ); + } + } + return $services; +} + + function stunnel_refresh_crls() { $stunnel = new OPNsense\Stunnel\Stunnel(); @@ -90,7 +123,7 @@ function stunnel_syslog() { $logfacilities = array(); $logfacilities['stunnel'] = array( - 'facility' => array('stunnel') + 'facility' => array('stunnel', 'identd_stunnel') ); return $logfacilities; } diff --git a/security/stunnel/src/etc/rc.d/identd_stunnel b/security/stunnel/src/etc/rc.d/identd_stunnel new file mode 100755 index 0000000000..003c2c3c4a --- /dev/null +++ b/security/stunnel/src/etc/rc.d/identd_stunnel @@ -0,0 +1,55 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: identd_stunnel +# REQUIRE: SERVERS +# KEYWORD: shutdown +# + +. /etc/rc.subr + +name=identd_stunnel +rcvar=identd_stunnel_enable +command=/usr/local/opnsense/scripts/stunnel/identd_stunnel.py +command_interpreter=/usr/local/bin/python3 +pidfile="/var/run/${name}.pid" +load_rc_config $name + +# Set defaults +: ${identd_stunnel_enable:=NO} + +stop_cmd=identd_stunnel_stop + +# kill configd +identd_stunnel_stop() +{ + if [ -z "$rc_pid" ]; then + [ -n "$rc_fast" ] && return 0 + _run_rc_notrunning + return 1 + fi + + echo -n "Stopping ${name}." + # first ask gently to exit + kill -15 ${rc_pid} + + # wait max 5 seconds for gentle exit + for i in $(seq 1 50); + do + if [ -z "`/bin/ps -ax | /usr/bin/awk '{print $1;}' | /usr/bin/grep "^${rc_pid}"`" ]; then + break + fi + sleep 0.1 + done + + # kill any remaining identd_stunnel processes (if still running) + for identd_stunnel_pid in `/bin/ps -ax | grep 'identd_stunnel.py' | /usr/bin/awk '{print $1;}' ` + do + kill -9 $identd_stunnel_pid >/dev/null 2>&1 + done + + echo "..done" +} + +run_rc_command $1 diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php index c0ed5b2dbb..c84ae5cfb1 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php @@ -45,7 +45,7 @@ protected function save() break; } } - parent::save(); + return parent::save(); } public function searchItemAction() @@ -77,4 +77,13 @@ public function toggleItemAction($uuid, $enabled = null) { return $this->toggleBase("services.service", $uuid, $enabled); } + + public function getAction() + { + $result = array(); + $result[static::$internalModelName] = [ + "general" => $this->getModel()->general->getNodes() + ]; + return $result; + } } diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php index caf2b73be1..e693259d31 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/ServicesController.php @@ -36,5 +36,6 @@ public function indexAction() { $this->view->pick('OPNsense/Stunnel/services'); $this->view->formDialogService = $this->getForm("dialogService"); + $this->view->formGeneral = $this->getForm("general"); } } diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/general.xml b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/general.xml new file mode 100644 index 0000000000..958e5a830a --- /dev/null +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/general.xml @@ -0,0 +1,21 @@ +
+ + stunnel.general.chroot + + checkbox + Start stunnel in it a chroot, although this is a more secure option there are small points of attention before + using this. Since system logging is detached after startup, stunnel seems to have difficulties handing syslog configuration changes + which need a service restart. If this happens, you need to restart stunnel manually as well. + + + + stunnel.general.enable_ident_server + + checkbox + Enable internal ident service (rfc1413), which tracks authenticated tcp sessions and returns the associated user + of the certificate used by stunnel (cn part). When enabled, this service listens on port tcp/113 and accepts port pairs as defined by rfc1413. + Make sure you deny untrusted clients access to this facility, usually it only makes sense to allow access from this + firewall (allowed by default). + + +
diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml index b17406bbb4..b76adc6c5a 100644 --- a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml +++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml @@ -11,6 +11,14 @@ 1 Y + + 0 + Y + + + 0 + Y + diff --git a/security/stunnel/src/opnsense/mvc/app/views/OPNsense/Stunnel/services.volt b/security/stunnel/src/opnsense/mvc/app/views/OPNsense/Stunnel/services.volt index fd6ba46c47..fe9967c40c 100644 --- a/security/stunnel/src/opnsense/mvc/app/views/OPNsense/Stunnel/services.volt +++ b/security/stunnel/src/opnsense/mvc/app/views/OPNsense/Stunnel/services.volt @@ -35,14 +35,30 @@ toggle:'/api/stunnel/services/toggleItem/' } ); - $("#reconfigureAct").SimpleActionButton(); + $("#reconfigureAct").SimpleActionButton({ + onPreAction: function() { + const dfObj = new $.Deferred(); + saveFormToEndpoint("/api/stunnel/services/set", 'frm_general_settings', function(){ + dfObj.resolve(); + }); + return dfObj; + } + }); updateServiceControlUI('stunnel'); + + let data_get_map = {'frm_general_settings':"/api/stunnel/services/get"}; + mapDataToFormUI(data_get_map).done(function(data){ + formatTokenizersUI(); + $('.selectpicker').selectpicker('refresh'); + }); + });
@@ -69,6 +85,10 @@
+
+ + {{ partial("layout_partials/base_form",['fields':formGeneral,'id':'frm_general_settings'])}} +
From 9001b6941bf76225859e87c46db79f9cc36eecf9 Mon Sep 17 00:00:00 2001 From: "Joey \"JojoXD\" Vos" Date: Tue, 26 May 2020 13:12:54 +0200 Subject: [PATCH 0122/3088] Added Telegraf InfluxDB v2 Output Support (#1849) --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 4 +++ .../OPNsense/Telegraf/forms/output.xml | 30 +++++++++++++++++++ .../app/models/OPNsense/Telegraf/Output.xml | 22 +++++++++++++- .../templates/OPNsense/Telegraf/telegraf.conf | 16 ++++++++++ 5 files changed, 72 insertions(+), 2 deletions(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index 166769c9bc..2c0dd9078f 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.7.7 +PLUGIN_VERSION= 1.8.0 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 3f381da7ea..01c12dea54 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -11,6 +11,10 @@ Kafka, MQTT, NSQ, and many others. Plugin Changelog ================ +1.8.0 + +* Add InfluxDB v2 output support + 1.7.7 * Fix log not properly parsed diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index f338190c97..4594818aec 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -35,6 +35,36 @@ text Set the password for authentication. + + output.influx_v2_enable + + checkbox + This will enable InfluxDB v2 as output. Format is without square brackets, just like http://192.168.0.1:9999. + + + output.influx_v2_url + + text + Set the URL where metrics shoud be sent to. + + + output.influx_v2_token + + text + Influx v2 authentication token. + + + output.influx_v2_organization + + text + Set the name of the organization in Influx v2. + + + output.influx_v2_bucket + + text + Set the name of the bucket in Influx v2. + output.graphite_enable diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index f50f3755e7..bd48099a43 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -1,7 +1,7 @@ //OPNsense/telegraf/output Telegraf outputs configuration - 1.3.1 + 1.4.0 0 @@ -85,5 +85,25 @@ 1 N + + 0 + N + + + + N + + + + N + + + + N + + + + N + diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index f8d01fab7f..08f6938033 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -129,6 +129,22 @@ {% endif %} {% endif %} +{% if helpers.exists('OPNsense.telegraf.output.influx_v2_enable') and OPNsense.telegraf.output.influx_v2_enable == '1' %} +[[outputs.influxdb_v2]] +{% if helpers.exists('OPNsense.telegraf.output.influx_v2_url') and OPNsense.telegraf.output.influx_v2_url != '' %} + urls = ["{{ OPNsense.telegraf.output.influx_v2_url }}"] +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.influx_v2_token') and OPNsense.telegraf.output.influx_v2_token != '' %} + token = "{{ OPNsense.telegraf.output.influx_v2_token }}" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.influx_v2_organization') and OPNsense.telegraf.output.influx_v2_organization != '' %} + organization = "{{ OPNsense.telegraf.output.influx_v2_organization }}" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.influx_v2_bucket') and OPNsense.telegraf.output.influx_v2_bucket != '' %} + bucket = "{{ OPNsense.telegraf.output.influx_v2_bucket }}" +{% endif %} +{% endif %} + {% if helpers.exists('OPNsense.telegraf.input.cpu') and OPNsense.telegraf.input.cpu == '1' %} [[inputs.cpu]] {% if helpers.exists('OPNsense.telegraf.input.cpu_percpu') and OPNsense.telegraf.input.cpu_percpu == '1' %} From 72980508a726d10cf39f2065259d315a04338f29 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 26 May 2020 21:02:37 +0200 Subject: [PATCH 0123/3088] security/stunnel prepare release version --- security/stunnel/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index ee61a98645..c308ced566 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,9 +1,7 @@ PLUGIN_NAME= stunnel -PLUGIN_VERSION= 0.2 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.0 PLUGIN_COMMENT= stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel -PLUGIN_DEVEL= yes .include "../../Mk/plugins.mk" From c46695c0301af79e02a2e376a6e005fa239ebbfa Mon Sep 17 00:00:00 2001 From: Bill Gertz Date: Thu, 28 May 2020 15:21:08 +0200 Subject: [PATCH 0124/3088] security/acme-client: Add NSUPDATE_ZONE support to nsupdate DNS-01 Service (#1851) Add NSUPDATE_ZONE nsupdate support Adds new validation.dns_nsudate_zone field to implement support for NSUPDATE_ZONE. See https://github.com/acmesh-official/acme.sh/pull/1963 for more information. --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 6 ++++++ .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 3 +++ .../src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php | 1 + 3 files changed, 10 insertions(+) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index c45394a474..fd36767e09 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -772,6 +772,12 @@ text + + validation.dns_nsupdate_zone + + text + Set hosted zone (e.g. example.com) as some DNS Providers require, like dyn.com's 'Standard DNS'. + validation.dns_nsupdate_key diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index e093a34948..2ec2e16b26 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -751,6 +751,9 @@ N + + N + N diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 997b7fb3c2..8e482c39d4 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -893,6 +893,7 @@ function run_acme_validation($certObj, $valObj, $acctObj) file_put_contents($secret_key_filename, $secret_key_data); $proc_env['NSUPDATE_KEY'] = $secret_key_filename; $proc_env['NSUPDATE_SERVER'] = (string)$valObj->dns_nsupdate_server; + $proc_env['NSUPDATE_ZONE'] = (string)$valObj->dns_nsupdate_zone; break; case 'dns_opnsense': # BIND plugin must be installed. From 2dfe7674d5dcdf7f29b3ec00133de556d24a4310 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 28 May 2020 15:23:59 +0200 Subject: [PATCH 0125/3088] security/acme-client: move optional field to the bottom, refs #1851 --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index fd36767e09..2724e0ad7c 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -772,18 +772,18 @@ text - - validation.dns_nsupdate_zone - - text - Set hosted zone (e.g. example.com) as some DNS Providers require, like dyn.com's 'Standard DNS'. - validation.dns_nsupdate_key textbox Requires the whole key file in a format that is compatible with nsupdate. + + validation.dns_nsupdate_zone + + text + Optionally set the name of the hosted zone (e.g. example.com) as some DNS Providers require, like dyn.com's 'Standard DNS'. + header From e1c15a1b20261c22d38fba860b0f39e3b2bf690a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 28 May 2020 15:24:15 +0200 Subject: [PATCH 0126/3088] security/acme-client: bump version --- security/acme-client/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index b0a5d54064..2e65ae4bcb 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 1.32 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.33 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From c47fc41b2759659929d51f862da87b58731955d6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 2 Jun 2020 10:18:49 +0200 Subject: [PATCH 0127/3088] net/frr: use FRR 7 #1768 --- net/frr/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 3a47f7843a..a808735a4a 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.14 PLUGIN_COMMENT= The FRRouting Protocol Suite -PLUGIN_DEPENDS= frr6 ruby +PLUGIN_DEPENDS= frr7 ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com .include "../../Mk/plugins.mk" From 5988514f0813c4ba95d7d6add23fd40ea561fede Mon Sep 17 00:00:00 2001 From: chris42 Date: Sun, 7 Jun 2020 13:30:28 +0200 Subject: [PATCH 0128/3088] Add core-networks API option --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++++++++++ .../app/models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++++++ .../scripts/OPNsense/AcmeClient/certhelper.php | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 2724e0ad7c..e29dde206e 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1086,4 +1086,19 @@ password + + + header + + + + validation.dns_cn_user + + text + + + validation.dns_cn_password + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 2ec2e16b26..f80753ae0d 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -366,6 +366,7 @@ Azure DNS API CloudFlare.com API ClouDNS API + Core-Networks API CloudXNS.com API cyon.ch API DirectAdmin API @@ -878,6 +879,12 @@ N + + N + + + N + diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 8e482c39d4..73c02c2fa3 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -693,6 +693,10 @@ function run_acme_validation($certObj, $valObj, $acctObj) $proc_env['CLOUDNS_SUB_AUTH_ID'] = (string)$valObj->dns_cloudns_sub_auth_id; $proc_env['CLOUDNS_AUTH_PASSWORD'] = (string)$valObj->dns_cloudns_auth_password; break; + case 'dns_cn': + $proc_env['CN_User'] = (string)$valObj->dns_cn_user; + $proc_env['CN_Password'] = (string)$valObj->dns_cn_password; + break; case 'dns_cx': $proc_env['CX_Key'] = (string)$valObj->dns_cx_key; $proc_env['CX_Secret'] = (string)$valObj->dns_cx_secret; From 543209b661a47bf2402c00acb247b015ad226fb6 Mon Sep 17 00:00:00 2001 From: chris42 Date: Sun, 7 Jun 2020 13:58:45 +0200 Subject: [PATCH 0129/3088] Order by name not tag --- .../opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index f80753ae0d..804f3c9d81 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -366,8 +366,8 @@ Azure DNS API CloudFlare.com API ClouDNS API - Core-Networks API CloudXNS.com API + Core-Networks API cyon.ch API DirectAdmin API DigitalOcean API From 734642abea2765d8d62268e234a79ec770a618cb Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 8 Jun 2020 14:28:01 +0200 Subject: [PATCH 0130/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 2e65ae4bcb..7e359a146f 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 1.33 +PLUGIN_VERSION= 1.34 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From a15bf04c202499c781088441a23059d9f32f617a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 8 Jun 2020 14:34:28 +0200 Subject: [PATCH 0131/3088] security/acme-client: add support for ArvanCloud, closes #1834 --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 10 ++++++++++ .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 6 +++++- .../scripts/OPNsense/AcmeClient/certhelper.php | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index e29dde206e..9cdc8c369f 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1101,4 +1101,14 @@ password + + + header + + + + validation.dns_arvan_token + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 804f3c9d81..0369e4ce1c 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1,6 +1,6 @@ //OPNsense/AcmeClient - 1.6.0 + 1.6.1 A secure Let's Encrypt plugin @@ -361,6 +361,7 @@ Acmeproxy API Alwaysdata.com API aliyun.com API + ArvanCloud API AutoDNS (InterNetX) API AWS Route 53 Azure DNS API @@ -885,6 +886,9 @@ N + + N + diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 73c02c2fa3..fc8cc6a442 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -665,6 +665,9 @@ function run_acme_validation($certObj, $valObj, $acctObj) $proc_env['Ali_Key'] = (string)$valObj->dns_ali_key; $proc_env['Ali_Secret'] = (string)$valObj->dns_ali_secret; break; + case 'dns_arvan': + $proc_env['Arvan_Token'] = (string)$valObj->dns_arvan_token; + break; case 'dns_autodns': $proc_env['AUTODNS_USER'] = (string)$valObj->dns_autodns_user; $proc_env['AUTODNS_PASSWORD'] = (string)$valObj->dns_autodns_password; From 0dbff80fef21140e9725b312183b60ccc1338a7c Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 8 Jun 2020 14:37:20 +0200 Subject: [PATCH 0132/3088] security/acme-client: restore alnum sorting in DNS API list --- .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 0369e4ce1c..66a93286de 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -365,13 +365,13 @@ AutoDNS (InterNetX) API AWS Route 53 Azure DNS API - CloudFlare.com API ClouDNS API + CloudFlare.com API CloudXNS.com API Core-Networks API cyon.ch API - DirectAdmin API DigitalOcean API + DirectAdmin API DNSimple API DNSMadeEasy.com API DNSPod.cn API From f3d517cc65ac030871b5c6e7638bb9457081f103 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 8 Jun 2020 14:43:25 +0200 Subject: [PATCH 0133/3088] security/acme-client: add support for Hetzner DNS API, closes #1870 --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 10 ++++++++++ .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 4 ++++ .../scripts/OPNsense/AcmeClient/certhelper.php | 3 +++ 3 files changed, 17 insertions(+) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 9cdc8c369f..8ad18f5a3e 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1111,4 +1111,14 @@ password + + + header + + + + validation.dns_hetzner_token + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 66a93286de..2880e11619 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -387,6 +387,7 @@ GoDaddy.com API Google Cloud DNS API GratisDNS.dk + Hetzner DNS API hosting.de API Hurricane Electric Infoblox API @@ -889,6 +890,9 @@ N + + N + diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index fc8cc6a442..7c7a6109cb 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -800,6 +800,9 @@ function run_acme_validation($certObj, $valObj, $acctObj) $proc_env['GDNSDK_Username'] = (string)$valObj->dns_gdnsdk_user; $proc_env['GDNSDK_Password'] = (string)$valObj->dns_gdnsdk_password; break; + case 'dns_hetzner': + $proc_env['HETZNER_Token'] = (string)$valObj->dns_hetzner_token; + break; case 'dns_hostingde': $proc_env['HOSTINGDE_ENDPOINT'] = (string)$valObj->dns_hostingde_server; $proc_env['HOSTINGDE_APIKEY'] = (string)$valObj->dns_hostingde_apiKey; From df8b86460ce38e023c00ca3068fc1e692baa39a0 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 9 Jun 2020 09:35:20 +0200 Subject: [PATCH 0134/3088] mail/postfix: add description to restart action (#1881) mail/postfix: add description to restart action, closes #1874 --- mail/postfix/Makefile | 1 + .../src/opnsense/service/conf/actions.d/actions_postfix.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index a86fe025c4..4f5fea0439 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= postfix PLUGIN_VERSION= 1.14 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix-sasl PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/src/opnsense/service/conf/actions.d/actions_postfix.conf b/mail/postfix/src/opnsense/service/conf/actions.d/actions_postfix.conf index 1c5f54ab70..6fcd216fa5 100644 --- a/mail/postfix/src/opnsense/service/conf/actions.d/actions_postfix.conf +++ b/mail/postfix/src/opnsense/service/conf/actions.d/actions_postfix.conf @@ -15,6 +15,7 @@ command:/usr/local/opnsense/scripts/OPNsense/Postfix/setup.sh;/usr/local/etc/rc. parameters: type:script message:restarting Postfix +description:Restart Postfix service [status] command:/usr/local/etc/rc.d/postfix status;exit 0 From ac9093e450b354d9393cf51eed64075e4dc81eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20M=C3=BCller?= Date: Wed, 10 Jun 2020 01:40:21 +0200 Subject: [PATCH 0135/3088] net/haproxy: add missing acl SNI regex text field --- .../app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml index ee8bb02837..63c55655fb 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml @@ -478,6 +478,12 @@ text + + acl.ssl_sni_reg + + text + + header From 407627cd49df0c140ebc23a609d700398a59d962 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jun 2020 07:57:09 +0200 Subject: [PATCH 0136/3088] mail/postfix: fix whitespace --- mail/postfix/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 4f5fea0439..522d394a0d 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= postfix PLUGIN_VERSION= 1.14 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix-sasl PLUGIN_MAINTAINER= m.muenz@gmail.com From a3913891d57f16b0a8fa0852cc50c3d5a2244a7a Mon Sep 17 00:00:00 2001 From: Andreas Rupper <61623186+andreas-rupper@users.noreply.github.com> Date: Sat, 13 Jun 2020 22:32:41 +0200 Subject: [PATCH 0137/3088] Updated Cloudflare to use token auth and update ttl (#1726) --- .../src/etc/inc/plugins.inc.d/dyndns.inc | 6 +- .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 133 +++++++++++------- dns/dyndns/src/www/services_dyndns_edit.php | 23 ++- 3 files changed, 106 insertions(+), 56 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index 02847b288c..68b1292802 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -100,8 +100,10 @@ function dyndns_list() 'azure' => 'Azure DNS', 'azurev6' => 'Azure DNS (v6)', 'citynetwork' => 'City Network', - 'cloudflare' => 'CloudFlare', - 'cloudflare-v6' => 'CloudFlare (v6)', + 'cloudflare' => 'Cloudflare', + 'cloudflare-v6' => 'Cloudflare (v6)', + 'cloudflare-token' => 'Cloudflare w/API token', + 'cloudflare-token-v6' => 'Cloudflare w/API token (v6)', 'custom' => 'Custom', 'custom-v6' => 'Custom (v6)', 'dhs' => 'DHS', diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 1b0c7b698b..7623744b89 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -26,8 +26,10 @@ * - DNS-O-Matic (dnsomatic.com) * - Custom dynamic DNS (any URL) * - Custom dynamic DNS IPv6 (any URL) - * - CloudFlare (www.cloudflare.com) - * - CloudFlare IPv6 (www.cloudflare.com) + * - Cloudflare (www.cloudflare.com) + * - Cloudflare IPv6 (www.cloudflare.com) + * - Cloudflare API token (www.cloudflare.com) + * - Cloudflare API token IPv6 (www.cloudflare.com) * - Eurodns (eurodns.com) * - GratisDNS (gratisdns.dk) * - City Network (citynetwork.se) @@ -58,47 +60,49 @@ * - _debug() * - _checkIP() * +----------------------------------------------------+ - * DynDNS Dynamic - Last Tested: 12 July 2005 - * DynDNS Static - Last Tested: NEVER - * DynDNS Custom - Last Tested: NEVER - * No-IP - Last Tested: 20 July 2008 - * HN.org - Last Tested: 12 July 2005 - * EasyDNS - Last Tested: 20 July 2008 - * DHS - Last Tested: 12 July 2005 - * ZoneEdit - Last Tested: NEVER - * Dyns - Last Tested: NEVER - * ODS - Last Tested: 02 August 2005 - * FreeDNS - Last Tested: 23 Feb 2011 - * Loopia - Last Tested: NEVER - * StaticCling - Last Tested: 27 April 2006 - * DNSexit - Last Tested: 20 July 2008 - * Namecheap - Last Tested: 31 August 2010 - * HE.net - Last Tested: 7 July 2013 - * HE.net IPv6 - Last Tested: 7 July 2013 - * HE.net Tunnel - Last Tested: 28 June 2011 - * SelfHost - Last Tested: 26 December 2011 - * Amazon Route53 - Last Tested: 01 April 2012 - * DNS-O-Matic - Last Tested: 9 September 2010 - * CloudFlare - Last Tested: 16 April 2019 - * CloudFlare IPv6 - Last Tested: 16 April 2019 - * Eurodns - Last Tested: 25 July 2018 - * GratisDNS - Last Tested: 26 January 2020 - * OVH DynHOST - Last Tested: NEVER - * City Network - Last Tested: 13 November 2013 - * Duck DNS - Last Tested: 04 March 2015 - * Google Domains - Last Tested: 20 February 2017 - * STRATO - Last Tested: 09 May 2017 - * 3322 - Last Tested: 26 May 2017 - * Oray - Last Tested: 26 May 2017 - * regfish - Last Tested: 15 August 2017 - * regfish v6 - Last Tested: 15 August 2017 - * Amazon Route53 v6 - Last Tested: 19 November 2017 - * dynv6 - Last Tested: 25 June 2019 - * dynv6 v6 - Last Tested: 25 June 2019 - * DigitalOcean - Last Tested: 25 June 2019 - * Azure DNS - Last Tested: 16 October 2019 - * Linode - Last Tested: 25 February 2020 - * Linode v6 - Last Tested: 25 February 2020 + * DynDNS Dynamic - Last Tested: 12 July 2005 + * DynDNS Static - Last Tested: NEVER + * DynDNS Custom - Last Tested: NEVER + * No-IP - Last Tested: 20 July 2008 + * HN.org - Last Tested: 12 July 2005 + * EasyDNS - Last Tested: 20 July 2008 + * DHS - Last Tested: 12 July 2005 + * ZoneEdit - Last Tested: NEVER + * Dyns - Last Tested: NEVER + * ODS - Last Tested: 02 August 2005 + * FreeDNS - Last Tested: 23 Feb 2011 + * Loopia - Last Tested: NEVER + * StaticCling - Last Tested: 27 April 2006 + * DNSexit - Last Tested: 20 July 2008 + * Namecheap - Last Tested: 31 August 2010 + * HE.net - Last Tested: 7 July 2013 + * HE.net IPv6 - Last Tested: 7 July 2013 + * HE.net Tunnel - Last Tested: 28 June 2011 + * SelfHost - Last Tested: 26 December 2011 + * Amazon Route53 - Last Tested: 01 April 2012 + * DNS-O-Matic - Last Tested: 9 September 2010 + * Cloudflare - Last Tested: 16 April 2019 + * Cloudflare IPv6 - Last Tested: 16 April 2019 + * Cloudflare w/API token - Last Tested: 13 June 2020 + * Cloudflare w/API token v6 - Last Tested: NEVER + * Eurodns - Last Tested: 25 July 2018 + * GratisDNS - Last Tested: 26 January 2020 + * OVH DynHOST - Last Tested: NEVER + * City Network - Last Tested: 13 November 2013 + * Duck DNS - Last Tested: 04 March 2015 + * Google Domains - Last Tested: 20 February 2017 + * STRATO - Last Tested: 09 May 2017 + * 3322 - Last Tested: 26 May 2017 + * Oray - Last Tested: 26 May 2017 + * regfish - Last Tested: 15 August 2017 + * regfish v6 - Last Tested: 15 August 2017 + * Amazon Route53 v6 - Last Tested: 19 November 2017 + * dynv6 - Last Tested: 25 June 2019 + * dynv6 v6 - Last Tested: 25 June 2019 + * DigitalOcean - Last Tested: 25 June 2019 + * Azure DNS - Last Tested: 16 October 2019 + * Linode - Last Tested: 25 February 2020 + * Linode v6 - Last Tested: 25 February 2020 * +====================================================+ * * @author E.Kristensen @@ -251,6 +255,16 @@ class updatedns $this->_error(9); } break; + case 'cloudflare-token': + case 'cloudflare-token-v6': + if (!$dnsPass) { + $this->_error(4); + } elseif (!$dnsHost) { + $this->_error(5); + } elseif (!$dnsTTL) { + $this->_error(9); + } + break; default: if (!$dnsUser) { $this->_error(3); @@ -271,6 +285,7 @@ class updatedns case 'linode-v6': case 'regfish-v6': case 'route53-v6': + case 'cloudflare-token-v6': $this->_useIPv6 = true; break; default: @@ -319,6 +334,8 @@ class updatedns case 'citynetwork': case 'cloudflare': case 'cloudflare-v6': + case 'cloudflare-token': + case 'cloudflare-token-v6': case 'custom': case 'custom-v6': case 'dhs': @@ -749,21 +766,35 @@ class updatedns break; case 'cloudflare': case 'cloudflare-v6': + case 'cloudflare-token': + case 'cloudflare-token-v6': $baseUrl = 'https://api.cloudflare.com/client/v4'; $fqdn = str_replace(' ', '', $this->_dnsHost); $recordType = ($this->_useIPv6) ? 'AAAA' : 'A'; + $ttlData = intval($this->_dnsTTL) < 1 ? 1 : intval($this->_dnsTTL); $hostData = array( "content" => "{$this->_dnsIP}", "type" => $recordType, - "name" => $fqdn + "name" => $fqdn, + "ttl" => $ttlData ); + // Determine if service is token based or user/password based and define appropriate header + if (strpos($this->_dnsService, 'token') !== false) { + $headerAuth = array( + "Authorization: Bearer {$this->_dnsPass}", + 'Content-Type: application/json' + ); + } else { + $headerAuth = array( + "X-Auth-Email: {$this->_dnsUser}", + "X-Auth-Key: {$this->_dnsPass}", + 'Content-Type: application/json' + ); + } + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_HTTPHEADER, array( - "X-Auth-Email: {$this->_dnsUser}", - "X-Auth-Key: {$this->_dnsPass}", - 'Content-Type: application/json' - )); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headerAuth); // Get all zone info $zonesUrl = "$baseUrl/zones"; @@ -1322,12 +1353,14 @@ class updatedns break; case 'cloudflare': case 'cloudflare-v6': + case 'cloudflare-token': + case 'cloudflare-token-v6': $output = json_decode($data); if ($output->result->content === $this->_dnsIP) { $status = "Dynamic DNS: (Success) {$this->_dnsHost} updated to {$this->_dnsIP}"; $successful_update = true; } elseif ($output->errors[0]->code === 9103) { - $status = "Dynamic DNS ({$this->_dnsHost}): ERROR - Invalid Credentials! Don't forget to use API Key for password field with CloudFlare."; + $status = "Dynamic DNS ({$this->_dnsHost}): ERROR - Invalid Credentials! Don't forget to use API Key for password field with Cloudflare."; } elseif (($output->success) && (!$output->result[0]->id)) { $status = "Dynamic DNS ({$this->_dnsHost}): ERROR - Zone ID was not found."; } else { diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index bb327f5d3f..bf3d92e871 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -75,7 +75,7 @@ function is_dyndns_username($uname) } $input_errors = array(); $pconfig = $_POST; - if(($pconfig['type'] == "freedns" || $pconfig['type'] == "linode" || $pconfig['type'] == "linode-v6" || $pconfig['type'] == "namecheap") && $pconfig['username'] == "") { + if(($pconfig['type'] == "freedns" || $pconfig['type'] == "linode" || $pconfig['type'] == "linode-v6" || $pconfig['type'] == "namecheap" || $pconfig['type'] == "cloudflare-token" || $pconfig['type'] == "cloudflare-token-v6") && $pconfig['username'] == "") { $pconfig['username'] = "none"; } @@ -114,6 +114,8 @@ function is_dyndns_username($uname) switch ($pconfig['type']) { case 'cloudflare': case 'cloudflare-v6': + case 'cloudflare-token': + case 'cloudflare-token-v6': case 'eurodns': case 'googledomains': case 'linode': @@ -137,6 +139,9 @@ function is_dyndns_username($uname) $input_errors[] = gettext("The username contains invalid characters."); } + if ((string)((int)$pconfig['ttl']) != $pconfig['ttl']) { + $input_errors[] = gettext("The TTL value needs to be a valid integer number."); + } if (count($input_errors) == 0) { $dyndns = array(); @@ -212,6 +217,15 @@ function is_dyndns_username($uname) case "azurev6": $(".type_azure").show(); break; + case 'cloudflare': + case 'cloudflare-v6': + $(".type_default").show(); + $(".type_cloudflare").show(); + break; + case 'cloudflare-token': + case 'cloudflare-token-v6': + $(".type_cloudflare").show(); + break; default: $(".type_default").show(); break; @@ -339,7 +353,7 @@ function is_dyndns_username($uname) - + @@ -364,7 +378,7 @@ function is_dyndns_username($uname)


-
+
@@ -414,12 +428,13 @@ function is_dyndns_username($uname)
- + From 8df04c75d1210a898154c022623c6157d4a4a96b Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 16 Jun 2020 09:37:51 +0200 Subject: [PATCH 0138/3088] net/freeradius: fix Login-Time validation (#1887) * Update User.xml * Update Makefile * Update pkg-descr --- net/freeradius/Makefile | 2 +- net/freeradius/pkg-descr | 4 ++++ .../src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index 2d667aa9e1..2178cd8749 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= freeradius -PLUGIN_VERSION= 1.9.6 +PLUGIN_VERSION= 1.9.7 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index efb4406873..bedbd33dad 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -15,6 +15,10 @@ The server is fast, feature-rich, modular, and scalable. Plugin Changelog ================ +1.9.7 + +* Fix Login-Time validation + 1.9.6 * Fix log not properly parsed diff --git a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml index c98c2e3157..c2432ab0b0 100644 --- a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml +++ b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml @@ -42,7 +42,7 @@ N - /^([0-9a-zA-Z\-]){1,128}$/u + /^([0-9a-zA-Z\-\,]){1,128}$/u N From 910d8ac7618b0a9e6e4fc31b97d73ca1d7bcf0a4 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 18 Jun 2020 09:22:24 +0200 Subject: [PATCH 0139/3088] net/haproxy: add missing header, refs #1883 --- .../mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml index 63c55655fb..a0a7a5b7c7 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml @@ -478,6 +478,11 @@ text
+ + + header + + acl.ssl_sni_reg From 28930cd881266819c7c58713c24ba48b67f15eb6 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 18 Jun 2020 10:03:46 +0200 Subject: [PATCH 0140/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 9cd8c47016..b07f11984d 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 2.22 +PLUGIN_VERSION= 2.23 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de From ff2bbcc41ebcd287c7fd1d133ee230fa3cbe0ac8 Mon Sep 17 00:00:00 2001 From: "J.Townsend" Date: Mon, 22 Jun 2020 14:22:05 +0100 Subject: [PATCH 0141/3088] DNS/Dnscrypt-proxy remove discontinued feeds (#1886) --- dns/dnscrypt-proxy/Makefile | 3 +- dns/dnscrypt-proxy/pkg-descr | 4 + .../models/OPNsense/Dnscryptproxy/Dnsbl.xml | 9 -- .../scripts/OPNsense/Dnscryptproxy/dnsbl.sh | 93 ------------------- 4 files changed, 5 insertions(+), 104 deletions(-) diff --git a/dns/dnscrypt-proxy/Makefile b/dns/dnscrypt-proxy/Makefile index 0ab7f039e9..2203e70541 100644 --- a/dns/dnscrypt-proxy/Makefile +++ b/dns/dnscrypt-proxy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= dnscrypt-proxy -PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= Flexible DNS proxy supporting DNSCrypt and DoH PLUGIN_DEPENDS= dnscrypt-proxy2 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/dnscrypt-proxy/pkg-descr b/dns/dnscrypt-proxy/pkg-descr index a5b69a78c9..1728cf52fe 100644 --- a/dns/dnscrypt-proxy/pkg-descr +++ b/dns/dnscrypt-proxy/pkg-descr @@ -5,6 +5,10 @@ such as DNSCrypt v2 and DNS-over-HTTPS. Plugin Changelog ================ +1.8 + +* Remove 8 discontinued DNSBL lists and 2 that are not updated any more + 1.7 * Add comment field to whitelist section diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/Dnsbl.xml b/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/Dnsbl.xml index 35c6c5eca9..95a89c1288 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/Dnsbl.xml +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/Dnsbl.xml @@ -16,19 +16,10 @@ Blocklist.site Ads Blocklist.site Fraud Blocklist.site Phishing - Cameleon List Easy List - EMD Malicious Domains List Easyprivacy List - hpHosts Ads - hpHosts FSA - hpHosts PSH - hpHosts PUP - Hbbtv List - Malwaredomain List NoCoin List PornTop1M List - Ransomware Tracker List Simple Ad List Simple Tracker List Steven Black List diff --git a/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh b/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh index 44c72135ca..b32d90be87 100755 --- a/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh +++ b/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh @@ -63,13 +63,6 @@ porntop() { rm ${WORKDIR}/porntop-raw } -emdlist() { - # EMD - ${FETCH} https://hosts-file.net/emd.txt -o ${WORKDIR}/emdlist-raw - sed "/\.$/d" ${WORKDIR}/emdlist-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/emdlist - rm ${WORKDIR}/emdlist-raw -} - adguard() { # AdGuard ${FETCH} https://justdomains.github.io/blocklists/lists/adguarddns-justdomains.txt -o ${WORKDIR}/adguard-raw @@ -84,20 +77,6 @@ nocoin() { rm ${WORKDIR}/nocoin-raw } -rwtracker() { - # RansomWare Tracker abuse.ch - ${FETCH} https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt -o ${WORKDIR}/rwtracker-raw - sed "/\.$/d" ${WORKDIR}/rwtracker-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/rwtracker - rm ${WORKDIR}/rwtracker-raw -} - -mwdomains() { - # MalwareDomains - ${FETCH} http://malwaredomains.lehigh.edu/files/justdomains -o ${WORKDIR}/malwaredomains-raw - sed "/\.$/d" ${WORKDIR}/malwaredomains-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/malwaredomains - rm ${WORKDIR}/malwaredomains-raw -} - windowsspyblockerspy() { # WindowsSpyBlocker (spy) ${FETCH} https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt -o ${WORKDIR}/windowsspyblockerspy-raw @@ -119,13 +98,6 @@ windowsspyblockerextra() { rm ${WORKDIR}/windowsspyblockerextra-raw } -cameleon() { - # Cameleon List - ${FETCH} http://sysctl.org/cameleon/hosts -o ${WORKDIR}/cameleon-raw - sed "/\.$/d" ${WORKDIR}/cameleon-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/cameleon - rm ${WORKDIR}/cameleon-raw -} - adaway() { # AdAway List ${FETCH} https://adaway.org/hosts.txt -o ${WORKDIR}/adaway-raw @@ -168,41 +140,6 @@ blocklistphishing() { rm ${WORKDIR}/blocklistphishing-raw } -hphosts-ads() { - # hphosts-ads - ${FETCH} https://hosts-file.net/ad_servers.txt -o ${WORKDIR}/hphosts-ads-raw - sed "/\.$/d" ${WORKDIR}/hphosts-ads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-ads - rm ${WORKDIR}/hphosts-ads-raw -} - -hphosts-fsa() { - # hphosts-fsa - ${FETCH} https://hosts-file.net/fsa.txt -o ${WORKDIR}/hphosts-fsa-raw - sed "/\.$/d" ${WORKDIR}/hphosts-fsa-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-fsa - rm ${WORKDIR}/hphosts-fsa-raw -} - -hphosts-psh() { - # hphosts-psh - ${FETCH} https://hosts-file.net/psh.txt -o ${WORKDIR}/hphosts-psh-raw - sed "/\.$/d" ${WORKDIR}/hphosts-psh-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-psh - rm ${WORKDIR}/hphosts-psh-raw -} - -hphosts-pup() { - # hphosts-pup - ${FETCH} https://hosts-file.net/pup.txt -o ${WORKDIR}/hphosts-pup-raw - sed "/\.$/d" ${WORKDIR}/hphosts-pup-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-pup - rm ${WORKDIR}/hphosts-pup-raw -} - -hbbtv() { - # HBBTV List - ${FETCH} https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/hbbtv.txt -o ${WORKDIR}/hbbtv-raw - sed "/\.$/d" ${WORKDIR}/hbbtv-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/hbbtv - rm ${WORKDIR}/hbbtv-raw -} - simplead() { # Simple Ad List ${FETCH} https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt -o ${WORKDIR}/simplead-raw @@ -252,45 +189,15 @@ for CAT in $(echo ${DNSBL} | tr ',' ' '); do blp) blocklistphishing ;; - ca) - cameleon - ;; el) easylist ;; ep) easyprivacy ;; - emd) - emdlist - ;; - hpa) - hphosts-ads - ;; - hpf) - hphosts-fsa - ;; - hpp) - hphosts-psh - ;; - hup) - hphosts-pup - ;; - ht) - hbbtv - ;; nc) nocoin ;; - rw) - rwtracker - ;; - mw) - mwdomains - ;; - pa) - #pornall - ;; pt) porntop ;; From a2095b9455873b7c6fd1fde0006303cb3f25c3f0 Mon Sep 17 00:00:00 2001 From: Martin Wasley Date: Tue, 23 Jun 2020 15:36:13 +0100 Subject: [PATCH 0142/3088] Correct colours in text-info and circle::before (#1892) Colours incorrect on firewall. --- .../opnsense/www/themes/rebellion/assets/stylesheets/main.scss | 3 +-- .../src/opnsense/www/themes/rebellion/build/css/main.css | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss index 7c32510561..0966e503c7 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss @@ -1534,7 +1534,7 @@ a.text-success:hover { } .text-info { - color: #ffffff; + color: #00ffff; } a.text-info:hover { @@ -9073,7 +9073,6 @@ textarea#update_status { .fa-times-circle::before { content: ""; - color: #B13116; } .fa-refresh::before { diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css index 20f7b8761e..5d86521dff 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css @@ -1441,7 +1441,7 @@ a.text-success:hover { } .text-info { - color: #ffffff; + color: #00ffff; } a.text-info:hover { @@ -7647,7 +7647,6 @@ textarea#update_status:hover { .fa-times-circle::before { content: ""; - color: #B13116; } .fa-refresh::before { From c912d0257b3b29a8622e370c5527186725b25cb8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Jun 2020 10:12:40 +0200 Subject: [PATCH 0143/3088] misc/theme-rebellion: bump revision --- misc/theme-rebellion/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/theme-rebellion/Makefile b/misc/theme-rebellion/Makefile index 0fe8c84e2a..8e35cc6d81 100644 --- a/misc/theme-rebellion/Makefile +++ b/misc/theme-rebellion/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-rebellion -PLUGIN_VERSION= 1.8.3 +PLUGIN_VERSION= 1.8.4 PLUGIN_COMMENT= A suitably dark theme PLUGIN_MAINTAINER= team-rebellion@queens-park.com From 666e4d4166119e3394ad6daa3c77103cff592a3a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Jun 2020 10:13:21 +0200 Subject: [PATCH 0144/3088] README: sync --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 809eb8cc35..6d6a923032 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ net/pptp -- End of life, no replacement net/relayd -- Relayd Load Balancer net/shadowsocks -- Secure socks5 proxy net/siproxd -- Siproxd is a proxy daemon for the SIP protocol -net/tayga -- Tayga IPv6 64NAT +net/tayga -- Tayga NAT64 net/udpbroadcastrelay -- Control ubpbroadcastrelay processes (development only) net/upnp -- Universal Plug and Play Service net/vnstat -- vnStat is a console-based network traffic monitor @@ -84,7 +84,7 @@ security/intrusion-detection-content-snort-vrt -- IDS Snort VRT ruleset (needs r security/maltrail -- Malicious traffic detection system security/openconnect -- OpenConnect Client security/softether -- Cross-platform Multi-protocol VPN Program (development only) -security/stunnel -- stunnel TLS proxy (development only) +security/stunnel -- stunnel TLS proxy security/tinc -- Tinc VPN security/tor -- The Onion Router sysutils/api-backup -- Provide the functionality to download the config.xml From 2f9a887a1b22e9b94ac38914526c95dae7d6a722 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Jun 2020 11:03:20 +0200 Subject: [PATCH 0145/3088] dns/dyndns: style and naming --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index 68b1292802..182091996d 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -102,8 +102,8 @@ function dyndns_list() 'citynetwork' => 'City Network', 'cloudflare' => 'Cloudflare', 'cloudflare-v6' => 'Cloudflare (v6)', - 'cloudflare-token' => 'Cloudflare w/API token', - 'cloudflare-token-v6' => 'Cloudflare w/API token (v6)', + 'cloudflare-token' => 'Cloudflare API token', + 'cloudflare-token-v6' => 'Cloudflare API token (v6)', 'custom' => 'Custom', 'custom-v6' => 'Custom (v6)', 'dhs' => 'DHS', From 70b23426be3e276b44f0faf3545575bb530f3f76 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Jun 2020 14:32:36 +0200 Subject: [PATCH 0146/3088] dns/dyndns: new version --- dns/dyndns/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 5d6d6b59c7..1fd50c3137 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= dyndns -PLUGIN_VERSION= 1.20 +PLUGIN_VERSION= 1.21 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From ae66c9361c6e6d3c3b432ef533a7e0456ca062f2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Jun 2020 14:36:24 +0200 Subject: [PATCH 0147/3088] net/shadowsocks: bump revision --- net/shadowsocks/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/shadowsocks/Makefile b/net/shadowsocks/Makefile index a49c85dff1..7a1b462f9a 100644 --- a/net/shadowsocks/Makefile +++ b/net/shadowsocks/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= shadowsocks PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Secure socks5 proxy PLUGIN_DEPENDS= shadowsocks-libev PLUGIN_MAINTAINER= m.muenz@gmail.com From 5bd128a123d0ef60b16bbc17c514c8c381617925 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Jun 2020 14:38:24 +0200 Subject: [PATCH 0148/3088] security/intrusion-detection-content-snort-vrt: bump version --- security/intrusion-detection-content-snort-vrt/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/intrusion-detection-content-snort-vrt/Makefile b/security/intrusion-detection-content-snort-vrt/Makefile index 293c238d22..d4e31d8943 100644 --- a/security/intrusion-detection-content-snort-vrt/Makefile +++ b/security/intrusion-detection-content-snort-vrt/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= intrusion-detection-content-snort-vrt -PLUGIN_VERSION= 1.0 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= IDS Snort VRT ruleset (needs registration or subscription) PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://www.snort.org/downloads#rules From 8d10ac6a0d6145a372fb60717c1e22071828a8de Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 26 Jun 2020 14:06:35 +0200 Subject: [PATCH 0149/3088] stunnel: missing copyright section --- .../scripts/stunnel/identd_stunnel.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py b/security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py index 179103aeb7..318ba9a62b 100755 --- a/security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py +++ b/security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py @@ -1,5 +1,31 @@ #!/usr/local/bin/python3 +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" + import os import sys import argparse From 8353a292a8842c56911cd7414f59bc2d9403e251 Mon Sep 17 00:00:00 2001 From: "D. Domig" Date: Wed, 1 Jul 2020 14:58:01 +0200 Subject: [PATCH 0150/3088] Add WireGuard widget (#1865) --- net/wireguard/Makefile | 2 +- net/wireguard/pkg-descr | 6 +- .../conf/actions.d/actions_wireguard.conf | 6 ++ .../src/www/widgets/include/wireguard.inc | 3 + .../www/widgets/widgets/wireguard.widget.php | 78 +++++++++++++++++++ 5 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 net/wireguard/src/www/widgets/include/wireguard.inc create mode 100644 net/wireguard/src/www/widgets/widgets/wireguard.widget.php diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 6af950a802..a0b7242e52 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 1.1 +PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= WireGuard VPN service PLUGIN_DEPENDS= wireguard PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index fb5515de4b..848f48597a 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,12 +16,16 @@ WWW: https://www.wireguard.com/ Changelog --------- +1.2 + +* Dashboard widget (contributed by D. Domig) + 1.1 * Allow adding interface route for PBR 1.0 -* Support for most features like S2S, Roadwarror +* Support for most features like S2S, Roadwarrior * DNS, MTU, PSK * Allow to disable setting routes for PBR diff --git a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf index 22c8a042e9..eda045e381 100644 --- a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf +++ b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf @@ -39,3 +39,9 @@ command:/usr/local/bin/wg show all latest-handshakes parameters: type:script_output message:show Wireguard handshakes + +[widget] +command:/usr/local/bin/wg show all latest-handshakes +parameters: +type:script_output +message:show Wireguard handshakes for widget diff --git a/net/wireguard/src/www/widgets/include/wireguard.inc b/net/wireguard/src/www/widgets/include/wireguard.inc new file mode 100644 index 0000000000..78b33cc16e --- /dev/null +++ b/net/wireguard/src/www/widgets/include/wireguard.inc @@ -0,0 +1,3 @@ + + + + + + + + + + + + + 0): + $dt = new DateTime("@$epoch"); + $latest = $dt->format(gettext("Y-m-d H:i:sP")); + endif; ?> + + + + + + + + + + + + + + + + + + +
...
From 7f7791edca3d926da5092bd5314110ec786b45bb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 2 Jul 2020 05:42:01 +0200 Subject: [PATCH 0151/3088] net/wireguard: style sweep --- net/wireguard/src/www/widgets/include/wireguard.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireguard/src/www/widgets/include/wireguard.inc b/net/wireguard/src/www/widgets/include/wireguard.inc index 78b33cc16e..4d93377615 100644 --- a/net/wireguard/src/www/widgets/include/wireguard.inc +++ b/net/wireguard/src/www/widgets/include/wireguard.inc @@ -1,3 +1,3 @@ Date: Thu, 2 Jul 2020 06:53:36 +0200 Subject: [PATCH 0152/3088] dns/dyndns: added not empty validation (#1903) --- dns/dyndns/src/www/services_dyndns_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index bf3d92e871..d13e552120 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -139,7 +139,7 @@ function is_dyndns_username($uname) $input_errors[] = gettext("The username contains invalid characters."); } - if ((string)((int)$pconfig['ttl']) != $pconfig['ttl']) { + if (!empty($pconfig['ttl']) && (string)((int)$pconfig['ttl']) != $pconfig['ttl']) { $input_errors[] = gettext("The TTL value needs to be a valid integer number."); } From 796114f4431ff62f4a59c375aca4c4c3e898b527 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 2 Jul 2020 06:56:18 +0200 Subject: [PATCH 0153/3088] dns/dyndns: bump revision after change --- dns/dyndns/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 1fd50c3137..0684f27347 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.21 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From c5f133d26fecfec49763344e21c0168742f46cb8 Mon Sep 17 00:00:00 2001 From: Jontron123 Date: Thu, 9 Jul 2020 01:32:22 -0400 Subject: [PATCH 0154/3088] Telegraf: fix flush_interval option (#1917) The Telegraf flush_interval option is not working correctly. The option was not being added to the telegraf.conf file. Add the missing flush_interval option to the template to fix this problem. --- .../opnsense/service/templates/OPNsense/Telegraf/telegraf.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index 08f6938033..afc552c6dc 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -28,6 +28,9 @@ {% if helpers.exists('OPNsense.telegraf.general.collection_jitter') and OPNsense.telegraf.general.collection_jitter != '' %} collection_jitter = "{{ OPNsense.telegraf.general.collection_jitter }}s" {% endif %} +{% if helpers.exists('OPNsense.telegraf.general.flush_interval') and OPNsense.telegraf.general.flush_interval != '' %} + flush_interval = "{{ OPNsense.telegraf.general.flush_interval }}s" +{% endif %} {% if helpers.exists('OPNsense.telegraf.general.flush_jitter') and OPNsense.telegraf.general.flush_jitter != '' %} flush_jitter = "{{ OPNsense.telegraf.general.flush_jitter }}s" {% endif %} From 16acd5fe7697c760787c7b2dae1eea3a7e0e05dc Mon Sep 17 00:00:00 2001 From: Micha M Date: Thu, 9 Jul 2020 07:38:23 +0200 Subject: [PATCH 0155/3088] net-mgmt/telegraf: Fix TLS connect (#1821) (#1902) As soon as insecure_skip_verify is in the Telegraf config file, it will try to connect using TLS to the Graphite Carbon cache server. So this patch adds a switch to disable the default TLS connection. Signed-off-by: MichaM --- .../app/controllers/OPNsense/Telegraf/forms/output.xml | 10 ++++++++-- .../mvc/app/models/OPNsense/Telegraf/Output.xml | 6 +++++- .../service/templates/OPNsense/Telegraf/telegraf.conf | 6 ++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index 4594818aec..0e726a008d 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -75,7 +75,7 @@ output.graphite_server text - Set the IP and port where metrics shoud be sent to. + Set the IP and port where metrics shoud be sent to. Format: IP:port.
output.graphite_prefix @@ -91,10 +91,16 @@ output.graphite_verify - + checkbox This will enable verification of a secure connection to Graphite. Default is disabled for compatibility reasons. + + output.graphite_ssl_disable + + checkbox + This will disable SSL/TLS connection to Graphite host. Default is encrypted connection. + output.graphite_tagsupport diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index bd48099a43..7b479f0c9c 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -1,7 +1,7 @@ //OPNsense/telegraf/output Telegraf outputs configuration - 1.4.0 + 1.4.1 0 @@ -40,6 +40,10 @@ N + + 0 + N + 0 N diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index afc552c6dc..84f994bc40 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -87,10 +87,12 @@ template = "{{ OPNsense.telegraf.output.graphite_template }}" {% endif %} timeout = 2 -{% if helpers.exists('OPNsense.telegraf.output.graphite_verify') and OPNsense.telegraf.output.graphite_verify == '0' %} +{% if helpers.exists('OPNsense.telegraf.output.graphite_ssl_disable') and OPNsense.telegraf.output.graphite_ssl_disable != '1' %} +{% if helpers.exists('OPNsense.telegraf.output.graphite_verify') and OPNsense.telegraf.output.graphite_verify == '0' %} insecure_skip_verify = true -{% else %} +{% else %} insecure_skip_verify = false +{% endif %} {% endif %} {% if helpers.exists('OPNsense.telegraf.output.graphite_tagsupport') and OPNsense.telegraf.output.graphite_tagsupport == '1' %} graphite_tag_support = true From 706ee10d42bdb723b7aee0ddff1efccc159c8490 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 9 Jul 2020 10:38:56 +0200 Subject: [PATCH 0156/3088] net-mgmt/telegraf: Version bump and credits (#1921) --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index 2c0dd9078f..dff3380731 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.8.0 +PLUGIN_VERSION= 1.8.1 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 01c12dea54..4765e48ad1 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -11,6 +11,11 @@ Kafka, MQTT, NSQ, and many others. Plugin Changelog ================ +1.8.1 + +* Fix 'flush interval' templating by @Jontron123 +* Add ability to disable TLS for Graphite by @primemaster + 1.8.0 * Add InfluxDB v2 output support From 1ceaf85ed3b8e885c237add2895d83cb887d5e73 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 17 Jul 2020 09:52:10 +0200 Subject: [PATCH 0157/3088] dns/dyndns: adapt dnsexit changes; closes #1924 --- dns/dyndns/Makefile | 2 +- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 0684f27347..8597694285 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.21 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 7623744b89..a136f37b04 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -580,7 +580,7 @@ class updatedns curl_setopt($ch, CURLOPT_URL, 'https://freedns.afraid.org/dynamic/update.php?' . $this->_dnsPass); break; case 'dnsexit': - curl_setopt($ch, CURLOPT_URL, 'https://www.dnsexit.com/RemoteUpdate.sv?login=' . urlencode($this->_dnsUser) . '&password=' . $this->_dnsPass . '&host=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); + curl_setopt($ch, CURLOPT_URL, 'https://update.dnsexit.com/RemoteUpdate.sv?login=' . urlencode($this->_dnsUser) . '&password=' . $this->_dnsPass . '&host=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); break; case 'loopia': $this->_dnsWildcard = (isset($this->_dnsWildcard) && $this->_dnsWildcard == true) ? 'ON' : 'OFF'; @@ -1265,7 +1265,7 @@ class updatedns } break; case 'dnsexit': - if (preg_match("/is the same/i", $data)) { + if (preg_match("/IP not changed/i", $data)) { $status = "Dynamic DNS ({$this->_dnsHost}): (Success) No Change In IP Address"; $successful_update = true; } elseif (preg_match("/Success/i", $data)) { From f23ab6c6349473dbb95f5c76a592b3e9aa777acd Mon Sep 17 00:00:00 2001 From: Martin Wasley Date: Fri, 17 Jul 2020 09:40:30 +0100 Subject: [PATCH 0158/3088] Fix jqtree color issue (#1919) --- misc/theme-rebellion/Makefile | 2 +- .../www/themes/rebellion/build/css/jqtree.css | 184 ++++++++++++++++++ 2 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/jqtree.css diff --git a/misc/theme-rebellion/Makefile b/misc/theme-rebellion/Makefile index 8e35cc6d81..d64b12ab93 100644 --- a/misc/theme-rebellion/Makefile +++ b/misc/theme-rebellion/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-rebellion -PLUGIN_VERSION= 1.8.4 +PLUGIN_VERSION= 1.8.6 PLUGIN_COMMENT= A suitably dark theme PLUGIN_MAINTAINER= team-rebellion@queens-park.com diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/jqtree.css b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/jqtree.css new file mode 100644 index 0000000000..f40b4203ab --- /dev/null +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/jqtree.css @@ -0,0 +1,184 @@ +ul.jqtree-tree { + list-style: none outside; + margin-left: 0; + margin-bottom: 0; + padding: 0; +} + + ul.jqtree-tree ul.jqtree_common { + list-style: none outside; + margin-left: 12px; + margin-right: 0; + margin-bottom: 0; + padding: 0; + display: block; + } + + ul.jqtree-tree li.jqtree-closed > ul.jqtree_common { + display: none; + } + + ul.jqtree-tree li.jqtree_common { + clear: both; + list-style-type: none; + } + + ul.jqtree-tree .jqtree-toggler { + border-bottom: none; + color: #333; + text-decoration: none; + vertical-align: middle; + } + + ul.jqtree-tree .jqtree-toggler:hover { + color: #000; + text-decoration: none; + } + + ul.jqtree-tree .jqtree-toggler.jqtree-closed { + background-position: 0 0; + } + + ul.jqtree-tree .jqtree-toggler.jqtree-toggler-left { + margin-right: 0.5em; + } + + ul.jqtree-tree .jqtree-toggler.jqtree-toggler-right { + margin-left: 0.5em; + } + + ul.jqtree-tree .jqtree-element { + cursor: pointer; + position: relative; + display: -webkit-box; + display: flex; + } + + ul.jqtree-tree .jqtree-title { + color: #cccccc; + vertical-align: middle; + margin-left: 1.5em; + } + + ul.jqtree-tree .jqtree-title.jqtree-title-folder { + margin-left: 0; + } + + ul.jqtree-tree li.jqtree-folder { + margin-bottom: 4px; + } + + ul.jqtree-tree li.jqtree-folder.jqtree-closed { + margin-bottom: 1px; + } + + ul.jqtree-tree li.jqtree-ghost { + position: relative; + z-index: 10; + margin-right: 10px; + } + + ul.jqtree-tree li.jqtree-ghost span { + display: block; + } + + ul.jqtree-tree li.jqtree-ghost span.jqtree-circle { + border: solid 2px #0000ff; + border-radius: 100px; + height: 8px; + width: 8px; + position: absolute; + top: -4px; + left: -6px; + box-sizing: border-box; + } + + ul.jqtree-tree li.jqtree-ghost span.jqtree-line { + background-color: #0000ff; + height: 2px; + padding: 0; + position: absolute; + top: -1px; + left: 2px; + width: 100%; + } + + ul.jqtree-tree li.jqtree-ghost.jqtree-inside { + margin-left: 48px; + } + + ul.jqtree-tree span.jqtree-border { + position: absolute; + display: block; + left: -2px; + top: 0; + border: solid 2px #0000ff; + border-radius: 6px; + margin: 0; + box-sizing: content-box; + } + + ul.jqtree-tree li.jqtree-selected > .jqtree-element, + ul.jqtree-tree li.jqtree-selected > .jqtree-element:hover { + background-color: #97BDD6; + background: -webkit-gradient(linear, left top, left bottom, from(#BEE0F5), to(#89AFCA)); + background: linear-gradient(#BEE0F5, #89AFCA); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); + } + + ul.jqtree-tree .jqtree-moving > .jqtree-element .jqtree-title { + outline: dashed 1px #0000ff; + } + +ul.jqtree-tree.jqtree-rtl { + direction: rtl; +} + +ul.jqtree-tree.jqtree-rtl ul.jqtree_common { + margin-left: 0; + margin-right: 12px; + } + +ul.jqtree-tree.jqtree-rtl .jqtree-toggler { + margin-left: 0.5em; + margin-right: 0; + } + +ul.jqtree-tree.jqtree-rtl .jqtree-title { + margin-left: 0; + margin-right: 1.5em; + } + +ul.jqtree-tree.jqtree-rtl .jqtree-title.jqtree-title-folder { + margin-right: 0; + } + +ul.jqtree-tree.jqtree-rtl li.jqtree-ghost { + margin-right: 0; + margin-left: 10px; + } + +ul.jqtree-tree.jqtree-rtl li.jqtree-ghost span.jqtree-circle { + right: -6px; + } + +ul.jqtree-tree.jqtree-rtl li.jqtree-ghost span.jqtree-line { + right: 2px; + } + +ul.jqtree-tree.jqtree-rtl li.jqtree-ghost.jqtree-inside { + margin-left: 0; + margin-right: 48px; + } + +ul.jqtree-tree.jqtree-rtl span.jqtree-border { + right: -2px; + } + +span.jqtree-dragging { + color: #fff; + background: #000; + opacity: 0.6; + cursor: pointer; + padding: 2px 8px; +} From 274739bc19dafa4204276979d49dea577b5b94da Mon Sep 17 00:00:00 2001 From: Yvan da Silva Date: Fri, 17 Jul 2020 10:45:06 +0200 Subject: [PATCH 0159/3088] Add GoDaddy DynDNS API support (#1654) Based on the following documentation https://developer.godaddy.com/ This adds support for GoDaddy DynDNS REST API. --- .../src/etc/inc/plugins.inc.d/dyndns.inc | 2 + .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 64 +++++++++++++++++++ dns/dyndns/src/www/services_dyndns_edit.php | 4 ++ 3 files changed, 70 insertions(+) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index 182091996d..ac717b7477 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -120,6 +120,8 @@ function dyndns_list() 'easydns' => 'easyDNS', 'eurodns' => 'EuroDNS', 'freedns' => 'freeDNS', + 'godaddy' => 'GoDaddy', + 'godaddy-v6' => 'GoDaddy (v6)', 'googledomains' => 'Google Domains', 'gratisdns' => 'GratisDNS', 'he-net' => 'HE.net', diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index a136f37b04..bb4d96f3f1 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -45,6 +45,8 @@ * - Azure DNS (azure.microsoft.com) * - Linode (linode.com) * - Linode IPv6 (linode.com) + * - GoDaddy (godaddy.com) + * - GoDaddy IPv6 (godaddy.com) * +----------------------------------------------------+ * Requirements: * - PHP version 4.0.2 or higher with the CURL Library and the PCRE Library @@ -103,6 +105,8 @@ * Azure DNS - Last Tested: 16 October 2019 * Linode - Last Tested: 25 February 2020 * Linode v6 - Last Tested: 25 February 2020 + * GoDaddy - Last Tested: 10 July 2020 + * GoDaddy v6 - Last Tested: 10 July 2020 * +====================================================+ * * @author E.Kristensen @@ -282,6 +286,7 @@ class updatedns case 'custom-v6': case 'dynv6-v6': case 'he-net-v6': + case 'godaddy-v6': case 'linode-v6': case 'regfish-v6': case 'route53-v6': @@ -352,6 +357,8 @@ class updatedns case 'easydns': case 'eurodns': case 'freedns': + case 'godaddy': + case 'godaddy-v6': case 'googledomains': case 'gratisdns': case 'he-net': @@ -1090,6 +1097,46 @@ class updatedns curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); break; + case 'godaddy': + case 'godaddy-v6': + /* Read https://developer.godaddy.com/ for API documentation */ + $baseApiUrl = 'https://api.godaddy.com/v1/domains/'; + $recordType = $this->_useIPv6 ? "AAAA" : "A"; + $splitHost = explode('.', trim($this->_dnsHost)); + $dnsDomain = '*'; + if ($this->_dnsWildcard != 'ON') { + $dnsDomain = array_shift($splitHost); + } + $dnsHost = implode('.', $splitHost); + + $url = $baseApiUrl . $dnsHost . '/records/' . $recordType . '/' . $dnsDomain; + + /* body can contain multiple options (data, port, priority, service, ttl, weight) */ + $data = array(); + $data[] = array('data' => $this->_dnsIP); + if ($this->_dnsTTL) { + $data[0]['ttl'] = $this->_dnsTTL; + } else { + // minimum allowed by GoDaddy + $data[0]['ttl'] = 600; + } + $jsonBody = json_encode($data); + if ($this->_dnsVerboseLog) { + log_error("Dynamic DNS: calling $url with body: $jsonBody"); + } + + /* PUT JSON /v1/domains/{domain}/records/{type}/{name} */ + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Accept: application/json', + 'Content-Type: application/json', + 'Authorization: sso-key ' . $this->_dnsUser . ':' . $this->_dnsPass + )); + curl_setopt($ch, CURLOPT_URL, $url); + + curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonBody); + break; default: break; } @@ -1537,6 +1584,23 @@ class updatedns $this->_debug($data); } break; + case 'godaddy': + case 'godaddy-v6': + /* See https://developer.godaddy.com/ for API documentation, not all codes are handled. */ + $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $successful_update = false; + if ($http_code == 200) { + $status = 'Dynamic DNS: (Success) IP Address Updated Successfully!'; + $successful_update = true; + } else if ($http_code == 401) { + $status = 'Dynamic DNS: (Error) Authentication info not sent or invalid'; + }else if ($http_code == 404) { + $status = 'Dynamic DNS: (Error) Resource not found'; + } else { + $status = "Dynamic DNS: (Error) Repsonse not handled check the following: {$data}"; + log_error("Dynamic DNS: (Error) HTTPS Status: {$http_code} PAYLOAD: {$data}"); + } + break; default: break; } diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index d13e552120..3db2e4e0fb 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -117,6 +117,8 @@ function is_dyndns_username($uname) case 'cloudflare-token': case 'cloudflare-token-v6': case 'eurodns': + case 'godaddy': + case 'godaddy-v6': case 'googledomains': case 'linode': case 'linode-v6': @@ -364,6 +366,7 @@ function is_dyndns_username($uname)


+
@@ -379,6 +382,7 @@ function is_dyndns_username($uname)


+
From ca59a6105778e361d575a6188e49f485fc675aeb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 17 Jul 2020 10:55:31 +0200 Subject: [PATCH 0160/3088] dns/dyndns: version 1.22 then --- dns/dyndns/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 8597694285..7911cd8872 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= dyndns -PLUGIN_VERSION= 1.21 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.22 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From 8b871922d5e4f0a1b5ebcc47843c3f4c09938880 Mon Sep 17 00:00:00 2001 From: "Patrick M. Hausen" Date: Mon, 20 Jul 2020 15:13:59 +0200 Subject: [PATCH 0161/3088] Add support for aggregation and Graphite Separate Instances to Collectd plugin, add 2 plugins to collectd (#1927) * Fix indentation * Make Graphite separate instances configurable * Add configuration to send CPU aggregate values * Remove superfluous blank lines * Fix inconsistent capitalisation * Add blank line between plugin sections * Add option to send CPU metrics as percent values * Fix inconsistent indentation * Fix inconsistent indentation * Add CPU temperature plugin * Add disk I/O plugin, remove CPU temperature plugin - it's not available * Add swap plugin * Fix misplaced `endif` in jinja template --- .../OPNsense/Collectd/forms/general.xml | 36 +++++++++++- .../app/models/OPNsense/Collectd/General.xml | 44 +++++++++++---- .../templates/OPNsense/Collectd/collectd.conf | 55 +++++++++++++++---- 3 files changed, 109 insertions(+), 26 deletions(-) diff --git a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml index 3e588da00f..1b60bf26fa 100644 --- a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml +++ b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml @@ -85,16 +85,22 @@
general.p_graphite_prefix - + text Prefix to set before the hostname. If it ends with a dot it creates an own directory. general.p_graphite_postfix - + text String to set after the hostname. For compatibility reason default is collectd, but you can also simply remove it. + + general.p_graphite_separate_instances + + checkbox + Enabling sends the plugin instance and type instance to Graphite as separate path components: host.cpu.0.cpu.idle. Disabling sends the plugin and plugin instance as one path component and type and type instance as another component: host.cpu-0.cpu-idle. + general.p_contextswitch_enable @@ -107,6 +113,24 @@ checkbox The CPU plugin collects the amount of time spent by the CPU in various states, most notably executing user code, executing system code, waiting for IO-operations and being idle. + + general.p_cpu_percent + + checkbox + When set, report CPU usage in percent instead of units of kernel time. + + + general.p_cpu_aggregates + + checkbox + Send aggregate values for CPU metrics in addition to values for individual cores. + + + general.p_disk_enable + + checkbox + The Disk plugin collects disk I/O information, i.e. read and write operations per second. + general.p_df_enable @@ -129,7 +153,13 @@ general.p_memory_enable checkbox - The Memory plugin collects physical memory utilization (Used, buffered, cached and free). + The Memory plugin collects physical memory utilization (used, buffered, cached and free). + + + general.p_swap_enable + + checkbox + The Swap plugin collects swap space utilization (used and free). general.p_processes_enable diff --git a/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml b/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml index 9dd07f44ab..960a6ed4eb 100644 --- a/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml +++ b/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml @@ -38,18 +38,18 @@ - N - /^([0-9a-zA-Z._\-]){1,128}$/u - - - - N - /^([0-9a-zA-Z._\-\!\$\%\/\(\)\+\#\=]){1,128}$/u - - - 0 - N - + N + /^([0-9a-zA-Z._\-]){1,128}$/u + + + + N + /^([0-9a-zA-Z._\-\!\$\%\/\(\)\+\#\=]){1,128}$/u + + + 0 + N + 0 N @@ -77,6 +77,10 @@ collectd N + + 0 + N + 1 N @@ -85,6 +89,18 @@ 1 N + + 1 + N + + + 1 + N + + + 1 + N + 1 N @@ -101,6 +117,10 @@ 1 N + + 1 + N + 1 N diff --git a/net-mgmt/collectd/src/opnsense/service/templates/OPNsense/Collectd/collectd.conf b/net-mgmt/collectd/src/opnsense/service/templates/OPNsense/Collectd/collectd.conf index b91d93af72..15af1eae7b 100644 --- a/net-mgmt/collectd/src/opnsense/service/templates/OPNsense/Collectd/collectd.conf +++ b/net-mgmt/collectd/src/opnsense/service/templates/OPNsense/Collectd/collectd.conf @@ -1,5 +1,4 @@ {% if helpers.exists('OPNsense.collectd.general.enabled') and OPNsense.collectd.general.enabled == '1' %} - {% if helpers.exists('OPNsense.collectd.general.hostname') and OPNsense.collectd.general.hostname != '' %} Hostname "{{ OPNsense.collectd.general.hostname }}" {% else %} @@ -12,12 +11,9 @@ FQDNLookup true Interval {{ OPNsense.collectd.general.interval }} {% endif %} - - - LoadPlugin syslog - LogLevel err + LogLevel err {% if helpers.exists('OPNsense.collectd.general.p_contextswitch_enable') and OPNsense.collectd.general.p_contextswitch_enable == '1' %} @@ -26,6 +22,12 @@ LoadPlugin contextswitch {% if helpers.exists('OPNsense.collectd.general.p_cpu_enable') and OPNsense.collectd.general.p_cpu_enable == '1' %} LoadPlugin cpu {% endif %} +{% if helpers.exists('OPNsense.collectd.general.p_cpu_aggregates') and OPNsense.collectd.general.p_cpu_aggregates == '1' %} +LoadPlugin aggregation +{% endif %} +{% if helpers.exists('OPNsense.collectd.general.p_disk_enable') and OPNsense.collectd.general.p_disk_enable == '1' %} +LoadPlugin disk +{% endif %} {% if helpers.exists('OPNsense.collectd.general.p_df_enable') and OPNsense.collectd.general.p_df_enable == '1' %} LoadPlugin df {% endif %} @@ -38,6 +40,9 @@ LoadPlugin load {% if helpers.exists('OPNsense.collectd.general.p_memory_enable') and OPNsense.collectd.general.p_memory_enable == '1' %} LoadPlugin memory {% endif %} +{% if helpers.exists('OPNsense.collectd.general.p_swap_enable') and OPNsense.collectd.general.p_swap_enable == '1' %} +LoadPlugin swap +{% endif %} {% if helpers.exists('OPNsense.collectd.general.p_network_enable') and OPNsense.collectd.general.p_network_enable == '1' %} LoadPlugin network {% endif %} @@ -65,19 +70,19 @@ LoadPlugin write_graphite {% if helpers.exists('OPNsense.collectd.general.p_network_host') and OPNsense.collectd.general.p_network_host != '' %} {% if helpers.exists('OPNsense.collectd.general.p_network_port') and OPNsense.collectd.general.p_network_port != '' %} - + {% if helpers.exists('OPNsense.collectd.general.p_network_username') and OPNsense.collectd.general.p_network_username != '' %} - Username "{{ OPNsense.collectd.general.p_network_username }}" + Username "{{ OPNsense.collectd.general.p_network_username }}" {% endif %} {% if helpers.exists('OPNsense.collectd.general.p_network_password') and OPNsense.collectd.general.p_network_password != '' %} - Password "{{ OPNsense.collectd.general.p_network_password }}" + Password "{{ OPNsense.collectd.general.p_network_password }}" {% endif %} {% if helpers.exists('OPNsense.collectd.general.p_network_username') and OPNsense.collectd.general.p_network_username != '' %} {% if helpers.exists('OPNsense.collectd.general.p_network_encryption') and OPNsense.collectd.general.p_network_encryption == '1' %} - SecurityLevel Encrypt + SecurityLevel Encrypt {% endif %} {% endif %} - + {% endif %} {% endif %} @@ -101,11 +106,15 @@ LoadPlugin write_graphite {% endif %} {% if helpers.exists('OPNsense.collectd.general.p_graphite_postfix') and OPNsense.collectd.general.p_graphite_postfix != '' %} Postfix "{{ OPNsense.collectd.general.p_graphite_postfix }}" +{% endif %} +{% if helpers.exists('OPNsense.collectd.general.p_graphite_separate_instances') and OPNsense.collectd.general.p_graphite_separate_instances == '1' %} + SeparateInstances true +{% else %} + SeparateInstances false {% endif %} StoreRates true AlwaysAppendDS false EscapeCharacter "_" - SeparateInstances false PreserveSeparator false DropDuplicateFields false @@ -113,4 +122,28 @@ LoadPlugin write_graphite {% endif %} {% endif %} + +{% if helpers.exists('OPNsense.collectd.general.p_cpu_percent') and OPNsense.collectd.general.p_cpu_percent == '1' %} + ValuesPercentage true +{% else %} + ValuesPercentage false +{% endif %} + + +{% if helpers.exists('OPNsense.collectd.general.p_cpu_aggregates') and OPNsense.collectd.general.p_cpu_aggregates == '1' %} + + + Plugin "cpu" + Type "percent" + GroupBy "Host" + GroupBy "TypeInstance" + CalculateNum false + CalculateSum true + CalculateAverage true + CalculateMinimum false + CalculateMaximum false + CalculateStddev false + + +{% endif %} {% endif %} From 6a74c2d4f4b5d9af6bb70cefe90f7d08065d9467 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 20 Jul 2020 16:37:59 +0200 Subject: [PATCH 0162/3088] net-mgmt/collectd: bump version, add changelog and credits (#1929) --- net-mgmt/collectd/Makefile | 2 +- net-mgmt/collectd/pkg-descr | 25 +++++++++++++++++++ .../OPNsense/Collectd/forms/general.xml | 12 +++++++++ .../app/models/OPNsense/Collectd/General.xml | 2 +- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/net-mgmt/collectd/Makefile b/net-mgmt/collectd/Makefile index fa38e96c0d..a67fb72124 100644 --- a/net-mgmt/collectd/Makefile +++ b/net-mgmt/collectd/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= collectd -PLUGIN_VERSION= 1.2 +PLUGIN_VERSION= 1.3 PLUGIN_COMMENT= Collect system and application performance metrics periodically PLUGIN_DEPENDS= collectd5 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/collectd/pkg-descr b/net-mgmt/collectd/pkg-descr index cfacb9279b..06744d71e5 100644 --- a/net-mgmt/collectd/pkg-descr +++ b/net-mgmt/collectd/pkg-descr @@ -3,4 +3,29 @@ performance metrics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files. + +Plugin Changelog +================ + +1.3 + +* Add support for CPU aggregation (contributed by @pmhausen) +* Make Graphite separate instances configurable (contributed by @pmhausen) +* Add disk I/O plugin (contributed by @pmhausen) + +1.2 + +* Make Hostname optional + +1.1 + +* Add prefix and postfix fields for Graphite + +1.0 + +* Allow exporting to network +* Allow exporting to Graphite +* Allow usage of most important plugins + + WWW: http://www.collectd.org diff --git a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml index 1b60bf26fa..6e05b7ca87 100644 --- a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml +++ b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml @@ -1,4 +1,8 @@
+ + section_title + + general.enabled @@ -23,6 +27,10 @@ text Global interval when to fetch values in seconds. + + section_title + + general.p_network_enable @@ -101,6 +109,10 @@ checkbox Enabling sends the plugin instance and type instance to Graphite as separate path components: host.cpu.0.cpu.idle. Disabling sends the plugin and plugin instance as one path component and type and type instance as another component: host.cpu-0.cpu-idle. + + section_title + + general.p_contextswitch_enable diff --git a/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml b/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml index 960a6ed4eb..b87d8f5ffb 100644 --- a/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml +++ b/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml @@ -1,7 +1,7 @@ //OPNsense/collectd/general Collectd configuration - 1.0.1 + 1.0.2 0 From f34342da10109ea4e782f8758a448c7480b984c9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 21 Jul 2020 13:10:23 +0200 Subject: [PATCH 0163/3088] LICENSE: sync --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index d4dd30ef24..b88f03b560 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ Copyright (c) 2015-2020 Ad Schellevis Copyright (c) 2019 Cloudfence - Julio Camargo (JCC) Copyright (c) 2005-2006 Colin Smith +Copyright (c) 2020 D. Domig Copyright (c) 2011 Dan Myers Copyright (c) 2017-2018 David Harrigan Copyright (c) 2014-2020 Deciso B.V. From f978efa3a76dac1696a583a1c1112c7e05ce897a Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jul 2020 22:53:39 +0200 Subject: [PATCH 0164/3088] net/wireguard: remove beta warning (#1931) --- .../opnsense/mvc/app/views/OPNsense/Wireguard/general.volt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt index fdbdf9a9a0..fa720d7042 100644 --- a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt +++ b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt @@ -36,10 +36,6 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Handshakes') }}
  • - -
    From 44413f47f438574a91bf7cf8c86516991273d1c5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 23 Jul 2020 08:15:32 +0200 Subject: [PATCH 0165/3088] net-mgmt/collectd: lint fix --- net-mgmt/collectd/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-mgmt/collectd/pkg-descr b/net-mgmt/collectd/pkg-descr index 06744d71e5..a350d3e2bc 100644 --- a/net-mgmt/collectd/pkg-descr +++ b/net-mgmt/collectd/pkg-descr @@ -13,7 +13,7 @@ Plugin Changelog * Make Graphite separate instances configurable (contributed by @pmhausen) * Add disk I/O plugin (contributed by @pmhausen) -1.2 +1.2 * Make Hostname optional From 1685999b9dd5cc659d99901d2eada79a8fa98c16 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 24 Jul 2020 23:23:30 +0200 Subject: [PATCH 0166/3088] net/haproxy: honor sort order of all rules, fixes #1925, refs #999 This partially reverts 1f9250e15bdca9601535378b8a5b72fa3ab557f6. --- .../templates/OPNsense/HAProxy/haproxy.conf | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index d3d4296893..bb61aa948d 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -44,7 +44,6 @@ {# # remember all ACLs to avoid duplicate declarations #} {% set acls_seen = [] %} {% set global_action_options = [] %} -{% set global_use_options = [] %} {% for action in linkedData.split(",") %} {% set action_data = helpers.getUUID(action) %} {# # collect ACLs for this action #} @@ -307,11 +306,10 @@ {% if acl_errors|int == 0 %} {% set action_enabled = '1' %} {% set action_options = [] %} -{% set use_options = [] %} {% if action_data.type == 'use_backend' %} {% if action_data.use_backend|default("") != "" %} {% set acl_backend_data = helpers.getUUID(action_data.use_backend) %} -{% do use_options.append('use_backend ' ~ acl_backend_data.name) %} +{% do action_options.append('use_backend ' ~ acl_backend_data.name) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters @@ -319,7 +317,7 @@ {% elif action_data.type == 'use_server' %} {% if action_data.use_server|default("") != "" %} {% set server_data = helpers.getUUID(action_data.use_server) %} -{% do use_options.append('use-server ' ~ server_data.name) %} +{% do action_options.append('use-server ' ~ server_data.name) %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters @@ -337,7 +335,7 @@ {% set defaultbackend_option = '' %} {% endif %} {# # Finally add map file to config #} -{% do use_options.append('use_backend %[req.hdr(host),lower,map_dom(' ~ mapfile_path ~ defaultbackend_option ~ ')]') %} +{% do action_options.append('use_backend %[req.hdr(host),lower,map_dom(' ~ mapfile_path ~ defaultbackend_option ~ ')]') %} {% else %} {% set action_enabled = '0' %} # ERROR: missing parameters @@ -554,10 +552,6 @@ {% do global_action_options.append(comment_lines|join('\n')) %} {% do global_action_options.append(([action_options|join(' '), acl_line]|join(' '))) %} {% endif %} -{% if use_options|length > 0 %} -{% do global_use_options.append(comment_lines|join('\n')) %} -{% do global_use_options.append(([use_options|join(' '), acl_line]|join(' '))) %} -{% endif %} {% else %} # ACTION INVALID: {{action_data.name}} {% endif %} @@ -569,10 +563,6 @@ {% if global_action_options|length > 0 %} {{global_action_options|join('\n' + ' ')}} - -{% endif %} -{% if global_use_options|length > 0 %} - {{global_use_options|join('\n' + ' ')}} {% endif %} {% else %} # ERROR: AclsAndActions called with empty data From d39344b88202a817006fd8210d1824145afa36f9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 25 Jul 2020 08:00:18 +0200 Subject: [PATCH 0167/3088] net-mgmt/zabbix5-proxy: move to v5 (#1932) --- net-mgmt/zabbix4-proxy/Makefile | 1 + net-mgmt/zabbix5-proxy/Makefile | 8 + net-mgmt/zabbix5-proxy/pkg-descr | 26 ++++ .../src/etc/inc/plugins.inc.d/zabbixproxy.inc | 49 ++++++ .../Zabbixproxy/Api/GeneralController.php | 39 +++++ .../Zabbixproxy/Api/ServiceController.php | 47 ++++++ .../Zabbixproxy/GeneralController.php | 38 +++++ .../OPNsense/Zabbixproxy/forms/general.xml | 145 ++++++++++++++++++ .../models/OPNsense/Zabbixproxy/ACL/ACL.xml | 9 ++ .../models/OPNsense/Zabbixproxy/General.php | 35 +++++ .../models/OPNsense/Zabbixproxy/General.xml | 107 +++++++++++++ .../models/OPNsense/Zabbixproxy/Menu/Menu.xml | 5 + .../views/OPNsense/Zabbixproxy/general.volt | 60 ++++++++ .../scripts/OPNsense/Zabbixproxy/setup.sh | 16 ++ .../conf/actions.d/actions_zabbixproxy.conf | 23 +++ .../templates/OPNsense/Zabbixproxy/+TARGETS | 3 + .../OPNsense/Zabbixproxy/zabbix_proxy | 6 + .../OPNsense/Zabbixproxy/zabbix_proxy.conf | 76 +++++++++ .../OPNsense/Zabbixproxy/zabbix_proxy.psk | 5 + 19 files changed, 698 insertions(+) create mode 100644 net-mgmt/zabbix5-proxy/Makefile create mode 100644 net-mgmt/zabbix5-proxy/pkg-descr create mode 100644 net-mgmt/zabbix5-proxy/src/etc/inc/plugins.inc.d/zabbixproxy.inc create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/Api/GeneralController.php create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/Api/ServiceController.php create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/GeneralController.php create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.php create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/views/OPNsense/Zabbixproxy/general.volt create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/service/conf/actions.d/actions_zabbixproxy.conf create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/+TARGETS create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.psk diff --git a/net-mgmt/zabbix4-proxy/Makefile b/net-mgmt/zabbix4-proxy/Makefile index ed0fea33a0..ae1fd3930c 100644 --- a/net-mgmt/zabbix4-proxy/Makefile +++ b/net-mgmt/zabbix4-proxy/Makefile @@ -2,6 +2,7 @@ PLUGIN_NAME= zabbix4-proxy PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= Zabbix Proxy enables decentralized monitoring PLUGIN_DEPENDS= zabbix4-proxy +PLUGIN_CONFLICTS= zabbix5-proxy PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" diff --git a/net-mgmt/zabbix5-proxy/Makefile b/net-mgmt/zabbix5-proxy/Makefile new file mode 100644 index 0000000000..89d4d33dde --- /dev/null +++ b/net-mgmt/zabbix5-proxy/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= zabbix5-proxy +PLUGIN_VERSION= 1.3 +PLUGIN_COMMENT= Zabbix Proxy enables decentralized monitoring +PLUGIN_DEPENDS= zabbix5-proxy +PLUGIN_CONFLICTS= zabbix4-proxy +PLUGIN_MAINTAINER= m.muenz@gmail.com + +.include "../../Mk/plugins.mk" diff --git a/net-mgmt/zabbix5-proxy/pkg-descr b/net-mgmt/zabbix5-proxy/pkg-descr new file mode 100644 index 0000000000..c99e873c49 --- /dev/null +++ b/net-mgmt/zabbix5-proxy/pkg-descr @@ -0,0 +1,26 @@ +Zabbix is an enterprise-class open source distributed monitoring solution. + +Zabbix is software that monitors numerous parameters of a network and the +health and integrity of servers. Zabbix uses a flexible notification +mechanism that allows users to configure e-mail based alerts for virtually +any event. This allows a fast reaction to server problems. Zabbix offers +excellent reporting and data visualisation features based on the stored +data. This makes Zabbix ideal for capacity planning. + +WWW: https://www.zabbix.com/ + +Plugin Changelog +---------------- + +1.3 + +* Switch to zabbix5-proxy + +1.2 + +* Allow adding multiple listen addresses + +1.1 + +* Add ProxyOfflineBuffer parameter +* Switch to new service control UI diff --git a/net-mgmt/zabbix5-proxy/src/etc/inc/plugins.inc.d/zabbixproxy.inc b/net-mgmt/zabbix5-proxy/src/etc/inc/plugins.inc.d/zabbixproxy.inc new file mode 100644 index 0000000000..d26017268a --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/etc/inc/plugins.inc.d/zabbixproxy.inc @@ -0,0 +1,49 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +function zabbixproxy_services() +{ + global $config; + + $services = array(); + + if (isset($config['OPNsense']['zabbixproxy']['general']['enabled']) && $config['OPNsense']['zabbixproxy']['general']['enabled'] == 1) { + $services[] = array( + 'description' => gettext('Zabbix Proxy'), + 'configd' => array( + 'restart' => array('zabbixproxy restart'), + 'start' => array('zabbixproxy start'), + 'stop' => array('zabbixproxy stop'), + ), + 'name' => 'zabbixproxy', + 'pidfile' => '/var/run/zabbix/zabbix_proxy.pid' + ); + } + + return $services; +} diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/Api/GeneralController.php b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/Api/GeneralController.php new file mode 100644 index 0000000000..7a930881dc --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/Api/GeneralController.php @@ -0,0 +1,39 @@ + + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +namespace OPNsense\Zabbixproxy\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class GeneralController extends ApiMutableModelControllerBase +{ + protected static $internalModelClass = '\OPNsense\Zabbixproxy\General'; + protected static $internalModelName = 'general'; +} diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/Api/ServiceController.php b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/Api/ServiceController.php new file mode 100644 index 0000000000..d94f2a1ced --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/Api/ServiceController.php @@ -0,0 +1,47 @@ + + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +namespace OPNsense\Zabbixproxy\Api; + +use OPNsense\Base\ApiMutableServiceControllerBase; +use OPNsense\Core\Backend; +use OPNsense\Zabbixproxy\General; + +/** + * Class ServiceController + * @package OPNsense\Zabbixproxy + */ +class ServiceController extends ApiMutableServiceControllerBase +{ + protected static $internalServiceClass = '\OPNsense\Zabbixproxy\General'; + protected static $internalServiceTemplate = 'OPNsense/Zabbixproxy'; + protected static $internalServiceEnabled = 'enabled'; + protected static $internalServiceName = 'zabbixproxy'; +} diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/GeneralController.php b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/GeneralController.php new file mode 100644 index 0000000000..56e2667c7f --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/GeneralController.php @@ -0,0 +1,38 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +namespace OPNsense\Zabbixproxy; + +class GeneralController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->generalForm = $this->getForm("general"); + $this->view->pick('OPNsense/Zabbixproxy/general'); + } +} diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml new file mode 100644 index 0000000000..11de26c17b --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml @@ -0,0 +1,145 @@ + + + general.enabled + + checkbox + This will activate the Zabbix Proxy service. + + + general.proxymode + + checkbox + Active (default) or passive mode, only switch to passive if you know what you are doing. + + + general.server + + text + IP address or hostname of Zabbix server. + + + general.serverport + + text + Port of Zabbix trapper on Zabbix server. Default is fine for most scenarios. + + + general.hostname + + text + The name of this Zabbix instance. It has to match with the defined name in the central Zabbix server. + + + general.listenip + + + select_multiple + true + List of comma delimited IP addresses that the trapper should listen on. Trapper will listen on all network interfaces if this parameter is missing. + + + general.listenport + + text + Listen port for trapper. Default is just fine. + + + general.sourceip + + text + Source IP address for outgoing connections. + + + general.startpollers + + text + Number of pre-forked instances of pollers. + + + general.startipmipollers + + text + Number of pre-forked instances of IPMI pollers. + + + general.startpollersunreachable + + text + Number of pre-forked instances of pollers for unreachable hosts (including IPMI and Java). + + + general.starttrappers + + text + Number of pre-forked instances of trappers. Trappers accept incoming connections from Zabbix sender and active agents. + + + general.startpingers + + text + Number of pre-forked instances of ICMP pingers. + + + general.startdiscoverers + + text + Number of pre-forked instances of discoverers. + + + general.starthttppollers + + text + Number of pre-forked instances of HTTP pollers. + + + general.cachesize + + text + Size of configuration cache, in bytes. Shared memory size, for storing hosts and items data. Range: 128K-8G + + + general.historycachesize + + text + Size of history cache in bytes. Shared memory size for storing history data. Range: 128K-2G + + + general.historyindexcachesize + + text + Size of history index cache in bytes. Shared memory size for indexing history cache. Range: 128K-2G + + + general.proxyofflinebuffer + + text + Set the time in hours how long the values will be buffered when the server is unreachable. + + + general.timeout + + text + Specifies how long we wait for agent, SNMP device or external check (in seconds). + + + general.encryption + + checkbox + Enable PSK based encryption for communicating with the Zabbix server + true + + + general.encryptionidentity + + text + The PSK identity configured on the Zabbix server + true + + + general.encryptionpsk + + text + The PSK configured on the Zabbix server + true + + diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml new file mode 100644 index 0000000000..6166a2c68d --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + Services: Zabbix Proxy + + ui/zabbixproxy/* + api/zabbixproxy/* + + + diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.php b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.php new file mode 100644 index 0000000000..351dbd9db5 --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.php @@ -0,0 +1,35 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +namespace OPNsense\Zabbixproxy; + +use OPNsense\Base\BaseModel; + +class General extends BaseModel +{ +} diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml new file mode 100644 index 0000000000..b4955e3c85 --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml @@ -0,0 +1,107 @@ + + //OPNsense/zabbixproxy/general + Zabbix Proxy configuration + 2.0.2 + + + 0 + Y + + + 0 + Y + + + + N + + + 10051 + N + + + Zabbix proxy + Y + + + 10051 + N + + + + , + Y + N + + + + N + + + 5 + N + + + 0 + N + + + 1 + N + + + 5 + N + + + 1 + N + + + 1 + N + + + 1 + N + + + 8M + N + + + 16M + N + + + 4M + N + + + N + 1 + 720 + Set a number between 1 and 720. + + + 4 + N + + + 0 + Y + + + + N + /^.{1,128}$/ + Should be a string between 1 and 128 characters. + + + + N + /^[A-Fa-f0-9]{32,512}$/ + Should be a hexadecimal string between 32 and 512 characters. + + + diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml new file mode 100644 index 0000000000..7b53017433 --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/views/OPNsense/Zabbixproxy/general.volt b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/views/OPNsense/Zabbixproxy/general.volt new file mode 100644 index 0000000000..0d5bef3833 --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/views/OPNsense/Zabbixproxy/general.volt @@ -0,0 +1,60 @@ +{# + +OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. +This file is Copyright © 2019 by Michael Muenz +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#} +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} +
    +
    + +
    +
    + + diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh new file mode 100644 index 0000000000..ba95dc0f4c --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# Setup database directory +mkdir -p /var/db/zabbix +chown -R zabbix:zabbix /var/db/zabbix +chmod 755 /var/db/zabbix + +# Setup logging +mkdir /var/log/zabbix +chown -R zabbix:zabbix /var/log/zabbix +chmod 770 /var/log/zabbix + +# Setup PID directory +mkdir -p /var/run/zabbix +chown -R zabbix:zabbix /var/run/zabbix +chmod 755 /var/run/zabbix diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/service/conf/actions.d/actions_zabbixproxy.conf b/net-mgmt/zabbix5-proxy/src/opnsense/service/conf/actions.d/actions_zabbixproxy.conf new file mode 100644 index 0000000000..7904a14457 --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/service/conf/actions.d/actions_zabbixproxy.conf @@ -0,0 +1,23 @@ +[start] +command:/usr/local/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh;/usr/local/etc/rc.d/zabbix_proxy start +parameters: +type:script +message:starting Zabbix Proxy + +[stop] +command:/usr/local/etc/rc.d/zabbix_proxy stop; exit 0 +parameters: +type:script +message:stopping Zabbix Proxy + +[restart] +command:/usr/local/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh;/usr/local/etc/rc.d/zabbix_proxy restart +parameters: +type:script +message:restarting Zabbix Proxy + +[status] +command:/usr/local/etc/rc.d/zabbix_proxy status;exit 0 +parameters: +type:script_output +message:request Zabbix Proxy status diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/+TARGETS b/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/+TARGETS new file mode 100644 index 0000000000..b797902b6f --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/+TARGETS @@ -0,0 +1,3 @@ +zabbix_proxy:/etc/rc.conf.d/zabbix_proxy +zabbix_proxy.conf:/usr/local/etc/zabbix5/zabbix_proxy.conf +zabbix_proxy.psk:/usr/local/etc/zabbix5/zabbix_proxy.psk diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy b/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy new file mode 100644 index 0000000000..f9c1bb348a --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy @@ -0,0 +1,6 @@ +{% if helpers.exists('OPNsense.zabbixproxy.general.enabled') and OPNsense.zabbixproxy.general.enabled == '1' %} +zabbix_proxy_var_script="/usr/local/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh" +zabbix_proxy_enable="YES" +{% else %} +zabbix_proxy_enable="NO" +{% endif %} diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf b/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf new file mode 100644 index 0000000000..31e1e31edd --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf @@ -0,0 +1,76 @@ +{% if helpers.exists('OPNsense.zabbixproxy.general.enabled') and OPNsense.zabbixproxy.general.enabled == '1' %} + +{% if helpers.exists('OPNsense.zabbixproxy.general.proxymode') and OPNsense.zabbixproxy.general.proxymode == '1' %} +ProxyMode=1 +{% else %} +ProxyMode=0 +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.server') and OPNsense.zabbixproxy.general.server != '' %} +Server={{ OPNsense.zabbixproxy.general.server }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.serverport') and OPNsense.zabbixproxy.general.serverport != '' %} +ServerPort={{ OPNsense.zabbixproxy.general.serverport }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.hostname') and OPNsense.zabbixproxy.general.hostname != '' %} +Hostname={{ OPNsense.zabbixproxy.general.hostname }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.listenport') and OPNsense.zabbixproxy.general.listenport != '' %} +ListenPort={{ OPNsense.zabbixproxy.general.listenport }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.sourceip') and OPNsense.zabbixproxy.general.sourceip != '' %} +SourceIP={{ OPNsense.zabbixproxy.general.sourceip }} +{% endif %} +LogFile=/var/log/zabbix/zabbix_proxy.log +PidFile=/var/run/zabbix/zabbix_proxy.pid +DBName=/var/db/zabbix/zabbix_proxy.db +{% if helpers.exists('OPNsense.zabbixproxy.general.proxyofflinebuffer') and OPNsense.zabbixproxy.general.proxyofflinebuffer != '' %} +ProxyOfflineBuffer={{ OPNsense.zabbixproxy.general.proxyofflinebuffer }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.startpollers') and OPNsense.zabbixproxy.general.startpollers != '' %} +StartPollers={{ OPNsense.zabbixproxy.general.startpollers }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.startipmipollers') and OPNsense.zabbixproxy.general.startipmipollers != '' %} +StartIPMIPollers={{ OPNsense.zabbixproxy.general.startipmipollers }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.startpollersunreachable') and OPNsense.zabbixproxy.general.startpollersunreachable != '' %} +StartPollersUnreachable={{ OPNsense.zabbixproxy.general.startpollersunreachable }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.starttrappers') and OPNsense.zabbixproxy.general.starttrappers != '' %} +StartTrappers={{ OPNsense.zabbixproxy.general.starttrappers }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.startpingers') and OPNsense.zabbixproxy.general.startpingers != '' %} +StartPingers={{ OPNsense.zabbixproxy.general.startpingers }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.startdiscoverers') and OPNsense.zabbixproxy.general.startdiscoverers != '' %} +StartDiscoverers={{ OPNsense.zabbixproxy.general.startdiscoverers }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.starthttppollers') and OPNsense.zabbixproxy.general.starthttppollers != '' %} +StartHTTPPollers={{ OPNsense.zabbixproxy.general.starthttppollers }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.listenip') and OPNsense.zabbixproxy.general.listenip != '' %} +ListenIP={{ OPNsense.zabbixproxy.general.listenip }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.cachesize') and OPNsense.zabbixproxy.general.cachesize != '' %} +CacheSize={{ OPNsense.zabbixproxy.general.cachesize }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.historycachesize') and OPNsense.zabbixproxy.general.historycachesize != '' %} +HistoryCacheSize={{ OPNsense.zabbixproxy.general.historycachesize }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.historyindexcachesize') and OPNsense.zabbixproxy.general.historyindexcachesize != '' %} +HistoryIndexCacheSize={{ OPNsense.zabbixproxy.general.historyindexcachesize }} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.timeout') and OPNsense.zabbixproxy.general.timeout != '' %} +Timeout={{ OPNsense.zabbixproxy.general.timeout }} +{% endif %} +FpingLocation=/usr/local/sbin/fping +Fping6Location=/usr/local/sbin/fping6 +{% if helpers.exists('OPNsense.zabbixproxy.general.encryption') and OPNsense.zabbixproxy.general.encryption == '1' %} +{% if helpers.exists('OPNsense.zabbixproxy.general.proxymode') and OPNsense.zabbixproxy.general.proxymode == '1' %} +TLSAccept=psk +{% else %} +TLSConnect=psk +{% endif %} +TLSPSKFile=/usr/local/etc/zabbix5/zabbix_proxy.psk +TLSPSKIdentity={{ OPNsense.zabbixproxy.general.encryptionidentity }} +{% endif %} +{% endif %} diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.psk b/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.psk new file mode 100644 index 0000000000..1e53053b50 --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.psk @@ -0,0 +1,5 @@ +{% if helpers.exists('OPNsense.zabbixproxy.general.enabled') and OPNsense.zabbixproxy.general.enabled == '1' %} +{% if helpers.exists('OPNsense.zabbixproxy.general.encryption') and OPNsense.zabbixproxy.general.encryption == '1' %} +{{ OPNsense.zabbixproxy.general.encryptionpsk }} +{% endif %} +{% endif %} From cf2f47d3c96b5920897f394ad330e4410dad8521 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 26 Jul 2020 07:29:38 +0200 Subject: [PATCH 0168/3088] net/chrony: New plugin (#1871) --- net/chrony/Makefile | 8 +++ net/chrony/pkg-descr | 14 +++++ .../src/etc/inc/plugins.inc.d/chrony.inc | 49 ++++++++++++++++ .../OPNsense/Chrony/Api/GeneralController.php | 37 ++++++++++++ .../OPNsense/Chrony/Api/ServiceController.php | 39 +++++++++++++ .../OPNsense/Chrony/GeneralController.php | 38 ++++++++++++ .../OPNsense/Chrony/forms/general.xml | 30 ++++++++++ .../app/models/OPNsense/Chrony/ACL/ACL.xml | 9 +++ .../app/models/OPNsense/Chrony/General.php | 35 +++++++++++ .../app/models/OPNsense/Chrony/General.xml | 26 +++++++++ .../app/models/OPNsense/Chrony/Menu/Menu.xml | 7 +++ .../app/views/OPNsense/Chrony/general.volt | 58 +++++++++++++++++++ .../opnsense/scripts/OPNsense/Chrony/setup.sh | 5 ++ .../conf/actions.d/actions_chrony.conf | 23 ++++++++ .../templates/OPNsense/Chrony/+TARGETS | 2 + .../templates/OPNsense/Chrony/chrony.conf | 19 ++++++ .../service/templates/OPNsense/Chrony/chronyd | 7 +++ 17 files changed, 406 insertions(+) create mode 100644 net/chrony/Makefile create mode 100644 net/chrony/pkg-descr create mode 100644 net/chrony/src/etc/inc/plugins.inc.d/chrony.inc create mode 100644 net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/GeneralController.php create mode 100644 net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/ServiceController.php create mode 100644 net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/GeneralController.php create mode 100644 net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml create mode 100644 net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/ACL/ACL.xml create mode 100644 net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.php create mode 100644 net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml create mode 100644 net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/Menu/Menu.xml create mode 100644 net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt create mode 100644 net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh create mode 100644 net/chrony/src/opnsense/service/conf/actions.d/actions_chrony.conf create mode 100644 net/chrony/src/opnsense/service/templates/OPNsense/Chrony/+TARGETS create mode 100644 net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf create mode 100644 net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chronyd diff --git a/net/chrony/Makefile b/net/chrony/Makefile new file mode 100644 index 0000000000..2ca167d2e0 --- /dev/null +++ b/net/chrony/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= chrony +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= Chrony time synchronisation +PLUGIN_DEPENDS= chrony +PLUGIN_MAINTAINER= m.muenz@gmail.com +PLUGIN_DEVEL= yes + +.include "../../Mk/plugins.mk" diff --git a/net/chrony/pkg-descr b/net/chrony/pkg-descr new file mode 100644 index 0000000000..0fd3f4ae53 --- /dev/null +++ b/net/chrony/pkg-descr @@ -0,0 +1,14 @@ +An alternative to native ntpd daemon. In some edge cases chrony works +better in virtual environments. + +Plugin Changelog +---------------- + +1.0 + +* Allow to adjust the listening port +* Allow setting of up to three peers +* Use of allowed networks + + +WWW: https://chrony.tuxfamily.org/ diff --git a/net/chrony/src/etc/inc/plugins.inc.d/chrony.inc b/net/chrony/src/etc/inc/plugins.inc.d/chrony.inc new file mode 100644 index 0000000000..36af05a37a --- /dev/null +++ b/net/chrony/src/etc/inc/plugins.inc.d/chrony.inc @@ -0,0 +1,49 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +function chrony_services() +{ + global $config; + + $services = array(); + + if (isset($config['OPNsense']['chrony']['general']['enabled']) && $config['OPNsense']['chrony']['general']['enabled'] == 1) { + $services[] = array( + 'description' => gettext('chrony daemon'), + 'configd' => array( + 'restart' => array('chrony restart'), + 'start' => array('chrony start'), + 'stop' => array('chrony stop'), + ), + 'name' => 'chronyd', + 'pidfile' => '/var/run/chrony/chronyd.pid' + ); + } + + return $services; +} diff --git a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/GeneralController.php b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/GeneralController.php new file mode 100644 index 0000000000..d96f5a1213 --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/GeneralController.php @@ -0,0 +1,37 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Chrony\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class GeneralController extends ApiMutableModelControllerBase +{ + protected static $internalModelClass = '\OPNsense\Chrony\General'; + protected static $internalModelName = 'general'; +} diff --git a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/ServiceController.php b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/ServiceController.php new file mode 100644 index 0000000000..d441d9dc68 --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/ServiceController.php @@ -0,0 +1,39 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Chrony\Api; + +use OPNsense\Base\ApiMutableServiceControllerBase; + +class ServiceController extends ApiMutableServiceControllerBase +{ + protected static $internalServiceClass = '\OPNsense\Chrony\General'; + protected static $internalServiceTemplate = 'OPNsense/Chrony'; + protected static $internalServiceEnabled = 'enabled'; + protected static $internalServiceName = 'chrony'; +} diff --git a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/GeneralController.php b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/GeneralController.php new file mode 100644 index 0000000000..faa214b6a0 --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/GeneralController.php @@ -0,0 +1,38 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Chrony; + +class GeneralController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->generalForm = $this->getForm('general'); + $this->view->pick('OPNsense/Chrony/general'); + } +} diff --git a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml new file mode 100644 index 0000000000..ee8d8326c2 --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml @@ -0,0 +1,30 @@ +
    + + general.enabled + + checkbox + Enable Chrony time daemon. + + + general.port + + text + Set the port chrony listen to. + + + general.peers + + + select_multiple + true + Set as many NTP peers you need. + + + general.allowednetworks + + + select_multiple + true + Set the networks allowed to synchronize time with this server. If this value is not set it will also not listen to the port and just synchronize the time for itself. + +
    diff --git a/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/ACL/ACL.xml b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/ACL/ACL.xml new file mode 100644 index 0000000000..ece3f4af8e --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + Services: Chrony + + ui/chrony/* + api/chrony/* + + + diff --git a/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.php b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.php new file mode 100644 index 0000000000..ddbdd9413e --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.php @@ -0,0 +1,35 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Chrony; + +use OPNsense\Base\BaseModel; + +class General extends BaseModel +{ +} diff --git a/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml new file mode 100644 index 0000000000..30b99eb530 --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml @@ -0,0 +1,26 @@ + + //OPNsense/chrony/general + Chrony configuration + 0.0.1 + + + 0 + Y + + + 323 + Y + + + 0.opnsense.pool.ntp.org + Y + , + Y + + + N + , + Y + + + diff --git a/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/Menu/Menu.xml b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/Menu/Menu.xml new file mode 100644 index 0000000000..e11f5fe9cb --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/Menu/Menu.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt b/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt new file mode 100644 index 0000000000..be8b75de22 --- /dev/null +++ b/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt @@ -0,0 +1,58 @@ +{# + # Copyright (c) 2019 Deciso B.V. + # Copyright (c) 2020 Michael Muenz + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} + +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} +
    +
    + +
    +
    + + diff --git a/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh b/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh new file mode 100644 index 0000000000..ddc03d6a0c --- /dev/null +++ b/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p /var/db/chrony/ /var/run/chrony/ +chown -R chronyd:chronyd /var/db/chrony/ /var/run/chrony/ +chmod 750 /var/db/chrony/ /var/run/chrony/ diff --git a/net/chrony/src/opnsense/service/conf/actions.d/actions_chrony.conf b/net/chrony/src/opnsense/service/conf/actions.d/actions_chrony.conf new file mode 100644 index 0000000000..dd50d41c47 --- /dev/null +++ b/net/chrony/src/opnsense/service/conf/actions.d/actions_chrony.conf @@ -0,0 +1,23 @@ +[start] +command:/usr/local/opnsense/scripts/OPNsense/Chrony/setup.sh;/usr/local/etc/rc.d/chronyd start +parameters: +type:script +message:starting chrony + +[stop] +command:/usr/local/etc/rc.d/chronyd stop +parameters: +type:script +message:stopping chrony + +[restart] +command:/usr/local/opnsense/scripts/OPNsense/Chrony/setup.sh;/usr/local/etc/rc.d/chronyd restart +parameters: +type:script +message:restarting chrony + +[status] +command:/usr/local/etc/rc.d/chronyd status;exit 0 +parameters: +type:script_output +message:request chrony status diff --git a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/+TARGETS b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/+TARGETS new file mode 100644 index 0000000000..a0947f1901 --- /dev/null +++ b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/+TARGETS @@ -0,0 +1,2 @@ +chronyd:/etc/rc.conf.d/chronyd +chrony.conf:/usr/local/etc/chrony.conf diff --git a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf new file mode 100644 index 0000000000..38397c3a6f --- /dev/null +++ b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf @@ -0,0 +1,19 @@ +{% if helpers.exists('OPNsense.chrony.general.enabled') and OPNsense.chrony.general.enabled == '1' %} + +port {{ OPNsense.chrony.general.port }} +driftfile /var/db/chrony/drift +pidfile /var/run/chrony/chronyd.pid + +{% if not helpers.empty('OPNsense.chrony.general.peers') %} +{% for peer in OPNsense.chrony.general.peers.split(',') %} +server {{ peer }} iburst +{% endfor %} +{% endif %} + +{% if not helpers.empty('OPNsense.chrony.general.allowednetworks') %} +{% for network in OPNsense.chrony.general.allowednetworks.split(',') %} +allow {{ network }} +{% endfor %} +{% endif %} + +{% endif %} diff --git a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chronyd b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chronyd new file mode 100644 index 0000000000..2faa5b55bc --- /dev/null +++ b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chronyd @@ -0,0 +1,7 @@ +{% if helpers.exists('OPNsense.chrony.general.enabled') and OPNsense.chrony.general.enabled == '1' %} +chronyd_var_script="/usr/local/opnsense/scripts/OPNsense/Chrony/setup.sh" +chronyd_enable="YES" +{% else %} +chronyd_enable="NO" +{% endif %} +chronyd_var_mfs="/var/db/chronyd /var/run/chronyd" From 23dcff078a4ba0e40b98231b8fde23b75ee41daf Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 26 Jul 2020 07:30:52 +0200 Subject: [PATCH 0169/3088] net/chrony|net-mgmt/zabbix5-proxy: whitespace sweep and sync --- README.md | 2 ++ .../src/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh | 0 net/chrony/pkg-descr | 6 +++--- net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh | 0 4 files changed, 5 insertions(+), 3 deletions(-) mode change 100644 => 100755 net-mgmt/zabbix5-proxy/src/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh mode change 100644 => 100755 net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh diff --git a/README.md b/README.md index 6d6a923032..9ae4e6a7a7 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ net-mgmt/nrpe -- Execute nagios plugins net-mgmt/telegraf -- Agent for collecting metrics and data net-mgmt/zabbix-agent -- Zabbix monitoring agent net-mgmt/zabbix4-proxy -- Zabbix Proxy enables decentralized monitoring +net-mgmt/zabbix5-proxy -- Zabbix Proxy enables decentralized monitoring +net/chrony -- Chrony time synchronisation (development only) net/firewall -- Firewall API supplemental package net/freeradius -- RADIUS Authentication, Authorization and Accounting Server net/frr -- The FRRouting Protocol Suite diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/OPNsense/Zabbixproxy/setup.sh old mode 100644 new mode 100755 diff --git a/net/chrony/pkg-descr b/net/chrony/pkg-descr index 0fd3f4ae53..de8195fad6 100644 --- a/net/chrony/pkg-descr +++ b/net/chrony/pkg-descr @@ -1,5 +1,5 @@ -An alternative to native ntpd daemon. In some edge cases chrony works -better in virtual environments. +An alternative to native ntpd daemon. In some edge cases chrony works +better in virtual environments. Plugin Changelog ---------------- @@ -8,7 +8,7 @@ Plugin Changelog * Allow to adjust the listening port * Allow setting of up to three peers -* Use of allowed networks +* Use of allowed networks WWW: https://chrony.tuxfamily.org/ diff --git a/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh b/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh old mode 100644 new mode 100755 From d90832d346c023ebab34c8fd535f521c79811fe9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 26 Jul 2020 17:09:43 +0200 Subject: [PATCH 0170/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index b07f11984d..13cc033de8 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 2.23 +PLUGIN_VERSION= 2.24 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de From 903e64c4481f0c4eae239d41f4dd91130a911684 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 26 Jul 2020 17:51:56 +0200 Subject: [PATCH 0171/3088] net/haproxy: add http-[request|response] set-var, refs #1796 --- .../OPNsense/HAProxy/forms/dialogAction.xml | 44 +++++++++++++++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 42 +++++++++++++++++- .../templates/OPNsense/HAProxy/haproxy.conf | 14 ++++++ 3 files changed, 99 insertions(+), 1 deletion(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml index 5a7881def1..c10565e9f3 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml @@ -203,6 +203,28 @@ text + + + header + + + + action.http_request_set_var_scope + + dropdown + + + + action.http_request_set_var_name + + text + + + action.http_request_set_var_expr + + text + + header @@ -310,6 +332,28 @@ text + + + header + + + + action.http_response_set_var_scope + + dropdown + + + + action.http_response_set_var_name + + text + + + action.http_response_set_var_expr + + text + + header diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index e06699a610..d7968fcdf3 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1829,6 +1829,7 @@ http-request header replace http-request header replace value http-request set-path + http-request set-var http-response allow http-response deny http-response lua script @@ -1837,7 +1838,8 @@ http-response header delete http-response header replace http-response header replace value - Set HTTP status code in response + http-response set-status + http-response set-var tcp-request connection accept tcp-request connection reject tcp-request content accept @@ -1934,6 +1936,25 @@ /^.{1,4096}$/u N + + N + txn + + variable is shared with the whole process + variable is shared with the whole session + variable is shared with the transaction (request/response) + variable is shared only during request processing + variable is shared only during response processing + + + + /^.{1,4096}$/u + N + + + /^.{1,4096}$/u + N + /^.{1,4096}$/u N @@ -1984,6 +2005,25 @@ /^.{1,4096}$/u N + + N + txn + + variable is shared with the whole process + variable is shared with the whole session + variable is shared with the transaction (request/response) + variable is shared only during request processing + variable is shared only during response processing + + + + /^.{1,4096}$/u + N + + + /^.{1,4096}$/u + N + /^.{1,4096}$/u N diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index bb61aa948d..f1abab9d01 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -415,6 +415,13 @@ {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} +{% elif action_data.type == 'http-request_set-var' %} +{% if action_data.http_request_set_var_scope|default("") != "" and action_data.http_request_set_var_name|default("") != "" and action_data.http_request_set_var_expr|default("") != "" %} +{% do action_options.append('http-request set-var(' ~ action_data.http_request_set_var_scope ~ '.' ~ action_data.http_request_set_var_name ~ ') ' ~ action_data.http_request_set_var_expr) %} +{% else %} +{% set action_enabled = '0' %} + # ERROR: missing parameters +{% endif %} {% elif action_data.type == 'http-response_allow' %} {% do action_options.append('http-response allow') %} {% elif action_data.type == 'http-response_deny' %} @@ -473,6 +480,13 @@ {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} +{% elif action_data.type == 'http-response_set-var' %} +{% if action_data.http_response_set_var_scope|default("") != "" and action_data.http_response_set_var_name|default("") != "" and action_data.http_response_set_var_expr|default("") != "" %} +{% do action_options.append('http-response set-var(' ~ action_data.http_response_set_var_scope ~ '.' ~ action_data.http_response_set_var_name ~ ') ' ~ action_data.http_response_set_var_expr) %} +{% else %} +{% set action_enabled = '0' %} + # ERROR: missing parameters +{% endif %} {% elif action_data.type == 'tcp-request_connection_accept' %} {% do action_options.append('tcp-request connection accept') %} {% elif action_data.type == 'tcp-request_connection_reject' %} From d7be04b57e2f4959e253510c4ba7e2634c06d8ef Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 26 Jul 2020 23:23:07 +0200 Subject: [PATCH 0172/3088] net/haproxy: allow to add groups as userlists, refs #1796 --- .../OPNsense/HAProxy/forms/dialogGroup.xml | 6 +++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 6 ++- .../templates/OPNsense/HAProxy/haproxy.conf | 42 ++++++++++++++----- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogGroup.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogGroup.xml index d868a472db..dd8956ffbd 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogGroup.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogGroup.xml @@ -24,4 +24,10 @@ true Type username or choose from list. + + group.add_userlist + + checkbox + Usually HAproxy userlists are created automatically in a context sensitive way. This option adds this group as userlist, so that it can be referenced in rules/conditions. All special and non-alphanumeric characters will be removed from the userlist name. + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index d7968fcdf3..584a74bba8 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 2.8.0 + 2.9.0 the HAProxy load balancer @@ -2219,6 +2219,10 @@ Y N + + 0 + N + diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index f1abab9d01..ac4f9d2003 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -729,7 +729,7 @@ {% endif %} {% endfor %} {% else %} - # WARNING: UserlistAddUsers called with empty user data + # NOTE: UserlistAddUsers called with empty user data {% endif %} {# # process all group members #} {% if linkedGroupData is defined %} @@ -758,20 +758,32 @@ {% endif %} {% endfor %} {% else %} - # WARNING: UserlistAddUsers called with empty group data + # NOTE: UserlistAddUsers called with empty group data {% endif %} {%- endmacro %} -{# Macro expects a backend or frontend object. #} -{% macro AddUserlist(proxy) -%} -{% if proxy is defined %} -{% if (proxy.enabled|default("") == '1' and proxy.mode|default("") == 'http' and proxy.basicAuthEnabled|default("") == '1') %} +{# Macro expects a backend/frontend (type 1) or group object (type 2). #} +{% macro AddUserlist(type,object) -%} +{% if (type == '1' and object is defined) %} +{# # frontend/backend object #} +{% if (object.enabled|default("") == '1' and object.mode|default("") == 'http' and object.basicAuthEnabled|default("") == '1') %} {# # call macro to generate list of unique users #} -{% set userlist_result = UserlistAddUsers(proxy.basicAuthUsers,proxy.basicAuthGroups) %} +{% set userlist_result = UserlistAddUsers(object.basicAuthUsers,object.basicAuthGroups) %} {# # check result, skip when empty #} {% if (userlist_result is defined and userlist_result|default("") != "" )%} -userlist list_{{proxy.id}} - # Origin: {{proxy.name}} +userlist list_{{object.id}} + # Origin: {{object.name}} +{{userlist_result}} +{% endif %} +{% endif %} +{% elif (type == '2' and object is defined) %} +{# # group object #} +{% if (object.enabled|default("") == '1' and object.add_userlist|default("") == '1') %} +{# # call macro to generate list of unique users #} +{% set userlist_result = UserlistAddUsers(object.members) %} +{# # check result, skip when empty #} +{% if (userlist_result is defined and userlist_result|default("") != "" ) %} +userlist {{object.name | regex_replace ("[^A-Za-z0-9]","")}} {{userlist_result}} {% endif %} {% endif %} @@ -951,17 +963,25 @@ userlist acl_{{acl.id}} {% endfor %} {% endif %} +{% if helpers.exists('OPNsense.HAProxy.groups') %} +# userlists generated from groups +{% for group in helpers.toList('OPNsense.HAProxy.groups.group') %} +{# # call macro to generate userlist #} +{{ AddUserlist('2',group) -}} +{% endfor %} +{% endif %} + # autogenerated entries for config in backends/frontends {% if helpers.exists('OPNsense.HAProxy.frontends') %} {% for frontend in helpers.toList('OPNsense.HAProxy.frontends.frontend') %} {# # call macro to generate userlist #} -{{ AddUserlist(frontend) -}} +{{ AddUserlist('1',frontend) -}} {% endfor %} {% endif %} {% if helpers.exists('OPNsense.HAProxy.backends') %} {% for backend in helpers.toList('OPNsense.HAProxy.backends.backend') %} {# # call macro to generate userlist #} -{{ AddUserlist(backend) -}} +{{ AddUserlist('1',backend) -}} {% endfor %} {% endif %} From 03764dfc7419a2c69f5e79c74018e79519fc67e9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 28 Jul 2020 10:50:57 +0200 Subject: [PATCH 0173/3088] plugins: switch to 20.7 development --- LICENSE | 3 +- Mk/defaults.mk | 2 +- README.md | 4 - dns/unbound-plus/Makefile | 7 - dns/unbound-plus/pkg-descr | 16 - .../Unboundplus/Api/DnsblController.php | 37 -- .../Api/MiscellaneousController.php | 37 -- .../Unboundplus/Api/ServiceController.php | 62 -- .../OPNsense/Unboundplus/DnsblController.php | 38 -- .../Unboundplus/MiscellaneousController.php | 38 -- .../OPNsense/Unboundplus/forms/dnsbl.xml | 30 - .../Unboundplus/forms/miscellaneous.xml | 18 - .../models/OPNsense/Unboundplus/ACL/ACL.xml | 9 - .../app/models/OPNsense/Unboundplus/Dnsbl.php | 35 -- .../app/models/OPNsense/Unboundplus/Dnsbl.xml | 47 -- .../models/OPNsense/Unboundplus/Menu/Menu.xml | 8 - .../OPNsense/Unboundplus/Miscellaneous.php | 35 -- .../OPNsense/Unboundplus/Miscellaneous.xml | 14 - .../app/views/OPNsense/Unboundplus/dnsbl.volt | 54 -- .../OPNsense/Unboundplus/miscellaneous.volt | 54 -- .../scripts/OPNsense/Unboundplus/dnsbl.py | 197 ------ .../conf/actions.d/actions_unboundplus.conf | 6 - .../templates/OPNsense/Unboundplus/+TARGETS | 5 - .../templates/OPNsense/Unboundplus/dnsbl.inc | 5 - .../templates/OPNsense/Unboundplus/dot.conf | 10 - .../templates/OPNsense/Unboundplus/lists.inc | 5 - .../OPNsense/Unboundplus/miscellaneous.conf | 6 - .../OPNsense/Unboundplus/whitelist.inc | 5 - net/l2tp/Makefile | 7 - net/l2tp/pkg-descr | 16 - .../src/etc/inc/plugins.inc.d/if_l2tp.inc | 279 --------- .../mvc/app/models/OPNsense/L2TP/ACL/ACL.xml | 26 - .../app/models/OPNsense/L2TP/Menu/Menu.xml | 13 - net/l2tp/src/www/diag_logs_template_l2tp.inc | 117 ---- net/l2tp/src/www/vpn_l2tp.php | 345 ----------- net/l2tp/src/www/vpn_l2tp_log.inc | 120 ---- net/l2tp/src/www/vpn_l2tp_log.php | 26 - net/l2tp/src/www/vpn_l2tp_users.php | 141 ----- net/l2tp/src/www/vpn_l2tp_users_edit.php | 206 ------- net/pppoe/Makefile | 7 - net/pppoe/pkg-descr | 16 - .../src/etc/inc/plugins.inc.d/if_pppoe.inc | 328 ---------- .../mvc/app/models/OPNsense/PPPoE/ACL/ACL.xml | 20 - .../app/models/OPNsense/PPPoE/Menu/Menu.xml | 12 - .../src/www/diag_logs_template_pppoe.inc | 117 ---- net/pppoe/src/www/vpn_pppoe.php | 153 ----- net/pppoe/src/www/vpn_pppoe_edit.php | 560 ------------------ net/pppoe/src/www/vpn_pppoe_log.inc | 120 ---- net/pppoe/src/www/vpn_pppoe_log.php | 24 - net/pptp/Makefile | 7 - net/pptp/pkg-descr | 16 - .../src/etc/inc/plugins.inc.d/if_pptp.inc | 306 ---------- .../mvc/app/models/OPNsense/PPTP/ACL/ACL.xml | 26 - .../app/models/OPNsense/PPTP/Menu/Menu.xml | 13 - net/pptp/src/www/diag_logs_template_pptp.inc | 117 ---- net/pptp/src/www/vpn_pptp.php | 418 ------------- net/pptp/src/www/vpn_pptp_log.inc | 120 ---- net/pptp/src/www/vpn_pptp_log.php | 26 - net/pptp/src/www/vpn_pptp_users.php | 136 ----- net/pptp/src/www/vpn_pptp_users_edit.php | 212 ------- 60 files changed, 2 insertions(+), 4835 deletions(-) delete mode 100644 dns/unbound-plus/Makefile delete mode 100644 dns/unbound-plus/pkg-descr delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/DnsblController.php delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/MiscellaneousController.php delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/ServiceController.php delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/DnsblController.php delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/MiscellaneousController.php delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/forms/dnsbl.xml delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/forms/miscellaneous.xml delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/ACL/ACL.xml delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Dnsbl.php delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Dnsbl.xml delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Menu/Menu.xml delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.php delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/views/OPNsense/Unboundplus/dnsbl.volt delete mode 100644 dns/unbound-plus/src/opnsense/mvc/app/views/OPNsense/Unboundplus/miscellaneous.volt delete mode 100755 dns/unbound-plus/src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py delete mode 100644 dns/unbound-plus/src/opnsense/service/conf/actions.d/actions_unboundplus.conf delete mode 100644 dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/+TARGETS delete mode 100644 dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dnsbl.inc delete mode 100644 dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dot.conf delete mode 100644 dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/lists.inc delete mode 100644 dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/miscellaneous.conf delete mode 100644 dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/whitelist.inc delete mode 100644 net/l2tp/Makefile delete mode 100644 net/l2tp/pkg-descr delete mode 100644 net/l2tp/src/etc/inc/plugins.inc.d/if_l2tp.inc delete mode 100644 net/l2tp/src/opnsense/mvc/app/models/OPNsense/L2TP/ACL/ACL.xml delete mode 100644 net/l2tp/src/opnsense/mvc/app/models/OPNsense/L2TP/Menu/Menu.xml delete mode 100644 net/l2tp/src/www/diag_logs_template_l2tp.inc delete mode 100644 net/l2tp/src/www/vpn_l2tp.php delete mode 100644 net/l2tp/src/www/vpn_l2tp_log.inc delete mode 100644 net/l2tp/src/www/vpn_l2tp_log.php delete mode 100644 net/l2tp/src/www/vpn_l2tp_users.php delete mode 100644 net/l2tp/src/www/vpn_l2tp_users_edit.php delete mode 100644 net/pppoe/Makefile delete mode 100644 net/pppoe/pkg-descr delete mode 100644 net/pppoe/src/etc/inc/plugins.inc.d/if_pppoe.inc delete mode 100644 net/pppoe/src/opnsense/mvc/app/models/OPNsense/PPPoE/ACL/ACL.xml delete mode 100644 net/pppoe/src/opnsense/mvc/app/models/OPNsense/PPPoE/Menu/Menu.xml delete mode 100644 net/pppoe/src/www/diag_logs_template_pppoe.inc delete mode 100644 net/pppoe/src/www/vpn_pppoe.php delete mode 100644 net/pppoe/src/www/vpn_pppoe_edit.php delete mode 100644 net/pppoe/src/www/vpn_pppoe_log.inc delete mode 100644 net/pppoe/src/www/vpn_pppoe_log.php delete mode 100644 net/pptp/Makefile delete mode 100644 net/pptp/pkg-descr delete mode 100644 net/pptp/src/etc/inc/plugins.inc.d/if_pptp.inc delete mode 100644 net/pptp/src/opnsense/mvc/app/models/OPNsense/PPTP/ACL/ACL.xml delete mode 100644 net/pptp/src/opnsense/mvc/app/models/OPNsense/PPTP/Menu/Menu.xml delete mode 100644 net/pptp/src/www/diag_logs_template_pptp.inc delete mode 100644 net/pptp/src/www/vpn_pptp.php delete mode 100644 net/pptp/src/www/vpn_pptp_log.inc delete mode 100644 net/pptp/src/www/vpn_pptp_log.php delete mode 100644 net/pptp/src/www/vpn_pptp_users.php delete mode 100644 net/pptp/src/www/vpn_pptp_users_edit.php diff --git a/LICENSE b/LICENSE index b88f03b560..069d562f93 100644 --- a/LICENSE +++ b/LICENSE @@ -18,10 +18,9 @@ Copyright (c) 2010 Jim Pingle Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça Copyright (c) 2019 Juergen Kellerer -Copyright (c) 2003-2006 Manuel Kasper +Copyright (c) 2003-2004 Manuel Kasper Copyright (c) 2020 Martin Wasley Copyright (c) 2017-2020 Michael Muenz -Copyright (c) 2020 Petr Kejval Copyright (c) 2004-2012 Scott Ullrich Copyright (c) 2010-2012 Seth Mos Copyright (c) 2008 Shrew Soft Inc. diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 815b7c4060..334c3b760a 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -58,7 +58,7 @@ _PLUGIN_PYTHON!=${PYTHONLINK} -V PLUGIN_PYTHON?= ${_PLUGIN_PYTHON:[2]:S/./ /g:[1..2]:tW:S/ //} .endif -PLUGIN_ABI?= 20.1 +PLUGIN_ABI?= 20.7 PLUGIN_PHP?= 72 PLUGIN_PYTHON?= 37 diff --git a/README.md b/README.md index 9ae4e6a7a7..b50db1add2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ dns/bind -- BIND domain name service dns/dnscrypt-proxy -- Flexible DNS proxy supporting DNSCrypt and DoH dns/dyndns -- Dynamic DNS Support dns/rfc2136 -- RFC-2136 Support -dns/unbound-plus -- Unbound additions mail/postfix -- SMTP mail relay mail/rspamd -- Protect your network from spam misc/theme-cicada -- The cicada theme - dark grey @@ -62,11 +61,8 @@ net/ftp-proxy -- Control ftp-proxy processes net/google-cloud-sdk -- Google Cloud SDK net/haproxy -- Reliable, high performance TCP/HTTP load balancer net/igmp-proxy -- IGMP-Proxy Service -net/l2tp -- End of life, no replacement net/mdns-repeater -- Proxy multicast DNS between networks net/ntopng -- Traffic Analysis and Flow Collection -net/pppoe -- End of life, no replacement -net/pptp -- End of life, no replacement net/relayd -- Relayd Load Balancer net/shadowsocks -- Secure socks5 proxy net/siproxd -- Siproxd is a proxy daemon for the SIP protocol diff --git a/dns/unbound-plus/Makefile b/dns/unbound-plus/Makefile deleted file mode 100644 index b12f8cf3db..0000000000 --- a/dns/unbound-plus/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -PLUGIN_NAME= unbound-plus -PLUGIN_VERSION= 1.1 -PLUGIN_REVISION= 1 -PLUGIN_COMMENT= Unbound additions -PLUGIN_MAINTAINER= m.muenz@gmail.com - -.include "../../Mk/plugins.mk" diff --git a/dns/unbound-plus/pkg-descr b/dns/unbound-plus/pkg-descr deleted file mode 100644 index 908838464a..0000000000 --- a/dns/unbound-plus/pkg-descr +++ /dev/null @@ -1,16 +0,0 @@ -Unbound-Plus is a collecion of additional features to Unbound, -including DNSBL and DNS-over-TLS support. - -WWW: https://github.com/opnsense/plugins/ - -Plugin Changelog ----------------- - -1.1 - -* Add DNS over TLS (DoT) support - -1.0 - -* Add DNSBL feature -* Allow to set private domains diff --git a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/DnsblController.php b/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/DnsblController.php deleted file mode 100644 index e729939f6c..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/DnsblController.php +++ /dev/null @@ -1,37 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -namespace OPNsense\Unboundplus\Api; - -use OPNsense\Base\ApiMutableModelControllerBase; - -class DnsblController extends ApiMutableModelControllerBase -{ - protected static $internalModelClass = '\OPNsense\Unboundplus\Dnsbl'; - protected static $internalModelName = 'dnsbl'; -} diff --git a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/MiscellaneousController.php b/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/MiscellaneousController.php deleted file mode 100644 index 5e98788200..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/MiscellaneousController.php +++ /dev/null @@ -1,37 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -namespace OPNsense\Unboundplus\Api; - -use OPNsense\Base\ApiMutableModelControllerBase; - -class MiscellaneousController extends ApiMutableModelControllerBase -{ - protected static $internalModelClass = '\OPNsense\Unboundplus\Miscellaneous'; - protected static $internalModelName = 'miscellaneous'; -} diff --git a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/ServiceController.php b/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/ServiceController.php deleted file mode 100644 index 66fa748579..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/Api/ServiceController.php +++ /dev/null @@ -1,62 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -namespace OPNsense\Unboundplus\Api; - -use OPNsense\Base\ApiMutableServiceControllerBase; -use OPNsense\Core\Backend; -use OPNsense\Unboundplus\Dnsbl; -use OPNsense\Unboundplus\Miscellaneous; - -class ServiceController extends ApiMutableServiceControllerBase -{ - protected static $internalServiceClass = '\OPNsense\Unboundplus\Dnsbl'; - protected static $internalServiceTemplate = 'OPNsense/Unboundplus'; - protected static $internalServiceEnabled = 'enabled'; - protected static $internalServiceName = 'unboundplus'; - - public function dnsblAction() - { - $this->sessionClose(); - $mdl = new Dnsbl(); - $backend = new Backend(); - $backend->configdRun('template reload OPNsense/Unboundplus'); - $response = $backend->configdpRun('unboundplus dnsbl', array((string)$mdl->type)); - return array("response" => $response); - } - - public function reloadunboundAction() - { - $this->sessionClose(); - $mdl = new Miscellaneous(); - $backend = new Backend(); - $backend->configdRun('template reload OPNsense/Unboundplus'); - $response = $backend->configdpRun('unbound reload', array((string)$mdl->type)); - return array("response" => $response); - } -} diff --git a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/DnsblController.php b/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/DnsblController.php deleted file mode 100644 index 882e2aae9a..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/DnsblController.php +++ /dev/null @@ -1,38 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -namespace OPNsense\Unboundplus; - -class DnsblController extends \OPNsense\Base\IndexController -{ - public function indexAction() - { - $this->view->dnsblForm = $this->getForm('dnsbl'); - $this->view->pick('OPNsense/Unboundplus/dnsbl'); - } -} diff --git a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/MiscellaneousController.php b/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/MiscellaneousController.php deleted file mode 100644 index 25bdb9e638..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/MiscellaneousController.php +++ /dev/null @@ -1,38 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -namespace OPNsense\Unboundplus; - -class MiscellaneousController extends \OPNsense\Base\IndexController -{ - public function indexAction() - { - $this->view->miscellaneousForm = $this->getForm('miscellaneous'); - $this->view->pick('OPNsense/Unboundplus/miscellaneous'); - } -} diff --git a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/forms/dnsbl.xml b/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/forms/dnsbl.xml deleted file mode 100644 index 6fd6fc6077..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/forms/dnsbl.xml +++ /dev/null @@ -1,30 +0,0 @@ -
    - - dnsbl.enabled - - checkbox - Enable the usage of DNS blocklists. - - - dnsbl.type - - select_multiple - Select which kind of DNSBL you want to use. - - - dnsbl.lists - - select_multiple - - true - List of domains from where blacklist will be downloaded. - - - dnsbl.whitelists - - select_multiple - - true - List of domains to whitelist. You can use regular expressions. - -
    diff --git a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/forms/miscellaneous.xml b/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/forms/miscellaneous.xml deleted file mode 100644 index 899ceb3901..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/controllers/OPNsense/Unboundplus/forms/miscellaneous.xml +++ /dev/null @@ -1,18 +0,0 @@ -
    - - miscellaneous.privatedomain - - select_multiple - - true - List of domains to mark as private. You only need this for some DNSBL lists which resolve to private addresses. - - - miscellaneous.dotservers - - select_multiple - - true - List of nameservers to use for DoT. Use syntax ip@port like 9.9.9.9@853 - -
    diff --git a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/ACL/ACL.xml b/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/ACL/ACL.xml deleted file mode 100644 index 181f635fd8..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/ACL/ACL.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - Services: Unbound DNSBL - - ui/unboundplus/* - api/unboundplus/* - - - diff --git a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Dnsbl.php b/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Dnsbl.php deleted file mode 100644 index b8bd973ef6..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Dnsbl.php +++ /dev/null @@ -1,35 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -namespace OPNsense\Unboundplus; - -use OPNsense\Base\BaseModel; - -class Dnsbl extends BaseModel -{ -} diff --git a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Dnsbl.xml b/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Dnsbl.xml deleted file mode 100644 index 5b537c08fd..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Dnsbl.xml +++ /dev/null @@ -1,47 +0,0 @@ - - //OPNsense/unboundplus/dnsbl - Unbound DNSBL configuration - 0.0.1 - - - 0 - Y - - - N - Y - - AdAway List - AdGuard List - Blocklist.site Ads - Blocklist.site Fraud - Blocklist.site Phishing - Cameleon List - Easy List - EMD Malicious Domains List - Easyprivacy List - hpHosts Ads - hpHosts FSA - hpHosts PSH - hpHosts PUP - Malwaredomain List - NoCoin List - PornTop1M List - Ransomware Tracker List - Simple Ad List - Simple Tracker List - Steven Black List - WindowsSpyBlocker (spy) - WindowsSpyBlocker (update) - WindowsSpyBlocker (extra) - YoYo List - - - - N - - - N - - - diff --git a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Menu/Menu.xml b/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Menu/Menu.xml deleted file mode 100644 index 32261d1a24..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Menu/Menu.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.php b/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.php deleted file mode 100644 index 9cc112378e..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.php +++ /dev/null @@ -1,35 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -namespace OPNsense\Unboundplus; - -use OPNsense\Base\BaseModel; - -class Miscellaneous extends BaseModel -{ -} diff --git a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml b/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml deleted file mode 100644 index 1ae1f590ae..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/models/OPNsense/Unboundplus/Miscellaneous.xml +++ /dev/null @@ -1,14 +0,0 @@ - - //OPNsense/unboundplus/miscellaneous - Unbound Miscellaneous configuration - 0.0.2 - - - N - - - N - /^[a-fA-F0-9\.\,\:\@]{1,512}$/ - - - diff --git a/dns/unbound-plus/src/opnsense/mvc/app/views/OPNsense/Unboundplus/dnsbl.volt b/dns/unbound-plus/src/opnsense/mvc/app/views/OPNsense/Unboundplus/dnsbl.volt deleted file mode 100644 index eb53cf0e64..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/views/OPNsense/Unboundplus/dnsbl.volt +++ /dev/null @@ -1,54 +0,0 @@ -{# - # Copyright (c) 2019 Deciso B.V. - # Copyright (c) 2019 Michael Muenz - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without modification, - # are permitted provided that the following conditions are met: - # - # 1. Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # - # 2. Redistributions in binary form must reproduce the above copyright notice, - # this list of conditions and the following disclaimer in the documentation - # and/or other materials provided with the distribution. - # - # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - # POSSIBILITY OF SUCH DAMAGE. - #} - -
    - {{ partial("layout_partials/base_form",['fields':dnsblForm,'id':'frm_dnsbl_settings'])}} -
    -
    - -
    -
    - - diff --git a/dns/unbound-plus/src/opnsense/mvc/app/views/OPNsense/Unboundplus/miscellaneous.volt b/dns/unbound-plus/src/opnsense/mvc/app/views/OPNsense/Unboundplus/miscellaneous.volt deleted file mode 100644 index dda6369f25..0000000000 --- a/dns/unbound-plus/src/opnsense/mvc/app/views/OPNsense/Unboundplus/miscellaneous.volt +++ /dev/null @@ -1,54 +0,0 @@ -{# - # Copyright (c) 2019 Deciso B.V. - # Copyright (c) 2019 Michael Muenz - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without modification, - # are permitted provided that the following conditions are met: - # - # 1. Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # - # 2. Redistributions in binary form must reproduce the above copyright notice, - # this list of conditions and the following disclaimer in the documentation - # and/or other materials provided with the distribution. - # - # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - # POSSIBILITY OF SUCH DAMAGE. - #} - -
    - {{ partial("layout_partials/base_form",['fields':miscellaneousForm,'id':'frm_miscellaneous_settings'])}} -
    -
    - -
    -
    - - diff --git a/dns/unbound-plus/src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py b/dns/unbound-plus/src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py deleted file mode 100755 index f933ad6877..0000000000 --- a/dns/unbound-plus/src/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/local/bin/python3 - -# DNS BL script -# Copyright (c) 2020 Petr Kejval - -# Downloads blacklisted domains from user specified URLs and "compile" them into unbound.conf compatible file - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -import re, urllib3, threading, subprocess - -re_blacklist = re.compile(r'(^127\.0\.0\.1[\s]+|^0\.0\.0\.0[\s]+)([0-9a-z_.-]+)(?:\s|$)|^([0-9a-z_.-]+)(?:\s|$)', re.I) -re_whitelist = re.compile(r'$^') # default - match nothing -blacklist = set() -urls = set() - -predefined_lists = { - "aa": "https://adaway.org/hosts.txt", - "ag": "https://justdomains.github.io/blocklists/lists/adguarddns-justdomains.txt", - "bla": "https://blocklist.site/app/dl/ads", - "blf": "https://blocklist.site/app/dl/fraud", - "blp": "https://blocklist.site/app/dl/phishing", - "ca": "http://sysctl.org/cameleon/hosts", - "el": "https://justdomains.github.io/blocklists/lists/easylist-justdomains.txt", - "ep": "https://justdomains.github.io/blocklists/lists/easyprivacy-justdomains.txt", - "emd": "https://hosts-file.net/emd.txt", - "hpa": "https://hosts-file.net/ad_servers.txt", - "hpf": "https://hosts-file.net/fsa.txt", - "hpp": "https://hosts-file.net/psh.txt", - "hup": "https://hosts-file.net/pup.txt", - "nc": "https://justdomains.github.io/blocklists/lists/nocoin-justdomains.txt", - "rw": "https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt", - "mw": "http://malwaredomains.lehigh.edu/files/justdomains", - "pa": "https://raw.githubusercontent.com/chadmayfield/my-pihole-blocklists/master/lists/pi_blocklist_porn_all.list", - "pt": "https://raw.githubusercontent.com/chadmayfield/pihole-blocklists/master/lists/pi_blocklist_porn_top1m.list", - "sa": "https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt", - "sb": "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts", - "st": "https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt", - "ws": "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt", - "wsu": "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update.txt", - "wse": "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt", - "yy": "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext" -} - -def add_to_blacklist(domain): - """ Checks if domain is present in whitelist. If not, domain is addded to BL set. """ - match = re_whitelist.match(domain) - if not match: - blacklist.add(domain) - -def parse_line(line): - """ Checks if line matches re_blacklist. If so, tries add domain to BL set. """ - global blacklist - line = line.replace('\\t', " ") - line = line.replace('\\r', "") - match = re_blacklist.match(line) - if match: - if match.group(2) != None: - add_to_blacklist(match.group(2)) - elif match.group(3) != None: - add_to_blacklist(match.group(3)) - -def process_url(url): - """ Reads and parses blacklisted domains from URL into BL set. """ - print(f"Processing BL items from: {url}") - - try: - http = urllib3.PoolManager(timeout=5.0) - r = http.request('GET', url, retries=2) - - if r.status == 200: - for line in str(r.data).split('\\n'): - parse_line(line) - except Exception as e: - print(str(e)) - -def save_config_file(): - """ Saves blacklist in unbound.conf format """ - print(f"Saving {len(blacklist)} blacklisted domains into dnsbl.conf") - - try: - with open("/var/unbound/etc/dnsbl.conf", 'w') as file: - # No domains found or DNSBL is disabled - if (len(blacklist) == 0): - file.write("") - else: - file.write('server:\n') - for line in blacklist: - #file.write('local-zone: "' + str(line) + '" static\n') - file.write('local-data: "' + str(line) + ' A 0.0.0.0"\n') - except Exception as e: - print(str(e)) - exit(1) - -def load_list(path, separator=None): - """ Reads file with specified path into set to ensure unique values. - Splits lines with defined separator. If sperator==None no split is performed. """ - result = set() - - try: - with open(path, 'r') as file: - for line in file.readlines(): - if not separator == None: - for element in line.split(separator): - result.add(element.replace('\n', '')) - else: - result.add(line.replace('\n', '')) - except Exception as e: - print(str(e)) - - return result - -def load_whitelist(): - """ Loads user defined whitelist in regex format and compiles it. """ - print("Loading whitelist") - global re_whitelist - wl = load_list('/var/unbound/etc/whitelist.inc', ',') - wl.add(r'.*localhost$') - wl.add(r'^(?![a-zA-Z\d]).*') # Exclude domains NOT starting with alphanumeric char - print(f"Loaded {len(wl)} whitelist items") - - try: - re_whitelist = re.compile('|'.join(wl), re.I) - except Exception as e: - print(f"Whitelist regex compile failed: {str(e)}") - -def load_blacklists(): - """ Loads user defined blacklists URLs. """ - print("Loading blacklists URLs") - global urls - urls = load_list('/var/unbound/etc/lists.inc', ',') - print(f"Loaded {len(urls)} blacklists URLs") - -def load_predefined_lists(): - """ Loads user chosen predefined lists """ - print("Loading predefined lists URLs") - global urls - lists = load_list('/var/unbound/etc/dnsbl.inc') - types = set() - - for first in lists: - first = str(first).split('=')[1] - first = str(first).replace('"', '').replace('\n', '') - first = first.split(',') - for type in first: - types.add(type) - break - - print(f"Loaded {len(types)} predefined blacklists URLs") - - for type in types: - try: - urls.add(predefined_lists[type]) - except KeyError: - continue - except Exception as e: - print(str(e)) - -if __name__ == "__main__": - # Prepare lists from config files - load_whitelist() - load_blacklists() - load_predefined_lists() - - # Start processing BLs in threads - threads = [threading.Thread(target=process_url, args=(url,)) for url in urls] - for t in threads: - t.start() - for t in threads: - t.join() - - save_config_file() - - print("Restarting unbound service") - subprocess.Popen(["pluginctl", "-s", "unbound", "restart"]) - exit(0) diff --git a/dns/unbound-plus/src/opnsense/service/conf/actions.d/actions_unboundplus.conf b/dns/unbound-plus/src/opnsense/service/conf/actions.d/actions_unboundplus.conf deleted file mode 100644 index e354a4e126..0000000000 --- a/dns/unbound-plus/src/opnsense/service/conf/actions.d/actions_unboundplus.conf +++ /dev/null @@ -1,6 +0,0 @@ -[dnsbl] -command:/usr/local/opnsense/scripts/OPNsense/Unboundplus/dnsbl.py -parameters: -type:script -message:fetching and applying DNSBLs -description: Download Unbound DNSBLs and restart diff --git a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/+TARGETS b/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/+TARGETS deleted file mode 100644 index 1166df58a0..0000000000 --- a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/+TARGETS +++ /dev/null @@ -1,5 +0,0 @@ -dnsbl.inc:/var/unbound/etc/dnsbl.inc -whitelist.inc:/var/unbound/etc/whitelist.inc -miscellaneous.conf:/var/unbound/etc/miscellaneous.conf -dot.conf:/var/unbound/etc/dot.conf -lists.inc:/var/unbound/etc/lists.inc diff --git a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dnsbl.inc b/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dnsbl.inc deleted file mode 100644 index a47edf32fe..0000000000 --- a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dnsbl.inc +++ /dev/null @@ -1,5 +0,0 @@ -{% if helpers.exists('OPNsense.unboundplus.dnsbl.enabled') and OPNsense.unboundplus.dnsbl.enabled == '1' %} -{% if helpers.exists('OPNsense.unboundplus.dnsbl.type') and OPNsense.unboundplus.dnsbl.type != '' %} -unbound_dnsbl="{{ OPNsense.unboundplus.dnsbl.type }}" -{% endif %} -{% endif %} diff --git a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dot.conf b/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dot.conf deleted file mode 100644 index 8837f8fd76..0000000000 --- a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/dot.conf +++ /dev/null @@ -1,10 +0,0 @@ -{% if helpers.exists('OPNsense.unboundplus.miscellaneous.dotservers') and OPNsense.unboundplus.miscellaneous.dotservers != '' %} -server: - tls-cert-bundle: /etc/ssl/cert.pem -forward-zone: - name: "." - forward-tls-upstream: yes -{% for dot in OPNsense.unboundplus.miscellaneous.dotservers.split(',') %} - forward-addr: {{ dot }} -{% endfor %} -{% endif %} diff --git a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/lists.inc b/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/lists.inc deleted file mode 100644 index 947a527616..0000000000 --- a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/lists.inc +++ /dev/null @@ -1,5 +0,0 @@ -{% if helpers.exists('OPNsense.unboundplus.dnsbl.enabled') and OPNsense.unboundplus.dnsbl.enabled == '1' %} -{% if helpers.exists('OPNsense.unboundplus.dnsbl.lists') and OPNsense.unboundplus.dnsbl.lists != '' %} -{{ OPNsense.unboundplus.dnsbl.lists|default("") }} -{% endif %} -{% endif %} diff --git a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/miscellaneous.conf b/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/miscellaneous.conf deleted file mode 100644 index 849bf8b100..0000000000 --- a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/miscellaneous.conf +++ /dev/null @@ -1,6 +0,0 @@ -{% if helpers.exists('OPNsense.unboundplus.miscellaneous.privatedomain') and OPNsense.unboundplus.miscellaneous.privatedomain != '' %} -server: -{% for privatedomain in OPNsense.unboundplus.miscellaneous.privatedomain.split(',') %} -private-domain: {{ privatedomain }} -{% endfor %} -{% endif %} diff --git a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/whitelist.inc b/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/whitelist.inc deleted file mode 100644 index 925e665f7e..0000000000 --- a/dns/unbound-plus/src/opnsense/service/templates/OPNsense/Unboundplus/whitelist.inc +++ /dev/null @@ -1,5 +0,0 @@ -{% if helpers.exists('OPNsense.unboundplus.dnsbl.enabled') and OPNsense.unboundplus.dnsbl.enabled == '1' %} -{% if helpers.exists('OPNsense.unboundplus.dnsbl.whitelists') and OPNsense.unboundplus.dnsbl.whitelists != '' %} -{{ OPNsense.unboundplus.dnsbl.whitelists|default("") }} -{% endif %} -{% endif %} diff --git a/net/l2tp/Makefile b/net/l2tp/Makefile deleted file mode 100644 index 4a7c54423a..0000000000 --- a/net/l2tp/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -PLUGIN_NAME= l2tp -PLUGIN_VERSION= 1.9 -PLUGIN_DEPENDS= clog mpd5 -PLUGIN_COMMENT= End of life, no replacement -PLUGIN_MAINTAINER= franco@opnsense.org - -.include "../../Mk/plugins.mk" diff --git a/net/l2tp/pkg-descr b/net/l2tp/pkg-descr deleted file mode 100644 index adda8e3aa3..0000000000 --- a/net/l2tp/pkg-descr +++ /dev/null @@ -1,16 +0,0 @@ -Mpd is a netgraph(4) based implementation of the multi-link PPP -protocol for FreeBSD. It is designed to be both fast and flexible. -It handles configuration and negotiation in user land, while routing -all data packets strictly in the kernel. It supports several of -the numerous PPP sub-protocols and extensions, such as: - - Multi-link PPP capability - PAP, CHAP, MS-CHAP and EAP authentication - PPP compression and encryption - IPCP and IPV6CP parameter negotiation - -This plugin has support for the following link type: - - Layer Two Tunnelling Protocol (L2TP) - -WWW: http://www.sourceforge.net/projects/mpd diff --git a/net/l2tp/src/etc/inc/plugins.inc.d/if_l2tp.inc b/net/l2tp/src/etc/inc/plugins.inc.d/if_l2tp.inc deleted file mode 100644 index 66848b2f32..0000000000 --- a/net/l2tp/src/etc/inc/plugins.inc.d/if_l2tp.inc +++ /dev/null @@ -1,279 +0,0 @@ - - * Copyright (C) 2008 Shrew Soft Inc. - * Copyright (C) 2008 Ermal Luçi - * Copyright (C) 2004 Scott Ullrich - * Copyright (C) 2003-2004 Manuel Kasper - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -function if_l2tp_configure() -{ - return array('bootup' => array('if_l2tp_configure_do')); -} - -function if_l2tp_services() -{ - global $config; - - $services = array(); - - if (isset($config['l2tp']['mode']) && $config['l2tp']['mode'] == 'server') { - $services[] = array( - 'description' => gettext('L2TP Server'), - 'pidfile' => '/var/run/l2tp-vpn.pid', - 'php' => array( - 'restart' => array('if_l2tp_configure_do'), - 'start' => array('if_l2tp_configure_do'), - ), - 'name' => 'l2tpd', - ); - } - - return $services; -} - -/** - * request syslog facilities for this plugin - * @return array - */ -function if_l2tp_syslog() -{ - $logfacilities = array(); - - $logfacilities['l2tps'] = array( - 'facility' => array('l2tps'), - 'remote' => 'vpn', - ); - - return $logfacilities; -} - -function if_l2tp_link_scripts($rootdir, $logtype = 'l2tp') -{ - $up = <<<'EOD' -#!/bin/sh - -/usr/bin/logger -p local3.info "login,%s,$4,$5" -/sbin/ifconfig $1 group l2tp - -EOD; - $down = <<<'EOD' -#!/bin/sh - -/usr/bin/logger -p local3.info "logout,%s,$4,$5" - -/sbin/pfctl -i $1 -Fs -/sbin/pfctl -K $4/32 - -EOD; - - file_put_contents($rootdir . '/linkup', sprintf($up, $logtype)); - file_put_contents($rootdir . '/linkdown', sprintf($down, $logtype)); - - chmod($rootdir . '/linkup', 0755); - chmod($rootdir . '/linkdown', 0755); -} - -function if_l2tp_configure_do() -{ - global $config; - - killbypid('/var/run/l2tp-vpn.pid', 'TERM', true); - mwexec('rm -rf /var/etc/l2tp-vpn'); - - $syscfg = $config['system']; - if (isset($config['l2tp'])) { - $l2tpcfg = $config['l2tp']; - } else { - return 0; - } - - if (!isset($l2tpcfg['mode']) || $l2tpcfg['mode'] != 'server') { - return 0; - } - - if (file_exists('/var/run/booting')) { - echo gettext('Configuring L2TP VPN service...'); - } - - switch ($l2tpcfg['mode']) { - case 'server': - @mkdir('/var/etc/l2tp-vpn'); - if_l2tp_link_scripts('/var/etc/l2tp-vpn'); - - $fd = fopen("/var/etc/l2tp-vpn/mpd.conf", "w"); - if (!$fd) { - printf(gettext("Error: cannot open mpd.conf in if_l2tp_configure().") . "\n"); - return 1; - } - - $selfip = get_interface_ip($l2tpcfg['interface']); - - $iprange = $l2tpcfg['remoteip'] . ' '; - $iprange .= long2ip32(ip2long($l2tpcfg['remoteip']) + $l2tpcfg['n_l2tp_units'] - 1); - - $iptype = "ippool pool1"; - if (isset($l2tpcfg['radius']['enable']) && isset($l2tpcfg['radius']['radiusissueips'])) { - $iptype = "0.0.0.0/0"; - } - - $mpdconf = << true); - $oic['virtual'] = true; - $oic['networks'] = array(); - $oic['if'] = 'l2tp'; - $oic['descr'] = 'L2TP'; - $oic['type'] = 'group'; - $mask = !empty($config['l2tp']['l2tp_subnet']) ? $config['l2tp']['l2tp_subnet'] : 32; - $oic['networks'][] = array("network" => gen_subnet($config['l2tp']['remoteip'], $mask), "mask" => $mask); - $interfaces['l2tp'] = $oic; - } - - return $interfaces; -} diff --git a/net/l2tp/src/opnsense/mvc/app/models/OPNsense/L2TP/ACL/ACL.xml b/net/l2tp/src/opnsense/mvc/app/models/OPNsense/L2TP/ACL/ACL.xml deleted file mode 100644 index 24ea3d3e1a..0000000000 --- a/net/l2tp/src/opnsense/mvc/app/models/OPNsense/L2TP/ACL/ACL.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - Diagnostics: Logs: L2TP - - vpn_l2tp_log.php* - - - - VPN: L2TP - - vpn_l2tp.php* - - - - VPN: L2TP: Users: Edit - - vpn_l2tp_users_edit.php* - - - - VPN: L2TP: Users - - vpn_l2tp_users.php* - - - diff --git a/net/l2tp/src/opnsense/mvc/app/models/OPNsense/L2TP/Menu/Menu.xml b/net/l2tp/src/opnsense/mvc/app/models/OPNsense/L2TP/Menu/Menu.xml deleted file mode 100644 index 5a548e1a10..0000000000 --- a/net/l2tp/src/opnsense/mvc/app/models/OPNsense/L2TP/Menu/Menu.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/net/l2tp/src/www/diag_logs_template_l2tp.inc b/net/l2tp/src/www/diag_logs_template_l2tp.inc deleted file mode 100644 index 993181556e..0000000000 --- a/net/l2tp/src/www/diag_logs_template_l2tp.inc +++ /dev/null @@ -1,117 +0,0 @@ - - * Copyright (C) 2004-2009 Scott Ullrich - * Copyright (C) 2003-2004 Manuel Kasper - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("interfaces.inc"); - -/* expects $logfile to point to the system path */ -/* expects $logclog to be true or false */ - -require_once 'diag_logs_common.inc'; - -$filtertext = ''; -$nentries = 50; - -if (isset($config['syslog']['nentries'])) { - $nentries = $config['syslog']['nentries']; -} - -if (!empty($_POST['clear'])) { - if ($logclog) { - system_clear_clog($logfile); - } else { - system_clear_log($logfile); - } -} - -if (isset($_POST['filtertext'])) { - $filtertext = $_POST['filtertext']; -} - -include("head.inc"); -?> - - - -
    -
    -
    -
    -

    -

    -
    -
    - -
    -
    -

    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    - diff --git a/net/l2tp/src/www/vpn_l2tp.php b/net/l2tp/src/www/vpn_l2tp.php deleted file mode 100644 index 7ebe7351c1..0000000000 --- a/net/l2tp/src/www/vpn_l2tp.php +++ /dev/null @@ -1,345 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("interfaces.inc"); -require_once("system.inc"); -require_once("plugins.inc.d/if_l2tp.inc"); - -$l2tpcfg = &config_read_array('l2tp'); -config_read_array('l2tp', 'radius'); - -if ($_SERVER['REQUEST_METHOD'] === 'GET') { - $pconfig['remoteip'] = $l2tpcfg['remoteip']; - $pconfig['localip'] = $l2tpcfg['localip']; - $pconfig['mode'] = $l2tpcfg['mode']; - $pconfig['interface'] = $l2tpcfg['interface']; - $pconfig['l2tp_dns1'] = $l2tpcfg['dns1']; - $pconfig['l2tp_dns2'] = $l2tpcfg['dns2']; - $pconfig['wins'] = $l2tpcfg['wins']; - $pconfig['radiusenable'] = isset($l2tpcfg['radius']['enable']); - $pconfig['radacct_enable'] = isset($l2tpcfg['radius']['accounting']); - $pconfig['radiusserver'] = $l2tpcfg['radius']['server']; - $pconfig['radiussecret'] = $l2tpcfg['radius']['secret']; - $pconfig['radiusissueips'] = isset($l2tpcfg['radius']['radiusissueips']); - $pconfig['n_l2tp_units'] = $l2tpcfg['n_l2tp_units']; - $pconfig['paporchap'] = $l2tpcfg['paporchap']; - $pconfig['secret'] = $l2tpcfg['secret']; -} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - $pconfig = $_POST; - - /* input validation */ - if ($_POST['mode'] == "server") { - $reqdfields = explode(" ", "localip remoteip"); - $reqdfieldsn = array(gettext("Server address"),gettext("Remote start address")); - - if ($_POST['radiusenable']) { - $reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret")); - $reqdfieldsn = array_merge( - $reqdfieldsn, - array(gettext("RADIUS server address"),gettext("RADIUS shared secret")) - ); - } - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - - if ($_POST['localip'] && !is_ipaddr($_POST['localip'])) { - $input_errors[] = gettext("A valid server address must be specified."); - } - if ($_POST['localip'] && !is_ipaddr($_POST['remoteip'])) { - $input_errors[] = gettext("A valid remote start address must be specified."); - } - if ($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver'])) { - $input_errors[] = gettext("A valid RADIUS server address must be specified."); - } - - if (!$input_errors) { - $subnet_start = ip2ulong($_POST['remoteip']); - $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1; - - if ((ip2ulong($_POST['localip']) >= $subnet_start) && - (ip2ulong($_POST['localip']) <= $subnet_end)) { - $input_errors[] = gettext("The specified server address lies in the remote subnet."); - } - } - } - - if (!$input_errors) { - $l2tpcfg['remoteip'] = $_POST['remoteip']; - $l2tpcfg['localip'] = $_POST['localip']; - $l2tpcfg['mode'] = $_POST['mode']; - $l2tpcfg['interface'] = $_POST['interface']; - $l2tpcfg['n_l2tp_units'] = $_POST['n_l2tp_units']; - - $l2tpcfg['radius']['server'] = $_POST['radiusserver']; - $l2tpcfg['radius']['secret'] = $_POST['radiussecret']; - $l2tpcfg['secret'] = $_POST['secret']; - - if ($_POST['wins']) { - $l2tpcfg['wins'] = $_POST['wins']; - } else { - unset($l2tpcfg['wins']); - } - - $l2tpcfg['paporchap'] = $_POST['paporchap']; - - - if ($_POST['l2tp_dns1'] == "") { - if (isset($l2tpcfg['dns1'])) { - unset($l2tpcfg['dns1']); - } - } else { - $l2tpcfg['dns1'] = $_POST['l2tp_dns1']; - } - - if ($_POST['l2tp_dns2'] == "") { - if (isset($l2tpcfg['dns2'])) { - unset($l2tpcfg['dns2']); - } - } else { - $l2tpcfg['dns2'] = $_POST['l2tp_dns2']; - } - - if ($_POST['radiusenable'] == "yes") { - $l2tpcfg['radius']['enable'] = true; - } else { - unset($l2tpcfg['radius']['enable']); - } - - if ($_POST['radacct_enable'] == "yes") { - $l2tpcfg['radius']['accounting'] = true; - } else { - unset($l2tpcfg['radius']['accounting']); - } - - if ($_POST['radiusissueips'] == "yes") { - $l2tpcfg['radius']['radiusissueips'] = true; - } else { - unset($l2tpcfg['radius']['radiusissueips']); - } - - write_config(); - if_l2tp_configure_do(); - header(url_safe('Location: /vpn_l2tp.php')); - exit; - } -} - -$service_hook = 'l2tpd'; -legacy_html_escape_form_data($pconfig); -include("head.inc"); - -?> - - -
    -
    -
    - 0) { - print_input_errors($input_errors); - } - if (isset($savemsg)) { - print_info_box($savemsg); - } - ?> -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - /> - -   - /> -
    - -
    - - -
    - - -
    - -
    - - -
    - - -
    -
    - - -
    - -
    - /> -
    - - /> -
    - -
    - - -
    - - -
    - > - -
    - " /> -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("interfaces.inc"); - -if (empty($config['syslog']['nentries'])) { - $nentries = 50; -} else { - $nentries = $config['syslog']['nentries']; -} - -if ($_POST['clear']) { - system_clear_clog($logfile); -} - -function dump_clog_vpn($file, $tail, $type) -{ - global $config; - - $sort = isset($config['syslog']['reverse']) ? '-r' : ''; - $logarr = array(); - - exec("/usr/local/sbin/clog " . escapeshellarg($file) . " | tail {$sort} -n " . escapeshellarg($tail), $logarr); - - foreach ($logarr as $logent) { - $logent = preg_split('/\s+/', $logent, 6); - $llent = explode(',', $logent[5]); - - if ($llent[1] !== $type) { - continue; - } - - echo "\n"; - echo "" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "\n"; - - if ($llent[0] == "login") { - echo "\n"; - } else { - echo "\n"; - } - - echo "" . htmlspecialchars($llent[3]) . "\n"; - echo "" . htmlspecialchars($llent[2]) . " \n"; - echo "\n"; - } -} - -include("head.inc"); -?> - - - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - diff --git a/net/l2tp/src/www/vpn_l2tp_log.php b/net/l2tp/src/www/vpn_l2tp_log.php deleted file mode 100644 index da534b536e..0000000000 --- a/net/l2tp/src/www/vpn_l2tp_log.php +++ /dev/null @@ -1,26 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("plugins.inc.d/if_l2tp.inc"); - -$a_secret = &config_read_array('l2tp', 'user'); - -if ($_SERVER['REQUEST_METHOD'] === 'POST') { - // delete entry - if (isset($_POST['act']) && $_POST['act'] == "del" && isset($_POST['id'])) { - if (!empty($a_secret[$_POST['id']])) { - unset($a_secret[$_POST['id']]); - write_config(); - } - exit; - } elseif (!empty($_POST['apply'])) { - if_l2tp_configure_do(); - clear_subsystem_dirty('l2tpusers'); - header(url_safe('Location: /vpn_l2tp_users.php')); - exit; - } -} - -$service_hook = 'l2tpd'; - -include("head.inc"); -$main_buttons = array( - array('label' => gettext('Add'), 'href' => 'vpn_l2tp_users_edit.php'), -); - -?> - - - -
    -
    -
    -
    - " . gettext("You must apply the changes in order for them to take effect") . ".
    " . gettext("Warning: this will terminate all current l2tp sessions!") . "");?> - -
    -
    -
    -
    - - - - - - - - - - - - - -
    - -   - - - -
    -
    -
    -
    -
    -
    -
    -
    - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -function l2tpusercmp($a, $b) -{ - return strcasecmp($a['name'], $b['name']); -} - -function l2tp_users_sort() -{ - global $config; - - if (!is_array($config['l2tp']['user'])) { - return; - } - - usort($config['l2tp']['user'], "l2tpusercmp"); -} - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("plugins.inc.d/if_l2tp.inc"); - -$a_secret = &config_read_array('l2tp', 'user'); - -if ($_SERVER['REQUEST_METHOD'] === 'GET') { - if (isset($_GET['id']) && !empty($a_secret[$_GET['id']])) { - $id = $_GET['id']; - } - if (isset($id)) { - $pconfig['usernamefld'] = $a_secret[$id]['name']; - $pconfig['ip'] = $a_secret[$id]['ip']; - } else { - $pconfig['usernamefld'] = null; - $pconfig['ip'] = null; - } -} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - if (isset($_POST['id']) && !empty($a_secret[$_POST['id']])) { - $id = $_POST['id']; - } - unset($input_errors); - $pconfig = $_POST; - - /* input validation */ - if (isset($id) && ($a_secret[$id])) { - $reqdfields = explode(" ", "usernamefld"); - $reqdfieldsn = array(gettext("Username")); - } else { - $reqdfields = explode(" ", "usernamefld passwordfld"); - $reqdfieldsn = array(gettext("Username"),gettext("Password")); - } - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - - if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['usernamefld'])) { - $input_errors[] = gettext("The username contains invalid characters."); - } - - if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['passwordfld'])) { - $input_errors[] = gettext("The password contains invalid characters."); - } - - if (($_POST['passwordfld']) && ($_POST['passwordfld'] != $_POST['password2'])) { - $input_errors[] = gettext("The passwords do not match."); - } - if (($_POST['ip'] && !is_ipaddr($_POST['ip']))) { - $input_errors[] = gettext("The IP address entered is not valid."); - } - - if (!$input_errors && !(isset($id) && $a_secret[$id])) { - /* make sure there are no dupes */ - foreach ($a_secret as $secretent) { - if ($secretent['name'] == $_POST['usernamefld']) { - $input_errors[] = gettext("Another entry with the same username already exists."); - break; - } - } - } - - if (!$input_errors) { - if (isset($id) && $a_secret[$id]) { - $secretent = $a_secret[$id]; - } - - $secretent['name'] = $_POST['usernamefld']; - $secretent['ip'] = $_POST['ip']; - - if ($_POST['passwordfld']) { - $secretent['password'] = $_POST['passwordfld']; - } - - if (isset($id) && $a_secret[$id]) { - $a_secret[$id] = $secretent; - } else { - $a_secret[] = $secretent; - } - - l2tp_users_sort(); - write_config(); - if_l2tp_configure_do(); - header(url_safe('Location: /vpn_l2tp_users.php')); - exit; - } -} - -$service_hook = 'l2tpd'; -legacy_html_escape_form_data($pconfig); -include("head.inc"); - -?> - - - -
    -
    -
    - - 0) { - print_input_errors($input_errors); - } ?> -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - -
    -
    - -  () -
    -
    - -
    - - -
      - - " onclick="window.location.href=''" /> - - - -
    -
    -
    -
    -
    -
    -
    -
    - - * Copyright (C) 2008 Shrew Soft Inc. - * Copyright (C) 2008 Ermal Luçi - * Copyright (C) 2004 Scott Ullrich - * Copyright (C) 2003-2004 Manuel Kasper - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -function if_pppoe_configure() -{ - return array('bootup' => array('if_pppoe_configure_do')); -} - -function if_pppoe_services() -{ - global $config; - - $services = array(); - - if (isset($config['pppoes']['pppoe'])) { - foreach ($config['pppoes']['pppoe'] as $pppoecfg) { - if (isset($pppoecfg['mode']) && $pppoecfg['mode'] == 'server') { - $services[] = array( - /* XXX clean up name printing */ - 'description' => gettext('PPPoE Server') . ': ' . htmlspecialchars($pppoecfg['descr']), - 'php' => array( - 'restart' => array('if_pppoe_configure_by_id'), - 'start' => array('if_pppoe_configure_by_id'), - 'args' => array('id'), - ), - 'pidfile' => "/var/run/pppoe{$pppoecfg['pppoeid']}-vpn.pid", - 'id' => $pppoecfg['pppoeid'], - 'name' => 'pppoed', - ); - } - } - } - - return $services; -} - -/** - * request syslog facilities for this plugin - * @return array - */ -function if_pppoe_syslog() -{ - $logfacilities = array(); - - $logfacilities['poes'] = array( - 'facility' => array('poes'), - 'remote' => 'vpn', - ); - - return $logfacilities; -} - -function if_pppoe_link_scripts($rootdir, $logtype = 'poes') -{ - $up = <<<'EOD' -#!/bin/sh - -/usr/bin/logger -p local3.info "login,%s,$4,$5" -/sbin/ifconfig $1 group pppoe - -EOD; - $down = <<<'EOD' -#!/bin/sh - -/usr/bin/logger -p local3.info "logout,%s,$4,$5" - -/sbin/pfctl -i $1 -Fs -/sbin/pfctl -K $4/32 - -EOD; - - file_put_contents($rootdir . '/linkup', sprintf($up, $logtype)); - file_put_contents($rootdir . '/linkdown', sprintf($down, $logtype)); - - chmod($rootdir . '/linkup', 0755); - chmod($rootdir . '/linkdown', 0755); -} - -function if_pppoe_configure_do() -{ - global $config; - - if (isset($config['pppoes']['pppoe'])) { - foreach ($config['pppoes']['pppoe'] as $pppoe) { - if_pppoe_configure_single($pppoe); - } - } -} - -function if_pppoe_configure_by_id($id) -{ - global $config; - - $found = null; - - if (isset($config['pppoes']['pppoe'])) { - foreach ($config['pppoes']['pppoe'] as $pppoe) { - if ($id != 0 && $id == $pppoe['pppoeid']) { - $found = $pppoe; - break; - } - } - } - - if ($found == null) { - return; - } - - if_pppoe_configure_single($found); -} - -function if_pppoe_configure_single(&$pppoecfg) -{ - global $config; - - $syscfg = $config['system']; - - killbypid("/var/run/pppoe{$pppoecfg['pppoeid']}-vpn.pid", 'TERM', true); - mwexec("rm -rf /var/etc/pppoe{$pppoecfg['pppoeid']}-vpn"); - - if (!isset($pppoecfg['mode']) || $pppoecfg['mode'] != 'server') { - return 0; - } - - if (file_exists('/var/run/booting')) { - echo gettext("Configuring PPPoE VPN service..."); - } - - switch ($pppoecfg['mode']) { - case 'server': - @mkdir("/var/etc/pppoe{$pppoecfg['pppoeid']}-vpn"); - if_pppoe_link_scripts("/var/etc/pppoe{$pppoecfg['pppoeid']}-vpn"); - - $pppoe_interface = get_real_interface($pppoecfg['interface']); - - $fd = fopen("/var/etc/pppoe{$pppoecfg['pppoeid']}-vpn/mpd.conf", "w"); - if (!$fd) { - printf(gettext("Error: cannot open mpd.conf in if_pppoe_configure().") . "\n"); - return 1; - } - - $iprange = $pppoecfg['remoteip'] . ' '; - $iprange .= long2ip32(ip2long($pppoecfg['remoteip']) + $pppoecfg['n_pppoe_units'] - 1); - - $iptype = 'ippool pool1'; - if (isset($pppoecfg['radius']['server']['enable']) && isset($pppoecfg['radius']['radiusissueips'])) { - $iptype = '0.0.0.0/0'; - } - - $mpdconf = << array()); - foreach ($config['pppoes']['pppoe'] as $pppoe) { - if ($pppoe['mode'] == "server") { - $mask = !empty($pppoe['pppoe_subnet']) ? $pppoe['pppoe_subnet'] : 32; - $pppoeifs['networks'][] = array("network" => gen_subnet($pppoe['remoteip'], $mask), "mask" => $mask); - } - } - if (count($pppoeifs['networks'])) { - $pppoeifs['enable'] = true; - $pppoeifs['virtual'] = true; - $pppoeifs['if'] = 'pppoe'; - $pppoeifs['descr'] = 'pppoe'; - $pppoeifs['type'] = 'group'; - $interfaces['pppoe'] = $pppoeifs; - } - } - - return $interfaces; -} diff --git a/net/pppoe/src/opnsense/mvc/app/models/OPNsense/PPPoE/ACL/ACL.xml b/net/pppoe/src/opnsense/mvc/app/models/OPNsense/PPPoE/ACL/ACL.xml deleted file mode 100644 index 782e5c9d81..0000000000 --- a/net/pppoe/src/opnsense/mvc/app/models/OPNsense/PPPoE/ACL/ACL.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - Diagnostics: Logs: PPPoE - - vpn_pppoe_log.php* - - - - Services: PPPoE Server - - vpn_pppoe.php* - - - - Services: PPPoE Server: Edit - - vpn_pppoe_edit.php* - - - diff --git a/net/pppoe/src/opnsense/mvc/app/models/OPNsense/PPPoE/Menu/Menu.xml b/net/pppoe/src/opnsense/mvc/app/models/OPNsense/PPPoE/Menu/Menu.xml deleted file mode 100644 index e4f037a79d..0000000000 --- a/net/pppoe/src/opnsense/mvc/app/models/OPNsense/PPPoE/Menu/Menu.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/net/pppoe/src/www/diag_logs_template_pppoe.inc b/net/pppoe/src/www/diag_logs_template_pppoe.inc deleted file mode 100644 index 993181556e..0000000000 --- a/net/pppoe/src/www/diag_logs_template_pppoe.inc +++ /dev/null @@ -1,117 +0,0 @@ - - * Copyright (C) 2004-2009 Scott Ullrich - * Copyright (C) 2003-2004 Manuel Kasper - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("interfaces.inc"); - -/* expects $logfile to point to the system path */ -/* expects $logclog to be true or false */ - -require_once 'diag_logs_common.inc'; - -$filtertext = ''; -$nentries = 50; - -if (isset($config['syslog']['nentries'])) { - $nentries = $config['syslog']['nentries']; -} - -if (!empty($_POST['clear'])) { - if ($logclog) { - system_clear_clog($logfile); - } else { - system_clear_log($logfile); - } -} - -if (isset($_POST['filtertext'])) { - $filtertext = $_POST['filtertext']; -} - -include("head.inc"); -?> - - - -
    -
    -
    -
    -

    -

    -
    -
    - -
    -
    -

    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    - diff --git a/net/pppoe/src/www/vpn_pppoe.php b/net/pppoe/src/www/vpn_pppoe.php deleted file mode 100644 index b6b0d2dfb3..0000000000 --- a/net/pppoe/src/www/vpn_pppoe.php +++ /dev/null @@ -1,153 +0,0 @@ - gettext('Add'), 'href' => 'vpn_pppoe_edit.php'), -); - -?> - - - - -
    -
    -
    -
    - " . gettext("You must apply the changes in order for them to take effect."));?> - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - -
    - " class="btn btn-default btn-xs"> - - - -
    -
    -
    -
    -
    -
    -
    -
    - - Copyright (C) 2010 Ermal Luçi - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -require_once("guiconfig.inc"); -require_once("interfaces.inc"); - -function vpn_pppoe_get_id() -{ - global $config; - - $vpnid = 1; - - if (isset($config['pppoes']['pppoe'])) { - foreach ($config['pppoes']['pppoe'] as $pppoe) { - if ($vpnid == $pppoe['pppoeid']) { - $vpnid++; - } else { - return $vpnid; - } - } - } - - return $vpnid; -} - -$a_pppoes = &config_read_array('pppoes', 'pppoe'); - -$copy_fields = array('remoteip', 'localip', 'mode', 'interface', 'n_pppoe_units', 'pppoe_subnet', 'dns1', 'dns2', 'descr', 'pppoeid'); - -if ($_SERVER['REQUEST_METHOD'] === 'GET') { - if (isset($_GET['id']) && !empty($a_pppoes[$_GET['id']])) { - $id = $_GET['id']; - } - $pconfig = array(); - foreach ($copy_fields as $fieldname) { - if (isset($id) && !empty($a_pppoes[$id][$fieldname])) { - $pconfig[$fieldname] = $a_pppoes[$id][$fieldname]; - } else { - $pconfig[$fieldname] = null; - } - } - // split username / password - $pconfig['users_username'] = array(); - $pconfig['users_password'] = array(); - $pconfig['users_ip'] = array(); - if (isset($id) && !empty($a_pppoes[$id]['username'])) { - foreach (explode(' ', $a_pppoes[$id]['username']) as $userinfo) { - $parts = explode(':', $userinfo); - $pconfig['users_username'][] = $parts[0]; - $pconfig['users_password'][] = base64_decode($parts[1]); - $pconfig['users_ip'][] = !empty($parts[2]) ? $parts[2] : ""; - } - } - - // radius properties - $pconfig['radacct_enable'] = isset($id) && isset($a_pppoes[$id]['radius']['accounting']); - $pconfig['radiusissueips'] = isset($id) && isset($a_pppoes[$id]['radius']['radiusissueips']); - $pconfig['radiusenable'] = isset($id) && isset($a_pppoes[$id]['radius']['server']['enable']); - $pconfig['radiusserver'] = isset($id) && isset($a_pppoes[$id]['radius']['server']['ip']) ? $a_pppoes[$id]['radius']['server']['ip'] : null; - $pconfig['radiusserverport'] = isset($id) && isset($a_pppoes[$id]['radius']['server']['port']) ? $a_pppoes[$id]['radius']['server']['port'] : null; - $pconfig['radiusserveracctport'] = isset($id) && isset($a_pppoes[$id]['radius']['server']['acctport']) ? $a_pppoes[$id]['radius']['server']['acctport'] : null; - $pconfig['radiussecret'] = isset($id) && isset($a_pppoes[$id]['radius']['server']['secret']) ? $a_pppoes[$id]['radius']['server']['secret'] : null; - $pconfig['radiussecenable'] = isset($id) && isset($a_pppoes[$id]['radius']['server2']['enable']); - $pconfig['radiusserver2'] = isset($id) && isset($a_pppoes[$id]['radius']['server2']['ip']) ? $a_pppoes[$id]['radius']['server2']['ip'] : null; - $pconfig['radiusserver2port'] = isset($id) && isset($a_pppoes[$id]['radius']['server2']['port']) ? $a_pppoes[$id]['radius']['server2']['port'] : null; - $pconfig['radiusserver2acctport'] = isset($id) && isset($a_pppoes[$id]['radius']['server2']['acctport']) ? $a_pppoes[$id]['radius']['server2']['acctport'] : null; - $pconfig['radiussecret2'] = isset($id) && isset($a_pppoes[$id]['radius']['server2']['secret2']) ? $a_pppoes[$id]['radius']['server2']['secret2'] : null; - $pconfig['radius_nasip'] = isset($id) && isset($a_pppoes[$id]['radius']['nasip']) ? $a_pppoes[$id]['radius']['nasip'] : null; - $pconfig['radius_acct_update'] = isset($id) && isset($a_pppoes[$id]['radius']['acct_update']) ? $a_pppoes[$id]['radius']['acct_update'] : null; - -} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - if (isset($_POST['id']) && !empty($a_pppoes[$_POST['id']])) { - $id = $_POST['id']; - } - $input_errors = array(); - $pconfig = $_POST; - - /* input validation */ - foreach ($pconfig['users_username'] as $item_idx => $usr) { - if (empty($pconfig['users_password'][$item_idx])) { - $input_errors[] = sprintf(gettext("No password specified for username %s"), $usr); - } - if ($pconfig['users_ip'][$item_idx] <> "" && !is_ipaddr($pconfig['users_ip'][$item_idx])) { - $input_errors[] = sprintf(gettext("Incorrect ip address specified for username %s"), $usr); - } - } - - if ($pconfig['mode'] == "server") { - $reqdfields = explode(" ", "localip remoteip"); - $reqdfieldsn = array(gettext("Server address"),gettext("Remote start address")); - - if (!empty($pconfig['radiusenable'])) { - $reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret")); - $reqdfieldsn = array_merge( - $reqdfieldsn, - array(gettext("RADIUS server address"),gettext("RADIUS shared secret")) - ); - } - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - - if (!empty($pconfig['localip']) && !is_ipaddr($pconfig['localip'])) { - $input_errors[] = gettext("A valid server address must be specified."); - } - if (!empty($pconfig['pppoe_subnet']) && !is_ipaddr($pconfig['remoteip'])) { - $input_errors[] = gettext("A valid remote start address must be specified."); - } - if (!empty($pconfig['radiusserver']) && !is_ipaddr($pconfig['radiusserver'])) { - $input_errors[] = gettext("A valid RADIUS server address must be specified."); - } - - $subnet_start = ip2ulong($pconfig['remoteip']); - $subnet_end = ip2ulong($pconfig['remoteip']) + $pconfig['pppoe_subnet'] - 1; - if ((ip2ulong($pconfig['localip']) >= $subnet_start) && - (ip2ulong($pconfig['localip']) <= $subnet_end)) { - $input_errors[] = gettext("The specified server address lies in the remote subnet."); - } - } - - if (!empty($pconfig['pppoeid']) && !is_numeric($_POST['pppoeid'])) { - $input_errors[] = gettext("Wrong data submitted"); - } - - if (count($input_errors) == 0) { - $pppoecfg = array(); - // convert user/pass/ip combination - $pconfig['username'] = array(); - foreach ($pconfig['users_username'] as $item_idx => $usr) { - $user_item = $usr . ":" . base64_encode($pconfig['users_password'][$item_idx]) ; - if (!empty($pconfig['users_ip'][$item_idx])) { - $user_item .= ":".$pconfig['users_ip'][$item_idx]; - } - $pconfig['username'][] = $user_item ; - } - if (count($pconfig['username']) > 0) { - $pppoecfg['username'] = implode(' ', $pconfig['username']); - } - - // copy simple fields - foreach ($copy_fields as $fieldname) { - if (isset($pconfig[$fieldname]) && $pconfig[$fieldname] != "") { - $pppoecfg[$fieldname] = $pconfig[$fieldname]; - } - } - - // radius settings (array) - if (!empty($pconfig['radiusserver']) || !empty($pconfig['radiusserver2'])) { - $pppoecfg['radius'] = array(); - $pppoecfg['radius']['server']['enable'] = !empty($pconfig['radiusenable']); - $pppoecfg['radius']['server2']['enable'] = !empty($pconfig['radiussecenable']); - $pppoecfg['radius']['accounting'] = !empty($pconfig['radacct_enable']); - $pppoecfg['radius']['radiusissueips'] = !empty($pconfig['radiusissueips']); - $pppoecfg['radius']['nasip'] = $pconfig['radius_nasip']; - $pppoecfg['radius']['acct_update'] = $pconfig['radius_acct_update']; - } - if (!empty($pconfig['radiusserver'])) { - $pppoecfg['radius']['server'] = array(); - $pppoecfg['radius']['server']['ip'] = $pconfig['radiusserver']; - $pppoecfg['radius']['server']['secret'] = $pconfig['radiussecret']; - $pppoecfg['radius']['server']['port'] = $pconfig['radiusserverport']; - $pppoecfg['radius']['server']['acctport'] = $pconfig['radiusserveracctport']; - } - if (!empty($pconfig['radiusserver2'])) { - $pppoecfg['radius']['server2'] = array(); - $pppoecfg['radius']['server2']['ip'] = $pconfig['radiusserver2']; - $pppoecfg['radius']['server2']['secret2'] = $pconfig['radiussecret2']; - $pppoecfg['radius']['server2']['port'] = $pconfig['radiusserver2port']; - $pppoecfg['radius']['server2']['acctport'] = $pconfig['radiusserver2acctport']; - } - - if (!isset($pconfig['pppoeid'])) { - $pppoecfg['pppoeid'] = vpn_pppoe_get_id(); - } - - if (file_exists('/tmp/.vpn_pppoe.apply')) { - $toapplylist = unserialize(file_get_contents('/tmp/.vpn_pppoe.apply')); - } else { - $toapplylist = array(); - } - - $toapplylist[] = $pppoecfg['pppoeid']; - if (!isset($id)) { - $a_pppoes[] = $pppoecfg; - } else { - $a_pppoes[$id] = $pppoecfg; - } - - write_config(); - mark_subsystem_dirty('vpnpppoe'); - file_put_contents('/tmp/.vpn_pppoe.apply', serialize($toapplylist)); - header(url_safe('Location: /vpn_pppoe.php')); - exit; - } -} - -include("head.inc"); -legacy_html_escape_form_data($pconfig); -?> - - - - - -
    -
    -
    - 0) { - print_input_errors($input_errors); - }?> -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - /> - -   - /> -
    - -
    - - -
    - - -
    - - -
    - - -
    - -
    - -
    - - -
    - /> -
    - - /> -
    - - /> -
    - -
    - - -
    - - -
    - /> - -
    - - - - - - - - - - - - - - - -
    - -
    - - -
    - - - - - - - - - - - - - - - -
    - -
    - - -
    - - - - - - - - - - - $user):?> - - - - - - - - - - - - - -
    -
    -
    - - - - - -
    -
    -
    -
      -"; - } - if (!empty($pconfig['pppoeid'])) { - echo ""; - } - ?> - " /> - " /> -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("interfaces.inc"); - -if (empty($config['syslog']['nentries'])) { - $nentries = 50; -} else { - $nentries = $config['syslog']['nentries']; -} - -if ($_POST['clear']) { - system_clear_clog($logfile); -} - -function dump_clog_vpn($file, $tail, $type) -{ - global $config; - - $sort = isset($config['syslog']['reverse']) ? '-r' : ''; - $logarr = array(); - - exec("/usr/local/sbin/clog " . escapeshellarg($file) . " | tail {$sort} -n " . escapeshellarg($tail), $logarr); - - foreach ($logarr as $logent) { - $logent = preg_split('/\s+/', $logent, 6); - $llent = explode(',', $logent[5]); - - if ($llent[1] !== $type) { - continue; - } - - echo "\n"; - echo "" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "\n"; - - if ($llent[0] == "login") { - echo "\n"; - } else { - echo "\n"; - } - - echo "" . htmlspecialchars($llent[3]) . "\n"; - echo "" . htmlspecialchars($llent[2]) . " \n"; - echo "\n"; - } -} - -include("head.inc"); -?> - - - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - diff --git a/net/pppoe/src/www/vpn_pppoe_log.php b/net/pppoe/src/www/vpn_pppoe_log.php deleted file mode 100644 index 65a52c8524..0000000000 --- a/net/pppoe/src/www/vpn_pppoe_log.php +++ /dev/null @@ -1,24 +0,0 @@ - - * Copyright (C) 2008 Shrew Soft Inc. - * Copyright (C) 2008 Ermal Luçi - * Copyright (C) 2004 Scott Ullrich - * Copyright (C) 2003-2004 Manuel Kasper - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -function if_pptp_configure() -{ - return array('bootup' => array('if_pptp_configure_do')); -} - -function if_pptp_services() -{ - global $config; - - $services = array(); - - if (isset($config['pptpd']['mode']) && $config['pptpd']['mode'] == 'server') { - $services[] = array( - 'description' => gettext('PPTP Server'), - 'pidfile' => '/var/run/pptp-vpn.pid', - 'php' => array( - 'restart' => array('if_pptp_configure_do'), - 'start' => array('if_pptp_configure_do'), - ), - 'name' => 'pptpd', - ); - } - - return $services; -} - -/** - * request syslog facilities for this plugin - * @return array - */ -function if_pptp_syslog() -{ - $logfacilities = array(); - - $logfacilities['pptps'] = array( - 'facility' => array('pptps'), - 'remote' => 'vpn', - ); - - return $logfacilities; -} - -function if_pptp_link_scripts($rootdir, $logtype = 'pptp') -{ - $up = <<<'EOD' -#!/bin/sh - -/usr/bin/logger -p local3.info "login,%s,$4,$5" -/sbin/ifconfig $1 group pptp - -EOD; - $down = <<<'EOD' -#!/bin/sh - -/usr/bin/logger -p local3.info "logout,%s,$4,$5" - -/sbin/pfctl -i $1 -Fs -/sbin/pfctl -K $4/32 - -EOD; - - file_put_contents($rootdir . '/linkup', sprintf($up, $logtype)); - file_put_contents($rootdir . '/linkdown', sprintf($down, $logtype)); - - chmod($rootdir . '/linkup', 0755); - chmod($rootdir . '/linkdown', 0755); -} - -function if_pptp_configure_do() -{ - global $config; - - $syscfg = $config['system']; - $pptpdcfg = $config['pptpd']; - - killbypid('/var/run/pptp-vpn.pid', 'TERM', true); - mwexec('rm -rf /var/etc/pptp-vpn'); - - if (!isset($pptpdcfg['mode']) || $pptpdcfg['mode'] != 'server') { - return 0; - } - - if (file_exists('/var/run/booting')) { - echo gettext("Configuring PPTP VPN service..."); - } - - switch ($pptpdcfg['mode']) { - case 'server': - @mkdir('/var/etc/pptp-vpn'); - if_pptp_link_scripts('/var/etc/pptp-vpn'); - - $fd = fopen('/var/etc/pptp-vpn/mpd.conf', 'w'); - if (!$fd) { - printf(gettext("Error: cannot open mpd.conf in if_pptp_configure().") . "\n"); - return 1; - } - - $selfip = get_interface_ip($pptpdcfg['interface']); - - $iprange = $pptpdcfg['remoteip'] . ' '; - $iprange .= long2ip32(ip2long($pptpdcfg['remoteip']) + $pptpdcfg['n_pptp_units'] - 1); - - $mpdconf = << 1) ? $pptpdcfg['radius']['server']['port'] : 1812; - $acctport = $authport + 1; - $mpdconf .= << 1) ? $pptpdcfg['radius']['server2']['port'] : 1812; - $acctport = $authport + 1; - $mpdconf .= << true); - $oic['networks'] = array(); - $oic['virtual'] = true; - $oic['if'] = 'pptp'; - $oic['type'] = 'group'; - $oic['descr'] = 'pptp'; - $mask = !empty($config['pptpd']['pptp_subnet']) ? $config['pptpd']['pptp_subnet'] : 32; - if (isset($config['pptpd']['n_pptp_units']) && is_numeric($config['pptpd']['n_pptp_units'])) { - $pptp_subnets = ip_range_to_subnet_array( - $config['pptpd']['remoteip'], - long2ip32(ip2long($config['pptpd']['remoteip']) + ($config['pptpd']['n_pptp_units'] - 1)) - ); - } else { - $pptp_subnets = ip_range_to_subnet_array( - $config['pptpd']['remoteip'], - long2ip32(ip2long($config['pptpd']['remoteip'])) - ); - } - foreach ($pptp_subnets as $pptp_subnet) { - $snparts = explode("/", $pptp_subnet); - $oic['networks'][] = array("network" => $snparts[0], "mask" => $snparts[1]); - } - $interfaces['pptp'] = $oic; - } - - return $interfaces; -} diff --git a/net/pptp/src/opnsense/mvc/app/models/OPNsense/PPTP/ACL/ACL.xml b/net/pptp/src/opnsense/mvc/app/models/OPNsense/PPTP/ACL/ACL.xml deleted file mode 100644 index fc66ffa68e..0000000000 --- a/net/pptp/src/opnsense/mvc/app/models/OPNsense/PPTP/ACL/ACL.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - Diagnostics: Logs: PPTP - - vpn_pptp_log.php* - - - - VPN: PPTP - - vpn_pptp.php* - - - - VPN: PPTP: User: Edit - - vpn_pptp_users_edit.php* - - - - VPN: PPTP: Users - - vpn_pptp_users.php* - - - diff --git a/net/pptp/src/opnsense/mvc/app/models/OPNsense/PPTP/Menu/Menu.xml b/net/pptp/src/opnsense/mvc/app/models/OPNsense/PPTP/Menu/Menu.xml deleted file mode 100644 index 66e6d55d19..0000000000 --- a/net/pptp/src/opnsense/mvc/app/models/OPNsense/PPTP/Menu/Menu.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/net/pptp/src/www/diag_logs_template_pptp.inc b/net/pptp/src/www/diag_logs_template_pptp.inc deleted file mode 100644 index 993181556e..0000000000 --- a/net/pptp/src/www/diag_logs_template_pptp.inc +++ /dev/null @@ -1,117 +0,0 @@ - - * Copyright (C) 2004-2009 Scott Ullrich - * Copyright (C) 2003-2004 Manuel Kasper - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("interfaces.inc"); - -/* expects $logfile to point to the system path */ -/* expects $logclog to be true or false */ - -require_once 'diag_logs_common.inc'; - -$filtertext = ''; -$nentries = 50; - -if (isset($config['syslog']['nentries'])) { - $nentries = $config['syslog']['nentries']; -} - -if (!empty($_POST['clear'])) { - if ($logclog) { - system_clear_clog($logfile); - } else { - system_clear_log($logfile); - } -} - -if (isset($_POST['filtertext'])) { - $filtertext = $_POST['filtertext']; -} - -include("head.inc"); -?> - - - -
    -
    -
    -
    -

    -

    -
    -
    - -
    -
    -

    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    - diff --git a/net/pptp/src/www/vpn_pptp.php b/net/pptp/src/www/vpn_pptp.php deleted file mode 100644 index 4c373668b9..0000000000 --- a/net/pptp/src/www/vpn_pptp.php +++ /dev/null @@ -1,418 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once('guiconfig.inc'); -require_once('interfaces.inc'); -require_once('filter.inc'); -require_once("system.inc"); -require_once('plugins.inc.d/if_pptp.inc'); - -$pptpcfg = &config_read_array('pptpd'); - -if ($_SERVER['REQUEST_METHOD'] === 'GET') { - $pconfig['remoteip'] = $pptpcfg['remoteip']; - $pconfig['localip'] = $pptpcfg['localip']; - $pconfig['mode'] = $pptpcfg['mode']; - $pconfig['wins'] = $pptpcfg['wins']; - $pconfig['req128'] = isset($pptpcfg['req128']); - $pconfig['n_pptp_units'] = $pptpcfg['n_pptp_units']; - $pconfig['interface'] = $pptpcfg['interface']; - $pconfig['pptp_dns1'] = $pptpcfg['dns1']; - $pconfig['pptp_dns2'] = $pptpcfg['dns2']; - $pconfig['radiusenable'] = isset($pptpcfg['radius']['server']['enable']); - $pconfig['radiusissueips'] = isset($pptpcfg['radius']['radiusissueips']); - $pconfig['radiussecenable'] = isset($pptpcfg['radius']['server2']['enable']); - $pconfig['radacct_enable'] = isset($pptpcfg['radius']['accounting']); - $pconfig['radiusserver'] = $pptpcfg['radius']['server']['ip']; - $pconfig['radiusserverport'] = $pptpcfg['radius']['server']['port']; - $pconfig['radiusserveracctport'] = $pptpcfg['radius']['server']['acctport']; - $pconfig['radiussecret'] = $pptpcfg['radius']['server']['secret']; - $pconfig['radiusserver2'] = $pptpcfg['radius']['server2']['ip']; - $pconfig['radiusserver2port'] = $pptpcfg['radius']['server2']['port']; - $pconfig['radiusserver2acctport'] = $pptpcfg['radius']['server2']['acctport']; - $pconfig['radiussecret2'] = $pptpcfg['radius']['server2']['secret2']; - $pconfig['radius_acct_update'] = $pptpcfg['radius']['acct_update']; - $pconfig['radius_nasip'] = $pptpcfg['radius']['nasip']; -} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - $pconfig = $_POST; - - /* input validation */ - if ($_POST['mode'] == "server") { - $reqdfields = explode(" ", "localip remoteip"); - $reqdfieldsn = array(gettext("Server address"),gettext("Remote start address")); - - if ($_POST['radiusenable']) { - $reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret")); - $reqdfieldsn = array_merge( - $reqdfieldsn, - array(gettext("RADIUS server address"),gettext("RADIUS shared secret")) - ); - } - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - - if ($_POST['localip'] && !is_ipaddr($_POST['localip'])) { - $input_errors[] = gettext("A valid server address must be specified."); - } - if ($_POST['remoteip'] && !is_ipaddr($_POST['remoteip'])) { - $input_errors[] = gettext("A valid remote start address must be specified."); - } - if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) { - $input_errors[] = gettext("A valid RADIUS server address must be specified."); - } - - if (!$input_errors) { - $subnet_start = ip2ulong($_POST['remoteip']); - $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_pptp_units'] - 1; - - if ((ip2ulong($_POST['localip']) >= $subnet_start) && - (ip2ulong($_POST['localip']) <= $subnet_end)) { - $input_errors[] = gettext("The specified server address lies in the remote subnet."); - } - } - } elseif (isset($config['pptpd']['mode'])) { - unset($config['pptpd']['mode']); - } - - if (!$input_errors) { - $pptpcfg['remoteip'] = $_POST['remoteip']; - $pptpcfg['localip'] = $_POST['localip']; - $pptpcfg['mode'] = $_POST['mode']; - $pptpcfg['interface'] = $_POST['interface']; - $pptpcfg['wins'] = $_POST['wins']; - $pptpcfg['n_pptp_units'] = $_POST['n_pptp_units']; - $pptpcfg['radius']['server']['ip'] = $_POST['radiusserver']; - $pptpcfg['radius']['server']['port'] = $_POST['radiusserverport']; - $pptpcfg['radius']['server']['acctport'] = $_POST['radiusserveracctport']; - $pptpcfg['radius']['server']['secret'] = $_POST['radiussecret']; - $pptpcfg['radius']['server2']['ip'] = $_POST['radiusserver2']; - $pptpcfg['radius']['server2']['port'] = $_POST['radiusserver2port']; - $pptpcfg['radius']['server2']['acctport'] = $_POST['radiusserver2acctport']; - $pptpcfg['radius']['server2']['secret2'] = $_POST['radiussecret2']; - $pptpcfg['radius']['nasip'] = $_POST['radius_nasip']; - $pptpcfg['radius']['acct_update'] = $_POST['radius_acct_update']; - - if ($_POST['pptp_dns1'] == "") { - if (isset($pptpcfg['dns1'])) { - unset($pptpcfg['dns1']); - } - } else { - $pptpcfg['dns1'] = $_POST['pptp_dns1']; - } - - if ($_POST['pptp_dns2'] == "") { - if (isset($pptpcfg['dns2'])) { - unset($pptpcfg['dns2']); - } - } else { - $pptpcfg['dns2'] = $_POST['pptp_dns2']; - } - - if ($_POST['req128'] == "yes") { - $pptpcfg['req128'] = true; - } elseif (isset($pptpcfg['req128'])) { - unset($pptpcfg['req128']); - } - - if ($_POST['radiusenable'] == "yes") { - $pptpcfg['radius']['server']['enable'] = true; - } elseif (isset($pptpcfg['radius']['server']['enable'])) { - unset($pptpcfg['radius']['server']['enable']); - } - - if ($_POST['radiussecenable'] == "yes") { - $pptpcfg['radius']['server2']['enable'] = true; - } elseif (isset($pptpcfg['radius']['server2']['enable'])) { - unset($pptpcfg['radius']['server2']['enable']); - } - - if ($_POST['radacct_enable'] == "yes") { - $pptpcfg['radius']['accounting'] = true; - } elseif (isset($pptpcfg['radius']['accounting'])) { - unset($pptpcfg['radius']['accounting']); - } - - if ($_POST['radiusissueips'] == "yes") { - $pptpcfg['radius']['radiusissueips'] = true; - } elseif (isset($pptpcfg['radius']['radiusissueips'])) { - unset($pptpcfg['radius']['radiusissueips']); - } - - write_config(); - $savemsg = get_std_save_message(); - if_pptp_configure_do(); - filter_configure(); - } -} - -$service_hook = 'pptpd'; -legacy_html_escape_form_data($pconfig); -include("head.inc"); - -?> - - - -
    -
    -
    - 0) { - print_input_errors($input_errors); -} ?> - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - /> - -   - /> - -
    - -
    - - -
    - - -
    - -
    -
    - - -
    - -
    - /> -
    - - /> -
    - - /> -
    - - /> - - -
    - -
    - - -
    - - - - - - - - - - - - - - - -
    - -
    - - -
    - - - - - - - - - - - - - - - -
    - -
    - - -
    - /> - - -
    - " /> -
    -
    -
    -
    -
    -
    -
    -
    - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("interfaces.inc"); - -if (empty($config['syslog']['nentries'])) { - $nentries = 50; -} else { - $nentries = $config['syslog']['nentries']; -} - -if ($_POST['clear']) { - system_clear_clog($logfile); -} - -function dump_clog_vpn($file, $tail, $type) -{ - global $config; - - $sort = isset($config['syslog']['reverse']) ? '-r' : ''; - $logarr = array(); - - exec("/usr/local/sbin/clog " . escapeshellarg($file) . " | tail {$sort} -n " . escapeshellarg($tail), $logarr); - - foreach ($logarr as $logent) { - $logent = preg_split('/\s+/', $logent, 6); - $llent = explode(',', $logent[5]); - - if ($llent[1] !== $type) { - continue; - } - - echo "\n"; - echo "" . htmlspecialchars(join(" ", array_slice($logent, 0, 3))) . "\n"; - - if ($llent[0] == "login") { - echo "\n"; - } else { - echo "\n"; - } - - echo "" . htmlspecialchars($llent[3]) . "\n"; - echo "" . htmlspecialchars($llent[2]) . " \n"; - echo "\n"; - } -} - -include("head.inc"); -?> - - - - -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - diff --git a/net/pptp/src/www/vpn_pptp_log.php b/net/pptp/src/www/vpn_pptp_log.php deleted file mode 100644 index 43ec426449..0000000000 --- a/net/pptp/src/www/vpn_pptp_log.php +++ /dev/null @@ -1,26 +0,0 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once('guiconfig.inc'); -require_once("system.inc"); -require_once('plugins.inc.d/if_pptp.inc'); - -$a_secret = &config_read_array('pptpd', 'user'); - -if ($_SERVER['REQUEST_METHOD'] === 'POST') { - // delete entry - if (isset($_POST['act']) && $_POST['act'] == "del" && isset($_POST['id'])) { - if (!empty($a_secret[$_POST['id']])) { - unset($a_secret[$_POST['id']]); - mark_subsystem_dirty('pptpusers'); - write_config(); - } - exit; - } elseif (!empty($_POST['apply'])) { - if_pptp_configure_do(); - clear_subsystem_dirty('pptpusers'); - header(url_safe('Location: /vpn_pptp_users.php')); - exit; - - } -} - -$service_hook = 'pptpd'; -include("head.inc"); -$main_buttons = array( - array('label' => gettext('Add'), 'href' => 'vpn_pptp_users_edit.php'), -); - -?> - - - - - -
    -
    -
    -
    - ".gettext("You must apply the changes in order for them to take effect").".
    ".gettext("Warning: this will terminate all current PPTP sessions")."!");?>
    - -
    -
    -
    -
    - - - - - - - - - - - - - -
    - - -
    -
    -
    -
    -
    -
    -
    -
    - - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -function pptpusercmp($a, $b) -{ - return strcasecmp($a['name'], $b['name']); -} - -function pptpd_users_sort() -{ - global $config; - - if (!is_array($config['ppptpd']['user'])) { - return; - } - - usort($config['pptpd']['user'], "pptpusercmp"); -} - -require_once('guiconfig.inc'); -require_once("system.inc"); -require_once('plugins.inc.d/if_pptp.inc'); - -$a_secret = &config_read_array('pptpd', 'user'); - -if ($_SERVER['REQUEST_METHOD'] === 'GET') { - if (isset($_GET['id']) && !empty($a_secret[$_GET['id']])) { - $id = $_GET['id']; - } - if (isset($id)) { - $pconfig['username'] = $a_secret[$id]['name']; - $pconfig['ip'] = $a_secret[$id]['ip']; - } else { - $pconfig['username'] = null; - $pconfig['ip'] = null; - } -} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - if (isset($_POST['id']) && !empty($a_secret[$_POST['id']])) { - $id = $_POST['id']; - } - unset($input_errors); - $pconfig = $_POST; - - /* input validation */ - if (isset($id) && ($a_secret[$id])) { - $reqdfields = explode(" ", "username"); - $reqdfieldsn = array(gettext("Username")); - } else { - $reqdfields = explode(" ", "username password"); - $reqdfieldsn = array(gettext("Username"),gettext("Password")); - } - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - - if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['username'])) { - $input_errors[] = gettext("The username contains invalid characters."); - } - - if (preg_match("/^!/", $_POST['password'])) { - $input_errors[] = gettext("The password cannot start with '!'."); - } - - if (!preg_match("/^[\x20-\x7E]*$/", $_POST['password'])) { - $input_errors[] = gettext("The password contains invalid characters."); - } - - if (($_POST['password']) && ($_POST['password'] != $_POST['password2'])) { - $input_errors[] = gettext("The passwords do not match."); - } - if (($_POST['ip'] && !is_ipaddr($_POST['ip']))) { - $input_errors[] = gettext("The IP address entered is not valid."); - } - - if (!$input_errors && !(isset($id) && $a_secret[$id])) { - /* make sure there are no dupes */ - foreach ($a_secret as $secretent) { - if ($secretent['name'] == $_POST['username']) { - $input_errors[] = gettext("Another entry with the same username already exists."); - break; - } - } - } - - if (!$input_errors) { - if (isset($id) && $a_secret[$id]) { - $secretent = $a_secret[$id]; - } - - $secretent['name'] = $_POST['username']; - $secretent['ip'] = $_POST['ip']; - - if ($_POST['password']) { - $secretent['password'] = $_POST['password']; - } - - if (isset($id) && $a_secret[$id]) { - $a_secret[$id] = $secretent; - } else { - $a_secret[] = $secretent; - } - - pptpd_users_sort(); - write_config(); - if_pptp_configure_do(); - header(url_safe('Location: /vpn_pptp_users.php')); - exit; - } -} - - -$service_hook = 'pptpd'; -legacy_html_escape_form_data($pconfig); -include("head.inc"); -?> - - - -
    -
    -
    - 0) { - print_input_errors($input_errors); - } ?> -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    - -
    - -
    -  () -
    - - -
    - - -
      - " /> - - - -
    -
    -
    -
    -
    -
    -
    -
    - Date: Thu, 30 Jul 2020 00:34:28 -0700 Subject: [PATCH 0174/3088] acme-client: add support for Linode Cloud API Resolves #1939 --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 10 ++++++++++ .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 4 ++++ .../scripts/OPNsense/AcmeClient/certhelper.php | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 8ad18f5a3e..aa2173c5c6 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -613,6 +613,16 @@ text + + + header + + + + validation.dns_linode_v4_key + + text + header diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 2880e11619..2363ab2470 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -398,6 +398,7 @@ LeaseWeb API lexicon DNS API Linode API + Linode Cloud API Loopia API LuaDNS.com API MailinaBox API @@ -690,6 +691,9 @@ N + + N + N https://api.loopia.se/RPCSERV diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 7c7a6109cb..6775f33481 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -850,6 +850,11 @@ function run_acme_validation($certObj, $valObj, $acctObj) // Linode can take up to 15 to update DNS records $acme_hook_options[] = "--dnssleep 960"; break; + case 'dns_linode_v4': + $proc_env['LINODE_V4_API_KEY'] = (string)$valObj->dns_linode_v4_key; + // Linode can take up to 15 to update DNS records + $acme_hook_options[] = "--dnssleep 960"; + break; case 'dns_loopia': $proc_env['LOOPIA_Api'] = (string)$valObj->dns_loopia_api; $proc_env['LOOPIA_User'] = (string)$valObj->dns_loopia_user; From 34ce9605359b8137e6d9b87f0f0a36b2e09a85ef Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 31 Jul 2020 08:29:18 +0200 Subject: [PATCH 0175/3088] net/udpbroadcastrelay: release as is --- README.md | 2 +- net/udpbroadcastrelay/Makefile | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b50db1add2..8c2f505049 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ net/relayd -- Relayd Load Balancer net/shadowsocks -- Secure socks5 proxy net/siproxd -- Siproxd is a proxy daemon for the SIP protocol net/tayga -- Tayga NAT64 -net/udpbroadcastrelay -- Control ubpbroadcastrelay processes (development only) +net/udpbroadcastrelay -- Control ubpbroadcastrelay processes net/upnp -- Universal Plug and Play Service net/vnstat -- vnStat is a console-based network traffic monitor net/wireguard -- WireGuard VPN service diff --git a/net/udpbroadcastrelay/Makefile b/net/udpbroadcastrelay/Makefile index b90f1cfd0b..0977354b33 100644 --- a/net/udpbroadcastrelay/Makefile +++ b/net/udpbroadcastrelay/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= udpbroadcastrelay -PLUGIN_VERSION= 0.1 -PLUGIN_DEVEL= yes +PLUGIN_VERSION= 1.0 PLUGIN_COMMENT= Control ubpbroadcastrelay processes PLUGIN_DEPENDS= udpbroadcastrelay PLUGIN_MAINTAINER= mjwasley@gmail.com From 828815e72596a1406c736105931566c1d9adf755 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 31 Jul 2020 13:42:38 +0200 Subject: [PATCH 0176/3088] mail/postfix (#1941) --- mail/postfix/Makefile | 3 +-- mail/postfix/pkg-descr | 4 ++++ .../opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 522d394a0d..51aede1328 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= postfix -PLUGIN_VERSION= 1.14 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.15 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix-sasl PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/pkg-descr b/mail/postfix/pkg-descr index 38f254a7de..7ebc7a2d43 100644 --- a/mail/postfix/pkg-descr +++ b/mail/postfix/pkg-descr @@ -6,6 +6,10 @@ is completely different. Plugin Changelog ================ +1.15 + +* Fix Log viewer + 1.14 * Add more anti-spam features into postfix itself diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml index b93892062c..d8aa479891 100644 --- a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml @@ -9,7 +9,7 @@
    - + From 594ff4fbe0ae2290aefb6f01ff3971ee9bb89cb0 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 31 Jul 2020 14:21:54 +0200 Subject: [PATCH 0177/3088] mail/postfix: quick fix syslog (#1942) --- mail/postfix/src/etc/inc/plugins.inc.d/postfix.inc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mail/postfix/src/etc/inc/plugins.inc.d/postfix.inc b/mail/postfix/src/etc/inc/plugins.inc.d/postfix.inc index b83b64bc5d..d486a07d21 100644 --- a/mail/postfix/src/etc/inc/plugins.inc.d/postfix.inc +++ b/mail/postfix/src/etc/inc/plugins.inc.d/postfix.inc @@ -52,10 +52,7 @@ function postfix_syslog() { $syslogconf = array(); - $syslogconf['mail'] = array( - 'facility' => array('postfix'), - 'remote' => 'mail', - ); + $syslogconf['postfix'] = array('facility' => array('postfix')); return $syslogconf; } From e7c4d1189ab6038224ac2d649e8fd49715842a5a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 2 Aug 2020 11:57:48 +0200 Subject: [PATCH 0178/3088] security/acme-client: remove bundled version of dns_opnsense.sh, refs #1888 --- .../OPNsense/AcmeClient/dns_opnsense.sh | 262 ------------------ .../scripts/OPNsense/AcmeClient/setup.sh | 6 +- 2 files changed, 4 insertions(+), 264 deletions(-) delete mode 100755 security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/dns_opnsense.sh diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/dns_opnsense.sh b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/dns_opnsense.sh deleted file mode 100755 index baa77125d5..0000000000 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/dns_opnsense.sh +++ /dev/null @@ -1,262 +0,0 @@ -#!/bin/sh - -#OPNsense Bind API -#https://docs.opnsense.org/development/api.html -# -#OPNs_Host="opnsense.example.com" -#OPNs_Port="443" -#OPNs_Key="qocfU9RSbt8vTIBcnW8bPqCrpfAHMDvj5OzadE7Str+rbjyCyk7u6yMrSCHtBXabgDDXx/dY0POUp7ZA" -#OPNs_Token="pZEQ+3ce8dDlfBBdg3N8EpqpF5I1MhFqdxX06le6Gl8YzyQvYCfCzNaFX9O9+IOSyAs7X71fwdRiZ+Lv" -#OPNs_Api_Insecure=1 # Set 1 for insecure and 0 for secure -> difference is whether ssl cert is checked for validity (0) or whether it is just accepted (1) - -######## Public functions ##################### -#Usage: add _acme-challenge.www.domain.com "123456789ABCDEF0000000000000000000000000000000000000" -#fulldomain -#txtvalue -dns_opnsense_add() { - fulldomain=$1 - txtvalue=$2 - - _opns_check_auth || return 1 - - if ! set_record "$fulldomain" "$txtvalue"; then - return 1 - fi - - return 0 -} - -#fulldomain -dns_opnsense_rm() { - fulldomain=$1 - txtvalue=$2 - - _opns_check_auth || return 1 - - if ! rm_record "$fulldomain" "$txtvalue"; then - return 1 - fi - - return 0 -} - -set_record() { - _info "Adding record" - fulldomain=$1 - new_challenge=$2 - - _debug "Detect root zone" - if ! _get_root "$fulldomain"; then - _err "invalid domain" - return 1 - fi - _debug _domain "$_domain" - _debug _host "$_host" - _debug _domainid "$_domainid" - _return_str="" - _record_string="" - _build_record_string "$_domainid" "$_host" "$new_challenge" - _uuid="" - if _existingchallenge "$_domain" "$_host" "$new_challenge"; then - # Update - if _opns_rest "POST" "/record/setRecord/${_uuid}" "$_record_string"; then - _return_str="$response" - else - return 1 - fi - - else - #create - if _opns_rest "POST" "/record/addRecord" "$_record_string"; then - _return_str="$response" - else - return 1 - fi - fi - - if echo "$_return_str" | _egrep_o "\"result\":\"saved\"" >/dev/null - then - _opns_rest "POST" "/service/reconfigure" "{}" - _debug "Record created" - else - _err "Error createing record $_record_string" - return 1 - fi - - return 0 -} - -rm_record() { - _info "Remove record" - fulldomain=$1 - new_challenge="$2" - - _debug "Detect root zone" - if ! _get_root "$fulldomain"; then - _err "invalid domain" - return 1 - fi - - _debug _domain "$_domain" - _debug _host "$_host" - _debug _domainid "$_domainid" - _uuid="" - if _existingchallenge "$_domain" "$_host" "$new_challenge"; then - # Delete - if _opns_rest "POST" "/record/delRecord/${_uuid}" "\{\}"; then - if echo "$_return_str" | _egrep_o "result":"deleted" >/dev/null; then - _opns_rest "POST" "/service/reconfigure" "{}" - _debug "Record deleted" - else - _err "Error delteting record $fulldomain" - return 1 - fi - else - _err "Error delteting record $fulldomain" - return 1 - fi - else - _info "Record not found, nothing to remove" - fi - - return 0 -} - -#################### Private functions below ################################## -#_acme-challenge.www.domain.com -#returns -# _domainid=domid - #_domain=domain.com -_get_root() { - domain=$1 - i=2 - p=1 - if _opns_rest "GET" "/domain/get"; then - _domain_response="$response" - else - return 1 - fi - - while true; do - h=$(printf "%s" "$domain" | cut -d . -f $i-100) - if [ -z "$h" ]; then - #not valid - return 1 - fi - _debug h "$h" - id=$(echo $_domain_response| _egrep_o "\"[^\"]*\":{\"enabled\":\"1\",\"type\":{\"master\":{\"value\":\"master\",\"selected\":1},\"slave\":{\"value\":\"slave\",\"selected\":0}},\"masterip\":\"[^\"]*\",\"domainname\":\"${h}\"" | cut -d ':' -f 1 | cut -d '"' -f 2 ) - - if [ -n "$id" ];then - _debug id "$id" - _host=$(printf "%s" "$domain" | cut -d . -f 1-$p) - _domain="${h}" - _domainid="${id}" - return 0 - fi - p=$i - i=$(_math $i + 1) - done - _debug "$domain not found" - - return 1 -} - -_opns_rest() { - method=$1 - ep=$2 - data=$3 - #Percent encode user and token - key=$(echo $OPNs_Key | tr -d "\n\r" | _url_encode ) - token=$(echo $OPNs_Token| tr -d "\n\r" | _url_encode ) - - opnsense_url="https://${key}:${token}@${OPNs_Host}:${OPNs_Port}/api/bind${ep}" - export _H1="Content-Type: application/json" - if [ ! "$method" = "GET" ]; then - _debug data "$data" - export _H1="Content-Type: application/json" - response="$(_post "$data" "$opnsense_url" "" "$method")" - else - export _H1="" - response="$(_get "$opnsense_url")" - fi - - if [ "$?" != "0" ]; then - _err "error $ep" - return 1 - fi - _debug2 response "$response" - - return 0 -} - -_build_record_string() { - _record_string="{\"record\":{\"enabled\":\"1\",\"domain\":\"$1\",\"name\":\"$2\",\"type\":\"TXT\",\"value\":\"$3\"}}" -} - -_existingchallenge() { - if _opns_rest "GET" "/record/searchRecord"; then - _record_response="$response" - else - return 1 - fi - _uuid="" - _uuid=$( echo $_record_response| _egrep_o "\"uuid\":\"[^\"]*\",\"enabled\":\"[01]\",\"domain\":\"$1\",\"name\":\"$2\",\"type\":\"TXT\",\"value\":\"$3\"" | cut -d ':' -f 2 | cut -d '"' -f 2 ) - - if [ -n "$_uuid" ];then - _debug uuid "$_uuid" - return 0 - fi - _debug "${2}.$1{1} record not found" - - return 1 -} - -_opns_check_auth() { - OPNs_Host="${OPNs_Host:-$(_readaccountconf_mutable OPNs_Host)}" - OPNs_Port="${OPNs_Port:-$(_readaccountconf_mutable OPNs_Port)}" - OPNs_Key="${OPNs_Key:-$(_readaccountconf_mutable OPNs_Key)}" - OPNs_Token="${OPNs_Token:-$(_readaccountconf_mutable OPNs_Token)}" - OPNs_Api_Insecure="${OPNs_Api_Insecure:-$(_readaccountconf_mutable OPNs_Api_Insecure)}" - - if [ -z "$OPNs_Host" ]; then - OPNs_Host="localhost" - _err "You don't specify OPNsense address." - fi - - if [ -z "$OPNs_Port" ]; then - OPNs_Port="443" - _err "You don't specify OPNsense Port." - fi - - if [ -z "$OPNs_Api_Insecure" ]; then - OPNs_Api_Insecure="0" - fi - - if [ -z "$OPNs_Key" ]; then - OPNs_Key="" - _err "You don't specify OPNsense api key id." - _err "Please set you OPNs_Key and try again." - return 1 - fi - - if [ -z "$OPNs_Token" ]; then - OPNs_Token="" - _err "You don't specify OPNsense token." - _err "Please create you OPNs_Token and try again." - return 1 - fi - - #save the api addr and key to the account conf file. - _saveaccountconf_mutable OPNs_Host "$OPNs_Host" - _saveaccountconf_mutable OPNs_Port "$OPNs_Port" - _saveaccountconf_mutable OPNs_Key "$OPNs_Key" - _saveaccountconf_mutable OPNs_Token "$OPNs_Token" - _saveaccountconf_mutable OPNs_Api_Insecure "$OPNs_Api_Insecure" - export HTTPS_INSECURE="${OPNs_Api_Insecure}" - - if ! _opns_rest "GET" "/general/get";then - _err "Can't Access OPNsense" - return 1 - fi - return 0 -} diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/setup.sh b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/setup.sh index 0acda031ef..43140eea72 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/setup.sh +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/setup.sh @@ -10,8 +10,10 @@ for directory in ${ACME_DIRS}; do chmod -R 750 ${directory} done -if [ ! -L /var/etc/acme-client/home/dns_opnsense.sh ]; then - ln -s /usr/local/opnsense/scripts/OPNsense/AcmeClient/dns_opnsense.sh /var/etc/acme-client/home/dns_opnsense.sh +# Remove symlink in order to use upstream version +# see https://github.com/opnsense/plugins/pull/1888 +if [ -L /var/etc/acme-client/home/dns_opnsense.sh ]; then + unlink /var/etc/acme-client/home/dns_opnsense.sh fi # Setting owner and mode for base and immediate children (non recursive) From 00d5323b2351369f5afb08f2b1b740093e0dc262 Mon Sep 17 00:00:00 2001 From: Adrian Fedoreanu Date: Sat, 1 Aug 2020 13:43:34 +0200 Subject: [PATCH 0179/3088] acme-client add support for 1984Hosting API --- security/acme-client/Makefile | 2 +- security/acme-client/pkg-descr | 2 +- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++++++++++ .../app/models/OPNsense/AcmeClient/AcmeClient.xml | 9 ++++++++- .../scripts/OPNsense/AcmeClient/certhelper.php | 4 ++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 7e359a146f..de178737e4 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 1.34 +PLUGIN_VERSION= 1.35 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 78dc22cf21..666ea3bb6e 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -1,5 +1,5 @@ This plugin contains a full ACME protocol implementation based on the -acme.sh project. Acording to the authors, it's probably "the easiest +acme.sh project. According to the authors, it's probably "the easiest and smallest and smartest shell script" to automatically issue and renew the free certificates from Let's Encrypt. diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 8ad18f5a3e..bad2879405 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1121,4 +1121,19 @@ password + + + header + + + + validation.dns_1984hosting_user + + text + + + validation.dns_1984hosting_password + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 2880e11619..dd9853ec14 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1,6 +1,6 @@ //OPNsense/AcmeClient - 1.6.1 + 1.6.2 A secure Let's Encrypt plugin @@ -357,6 +357,7 @@ Y dns_nsupdate + 1984Hosting API ACME DNS API Acmeproxy API Alwaysdata.com API @@ -893,6 +894,12 @@ N + + N + + + N + diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 7c7a6109cb..1d9e29f0e4 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -647,6 +647,10 @@ function run_acme_validation($certObj, $valObj, $acctObj) // Setup DNS hook: // Set required env variables, write secrets to files, etc. switch ((string)$valObj->dns_service) { + case 'dns_1984hosting': + $proc_env['One984HOSTING_Username'] = (string)$valObj->dns_1984hosting_user; + $proc_env['One984HOSTING_Password'] = (string)$valObj->dns_1984hosting_password; + break; case 'dns_acmedns': $proc_env['ACMEDNS_USERNAME'] = (string)$valObj->dns_acmedns_user; $proc_env['ACMEDNS_PASSWORD'] = (string)$valObj->dns_acmedns_password; From 6b9cbc35606c223b6894bf85cbe4faf1db1dac9e Mon Sep 17 00:00:00 2001 From: Starkstromkonsument Date: Mon, 3 Aug 2020 22:27:49 +0200 Subject: [PATCH 0180/3088] net-mgmt/zabbix-agent: add logformat file --- .../systemhealth/logformats/zabbix_agentd.py | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py diff --git a/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py b/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py new file mode 100644 index 0000000000..dbb5a327a8 --- /dev/null +++ b/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py @@ -0,0 +1,56 @@ +""" + Copyright (c) 2020 Ad Schellevis + Copyright (C) 2020 Starkstromkonsument + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import re +import datetime +from . import BaseLogFormat +zabbix_timeformat = r'(\d*):(\d{4}\d{2}\d{2}:\d{2}\d{2}\d{2})\.\d{3}\s(.*)' + + +class ZabbixLogFormat(BaseLogFormat): + def __init__(self, filename): + super(ZabbixLogFormat, self).__init__(filename) + self._priority = 100 + + def match(self, line): + return self._filename.find('zabbix_agentd') > -1 and re.match(zabbix_timeformat, line) is not None + + @staticmethod + def timestamp(line): + tmp = re.match(zabbix_timeformat, line) + grp = tmp.group(2) + return datetime.datetime.strptime(grp, "%Y%m%d:%H%M%S").isoformat() + + @staticmethod + def process_name(line): + tmp = re.match(zabbix_timeformat, line) + return tmp.group(1) + + @staticmethod + def line(line): + tmp = re.match(zabbix_timeformat, line) + return tmp.group(3) + From 5da0a72ecf79023745738d45e4fb6b012236cfb7 Mon Sep 17 00:00:00 2001 From: Starkstromkonsument Date: Mon, 3 Aug 2020 22:29:20 +0200 Subject: [PATCH 0181/3088] net-mgmt/zabbix-agent: bump version and amend changelog --- net-mgmt/zabbix-agent/Makefile | 2 +- net-mgmt/zabbix-agent/pkg-descr | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/net-mgmt/zabbix-agent/Makefile b/net-mgmt/zabbix-agent/Makefile index 571461e96d..00142169a5 100644 --- a/net-mgmt/zabbix-agent/Makefile +++ b/net-mgmt/zabbix-agent/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= zabbix-agent -PLUGIN_VERSION= 1.7 +PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= Zabbix monitoring agent PLUGIN_DEPENDS= zabbix4-agent PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net-mgmt/zabbix-agent/pkg-descr b/net-mgmt/zabbix-agent/pkg-descr index d18a4485b0..4ba4ced181 100644 --- a/net-mgmt/zabbix-agent/pkg-descr +++ b/net-mgmt/zabbix-agent/pkg-descr @@ -7,4 +7,12 @@ any event. This allows a fast reaction to server problems. Zabbix offers excellent reporting and data visualisation features based on the stored data. This makes Zabbix ideal for capacity planning. -WWW: http://www.zabbix.com/ +WWW: https://www.zabbix.com/ + +Plugin Changelog +---------------- + +1.8 + +* Add Changelog (Starkstromkonsument ) +* Fix logformat (Starkstromkonsument ) From f0c99df38d03a83e291e9d4fa3d4b4581fecdb99 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 6 Aug 2020 16:08:36 +0200 Subject: [PATCH 0182/3088] net/frr: Disable eBGP policies (#1953) --- net/frr/Makefile | 2 +- net/frr/pkg-descr | 4 ++++ .../src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index a808735a4a..b15d063124 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.14 +PLUGIN_VERSION= 1.15 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 96f819dc9c..ffcad0a3a5 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -11,6 +11,10 @@ switching and routing, Internet access routers, and Internet peering. Plugin Changelog ================ +1.15 + +* Disable eBGP policies introduced with FRR 7.4 + 1.14 * fix null route issue in parsing diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index da858e7c8d..a92bad0041 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -17,6 +17,7 @@ log syslog {{ OPNsense.quagga.general.sysloglevel }} ! {% if helpers.exists('OPNsense.quagga.bgp.asnumber') and OPNsense.quagga.bgp.asnumber != '' %} router bgp {{ OPNsense.quagga.bgp.asnumber }} + no bgp ebgp-requires-policy {% if helpers.exists('OPNsense.quagga.bgp.routerid') and OPNsense.quagga.bgp.routerid != '' %} bgp router-id {{ OPNsense.quagga.bgp.routerid }} {% endif %} From 38217a631fe2ff4d16f3d2c26d1e1d4ebd58beae Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 9 Aug 2020 22:20:08 +0200 Subject: [PATCH 0183/3088] acme-client: add support for Joker API DNS validation --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++++++++++ .../app/models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++++++ .../scripts/OPNsense/AcmeClient/certhelper.php | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 4e1c2f81be..6dc61e3f75 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -551,6 +551,21 @@ checkbox Uncheck this box if you have a valid SSL certificate for your ISPConfig installation. + + + header + + + + validation.dns_joker_username + + text + + + validation.dns_joker_password + + password + header diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index b8b74d69cc..54a332d71c 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -394,6 +394,7 @@ Infoblox API INWX XMLRPC API ISPConfig 3.1+ API + Joker API KingHost DNS API Knot (knsupdate) DNS API LeaseWeb API @@ -604,6 +605,12 @@ N 1 + + N + + + N + N diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index c2e53da2f3..44381d7088 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -829,6 +829,10 @@ function run_acme_validation($certObj, $valObj, $acctObj) $proc_env['ISPC_Api'] = (string)$valObj->dns_ispconfig_api; $proc_env['ISPC_Api_Insecure'] = (string)$valObj->dns_ispconfig_insecure; break; + case 'dns_joker': + $proc_env['JOKER_USERNAME'] = (string)$valObj->dns_joker_username; + $proc_env['JOKER_PASSWORD'] = (string)$valObj->dns_joker_password; + break; case 'dns_kinghost': $proc_env['KINGHOST_username'] = (string)$valObj->dns_kinghost_username; $proc_env['KINGHOST_Password'] = (string)$valObj->dns_kinghost_password; From 0be1cf4003fc700c01c660e75f20129e072a67bd Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 11 Aug 2020 10:41:57 +0200 Subject: [PATCH 0184/3088] net/haproxy: switch to stable package --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index b07f11984d..e4f47a08c6 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 2.23 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer -PLUGIN_DEPENDS= haproxy +PLUGIN_DEPENDS= haproxy20 PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" From cb361839797447e5750dbf1dd97ffae4a804481d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 12 Aug 2020 15:43:02 +0200 Subject: [PATCH 0185/3088] security/acme-client: typewriter style is not wrong.. --- security/acme-client/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 666ea3bb6e..25a85e16d6 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -1,5 +1,5 @@ This plugin contains a full ACME protocol implementation based on the -acme.sh project. According to the authors, it's probably "the easiest +acme.sh project. According to the authors, it's probably "the easiest and smallest and smartest shell script" to automatically issue and renew the free certificates from Let's Encrypt. From 54d70a667fd54facf7e42a0aa22b319509f52fcf Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 12 Aug 2020 16:40:41 +0200 Subject: [PATCH 0186/3088] security/acme-client: add ability to rerun automations, closes #1962 --- .../AcmeClient/Api/CertificatesController.php | 22 ++++++++++++++++- .../OPNsense/AcmeClient/certificates.volt | 24 ++++++++++++++++++- .../OPNsense/AcmeClient/certhelper.php | 19 ++++++++++++++- .../conf/actions.d/actions_acmeclient.conf | 6 +++++ 4 files changed, 68 insertions(+), 3 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php index 158ff96796..0159e46310 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php @@ -1,7 +1,7 @@ "failed"); + $mdlAcme = new AcmeClient(); + if ($uuid != null) { + $node = $mdlAcme->getNodeByReference('certificates.certificate.' . $uuid); + if ($node != null) { + $cert_id = $node->id; + $backend = new Backend(); + $response = $backend->configdRun("acmeclient run-automation {$cert_id}"); + } + } + return $result; + } } diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt index c2e206bd6b..6db878d502 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt @@ -2,7 +2,7 @@ (Partially duplicates code from opnsense_bootgrid_plugin.js.) -Copyright (C) 2017 Frank Wall +Copyright (C) 2017-2020 Frank Wall Copyright (C) 2015 Deciso B.V. OPNsense® is Copyright © 2014-2015 by Deciso B.V. All rights reserved. @@ -48,6 +48,7 @@ POSSIBILITY OF SUCH DAMAGE. sign:'/api/acmeclient/certificates/sign/', revoke:'/api/acmeclient/certificates/revoke/', removekey:'/api/acmeclient/certificates/removekey/', + automation:'/api/acmeclient/certificates/automation/', }; var gridopt = { @@ -61,6 +62,7 @@ POSSIBILITY OF SUCH DAMAGE. return " " + "" + "" + + "" + "" + "" + ""; @@ -377,6 +379,26 @@ POSSIBILITY OF SUCH DAMAGE. } }); + // run automation + // TODO: this should block other acme.sh actions + grid_certificates.find(".command-automation").on("click", function(e) + { + if (gridParams['automation'] != undefined) { + var uuid=$(this).data("row-id"); + stdDialogConfirm('{{ lang._('Confirmation Required') }}', + '{{ lang._('Rerun all automations for the selected certificate?') }}', + '{{ lang._('Yes') }}', '{{ lang._('Cancel') }}', function() { + ajaxCall(url=gridParams['automation'] + uuid, + sendData={},callback=function(data,status){ + // reload grid after sign + $("#"+gridId).bootgrid("reload"); + }); + }); + } else { + console.log("[grid] action automation missing") + } + }); + }); // Hide options that are irrelevant in this context. diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index 44381d7088..cb4d2be0a9 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -2,7 +2,7 @@ * Copyright (C) 2008 Shrew Soft Inc. @@ -96,6 +96,10 @@ $result = cert_action_validator($options["c"]); echo json_encode(array('status' => $result)); break; + case 'automation': + $result = cert_action_validator($options["c"]); + echo json_encode(array('status' => $result)); + break; default: echo "ERROR: invalid argument specified\n"; log_error("invalid argument specified"); @@ -219,6 +223,19 @@ function cert_action_validator($opt_cert_id) } } + // Only run certificate automation + if ($options["a"] == "automation") { + // Check if the cert was successul issued + if (!empty((string)$certObj->statusCode) and (string)$certObj->statusCode == '200') { + log_error("AcmeClient: ready to run automation for certificate: " . (string)$certObj->name); + $restart_certs[] = $certObj; + } else { + log_error("AcmeClient: failed to run automation, certificate status not OK: " . (string)$certObj->name); + return(1); + } + break; // Stop after first match. + } + // Make sure we found the configured validation method if ($ref_found == true) { // Was a revocation requested? diff --git a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf index 1a335c89f9..6122512e0b 100644 --- a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf +++ b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf @@ -71,6 +71,12 @@ parameters: type:script message:signing or renewing a certificate +[run-automation] +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -a automation -c +parameters:%s +type:script +message:running automations for a certificate + [cron-auto-renew] command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -a sign -A -C parameters: From a2091befa8057fd6daf87e7a98ad28e14ea33c6e Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 12 Aug 2020 16:40:57 +0200 Subject: [PATCH 0187/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index de178737e4..9c9d25f782 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 1.35 +PLUGIN_VERSION= 1.36 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From cade24c50a247cfac95a89e418df4fba4b74f04a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 13 Aug 2020 12:14:26 +0200 Subject: [PATCH 0188/3088] net-mgmt/zabbix-agent: switch to 5.0 release; closes #1938 --- net-mgmt/zabbix-agent/Makefile | 2 +- net-mgmt/zabbix-agent/pkg-descr | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net-mgmt/zabbix-agent/Makefile b/net-mgmt/zabbix-agent/Makefile index 00142169a5..148ae72c19 100644 --- a/net-mgmt/zabbix-agent/Makefile +++ b/net-mgmt/zabbix-agent/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= zabbix-agent PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= Zabbix monitoring agent -PLUGIN_DEPENDS= zabbix4-agent +PLUGIN_DEPENDS= zabbix5-agent PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" diff --git a/net-mgmt/zabbix-agent/pkg-descr b/net-mgmt/zabbix-agent/pkg-descr index 4ba4ced181..3c687fcbc7 100644 --- a/net-mgmt/zabbix-agent/pkg-descr +++ b/net-mgmt/zabbix-agent/pkg-descr @@ -16,3 +16,4 @@ Plugin Changelog * Add Changelog (Starkstromkonsument ) * Fix logformat (Starkstromkonsument ) +* Switch to Zabbix Agent 5.0 From 2071e23a61043524a603c6ce6e5b6691295db66c Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 13 Aug 2020 19:35:50 +0200 Subject: [PATCH 0189/3088] security/tinc: list_ciphers.py parse issue on 20.7. closes https://github.com/opnsense/plugins/issues/1976 --- .../scripts/OPNsense/Tinc/list_ciphers.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py index 244491048d..76e2c99812 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py @@ -1,7 +1,7 @@ #!/usr/local/bin/python3 """ - Copyright (c) 2016-2019 Ad Schellevis + Copyright (c) 2016-2020 Ad Schellevis All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,19 +28,14 @@ -------------------------------------------------------------------------------------- list ciphers """ -from subprocess import Popen, PIPE +import subprocess import ujson response = dict() -p = Popen(['/usr/bin/openssl','enc', '-help'],stdin=PIPE, stdout=PIPE, stderr=PIPE, bufsize=-1) -output, error = p.communicate() -cipher_section = False -for line in error.decode().split('\n'): - if line.find('Cipher Types') == 0: - cipher_section = True - continue - if cipher_section: +p = subprocess.run(['/usr/local/bin/openssl', 'enc', '-ciphers'], capture_output=True, text=True) +for line in p.stdout.split("\n"): + if not line.startswith('Supported'): for item in line.split(): if len(item) > 1: response[item[1:]] = item[1:] From 7526053bfea0600e503090789728c40c1f534450 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 14 Aug 2020 09:04:07 +0200 Subject: [PATCH 0190/3088] net-mgmt/zabbix-agent: fix permission --- .../src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py diff --git a/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py b/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py old mode 100644 new mode 100755 From 6ec1883fa68a019f70ec6ab4292e8aeed9b2d0cc Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 15 Aug 2020 14:48:10 +0200 Subject: [PATCH 0191/3088] security/tinc. list_ciphers compatibility with both libre and open ssl. closes https://github.com/opnsense/plugins/issues/1976 --- .../opnsense/scripts/OPNsense/Tinc/list_ciphers.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py index 76e2c99812..893ac68cb0 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/list_ciphers.py @@ -34,11 +34,15 @@ response = dict() p = subprocess.run(['/usr/local/bin/openssl', 'enc', '-ciphers'], capture_output=True, text=True) -for line in p.stdout.split("\n"): - if not line.startswith('Supported'): - for item in line.split(): - if len(item) > 1: - response[item[1:]] = item[1:] +ciphers_start = False +for f in [p.stdout, p.stderr]: + for line in f.split("\n"): + if line.startswith('Supported ciphers:') or line.startswith('Valid ciphername values:'): + ciphers_start = True + elif ciphers_start: + for item in line.split(): + if len(item) > 1: + response[item[1:]] = item[1:] response["none"] = "None" # output generated keys From 4716fb18a20719de4342bd8b633c1354124a402f Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 17 Aug 2020 13:00:55 +0200 Subject: [PATCH 0192/3088] stunnel identd: increase request_queue_size, default 5 is quite low. While here, switch to threading tcp server to better cope with concurrent requests --- security/stunnel/Makefile | 2 +- .../stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index c308ced566..c79e12bfb7 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= stunnel -PLUGIN_VERSION= 1.0 +PLUGIN_VERSION= 1.0.1 PLUGIN_COMMENT= stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel diff --git a/security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py b/security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py index 318ba9a62b..115619d400 100755 --- a/security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py +++ b/security/stunnel/src/opnsense/scripts/stunnel/identd_stunnel.py @@ -187,8 +187,9 @@ def handle(self): def run_listener(): - server = socketserver.TCPServer(('0.0.0.0', 113), RequestHandler, bind_and_activate=False) + server = socketserver.ThreadingTCPServer(('0.0.0.0', 113), RequestHandler, bind_and_activate=False) server.allow_reuse_address = True + server.request_queue_size = 128 server.server_bind() server.server_activate() server.serve_forever() From dd34f01d112ae1e8e387a205b5937032c65b261b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 18 Aug 2020 11:45:23 +0200 Subject: [PATCH 0193/3088] LICENSE: sync --- LICENSE | 3 ++- .../opnsense/scripts/systemhealth/logformats/zabbix_agentd.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 069d562f93..e240a4202e 100644 --- a/LICENSE +++ b/LICENSE @@ -12,7 +12,7 @@ Copyright (c) 2008-2010 Ermal Luçi Copyright (c) 2017-2019 Fabian Franz Copyright (c) 2019 Felix Matouschek Copyright (c) 2014-2020 Franco Fichtner -Copyright (c) 2016-2019 Frank Wall +Copyright (c) 2016-2020 Frank Wall Copyright (c) 2016 IT-assistans Sverige AB Copyright (c) 2010 Jim Pingle Copyright (c) 2015 Jos Schellevis @@ -26,6 +26,7 @@ Copyright (c) 2010-2012 Seth Mos Copyright (c) 2008 Shrew Soft Inc. Copyright (c) 2017-2019 Smart-Soft Copyright (c) 2013 Stanley P. Miller \ stan-qaz +Copyright (c) 2020 Starkstromkonsument Copyright (c) 2010 Yehuda Katz Copyright (c) 2015 YoungJoo.Kim Copyright (c) 2020 devNan0 diff --git a/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py b/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py index dbb5a327a8..6376419491 100755 --- a/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py +++ b/net-mgmt/zabbix-agent/src/opnsense/scripts/systemhealth/logformats/zabbix_agentd.py @@ -1,6 +1,6 @@ """ Copyright (c) 2020 Ad Schellevis - Copyright (C) 2020 Starkstromkonsument + Copyright (C) 2020 Starkstromkonsument All rights reserved. Redistribution and use in source and binary forms, with or without @@ -53,4 +53,3 @@ def process_name(line): def line(line): tmp = re.match(zabbix_timeformat, line) return tmp.group(3) - From 89737ebe2c4a36ceb79a9ae48ec832452e983210 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 18 Aug 2020 17:40:21 +0200 Subject: [PATCH 0194/3088] net/haproxy: add support for resolvers, refs #1787 --- .../HAProxy/Api/SettingsController.php | 30 +++++++++ .../OPNsense/HAProxy/IndexController.php | 1 + .../OPNsense/HAProxy/forms/dialogBackend.xml | 7 ++ .../OPNsense/HAProxy/forms/dialogResolver.xml | 54 +++++++++++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 66 ++++++++++++++++++- .../app/models/OPNsense/HAProxy/Menu/Menu.xml | 1 + .../mvc/app/views/OPNsense/HAProxy/index.volt | 53 ++++++++++++++- .../templates/OPNsense/HAProxy/haproxy.conf | 39 +++++++++++ 8 files changed, 249 insertions(+), 2 deletions(-) create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php index 7779d14d56..ef5f8f65d4 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php @@ -379,4 +379,34 @@ public function searchUsersAction() { return $this->searchBase('users.user', array('enabled', 'name', 'description'), 'name'); } + + public function getresolverAction($uuid = null) + { + return $this->getBase('resolver', 'resolvers.resolver', $uuid); + } + + public function setresolverAction($uuid) + { + return $this->setBase('resolver', 'resolvers.resolver', $uuid); + } + + public function addresolverAction() + { + return $this->addBase('resolver', 'resolvers.resolver'); + } + + public function delresolverAction($uuid) + { + return $this->delBase('resolvers.resolver', $uuid); + } + + public function toggleresolverAction($uuid, $enabled = null) + { + return $this->toggleBase('resolvers.resolver', $uuid); + } + + public function searchresolversAction() + { + return $this->searchBase('resolvers.resolver', array('enabled', 'name', 'nameservers'), 'name'); + } } diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php index 0203015213..1209f8ad00 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php @@ -57,6 +57,7 @@ public function indexAction() $this->view->formDialogErrorfile = $this->getForm("dialogErrorfile"); $this->view->formDialogMapfile = $this->getForm("dialogMapfile"); $this->view->formDialogCpu = $this->getForm("dialogCpu"); + $this->view->formDialogResolver = $this->getForm("dialogResolver"); // set additional view parameters $mdlHAProxy = new \OPNsense\HAProxy\HAProxy(); $this->view->showIntro = (string)$mdlHAProxy->general->showIntro; diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index 380bcd3654..8d4479ef5c 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -54,6 +54,13 @@ Type server name or choose from list. + + backend.linkedResolver + + dropdown + + true + backend.source diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml new file mode 100644 index 0000000000..a604d7d6fb --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml @@ -0,0 +1,54 @@ +
    + + resolver.enabled + + checkbox + Enable this resolver configuration. + + + resolver.name + + text + Choose a name for this resolver configuration. + + + resolver.description + + text + Choose a optional description for this resolver configuration. + + + resolver.nameservers + + select_multiple + + true + true + + Enter ip:port here. Finish with TAB. + + + resolver.parse_resolv_conf + + checkbox + Add all nameservers found in /etc/resolv.conf to this resolver configuration. + + + resolver.resolve_retries + + text + + + + resolver.timeout_resolve + + text + + + + resolver.timeout_retry + + text + + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 584a74bba8..3628b1adc9 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 2.9.0 + 2.10.0 the HAProxy load balancer @@ -792,6 +792,18 @@ Y N + + + + + Related resolver not found + N + N + /^((([0-9a-zA-Z._\-\*:]+)))*/u lower @@ -2482,5 +2494,57 @@ + + + + Y + + + 1 + Y + + + /^[^\t^,^;^\.^\[^\]^\{^\}]{1,255}$/u + Should be a string between 1 and 255 characters. + Y + + + N + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + + + N + Y + Y + /^((([0-9a-zA-Z._\-\*:\[\]]+:[0-9]+(-[0-9]+)?)([,]){0,1}))*/u + lower + Please provide a valid nameserver address, i.e. 127.0.0.1:53, [::1]:53 or 192.168.1.1:53. + + + 0 + Y + + + 3 + 0 + 100000 + Please specify a value between 0 and 100000. + N + + + 1s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + + + 1s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + + + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml index 15829a646e..750fe00af6 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml @@ -20,6 +20,7 @@ +
    diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index 6cc4460973..3e4086172c 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -198,6 +198,19 @@ POSSIBILITY OF SUCH DAMAGE. } ); + $("#grid-resolvers").UIBootgrid( + { search:'/api/haproxy/settings/searchResolvers', + get:'/api/haproxy/settings/getResolver/', + set:'/api/haproxy/settings/setResolver/', + add:'/api/haproxy/settings/addResolver/', + del:'/api/haproxy/settings/delResolver/', + toggle:'/api/haproxy/settings/toggleResolver/', + options: { + rowCount:[10,25,50,100,500,1000] + } + } + ); + // hook into on-show event for dialog to extend layout. $('#DialogAcl').on('shown.bs.modal', function (e) { $("#acl\\.expression").change(function(){ @@ -538,6 +551,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Lua Scripts') }}
  • {{ lang._('Map Files') }}
  • {{ lang._('CPU Affinity Rules') }}
  • +
  • {{ lang._('Resolvers') }}
  • @@ -626,8 +640,9 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sLua scripts:%s Include your own Lua code/scripts to extend HAProxy's functionality. The Lua code can be used in certain %sRules%s, for example.") | format('', '', '', '') }}
  • {{ lang._("%sMap Files:%s A map allows to map a data in input to an other one on output. For example, this makes it possible to map a large number of domains to backend pools without using the GUI. Map files need to be used in %sRules%s, otherwise they are ignored.") | format('', '', '', '') }}
  • {{ lang._("%sCPU Affinity Rules:%s This feature makes it possible to bind HAProxy's processes/threads to a specific CPU (or a CPU set). Furthermore it is possible to select CPU Affinity Rules in %sPublic Services%s to restrict them to a certain set of processes/threads/CPUs.") | format('', '', '', '') }}
  • +
  • {{ lang._("%sResolvers:%s This feature allows in-depth configuration of how HAProxy handles name resolution and interacts with name resolvers (DNS). Each resolver configuration can be used in %sBackend Pools%s to apply individual name resolution configurations.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}


    @@ -1067,6 +1082,41 @@ POSSIBILITY OF SUCH DAMAGE.
    + +
    + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Resolver ID') }}{{ lang._('Enabled') }}{{ lang._('Name') }}{{ lang._('Nameservers') }}{{ lang._('Commands') }}{{ lang._('ID') }}
    + + +
    + +
    +
    + + +
    +
    +
    +
    {# include dialogs #} @@ -1082,3 +1132,4 @@ POSSIBILITY OF SUCH DAMAGE. {{ partial("layout_partials/base_dialog",['fields':formDialogErrorfile,'id':'DialogErrorfile','label':lang._('Edit Error Message')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogMapfile,'id':'DialogMapfile','label':lang._('Edit Map File')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogCpu,'id':'DialogCpu','label':lang._('Edit CPU Affinity Rule')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogResolver,'id':'DialogResolver','label':lang._('Edit Resolver')])}} diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index ac4f9d2003..68f0533560 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -998,6 +998,40 @@ userlist stats_auth {% endif %} {% endif %} +{# ############################### #} +{# RESOLVERS #} +{# ############################### #} + +{% if helpers.exists('OPNsense.HAProxy.resolvers') %} +{% for resolver in helpers.toList('OPNsense.HAProxy.resolvers.resolver') %} +{% if resolver.enabled == '1' %} +# Resolver: {{resolver.name}} +resolvers {{resolver.id}} +{% if resolver.nameservers|default("") != "" %} +{% for nameserver in resolver.nameservers.split(",") %} + nameserver {{nameserver}} {{nameserver}} +{% endfor %} +{% endif %} +{% if resolver.parse_resolv_conf|default("") == "1" %} + parse-resolv-conf +{% endif %} +{% if resolver.resolve_retries|default("") != "" %} + resolve_retries {{resolver.resolve_retries}} +{% endif %} +{% if resolver.timeout_resolve|default("") != "" %} + timeout resolve {{resolver.timeout_resolve}} +{% endif %} +{% if resolver.timeout_retry|default("") != "" %} + timeout retry {{resolver.timeout_retry}} +{% endif %} + +{% else %} +# Resolver (DISABLED): {{resolver.name}} + +{% endif %} +{% endfor %} +{%- endif -%} + {# ############################### #} {# FRONTENDS #} {# ############################### #} @@ -1454,6 +1488,11 @@ backend {{backend.name}} {% do server_options.append('verify none') %} {% endif %} {% endif %} +{# # resolver #} +{% if backend.linkedResolver|default("") != "" %} +{% set resolver_data = helpers.getUUID(backend.linkedResolver) %} +{% do server_options.append('resolvers ' ~ resolver_data.id) %} +{% endif %} {# # source address #} {% if backend.source|default("") != "" %} {# # prefer backend configuration #} From 66608b9dc99c53fab85e25dfdb6a5015d73be007 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 18 Aug 2020 18:05:01 +0200 Subject: [PATCH 0195/3088] net/haproxy: add support for init-addr, fixes #1787 --- .../app/controllers/OPNsense/HAProxy/forms/main.xml | 8 ++++++++ .../mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 11 +++++++++++ .../service/templates/OPNsense/HAProxy/haproxy.conf | 3 +++ 3 files changed, 22 insertions(+) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml index 15e2cbc434..c7145c7905 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml @@ -227,6 +227,14 @@ dropdown
    + + haproxy.general.defaults.init_addr + + select_multiple + + true + + haproxy.general.defaults.customOptions diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 3628b1adc9..914f3b74d9 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -199,6 +199,17 @@ redispatch on the 3rd retry prior to the last retry + + N + last,libc + Y + Y + + last + libc + none + + N diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 68f0533560..10dd9c4952 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -933,6 +933,9 @@ defaults {% if OPNsense.HAProxy.general.defaults.retries|default("") != "" %} retries {{OPNsense.HAProxy.general.defaults.retries}} {% endif %} +{% if OPNsense.HAProxy.general.defaults.init_addr|default("") != "" %} + default-server init-addr {{OPNsense.HAProxy.general.defaults.init_addr}} +{% endif %} {% if OPNsense.HAProxy.general.defaults.customOptions|default("") != "" %} # WARNING: pass through options below this line {% for customOpt in OPNsense.HAProxy.general.defaults.customOptions.split("\n") %} From 890394928ad884debdd233312b2f28f3a646fc38 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 20 Aug 2020 00:06:44 +0200 Subject: [PATCH 0196/3088] net/haproxy: streamline "settings" page, improve inline help, add new button --- .../OPNsense/HAProxy/IndexController.php | 24 +- .../OPNsense/HAProxy/forms/generalCache.xml | 30 ++ .../HAProxy/forms/generalDefaults.xml | 63 ++++ .../OPNsense/HAProxy/forms/generalLogging.xml | 31 ++ .../OPNsense/HAProxy/forms/generalPeers.xml | 56 +++ .../HAProxy/forms/generalSettings.xml | 30 ++ .../OPNsense/HAProxy/forms/generalStats.xml | 60 +++ .../OPNsense/HAProxy/forms/generalTuning.xml | 102 +++++ .../OPNsense/HAProxy/forms/main.xml | 356 ------------------ .../mvc/app/views/OPNsense/HAProxy/index.volt | 303 ++++++++++----- 10 files changed, 603 insertions(+), 452 deletions(-) create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalCache.xml create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalDefaults.xml create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalLogging.xml create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalPeers.xml create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalStats.xml create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml delete mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php index 1209f8ad00..141fac3e51 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php @@ -44,20 +44,26 @@ class IndexController extends \OPNsense\Base\IndexController public function indexAction() { // include form definitions - $this->view->mainForm = $this->getForm("main"); - $this->view->formDialogFrontend = $this->getForm("dialogFrontend"); - $this->view->formDialogBackend = $this->getForm("dialogBackend"); - $this->view->formDialogServer = $this->getForm("dialogServer"); - $this->view->formDialogHealthcheck = $this->getForm("dialogHealthcheck"); - $this->view->formDialogAction = $this->getForm("dialogAction"); $this->view->formDialogAcl = $this->getForm("dialogAcl"); - $this->view->formDialogUser = $this->getForm("dialogUser"); + $this->view->formDialogAction = $this->getForm("dialogAction"); + $this->view->formDialogBackend = $this->getForm("dialogBackend"); + $this->view->formDialogCpu = $this->getForm("dialogCpu"); + $this->view->formDialogErrorfile = $this->getForm("dialogErrorfile"); + $this->view->formDialogFrontend = $this->getForm("dialogFrontend"); $this->view->formDialogGroup = $this->getForm("dialogGroup"); + $this->view->formDialogHealthcheck = $this->getForm("dialogHealthcheck"); $this->view->formDialogLua = $this->getForm("dialogLua"); - $this->view->formDialogErrorfile = $this->getForm("dialogErrorfile"); $this->view->formDialogMapfile = $this->getForm("dialogMapfile"); - $this->view->formDialogCpu = $this->getForm("dialogCpu"); $this->view->formDialogResolver = $this->getForm("dialogResolver"); + $this->view->formDialogServer = $this->getForm("dialogServer"); + $this->view->formDialogUser = $this->getForm("dialogUser"); + $this->view->generalCacheForm = $this->getForm("generalCache"); + $this->view->generalDefaultsForm = $this->getForm("generalDefaults"); + $this->view->generalLoggingForm = $this->getForm("generalLogging"); + $this->view->generalPeersForm = $this->getForm("generalPeers"); + $this->view->generalSettingsForm = $this->getForm("generalSettings"); + $this->view->generalStatsForm = $this->getForm("generalStats"); + $this->view->generalTuningForm = $this->getForm("generalTuning"); // set additional view parameters $mdlHAProxy = new \OPNsense\HAProxy\HAProxy(); $this->view->showIntro = (string)$mdlHAProxy->general->showIntro; diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalCache.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalCache.xml new file mode 100644 index 0000000000..d9fd948b39 --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalCache.xml @@ -0,0 +1,30 @@ +
    + + + header + + + haproxy.general.cache.enabled + + checkbox + + + + haproxy.general.cache.totalMaxSize + + text + + + + haproxy.general.cache.maxAge + + text + + + + haproxy.general.cache.maxObjectSize + + text + + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalDefaults.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalDefaults.xml new file mode 100644 index 0000000000..4a44e0aee1 --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalDefaults.xml @@ -0,0 +1,63 @@ +
    + + + header + + + haproxy.general.defaults.maxConnections + + text + + + + haproxy.general.defaults.timeoutClient + + text + + + + haproxy.general.defaults.timeoutConnect + + text + + + + haproxy.general.defaults.timeoutCheck + + text + + + + haproxy.general.defaults.timeoutServer + + text + + + + haproxy.general.defaults.retries + + text + + + + haproxy.general.defaults.redispatch + + dropdown + + + + haproxy.general.defaults.init_addr + + select_multiple + + true + + + + haproxy.general.defaults.customOptions + + textbox +
    NOTE: The syntax will not be checked, use at your own risk!
    ]]>
    + true +
    +
    diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalLogging.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalLogging.xml new file mode 100644 index 0000000000..cdc79ac14b --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalLogging.xml @@ -0,0 +1,31 @@ +
    + + + header + + + haproxy.general.logging.host + + text + + + + haproxy.general.logging.facility + + dropdown + + + + haproxy.general.logging.level + + dropdown + + + + haproxy.general.logging.length + + text + + true + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalPeers.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalPeers.xml new file mode 100644 index 0000000000..f1091f4f35 --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalPeers.xml @@ -0,0 +1,56 @@ +
    + + + header + + + haproxy.general.peers.enabled + + checkbox + + + + + header + + + haproxy.general.peers.name1 + + text + + + + haproxy.general.peers.listen1 + + text + + + + haproxy.general.peers.port1 + + text + + + + + header + + + haproxy.general.peers.name2 + + text + + + + haproxy.general.peers.listen2 + + text + + + + haproxy.general.peers.port2 + + text + + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml new file mode 100644 index 0000000000..78d7ce4b2a --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml @@ -0,0 +1,30 @@ +
    + + + header + + + haproxy.general.enabled + + checkbox + Enable or disable the HAProxy service. + + + haproxy.general.gracefulStop + + checkbox + + + + haproxy.general.seamlessReload + + checkbox + + + + haproxy.general.showIntro + + checkbox + + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalStats.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalStats.xml new file mode 100644 index 0000000000..6832e1e173 --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalStats.xml @@ -0,0 +1,60 @@ +
    + + + header + + + haproxy.general.stats.enabled + + checkbox + + + + haproxy.general.stats.port + + text + + true + + + haproxy.general.stats.remoteEnabled + + checkbox + This may be a security risk if you do not enable authentication! Note that you need to add appropiate firewall rules for this to work.]]> + + + haproxy.general.stats.remoteBind + + select_multiple + + true + + Enter address:port here. Finish with TAB. + + + haproxy.general.stats.authEnabled + + checkbox + + + haproxy.general.stats.allowedUsers + + select_multiple + true + Type username or choose from list. + + + haproxy.general.stats.allowedGroups + + select_multiple + true + Type group or choose from list. + + + haproxy.general.stats.customOptions + + textbox +
    NOTE: The syntax will not be checked, use at your own risk!
    ]]>
    + true +
    +
    diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml new file mode 100644 index 0000000000..a5abb322c0 --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml @@ -0,0 +1,102 @@ +
    + + + header + + + haproxy.general.tuning.root + + checkbox +
    NOTE: Enabling root could be a security issue but it's required by some feature.
    ]]>
    + true +
    + + haproxy.general.tuning.nbproc + + text +
    NOTE: You may experience random issues in multi-process mode. For more information about the "nbproc" option please see the HAProxy Documentation.
    ]]>
    + true +
    + + haproxy.general.tuning.nbthread + + text + + + + haproxy.general.tuning.maxConnections + + text +
    NOTE: HAProxy will not be able to allocate enough memory if you set this value too high. Consider raising the settings for kern.maxfiles and kern.maxfilesperproc if you need to specify a non-default value.
    ]]>
    +
    + + haproxy.general.tuning.sslServerVerify + + dropdown + + + + haproxy.general.tuning.maxDHSize + + text +
    NOTE: Higher values will increase the CPU load. For more information about the "tune.ssl.default-dh-param" option please see the HAProxy Documentation.
    ]]>
    +
    + + haproxy.general.tuning.bufferSize + + text +
    NOTE: It is strongly recommended not to change this from the default value, as very low values will break some services such as statistics, and values larger than default size will increase memory usage, possibly causing the system to run out of memory.
    ]]>
    + true +
    + + haproxy.general.tuning.checkBufferSize + + text + + true + + + haproxy.general.tuning.luaMaxMem + + text + + true + + + haproxy.general.tuning.spreadChecks + + text + + + + haproxy.general.tuning.customOptions + + textbox +
    NOTE: The syntax will not be checked, use at your own risk!
    ]]>
    + true +
    + + + header + + + haproxy.general.tuning.ssl_defaultsEnabled + + checkbox + + + + haproxy.general.tuning.ssl_bindOptions + + select_multiple + + true + + + + haproxy.general.tuning.ssl_cipherList + + text + + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml deleted file mode 100644 index c7145c7905..0000000000 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml +++ /dev/null @@ -1,356 +0,0 @@ -
    - - - - haproxy.general.enabled - - checkbox - Enable or disable the HAProxy service. - - - haproxy.general.gracefulStop - - checkbox - - - - haproxy.general.seamlessReload - - checkbox - - - - haproxy.general.showIntro - - checkbox - - - - - - haproxy.general.peers.enabled - - checkbox - - - - - header - - - haproxy.general.peers.name1 - - text - - - - haproxy.general.peers.listen1 - - text - - - - haproxy.general.peers.port1 - - text - - - - - header - - - haproxy.general.peers.name2 - - text - - - - haproxy.general.peers.listen2 - - text - - - - haproxy.general.peers.port2 - - text - - - - - - - info - - - haproxy.general.tuning.root - - checkbox -
    NOTE: Enabling root could be a security issue but it's required by some feature.
    ]]>
    - true -
    - - haproxy.general.tuning.nbproc - - text -
    NOTE: You may experience random issues in multi-process mode. For more information about the "nbproc" option please see the HAProxy Documentation.
    ]]>
    - true -
    - - haproxy.general.tuning.nbthread - - text - - - - haproxy.general.tuning.maxConnections - - text -
    NOTE: HAProxy will not be able to allocate enough memory if you set this value too high. Consider raising the settings for kern.maxfiles and kern.maxfilesperproc if you need to specify a non-default value.
    ]]>
    -
    - - haproxy.general.tuning.sslServerVerify - - dropdown - - - - haproxy.general.tuning.maxDHSize - - text -
    NOTE: Higher values will increase the CPU load. For more information about the "tune.ssl.default-dh-param" option please see the HAProxy Documentation.
    ]]>
    -
    - - haproxy.general.tuning.bufferSize - - text -
    NOTE: It is strongly recommended not to change this from the default value, as very low values will break some services such as statistics, and values larger than default size will increase memory usage, possibly causing the system to run out of memory.
    ]]>
    - true -
    - - haproxy.general.tuning.checkBufferSize - - text - - true - - - haproxy.general.tuning.luaMaxMem - - text - - true - - - haproxy.general.tuning.spreadChecks - - text - - - - haproxy.general.tuning.customOptions - - textbox -
    NOTE: The syntax will not be checked, use at your own risk!
    ]]>
    - true -
    - - - header - - - haproxy.general.tuning.ssl_defaultsEnabled - - checkbox - - - - haproxy.general.tuning.ssl_bindOptions - - select_multiple - - true - - - - haproxy.general.tuning.ssl_cipherList - - text - - -
    - - - - info - - - haproxy.general.defaults.maxConnections - - text - - - - haproxy.general.defaults.timeoutClient - - text - - - - haproxy.general.defaults.timeoutConnect - - text - - - - haproxy.general.defaults.timeoutCheck - - text - - - - haproxy.general.defaults.timeoutServer - - text - - - - haproxy.general.defaults.retries - - text - - - - haproxy.general.defaults.redispatch - - dropdown - - - - haproxy.general.defaults.init_addr - - select_multiple - - true - - - - haproxy.general.defaults.customOptions - - textbox -
    NOTE: The syntax will not be checked, use at your own risk!
    ]]>
    - true -
    -
    - - - haproxy.general.logging.host - - text - - - - haproxy.general.logging.facility - - dropdown - - - - haproxy.general.logging.level - - dropdown - - - - haproxy.general.logging.length - - text - - true - - - - - haproxy.general.stats.enabled - - checkbox - - - - haproxy.general.stats.port - - text - - true - - - haproxy.general.stats.remoteEnabled - - checkbox - This may be a security risk if you do not enable authentication! Note that you need to add appropiate firewall rules for this to work.]]> - - - haproxy.general.stats.remoteBind - - select_multiple - - true - - Enter address:port here. Finish with TAB. - - - haproxy.general.stats.authEnabled - - checkbox - - - haproxy.general.stats.allowedUsers - - select_multiple - true - Type username or choose from list. - - - haproxy.general.stats.allowedGroups - - select_multiple - true - Type group or choose from list. - - - haproxy.general.stats.customOptions - - textbox -
    NOTE: The syntax will not be checked, use at your own risk!
    ]]>
    - true -
    -
    - - - haproxy.general.cache.enabled - - checkbox - - - - haproxy.general.cache.totalMaxSize - - text - - - - haproxy.general.cache.maxAge - - text - - - - haproxy.general.cache.maxObjectSize - - text - - - -
    -
    diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index 3e4086172c..59adaa8923 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -31,6 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. $( document ).ready(function() { + // get general HAProxy settings var data_get_map = {'frm_haproxy':"/api/haproxy/settings/get"}; // load initial data @@ -298,7 +299,7 @@ POSSIBILITY OF SUCH DAMAGE. * Commands **********************************************************************/ - // Reconfigure haproxy - activate changes + // reconfigure haproxy to activate changes $('[id*="reconfigureAct"]').each(function(){ $(this).click(function(){ @@ -366,7 +367,7 @@ POSSIBILITY OF SUCH DAMAGE. }); }); - // Test configuration file + // test configuration file $('[id*="configtestAct"]').each(function(){ $(this).click(function(){ @@ -407,34 +408,115 @@ POSSIBILITY OF SUCH DAMAGE. }); }); - // form save event handlers for all defined forms - $('[id*="save_"]').each(function(){ + // save general settings and perform a config test + $('[id*="saveAndTestAct"]').each(function(){ $(this).click(function(){ - var frm_id = $(this).closest("form").attr("id"); - var frm_title = $(this).closest("form").attr("data-title"); + // extract the form id from the button id + var frm_id = "frm_" + $(this).attr("id").split('_')[1] - // set progress animation - $("#"+frm_id+"_progress").addClass("fa fa-spinner fa-pulse"); - - // save data for tab + // save data for this tab saveFormToEndpoint(url="/api/haproxy/settings/set",formid=frm_id,callback_ok=function(){ + // set progress animation + $('[id*="saveAndTestAct_progress"]').each(function(){ + $(this).addClass("fa fa-spinner fa-pulse"); + }); - // on correct save, perform reconfigure - ajaxCall(url="/api/haproxy/service/reconfigure", sendData={}, callback=function(data,status) { - if (status != "success" || data['status'] != 'ok') { + // on correct save, perform config test + ajaxCall(url="/api/haproxy/service/configtest", sendData={}, callback=function(data,status) { + if (data['result'].indexOf('ALERT') > -1) { + BootstrapDialog.show({ + type: BootstrapDialog.TYPE_DANGER, + title: "{{ lang._('HAProxy config contains critical errors') }}", + message: data['result'], + draggable: true + }); + } else if (data['result'].indexOf('WARNING') > -1) { BootstrapDialog.show({ type: BootstrapDialog.TYPE_WARNING, - title: "{{ lang._('Error reconfiguring HAProxy') }}", - message: data['status'], + title: "{{ lang._('HAProxy config contains minor errors') }}", + message: data['result'], draggable: true }); + } + // when done, disable progress animation + $('[id*="saveAndTestAct_progress"]').each(function(){ + $(this).removeClass("fa fa-spinner fa-pulse"); + }); + }); + }); + }); + }); + + // save general settings and reconfigure HAProxy + $('[id*="saveAndReconfigureAct"]').each(function(){ + $(this).click(function(){ + // extract the form id from the button id + var frm_id = "frm_" + $(this).attr("id").split('_')[1] + + // save data for this tab + saveFormToEndpoint(url="/api/haproxy/settings/set",formid=frm_id,callback_ok=function(){ + // set progress animation + $('[id*="saveAndReconfigureAct_progress"]').each(function(){ + $(this).addClass("fa fa-spinner fa-pulse"); + }); + + // on correct save, perform config test + ajaxCall(url="/api/haproxy/service/configtest", sendData={}, callback=function(data,status) { + // show warning in case of critical errors + if (data['result'].indexOf('ALERT') > -1) { + BootstrapDialog.show({ + type: BootstrapDialog.TYPE_DANGER, + title: "{{ lang._('HAProxy config contains critical errors') }}", + message: "{{ lang._('The HAProxy service may not be able to start due to critical errors. Try anyway?') }}", + buttons: [{ + label: '{{ lang._('Continue') }}', + cssClass: 'btn-primary', + action: function(dlg){ + ajaxCall(url="/api/haproxy/service/reconfigure", sendData={}, callback=function(data,status) { + if (status != "success" || data['status'] != 'ok') { + BootstrapDialog.show({ + type: BootstrapDialog.TYPE_WARNING, + title: "{{ lang._('Error reconfiguring HAProxy') }}", + message: data['status'], + draggable: true + }); + } + }); + // when done, disable progress animation + $('[id*="saveAndReconfigureAct_progress"]').each(function(){ + $(this).removeClass("fa fa-spinner fa-pulse"); + }); + dlg.close(); + } + }, { + icon: 'fa fa-trash-o', + label: '{{ lang._('Abort') }}', + action: function(dlg){ + // when done, disable progress animation + $('[id*="saveAndReconfigureAct_progress"]').each(function(){ + $(this).removeClass("fa fa-spinner fa-pulse"); + }); + dlg.close(); + } + }] + }); } else { - ajaxCall(url="/api/haproxy/service/status", sendData={}, callback=function(data,status) { - updateServiceStatusUI(data['status']); + ajaxCall(url="/api/haproxy/service/reconfigure", sendData={}, callback=function(data,status) { + if (status != "success" || data['status'] != 'ok') { + BootstrapDialog.show({ + type: BootstrapDialog.TYPE_WARNING, + title: "{{ lang._('Error reconfiguring HAProxy') }}", + message: data['status'], + draggable: true + }); + } + // when done, disable progress animation + $('[id*="saveAndReconfigureAct_progress"]').each(function(){ + $(this).removeClass("fa fa-spinner fa-pulse"); + }); }); } - // when done, disable progress animation. - $("#"+frm_id+"_progress").removeClass("fa fa-spinner fa-pulse"); + //}); }); }); @@ -513,30 +595,24 @@ POSSIBILITY OF SUCH DAMAGE. - {# add automatically generated tabs #} - {% for tab in mainForm['tabs']|default([]) %} - {% if tab['subtabs']|default(false) %} - {# Tab with dropdown #} - - {% else %} - {# Standard Tab #} -
  • - - {{tab[1]}} - -
  • - {% endif %} - {% endfor %} +
  • {{ lang._('Add %sReal Servers:%s All physical or virtual servers that HAProxy should use to load balance between or proxy to.') | format('', '') }}
  • {{ lang._('Add %sBackend Pools:%s Group the previously added servers to build a server farm. All servers in a group usually deliver the same content. The Backend Pool takes care of health monitoring and load distribution. A Backend Pool must be configured even if you only have a single server.') | format('', '')}}
  • {{ lang._('Add %sPublic Services:%s The Public Service listens for client connections, optionally applies rules and forwards client request data to the selected Backend Pool for load balancing or proxying.') | format('', '') }}
  • -
  • {{ lang._('Lastly, enable HAProxy using the %sService Settings%s.') | format('', '') }}
  • +
  • {{ lang._('Lastly, enable HAProxy using the %sService%s settings page.') | format('', '') }}
  • {{ lang._('Please be aware that you need to %smanually%s add the required firewall rules for all configured services.') | format('', '') }}

    {{ lang._('Further information is available in our %sHAProxy plugin documentation%s and of course in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '', '', '') }}

    @@ -631,6 +707,24 @@ POSSIBILITY OF SUCH DAMAGE. +
    +
    +

    {{ lang._('Settings') }}

    +

    {{ lang._("Manage HAProxy core configuration:") }}

    +
      +
    • {{ lang._("%sService:%s Basic service management and options to control HAProxy's restart behaviour.") | format('', '') }}
    • +
    • {{ lang._("%sGlobal Parameters:%s Tuning parameters and global defaults that cannot be overriden elsewhere.") | format('', '', '', '') }}
    • +
    • {{ lang._("%sDefault Parameters:%s Define default parameters for all %sPublic Services%s, %sBackend Pools%s and %sReal Servers%s here. They may be overriden elsewhere.") | format('', '', '', '', '', '', '', '', '', '', '', '') }}
    • +
    • {{ lang._("%sLogging:%s Configure HAProxy's logging behaviour and enable remote logging.") | format('', '', '', '') }}
    • +
    • {{ lang._("%sStatistics:%s This manages HAProxy's internal statistics reporting.") | format('', '', '', '') }}
    • +
    • {{ lang._("%sCache:%s HAProxy's cache which was designed to perform cache on small objects (favicon, css, etc.). This is a minimalist low-maintenance cache which runs in RAM.") | format('', '', '', '') }}
    • +
    • {{ lang._("%sPeers:%s Configure a communication channel between two HAProxy instances. This will propagate entries of any data-types in stick-tables between these HAProxy instances over TCP connections in a multi-master fashion. Useful when aiming for a seamless failover in a HA setup.") | format('', '', '', '') }}
    • +
    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}

    +
    +
    +
    +

    {{ lang._('Advanced Features') }}

    @@ -647,25 +741,7 @@ POSSIBILITY OF SUCH DAMAGE.
    - {# add automatically generated tabs #} - {% for tab in mainForm['tabs']|default([]) %} - {% if tab['subtabs']|default(false) %} - {# Tab with dropdown #} - {% for subtab in tab['subtabs']|default({})%} -
    - {{ partial("layout_partials/base_form",['fields':subtab[2],'id':'frm_'~subtab[0],'data_title':subtab[1],'apply_btn_id':'save_'~subtab[0]])}} -
    - {% endfor %} - {% endif %} - {% if tab['subtabs']|default(false)==false %} -
    - {{ partial("layout_partials/base_form",['fields':tab[2],'id':'frm_'~tab[0],'apply_btn_id':'save_'~tab[0]])}} -
    - {% endif %} - {% endfor %} -
    - @@ -689,7 +765,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -700,7 +775,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -724,7 +798,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -735,7 +808,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -761,7 +833,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -772,7 +843,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -795,7 +865,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -806,7 +875,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -829,7 +897,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -840,7 +907,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -863,7 +929,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -874,7 +939,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -898,7 +962,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -909,7 +972,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -933,7 +995,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -944,7 +1005,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -968,7 +1028,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -979,7 +1038,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -1002,7 +1060,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -1013,7 +1070,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -1036,7 +1092,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -1047,7 +1102,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -1073,7 +1127,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -1084,7 +1137,6 @@ POSSIBILITY OF SUCH DAMAGE.
    - @@ -1108,7 +1160,6 @@ POSSIBILITY OF SUCH DAMAGE.
    -

    @@ -1117,6 +1168,84 @@ POSSIBILITY OF SUCH DAMAGE.
    + + +
    +
    + {{ partial("layout_partials/base_form",['fields':generalSettingsForm,'id':'frm_haproxy-general-settings'])}} +
    +
    + + +
    +
    +
    + +
    +
    + {{ partial("layout_partials/base_form",['fields':generalTuningForm,'id':'frm_haproxy-general-tuning'])}} +
    +
    + + +
    +
    +
    + +
    +
    + {{ partial("layout_partials/base_form",['fields':generalDefaultsForm,'id':'frm_haproxy-general-defaults'])}} +
    +
    + + +
    +
    +
    + +
    +
    + {{ partial("layout_partials/base_form",['fields':generalLoggingForm,'id':'frm_haproxy-general-logging'])}} +
    +
    + + +
    +
    +
    + +
    +
    + {{ partial("layout_partials/base_form",['fields':generalStatsForm,'id':'frm_haproxy-general-stats'])}} +
    +
    + + +
    +
    +
    + +
    +
    + {{ partial("layout_partials/base_form",['fields':generalCacheForm,'id':'frm_haproxy-general-cache'])}} +
    +
    + + +
    +
    +
    + +
    +
    + {{ partial("layout_partials/base_form",['fields':generalPeersForm,'id':'frm_haproxy-general-peers'])}} +
    +
    + + +
    +
    +
    {# include dialogs #} From 95b8cc6aa00e40e5a2edf11827561051ec4d4d34 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 20 Aug 2020 01:01:41 +0200 Subject: [PATCH 0197/3088] net/haproxy: add plugin changelog --- net/haproxy/pkg-descr | 242 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 241 insertions(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 5a41f6ad02..be9ec9837e 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -3,4 +3,244 @@ availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing. -WWW: https://haproxy.org/ +Plugin Changelog +================ + +2.24 + +Added: +* add support for http-request set-var and http-response set-var (#1796) +* add group as userlist to HAProxy config to make it usable in rules/conditions (#1796) +* add support for resolvers to customize how HAProxy handles name resolution (#1787) +* add support for init-addr to allow HAProxy to start when DNS does not resolve (#1787) + +Fixed: +* honor sort order of all rules, remove special handling of "use_[backend|server]" options (#1925) + +Changed: +* add "Save & Test syntax" button to all "Settings" pages +* add "introduction" page for Settings tab +* streamine "Settings" subtabs + +2.23 + +Fixed: +* add missing acl SNI regex text field (#1883) + +2.22 + +Added: +* enable SSL verification for a server when "Force SSL" is enabled in the associated health check (#1761) +* use the systems local Root CA Certificates for SSL verification when no CA was selected (#1761) + +Fixed: +* fix label of src_sess_cnt (#1780) +* fix invalid use of option httplog (resolves a warning in config test) +* fix invalid use of option forwardfor (resolves a warning in config test) + +2.21 + +Fixed: +* override "graceful" restart if required (#1745) + +2.20 + +Changed: +* update stats socket permission for easier (non-root) monitoring (#1232) + +2.19 + +Added: +* switch to HAProxy 2.0 release series (#1089) +* add support for the "max-object-size" cache configuration option (#1458) +* add end-to-end HTTP/2 support (details) +* add support for the random balancing algorithm (details) + +Fixed: +* fix IPv6 validation in frontends (#540) + +Changed: +* add IPv6 example to listen address help text +* update URLs to HAProxy 2.0 documentation +* frontends: move HTTP/2 option to HTTP settings +* change order of frontend options + +2.18 + +Added: +* add support for HAProxy cache (#1442) + +Changed: +* change http-reuse default (align with HAProxy's default value, #1439) + +2.17 + +Added: +* allow backends without servers (#1304) +* add support for deciphered SNI check in ACLs (#1365) +* allow to force SSL for health checks (#1282) + +Changed: +* improve wording for SNI conditions to differentiate between deciphered vs. not deciphered + +2.16 + +Fixed: +* allow hyphens in server, frontend and backend names (#1346) + +2.15 + +Added: +* rules can finally be sorted by using drag'n'drop (#582) +* added "enabled" field to servers (#1208) +* TCP inspection delays are supported in rules (#1188) + +Changed: +* server option "mode" is always visible, no longer requires "advanced mode" (#1208) +* most dropdown fields finally have alphanumeric sorting (#687, opnsense/core#3251) +* rules: align indentation of comments in haproxy.conf + +2.14 + +Fixed: +* bulk deleting does not work (#1164) + +Changed: +* migrate to mutable controller (required to fix #1164) + +2.13 + +Added: +* support multiple CAs for SSL verification for servers + +Fixed: +* fix export of CAs (#1074) + +Changed: +* export a frontend's default SSL certificate (#1088) +* it is no longer required to add a default SSL certificate to a frontend's "certificates" list (#1088) +* avoid duplicate entry in certlist file if a default SSL certificate is specified +* always show "Default certificate" option in frontends, it's no longer an "advanced" option + +2.12 + +Added: +* add support for HTTP/2 (#1047) + +2.11 + +Fixed: +* fix warning: a 'http-request' rule placed after a 'use_backend' rule will still be processed before (#999) +* fix wrong parameter name when using tcp-request content lua (#999) + +Changed: +* internal: trim whitespace, remove empty lines in haproxy.conf (#999) + +2.10 + +Added: +* add support for multithreading (available as new option in Settings -> Global Parameters) (#1003) +* add support for client certificate authentication (#426) +* add support for HTTP Basic Auth to frontends/backends/ACLs (#300) +* add basic user/group management functionality (supports Basic Auth as well as stats users) +* add new CPU Affinity Rules feature (which is a combination of HAProxy's cpu-map, bind-process and process options) (see #1003 for a short explanation) + +Fixed: +* function "http-request header-delete" generated a corrupted haproxy.conf (#882) + +Changed: +* migrate all stats users from old (and cumbersome) username:password format to new user management feature +* internal: use /tmp for autogenerated files (now they are automatically cleaned up on boot) +* internal: change filename of cert lists from id.crtlist to id.certlist + +2.9 + +Added: +* add "http-reuse" option (#836) + +2.8 + +Added: +* support truly seamless reloads (#224) +* add support for the "map" feature (#180) + +Fixed: +* fix reload of service template in "reconfigure" action (#690; introduced in 7381101) +* enabling "hard stop" mode resulted in an invalid "hardrestart" RC command + +Changed: +* use "reload" instead of "restart" RC action +* if "reload" fails, also issue a "restart" command (required when enabling seamless reloads) +* start progress animation (spinner) earlier when applying settings + +2.7 + +Added: +* support rise/fall parameters in backends and health checks +* support set-path in ACLs +* support for cookie-based persistence (#680) + +Fixed: +* fix X-Forwarded-For option disappeared (#647) +* fix validation for source address fields (#695) + +2.6 + +Added: +* add support for http-response set-status in ACLs to manipulate HTTP status codes + +Fixed: +* fix invalid backend name when using nbsrv in ACLs + +2.5 + +Added: +* add support for the PROXY protocol (i.e. in combination with postfix or dovecot) +* switch to HAProxy 1.8.4 + +2.4 + +Added: +* add support for "preload" and "includeSubDomains" HSTS options (#447) +* support session sync / HAProxy peers (#165) +* add new HTTP timeout options (to mitigate slowloris attacks) (#202) +* allow tracking additional values in stick-tables (#202) +* add stick-table config for frontends (optional, disabled by default) (#202) +* add support for many new conditions (#202) +* enable sticky counters for frontend stick-tables (required for new conditions) (#202) + +Changed: +* relax validation masks for several "name" fields (to allow more "special" characters) +* switch to new mutable service controller + +2.3 + +Added: +* new option to hide introduction pages (#340) + +Fixed: +* fix wrong introduction for "Advanced" tab (regression introduced in 8cdcbda) + +2.2 + +Fixed: +* fix for rules parameters (values could not be saved, leading to invalid rules) + +2.1 + +Fixed: +* do not enable HSTS unconditionally (now works as described in #380) +* enable HSTS only for HTTP frontends + +2.0 + +Added: +* new GUI to guide new users and improve general usability (#208) +* make server port optional (#341) +* new SSL settings for frontends (#380) +* new global SSL default values (#380) +* new option for HTTP Strict Transport Security (#380) + +Fixed: +* rephrase text to make it clear that aliases cannot be used (#360) +* rephrase text to make it clear that "use_server" will only work for backends (#361) From 8daf9a122c9abe97953a350d1caa1052cd74039d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 20 Aug 2020 07:05:58 +0200 Subject: [PATCH 0198/3088] plugins: style sweep --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 4 ++-- .../src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index bb4d96f3f1..a40a5bd410 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -1592,9 +1592,9 @@ class updatedns if ($http_code == 200) { $status = 'Dynamic DNS: (Success) IP Address Updated Successfully!'; $successful_update = true; - } else if ($http_code == 401) { + } elseif ($http_code == 401) { $status = 'Dynamic DNS: (Error) Authentication info not sent or invalid'; - }else if ($http_code == 404) { + } elseif ($http_code == 404) { $status = 'Dynamic DNS: (Error) Resource not found'; } else { $status = "Dynamic DNS: (Error) Repsonse not handled check the following: {$data}"; diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php index cb4d2be0a9..928961e391 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php @@ -227,8 +227,8 @@ function cert_action_validator($opt_cert_id) if ($options["a"] == "automation") { // Check if the cert was successul issued if (!empty((string)$certObj->statusCode) and (string)$certObj->statusCode == '200') { - log_error("AcmeClient: ready to run automation for certificate: " . (string)$certObj->name); - $restart_certs[] = $certObj; + log_error("AcmeClient: ready to run automation for certificate: " . (string)$certObj->name); + $restart_certs[] = $certObj; } else { log_error("AcmeClient: failed to run automation, certificate status not OK: " . (string)$certObj->name); return(1); From 97e304b7b8792d03c631d22fa3de7ff35cb7236e Mon Sep 17 00:00:00 2001 From: Martin Wasley Date: Sun, 23 Aug 2020 08:35:49 +0100 Subject: [PATCH 0199/3088] Minor colour corrections Fix some colours --- .../opnsense/www/themes/rebellion/assets/stylesheets/main.scss | 2 +- .../opnsense/www/themes/rebellion/build/css/jquery.bootgrid.css | 2 +- .../src/opnsense/www/themes/rebellion/build/css/main.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss index 0966e503c7..92c6f2deee 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss @@ -5725,7 +5725,7 @@ tbody.collapse.in { } } .navbar-text { - color: #2B2B2B; + color: #AAAAAA; } .navbar-nav > { li > a { diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/jquery.bootgrid.css b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/jquery.bootgrid.css index 5cac223c4a..7599c8f755 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/jquery.bootgrid.css +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/jquery.bootgrid.css @@ -78,7 +78,7 @@ outline: 0; } .bootgrid-table th > .column-header-anchor { - background-color: #929292; + background-color: #444444; color: #eee; cursor: not-allowed; display: block; diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css index 5d86521dff..c3520c56a3 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css @@ -4708,7 +4708,7 @@ tbody.collapse.in { background-color: transparent; } .navbar-default .navbar-text { - color: #2B2B2B; + color: #aaaaaa; } .navbar-default .navbar-nav > li > a { color: #C1C1c1; From 5b91487ec2d8a51afbb17e66a704bc526b9dc1ef Mon Sep 17 00:00:00 2001 From: Adriano Date: Mon, 24 Aug 2020 14:15:16 +0200 Subject: [PATCH 0200/3088] dns/dyndns: Implementend a basic PoC for Gandi LiveDNS (#1916) --- .../src/etc/inc/plugins.inc.d/dyndns.inc | 1 + .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 43 +++++++++++++++++++ dns/dyndns/src/www/services_dyndns_edit.php | 5 ++- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index ac717b7477..40744ebd5c 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -120,6 +120,7 @@ function dyndns_list() 'easydns' => 'easyDNS', 'eurodns' => 'EuroDNS', 'freedns' => 'freeDNS', + 'gandi-livedns' => 'Gandi LiveDNS', 'godaddy' => 'GoDaddy', 'godaddy-v6' => 'GoDaddy (v6)', 'googledomains' => 'Google Domains', diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index a40a5bd410..7a423bd4ed 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -42,6 +42,7 @@ * - regfish IPv6 (regfish.de) * - dynv6 IPv6 (dynv6.com) * - DigitalOcean (digitalocean.com) + * - Gandi LiveDNS (gandi.net) * - Azure DNS (azure.microsoft.com) * - Linode (linode.com) * - Linode IPv6 (linode.com) @@ -107,6 +108,7 @@ * Linode v6 - Last Tested: 25 February 2020 * GoDaddy - Last Tested: 10 July 2020 * GoDaddy v6 - Last Tested: 10 July 2020 + * Gandi LiveDNS - Last Tested: 24 August 2020 * +====================================================+ * * @author E.Kristensen @@ -345,6 +347,7 @@ class updatedns case 'custom-v6': case 'dhs': case 'digitalocean': + case 'gandi-livedns': case 'dnsexit': case 'dnsomatic': case 'duckdns': @@ -669,6 +672,28 @@ class updatedns curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($hostData)); curl_setopt($ch, CURLOPT_URL, $server); break; + case 'gandi-livedns': + /* + * https://github.com/vizion8-dan + * Tested on OPNsense 20.1.8_1-amd64 - IPv4 (A) + * dnsHost ("Hostname" field in OPNsense) should be the 2nd-level domain ("example.org") + * dnsUser ("Username" field in OPNsense) should be the subdomain / A-record ("myrecord" in 2nd-level domain) + * dnsPass should be the Gandi-API key + */ + $server = "https://dns.api.gandi.net/api/v5/domains/". $this->_dnsHost . "/records/" . $this->_dnsUser . "/A"; + + $body = '{"rrset_ttl":"' . "300" . '", "rrset_values":["'. $this->_dnsIP . '"]}'; + + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + "X-Api-Key: {$this->_dnsPass}", + 'Content-Type: application/json' + )); + curl_setopt($ch, CURLOPT_POSTFIELDS, $body); + curl_setopt($ch, CURLOPT_URL, $server); + break; case 'selfhost': if (isset($this->_dnsWildcard) && $this->_dnsWildcard != "OFF") { $this->_dnsWildcard = "ON"; @@ -1425,6 +1450,24 @@ class updatedns log_error("Dynamic DNS Record ID ({$this->_dnsUser}): PAYLOAD: {$data}"); } break; + case 'gandi-livedns': + $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if ($http_code == 401) { + $status = 'Dynamic DNS: (Error) Bad authentication attempt because of a wrong API Key.'; + } elseif ($http_code == 403) { + $status = 'Dynamic DNS: (Error) Access to the resource is denied. Mainly due to a lack of permissions to access it!'; + } elseif ($http_code == 201) { + $status = 'Dynamic DNS: (Success) Record was created!'; + $successful_update = true; + } elseif ($http_code == 200) { + $status = 'Dynamic DNS: (Success) Same record already exists. Nothing was changed!'; + $successful_update = true; + } else { + $status = 'Dynamic DNS: (Error) "Unknown Response"'; + log_error("Dynamic DNS: HTTP Status: {$http_code} PAYLOAD: {$data}"); + $this->_debug($data); + } + break; case 'gratisdns': if (preg_match('/Forkerte værdier/i', $data)) { $status = "Dynamic DNS: (Error) Wrong values - Update could not be completed."; diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index 3db2e4e0fb..b503bdbb16 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -317,7 +317,8 @@ function is_dyndns_username($uname) @@ -366,6 +367,7 @@ function is_dyndns_username($uname)


    +

    @@ -382,6 +384,7 @@ function is_dyndns_username($uname)


    +

    From 3ee618ecdfc3dd20d7180676a89692882a7e5e6c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 24 Aug 2020 14:16:31 +0200 Subject: [PATCH 0201/3088] dns/dyndns: new version and whitespace swep --- dns/dyndns/Makefile | 2 +- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 6 +++--- dns/dyndns/src/www/services_dyndns_edit.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 7911cd8872..2553b19f55 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= dyndns -PLUGIN_VERSION= 1.22 +PLUGIN_VERSION= 1.23 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 7a423bd4ed..61d2f06b44 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -676,8 +676,8 @@ class updatedns /* * https://github.com/vizion8-dan * Tested on OPNsense 20.1.8_1-amd64 - IPv4 (A) - * dnsHost ("Hostname" field in OPNsense) should be the 2nd-level domain ("example.org") - * dnsUser ("Username" field in OPNsense) should be the subdomain / A-record ("myrecord" in 2nd-level domain) + * dnsHost ("Hostname" field in OPNsense) should be the 2nd-level domain ("example.org") + * dnsUser ("Username" field in OPNsense) should be the subdomain / A-record ("myrecord" in 2nd-level domain) * dnsPass should be the Gandi-API key */ $server = "https://dns.api.gandi.net/api/v5/domains/". $this->_dnsHost . "/records/" . $this->_dnsUser . "/A"; @@ -1453,7 +1453,7 @@ class updatedns case 'gandi-livedns': $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code == 401) { - $status = 'Dynamic DNS: (Error) Bad authentication attempt because of a wrong API Key.'; + $status = 'Dynamic DNS: (Error) Bad authentication attempt because of a wrong API Key.'; } elseif ($http_code == 403) { $status = 'Dynamic DNS: (Error) Access to the resource is denied. Mainly due to a lack of permissions to access it!'; } elseif ($http_code == 201) { diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index b503bdbb16..388cbbcbe3 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -318,7 +318,7 @@ function is_dyndns_username($uname) From 7ead9914dac7d402341733faf58be14ec362d669 Mon Sep 17 00:00:00 2001 From: nan0 <49376203+devNan0@users.noreply.github.com> Date: Fri, 28 Aug 2020 10:02:05 +0200 Subject: [PATCH 0202/3088] net-mgmt/telegraf: Add ntpq input (#1965) --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 4 ++++ .../controllers/OPNsense/Telegraf/forms/input.xml | 12 ++++++++++++ .../mvc/app/models/OPNsense/Telegraf/Input.xml | 10 +++++++++- .../templates/OPNsense/Telegraf/telegraf.conf | 9 +++++++++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index dff3380731..6c5c508810 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.8.1 +PLUGIN_VERSION= 1.8.2 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 4765e48ad1..5dd3e3a581 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -11,6 +11,10 @@ Kafka, MQTT, NSQ, and many others. Plugin Changelog ================ +1.8.2 + +* Add 'ntpq' input + 1.8.1 * Fix 'flush interval' templating by @Jontron123 diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml index a17f02e64b..2e1f41a096 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml @@ -111,4 +111,16 @@ checkbox Enable the collection of ZFS statistics. + + input.ntpq + + checkbox + Enable the collection of NTP query metrics. + + + input.ntpq_dns_lookup + + checkbox + Can increase metric gather times. + diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml index b2860ed042..4dd827965f 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml @@ -1,7 +1,7 @@ //OPNsense/telegraf/input Telegraf inputs configuration - 1.0.2 + 1.0.3 1 @@ -74,5 +74,13 @@ 0 N + + 0 + N + + + 0 + N + diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index 84f994bc40..f9396633e3 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -224,4 +224,13 @@ poolMetrics = true {% endif %} +{% if helpers.exists('OPNsense.telegraf.input.ntpq') and OPNsense.telegraf.input.ntpq == '1' %} +[[inputs.ntpq]] +{% if helpers.exists('OPNsense.telegraf.input.ntpq_dns_lookup') and OPNsense.telegraf.input.ntpq_dns_lookup == '1' %} + dns_lookup = true +{% else %} + dns_lookup = false +{% endif %} +{% endif %} + {% endif %} From d96c8142c001a9d0d8322f05fb840f08b305b574 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 1 Sep 2020 14:00:22 +0200 Subject: [PATCH 0203/3088] security/tinc: fix cipher parsing revision bump --- security/tinc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/tinc/Makefile b/security/tinc/Makefile index b624156459..3b6a0356ec 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= tinc PLUGIN_VERSION= 1.5 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org From cc5680ee90a17f374d7c8daa667ebc65a3ba9eb3 Mon Sep 17 00:00:00 2001 From: gap579137 Date: Tue, 25 Aug 2020 07:18:47 -0500 Subject: [PATCH 0204/3088] Updated Project Block List URL These links were updated to reflect the current hosting platform that allows for last-modified header. --- dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh | 6 +++--- .../src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh b/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh index 4cef66ada6..aac1ad92ee 100755 --- a/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh +++ b/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh @@ -149,21 +149,21 @@ stevenblack() { blocklistads() { # Blocklist.site Ads - ${FETCH} https://blocklist.site/app/dl/ads -o ${WORKDIR}/blocklistads-raw + ${FETCH} https://blocklistproject.github.io/Lists/ads.txt -o ${WORKDIR}/blocklistads-raw sed "/\.$/d" ${WORKDIR}/blocklistads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistads rm ${WORKDIR}/blocklistads-raw } blocklistfraud() { # Blocklist.site Fraud - ${FETCH} https://blocklist.site/app/dl/fraud -o ${WORKDIR}/blocklistfraud-raw + ${FETCH} https://blocklistproject.github.io/Lists/fraud.txt -o ${WORKDIR}/blocklistfraud-raw sed "/\.$/d" ${WORKDIR}/blocklistfraud-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistfraud rm ${WORKDIR}/blocklistfraud-raw } blocklistphishing() { # Blocklist.site Phishing - ${FETCH} https://blocklist.site/app/dl/phishing -o ${WORKDIR}/blocklistphishing-raw + ${FETCH} https://blocklistproject.github.io/Lists/phishing.txt -o ${WORKDIR}/blocklistphishing-raw sed "/\.$/d" ${WORKDIR}/blocklistphishing-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistphishing rm ${WORKDIR}/blocklistphishing-raw } diff --git a/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh b/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh index b32d90be87..4142f556e7 100755 --- a/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh +++ b/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh @@ -121,21 +121,21 @@ stevenblack() { blocklistads() { # Blocklist.site Ads - ${FETCH} https://blocklist.site/app/dl/ads -o ${WORKDIR}/blocklistads-raw + ${FETCH} https://blocklistproject.github.io/Lists/ads.txt -o ${WORKDIR}/blocklistads-raw sed "/\.$/d" ${WORKDIR}/blocklistads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistads rm ${WORKDIR}/blocklistads-raw } blocklistfraud() { # Blocklist.site Fraud - ${FETCH} https://blocklist.site/app/dl/fraud -o ${WORKDIR}/blocklistfraud-raw + ${FETCH} https://blocklistproject.github.io/Lists/fraud.txt -o ${WORKDIR}/blocklistfraud-raw sed "/\.$/d" ${WORKDIR}/blocklistfraud-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistfraud rm ${WORKDIR}/blocklistfraud-raw } blocklistphishing() { # Blocklist.site Phishing - ${FETCH} https://blocklist.site/app/dl/phishing -o ${WORKDIR}/blocklistphishing-raw + ${FETCH} https://blocklistproject.github.io/Lists/phishing.txt -o ${WORKDIR}/blocklistphishing-raw sed "/\.$/d" ${WORKDIR}/blocklistphishing-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistphishing rm ${WORKDIR}/blocklistphishing-raw } From 1365468284fc4234c7d54a889a1cbf6aa46792f5 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 5 Sep 2020 10:02:23 +0200 Subject: [PATCH 0205/3088] Update dialogEditBindDomain.xml (#2016) --- .../controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml index f1f5adfc98..dfd13fd206 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml @@ -45,7 +45,7 @@ domain.allowtransfer dropdown - Define an ACL where you allow which server can retrieve this zone. + Define an ACL where you allow which server can retrieve this zone. If this value is empty, domain transfers from everywhere are allowed. domain.allowquery From ca754248bf601fc1b637e2eaeec9a61744aef5d0 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 5 Sep 2020 10:17:39 +0200 Subject: [PATCH 0206/3088] net/frr: fix ospf6 router-id changes with frr7 (#2010) --- net/frr/Makefile | 2 +- net/frr/pkg-descr | 4 ++++ .../opnsense/service/templates/OPNsense/Quagga/ospf6d.conf | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index b15d063124..5b6b4037be 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.15 +PLUGIN_VERSION= 1.16 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index ffcad0a3a5..53558e2993 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -11,6 +11,10 @@ switching and routing, Internet access routers, and Internet peering. Plugin Changelog ================ +1.16 + +* Fix templating for router IDs in OSPF3 daemon + 1.15 * Disable eBGP policies introduced with FRR 7.4 diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf index ec92113a02..607316523a 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf @@ -39,6 +39,9 @@ interface {{ physical_interface(interface.interfacename) }} {% endif %} ! router ospf6 +{% if helpers.exists('OPNsense.quagga.ospf6.routerid') and OPNsense.quagga.ospf6.routerid != '' %} + ospf6 router-id {{ OPNsense.quagga.ospf6.routerid }} +{% endif %} {% if helpers.exists('OPNsense.quagga.ospf6.redistribute') and OPNsense.quagga.ospf6.redistribute != '' %} {% for line in OPNsense.quagga.ospf6.redistribute.split(',') %} redistribute {{ line }} @@ -50,9 +53,6 @@ router ospf6 {% endif %} {% endfor %} {% endif %} -{% if helpers.exists('OPNsense.quagga.ospf6.routerid') and OPNsense.quagga.ospf6.routerid != '' %} - router-id {{ OPNsense.quagga.ospf6.routerid }} -{% endif %} ! line vty ! From 9078aea5150bf04f81622fdb1ec68f31b5071809 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 10 Sep 2020 15:46:28 +0200 Subject: [PATCH 0207/3088] mail/rspamd: add option to set a nameserver (#2025) --- mail/rspamd/Makefile | 2 +- mail/rspamd/pkg-descr | 4 ++++ .../app/controllers/OPNsense/Rspamd/forms/settings.xml | 9 +++++++++ .../opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml | 8 +++++++- .../opnsense/service/templates/OPNsense/Rspamd/+TARGETS | 1 + .../service/templates/OPNsense/Rspamd/options.inc | 7 +++++++ 6 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/options.inc diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile index fef81f2f23..f19a4a45e1 100644 --- a/mail/rspamd/Makefile +++ b/mail/rspamd/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= rspamd -PLUGIN_VERSION= 1.9 +PLUGIN_VERSION= 1.10 PLUGIN_COMMENT= Protect your network from spam PLUGIN_DEPENDS= rspamd PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/mail/rspamd/pkg-descr b/mail/rspamd/pkg-descr index 32b7704d37..c2118b5256 100644 --- a/mail/rspamd/pkg-descr +++ b/mail/rspamd/pkg-descr @@ -5,6 +5,10 @@ lua. Plugin Changelog ---------------- +1.10 + +* Add nameserver option + 1.9 * Add History Rows field diff --git a/mail/rspamd/src/opnsense/mvc/app/controllers/OPNsense/Rspamd/forms/settings.xml b/mail/rspamd/src/opnsense/mvc/app/controllers/OPNsense/Rspamd/forms/settings.xml index b027f57b46..b37c8b7806 100644 --- a/mail/rspamd/src/opnsense/mvc/app/controllers/OPNsense/Rspamd/forms/settings.xml +++ b/mail/rspamd/src/opnsense/mvc/app/controllers/OPNsense/Rspamd/forms/settings.xml @@ -62,6 +62,15 @@ true Set the number of rows to be displayed in rspamd UI. + + rspamd.general.nameserver + + select_multiple + + true + true + Set the nameservers for resolving DNS requests. + diff --git a/mail/rspamd/src/opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml b/mail/rspamd/src/opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml index 483d55d6ef..fccb94dfce 100644 --- a/mail/rspamd/src/opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml +++ b/mail/rspamd/src/opnsense/mvc/app/models/OPNsense/Rspamd/RSpamd.xml @@ -1,7 +1,7 @@ //OPNsense/Rspamd rspamd anti spam filter - 1.0.1 + 1.0.2 @@ -126,6 +126,12 @@ 100000 Choose a value between 1 and 100000. + + 127.0.0.1 + Y + , + Y + diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS index f4db33f7b9..ec5b4811a5 100644 --- a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS +++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/+TARGETS @@ -21,3 +21,4 @@ redis.conf:/usr/local/etc/rspamd/local.d/redis.conf spamtrap-map:/usr/local/etc/rspamd/maps.d/spamtrap.map classifier-bayes.conf:/usr/local/etc/rspamd/local.d/classifier-bayes.conf history_redis.conf:/usr/local/etc/rspamd/local.d/history_redis.conf +options.inc:/usr/local/etc/rspamd/local.d/options.inc diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/options.inc b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/options.inc new file mode 100644 index 0000000000..eec227c1bc --- /dev/null +++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/options.inc @@ -0,0 +1,7 @@ +# Please don't modify this file as your changes might be overwritten with +# the next update. +# + +dns { + nameserver = [{{ "'" + ("','".join(OPNsense.Rspamd.general.nameserver.split(','))) + "'" }}]; +} From d6257b15791f2108c6c366283bd8a3a70a7d9f07 Mon Sep 17 00:00:00 2001 From: Starkstromkonsument Date: Fri, 11 Sep 2020 09:28:12 +0200 Subject: [PATCH 0208/3088] mail/postfix: Add support for header_checks (#1897) --- mail/postfix/Makefile | 2 +- mail/postfix/pkg-descr | 4 + .../Postfix/Api/HeaderchecksController.php | 67 +++++++++++++++ .../Postfix/HeaderchecksController.php | 38 ++++++++ .../forms/dialogEditPostfixHeadercheck.xml | 21 +++++ .../models/OPNsense/Postfix/Headerchecks.php | 31 +++++++ .../models/OPNsense/Postfix/Headerchecks.xml | 25 ++++++ .../app/models/OPNsense/Postfix/Menu/Menu.xml | 1 + .../views/OPNsense/Postfix/headerchecks.volt | 86 +++++++++++++++++++ .../templates/OPNsense/Postfix/+TARGETS | 2 + .../OPNsense/Postfix/header_checks_delivering | 9 ++ .../OPNsense/Postfix/header_checks_receiving | 9 ++ .../templates/OPNsense/Postfix/main.cf | 2 + 13 files changed, 296 insertions(+), 1 deletion(-) create mode 100644 mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/Api/HeaderchecksController.php create mode 100644 mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/HeaderchecksController.php create mode 100644 mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml create mode 100644 mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.php create mode 100644 mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.xml create mode 100644 mail/postfix/src/opnsense/mvc/app/views/OPNsense/Postfix/headerchecks.volt create mode 100644 mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/header_checks_delivering create mode 100644 mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/header_checks_receiving diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 51aede1328..a87fa354de 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= postfix -PLUGIN_VERSION= 1.15 +PLUGIN_VERSION= 1.16 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix-sasl PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/pkg-descr b/mail/postfix/pkg-descr index 7ebc7a2d43..8188ee8b78 100644 --- a/mail/postfix/pkg-descr +++ b/mail/postfix/pkg-descr @@ -6,6 +6,10 @@ is completely different. Plugin Changelog ================ +1.16 + +* Add support for header_checks (Starkstromkonsument ) + 1.15 * Fix Log viewer diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/Api/HeaderchecksController.php b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/Api/HeaderchecksController.php new file mode 100644 index 0000000000..0ff6e04f94 --- /dev/null +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/Api/HeaderchecksController.php @@ -0,0 +1,67 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Postfix\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class HeaderchecksController extends ApiMutableModelControllerBase +{ + protected static $internalModelName = 'headerchecks'; + protected static $internalModelClass = '\OPNsense\Postfix\Headerchecks'; + + public function searchHeaderchecksAction() + { + return $this->searchBase('headerchecks.headercheck', array("enabled", "expression", "filter")); + } + + public function getHeadercheckAction($uuid = null) + { + return $this->getBase('headercheck', 'headerchecks.headercheck', $uuid); + } + + public function addHeadercheckAction() + { + return $this->addBase('headercheck', 'headerchecks.headercheck'); + } + + public function delHeadercheckAction($uuid) + { + return $this->delBase('headerchecks.headercheck', $uuid); + } + + public function setHeadercheckAction($uuid) + { + return $this->setBase('headercheck', 'headerchecks.headercheck', $uuid); + } + + public function toggleHeadercheckAction($uuid) + { + return $this->toggleBase('headerchecks.headercheck', $uuid); + } +} diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/HeaderchecksController.php b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/HeaderchecksController.php new file mode 100644 index 0000000000..8c42454d1e --- /dev/null +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/HeaderchecksController.php @@ -0,0 +1,38 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Postfix; + +class HeaderchecksController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->formDialogEditPostfixHeadercheck = $this->getForm("dialogEditPostfixHeadercheck"); + $this->view->pick('OPNsense/Postfix/headerchecks'); + } +} diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml new file mode 100644 index 0000000000..bde023d7db --- /dev/null +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml @@ -0,0 +1,21 @@ +
    + + headercheck.enabled + + checkbox + This will enable or disable the header_check rule. + + + headercheck.expression + + text + /^\s*User-Agent/ IGNORENote: The regexp is not validated by this form. Please test it carefully.]]> + + + headercheck.filter + + dropdown + See the Postfix manual about header_checks(5)]]> + RECEIVING = header_checks / DELIVERING = smtp_header_checks + +
    diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.php b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.php new file mode 100644 index 0000000000..c55a4646b0 --- /dev/null +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.php @@ -0,0 +1,31 @@ + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +class Headerchecks extends BaseModel +{ +} diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.xml b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.xml new file mode 100644 index 0000000000..8e8b48377a --- /dev/null +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.xml @@ -0,0 +1,25 @@ + + //OPNsense/postfix/headerchecks + Postfix header_checks configuration + 1.0.0 + + + + + 1 + Y + + + Y + + + Y + + while delivering mail + while receiving mail + + + + + + diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml index d8aa479891..9e88d86a1b 100644 --- a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Menu/Menu.xml @@ -8,6 +8,7 @@ +
    diff --git a/mail/postfix/src/opnsense/mvc/app/views/OPNsense/Postfix/headerchecks.volt b/mail/postfix/src/opnsense/mvc/app/views/OPNsense/Postfix/headerchecks.volt new file mode 100644 index 0000000000..320fb4fa07 --- /dev/null +++ b/mail/postfix/src/opnsense/mvc/app/views/OPNsense/Postfix/headerchecks.volt @@ -0,0 +1,86 @@ +{# + +OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. +Copyright (C) 2020 Starkstromkonsument +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#} + + + +
    +
    + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Expression') }}{{ lang._('Filter') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    + + +
    +
    +
    + +

    +
    +
    +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogEditPostfixHeadercheck,'id':'dialogEditPostfixHeadercheck','label':lang._('Edit header_check rule')])}} diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/+TARGETS b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/+TARGETS index 9d7dca3cd9..a1de27fd61 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/+TARGETS +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/+TARGETS @@ -9,3 +9,5 @@ senderbcc:/usr/local/etc/postfix/senderbcc recipientbcc:/usr/local/etc/postfix/recipientbcc smtp_auth:/usr/local/etc/postfix/smtp_auth sendercanonical:/usr/local/etc/postfix/sendercanonical +header_checks_delivering:/usr/local/etc/postfix/header_checks_delivering +header_checks_receiving:/usr/local/etc/postfix/header_checks_receiving diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/header_checks_delivering b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/header_checks_delivering new file mode 100644 index 0000000000..0e53f977b6 --- /dev/null +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/header_checks_delivering @@ -0,0 +1,9 @@ +{% if helpers.exists('OPNsense.postfix.general.enabled') and OPNsense.postfix.general.enabled == '1' %} +{% if helpers.exists('OPNsense.postfix.headerchecks.headerchecks.headercheck') %} +{% for headercheck_list in helpers.toList('OPNsense.postfix.headerchecks.headerchecks.headercheck') %} +{% if headercheck_list.enabled == '1' and headercheck_list.filter == 'WHILE_DELIVERING' %} +{{ headercheck_list.expression }} +{% endif %} +{% endfor %} +{% endif %} +{% endif %} diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/header_checks_receiving b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/header_checks_receiving new file mode 100644 index 0000000000..320e7300c3 --- /dev/null +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/header_checks_receiving @@ -0,0 +1,9 @@ +{% if helpers.exists('OPNsense.postfix.general.enabled') and OPNsense.postfix.general.enabled == '1' %} +{% if helpers.exists('OPNsense.postfix.headerchecks.headerchecks.headercheck') %} +{% for headercheck_list in helpers.toList('OPNsense.postfix.headerchecks.headerchecks.headercheck') %} +{% if headercheck_list.enabled == '1' and headercheck_list.filter == 'WHILE_RECEIVING' %} +{{ headercheck_list.expression }} +{% endif %} +{% endfor %} +{% endif %} +{% endif %} diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf index d744346027..69f314b711 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf @@ -35,6 +35,8 @@ virtual_alias_maps = hash:/usr/local/etc/postfix/virtual sender_bcc_maps = hash:/usr/local/etc/postfix/senderbcc recipient_bcc_maps = hash:/usr/local/etc/postfix/recipientbcc sender_canonical_maps = regexp:/usr/local/etc/postfix/sendercanonical +header_checks = regexp:/usr/local/etc/postfix/header_checks_receiving +smtp_header_checks = regexp:/usr/local/etc/postfix/header_checks_delivering ########################## # END SYSTEM DEFAULTS ########################## From 8fe0f3a899e29c2ff684710c683450dbb6075add Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 27 Aug 2020 21:57:42 +0200 Subject: [PATCH 0209/3088] security/acme-client: release 2.0 --- security/acme-client/Makefile | 2 +- security/acme-client/pkg-descr | 318 ++++ .../AcmeClient/Api/AccountsController.php | 26 +- .../AcmeClient/Api/CertificatesController.php | 18 +- .../AcmeClient/Api/ServiceController.php | 1 - .../AcmeClient/Api/SettingsController.php | 4 +- .../AcmeClient/forms/dialogCertificate.xml | 4 +- .../OPNsense/AcmeClient/forms/settings.xml | 8 +- .../library/OPNsense/AcmeClient/LeAccount.php | 263 +++ .../OPNsense/AcmeClient/LeAutomation/Base.php | 97 + .../AcmeClient/LeAutomation/Configd.php | 51 + .../AcmeClient/LeAutomation/RestartGui.php | 45 + .../LeAutomation/RestartHaproxy.php | 44 + .../AcmeClient/LeAutomation/RestartNginx.php | 44 + .../LeAutomation/UploadHighwinds.php | 45 + .../AcmeClient/LeAutomation/UploadSftp.php | 45 + .../AcmeClient/LeAutomationFactory.php | 81 + .../AcmeClient/LeAutomationInterface.php | 43 + .../OPNsense/AcmeClient/LeCertificate.php | 650 +++++++ .../library/OPNsense/AcmeClient/LeCommon.php | 214 +++ .../library/OPNsense/AcmeClient/LeUtils.php | 189 ++ .../OPNsense/AcmeClient/LeValidation/Base.php | 298 +++ .../LeValidation/Dns1984hosting.php | 45 + .../AcmeClient/LeValidation/DnsAcmedns.php | 47 + .../AcmeClient/LeValidation/DnsAcmeproxy.php | 46 + .../AcmeClient/LeValidation/DnsAd.php | 44 + .../AcmeClient/LeValidation/DnsAli.php | 45 + .../AcmeClient/LeValidation/DnsArvan.php | 44 + .../AcmeClient/LeValidation/DnsAutodns.php | 46 + .../AcmeClient/LeValidation/DnsAws.php | 45 + .../AcmeClient/LeValidation/DnsAzure.php | 47 + .../AcmeClient/LeValidation/DnsCf.php | 49 + .../AcmeClient/LeValidation/DnsCloudns.php | 46 + .../AcmeClient/LeValidation/DnsCn.php | 45 + .../AcmeClient/LeValidation/DnsCx.php | 45 + .../AcmeClient/LeValidation/DnsCyon.php | 45 + .../AcmeClient/LeValidation/DnsDa.php | 45 + .../AcmeClient/LeValidation/DnsDgon.php | 44 + .../AcmeClient/LeValidation/DnsDnsimple.php | 44 + .../AcmeClient/LeValidation/DnsDo.php | 45 + .../AcmeClient/LeValidation/DnsDoapi.php | 44 + .../AcmeClient/LeValidation/DnsDp.php | 45 + .../AcmeClient/LeValidation/DnsDreamhost.php | 44 + .../AcmeClient/LeValidation/DnsDuckdns.php | 44 + .../AcmeClient/LeValidation/DnsDyn.php | 46 + .../AcmeClient/LeValidation/DnsDynu.php | 45 + .../AcmeClient/LeValidation/DnsEuserv.php | 46 + .../AcmeClient/LeValidation/DnsFreedns.php | 45 + .../LeValidation/DnsGandiLivedns.php | 44 + .../AcmeClient/LeValidation/DnsGcloud.php | 88 + .../AcmeClient/LeValidation/DnsGd.php | 45 + .../AcmeClient/LeValidation/DnsGdnsdk.php | 45 + .../AcmeClient/LeValidation/DnsHe.php | 45 + .../AcmeClient/LeValidation/DnsHetzner.php | 44 + .../AcmeClient/LeValidation/DnsHostingde.php | 45 + .../AcmeClient/LeValidation/DnsInfoblox.php | 45 + .../AcmeClient/LeValidation/DnsInwx.php | 45 + .../AcmeClient/LeValidation/DnsIspconfig.php | 47 + .../AcmeClient/LeValidation/DnsJoker.php | 45 + .../AcmeClient/LeValidation/DnsKinghost.php | 45 + .../AcmeClient/LeValidation/DnsKnot.php | 45 + .../AcmeClient/LeValidation/DnsLeaseweb.php | 44 + .../AcmeClient/LeValidation/DnsLexicon.php | 55 + .../AcmeClient/LeValidation/DnsLinode.php | 46 + .../AcmeClient/LeValidation/DnsLinodeV4.php | 46 + .../AcmeClient/LeValidation/DnsLoopia.php | 46 + .../AcmeClient/LeValidation/DnsLua.php | 45 + .../AcmeClient/LeValidation/DnsMe.php | 45 + .../AcmeClient/LeValidation/DnsMiab.php | 46 + .../AcmeClient/LeValidation/DnsNamecheap.php | 51 + .../AcmeClient/LeValidation/DnsNamecom.php | 45 + .../AcmeClient/LeValidation/DnsNamesilo.php | 46 + .../AcmeClient/LeValidation/DnsNetcup.php | 48 + .../AcmeClient/LeValidation/DnsNsone.php | 44 + .../AcmeClient/LeValidation/DnsNsupdate.php | 52 + .../AcmeClient/LeValidation/DnsOpnsense.php | 54 + .../AcmeClient/LeValidation/DnsOvh.php | 47 + .../AcmeClient/LeValidation/DnsPdns.php | 46 + .../AcmeClient/LeValidation/DnsPleskxml.php | 46 + .../LeValidation/DnsSchlundtech.php | 45 + .../AcmeClient/LeValidation/DnsSelectel.php | 44 + .../AcmeClient/LeValidation/DnsServercow.php | 45 + .../AcmeClient/LeValidation/DnsUnoeuro.php | 45 + .../AcmeClient/LeValidation/DnsVariomedia.php | 44 + .../AcmeClient/LeValidation/DnsVscale.php | 44 + .../AcmeClient/LeValidation/DnsYandex.php | 44 + .../AcmeClient/LeValidation/DnsZilore.php | 44 + .../AcmeClient/LeValidation/DnsZonomi.php | 44 + .../AcmeClient/LeValidation/HttpOpnsense.php | 140 ++ .../AcmeClient/LeValidationFactory.php | 90 + .../AcmeClient/LeValidationInterface.php | 49 + .../models/OPNsense/AcmeClient/AcmeClient.xml | 18 +- .../models/OPNsense/AcmeClient/Menu/Menu.xml | 4 +- .../OPNsense/AcmeClient/Migrations/M2_0_0.php | 54 + .../views/OPNsense/AcmeClient/accounts.volt | 290 ++- .../OPNsense/AcmeClient/certificates.volt | 7 +- .../views/OPNsense/AcmeClient/settings.volt | 2 +- .../OPNsense/AcmeClient/validations.volt | 4 +- .../OPNsense/AcmeClient/certhelper.php | 1655 ----------------- .../scripts/OPNsense/AcmeClient/lecert.php | 193 ++ .../conf/actions.d/actions_acmeclient.conf | 22 +- 101 files changed, 6363 insertions(+), 1710 deletions(-) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAccount.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Configd.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartGui.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartHaproxy.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartNginx.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/UploadHighwinds.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/UploadSftp.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomationFactory.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomationInterface.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Dns1984hosting.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmedns.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmeproxy.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAd.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAli.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsArvan.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAutodns.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAws.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAzure.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCloudns.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCn.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCx.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCyon.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDa.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDgon.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnsimple.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDo.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDoapi.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDp.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDreamhost.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDuckdns.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDyn.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDynu.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEuserv.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsFreedns.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGcloud.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGd.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGdnsdk.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHe.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHetzner.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHostingde.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInfoblox.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInwx.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsIspconfig.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsJoker.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsKinghost.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsKnot.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLeaseweb.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLexicon.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinode.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinodeV4.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLoopia.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLua.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMe.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMiab.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamecheap.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamecom.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNetcup.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsone.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOpnsense.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOvh.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPdns.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPleskxml.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSchlundtech.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSelectel.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsServercow.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsUnoeuro.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVariomedia.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVscale.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsYandex.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsZilore.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsZonomi.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidationFactory.php create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidationInterface.php create mode 100644 security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M2_0_0.php delete mode 100755 security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php create mode 100755 security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 9c9d25f782..97a5889dff 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 1.36 +PLUGIN_VERSION= 2.0 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 25a85e16d6..ad11ff7def 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -4,3 +4,321 @@ and smallest and smartest shell script" to automatically issue and renew the free certificates from Let's Encrypt. WWW: https://github.com/acmesh-official/acme.sh + +Plugin Changelog +================ + +2.0 + +Added: +* add new OOP backend to improve reliability and maintainability (#1398) +* add status for accounts to backend and WebGUI +* add button to manually trigger account registration +* add plugin changelog + +Fixed: +* fix bug where configuration could get lost (#1526) +* fix Cyon DNS API (password not set) + +Changed: +* now an Automation may run multiple times during bulk issue/renewal (previously only once) +* rename "Validation Methods" to "Challenge Types" to adopt official LE wording +* rename Menu entry "Automation" to "Automations" +* specify python version for gcloud SDK +* rephrase several log messages +* add more detailed output when debug logging is enabled + +1.36 + +Added: +* add ability to rerun automations (#1962) + +1.35 + +Added: +* add support for Linode Cloud API (#1940) +* add support for 1984Hosting API (#1945) + +Changed: +* remove outdated bundled version of dns_opnsense.sh (#1888) + +1.34 + +Added: +* add support for dnsapi ArvanCloud (#1834) +* add support for dnsapi Hetzner (#1870) + +Changed: +* restore proper sorting in DNS API list + +1.33 + +Added: +* add NSUPDATE_ZONE support to nsupdate DNS-01 service (#1851) + +1.32 + +Added: +* add support for Acmeproxy DNS provider (#1838) + +Changed: +* improve support for dnsapi Euserv.eu (#1790) + +1.31 + +Added: +* add support for dnsapi SchlundTech (#1728) +* add support for dnsapi Euserv (#1779) +* add support for dnsapi Leaseweb (#1670) + +Changed: +* sftp export: make the "fullchain" filename configurable (#1776) + +1.30 + +Changed: +* update acme.sh GitHub link to new repo URL (#1744) + +1.29 + +Added: +* add support for CloudFlare token (#1625) +* add support for MailinaBox DNS API (#1531) +* add support for Plesk XML API (#1567) +* add support for Variomedia DNS API + +Fixed: +* fix IPv6 support for "automatic port forward" validation method (#1590) + +Changed: +* validate IPv4 and IPv6 addresses before using them for "automatic port forward" +* enable IPv6 support on local ACME webservice (when system.ipv6allow is enabled) + +1.28 + +Changed: +* correct minor spelling error (#1628) +* log filename not compatible with new log view (#1593) + +1.27 + +Added: +* add support for Loopia DNS API (#1529) +* automations can now restart Captive Portal or IPsec service after cert renewal (#1534) +* add support for 60+ DNS APIs through Lexicon (#1524) + +Fixed: +* don't break accounts when switching between stg/prod Let's Encrypt environments (#1528) + +Changed: +* add py-dns-lexicon as plugin dependency to support it in DNS-01 out-of-the-box +* support acme.sh debug log level 2 and 3 (#1546) + +1.26 + +Added: +* new automation: support cert upload via sftp (#1455) +* add support for OPNsense's BIND plugin (#1491) +* add support for DNS alias mode (#1492, #1301) + +Changed: +* add headers for certificate options for the sake of clarity + +1.25 + +Added: +* add support for netcup DNS API (#1350) + +Fixed: +* updating an existing cert in Highwinds API failed with a 404 error (wrong HTTP method) + +Changed: +* fix "Use of undefined constant" PHP errors +* treat certificate serial number as string not as integer +* move "remove certificate" button to the end of the button list + +1.24 + +Added: +* add support for Domain-Offensive LetsEncrypt API dns_doapi (#1294) +* add support for Namecheap API (dns_namecheap) +* add support for Google Cloud DNS API dns_gcloud (#549) +* run acme.sh --remove when a cert is removed from the GUI (#1380) +* add a new button to remove the private key (#990) + +Fixed: +* certificate status not correctly updated (#1307) + +Changed: +* add log message when certificate status is updated (refs #1307) + +1.23 + +Fixed: +* renewal interval is ignored (#1221) + +1.22 + +Added: +* support DNS-01 with hosting.de API (#1234) + +Changed: +* streamline log messages, use "AcmeClient" instead of "LE" + +1.21 + +Added: +* possible breaking change: the API endpoint to update individual certs/accounts/etc. has been renamed from "set" to "update" + +Fixed: +* bulk deleting does not work (#1163) + +Changed: +* migrate to mutable controller (required to fix #1163) + +1.20 + +Added: +* new button to reset all acme states, useful after importing a config backup to a new installation (#243) + +1.19 + +Added: +* new automation: automatically upload certificates to Highwinds CDN (proof-of-concept, support for other APIs possible) + +Changed: +* rename "Restart Actions" to "Automation" (the old name has always been rather clumsy) +* change "Automation" position in Menu (it's optional, the new position reflects this) + +1.18 + +Added: +* add support for GratisDNS.dk (#1042) +* add support for ACME DNS + +1.17 + +Fixed: +* fix OCSP always enabled (#794) +* fix acme operations when using multiple accounts (#789) + +1.16 + +Added: +* add support for OCSP Must Staple extension + +Fixed: +* fix ecc certs renewal bug + +1.15 + +Added: +* add support to multiple dns api providers (#712) + +Changed: +* mask passwords by using password fields (#707) + +1.14 + +Added: +* add support for ClouDNS (#574) + +1.13 + +Added: +* update acme.sh to 2.7.5 (#418) + +Changed: +* fix missing fields for several DNS providers (#481) + +1.12 + +Added: +* compatibility with HAProxy plugin version 2.0 (refs #330) + +Fixed: +* fix missing fields for Hurricane Electric (#334) + +1.11 + +Fixed: +* add missing field for DuckDNS (#287) + +1.9 + +Added: +* update acme.sh to version 2.7.2 (#210) +* add support for new DNS API hooks (#225) + +Fixed: +* Rename Certificate "Name" to "Common Name" for better clarity (#214) +* Fix title in "Renew" and "Revoke" dialogs +* Add dependency to BIND to fix nsupdate support +* fix 'Compilation failed: number too big' (#227) + +1.8 + +Added: +* drop bundled acme.sh in favour of the FreeBSD port + +Fixed: +* rename validation method "OPNsense Port Forward" to "OPNsense Web Service" to make it more clear that we're using an internal web service + +1.7 + +Fixed: +* fix $backend is not declared (#132) +* fix null exception in api + +1.6 + +Fixed: +* fix broken translation strings + +1.5 + +Fixed: +* try to solve disconnection issue (mostly during auto-renewal) (#109) +* try to fix "Node no longer exists" + +1.4 + +Changed: +* rename label "Validation Method" to "Challenge Type" + +1.3 + +Changed: +* remove support for custom restart actions (#100) +* avoid log message on missing restart action +* simplify JS code + +1.2 + +Fixed: +* properly import CA certificates (#84) +* don't make sensitive data world-readable + +Changed: +* hide params for restart actions when not selected +* remove prefixes from validation name +* hide http service entries when not selected +* log acme status for each cert + +1.1 + +Added: +* add HAProxy integration + +Fixed: +* avoid API exception when HAProxy integration is incomplete +* avoid error message if no restart action was specified +* do not run restart actions if cert was not changed + +Changed: +* add hide() trickery to hide entries when not selected +* relax fields validation (#70) + +1.0 + +Initial release (#6) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php index b8bcc901a0..ef6dfbf2d6 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php @@ -33,6 +33,7 @@ use OPNsense\Base\ApiMutableModelControllerBase; use OPNsense\Base\UIModelGrid; +use OPNsense\Core\Backend; use OPNsense\Core\Config; use OPNsense\AcmeClient\AcmeClient; @@ -73,6 +74,29 @@ public function toggleAction($uuid, $enabled = null) public function searchAction() { - return $this->searchBase('accounts.account', array('enabled', 'name', 'email'), 'name'); + return $this->searchBase('accounts.account', array('enabled', 'name', 'email', 'statusCode', 'statusLastUpdate'), 'name'); + } + + /** + * register account by uuid + * @param $uuid item unique id + * @return array status + */ + public function registerAction($uuid) + { + $result = array("result" => "failed"); + if ($this->request->isPost()) { + $mdlAcme = new AcmeClient(); + + if ($uuid != null) { + $node = $mdlAcme->getNodeByReference('accounts.account.' . $uuid); + if ($node != null) { + $backend = new Backend(); + $response = $backend->configdRun("acmeclient register-account ${uuid}"); + return array("response" => $response); + } + } + } + return $result; } } diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php index 0159e46310..5a56a56a09 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php @@ -69,9 +69,11 @@ public function delAction($uuid) if ($uuid != null) { $node = $mdlAcme->getNodeByReference('certificates.certificate.' . $uuid); if ($node != null) { - $cert_id = $node->id; $backend = new Backend(); - $response = $backend->configdRun("acmeclient remove-cert {$cert_id}"); + $response = $backend->configdRun("acmeclient remove-cert {$uuid}"); + // Give configd some time to start this operation before the + // cert is removed from config. + sleep(2); } } return $this->delBase('certificates.certificate', $uuid); @@ -101,9 +103,8 @@ public function signAction($uuid) if ($uuid != null) { $node = $mdlAcme->getNodeByReference('certificates.certificate.' . $uuid); if ($node != null) { - $cert_id = $node->id; $backend = new Backend(); - $response = $backend->configdRun("acmeclient sign-cert {$cert_id}"); + $response = $backend->configdRun("acmeclient sign-cert ${uuid}"); return array("response" => $response); } } @@ -123,9 +124,8 @@ public function removekeyAction($uuid) if ($uuid != null) { $node = $mdlAcme->getNodeByReference('certificates.certificate.' . $uuid); if ($node != null) { - $cert_id = $node->id; $backend = new Backend(); - $response = $backend->configdRun("acmeclient remove-key {$cert_id}"); + $response = $backend->configdRun("acmeclient remove-key ${uuid}"); } } return $result; @@ -145,9 +145,8 @@ public function revokeAction($uuid) if ($uuid != null) { $node = $mdlAcme->getNodeByReference('certificates.certificate.' . $uuid); if ($node != null) { - $cert_id = $node->id; $backend = new Backend(); - $response = $backend->configdRun("acmeclient revoke-cert {$cert_id}"); + $response = $backend->configdRun("acmeclient revoke-cert ${uuid}"); return array("response" => $response); } } @@ -167,9 +166,8 @@ public function automationAction($uuid) if ($uuid != null) { $node = $mdlAcme->getNodeByReference('certificates.certificate.' . $uuid); if ($node != null) { - $cert_id = $node->id; $backend = new Backend(); - $response = $backend->configdRun("acmeclient run-automation {$cert_id}"); + $response = $backend->configdRun("acmeclient run-automation ${uuid}"); } } return $result; diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ServiceController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ServiceController.php index 23264d2b53..d7de8f5f33 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ServiceController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ServiceController.php @@ -182,7 +182,6 @@ public function configtestAction() // finally run the syntax check $response = $backend->configdRun("acmeclient configtest"); return array("result" => $response); - // TODO: We may also want to check for duplicate cert names, etc. } /** diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php index f093bb840b..3dcd37d54c 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php @@ -384,7 +384,7 @@ public function fetchHAProxyIntegrationAction() } /** - * Check wether the Google Cloud plugin is installed. + * Check whether the Google Cloud plugin is installed. * @return array status action */ public function getGcloudPluginStatusAction() @@ -402,7 +402,7 @@ public function getGcloudPluginStatusAction() } /** - * Check wether the BIND plugin is installed. + * Check whether the BIND plugin is installed. * @return array status action */ public function getBindPluginStatusAction() diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml index 303b5e5615..0fd183462d 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml @@ -42,9 +42,9 @@ certificate.validationMethod - + dropdown - + certificate.autoRenewal diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/settings.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/settings.xml index 242f42010f..28cee3b6c3 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/settings.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/settings.xml @@ -9,19 +9,19 @@ acmeclient.settings.autoRenewal checkbox - + acmeclient.settings.environment dropdown - relaxed rate limits.
    NOTE:Certificates signed by the staging environment are NOT valid. You need to forcefully re-sign (or delete and re-create) them after switching from staging to production environment.
    ]]>
    + relaxed rate limits.
    NOTE:Certificates signed by the staging environment are NOT valid. You need to forcefully re-sign (or delete and re-create) them after switching from staging to production environment.
    ]]>
    acmeclient.settings.haproxyIntegration checkbox - Requires that the OPNsense HAProxy plugin is installed. This will automatically add the required backend, server, action and ACL for you. You just need to select your HAProxy frontend when configuration the certificate or validation method.
    NOTE:This will only work for HTTP-01 validation and HAProxy frontends running in http mode; TCP frontends are not supported.
    ]]>
    + Requires that the OPNsense HAProxy plugin is installed. This will automatically add the required backend, server, action and ACL for you. You just need to select your HAProxy frontend when configuration the certificate or challenge type.
    NOTE:This will only work for HTTP-01 validation and HAProxy frontends running in http mode; TCP frontends are not supported.
    ]]>
    acmeclient.settings.logLevel @@ -33,7 +33,7 @@ acmeclient.settings.challengePort text - + true diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAccount.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAccount.php new file mode 100644 index 0000000000..4f13e67a90 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAccount.php @@ -0,0 +1,263 @@ +uuid = $uuid; + + // Get config object + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + + // Set log level + $this->setLoglevel(); + + // Set Let's Encrypt environment + $this->setEnvironment(); + + // Store acme filenames + $this->acme_args[] = '--home ' . self::ACME_HOME_DIR; + } + + /** + * generate private key and ACME config for this account + */ + public function generateKey() + { + // Collect account information + $account_conf_dir = self::ACME_BASE_ACCOUNT_DIR . '/' . (string)$this->config->id . '_' . $this->environment; + $account_conf_file = $account_conf_dir . '/account.conf'; + $account_key_file = $account_conf_dir . '/account.key'; + $account_json_file = $account_conf_dir . '/account.json'; + $account_ca_file = $account_conf_dir . '/ca.conf'; + $acme_conf = array(); + $acme_conf[] = "CERT_HOME='" . self::ACME_HOME_DIR . "'"; + $acme_conf[] = "LOG_FILE='" . self::ACME_LOG_FILE . "'"; + $acme_conf[] = "ACCOUNT_KEY_PATH='" . $account_key_file . "'"; + $acme_conf[] = "ACCOUNT_JSON_PATH='" . $account_json_file . "'"; + $acme_conf[] = "CA_CONF='" . $account_ca_file . "'"; + if (!empty((string)$this->config->email)) { + $acme_conf[] = "ACCOUNT_EMAIL='" . (string)$this->config->email . "'"; + } + + // Store some values for later re-use + $this->account_conf_file = $account_conf_file; + + // Create account configuration file + if (!is_dir($account_conf_dir)) { + mkdir($account_conf_dir, 0700, true); + } + file_put_contents($account_conf_file, (string)implode("\n", $acme_conf) . "\n"); + chmod($account_conf_file, 0600); + + // Check if account key already exists both in filesystem and in config + if (!is_file($account_key_file) || empty((string)$this->config->key)) { + LeUtils::log_debug('creating account key for ' . (string)$this->config->name, $this->debug); + + // Check if we have an account key in our configuration + if (!empty((string)$this->config->key)) { + LeUtils::log_debug('exporting existing account key to filesystem for ' . (string)$this->config->name, $this->debug); + // Write key to disk + file_put_contents($account_key_file, (string)base64_decode((string)$this->config->key)); + chmod($account_key_file, 0600); + return true; + } else { + LeUtils::log_debug('generating a new account key for ' . (string)$this->config->name, $this->debug); + // Preparation to run acme client + $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env['PATH'] = $this::ACME_ENV_PATH; + $proc_desc = array( // descriptor array for proc_open() + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stdout + 2 => array("pipe", "w") // stderr + ); + $proc_pipes = array(); + + // Run acme client to generate a account key + $acmecmd = '/usr/local/sbin/acme.sh ' + . '--createAccountKey ' + . implode(' ', $this->acme_args) . ' ' + . '--accountkeylength ' . self::ACME_ACCOUNT_KEY_LENGTH . ' ' + . "--accountconf ${account_conf_file}"; + LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); + $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); + + // Make sure the resource could be setup properly + if (is_resource($proc)) { + // Close all pipes + fclose($proc_pipes[0]); + fclose($proc_pipes[1]); + fclose($proc_pipes[2]); + // Get exit code + $result = proc_close($proc); + } else { + LeUtils::log_error('unable to start acme client process'); + $this->setStatus(500); + return false; + } + + // Check exit code + if ($result) { + LeUtils::log_error('failed to create a new account key for ' . (string)$this->config->name); + $this->setStatus(300); + return false; + } + + // Read account key file + $account_key_content = @file_get_contents($account_key_file); + if (empty($account_key_content) || ($account_key_content == false)) { + LeUtils::log_error("unable to read account key from file ${account_key_file}"); + $this->setStatus(500); + return false; + } + + // Reload to get most recent config + Config::getInstance()->forceReload(); + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + + // Import account key into config + $this->config->key = base64_encode($account_key_content); + + // Serialize to config and save + $this->model->serializeToConfig(); + Config::getInstance()->save(); + + // Refresh config objects + Config::getInstance()->forceReload(); + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + + if (empty((string)$this->config->key)) { + $this->setStatus(500); + LeUtils::log_error('failed to save account key for ' . (string)$this->config->name); + return false; + } + LeUtils::log_debug('successfully created account key for ' . (string)$this->config->name, $this->debug); + return true; + } + } + return true; + } + + /** + * check if account is already registered + * @return bool + */ + public function isRegistered() + { + if (!empty((string)$this->config->statusLastUpdate) and !empty((string)$this->config->key) and ((string)$this->config->statusCode == '200')) { + return true; + } + return false; + } + + /** + * register account with Let's Encrypt + * @return bool + */ + public function register() + { + if (!($this->isEnabled())) { + LeUtils::log('ignoring disabled account: ' . (string)$this->config->name); + return false; + } + + // Make sure a private already exists + if (!($this->generateKey())) { + LeUtils::log_error('aborting registration due to issues with account key: ' . (string)$this->config->name); + return false; + } + + // Check if account is already registered + if (!($this->isRegistered())) { + LeUtils::log_debug('starting account registration for ' . (string)$this->config->name, $this->debug); + + // Preparation to run acme client + $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env['PATH'] = $this::ACME_ENV_PATH; + $proc_desc = array( // descriptor array for proc_open() + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stdout + 2 => array("pipe", "w") // stderr + ); + $proc_pipes = array(); + + // Run acme client + $acmecmd = '/usr/local/sbin/acme.sh ' + . '--registeraccount ' + . implode(' ', $this->acme_args) . ' ' + . '--accountconf ' . $this->account_conf_file; + LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); + $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); + + // Make sure the resource could be setup properly + if (is_resource($proc)) { + // Close all pipes + fclose($proc_pipes[0]); + fclose($proc_pipes[1]); + fclose($proc_pipes[2]); + // Get exit code + $result = proc_close($proc); + } else { + LeUtils::log_error('unable to start acme client process'); + $this->setStatus(500); + return false; + } + + // Check validation result + if ($result) { + LeUtils::log_error('account registration failed for ' . $this->config->name); + $this->setStatus(400); + return false; + } + + // Update account status. + LeUtils::log_error('account registration successful for ' . $this->config->name); + $this->setStatus(200); + } else { + LeUtils::log_debug('account already registered: ' . (string)$this->config->name, $this->debug); + } + + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php new file mode 100644 index 0000000000..cb4ad40f12 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php @@ -0,0 +1,97 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\AcmeClient\LeAutomation; + +use OPNsense\Core\Backend; +use OPNsense\Core\Config; +use OPNsense\AcmeClient\LeAccount; +use OPNsense\AcmeClient\LeUtils; + +/** + * LeAutomation stub file, contains shared logic for all automations. + * @package OPNsense\AcmeClient + */ +abstract class Base extends \OPNsense\AcmeClient\LeCommon +{ + public const CONFIG_PATH = 'actions.action'; + + /** + * Initialize LeAutomation object by adding the required configuration. + * @return boolean + */ + public function init(string $certid, string $accountuuid) + { + // Get config object + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + + // Get account object to query ID + $account = new LeAccount($accountuuid); + + // Store auxiliary information (required to glue stuff together) + $this->cert_id = $certid; + $this->account_id = (string)$account->id; + $this->account_uuid = (string)$account->uuid; + + // Set log level + $this->setLoglevel(); + + // Set Let's Encrypt environment + $this->setEnvironment(); + + return true; + } + + /** + * run all tasks related to this automation + * @return boolean + */ + public function run() + { + if (!($this->isEnabled())) { + LeUtils::log('ignoring disabled automation: ' . (string)$this->config->name); + return true; // not an error + } + + LeUtils::log('running automation: ' . $this->config->name); + $backend = new \OPNsense\Core\Backend(); + $response = $backend->configdRun((string)$this->command, $this->command_args); + return true; + } + + /** + * get automation type from configuration + * @return string + */ + public function getType() + { + return $this->config->type; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Configd.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Configd.php new file mode 100644 index 0000000000..810fafab54 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Configd.php @@ -0,0 +1,51 @@ +config->configd)) { + LeUtils::log_error('no configd command specified for automation: ' . $this->config->name); + return false; + } + + $this->command = (string)$this->config->configd; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartGui.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartGui.php new file mode 100644 index 0000000000..e63cf479e5 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartGui.php @@ -0,0 +1,45 @@ +command = 'webgui restart 2'; + $this->command_args = true; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartHaproxy.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartHaproxy.php new file mode 100644 index 0000000000..c40e9fce7c --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartHaproxy.php @@ -0,0 +1,44 @@ +command = 'haproxy restart'; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartNginx.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartNginx.php new file mode 100644 index 0000000000..fc803e78ad --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/RestartNginx.php @@ -0,0 +1,44 @@ +command = 'nginx restart'; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/UploadHighwinds.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/UploadHighwinds.php new file mode 100644 index 0000000000..1e9bfdcba3 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/UploadHighwinds.php @@ -0,0 +1,45 @@ +cert_id . ' ' . $this->config->id; + $this->command = $command; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/UploadSftp.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/UploadSftp.php new file mode 100644 index 0000000000..11770c8f5e --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/UploadSftp.php @@ -0,0 +1,45 @@ +cert_id . ' ' . $this->config->id; + $this->command = $command; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomationFactory.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomationFactory.php new file mode 100644 index 0000000000..5c6b531777 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomationFactory.php @@ -0,0 +1,81 @@ +getNodeByReference(self::CONFIG_PATH . '.' . $uuid); + if ($obj == null) { + LeUtils::log_error("automation not found: ${uuid}"); + return null; + } + + // Convert to PascalCase, required to find the class name. + $auto_name = str_replace(' ', '', ucwords(str_replace(array('-', '_'), ' ', (string)$obj->type))); + + // Search class name + foreach (glob(__DIR__ . "/LeAutomation/*.php") as $filename) { + $file_found = basename($filename, '.php'); + try { + $reflClass = new \ReflectionClass("OPNsense\\AcmeClient\\LeAutomation\\{$file_found}"); + } catch (\ReflectionException $e) { + break; + } + if ($reflClass->implementsInterface('OPNsense\\AcmeClient\\LeAutomationInterface')) { + if ($file_found == $auto_name) { + // Create new object + $objAuto = $reflClass->newInstance(); + $objAuto->setUuid($uuid); + return $objAuto; + } + } + } + + LeUtils::log_error("automation not supported: " . (string)$obj->type . " (${uuid})"); + return null; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomationInterface.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomationInterface.php new file mode 100644 index 0000000000..6fb9b1f883 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomationInterface.php @@ -0,0 +1,43 @@ +uuid = $uuid; + $this->force = $force; + + // Get config object + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + + // Get account object to query ID + $account = new LeAccount((string)$this->config->account); + if (empty($account) || $account == null) { + LeUtils::log_error('unable to load account information: ' . (string)$this->config->account); + return false; + } + + // Store auxiliary information (required to glue stuff together) + $this->account_id = (string)$account->getId(); + $this->account_uuid = (string)$account->getUuid(); + + // Set log level + $this->setLoglevel(); + + // Set Let's Encrypt environment + $this->setEnvironment(); + + // Handle special key types + if ($this->config->keyLength == 'key_ec256' || $this->config->keyLength == 'key_ec384') { + // Pass --ecc to acme client to locate the correct cert directory + $this->acme_args[] = '--ecc'; + } + + // Store cert filenames + $this->cert_file = (string)sprintf(self::ACME_CERT_FILE, $this->config->id); + $this->cert_key_file = (string)sprintf(self::ACME_KEY_FILE, $this->config->id); + $this->cert_chain_file = (string)sprintf(self::ACME_CHAIN_FILE, $this->config->id); + $this->cert_fullchain_file = (string)sprintf(self::ACME_FULLCHAIN_FILE, $this->config->id); + + // Store acme filenames + $this->acme_args[] = '--home ' . self::ACME_HOME_DIR; + $this->acme_args[] = '--certpath ' . $this->cert_file; + $this->acme_args[] = '--keypath ' . $this->cert_key_file; + $this->acme_args[] = '--capath ' . $this->cert_chain_file; + $this->acme_args[] = '--fullchainpath ' . $this->cert_fullchain_file; + } + + /** + * Import the certificate into OPNsense's trust storage. + * @param bool $skip_validation try to import even if some checks fail + * @return bool + */ + public function import(bool $skip_validation = false) + { + if (!($this->isEnabled())) { + LeUtils::log("ignoring disabled certificate: " . (string)$this->config->name); + return false; + } + + // Cannot import if certificate was not issued yet. + // NOTE: When the certificate was just issued, then the cert status + // does not reflect this yet and must be ignored by setting $skip_validation. + if (!($this->isIssued()) && !($skip_validation)) { + LeUtils::log('ignoring import request for certificate ' . (string)$this->config->name . ' (not issued or revoked)'); + return false; + } + + // Reload to get most recent config + Config::getInstance()->forceReload(); + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + + // Check if certificate files can be found + clearstatcache(); // don't let the cache fool us + foreach (array($this->cert_file, $this->cert_key_file, $this->cert_chain_file, $this->cert_fullchain_file) as $file) { + if (!is_file($file)) { + LeUtils::log_error("unable to import certificate " . $this->config->name . ", file not found: ${file}"); + Config::getInstance()->unlock(); + return false; + } + } + + /** + * Step 1: import CA + */ + + // Read contents from CA file + $ca_content = @file_get_contents($this->cert_chain_file); + if ($ca_content != false) { + $ca_subject = cert_get_subject($ca_content, false); + $ca_serial = cert_get_serial($ca_content, false); + $ca_cn = LeUtils::local_cert_get_cn($ca_content, false); + $ca_issuer = cert_get_issuer($ca_content, false); + $ca_purpose = cert_get_purpose($ca_content, false); + } else { + LeUtils::log_error('unable to read CA certificate content from file'); + Config::getInstance()->unlock(); + return false; + } + + // Prepare CA for import in Cert Manager + $ca = array(); + $ca['crt'] = base64_encode($ca_content); + $ca['refid'] = uniqid(); + $ca_found = false; + + // Check if CA was previously imported + foreach (Config::getInstance()->object()->ca as $cacrt) { + $cacrt_subject = cert_get_subject($cacrt->crt, true); + $cacrt_issuer = cert_get_issuer($cacrt->crt, true); + if (($ca_subject == $cacrt_subject) and ($ca_issuer == $cacrt_issuer)) { + // Use old refid instead of generating a new one + $ca['refid'] = (string)$cacrt->refid; + $ca_found = true; + break; + } + } + + // Collect required CA information + $ca_cn = LeUtils::local_cert_get_cn($ca_content, false); + $ca['descr'] = (string)$ca_cn . ' (Let\'s Encrypt)'; + + // Prepare CA for import + LeUtils::local_ca_import($ca, $ca_content); + + // Check if CA was found in config + if ($ca_found == true) { + // Update existing CA + foreach (Config::getInstance()->object()->ca as $cacrt) { + if ((string)$cacrt->refid == $ca['refid']) { + $cacrt->crt = $ca['crt']; + $cacrt->descr = $ca['descr']; + break; + } + } + } else { + // Create new CA + LeUtils::log("importing Let's Encrypt CA: ${ca_cn}"); + $newca = Config::getInstance()->object()->addChild('ca'); + foreach (array_keys($ca) as $cacfg) { + $newca->addChild($cacfg, (string)$ca[$cacfg]); + } + } + + /** + * Step 2: import certificate + */ + + // Read contents from certificate file + $cert_content = @file_get_contents($this->cert_file); + if ($cert_content != false) { + $cert_subject = cert_get_subject($cert_content, false); + $cert_serial = cert_get_serial($cert_content, false); + $cert_cn = LeUtils::local_cert_get_cn($cert_content, false); + $cert_issuer = cert_get_issuer($cert_content, false); + $cert_purpose = cert_get_purpose($cert_content, false); + } else { + LeUtils::log_error('unable to read certificate content from file'); + Config::getInstance()->unlock(); + $this->setStatus(500); + return false; + } + + // Prepare certificate for import in Cert Manager + $cert = array(); + $cert_refid = uniqid(); + $cert['refid'] = $cert_refid; + $cert['caref'] = (string)$ca['refid']; + $import_log_message = 'imported'; + $cert_found = false; + + // Check if cert was previously imported + if (!empty((string)$this->config->certRefId)) { + // Check if the previously imported certificate can still be found + foreach (Config::getInstance()->object()->ca as $cfgCert) { + // Check if IDs match + if ((string)$this->config->certRefId == (string)$cfgCert->refid) { + $cert_found = true; + break; + } + } + // Existing cert? + if ($cert_found) { + // Use old refid instead of generating a new one + $cert_refid = (string)$this->config->certRefId; + $import_log_message = 'updated'; + } + } else { + // Not found. Just import as new cert. + } + + // Read private key + $key_content = @file_get_contents($this->cert_key_file); + if ($key_content == false) { + LeUtils::log_error('unable to read private key from file: ' . $this->cert_key_file); + Config::getInstance()->unlock(); + $this->setStatus(500); + return false; + } + + // Collect required cert information + $cert_cn = LeUtils::local_cert_get_cn($cert_content, false); + $cert['descr'] = (string)$cert_cn . ' (Let\'s Encrypt)'; + $cert['refid'] = $cert_refid; + + // Prepare certificate for import + cert_import($cert, $cert_content, $key_content); + + // Check if cert was found in config + if ($cert_found == true) { + // Update existing cert + foreach (Config::getInstance()->object()->cert as $cfgCert) { + if ((string)$cfgCert->refid == $cert['refid']) { + $cfgCert->crt = $cert['crt']; + $cfgCert->prv = $cert['prv']; + $cfgCert->descr = $cert['descr']; + break; + } + } + } else { + // Create new cert + $newcert = Config::getInstance()->object()->addChild('cert'); + foreach (array_keys($cert) as $certcfg) { + $newcert->addChild($certcfg, (string)$cert[$certcfg]); + } + } + LeUtils::log("${import_log_message} Let's Encrypt X.509 certificate: ${cert_cn}"); + + /** + * Step 3: update configuration + */ + + // Add refid to certObj + $this->config->certRefId = $cert_refid; + // Set update/create time + $this->config->lastUpdate = time(); + + // Serialize to config and save + $this->model->serializeToConfig(); + Config::getInstance()->save(); + + // Reload to get most recent config + Config::getInstance()->forceReload(); + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + + return true; + } + + /** + * check if certificate is already issued by Let's Encrypt + * @return bool + */ + public function isIssued() + { + return (string)$this->config->statusCode == 200 ? true : false; + } + + /** + * issue or renew the certificate + * @return bool + */ + public function issue() + { + if (!($this->isEnabled())) { + LeUtils::log('ignoring disabled certificate: ' . (string)$this->config->name); + return false; + } + + // Issue or renew? + if (!empty((string)$this->config->lastUpdate) and !($this->force)) { + $acme_action = "renew"; + $renew = true; + } else { + // Default: Issue a new certificate. + // If "force" is specified, forcefully re-issue the cert, no matter if it's required. + // NOTE: This is useful when switching from acme staging to production servers. + $acme_action = "issue"; + $renew = false; + } + + // Decide whether or not to continue. + if (!($this->needsRenewal()) and !($this->force)) { + // Renewal not required. Do nothing. + LeUtils::log("issue/renewal not required for certificate: " . (string)$this->config->name); + return false; + } + LeUtils::log("${acme_action} certificate: " . (string)$this->config->name); + + // Ensure that account is registered. + if (!($this->setAccount())) { + return false; + } + + // Setup ACME environment for this certificate. + $certdir = (string)sprintf(self::ACME_CERT_DIR, (string)$this->config->id); + $keydir = (string)sprintf(self::ACME_KEY_DIR, (string)$this->config->id); + $configdir = (string)sprintf(self::ACME_CONFIG_DIR, (string)$this->config->id); + foreach (array($certdir, $keydir, $configdir) as $dir) { + if (!is_dir($dir)) { + LeUtils::log_debug("creating directory: ${dir}", $this->debug); + mkdir($dir, 0700, true); + } + } + + // Perform preparation tasks + if (!($this->setValidation())) { + $this->setStatus(300); + return false; // validation method is invalid + } + + // Let's start certificate validation... + if ($this->validation->run($renew)) { + LeUtils::log('successfully issued/renewed certificate: ' . (string)$this->config->name); + } else { + LeUtils::log_error('validation for certificate failed: ' . (string)$this->config->name); + $this->setStatus(400); + return false; + } + + // Import certificate. + if (!($this->import(true))) { + LeUtils::log_error('failed to import certificate: ' . (string)$this->config->name); + $this->setStatus(500); + return false; + } + + // Run referenced automations. + $this->runAutomations(); + + // Update cert status. + $this->setStatus(200); + + return true; + } + + /** + * calculate next renewal date for this certificate + * @return bool + */ + public function needsRenewal() + { + $return = false; + + // Collect required information + $last_update = !empty((string)$this->config->lastUpdate) ? (string)$this->config->lastUpdate : 0; + $current_time = new \DateTime(); + $last_update_time = new \DateTime(); + $last_update_time->setTimestamp($last_update); + $renew_interval = (string)$this->config->renewInterval; + $next_update = $last_update_time->add(new \DateInterval('P' . $renew_interval . 'D')); + + // Do the math + if ($current_time >= $next_update) { + LeUtils::log('certificate must be issued/renewed: ' . (string)$this->config->name); + $return = true; + } + + return $return; + } + + /** + * completely remove the certificate and all related configuration from filesystem + * @return bool + */ + public function remove() + { + // NOTE: + // Removal is allowed even if the cert is disabled. + + // Cannot remove if certificate was not issued yet. + if (empty((string)$this->config->lastUpdate)) { + LeUtils::log('ignoring removal request for certificate ' . (string)$this->config->name . ' (not issued yet)'); + return false; + } + LeUtils::log('wiping certificate config: ' . (string)$this->config->name); + + // Preparation to run acme client + $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env['PATH'] = $this::ACME_ENV_PATH; + $proc_desc = array( // descriptor array for proc_open() + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stdout + 2 => array("pipe", "w") // stderr + ); + $proc_pipes = array(); + + // Run acme client to remove certificate and related config + $acmecmd = '/usr/local/sbin/acme.sh ' + . '--remove ' + . implode(' ', $this->acme_args) . ' ' + . '--domain ' . (string)$this->config->name; + LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); + $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); + + // Make sure the resource could be setup properly + if (is_resource($proc)) { + // Close all pipes + fclose($proc_pipes[0]); + fclose($proc_pipes[1]); + fclose($proc_pipes[2]); + // Get exit code + $result = proc_close($proc); + } else { + LeUtils::log_error('unable to start acme client process'); + return false; + } + + // Check exit code + if ($result) { + LeUtils::log_error('error removing certificate ' . (string)$this->config->name); + return false; + } + + // Remove all certificate files (just to be sure) + // NOTE: This also resets the cert status. + $this->reset(); + + return true; + } + + /** + * reset the certificate by removing only it's private key and the signed certificate + * @return bool + */ + public function reset() + { + // NOTE: Reset is allowed even if the cert is disabled. + LeUtils::log('removing certificate files: ' . (string)$this->config->name); + $cert_files = [ + $this->cert_file, + $this->cert_key_file, + $this->cert_chain_file, + $this->cert_fullchain_file, + ]; + foreach ($cert_files as $_file) { + if (file_exists($_file)) { + unlink($_file); + } + } + + // Reset cert status + $this->setStatus(100); + return true; + } + + /** + * revoke the certificate + * @return bool + */ + public function revoke() + { + // NOTE: Revocation is allowed even if the cert is disabled. + + // Revocation will fail if additional domain names were added + // to the certificate after issue/renewal. + + // Cannot revoke if certificate was not issued yet. + if (!($this->isIssued())) { + LeUtils::log('ignoring revocation request for certificate ' . (string)$this->config->name . ' (not issued yet)'); + return false; + } + LeUtils::log('revoking certificate: ' . (string)$this->config->name); + + // Collect account information + $account_conf_dir = self::ACME_BASE_ACCOUNT_DIR . '/' . $this->account_id . '_' . $this->environment; + $account_conf_file = $account_conf_dir . '/account.conf'; + + // Preparation to run acme client + $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env['PATH'] = $this::ACME_ENV_PATH; + $proc_desc = array( // descriptor array for proc_open() + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stdout + 2 => array("pipe", "w") // stderr + ); + $proc_pipes = array(); + + // Run acme client to revoke certificate + $acmecmd = '/usr/local/sbin/acme.sh ' + . '--revoke ' + . implode(' ', $this->acme_args) . ' ' + . '--domain ' . (string)$this->config->name . ' ' + . "--accountconf ${account_conf_file}"; + LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); + $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); + + // Make sure the resource could be setup properly + if (is_resource($proc)) { + // Close all pipes + fclose($proc_pipes[0]); + fclose($proc_pipes[1]); + fclose($proc_pipes[2]); + // Get exit code + $result = proc_close($proc); + } else { + LeUtils::log_error('unable to start acme client process'); + return false; + } + + // Check exit code + if ($result) { + LeUtils::log_error('failed to revoke certificate ' . (string)$this->config->name); + $this->setStatus(400); + return false; + } + LeUtils::log('successfully revoked certificate: ' . (string)$this->config->name); + + // Reset cert status + $this->setStatus(250); + return true; + } + + /** + * run all automations for this certificate + * @return bool + */ + public function runAutomations() + { + if (!($this->isEnabled())) { + LeUtils::log('ignoring disabled certificate: ' . (string)$this->config->name); + return false; + } + + // Check if any automations are configured for this cert + if (empty((string)$this->config->restartActions)) { + return true; // no automations, no error + } + + // Walk through all linked automations. + LeUtils::log('running automations for certificate: ' . (string)$this->config->name); + $automations = explode(',', (string)$this->config->restartActions); + foreach ($automations as $auto_uuid) { + $autoFactory = new LeAutomationFactory(); + $automation = $autoFactory->getAutomation($auto_uuid); + $automation->init($this->getId(), (string)$this->config->account); + // Ignore invalid automations. + if ($automation->prepare()) { + $automation->run(); + } + } + + return true; + } + + /** + * configure and register the referenced account + * @return bool + */ + public function setAccount() + { + // Ensure that account is registered. + $account = new LeAccount((string)$this->config->account); + if (empty($account)) { + $this->setStatus(300); // update cert status + return false; // account invalid or it was deleted + } elseif (!($account->isRegistered())) { + $account->generateKey(); + if (!($account->register())) { + $this->setStatus(400); // update cert status + return false; // account registration failed + } + // Refresh config objects, account may have modified the configuration. + Config::getInstance()->forceReload(); + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + } + LeUtils::log('account is registered: ' . (string)$account->config->name); + return true; + } + + /** + * configure the validation method + * @return bool + */ + public function setValidation() + { + if (empty((string)$this->validation)) { + // Setup new validation object + $valFactory = new LeValidationFactory(); + $val = $valFactory->getValidation((string)$this->config->validationMethod); + if (!isset($val) or empty($val)) { + LeUtils::log_error('invalid challenge type for certificate: ' . (string)$this->config->name); + return false; + } + if (!$val->init((string)$this->config->id, (string)$this->config->account)) { + LeUtils::log_error('failed to initialize validation for certificate: ' . (string)$this->config->name); + return false; + } + + // Configure validation object + $val->setNames($this->config->name, $this->config->altNames); + $val->setRenewal((int)$this->config->renewInterval); + $val->setForce($this->force); + // strip prefix from key value + $val->setKey(substr($this->config->keyLength, 4)); + $val->prepare(); + + // Store validation object + $this->validation = $val; + } + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php new file mode 100644 index 0000000000..3ae1da0218 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php @@ -0,0 +1,214 @@ +config->id; + } + + /** + * get UUID from auxiliary configuration object + * @return string + */ + public function getUuid() + { + return (string)$this->config->uuid; + } + + /** + * load config object from configuration + * @return bool + */ + public function loadConfig(string $path, string $uuid) + { + // Get config object + $model = new \OPNsense\AcmeClient\AcmeClient(); + $obj = $model->getNodeByReference("${path}.${uuid}"); + if ($obj == null) { + LeUtils::log_error("config of type ${path} not found: ${uuid}"); + return false; + } + // Store config objects + $this->config = $obj; + $this->model = $model; + return true; + } + + /** + * check if object is enabled in configuration + * @return bool + */ + public function isEnabled() + { + return (string)$this->config->enabled == 1 ? true : false; + } + + /** + * set Let's Encrypt environment for acme.sh + */ + public function setEnvironment() + { + $this->environment = (string)$this->model->getNodeByReference('settings.environment'); + $this->acme_args[] = $this->environment == 'stg' ? '--staging' : null; + } + + /** + * set log level for acme.sh and configure optional debug logging + */ + public function setLoglevel() + { + $loglevel = (string)$this->model->getNodeByReference('settings.logLevel'); + + switch ($loglevel) { + case 'extended': + $this->acme_args[] = '--log-level 2'; + $this->debug = false; + break; + case 'debug': + $this->acme_args[] = '--debug'; + $this->debug = true; + break; + case 'debug2': + $this->acme_args[] = '--debug 2'; + $this->debug = true; + break; + case 'debug3': + $this->acme_args[] = '--debug 3'; + $this->debug = true; + break; + default: + $this->acme_args[] = '--log-level 1'; + $this->debug = false; + break; + } + } + + /** + * update status information to reflect the result of the last operation + * Supported status codes are: + * 100 pending + * 200 cert issued / acct registered + * 250 cert revoked / acct deactivated + * 300 configuration error + * 400 issue/renew/registration failed + * 500 internal error (code issues, bad luck, unexpected errors, ...) + * Feel free to add more status codes to support new use-cases. + * @return bool + */ + public function setStatus(int $statusCode) + { + // Update attributes. + $this->config->statusCode = $statusCode; + $this->config->statusLastUpdate = time(); + + // Serialize to config and save + Config::getInstance()->unlock(); + $this->model->serializeToConfig(); + Config::getInstance()->save(); + + // Reload to get most recent config + Config::getInstance()->forceReload(); + $this->loadConfig($this::CONFIG_PATH, $this->uuid); + + return true; + } + + /** + * set UUID of auxiliary configuration object + */ + public function setUuid(string $uuid) + { + $this->uuid = $uuid; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php new file mode 100644 index 0000000000..dd5ce0ff39 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php @@ -0,0 +1,189 @@ + + * Copyright (C) 2008 Shrew Soft Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\AcmeClient; + +use OPNsense\Core\Config; + +/** + * Helper functions for LeAcme + * @package OPNsense\AcmeClient + */ +class LeUtils +{ + public static function base64url_decode($str) + { + return base64_decode(str_pad(strtr($str, '-_', '+/'), strlen($str) % 4, '=', STR_PAD_RIGHT)); + } + + public static function base64url_encode($str) + { + return rtrim(strtr(base64_encode($str), '+/', '-_'), '='); + } + + // Copied from system_camanager.php. + public static function local_ca_import(&$ca, $str, $key = "", $serial = 0) + { + // Get config object. + $config = Config::getInstance()->object(); + + $ca['crt'] = base64_encode($str); + if (!empty($key)) { + $ca['prv'] = base64_encode($key); + } + if (!empty($serial)) { + $ca['serial'] = $serial; + } + $subject = cert_get_subject($str, false); + $issuer = cert_get_issuer($str, false); + + // Find my issuer unless self-signed + if ($issuer != $subject) { + $issuer_crt =& lookup_ca_by_subject($issuer); + if ($issuer_crt) { + $ca['caref'] = $issuer_crt['refid']; + } + } + + /* Correct if child certificate was loaded first */ + if (is_array($config['ca'])) { + foreach ($config['ca'] as & $oca) { + $issuer = cert_get_issuer($oca['crt']); + if ($ca['refid'] != $oca['refid'] && $issuer == $subject) { + $oca['caref'] = $ca['refid']; + } + } + } + if (is_array($config['cert'])) { + foreach ($config['cert'] as & $cert) { + $issuer = cert_get_issuer($cert['crt']); + if ($issuer == $subject) { + $cert['caref'] = $ca['refid']; + } + } + } + return true; + } + + // copied from certs.inc + public static function local_cert_get_cn($crt, $decode = true) + { + $sub = self::local_cert_get_subject_array($crt, $decode); + if (is_array($sub)) { + foreach ($sub as $s) { + if (strtoupper($s['a']) == "CN") { + return $s['v']; + } + } + } + return ""; + } + + // copied from certs.inc + public static function local_cert_get_subject_array($str_crt, $decode = true) + { + if ($decode) { + $str_crt = base64_decode($str_crt); + } + $inf_crt = openssl_x509_parse($str_crt); + $components = $inf_crt['subject']; + + if (!is_array($components)) { + return; + } + + $subject_array = array(); + + foreach ($components as $a => $v) { + $subject_array[] = array('a' => $a, 'v' => $v); + } + + return $subject_array; + } + + /** + * log runtime information + */ + public static function log($msg) + { + syslog(LOG_NOTICE, "AcmeClient: ${msg}"); + } + + /** + * log additional debug output + */ + public static function log_debug($msg, bool $debug = false) + { + if ($debug) { + syslog(LOG_NOTICE, "AcmeClient: ${msg}"); + } + } + + /** + * log error messages + */ + public static function log_error($msg) + { + syslog(LOG_ERR, "AcmeClient: ${msg}"); + } + + /** + * run arbitrary shell commands and log the result + * @param $proc_cmd string the command that should be run + * @param $proc_env array optional environment variables that should be used + * @return bool + */ + public static function run_shell_command($proc_cmd, $proc_env = array()) + { + $proc_desc = array( // descriptor array for proc_open() + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stdout + 2 => array("pipe", "w") // stderr + ); + $proc_pipes = array(); + $proc = proc_open($proc_cmd, $proc_desc, $proc_pipes, null, $proc_env); + + // Make sure the resource could be setup properly + if (is_resource($proc)) { + // Close all pipes + fclose($proc_pipes[0]); + fclose($proc_pipes[1]); + fclose($proc_pipes[2]); + // Get exit code + $result = proc_close($proc); + log_error(sprintf("AcmeClient: The shell command '%s' returned exit code '%d'", $proc_cmd, $result)); + return($result); + } else { + log_error(sprintf("AcmeClient: Unable to prepare shell command '%s'", $proc_cmd)); + return false; + } + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php new file mode 100644 index 0000000000..d47d5e73cd --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php @@ -0,0 +1,298 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\AcmeClient\LeValidation; + +use OPNsense\Core\Config; +use OPNsense\AcmeClient\LeAccount; +use OPNsense\AcmeClient\LeUtils; + +/** + * LeValidation stub file, contains shared logic for all validation methods. + * @package OPNsense\AcmeClient + */ +abstract class Base extends \OPNsense\AcmeClient\LeCommon +{ + public const CONFIG_PATH = 'validations.validation'; + + /** + * The validation method cannot be properly initialized without the required + * configuration. LeValidation returns a more or less uninitialized object + * that first needs to be configured, and finally initialized by this function. + * @param $certid string the ID of the certificate object + * @param $accountuuid string the UUID of the account object + * @return bool + */ + public function init(string $certid, string $accountuuid) + { + // Get config object + $this->loadConfig(self::CONFIG_PATH, $this->uuid); + + // Get account object to query ID + $account = new LeAccount($accountuuid); + if (empty($account) || $account == null) { + LeUtils::log_error("unable to load account information: ${accountuuid}"); + return false; + } + + // Store auxiliary information (required to glue stuff together) + $this->cert_id = $certid; + $this->account_id = (string)$account->getId(); + $this->account_uuid = (string)$account->getUuid(); + + // Teach acme.sh about DNS API hook location + $this->acme_env['_SCRIPT_HOME'] = '/usr/local/share/examples/acme.sh'; + + // Set log level + $this->setLoglevel(); + + // Set Let's Encrypt environment + $this->setEnvironment(); + + // Store acme hook + switch ((string)$this->config->method) { + case 'dns01': + $this->acme_args[] = '--dns ' . (string)$this->config->dns_service; + $this->acme_args[] = '--dnssleep ' . (string)$this->config->dns_sleep; + break; + case 'http01': + $this->acme_args[] = '--webroot /var/etc/acme-client/challenges'; + break; + } + + // Store acme filenames + $this->acme_args[] = '--home ' . self::ACME_HOME_DIR; + $this->acme_args[] = '--certpath ' . sprintf(self::ACME_CERT_FILE, $this->cert_id); + $this->acme_args[] = '--keypath ' . sprintf(self::ACME_KEY_FILE, $this->cert_id); + $this->acme_args[] = '--capath ' . sprintf(self::ACME_CHAIN_FILE, $this->cert_id); + $this->acme_args[] = '--fullchainpath ' . sprintf(self::ACME_FULLCHAIN_FILE, $this->cert_id); + + return true; + } + + /** + * cleanup tasks that should run after performing the certificate validation + * @return bool + */ + public function cleanup() + { + // Dummy; no default cleanup tasks. + return true; + } + + /** + * get the configured validation method (HTTP-01 or DNS-01) + * @return string validation method + */ + public function getMethod() + { + return $this->config->method; + } + + /** + * perform preparation tasks and run acme client + * @param $renew optional parameter to specify if a renewal is required + * @return bool + */ + public function run(bool $renew = false) + { + if (!($this->isEnabled())) { + LeUtils::log('ignoring disabled challenge type: ' . (string)$this->config->name); + return false; + } + + LeUtils::log('using challenge type: ' . (string)$this->config->name); + + // Issue or renew + $acme_action = $renew == true ? 'renew' : 'issue'; + + // Handle special key types + if ($this->cert_keylength == 'ec256' || $this->cert_keylength == 'ec384') { + if ($renew == true) { + // If it's a renew then pass --ecc to acme client to locate the correct cert directory + $acme_args[] = '--ecc'; + } + } + + // Use individual account config for each environment + $account_conf_dir = self::ACME_BASE_ACCOUNT_DIR . '/' . $this->account_id . '_' . $this->environment; + $account_conf_file = $account_conf_dir . '/account.conf'; + + // Preparation to run acme client + $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env['PATH'] = $this::ACME_ENV_PATH; + $proc_desc = array( // descriptor array for proc_open() + 0 => array("pipe", "r"), // stdin + 1 => array("pipe", "w"), // stdout + 2 => array("pipe", "w") // stderr + ); + $proc_pipes = array(); + + // Run acme client + // NOTE: We "export" certificates to our own directory, so we don't have to deal + // with domain names in filesystem, but instead can use the ID of our certObj, which + // will never change. + $acmecmd = '/usr/local/sbin/acme.sh ' + . "--${acme_action} " + . implode(' ', $this->acme_args) . ' ' + . "--accountconf ${account_conf_file}"; + LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); + $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); + + // Make sure the resource could be setup properly + if (is_resource($proc)) { + // Close all pipes + fclose($proc_pipes[0]); + fclose($proc_pipes[1]); + fclose($proc_pipes[2]); + // Get exit code + $result = proc_close($proc); + } else { + LeUtils::log_error('unable to start acme client process'); + return false; + } + + // Run optional cleanup tasks. + $this->cleanup(); + + // Check validation result + if ($result) { + LeUtils::log_error('domain validation failed (' . $this->getMethod() . ')'); + return false; + } + + return true; + } + + /** + * add config to force certificate renewal + * @param $force bool indicate whether force should be enabled or not + */ + public function setForce(bool $force = false) + { + $this->acme_args[] = $force == true ? '--force' : null; + } + + /** + * set key length + * @param $length key length + */ + public function setKey(string $length = '4096') + { + if ($length == 'ec256' || $length == 'ec384') { + $key_length = substr_replace($length, '-', 2, 0); + } else { + $key_length = $length; + } + + $this->acme_args[] = '--keylength ' . $key_length; + $this->cert_keylength = $length; + } + + /** + * configure certificate common name, altNames and DNS alias mode + */ + public function setNames(string $certname, string $altnames = '', string $aliasmode = '', string $domainalias = '', string $challengealias = '') + { + // Store basic certificate information + $this->cert_name = $certname; + $this->cert_altnames = $altnames; + $this->cert_aliasmode = $aliasmode; + $this->cert_domainalias = $domainalias; + $this->cert_challengealias = $challengealias; + + // Main domain for acme + $this->acme_args[] = '--domain ' . $certname; + + // Main domain: Use DNS alias mode for domain validation? + // https://github.com/Neilpang/acme.sh/wiki/DNS-alias-mode + if ($this->getMethod() == 'dns01') { + switch ((string)$aliasmode) { + case 'automatic': + $name = '_acme-challenge.' . ltrim((string)$this->cert_name, '*.'); + if ($dst = dns_get_record($name, DNS_CNAME)) { + $this->acme_args[] = '--domain-alias ' . $dst[0]['target']; + } + break; + case 'domain': + $this->acme_args[] = '--domain-alias ' . (string)$this->cert_domainalias; + break; + case 'challenge': + $this->acme_args[] = '--challenge-alias ' . (string)$this->cert_challengealias; + break; + } + } + + // altNames + if (!empty((string)$this->cert_altnames)) { + foreach (explode(",", (string)$this->cert_altnames) as $altname) { + $this->acme_args[] = "--domain ${altname}"; + + // altNames: Use DNS alias mode for domain validation? + // https://github.com/Neilpang/acme.sh/wiki/DNS-alias-mode + if ($this->getMethod() == 'dns01') { + switch ((string)$this->cert_aliasmode) { + case 'automatic': + $name = "_acme-challenge." . ltrim($altname, '*.'); + if ($dst = dns_get_record($name, DNS_CNAME)) { + $this->acme_args[] = '--domain-alias ' . $dst[0]['target']; + } + break; + case 'domain': + $this->acme_args[] = '--domain-alias ' . (string)$this->cert_domainalias; + break; + case 'challenge': + $this->acme_args[] = '--challenge-alias ' . (string)$this->cert_challengealias; + break; + } + } + } + } + } + + /** + * enable OCSP extension + * @param $ocsp bool whether ocsp extension should be enabled or not + */ + public function setOcsp(bool $ocsp = false) + { + // if OCSP extension is turned on pass --ocsp parameter to acme client + $this->acme_args[] = $ocsp == true ? '--ocsp' : null; + } + + /** + * set renewal interval + * @param $interval int specifies the renewal interval in days + */ + public function setRenewal(int $interval = 60) + { + $this->acme_args[] = '--days ' . (string)$interval; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Dns1984hosting.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Dns1984hosting.php new file mode 100644 index 0000000000..9569797ac6 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Dns1984hosting.php @@ -0,0 +1,45 @@ +acme_env['One984HOSTING_Username'] = (string)$this->config->dns_1984hosting_user; + $this->acme_env['One984HOSTING_Password'] = (string)$this->config->dns_1984hosting_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmedns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmedns.php new file mode 100644 index 0000000000..4ccefe4e3e --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmedns.php @@ -0,0 +1,47 @@ +acme_env['ACMEDNS_USERNAME'] = (string)$this->config->dns_acmedns_user; + $this->acme_env['ACMEDNS_PASSWORD'] = (string)$this->config->dns_acmedns_password; + $this->acme_env['ACMEDNS_SUBDOMAIN'] = (string)$this->config->dns_acmedns_subdomain; + $this->acme_env['ACMEDNS_UPDATE_URL'] = (string)$this->config->dns_acmedns_updateurl; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmeproxy.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmeproxy.php new file mode 100644 index 0000000000..f2207332ad --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmeproxy.php @@ -0,0 +1,46 @@ +acme_env['ACMEPROXY_ENDPOINT'] = (string)$this->config->dns_acmeproxy_endpoint; + $this->acme_env['ACMEPROXY_USERNAME'] = (string)$this->config->dns_acmeproxy_username; + $this->acme_env['ACMEPROXY_PASSWORD'] = (string)$this->config->dns_acmeproxy_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAd.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAd.php new file mode 100644 index 0000000000..e468dadf6e --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAd.php @@ -0,0 +1,44 @@ +acme_env['AD_API_KEY'] = (string)$this->config->dns_ad_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAli.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAli.php new file mode 100644 index 0000000000..357757c6be --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAli.php @@ -0,0 +1,45 @@ +acme_env['Ali_Key'] = (string)$this->config->dns_ali_key; + $this->acme_env['Ali_Secret'] = (string)$this->config->dns_ali_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsArvan.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsArvan.php new file mode 100644 index 0000000000..786f2e3953 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsArvan.php @@ -0,0 +1,44 @@ +acme_env['Arvan_Token'] = (string)$this->config->dns_arvan_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAutodns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAutodns.php new file mode 100644 index 0000000000..597d737a30 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAutodns.php @@ -0,0 +1,46 @@ +acme_env['AUTODNS_USER'] = (string)$this->config->dns_autodns_user; + $this->acme_env['AUTODNS_PASSWORD'] = (string)$this->config->dns_autodns_password; + $this->acme_env['AUTODNS_CONTEXT'] = (string)$this->config->dns_autodns_context; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAws.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAws.php new file mode 100644 index 0000000000..c4e96479cc --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAws.php @@ -0,0 +1,45 @@ +acme_env['AWS_ACCESS_KEY_ID'] = (string)$this->config->dns_aws_id; + $this->acme_env['AWS_SECRET_ACCESS_KEY'] = (string)$this->config->dns_aws_secret; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAzure.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAzure.php new file mode 100644 index 0000000000..1b2acc9dcc --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAzure.php @@ -0,0 +1,47 @@ +acme_env['AZUREDNS_SUBSCRIPTIONID'] = (string)$this->config->dns_azuredns_subscriptionid; + $this->acme_env['AZUREDNS_TENANTID'] = (string)$this->config->dns_azuredns_tenantid; + $this->acme_env['AZUREDNS_APPID'] = (string)$this->config->dns_azuredns_appid; + $this->acme_env['AZUREDNS_CLIENTSECRET'] = (string)$this->config->dns_azuredns_clientsecret; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php new file mode 100644 index 0000000000..3f6f735e01 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php @@ -0,0 +1,49 @@ +acme_env['CF_Key'] = (string)$this->config->dns_cf_key; + $this->acme_env['CF_Email'] = (string)$this->config->dns_cf_email; + // Restricted API token (recommended) + $this->acme_env['CF_Token'] = (string)$this->config->dns_cf_token; + $this->acme_env['CF_Account_ID'] = (string)$this->config->dns_cf_account_id; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCloudns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCloudns.php new file mode 100644 index 0000000000..fcd5b66257 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCloudns.php @@ -0,0 +1,46 @@ +acme_env['CLOUDNS_AUTH_ID'] = (string)$this->config->dns_cloudns_auth_id; + $this->acme_env['CLOUDNS_SUB_AUTH_ID'] = (string)$this->config->dns_cloudns_sub_auth_id; + $this->acme_env['CLOUDNS_AUTH_PASSWORD'] = (string)$this->config->dns_cloudns_auth_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCn.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCn.php new file mode 100644 index 0000000000..93706440b9 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCn.php @@ -0,0 +1,45 @@ +acme_env['CN_User'] = (string)$this->config->dns_cn_user; + $this->acme_env['CN_Password'] = (string)$this->config->dns_cn_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCx.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCx.php new file mode 100644 index 0000000000..c81e7b0c0b --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCx.php @@ -0,0 +1,45 @@ +acme_env['CX_Key'] = (string)$this->config->dns_cx_key; + $this->acme_env['CX_Secret'] = (string)$this->config->dns_cx_secret; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCyon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCyon.php new file mode 100644 index 0000000000..ed753b90ec --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCyon.php @@ -0,0 +1,45 @@ +acme_env['CY_Username'] = (string)$this->config->dns_cyon_user; + $this->acme_env['CY_Password'] = (string)$this->config->dns_cyon_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDa.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDa.php new file mode 100644 index 0000000000..9f6600c42f --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDa.php @@ -0,0 +1,45 @@ +acme_env['DA_Api'] = (string)$this->config->dns_da_key; + $this->acme_env['DA_Api_Insecure'] = (string)$this->config->dns_da_insecure; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDgon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDgon.php new file mode 100644 index 0000000000..d8039ccbab --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDgon.php @@ -0,0 +1,44 @@ +acme_env['DO_API_KEY'] = (string)$this->config->dns_dgon_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnsimple.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnsimple.php new file mode 100644 index 0000000000..e15c23d415 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnsimple.php @@ -0,0 +1,44 @@ +acme_env['DNSimple_OAUTH_TOKEN'] = (string)$this->config->dns_dnsimple_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDo.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDo.php new file mode 100644 index 0000000000..1afc8521cd --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDo.php @@ -0,0 +1,45 @@ +acme_env['DO_PID'] = (string)$this->config->dns_do_pid; + $this->acme_env['DO_PW'] = (string)$this->config->dns_do_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDoapi.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDoapi.php new file mode 100644 index 0000000000..9dd29d2eea --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDoapi.php @@ -0,0 +1,44 @@ +acme_env['DO_LETOKEN'] = (string)$this->config->dns_doapi_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDp.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDp.php new file mode 100644 index 0000000000..c118c2ecfe --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDp.php @@ -0,0 +1,45 @@ +acme_env['DP_Id'] = (string)$this->config->dns_dp_id; + $this->acme_env['DP_Key'] = (string)$this->config->dns_dp_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDreamhost.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDreamhost.php new file mode 100644 index 0000000000..9fd3e7750d --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDreamhost.php @@ -0,0 +1,44 @@ +acme_env['DH_API_KEY'] = (string)$this->config->dns_dh_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDuckdns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDuckdns.php new file mode 100644 index 0000000000..0bf4c174ba --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDuckdns.php @@ -0,0 +1,44 @@ +acme_env['DuckDNS_Token'] = (string)$this->config->dns_duckdns_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDyn.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDyn.php new file mode 100644 index 0000000000..d11e003d4c --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDyn.php @@ -0,0 +1,46 @@ +acme_env['DYN_Customer'] = (string)$this->config->dns_dyn_customer; + $this->acme_env['DYN_Username'] = (string)$this->config->dns_dyn_user; + $this->acme_env['DYN_Password'] = (string)$this->config->dns_dyn_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDynu.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDynu.php new file mode 100644 index 0000000000..7a24ebe701 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDynu.php @@ -0,0 +1,45 @@ +acme_env['Dynu_ClientId'] = (string)$this->config->dns_dynu_clientid; + $this->acme_env['Dynu_Secret'] = (string)$this->config->dns_dynu_secret; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEuserv.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEuserv.php new file mode 100644 index 0000000000..3dd2a82d96 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEuserv.php @@ -0,0 +1,46 @@ +acme_env['EUSERV_Username'] = (string)$this->config->dns_euserv_user; + $this->acme_env['EUSERV_Password'] = (string)$this->config->dns_euserv_password; + $this->acme_args[] = '--insecure'; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsFreedns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsFreedns.php new file mode 100644 index 0000000000..d7e4d5fe29 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsFreedns.php @@ -0,0 +1,45 @@ +acme_env['FREEDNS_User'] = (string)$this->config->dns_freedns_user; + $this->acme_env['FREEDNS_Password'] = (string)$this->config->dns_freedns_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php new file mode 100644 index 0000000000..afebc94825 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php @@ -0,0 +1,44 @@ +acme_env['GANDI_LIVEDNS_KEY'] = (string)$this->config->dns_gandi_livedns_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGcloud.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGcloud.php new file mode 100644 index 0000000000..045363b7c3 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGcloud.php @@ -0,0 +1,88 @@ +model->isPluginInstalled('google-cloud-sdk') != '1') { + LeUtils::log_error('Google Cloud SDK plugin is NOT installed. Please install os-google-cloud-sdk and try again.'); + return false; + } + + // A valid Google Cloud JSON key is required. + if (!empty((string)$this->config->dns_gcloud_key)) { + # Extract the gcloud project from the key data. + $_gcloud_data = json_decode((string)$this->config->dns_gcloud_key); + $gcloud_project = $_gcloud_data->project_id; + $gcloud_account = $_gcloud_data->client_email; + if (empty($gcloud_project)) { + LeUtils::log_error('unable to extract project name from Google Cloud DNS JSON key'); + return false; + } else { + LeUtils::log("Google Cloud DNS project name: ${gcloud_project}"); + } + } else { + LeUtils::log('no key for Google Cloud DNS was specified'); + return false; + } + + // Preparations to run gcloud CLI. + $val_id = (string)$this->config->id; + $gcloud_config = "acme-${val_id}"; + $gcloud_key_file = '/tmp/acme_' . (string)$this->config->dns_service . "_${val_id}.json"; + file_put_contents($gcloud_key_file, (string)$this->config->dns_gcloud_key); + chmod($gcloud_key_file, 0600); + $proc_env['CLOUDSDK_PYTHON'] = '/usr/local/bin/python3'; + $proc_env['CLOUDSDK_ACTIVE_CONFIG_NAME'] = $gcloud_config; + $proc_env['CLOUDSDK_CORE_PROJECT'] = $gcloud_project; + + // Ensure that a working gcloud config exists. + LeUtils::run_shell_command("/usr/local/bin/gcloud config configurations create ${gcloud_config}", $proc_env); + LeUtils::run_shell_command("/usr/local/bin/gcloud config configurations activate ${gcloud_config}", $proc_env); + LeUtils::run_shell_command("/usr/local/bin/gcloud auth activate-service-account --key-file=${gcloud_key_file}", $proc_env); + LeUtils::run_shell_command("/usr/local/bin/gcloud config set account ${gcloud_account}", $proc_env); + LeUtils::run_shell_command("/usr/local/bin/gcloud config set project ${gcloud_project}", $proc_env); + + // Save config for acme client. + $this->acme_env['CLOUDSDK_PYTHON'] = '/usr/local/bin/python3'; + $this->acme_env['CLOUDSDK_ACTIVE_CONFIG_NAME'] = $gcloud_config; + $this->acme_env['CLOUDSDK_CORE_PROJECT'] = $gcloud_project; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGd.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGd.php new file mode 100644 index 0000000000..64a5983d78 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGd.php @@ -0,0 +1,45 @@ +acme_env['GD_Key'] = (string)$this->config->dns_gd_key; + $this->acme_env['GD_Secret'] = (string)$this->config->dns_gd_secret; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGdnsdk.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGdnsdk.php new file mode 100644 index 0000000000..034eb168c9 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGdnsdk.php @@ -0,0 +1,45 @@ +acme_env['GDNSDK_Username'] = (string)$this->config->dns_gdnsdk_user; + $this->acme_env['GDNSDK_Password'] = (string)$this->config->dns_gdnsdk_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHe.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHe.php new file mode 100644 index 0000000000..17c17dc5bd --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHe.php @@ -0,0 +1,45 @@ +acme_env['HE_Username'] = (string)$this->config->dns_he_user; + $this->acme_env['HE_Password'] = (string)$this->config->dns_he_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHetzner.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHetzner.php new file mode 100644 index 0000000000..00f755e2a0 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHetzner.php @@ -0,0 +1,44 @@ +acme_env['HETZNER_Token'] = (string)$this->config->dns_hetzner_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHostingde.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHostingde.php new file mode 100644 index 0000000000..8b8b0f6d08 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHostingde.php @@ -0,0 +1,45 @@ +acme_env['HOSTINGDE_ENDPOINT'] = (string)$this->config->dns_hostingde_server; + $this->acme_env['HOSTINGDE_APIKEY'] = (string)$this->config->dns_hostingde_apiKey; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInfoblox.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInfoblox.php new file mode 100644 index 0000000000..7cef05a447 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInfoblox.php @@ -0,0 +1,45 @@ +acme_env['Infoblox_Creds'] = (string)$this->config->dns_infoblox_credentials; + $this->acme_env['Infoblox_Server'] = (string)$this->config->dns_infoblox_server; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInwx.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInwx.php new file mode 100644 index 0000000000..f4e0533fb6 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsInwx.php @@ -0,0 +1,45 @@ +acme_env['INWX_User'] = (string)$this->config->dns_inwx_user; + $this->acme_env['INWX_Password'] = (string)$this->config->dns_inws_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsIspconfig.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsIspconfig.php new file mode 100644 index 0000000000..ea5d8df203 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsIspconfig.php @@ -0,0 +1,47 @@ +acme_env['ISPC_User'] = (string)$this->config->dns_ispconfig_user; + $this->acme_env['ISPC_Password'] = (string)$this->config->dns_ispconfig_password; + $this->acme_env['ISPC_Api'] = (string)$this->config->dns_ispconfig_api; + $this->acme_env['ISPC_Api_Insecure'] = (string)$this->config->dns_ispconfig_insecure; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsJoker.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsJoker.php new file mode 100644 index 0000000000..da74585fbc --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsJoker.php @@ -0,0 +1,45 @@ +acme_env['JOKER_USERNAME'] = (string)$this->config->dns_joker_username; + $this->acme_env['JOKER_PASSWORD'] = (string)$this->config->dns_joker_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsKinghost.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsKinghost.php new file mode 100644 index 0000000000..d21df40ef7 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsKinghost.php @@ -0,0 +1,45 @@ +acme_env['KINGHOST_username'] = (string)$this->config->dns_kinghost_username; + $this->acme_env['KINGHOST_Password'] = (string)$this->config->dns_kinghost_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsKnot.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsKnot.php new file mode 100644 index 0000000000..a58c93ca1c --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsKnot.php @@ -0,0 +1,45 @@ +acme_env['KNOT_SERVER'] = (string)$this->config->dns_knot_server; + $this->acme_env['KNOT_KEY'] = (string)$this->config->dns_knot_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLeaseweb.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLeaseweb.php new file mode 100644 index 0000000000..967b3190e9 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLeaseweb.php @@ -0,0 +1,44 @@ +acme_env['LSW_Key'] = (string)$this->config->dns_leaseweb_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLexicon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLexicon.php new file mode 100644 index 0000000000..2ffc6d1ec4 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLexicon.php @@ -0,0 +1,55 @@ +config->dns_lexicon_provider; + $env_user = 'LEXICON_' . strtoupper($provider) . '_USERNAME'; + $env_token = 'LEXICON_' . strtoupper($provider) . '_TOKEN'; + + $this->acme_env['PROVIDER'] = $provider; + $this->acme_env[$env_user] = (string)$this->config->dns_lexicon_user; + $this->acme_env[$env_token] = (string)$this->config->dns_lexicon_token; + + if ((string)$this->config->dns_lexicon_provider == 'namesilo') { + // Namesilo applies changes to DNS records only every 15 minutes. + $this->acme_args[] = '--dnssleep 960'; + } + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinode.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinode.php new file mode 100644 index 0000000000..2b2453b8bd --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinode.php @@ -0,0 +1,46 @@ +acme_env['LINODE_API_KEY'] = (string)$this->config->dns_linode_key; + // Linode can take up to 15 to update DNS records + $this->acme_args[] = '--dnssleep 960'; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinodeV4.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinodeV4.php new file mode 100644 index 0000000000..c69293a243 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinodeV4.php @@ -0,0 +1,46 @@ +acme_env['LINODE_V4_API_KEY'] = (string)$this->config->dns_linode_v4_key; + // Linode can take up to 15 to update DNS records + $this->acme_args[] = '--dnssleep 960'; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLoopia.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLoopia.php new file mode 100644 index 0000000000..2c5affae53 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLoopia.php @@ -0,0 +1,46 @@ +acme_env['LOOPIA_Api'] = (string)$this->config->dns_loopia_api; + $this->acme_env['LOOPIA_User'] = (string)$this->config->dns_loopia_user; + $this->acme_env['LOOPIA_Password'] = (string)$this->config->dns_loopia_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLua.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLua.php new file mode 100644 index 0000000000..70d5419e5e --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLua.php @@ -0,0 +1,45 @@ +acme_env['LUA_Key'] = (string)$this->config->dns_lua_key; + $this->acme_env['LUA_Email'] = (string)$this->config->dns_lua_email; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMe.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMe.php new file mode 100644 index 0000000000..c177f24a21 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMe.php @@ -0,0 +1,45 @@ +acme_env['ME_Key'] = (string)$this->config->dns_me_key; + $this->acme_env['ME_Secret'] = (string)$this->config->dns_me_secret; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMiab.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMiab.php new file mode 100644 index 0000000000..f75b188fb2 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMiab.php @@ -0,0 +1,46 @@ +acme_env['MIAB_Username'] = (string)$this->config->dns_miab_user; + $this->acme_env['MIAB_Password'] = (string)$this->config->dns_miab_password; + $this->acme_env['MIAB_Server'] = (string)$this->config->dns_miab_server; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamecheap.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamecheap.php new file mode 100644 index 0000000000..5d252d3e98 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamecheap.php @@ -0,0 +1,51 @@ +acme_env['NAMECHEAP_USERNAME'] = (string)$this->config->dns_namecheap_user; + $this->acme_env['NAMECHEAP_API_KEY'] = (string)$this->config->dns_namecheap_api; + if (!empty((string)$this->config->dns_namecheap_sourceip)) { + $this->acme_env['NAMECHEAP_SOURCEIP'] = (string)$this->config->dns_namecheap_sourceip; + } else { + // Use a public service to get our source IP for Namecheap API + $this->acme_env['NAMECHEAP_SOURCEIP'] = 'https://ifconfig.co/ip'; + } + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamecom.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamecom.php new file mode 100644 index 0000000000..f011500b70 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamecom.php @@ -0,0 +1,45 @@ +acme_env['Namecom_Username'] = (string)$this->config->dns_namecom_user; + $this->acme_env['Namecom_Token'] = (string)$this->config->dns_namecom_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php new file mode 100644 index 0000000000..1cfa7f3267 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php @@ -0,0 +1,46 @@ +acme_env['Namesilo_Key'] = (string)$this->config->dns_namesilo_key; + // Namesilo applies changes to DNS records only every 15 minutes. + $this->acme_args[] = '--dnssleep 960'; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNetcup.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNetcup.php new file mode 100644 index 0000000000..b4afca6cb5 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNetcup.php @@ -0,0 +1,48 @@ +acme_env['NC_CID'] = (string)$this->config->dns_netcup_cid; + $this->acme_env['NC_Apikey'] = (string)$this->config->dns_netcup_key; + $this->acme_env['NC_Apipw'] = (string)$this->config->dns_netcup_pw; + // netcup applies changes to DNS records only every 10 minutes. + $this->acme_args[] = '--dnssleep 600'; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsone.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsone.php new file mode 100644 index 0000000000..c1df9f7adc --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsone.php @@ -0,0 +1,44 @@ +acme_env['NS1_Key'] = (string)$this->config->dns_nsone_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php new file mode 100644 index 0000000000..5fe117e5e5 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php @@ -0,0 +1,52 @@ +cert_uuid); + $secret_key_filename = "${configdir}/secret.key"; + $secret_key_data = (string)$this->config->dns_nsupdate_key . '\n'; + file_put_contents($secret_key_filename, $secret_key_data); + + // Add env variables + $this->acme_env['NSUPDATE_KEY'] = $secret_key_filename; + $this->acme_env['NSUPDATE_SERVER'] = (string)$this->config->dns_nsupdate_server; + $this->acme_env['NSUPDATE_ZONE'] = (string)$this->config->dns_nsupdate_zone; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOpnsense.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOpnsense.php new file mode 100644 index 0000000000..fcb33a7026 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOpnsense.php @@ -0,0 +1,54 @@ +model->isPluginInstalled('bind') != '1') { + LeUtils::log_error('BIND plugin is NOT installed. Please install os-bind and try again.'); + return false; + } + $this->acme_env['OPNs_Host'] = (string)$this->config->dns_opnsense_host; + $this->acme_env['OPNs_Port'] = (string)$this->config->dns_opnsense_port; + $this->acme_env['OPNs_Key'] = (string)$this->config->dns_opnsense_key; + $this->acme_env['OPNs_Token'] = (string)$this->config->dns_opnsense_token; + $this->acme_env['OPNs_Api_Insecure'] = (string)$this->config->dns_opnsense_insecure; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOvh.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOvh.php new file mode 100644 index 0000000000..8d9896924a --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOvh.php @@ -0,0 +1,47 @@ +acme_env['OVH_AK'] = (string)$this->config->dns_ovh_app_key; + $this->acme_env['OVH_AS'] = (string)$this->config->dns_ovh_app_secret; + $this->acme_env['OVH_CK'] = (string)$this->config->dns_ovh_consumer_key; + $this->acme_env['OVH_END_POINT'] = (string)$this->config->dns_ovh_endpoint; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPdns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPdns.php new file mode 100644 index 0000000000..7029fed794 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPdns.php @@ -0,0 +1,46 @@ +acme_env['PDNS_Url'] = (string)$this->config->dns_pdns_url; + $this->acme_env['PDNS_ServerId'] = (string)$this->config->dns_pdns_serverid; + $this->acme_env['PDNS_Token'] = (string)$this->config->dns_pdns_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPleskxml.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPleskxml.php new file mode 100644 index 0000000000..5b71dcd534 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPleskxml.php @@ -0,0 +1,46 @@ +acme_env['pleskxml_user'] = (string)$this->config->dns_pleskxml_user; + $this->acme_env['pleskxml_pass'] = (string)$this->config->dns_pleskxml_pass; + $this->acme_env['pleskxml_uri'] = (string)$this->config->dns_pleskxml_uri; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSchlundtech.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSchlundtech.php new file mode 100644 index 0000000000..c287c1d60f --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSchlundtech.php @@ -0,0 +1,45 @@ +acme_env['SCHLUNDTECH_USER'] = (string)$this->config->dns_schlundtech_user; + $this->acme_env['SCHLUNDTECH_PASSWORD'] = (string)$this->config->dns_schlundtech_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSelectel.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSelectel.php new file mode 100644 index 0000000000..56e3112666 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSelectel.php @@ -0,0 +1,44 @@ +acme_env['SL_Key'] = (string)$this->config->dns_sl_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsServercow.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsServercow.php new file mode 100644 index 0000000000..1ab91b2d2e --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsServercow.php @@ -0,0 +1,45 @@ +acme_env['SERVERCOW_API_Username'] = (string)$this->config->dns_servercow_username; + $this->acme_env['SERVERCOW_API_Password'] = (string)$this->config->dns_servercow_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsUnoeuro.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsUnoeuro.php new file mode 100644 index 0000000000..79dd3a0546 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsUnoeuro.php @@ -0,0 +1,45 @@ +acme_env['UNO_Key'] = (string)$this->config->dns_uno_key; + $this->acme_env['UNO_User'] = (string)$this->config->dns_uno_user; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVariomedia.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVariomedia.php new file mode 100644 index 0000000000..e519d4a85b --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVariomedia.php @@ -0,0 +1,44 @@ +acme_env['VARIOMEDIA_API_TOKEN'] = (string)$this->config->dns_variomedia_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVscale.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVscale.php new file mode 100644 index 0000000000..566611aae6 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVscale.php @@ -0,0 +1,44 @@ +acme_env['VSCALE_API_KEY'] = (string)$this->config->dns_vscale_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsYandex.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsYandex.php new file mode 100644 index 0000000000..73891677e5 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsYandex.php @@ -0,0 +1,44 @@ +acme_env['PDD_Token'] = (string)$this->config->dns_yandex_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsZilore.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsZilore.php new file mode 100644 index 0000000000..854724c651 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsZilore.php @@ -0,0 +1,44 @@ +acme_env['Zilore_Key'] = (string)$this->config->dns_zilore_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsZonomi.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsZonomi.php new file mode 100644 index 0000000000..ffe93baaa5 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsZonomi.php @@ -0,0 +1,44 @@ +acme_env['ZM_Key'] = (string)$this->config->dns_zm_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php new file mode 100644 index 0000000000..32f6d31385 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php @@ -0,0 +1,140 @@ +object(); + $local_http_port = $configObj->OPNsense->AcmeClient->settings->challengePort; + + // Collect all IP addresses here, automatic port forward will be applied for each IP + $iplist = array(); + + // Add IP addresses from auto-discovery feature + if ($this->config->http_opn_autodiscovery == 1) { + $dnslist = explode(',', $this->cert_altnames); + $dnslist[] = $this->cert_name; + foreach ($dnslist as $fqdn) { + // NOTE: This may take some time. + $ip_found = gethostbyname("${fqdn}."); + if (!empty($ip_found)) { + $iplist[] = (string)$ip_found; + } + } + } + + // Add IP addresses from user input + $additional_ip = (string)$this->config->http_opn_ipaddresses; + if (!empty($additional_ip)) { + foreach (explode(',', $additional_ip) as $ip) { + $iplist[] = $ip; + } + } + + // Add IP address from chosen interface + if (!empty((string)$this->config->http_opn_interface)) { + $interface_ip = get_interface_ip((string)$this->config->http_opn_interface); + if (!empty($interface_ip)) { + $iplist[] = $interface_ip; + } + } + + // Check if IPv6 support is enabled + if (isset($configObj->system->ipv6allow) && ($configObj->system->ipv6allow == '1')) { + $_ipv6_enabled = true; + } else { + $_ipv6_enabled = false; + } + + // Generate rules for all IP addresses + $anchor_rules = ""; + if (!empty($iplist)) { + $dedup_iplist = array_unique($iplist); + // Add one rule for every IP + foreach ($dedup_iplist as $ip) { + if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { + // IPv4 + $_dst = '127.0.0.1'; + $_family = 'inet'; + LeUtils::log("using IPv4 address: ${ip}"); + } elseif (($_ipv6_enabled == true) && (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))) { + // IPv6 + $_dst = '::1'; + $_family = 'inet6'; + LeUtils::log("using IPv6 address: ${ip}"); + } else { + continue; // skip broken entries + } + $anchor_rules .= "rdr pass ${_family} proto tcp from any to ${ip} port 80 -> ${_dst} port ${local_http_port}\n"; + } + } else { + LeUtils::log_error("no IP addresses found to setup port forward"); + return false; + } + + // Abort if no rules were generated + if (empty($anchor_rules)) { + LeUtils::log_error("unable to setup a port forward (empty ruleset)"); + return false; + } + + // Create temporary port forward to allow acme challenges to get through + $anchor_setup = "rdr-anchor \"acme-client\"\n"; + file_put_contents("${configdir}/acme_anchor_setup", $anchor_setup); + chmod("${configdir}/acme_anchor_setup", 0600); + mwexec("/sbin/pfctl -f ${configdir}/acme_anchor_setup"); + file_put_contents("${configdir}/acme_anchor_rules", $anchor_rules); + chmod("${configdir}/acme_anchor_rules", 0600); + mwexec("/sbin/pfctl -a acme-client -f ${configdir}/acme_anchor_rules"); + } + + public function cleanup() + { + // Flush OPNsense port forward rules. + mwexec('/sbin/pfctl -a acme-client -F all'); + + // Workaround to solve disconnection issues reported by some users. + $backend = new \OPNsense\Core\Backend(); + $response = $backend->configdRun('filter reload'); + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidationFactory.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidationFactory.php new file mode 100644 index 0000000000..f8113483ef --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidationFactory.php @@ -0,0 +1,90 @@ +getNodeByReference(self::CONFIG_PATH . '.' . $uuid); + if ($obj == null) { + LeUtils::log_error("challenge type not found: ${uuid}"); + return null; + } + + // Get type of validation to find the required class name. + switch ((string)$obj->method) { + case 'dns01': + $search_name = $obj->dns_service; + break; + case 'http01': + $search_name = "http_" . $obj->http_service; + break; + } + + // Convert to PascalCase + $val_name = str_replace(' ', '', ucwords(str_replace(array('-', '_'), ' ', $search_name))); + + // Search class name + foreach (glob(__DIR__ . "/LeValidation/*.php") as $filename) { + $srv_found = basename($filename, '.php'); + try { + $reflClass = new \ReflectionClass("OPNsense\\AcmeClient\\LeValidation\\{$srv_found}"); + } catch (\ReflectionException $e) { + break; + } + if ($reflClass->implementsInterface('OPNsense\\AcmeClient\\LeValidationInterface')) { + if ($srv_found == $val_name) { + // Create new object + $objVal = $reflClass->newInstance(); + $objVal->setUuid($uuid); + return $objVal; + } + } + } + LeUtils::log_error("challenge type not supported: " . (string)$objVal->method . " (${uuid})"); + return null; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidationInterface.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidationInterface.php new file mode 100644 index 0000000000..f5836672e6 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidationInterface.php @@ -0,0 +1,49 @@ + //OPNsense/AcmeClient - 1.6.2 + 2.0.0 A secure Let's Encrypt plugin @@ -143,10 +143,21 @@ N - + N + + + N + 100 + 100 + 1000 + + + + N + @@ -272,8 +283,7 @@ N - - + 100 100 1000 diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Menu/Menu.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Menu/Menu.xml index 472b15b89a..79a8f7cf87 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Menu/Menu.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Menu/Menu.xml @@ -6,9 +6,9 @@ - + - + diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M2_0_0.php b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M2_0_0.php new file mode 100644 index 0000000000..3bd34fe877 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M2_0_0.php @@ -0,0 +1,54 @@ +getNodeByReference('accounts.account')->iterateItems() as $account) { + if (!empty((string)$account->lastUpdate) && empty((string)$account->statusLastUpdate)) { + $account->statusLastUpdate = (string)$account->lastUpdate; + // Account is already registered. + $account->statusCode = '200'; + $account->lastUpdate = null; // clear old value + } elseif (!empty((string)$account->statusLastUpdate) || !empty((string)$account->statusCode)) { + // Ignore accounts that already use M2_0_0 fields. + } else { + // Account registration is pending. + $account->statusCode = '100'; + } + } + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt index f6d6e8ed30..7a95eef4b1 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt @@ -35,18 +35,284 @@ POSSIBILITY OF SUCH DAMAGE. * link grid actions **********************************************************************/ - $("#grid-accounts").UIBootgrid( - { search:'/api/acmeclient/accounts/search', - get:'/api/acmeclient/accounts/get/', - set:'/api/acmeclient/accounts/update/', - add:'/api/acmeclient/accounts/add/', - del:'/api/acmeclient/accounts/del/', - toggle:'/api/acmeclient/accounts/toggle/', - options: { - rowCount:[10,25,50,100,500,1000] + var gridParams = { + search:'/api/acmeclient/accounts/search', + get:'/api/acmeclient/accounts/get/', + set:'/api/acmeclient/accounts/update/', + add:'/api/acmeclient/accounts/add/', + del:'/api/acmeclient/accounts/del/', + toggle:'/api/acmeclient/accounts/toggle/', + register:'/api/acmeclient/accounts/register/', + }; + + var gridopt = { + ajax: true, + selection: true, + multiSelect: true, + rowCount:[10,25,50,100,500,1000], + url: '/api/acmeclient/accounts/search', + formatters: { + "commands": function (column, row) { + return " " + + "" + + "" + + ""; + }, + "rowtoggle": function (column, row) { + if (parseInt(row[column.id], 2) == 1) { + return ""; + } else { + return ""; + } + }, + "accountstatus": function (column, row) { + if (row.statusCode == "" || row.statusCode == undefined) { + // fallback to lastUpdate value (unset if account was not registered) + if (row.statusLastUpdate == "" || row.statusLastUpdate == undefined) { + return "{{ lang._('not registered') }}"; + } else { + return "{{ lang._('OK') }}"; + } + } else if (row.statusCode == "100") { + return "{{ lang._('not registered') }}"; + } else if (row.statusCode == "200") { + return "{{ lang._('OK (registered)') }}"; + } else if (row.statusCode == "250") { + return "{{ lang._('deactivated') }}"; + } else if (row.statusCode == "300") { + return "{{ lang._('configuration error') }}"; + } else if (row.statusCode == "400") { + return "{{ lang._('registration failed') }}"; + } else if (row.statusCode == "500") { + return "{{ lang._('internal error') }}"; + } else { + return "{{ lang._('unknown') }}"; + } + }, + "acmestatusdate": function (column, row) { + if (row.statusLastUpdate == "" || row.statusCode == undefined) { + return "{{ lang._('unknown') }}"; + } else { + var statusdate = new Date(row.statusLastUpdate*1000); + return statusdate.toLocaleString(); + } + } + }, + }; + + /** + * reload bootgrid, return to current selected page + */ + function std_bootgrid_reload(gridId) { + var currentpage = $("#"+gridId).bootgrid("getCurrentPage"); + $("#"+gridId).bootgrid("reload"); + // absolutely not perfect, bootgrid.reload doesn't seem to support when().done() + setTimeout(function(){ + $('#'+gridId+'-footer a[data-page="'+currentpage+'"]').click(); + }, 400); + } + + /** + * copy actions for selected items from opnsense_bootgrid_plugin.js + */ + var grid_accounts = $("#grid-accounts").bootgrid(gridopt).on("loaded.rs.jquery.bootgrid", function (e) + { + // scale footer on resize + $(this).find("tfoot td:first-child").attr('colspan',$(this).find("th").length - 1); + $(this).find('tr[data-row-id]').each(function(){ + if ($(this).find('[class*="command-toggle"]').first().data("value") == "0") { + $(this).addClass("text-muted"); + } + }); + + // edit dialog id to use + var editDlg = $(this).attr('data-editDialog'); + var gridId = $(this).attr('id'); + + // link Add new to child button with data-action = add + $(this).find("*[data-action=add]").click(function(){ + if ( gridParams['get'] != undefined && gridParams['add'] != undefined) { + var urlMap = {}; + urlMap['frm_' + editDlg] = gridParams['get']; + mapDataToFormUI(urlMap).done(function(){ + // update selectors + formatTokenizersUI(); + $('.selectpicker').selectpicker('refresh'); + // clear validation errors (if any) + clearFormValidation('frm_' + editDlg); + }); + + // show dialog for edit + $('#'+editDlg).modal({backdrop: 'static', keyboard: false}); + // + $("#btn_"+editDlg+"_save").unbind('click').click(function(){ + saveFormToEndpoint(url=gridParams['add'], + formid='frm_' + editDlg, callback_ok=function(){ + $("#"+editDlg).modal('hide'); + $("#"+gridId).bootgrid("reload"); + }, true); + }); + } else { + console.log("[grid] action add missing") + } + }); + + // link delete selected items action + $(this).find("*[data-action=deleteSelected]").click(function(){ + if ( gridParams['del'] != undefined) { + stdDialogConfirm('{{ lang._('Confirm removal') }}', + '{{ lang._('Do you want to remove the selected item?') }}', + '{{ lang._('Yes') }}', '{{ lang._('Cancel') }}', function () { + var rows =$("#"+gridId).bootgrid('getSelectedRows'); + if (rows != undefined){ + var deferreds = []; + $.each(rows, function(key,uuid){ + deferreds.push(ajaxCall(url=gridParams['del'] + uuid, sendData={},null)); + }); + // refresh after load + $.when.apply(null, deferreds).done(function(){ + std_bootgrid_reload(gridId); + }); + } + }); + } else { + console.log("[grid] action del missing") + } + }); + + }); + + /** + * copy actions for items from opnsense_bootgrid_plugin.js + */ + grid_accounts.on("loaded.rs.jquery.bootgrid", function(){ + + // edit dialog id to use + var editDlg = $(this).attr('data-editDialog'); + var gridId = $(this).attr('id'); + + // edit item + grid_accounts.find(".command-edit").on("click", function(e) + { + if (editDlg != undefined && gridParams['get'] != undefined) { + var uuid = $(this).data("row-id"); + var urlMap = {}; + urlMap['frm_' + editDlg] = gridParams['get'] + uuid; + mapDataToFormUI(urlMap).done(function () { + // update selectors + formatTokenizersUI(); + $('.selectpicker').selectpicker('refresh'); + // clear validation errors (if any) + clearFormValidation('frm_' + editDlg); + }); + + // show dialog for pipe edit + $('#'+editDlg).modal({backdrop: 'static', keyboard: false}); + // define save action + $("#btn_"+editDlg+"_save").unbind('click').click(function(){ + if (gridParams['set'] != undefined) { + saveFormToEndpoint(url=gridParams['set']+uuid, + formid='frm_' + editDlg, callback_ok=function(){ + $("#"+editDlg).modal('hide'); + std_bootgrid_reload(gridId); + }, true); + } else { + console.log("[grid] action set missing") + } + }); + } else { + console.log("[grid] action get or data-editDialog missing") } - } - ); + }); + + // copy item, save as new + grid_accounts.find(".command-copy").on("click", function(e) + { + if (editDlg != undefined && gridParams['get'] != undefined) { + var uuid = $(this).data("row-id"); + var urlMap = {}; + urlMap['frm_' + editDlg] = gridParams['get'] + uuid; + mapDataToFormUI(urlMap).done(function () { + // update selectors + formatTokenizersUI(); + $('.selectpicker').selectpicker('refresh'); + // clear validation errors (if any) + clearFormValidation('frm_' + editDlg); + }); + + // show dialog for pipe edit + $('#'+editDlg).modal({backdrop: 'static', keyboard: false}); + // define save action + $("#btn_"+editDlg+"_save").unbind('click').click(function(){ + if (gridParams['add'] != undefined) { + saveFormToEndpoint(url=gridParams['add'], + formid='frm_' + editDlg, callback_ok=function(){ + $("#"+editDlg).modal('hide'); + std_bootgrid_reload(gridId); + }, true); + } else { + console.log("[grid] action add missing") + } + }); + } else { + console.log("[grid] action get or data-editDialog missing") + } + }); + + // delete item + grid_accounts.find(".command-delete").on("click", function(e) + { + if (gridParams['del'] != undefined) { + var uuid=$(this).data("row-id"); + stdDialogConfirm('{{ lang._('Confirm removal') }}', + '{{ lang._('Do you want to remove the selected item?') }}', + '{{ lang._('Yes') }}', '{{ lang._('Cancel') }}', function () { + ajaxCall(url=gridParams['del'] + uuid, + sendData={},callback=function(data,status){ + // reload grid after delete + $("#"+gridId).bootgrid("reload"); + }); + }); + } else { + console.log("[grid] action del missing") + } + }); + + // toggle item + grid_accounts.find(".command-toggle").on("click", function(e) + { + if (gridParams['toggle'] != undefined) { + var uuid=$(this).data("row-id"); + $(this).addClass("fa-spinner fa-pulse"); + ajaxCall(url=gridParams['toggle'] + uuid, + sendData={},callback=function(data,status){ + // reload grid after toggle + std_bootgrid_reload(gridId); + }); + } else { + console.log("[grid] action toggle missing") + } + }); + + // register account + grid_accounts.find(".command-register").on("click", function(e) + { + if (gridParams['register'] != undefined) { + var uuid=$(this).data("row-id"); + stdDialogConfirm('{{ lang._('Confirmation Required') }}', + '{{ lang._('Register the selected account with Lets Encrypt?') }}', + '{{ lang._('Yes') }}', '{{ lang._('Cancel') }}', function() { + ajaxCall(url=gridParams['register'] + uuid,sendData={},callback=function(data,status){ + // reload grid afterwards + $("#"+gridId).bootgrid("reload"); + }); + }); + } else { + console.log("[grid] action register missing") + } + }); + + }); }); @@ -64,6 +330,8 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Enabled') }} {{ lang._('Name') }} {{ lang._('E-Mail') }} + {{ lang._('Status') }} + {{ lang._('Registration Date') }} {{ lang._('Commands') }} {{ lang._('ID') }} diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt index 6db878d502..2d172eb017 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt @@ -318,13 +318,12 @@ POSSIBILITY OF SUCH DAMAGE. }); // sign cert - // TODO: this should block other acme.sh actions grid_certificates.find(".command-sign").on("click", function(e) { if (gridParams['sign'] != undefined) { var uuid=$(this).data("row-id"); stdDialogConfirm('{{ lang._('Confirmation Required') }}', - '{{ lang._('Forcefully (re-)issue the selected certificate?') }}', + '{{ lang._('Forcefully issue or renew the selected certificate?') }}', '{{ lang._('Yes') }}', '{{ lang._('Cancel') }}', function() { // Handle HAProxy integration (no-op if not applicable) ajaxCall(url="/api/acmeclient/settings/fetchHAProxyIntegration", sendData={}, callback=function(data,status) { @@ -340,7 +339,6 @@ POSSIBILITY OF SUCH DAMAGE. }); // revoke cert - // TODO: this should block other acme.sh actions grid_certificates.find(".command-revoke").on("click", function(e) { if (gridParams['revoke'] != undefined) { @@ -360,7 +358,6 @@ POSSIBILITY OF SUCH DAMAGE. }); // remove private key - // TODO: this should block other acme.sh actions grid_certificates.find(".command-removekey").on("click", function(e) { if (gridParams['removekey'] != undefined) { @@ -380,7 +377,6 @@ POSSIBILITY OF SUCH DAMAGE. }); // run automation - // TODO: this should block other acme.sh actions grid_certificates.find(".command-automation").on("click", function(e) { if (gridParams['automation'] != undefined) { @@ -417,7 +413,6 @@ POSSIBILITY OF SUCH DAMAGE. /** * Sign or renew ALL certificates - * TODO: this should block other acme.sh actions */ $("#signallcertsAct").click(function(){ //$("#signallcertsAct_progress").addClass("fa fa-spinner fa-pulse"); diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt index 08d8932b85..bb67c87c0f 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt @@ -241,7 +241,7 @@ POSSIBILITY OF SUCH DAMAGE.
    - {{ lang._("Please read the official %sLet's Encrypt documentation%s before using this plugin. Otherwise you will easily hit its %srate limits%s and thus all your attempts to issue a certificate will fail.") | format('', '', '', '') }}{{ lang._("Please use Let's Encrypt's %sstaging servers%s when using this plugin for the first time or while testing a new validation method. You will have to reissue your certificates when switching from staging to production servers to get valid certificates.") | format('', '') }} + {{ lang._("Please read the official %sLet's Encrypt documentation%s before using this plugin. Otherwise you will easily hit its %srate limits%s and thus all your attempts to issue a certificate will fail.") | format('', '', '', '') }}{{ lang._("Please use Let's Encrypt's %sstaging servers%s when using this plugin for the first time or while testing a new challenge type. You will have to reissue your certificates when switching from staging to production servers to get valid certificates.") | format('', '') }}
    {{ lang._('Please use the %sissue tracker%s to report bugs or request new features.') | format('', '') }}
    diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/validations.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/validations.volt index cb94acec00..6ece1b0aa7 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/validations.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/validations.volt @@ -91,7 +91,7 @@ POSSIBILITY OF SUCH DAMAGE.
    @@ -122,4 +122,4 @@ POSSIBILITY OF SUCH DAMAGE.
    {# include dialogs #} -{{ partial("layout_partials/base_dialog",['fields':formDialogValidation,'id':'DialogValidation','label':lang._('Edit Validation Method')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogValidation,'id':'DialogValidation','label':lang._('Edit Challenge Type')])}} diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php deleted file mode 100755 index 928961e391..0000000000 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/certhelper.php +++ /dev/null @@ -1,1655 +0,0 @@ -#!/usr/local/bin/php - - * Copyright (C) 2008 Shrew Soft Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -// Hello. I am the spaghetti monster. Yummy. - -// Use legacy code to manage certificates. -require_once("config.inc"); -require_once("certs.inc"); -require_once("legacy_bindings.inc"); -require_once("interfaces.inc"); -require_once("util.inc"); - -// Some stuff requires the almighty MVC framework. -use OPNsense\Core\Backend; -use OPNsense\Core\Config; -use OPNsense\Base; -use OPNsense\AcmeClient\AcmeClient; - -$postponed_updates = array(); - -/* CLI arguments: - * -a (action) - * -c (certificate id, NOT the uuid) - * -A (all certificates) - * -C (cron, special rules apply when running as cronjob) - * -F (force, rewew/recreate) - * -S (staging) - */ -$options = getopt("a:c:ACFS"); - -// Simple validation -if (!isset($options["a"]) or (!isset($options["c"]) and !isset($options["A"]))) { - // ALL actions require either a certificate ID or the -A switch - echo "ERROR: not enough arguments\n"; - exit(1); -} -if (($options["a"] == 'revoke') and !isset($options["c"])) { - echo "ERROR: option revoke requires a certificate ID\n"; - exit(1); -} - -// Cron mode -if (isset($options["C"])) { - // Automatically work on ALL certificates - $options["A"] = ""; -} - -// Run the specified action -switch ($options["a"]) { - case 'sign': - $result = cert_action_validator($options["c"]); - echo json_encode(array('status' => $result)); - break; - case 'renew': - $result = cert_action_validator($options["c"]); - echo json_encode(array('status' => $result)); - break; - case 'remove': - $result = cert_action_validator($options["c"]); - echo json_encode(array('status' => $result)); - break; - case 'removekey': - $result = cert_action_validator($options["c"]); - echo json_encode(array('status' => $result)); - break; - case 'revoke': - $result = cert_action_validator($options["c"]); - echo json_encode(array('status' => $result)); - break; - case 'automation': - $result = cert_action_validator($options["c"]); - echo json_encode(array('status' => $result)); - break; - default: - echo "ERROR: invalid argument specified\n"; - log_error("invalid argument specified"); - exit(1); -} - -// Write certificate status updates to configuration -dump_postponed_updates(); - -// ALL certificate work starts here. First we do some common validation and -// make sure that everything is prepared for acme client to run. -// The actual issue/renew/revoke work is done by separate functions. -function cert_action_validator($opt_cert_id) -{ - global $options; - - $modelObj = new OPNsense\AcmeClient\AcmeClient(); - - // Store certs here after successful issue/renewal. Required for automations. - $restart_certs = array(); - - // Search for cert ID in configuration - $configObj = Config::getInstance()->object(); - if (isset($configObj->OPNsense->AcmeClient->certificates) && $configObj->OPNsense->AcmeClient->certificates->count() > 0) { - foreach ($configObj->OPNsense->AcmeClient->certificates->children() as $certObj) { - // Extract cert ID - $cert_id = (string)$certObj->id; - if (empty($cert_id)) { - continue; // Cert is invalid, skip it. - } - - // Either work with ALL certificates or check if cert ID matches - if (isset($options["A"]) or ((string)$cert_id == (string)$opt_cert_id)) { - // Ignore disabled certificates - if ($certObj->enabled == 0) { - // Always ignore disabled certs when working on ALL certs. - if (isset($options["A"])) { - continue; // skip to next item - } - // Allow only "revoke", "remove" and "removekey" for disabled certs. - if (!in_array($options["a"], ['remove','removekey','revoke'])) { - return(1); // Cert is disabled, skip it. - } - } - - // Extract Account from referenced obj - $acctRef = (string)$certObj->account; - $acctObj = null; - $acctref_found = false; - foreach ($modelObj->getNodeByReference('accounts.account')->iterateItems() as $node) { - if ((string)$node->getAttributes()["uuid"] == $acctRef) { - $acctref_found = true; - $acctObj = $node; - break; // Match! Go ahead. - } - } - - // Make sure we found the configured account - if ($acctref_found == true) { - // Ensure that this account was properly setup and registered. - $acct_result = run_acme_account_registration($acctObj, $certObj, $modelObj); - if (!$acct_result) { - // account registration OK - } else { - log_error("AcmeClient: account registration failed"); - log_cert_acme_status($certObj, $modelObj, '400'); - if (isset($options["A"])) { - continue; // skip to next item - } - return(1); - } - } else { - log_error("AcmeClient: account not found"); - log_cert_acme_status($certObj, $modelObj, '300'); - if (isset($options["A"])) { - continue; // skip to next item - } - return(1); - } - - // Extract Validation Method from referenced obj - $valRef = (string)$certObj->validationMethod; - $valObj = null; - $ref_found = false; - foreach ($modelObj->getNodeByReference('validations.validation')->iterateItems() as $node) { - if ((string)$node->getAttributes()["uuid"] == $valRef) { - $ref_found = true; - $valObj = $node; - break; // Match! Go ahead. - } - } - - // Cert is being removed from the GUI, delete all traces. - if ($options["a"] == "remove") { - // Start acme client to remove the certificate - $rev_result = remove_cert($certObj); - if (!$rev_result) { - log_error("AcmeClient: successfully removed acme.sh certificate configuration for " . (string)$certObj->name); - return(0); // Success! - } else { - log_error("AcmeClient: failed to remove acme.sh certificate configuration for " . (string)$certObj->name); - return(1); - } - } - - // Remove private key - // NOTE: Although the user requested to remove the private key, - // we simply perform a full cert removal because without the - // matching private key the cert is useless. - if ($options["a"] == "removekey") { - // Start acme client to remove the certificate - $rev_result = remove_cert($certObj); - if (!$rev_result) { - log_error("AcmeClient: successfully removed the private key and reset certificate " . (string)$certObj->name); - // Reset certificate state, treat it like a new certificate. - log_cert_acme_status($certObj, $modelObj, '100'); - return(0); // Success! - } else { - log_error("AcmeClient: failed to remove the private key and reset certificate " . (string)$certObj->name); - return(1); - } - } - - // Only run certificate automation - if ($options["a"] == "automation") { - // Check if the cert was successul issued - if (!empty((string)$certObj->statusCode) and (string)$certObj->statusCode == '200') { - log_error("AcmeClient: ready to run automation for certificate: " . (string)$certObj->name); - $restart_certs[] = $certObj; - } else { - log_error("AcmeClient: failed to run automation, certificate status not OK: " . (string)$certObj->name); - return(1); - } - break; // Stop after first match. - } - - // Make sure we found the configured validation method - if ($ref_found == true) { - // Was a revocation requested? - // NOTE: Revocation is not even considered when some elements have already been - // deleted from the GUI. It's likely that it would fail anyway. - if ($options["a"] == "revoke") { - // Start acme client to revoke the certificate - $rev_result = revoke_cert($certObj, $valObj, $acctObj); - if (!$rev_result) { - log_cert_acme_status($certObj, $modelObj, '250'); - return(0); // Success! - } else { - // Revocation failure - log_error("AcmeClient: revocation for certificate failed"); - log_cert_acme_status($certObj, $modelObj, '400'); - if (isset($options["A"])) { - continue; // skip to next item - } - return(1); - } - } - - // Which validation method? - if ((string)$valObj->method == 'http01' or ((string)$valObj->method == 'dns01')) { - // Start acme client to issue or renew certificate - $val_result = run_acme_validation($certObj, $valObj, $acctObj); - if (!$val_result) { - log_error("AcmeClient: successfully issued/renewed certificate: " . (string)$certObj->name); - // Import certificate to Cert Manager - if (!import_certificate($certObj, $modelObj)) { - // Prepare certificate for automation - $restart_certs[] = $certObj; - log_cert_acme_status($certObj, $modelObj, '200'); - } else { - log_error("AcmeClient: unable to import certificate: " . (string)$certObj->name); - log_cert_acme_status($certObj, $modelObj, '500'); - if (isset($options["A"])) { - continue; // skip to next item - } - return(1); - } - } elseif ($val_result == '99') { - // Renewal not required. Do nothing. - } else { - // validation failure - log_error("AcmeClient: validation for certificate failed: " . (string)$certObj->name); - log_cert_acme_status($certObj, $modelObj, '400'); - if (isset($options["A"])) { - continue; // skip to next item - } - return(1); - } - } else { - log_error("AcmeClient: invalid validation method specified: " . (string)$valObj->method); - log_cert_acme_status($certObj, $modelObj, '300'); - if (isset($options["A"])) { - continue; // skip to next item - } - return(1); - } - } else { - log_error("AcmeClient: validation method not found for cert " . $certObj->name); - log_cert_acme_status($certObj, $modelObj, '300'); - if (isset($options["A"])) { - continue; // skip to next item - } - return(1); - } - - // Work on ALL certificates? - if (!isset($options["A"])) { - break; // Stop after first match. - } - } - } - } else { - log_error("AcmeClient: no LE certificates found in configuration"); - return(1); - } - - // Run automations if an operation was successful. - if (!empty($restart_certs)) { - // Execute automations. - if (!run_restart_actions($restart_certs, $modelObj)) { - # Success. - } else { - log_error("AcmeClient: failed to execute some automations"); - } - } - - return(0); -} - -// Prepare optional parameters for acme client -function eval_optional_acme_args() -{ - global $options; - $configObj = Config::getInstance()->object(); - - $acme_args = array(); - - // Force certificate renewal? - $acme_args[] = isset($options["F"]) ? "--force" : null; - - // Use LE staging environment? - $acme_args[] = $configObj->OPNsense->AcmeClient->settings->environment == "stg" ? "--staging" : null; - $acme_args[] = isset($options["S"]) ? "--staging" : null; // for debug purpose - - // Set log level - switch ($configObj->OPNsense->AcmeClient->settings->logLevel) { - case "extended": - $acme_args[] = "--log-level 2"; - case "debug": - $acme_args[] = "--debug"; - case "debug2": - $acme_args[] = "--debug 2"; - case "debug3": - $acme_args[] = "--debug 3"; - default: - $acme_args[] = "--log-level 1"; - } - - // Remove empty and duplicate elements from array - return(array_unique(array_filter($acme_args))); -} - -// Create account keys and register accounts, export/import them from/to filesystem/config.xml -function run_acme_account_registration($acctObj, $certObj, $modelObj) -{ - global $options; - - // Prepare optional parameters for acme-client - $acme_args = eval_optional_acme_args(); - - // Collect account information - $acme_env = (string)$modelObj->settings->environment; - $account_conf_dir = "/var/etc/acme-client/accounts/" . $acctObj->id . "_${acme_env}"; - $account_conf_file = $account_conf_dir . "/account.conf"; - $account_key_file = $account_conf_dir . "/account.key"; - $account_json_file = $account_conf_dir . "/account.json"; - $account_ca_file = $account_conf_dir . "/ca.conf"; - $acme_conf = array(); - $acme_conf[] = "CERT_HOME='/var/etc/acme-client/home'"; - $acme_conf[] = "LOG_FILE='/var/log/acme.sh.log'"; - $acme_conf[] = "ACCOUNT_KEY_PATH='" . $account_key_file . "'"; - $acme_conf[] = "ACCOUNT_JSON_PATH='" . $account_json_file . "'"; - $acme_conf[] = "CA_CONF='" . $account_ca_file . "'"; - if (!empty((string)$acctObj->email)) { - $acme_conf[] = "ACCOUNT_EMAIL='" . (string)$acctObj->email . "'"; - } - - // Create account configuration file - if (!is_dir($account_conf_dir)) { - mkdir($account_conf_dir, 0700, true); - } - file_put_contents($account_conf_file, (string)implode("\n", $acme_conf) . "\n"); - chmod($account_conf_file, 0600); - - // Check if account key already exists - if (is_file($account_key_file)) { - // account key found - } else { - // Check if we have an account key in our configuration - if (!empty((string)$acctObj->key)) { - // Write key to disk - file_put_contents($account_key_file, (string)base64_decode((string)$acctObj->key)); - chmod($account_key_file, 0600); - } else { - // Do not generate new key if a revocation was requested. - if ($options["a"] == "revoke") { - log_error("AcmeClient: account key not found, but a revocation was requested"); - return(1); - } - - // Let acme client generate a new account key - $acmecmd = "/usr/local/sbin/acme.sh " - . implode(" ", $acme_args) . " " - . "--createAccountKey " - . "--accountkeylength 4096 " - . "--home /var/etc/acme-client/home " - . "--accountconf " . $account_conf_file; - $result = mwexec($acmecmd); - - // Check exit code - if (!($result)) { - // created a new account key - } else { - log_error("AcmeClient: failed to create a new account key"); - return(1); - } - - // Read account key - $account_key_content = @file_get_contents($account_key_file); - if ($account_key_content == false) { - log_error("AcmeClient: unable to read account key from file"); - return(1); - } - - // Import account key into config - $acctObj->key = base64_encode($account_key_content); - // serialize to config and save - $modelObj->serializeToConfig(); - Config::getInstance()->save(); - Config::getInstance()->forceReload(); - } - } - - // Check if account was already registered - if (!empty((string)$acctObj->lastUpdate)) { - // account key already registered - } else { - // Do not register new account if a revocation was requested. - if ($options["a"] == "revoke") { - log_error("AcmeClient: account not registered, but a revocation was requested"); - return(1); - } - - // Run acme client to register the account - $acmecmd = "/usr/local/sbin/acme.sh " - . implode(" ", $acme_args) . " " - . "--registeraccount " - . "--home /var/etc/acme-client/home " - . "--accountconf " . $account_conf_file; - $result = mwexec($acmecmd); - - // Check exit code - if (!($result)) { - // registered a new account key - } else { - log_error("AcmeClient: failed to register a new account key"); - return(1); - } - - // Set update/create time in config - $acctObj->lastUpdate = time(); - // serialize to config and save - $modelObj->serializeToConfig(); - Config::getInstance()->save(); - Config::getInstance()->forceReload(); - } - - return; -} - -// Run acme client with HTTP-01 or DNS-01 validation to issue/renew certificate -function run_acme_validation($certObj, $valObj, $acctObj) -{ - global $options; - - // Required to run pre-defined commands. - $backend = new Backend(); - $modelObj = new OPNsense\AcmeClient\AcmeClient(); - - // Collect account information - $acme_env = (string)$modelObj->settings->environment; - $account_conf_dir = "/var/etc/acme-client/accounts/" . $acctObj->id . "_${acme_env}"; - $account_conf_file = $account_conf_dir . "/account.conf"; - - // Generate certificate filenames - $cert_id = (string)$certObj->id; - $cert_filename = "/var/etc/acme-client/certs/${cert_id}/cert.pem"; - $cert_chain_filename = "/var/etc/acme-client/certs/${cert_id}/chain.pem"; - $cert_fullchain_filename = "/var/etc/acme-client/certs/${cert_id}/fullchain.pem"; - $key_filename = "/var/etc/acme-client/keys/${cert_id}/private.key"; - - // Setup our own ACME environment - $certdir = "/var/etc/acme-client/certs/${cert_id}"; - $keydir = "/var/etc/acme-client/keys/${cert_id}"; - $configdir = "/var/etc/acme-client/configs/${cert_id}"; - foreach (array($certdir, $keydir, $configdir) as $dir) { - if (!is_dir($dir)) { - mkdir($dir, 0700, true); - } - } - - // Preparation to run acme client - $acme_args = eval_optional_acme_args(); - $proc_env = array(); // env variables for proc_open() - $proc_env['PATH'] = '/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin'; - $proc_desc = array( // descriptor array for proc_open() - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - 2 => array("pipe", "w") // stderr - ); - $proc_pipes = array(); - - // Do we need to issue or renew the certificate? - if (!empty((string)$certObj->lastUpdate) and !isset($options["F"])) { - $acme_action = "renew"; - } else { - // Default: Issue a new certificate. - // If "-F" is specified, forcefully re-issue the cert, no matter if it's required. - // NOTE: This is useful if altNames were changed or when switching - // from acme staging to acme production servers. - $acme_action = "issue"; - } - - // Calculate next renewal date - $last_update = !empty((string)$certObj->lastUpdate) ? (string)$certObj->lastUpdate : 0; - $renew_cert = false; - $current_time = new \DateTime(); - $last_update_time = new \DateTime(); - $last_update_time->setTimestamp($last_update); - $renew_interval = (string)$certObj->renewInterval; - $next_update = $last_update_time->add(new \DateInterval('P' . $renew_interval . 'D')); - - // Check if it's time to renew the cert. - if (isset($options["F"]) or ($current_time >= $next_update)) { - $renew_cert = true; - } else { - // Renewal not yet required, report special code - return(99); - } - - // Try HTTP-01 or DNS-01 validation? - $val_method = (string)$valObj->method; - $acme_validation = ""; // val.method as argument for acme.sh - $acme_hook_options = array(); // store addition arguments for acme.sh here - switch ($val_method) { - case 'http01': - $acme_validation = "--webroot /var/etc/acme-client/challenges "; - break; - case 'dns01': - $acme_validation = "--dns " . (string)$valObj->dns_service . " "; - break; - default: - log_error("AcmeClient: invalid validation method specified: " . (string)$valObj->method); - return(1); - } - - // HTTP-01: setup OPNsense internal port forward - if (($val_method == 'http01') and ((string)$valObj->http_service == 'opnsense')) { - // Get configured HTTP port for local lighttpd server - $configObj = Config::getInstance()->object(); - $local_http_port = $configObj->OPNsense->AcmeClient->settings->challengePort; - - // Collect all IP addresses here, automatic port forward will be applied for each IP - $iplist = array(); - - // Add IP addresses from auto-discovery feature - if ($valObj->http_opn_autodiscovery == 1) { - $dnslist = explode(',', $certObj->altNames); - $dnslist[] = $certObj->name; - foreach ($dnslist as $fqdn) { - // NOTE: This may take some time. - $ip_found = gethostbyname("${fqdn}."); - if (!empty($ip_found)) { - $iplist[] = (string)$ip_found; - } - } - } - - // Add IP addresses from user input - $additional_ip = (string)$valObj->http_opn_ipaddresses; - if (!empty($additional_ip)) { - foreach (explode(',', $additional_ip) as $ip) { - $iplist[] = $ip; - } - } - - // Add IP address from chosen interface - if (!empty((string)$valObj->http_opn_interface)) { - $interface_ip = get_interface_ip((string)$valObj->http_opn_interface); - if (!empty($interface_ip)) { - $iplist[] = $interface_ip; - } - } - - // Check wether IPv6 support is enabled - $configObj = Config::getInstance()->object(); - if (isset($configObj->system->ipv6allow) && ($configObj->system->ipv6allow == "1")) { - $_ipv6_enabled = true; - } else { - $_ipv6_enabled = false; - } - - // Generate rules for all IP addresses - $anchor_rules = ""; - if (!empty($iplist)) { - $dedup_iplist = array_unique($iplist); - // Add one rule for every IP - foreach ($dedup_iplist as $ip) { - if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { - // IPv4 - $_dst = '127.0.0.1'; - $_family = 'inet'; - log_error("AcmeClient: using IPv4 address: ${ip}"); - } elseif (($_ipv6_enabled == true) && (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))) { - // IPv6 - $_dst = '::1'; - $_family = 'inet6'; - log_error("AcmeClient: using IPv6 address: ${ip}"); - } else { - continue; // skip broken entries - } - $anchor_rules .= "rdr pass ${_family} proto tcp from any to ${ip} port 80 -> ${_dst} port ${local_http_port}\n"; - } - } else { - log_error("AcmeClient: no IP addresses found to setup port forward"); - return(1); - } - - // Abort if no rules were generated - if (empty($anchor_rules)) { - log_error("AcmeClient: unable to setup a port forward (empty ruleset)"); - return(1); - } - - // Create temporary port forward to allow acme challenges to get through - $anchor_setup = "rdr-anchor \"acme-client\"\n"; - file_put_contents("${configdir}/acme_anchor_setup", $anchor_setup); - chmod("${configdir}/acme_anchor_setup", 0600); - mwexec("/sbin/pfctl -f ${configdir}/acme_anchor_setup"); - file_put_contents("${configdir}/acme_anchor_rules", $anchor_rules); - chmod("${configdir}/acme_anchor_rules", 0600); - mwexec("/sbin/pfctl -a acme-client -f ${configdir}/acme_anchor_rules"); - } - - // Prepare DNS-01 hooks - if ($val_method == 'dns01') { - // Some common stuff - $val_id = preg_replace("/[^a-zA-Z0-9]/", "", (string)$valObj->id); - $secret_key_filename = "${configdir}/secret.key"; - $acme_args[] = '--dnssleep ' . $valObj->dns_sleep; - - // Setup DNS hook: - // Set required env variables, write secrets to files, etc. - switch ((string)$valObj->dns_service) { - case 'dns_1984hosting': - $proc_env['One984HOSTING_Username'] = (string)$valObj->dns_1984hosting_user; - $proc_env['One984HOSTING_Password'] = (string)$valObj->dns_1984hosting_password; - break; - case 'dns_acmedns': - $proc_env['ACMEDNS_USERNAME'] = (string)$valObj->dns_acmedns_user; - $proc_env['ACMEDNS_PASSWORD'] = (string)$valObj->dns_acmedns_password; - $proc_env['ACMEDNS_SUBDOMAIN'] = (string)$valObj->dns_acmedns_subdomain; - $proc_env['ACMEDNS_UPDATE_URL'] = (string)$valObj->dns_acmedns_updateurl; - break; - case 'dns_acmeproxy': - $proc_env['ACMEPROXY_ENDPOINT'] = (string)$valObj->dns_acmeproxy_endpoint; - $proc_env['ACMEPROXY_USERNAME'] = (string)$valObj->dns_acmeproxy_username; - $proc_env['ACMEPROXY_PASSWORD'] = (string)$valObj->dns_acmeproxy_password; - break; - case 'dns_ad': - $proc_env['AD_API_KEY'] = (string)$valObj->dns_ad_key; - break; - case 'dns_ali': - $proc_env['Ali_Key'] = (string)$valObj->dns_ali_key; - $proc_env['Ali_Secret'] = (string)$valObj->dns_ali_secret; - break; - case 'dns_arvan': - $proc_env['Arvan_Token'] = (string)$valObj->dns_arvan_token; - break; - case 'dns_autodns': - $proc_env['AUTODNS_USER'] = (string)$valObj->dns_autodns_user; - $proc_env['AUTODNS_PASSWORD'] = (string)$valObj->dns_autodns_password; - $proc_env['AUTODNS_CONTEXT'] = (string)$valObj->dns_autodns_context; - break; - case 'dns_aws': - $proc_env['AWS_ACCESS_KEY_ID'] = (string)$valObj->dns_aws_id; - $proc_env['AWS_SECRET_ACCESS_KEY'] = (string)$valObj->dns_aws_secret; - break; - case 'dns_azure': - $proc_env['AZUREDNS_SUBSCRIPTIONID'] = (string)$valObj->dns_azuredns_subscriptionid; - $proc_env['AZUREDNS_TENANTID'] = (string)$valObj->dns_azuredns_tenantid; - $proc_env['AZUREDNS_APPID'] = (string)$valObj->dns_azuredns_appid; - $proc_env['AZUREDNS_CLIENTSECRET'] = (string)$valObj->dns_azuredns_clientsecret; - break; - case 'dns_cf': - // Global API key (insecure) - $proc_env['CF_Key'] = (string)$valObj->dns_cf_key; - $proc_env['CF_Email'] = (string)$valObj->dns_cf_email; - // Restricted API token (recommended) - $proc_env['CF_Token'] = (string)$valObj->dns_cf_token; - $proc_env['CF_Account_ID'] = (string)$valObj->dns_cf_account_id; - break; - case 'dns_cloudns': - $proc_env['CLOUDNS_AUTH_ID'] = (string)$valObj->dns_cloudns_auth_id; - $proc_env['CLOUDNS_SUB_AUTH_ID'] = (string)$valObj->dns_cloudns_sub_auth_id; - $proc_env['CLOUDNS_AUTH_PASSWORD'] = (string)$valObj->dns_cloudns_auth_password; - break; - case 'dns_cn': - $proc_env['CN_User'] = (string)$valObj->dns_cn_user; - $proc_env['CN_Password'] = (string)$valObj->dns_cn_password; - break; - case 'dns_cx': - $proc_env['CX_Key'] = (string)$valObj->dns_cx_key; - $proc_env['CX_Secret'] = (string)$valObj->dns_cx_secret; - break; - case 'dns_cyon': - $proc_env['CY_Username'] = (string)$valObj->dns_cyon_user; - $proc_env['CY_Password'] = (string)$valObj->dns_cyon_user; - break; - case 'dns_da': - $proc_env['DA_Api'] = (string)$valObj->dns_da_key; - $proc_env['DA_Api_Insecure'] = (string)$valObj->dns_da_insecure; - break; - case 'dns_dgon': - $proc_env['DO_API_KEY'] = (string)$valObj->dns_dgon_key; - break; - case 'dns_dnsimple': - $proc_env['DNSimple_OAUTH_TOKEN'] = (string)$valObj->dns_dnsimple_token; - break; - case 'dns_do': - $proc_env['DO_PID'] = (string)$valObj->dns_do_pid; - $proc_env['DO_PW'] = (string)$valObj->dns_do_password; - break; - case 'dns_doapi': - $proc_env['DO_LETOKEN'] = (string)$valObj->dns_doapi_token; - break; - case 'dns_dp': - $proc_env['DP_Id'] = (string)$valObj->dns_dp_id; - $proc_env['DP_Key'] = (string)$valObj->dns_dp_key; - break; - case 'dns_dreamhost': - $proc_env['DH_API_KEY'] = (string)$valObj->dns_dh_key; - break; - case 'dns_duckdns': - $proc_env['DuckDNS_Token'] = (string)$valObj->dns_duckdns_token; - break; - case 'dns_dyn': - $proc_env['DYN_Customer'] = (string)$valObj->dns_dyn_customer; - $proc_env['DYN_Username'] = (string)$valObj->dns_dyn_user; - $proc_env['DYN_Password'] = (string)$valObj->dns_dyn_password; - break; - case 'dns_dynu': - $proc_env['Dynu_ClientId'] = (string)$valObj->dns_dynu_clientid; - $proc_env['Dynu_Secret'] = (string)$valObj->dns_dynu_secret; - break; - case 'dns_euserv': - $proc_env['EUSERV_Username'] = (string)$valObj->dns_euserv_user; - $proc_env['EUSERV_Password'] = (string)$valObj->dns_euserv_password; - $acme_hook_options[] = "--insecure"; - break; - case 'dns_freedns': - $proc_env['FREEDNS_User'] = (string)$valObj->dns_freedns_user; - $proc_env['FREEDNS_Password'] = (string)$valObj->dns_freedns_password; - break; - case 'dns_gandi_livedns': - $proc_env['GANDI_LIVEDNS_KEY'] = (string)$valObj->dns_gandi_livedns_key; - break; - case 'dns_gcloud': - # Google Cloud SDK must be installed. - if ((string)$modelObj->isPluginInstalled('google-cloud-sdk') != "1") { - log_error("AcmeClient: Google Cloud SDK plugin is NOT installed. Please install os-google-cloud-sdk."); - return(1); - } - # We need a valid Google Cloud JSON key. - if (!empty((string)$valObj->dns_gcloud_key)) { - # Extract the gcloud project from the key data. - $_gcloud_data = json_decode((string)$valObj->dns_gcloud_key); - $gcloud_project = $_gcloud_data->project_id; - $gcloud_account = $_gcloud_data->client_email; - if (empty($gcloud_project)) { - log_error("AcmeClient: unable to extract project name from Google Cloud DNS JSON key"); - return(1); - } else { - log_error("AcmeClient: Google Cloud DNS project name: ${gcloud_project}"); - } - } else { - log_error("AcmeClient: no key for Google Cloud DNS was specified"); - return(1); - } - # Preparations for gcloud CLI. - $gcloud_config = "acme-${val_id}"; - $gcloud_key_file = "/tmp/acme_" . (string)$valObj->dns_service . "_${val_id}.json"; - file_put_contents($gcloud_key_file, (string)$valObj->dns_gcloud_key); - chmod($gcloud_key_file, 0600); - $proc_env['CLOUDSDK_ACTIVE_CONFIG_NAME'] = $gcloud_config; - $proc_env['CLOUDSDK_CORE_PROJECT'] = $gcloud_project; - # Ensure that a working gcloud config exists. - run_shell_command("/usr/local/bin/gcloud config configurations create ${gcloud_config}", $proc_env); - run_shell_command("/usr/local/bin/gcloud config configurations activate ${gcloud_config}", $proc_env); - run_shell_command("/usr/local/bin/gcloud auth activate-service-account --key-file=${gcloud_key_file}", $proc_env); - run_shell_command("/usr/local/bin/gcloud config set account ${gcloud_account}", $proc_env); - run_shell_command("/usr/local/bin/gcloud config set project ${gcloud_project}", $proc_env); - break; - case 'dns_gd': - $proc_env['GD_Key'] = (string)$valObj->dns_gd_key; - $proc_env['GD_Secret'] = (string)$valObj->dns_gd_secret; - break; - case 'dns_gdnsdk': - $proc_env['GDNSDK_Username'] = (string)$valObj->dns_gdnsdk_user; - $proc_env['GDNSDK_Password'] = (string)$valObj->dns_gdnsdk_password; - break; - case 'dns_hetzner': - $proc_env['HETZNER_Token'] = (string)$valObj->dns_hetzner_token; - break; - case 'dns_hostingde': - $proc_env['HOSTINGDE_ENDPOINT'] = (string)$valObj->dns_hostingde_server; - $proc_env['HOSTINGDE_APIKEY'] = (string)$valObj->dns_hostingde_apiKey; - break; - case 'dns_he': - $proc_env['HE_Username'] = (string)$valObj->dns_he_user; - $proc_env['HE_Password'] = (string)$valObj->dns_he_password; - break; - case 'dns_infoblox': - $proc_env['Infoblox_Creds'] = (string)$valObj->dns_infoblox_credentials; - $proc_env['Infoblox_Server'] = (string)$valObj->dns_infoblox_server; - break; - case 'dns_inwx': - $proc_env['INWX_User'] = (string)$valObj->dns_inwx_user; - $proc_env['INWX_Password'] = (string)$valObj->dns_inws_password; - break; - case 'dns_ispconfig': - $proc_env['ISPC_User'] = (string)$valObj->dns_ispconfig_user; - $proc_env['ISPC_Password'] = (string)$valObj->dns_ispconfig_password; - $proc_env['ISPC_Api'] = (string)$valObj->dns_ispconfig_api; - $proc_env['ISPC_Api_Insecure'] = (string)$valObj->dns_ispconfig_insecure; - break; - case 'dns_joker': - $proc_env['JOKER_USERNAME'] = (string)$valObj->dns_joker_username; - $proc_env['JOKER_PASSWORD'] = (string)$valObj->dns_joker_password; - break; - case 'dns_kinghost': - $proc_env['KINGHOST_username'] = (string)$valObj->dns_kinghost_username; - $proc_env['KINGHOST_Password'] = (string)$valObj->dns_kinghost_password; - break; - case 'dns_knot': - $proc_env['KNOT_SERVER'] = (string)$valObj->dns_knot_server; - $proc_env['KNOT_KEY'] = (string)$valObj->dns_knot_key; - break; - case 'dns_leaseweb': - $proc_env['LSW_Key'] = (string)$valObj->dns_leaseweb_key; - break; - case 'dns_lexicon': - $proc_env['PROVIDER'] = (string)$valObj->dns_lexicon_provider; - $proc_env['LEXICON_' . strtoupper($proc_env['PROVIDER']) . '_USERNAME'] = (string)$valObj->dns_lexicon_user; - $proc_env['LEXICON_' . strtoupper($proc_env['PROVIDER']) . '_TOKEN'] = (string)$valObj->dns_lexicon_token; - if ((string)$valObj->dns_lexicon_provider == 'namesilo') { - // Namesilo applies changes to DNS records only every 15 minutes. - $acme_hook_options[] = "--dnssleep 960"; - } - break; - case 'dns_linode': - $proc_env['LINODE_API_KEY'] = (string)$valObj->dns_linode_key; - // Linode can take up to 15 to update DNS records - $acme_hook_options[] = "--dnssleep 960"; - break; - case 'dns_linode_v4': - $proc_env['LINODE_V4_API_KEY'] = (string)$valObj->dns_linode_v4_key; - // Linode can take up to 15 to update DNS records - $acme_hook_options[] = "--dnssleep 960"; - break; - case 'dns_loopia': - $proc_env['LOOPIA_Api'] = (string)$valObj->dns_loopia_api; - $proc_env['LOOPIA_User'] = (string)$valObj->dns_loopia_user; - $proc_env['LOOPIA_Password'] = (string)$valObj->dns_loopia_password; - break; - case 'dns_lua': - $proc_env['LUA_Key'] = (string)$valObj->dns_lua_key; - $proc_env['LUA_Email'] = (string)$valObj->dns_lua_email; - break; - case 'dns_me': - $proc_env['ME_Key'] = (string)$valObj->dns_me_key; - $proc_env['ME_Secret'] = (string)$valObj->dns_me_secret; - break; - case 'dns_miab': - $proc_env['MIAB_Username'] = (string)$valObj->dns_miab_user; - $proc_env['MIAB_Password'] = (string)$valObj->dns_miab_password; - $proc_env['MIAB_Server'] = (string)$valObj->dns_miab_server; - break; - case 'dns_namecheap': - $proc_env['NAMECHEAP_USERNAME'] = (string)$valObj->dns_namecheap_user; - $proc_env['NAMECHEAP_API_KEY'] = (string)$valObj->dns_namecheap_api; - if (!empty((string)$valObj->dns_namecheap_sourceip)) { - $proc_env['NAMECHEAP_SOURCEIP'] = (string)$valObj->dns_namecheap_sourceip; - } else { - // Use a public service to get our source IP for Namecheap API - $proc_env['NAMECHEAP_SOURCEIP'] = 'https://ifconfig.co/ip'; - } - break; - case 'dns_namecom': - $proc_env['Namecom_Username'] = (string)$valObj->dns_namecom_user; - $proc_env['Namecom_Token'] = (string)$valObj->dns_namecom_token; - break; - case 'dns_namesilo': - $proc_env['Namesilo_Key'] = (string)$valObj->dns_namesilo_key; - // Namesilo applies changes to DNS records only every 15 minutes. - $acme_hook_options[] = "--dnssleep 960"; - break; - case 'dns_netcup': - $proc_env['NC_CID'] = (string)$valObj->dns_netcup_cid; - $proc_env['NC_Apikey'] = (string)$valObj->dns_netcup_key; - $proc_env['NC_Apipw'] = (string)$valObj->dns_netcup_pw; - // netcup applies changes to DNS records only every 10 minutes. - $acme_hook_options[] = "--dnssleep 600"; - break; - case 'dns_nsone': - $proc_env['NS1_Key'] = (string)$valObj->dns_nsone_key; - break; - case 'dns_nsupdate': - // Write secret key to filesystem - $secret_key_data = (string)$valObj->dns_nsupdate_key . "\n"; - file_put_contents($secret_key_filename, $secret_key_data); - $proc_env['NSUPDATE_KEY'] = $secret_key_filename; - $proc_env['NSUPDATE_SERVER'] = (string)$valObj->dns_nsupdate_server; - $proc_env['NSUPDATE_ZONE'] = (string)$valObj->dns_nsupdate_zone; - break; - case 'dns_opnsense': - # BIND plugin must be installed. - if ((string)$modelObj->isPluginInstalled('bind') != "1") { - log_error("AcmeClient: BIND plugin is NOT installed. Please install os-bind."); - return(1); - } - $proc_env['OPNs_Host'] = (string)$valObj->dns_opnsense_host; - $proc_env['OPNs_Port'] = (string)$valObj->dns_opnsense_port; - $proc_env['OPNs_Key'] = (string)$valObj->dns_opnsense_key; - $proc_env['OPNs_Token'] = (string)$valObj->dns_opnsense_token; - $proc_env['OPNs_Api_Insecure'] = (string)$valObj->dns_opnsense_insecure; - break; - case 'dns_ovh': - $proc_env['OVH_AK'] = (string)$valObj->dns_ovh_app_key; - $proc_env['OVH_AS'] = (string)$valObj->dns_ovh_app_secret; - $proc_env['OVH_CK'] = (string)$valObj->dns_ovh_consumer_key; - $proc_env['OVH_END_POINT'] = (string)$valObj->dns_ovh_endpoint; - break; - case 'dns_pdns': - $proc_env['PDNS_Url'] = (string)$valObj->dns_pdns_url; - $proc_env['PDNS_ServerId'] = (string)$valObj->dns_pdns_serverid; - $proc_env['PDNS_Token'] = (string)$valObj->dns_pdns_token; - break; - case 'dns_pleskxml': - $proc_env['pleskxml_user'] = (string)$valObj->dns_pleskxml_user; - $proc_env['pleskxml_pass'] = (string)$valObj->dns_pleskxml_pass; - $proc_env['pleskxml_uri'] = (string)$valObj->dns_pleskxml_uri; - break; - case 'dns_schlundtech': - $proc_env['SCHLUNDTECH_USER'] = (string)$valObj->dns_schlundtech_user; - $proc_env['SCHLUNDTECH_PASSWORD'] = (string)$valObj->dns_schlundtech_password; - break; - case 'dns_selectel': - $proc_env['SL_Key'] = (string)$valObj->dns_sl_key; - break; - case 'dns_servercow': - $proc_env['SERVERCOW_API_Username'] = (string)$valObj->dns_servercow_username; - $proc_env['SERVERCOW_API_Password'] = (string)$valObj->dns_servercow_password; - break; - case 'dns_unoeuro': - $proc_env['UNO_Key'] = (string)$valObj->dns_uno_key; - $proc_env['UNO_User'] = (string)$valObj->dns_uno_user; - break; - case 'dns_variomedia': - $proc_env['VARIOMEDIA_API_TOKEN'] = (string)$valObj->dns_variomedia_key; - break; - case 'dns_vscale': - $proc_env['VSCALE_API_KEY'] = (string)$valObj->dns_vscale_key; - break; - case 'dns_yandex': - $proc_env['PDD_Token'] = (string)$valObj->dns_yandex_token; - break; - case 'dns_zilore': - $proc_env['Zilore_Key'] = (string)$valObj->dns_zilore_key; - break; - case 'dns_zonomi': - $proc_env['ZM_Key'] = (string)$valObj->dns_zm_key; - break; - default: - log_error("AcmeClient: invalid DNS-01 service specified: " . (string)$valObj->dns_service); - return(1); - } - } - - // Prepare altNames - $altnames = ""; - - // Main domain: Use DNS alias mode for domain validation? - // https://github.com/Neilpang/acme.sh/wiki/DNS-alias-mode - if ($val_method == 'dns01') { - switch ((string)$certObj->aliasmode) { - case 'automatic': - $name = "_acme-challenge." . ltrim((string)$certObj->name, '*.'); - if ($dst = dns_get_record($name, DNS_CNAME)) { - $altnames .= "--domain-alias " . $dst[0]['target'] . " "; - } - break; - case 'domain': - $altnames .= "--domain-alias " . (string)$certObj->domainalias . " "; - break; - case 'challenge': - $altnames .= "--challenge-alias " . (string)$certObj->challengealias . " "; - break; - } - } - - if (!empty((string)$certObj->altNames)) { - $_altnames = explode(",", (string)$certObj->altNames); - foreach (explode(",", (string)$certObj->altNames) as $altname) { - $altnames .= "--domain ${altname} "; - - // altNames: Use DNS alias mode for domain validation? - // https://github.com/Neilpang/acme.sh/wiki/DNS-alias-mode - if ($val_method == 'dns01') { - switch ((string)$certObj->aliasmode) { - case 'automatic': - $name = "_acme-challenge." . ltrim($altname, '*.'); - if ($dst = dns_get_record($name, DNS_CNAME)) { - $altnames .= "--domain-alias " . $dst[0]['target'] . " "; - } - break; - case 'domain': - $altnames .= "--domain-alias " . (string)$certObj->domainalias . " "; - break; - case 'challenge': - $altnames .= "--challenge-alias " . (string)$certObj->challengealias . " "; - break; - } - } - } - } - - // Teach acme.sh about DNS API hook location - $proc_env['_SCRIPT_HOME'] = '/usr/local/share/examples/acme.sh'; - - // Get the chosen key length from xml and trim the parameter before passing to acme client - $key_length = (string) $certObj->keyLength; - $key_length = substr($key_length, 4); - - if ($key_length == 'ec256' || $key_length == 'ec384') { - if ($acme_action == "renew") { - // if it's renew then pass --ecc to acme client to locate the correct cert directory - $acme_args[] = "--ecc"; - } - $key_length = substr_replace($key_length, '-', 2, 0); - } - - // if OCSP Extension is turned on pass --ocsp parameter to acme client - if (isset($certObj->ocsp) and ($certObj->ocsp == 1)) { - $acme_args[] = "--ocsp"; - } - - // Run acme client - // NOTE: We "export" certificates to our own directory, so we don't have to deal - // with domain names in filesystem, but instead can use the ID of our certObj. - $acmecmd = "/usr/local/sbin/acme.sh " - . implode(" ", $acme_args) . " " - . "--${acme_action} " - . "--days " . (string)$certObj->renewInterval . " " - . "--domain " . (string)$certObj->name . " " - . $altnames - . $acme_validation . " " - . "--home /var/etc/acme-client/home " - . "--keylength " . $key_length . " " - . "--accountconf " . $account_conf_file . " " - . "--certpath ${cert_filename} " - . "--keypath ${key_filename} " - . "--capath ${cert_chain_filename} " - . "--fullchainpath ${cert_fullchain_filename} " - . implode(" ", $acme_hook_options); - $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); - - // Make sure the resource could be setup properly - if (is_resource($proc)) { - // Close all pipes - fclose($proc_pipes[0]); - fclose($proc_pipes[1]); - fclose($proc_pipes[2]); - // Get exit code - $result = proc_close($proc); - } else { - log_error("AcmeClient: unable to start acme client process"); - return(1); - } - - // HTTP-01: flush OPNsense port forward rules - if (($val_method == 'http01') and ((string)$valObj->http_service == 'opnsense')) { - mwexec('/sbin/pfctl -a acme-client -F all'); - // XXX: workaround to solve disconnection issues reported by some users - $response = $backend->configdRun('filter reload'); - } - - // Check validation result - if ($result) { - log_error("AcmeClient: domain validation failed"); - return(1); - } - - // Simply return acme clients exit code - return($result); -} - -// Revoke a certificate. -function revoke_cert($certObj, $valObj, $acctObj) -{ - // NOTE: Revocation will fail if additional domain names were added - // to the certificate after issue/renewal. - - // Prepare optional parameters for acme-client - $acme_args = eval_optional_acme_args(); - - // Collect account information - $acme_env = (string)$modelObj->settings->environment; - $account_conf_dir = "/var/etc/acme-client/accounts/" . $acctObj->id . "_${acme_env}"; - $account_conf_file = $account_conf_dir . "/account.conf"; - - // Generate certificate filenames - $cert_id = (string)$certObj->id; - - // Check if EC certificate is used, if yes add the --ecc parameter to acme client - $key_length = (string) $certObj->keyLength; - $ecc_param = " "; - if ($key_length == 'key_ec256' || $key_length == 'key_ec384') { - $ecc_param = "--ecc"; - } - - // Run acme client - // NOTE: We "export" certificates to our own directory, so we don't have to deal - // with domain names in filesystem, but instead can use the ID of our certObj. - $acmecmd = "/usr/local/sbin/acme.sh " - . implode(" ", $acme_args) . " " - . "--revoke " - . "--domain " . (string)$certObj->name . " " - . "--home /var/etc/acme-client/home " - . "--accountconf " . $account_conf_file . " " - . $ecc_param; - $result = mwexec($acmecmd); - - // Simply return acme clients exit code - return($result); -} - -// Remove a cert from list of certs known to acme.sh. -function remove_cert($certObj) -{ - // Prepare optional parameters for acme-client - $acme_args = eval_optional_acme_args(); - - // Generate certificate filenames - $cert_id = (string)$certObj->id; - - // Check if EC certificate is used, if yes add the --ecc parameter to acme client - $key_length = (string) $certObj->keyLength; - $ecc_param = " "; - if ($key_length == 'key_ec256' || $key_length == 'key_ec384') { - $ecc_param = "--ecc"; - } - - // Run acme client - $acmecmd = "/usr/local/sbin/acme.sh " - . implode(" ", $acme_args) . " " - . "--remove " - . "--domain " . (string)$certObj->name . " " - . "--home /var/etc/acme-client/home " - . $ecc_param; - $result = mwexec($acmecmd); - - $cert_files = [ - "/var/etc/acme-client/keys/${cert_id}/private.key", - "/var/etc/acme-client/certs/${cert_id}/cert.pem", - "/var/etc/acme-client/certs/${cert_id}/chain.pem", - "/var/etc/acme-client/certs/${cert_id}/fullchain.pem", - ]; - - foreach ($cert_files as $_file) { - if (file_exists($_file)) { - unlink($_file); - } - } - - // Simply return acme clients exit code - return($result); -} - -function import_certificate($certObj, $modelObj) -{ - global $config; - - $cert_id = (string)$certObj->id; - $cert_filename = "/var/etc/acme-client/certs/${cert_id}/cert.pem"; - $cert_chain_filename = "/var/etc/acme-client/certs/${cert_id}/chain.pem"; - $cert_fullchain_filename = "/var/etc/acme-client/certs/${cert_id}/fullchain.pem"; - $key_filename = "/var/etc/acme-client/keys/${cert_id}/private.key"; - - // Check if certificate files can be found - clearstatcache(); // don't let the cache fool us - foreach (array($cert_filename, $key_filename, $cert_chain_filename, $cert_fullchain_filename) as $file) { - if (is_file($file)) { - // certificate file found - } else { - log_error("AcmeClient: unable to import certificate, file not found: ${file}"); - return(1); - } - } - - /* - * Step 1: import CA - */ - - // Read contents from CA file - $ca_content = @file_get_contents($cert_chain_filename); - if ($ca_content != false) { - $ca_subject = cert_get_subject($ca_content, false); - $ca_serial = cert_get_serial($ca_content, false); - $ca_cn = local_cert_get_cn($ca_content, false); - $ca_issuer = cert_get_issuer($ca_content, false); - $ca_purpose = cert_get_purpose($ca_content, false); - } else { - log_error("AcmeClient: unable to read CA certificate content from file"); - return(1); - } - - // Prepare CA for import in Cert Manager - $ca = array(); - $ca['crt'] = base64_encode($ca_content); - $ca['refid'] = uniqid(); - $ca_found = false; - - // Check if CA was previously imported - $cacnt = 0; - foreach ($config['ca'] as $cacrt) { - $cacrt_subject = cert_get_subject($cacrt['crt'], true); - $cacrt_issuer = cert_get_issuer($cacrt['crt'], true); - if (($ca_subject == $cacrt_subject) and ($ca_issuer == $cacrt_issuer)) { - // Use old refid instead of generating a new one - $ca['refid'] = (string)$cacrt['refid']; - $ca_found = true; - break; - } - $cacnt++; - } - - // Collect required CA information - $ca_cn = local_cert_get_cn($ca_content, false); - $ca['descr'] = (string)$ca_cn . ' (Let\'s Encrypt)'; - - // Prepare CA for import - local_ca_import($ca, $ca_content); - - // Update existing CA? - if ($ca_found == true) { - $config['ca'][$cacnt] = $ca; - } else { - // Create new CA item - $config['ca'][] = $ca; - log_error("AcmeClient: importing Let's Encrypt CA: ${ca_cn}"); - } - - /* - * Step 2: import certificate - */ - - // Read contents from certificate file - $cert_content = @file_get_contents($cert_filename); - if ($cert_content != false) { - $cert_subject = cert_get_subject($cert_content, false); - $cert_serial = cert_get_serial($cert_content, false); - $cert_cn = local_cert_get_cn($cert_content, false); - $cert_issuer = cert_get_issuer($cert_content, false); - $cert_purpose = cert_get_purpose($cert_content, false); - } else { - log_error("AcmeClient: unable to read certificate content from file"); - return(1); - } - - // Prepare certificate for import in Cert Manager - $cert = array(); - $cert_refid = uniqid(); - $cert['refid'] = $cert_refid; - $cert['caref'] = (string)$ca['refid']; - $import_log_message = 'Imported'; - $cert_found = false; - - // Check if cert was previously imported - if (isset($certObj->certRefId)) { - // Check if the imported certificate can still be found - $configObj = Config::getInstance()->object(); - foreach ($configObj->cert as $cfgCert) { - // Check if the IDs matches - if ((string)$certObj->certRefId == (string)$cfgCert->refid) { - $cert_found = true; - break; - } - } - // Existing cert? - if ($cert_found == true) { - // Use old refid instead of generating a new one - $cert_refid = (string)$certObj->certRefId; - $import_log_message = 'Updated'; - } - } else { - // Not found. Just import as new cert. - } - - // Read private key - $key_content = @file_get_contents($key_filename); - if ($key_content == false) { - log_error("AcmeClient: unable to read private key from file: ${key_filename}"); - return(1); - } - - // Collect required cert information - $cert_cn = local_cert_get_cn($cert_content, false); - $cert['descr'] = (string)$cert_cn . ' (Let\'s Encrypt)'; - $cert['refid'] = $cert_refid; - - // Prepare certificate for import - cert_import($cert, $cert_content, $key_content); - - // Update existing certificate? - if ($cert_found == true) { - // FIXME: Do legacy configs really depend on counters? - $cnt = 0; - foreach ($config['cert'] as $crt) { - if ($crt['refid'] == $cert_refid) { - $config['cert'][$cnt] = $cert; - break; - } - $cnt++; - } - } else { - // Create new certificate item - $config['cert'][] = $cert; - } - - /* - * Step 3: update configuration - */ - - // Write changes to config - // TODO: Legacy code, should be replaced with code from OPNsense framework - write_config("${import_log_message} Let's Encrypt X.509 certificate: ${cert_cn}"); - log_error("AcmeClient: ${import_log_message} Let's Encrypt X.509 certificate: ${cert_cn}"); - - // Update (acme) certificate object (through MVC framework) - $uuid = $certObj->attributes()->uuid; - $node = $modelObj->getNodeByReference('certificates.certificate.' . $uuid); - if ($node != null) { - // Add refid to certObj - $node->certRefId = $cert_refid; - // Set update/create time - $node->lastUpdate = time(); - // if node was found, serialize to config and save - $modelObj->serializeToConfig(); - Config::getInstance()->save(); - Config::getInstance()->forceReload(); - } else { - log_error("AcmeClient: unable to update LE certificate object"); - return(1); - } - - return(0); -} - -function run_restart_actions($certlist, $modelObj) -{ - global $config; - $return = 0; - $configObj = Config::getInstance()->object(); - - // Required to run pre-defined commands. - $backend = new Backend(); - - // NOTE: Do NOT run any automation twice, collect duplicates first. - $restart_actions = array(); - - // Check if there's something to do. - if (!empty($certlist) and is_array($certlist)) { - // Extract cert object - foreach ($certlist as $certObj) { - // Make sure the object is functional. - if (empty($certObj->id)) { - log_error("AcmeClient: failed to query certificate for automation"); - continue; - } - // Extract automations - if (empty((string)$certObj->restartActions)) { - // No automations configured. - continue; - } - $_actions = explode(',', $certObj->restartActions); - // Walk through all linked automations. - foreach ($_actions as $_action) { - // Extract automations - $action = $modelObj->getByActionID($_action); - // Make sure the object is functional. - if ($action === null) { - log_error("AcmeClient: failed to retrieve automations from certificate"); - } else { - // Ignore disabled automations (even if they are still - // linked to a certificated). - if ((string)$action->enabled === "0") { - continue; - } - // Store by UUID, automatically eliminates duplicates. - $_data = array(); - $_data['obj'] = $action; - $_data['cert_id'] = $certObj->id; - $restart_actions[$_action] = $_data; - } - } - } - } - - // Run the collected automations. - if (!empty($restart_actions) and is_array($restart_actions)) { - // Extract cert object - foreach ($restart_actions as $_action) { - $action = $_action['obj']; - $cert_id = $_action['cert_id']; - $action_id = $action->id; - // Run pre-defined or custom command? - log_error("AcmeClient: running automation: " . $action->name); - switch ((string)$action->type) { - case 'restart_gui': - $response = $backend->configdRun('webgui restart 2', true); - break; - case 'restart_haproxy': - $response = $backend->configdRun("haproxy restart"); - break; - case 'restart_nginx': - $response = $backend->configdRun("nginx restart"); - break; - case 'upload_highwinds': - $response = $backend->configdRun("acmeclient upload_highwinds ${cert_id} ${action_id}"); - break; - case 'upload_sftp': - $response = $backend->configdRun("acmeclient upload-sftp ${cert_id} ${action_id}"); - break; - case 'configd': - // Make sure a configd command was specified. - if (empty((string)$action->configd)) { - log_error("AcmeClient: no configd command specified for automation: " . $action->name); - $result = '1'; - } else { - $response = $backend->configdRun((string)$action->configd); - } - break; - default: - log_error("AcmeClient: an invalid automation was specified: " . (string)$action->type); - $return = 1; - break; - } - } - } - - return($return); -} - -/* Update certificate object to log the status of the current acme run. - * Supported status codes are: - * 100 pending - * 200 issue/renew OK - * 250 certificate revoked - * 300 configuration error (validation method, account, ...) - * 400 issue/renew failed - * 500 internal error (code issues, bad luck, unexpected errors, ...) - * Feel free to add more status codes to make it more useful. -*/ -function log_cert_acme_status($certObj, $modelObj, $statusCode) -{ - global $postponed_updates; - - $uuid = $certObj->attributes()->uuid; - $node = $modelObj->getNodeByReference('certificates.certificate.' . $uuid); - if ($node != null) { - $postponed_updates[] = array( - 'uuid' => (string)$uuid, - 'statusCode' => $statusCode, - 'statusLastUpdate' => time()); - } else { - log_error("AcmeClient: unable to update acme status for certificate " . (string)$certObj->name); - return(1); - } -} - -/* Write postponed certificate status updates to the configuration. - * This workaround seems to fix the "Node no longer exists" error - * that haunted us for quite some time. -*/ -function dump_postponed_updates() -{ - global $postponed_updates; - - $status_descr = [ - 100 => 'unknown', - 200 => 'OK', - 250 => 'cert revoked', - 300 => 'configuration error', - 400 => 'validation failed', - 500 => 'internal error', - ]; - - $modelObj = new OPNsense\AcmeClient\AcmeClient(); - - foreach ($postponed_updates as $pupdate) { - $_statusCode = $pupdate['statusCode']; - $_uuid = $pupdate['uuid']; - $node = $modelObj->getNodeByReference('certificates.certificate.' . $_uuid); - if ($node != null) { - log_error("AcmeClient: storing status '" . $status_descr[$_statusCode] . "' for cert " . (string)$node->name); - $node->statusCode = $_statusCode; - $node->statusLastUpdate = $pupdate['statusLastUpdate']; - // serialize to config and save - $modelObj->serializeToConfig(); - Config::getInstance()->save(); - Config::getInstance()->forceReload(); - } else { - log_error(sprintf("AcmeClient: failed to store status '%s' for cert %s: node not found", $status_descr[$_statusCode], $_uuid)); - } - } -} - -function run_shell_command($proc_cmd, $proc_env = array()) -{ - $proc_desc = array( // descriptor array for proc_open() - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - 2 => array("pipe", "w") // stderr - ); - $proc_pipes = array(); - $proc = proc_open($proc_cmd, $proc_desc, $proc_pipes, null, $proc_env); - - // Make sure the resource could be setup properly - if (is_resource($proc)) { - // Close all pipes - fclose($proc_pipes[0]); - fclose($proc_pipes[1]); - fclose($proc_pipes[2]); - // Get exit code - $result = proc_close($proc); - log_error(sprintf("AcmeClient: The shell command '%s' returned exit code '%d'", $proc_cmd, $result)); - return($result); - } else { - log_error(sprintf("AcmeClient: Unable to prepare shell command '%s'", $proc_cmd)); - return(1); - } -} - -// taken from certs.inc -function local_cert_get_subject_array($str_crt, $decode = true) -{ - if ($decode) { - $str_crt = base64_decode($str_crt); - } - $inf_crt = openssl_x509_parse($str_crt); - $components = $inf_crt['subject']; - - if (!is_array($components)) { - return; - } - - $subject_array = array(); - - foreach ($components as $a => $v) { - $subject_array[] = array('a' => $a, 'v' => $v); - } - - return $subject_array; -} - -// taken from certs.inc -function local_cert_get_cn($crt, $decode = true) -{ - $sub = local_cert_get_subject_array($crt, $decode); - if (is_array($sub)) { - foreach ($sub as $s) { - if (strtoupper($s['a']) == "CN") { - return $s['v']; - } - } - } - return ""; -} - -// taken from system_camanager.php -function local_ca_import(&$ca, $str, $key = "", $serial = 0) -{ - global $config; - - $ca['crt'] = base64_encode($str); - if (!empty($key)) { - $ca['prv'] = base64_encode($key); - } - if (!empty($serial)) { - $ca['serial'] = $serial; - } - $subject = cert_get_subject($str, false); - $issuer = cert_get_issuer($str, false); - - // Find my issuer unless self-signed - if ($issuer != $subject) { - $issuer_crt =& lookup_ca_by_subject($issuer); - if ($issuer_crt) { - $ca['caref'] = $issuer_crt['refid']; - } - } - - /* Correct if child certificate was loaded first */ - if (is_array($config['ca'])) { - foreach ($config['ca'] as & $oca) { - $issuer = cert_get_issuer($oca['crt']); - if ($ca['refid'] != $oca['refid'] && $issuer == $subject) { - $oca['caref'] = $ca['refid']; - } - } - } - if (is_array($config['cert'])) { - foreach ($config['cert'] as & $cert) { - $issuer = cert_get_issuer($cert['crt']); - if ($issuer == $subject) { - $cert['caref'] = $ca['refid']; - } - } - } - return true; -} - -function base64url_encode($str) -{ - return rtrim(strtr(base64_encode($str), '+/', '-_'), '='); -} -function base64url_decode($str) -{ - return base64_decode(str_pad(strtr($str, '-_', '+/'), strlen($str) % 4, '=', STR_PAD_RIGHT)); -} - -exit; diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php new file mode 100755 index 0000000000..0b47d933d3 --- /dev/null +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php @@ -0,0 +1,193 @@ +#!/usr/local/bin/php + [ + 'description' => 'issue or renew certificates', + ], + 'import' => [ + 'description' => 're-import certificate into trust store', + ], + 'revoke' => [ + 'description' => 'revoke the specified certificate', + ], + 'remove' => [ + 'description' => 'remove all files and configuration for the specified certificate', + ], + 'reset' => [ + 'description' => 'reset the specified certificate by removing it\'s private key', + ], + 'automation' => [ + 'description' => 'run automations for the specified certificate', + ], + 'register' => [ + 'description' => 'register the specified account with Lets Encrypt', + ], +]; + +// Supported command line options and their usage information. +const STATIC_OPTIONS = << $options) { + echo "\"$name\" - {$options["description"]}" . PHP_EOL; + } + + echo PHP_EOL . "Examples:" . PHP_EOL + . str_replace('/\r\n|\n|\r/g', PHP_EOL, EXAMPLES) + . PHP_EOL . PHP_EOL; +} + +/** + * check if the specified mode is supported + */ +function validateMode($mode) +{ + $return = false; + foreach (MODES as $name => $options) { + if ($mode === $name) { + $return = true; + break; + } + } + return $return; +} + +function main() +{ + // Parse command line arguments + $options = getopt('h', ['account:', 'all', 'cert:', 'force', 'help', 'mode:']); + $force = isset($options['force']) ? true : false; + + // Verify mode and arguments + if (empty($options) || isset($options['h']) || isset($options['help']) || + (isset($options['mode']) and !validateMode($options['mode']))) { + // Not enough or invalid arguments specified. + help(); + } elseif (($options['mode'] === 'issue') && (isset($options['cert']) || isset($options['all']))) { + // Work on all or only on a single certificate + if (isset($options['all'])) { + // Iterate over all certificates + $config = OPNsense\Core\Config::getInstance()->object(); + $acme = $config->OPNsense->AcmeClient; + + // Iterate over all certificates + foreach ($acme->certificates->children() as $certCfg) { + $cert_uuid = (string)$certCfg->attributes()['uuid']; + $cert = new LeCertificate($cert_uuid, $force); + // NOTE: Disabled certificates are automatically ignored by LeCertificate. + $cert->issue(); + } + } else { + // NOTE: Disabled certificates are automatically ignored by LeCertificate. + $cert = new LeCertificate($options['cert'], $force); + $cert->issue(); + } + } elseif ($options['mode'] === 'import' && isset($options['cert'])) { + $cert = new LeCertificate($options['cert']); + $cert->import(); + } elseif ($options['mode'] === 'revoke' && isset($options['cert'])) { + $cert = new LeCertificate($options['cert']); + $cert->revoke(); + } elseif ($options['mode'] === 'remove' && isset($options['cert'])) { + $cert = new LeCertificate($options['cert']); + $cert->remove(); + } elseif ($options['mode'] === 'reset' && isset($options['cert'])) { + $cert = new LeCertificate($options['cert']); + $cert->reset(); + } elseif ($options['mode'] === 'automation' && isset($options['cert'])) { + $cert = new LeCertificate($options['cert']); + $cert->runAutomations(); + } elseif ($options['mode'] === 'register' && isset($options['account'])) { + $account = new LeAccount($options['account']); + $account->register(); + } else { + // Fallback to help + help(); + } +} + +// Run! +main(); diff --git a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf index 6122512e0b..1b90696405 100644 --- a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf +++ b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf @@ -42,48 +42,54 @@ message:testing acme_http_challenge configuration ########################################## [sign-cert] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -F -a sign -c +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode issue --force --cert parameters:%s type:script message:signing or renewing a certificate [revoke-cert] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -a revoke -c +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode revoke --cert parameters:%s type:script message:revoking a certificate [remove-cert] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -a remove -c +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode remove --cert parameters:%s type:script message:removing a certificate [remove-key] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -a removekey -c +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode reset --cert parameters:%s type:script message:removing a certificate private key [sign-all-certs] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -a sign -A +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode issue --all parameters: type:script -message:signing or renewing a certificate +message:signing or renewing all certificates [run-automation] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -a automation -c +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode automation --cert parameters:%s type:script message:running automations for a certificate [cron-auto-renew] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/certhelper.php -a sign -A -C +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode issue --all parameters: type:script message:cronjob running to sign or renew certificates description:Renew Let's Encrypt certificates +[register-account] +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode register --account +parameters:%s +type:script +message:registering an account + [upload_highwinds] command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/upload_highwinds.php parameters:-c %s -a %s From bacea2cdc82437920fe50b065787aac14a77dbb4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 14 Sep 2020 11:59:52 +0200 Subject: [PATCH 0210/3088] mail/postfix: as discussed E-Mail address is welcome, real name also... GitHub link not good for direct communication. --- .../Postfix/Api/HeaderchecksController.php | 2 +- .../Postfix/HeaderchecksController.php | 2 +- .../models/OPNsense/Postfix/Headerchecks.php | 47 ++++++++-------- .../views/OPNsense/Postfix/headerchecks.volt | 53 +++++++++---------- 4 files changed, 53 insertions(+), 51 deletions(-) diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/Api/HeaderchecksController.php b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/Api/HeaderchecksController.php index 0ff6e04f94..25e1f49b7e 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/Api/HeaderchecksController.php +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/Api/HeaderchecksController.php @@ -1,7 +1,7 @@ + * Copyright (C) 2020 Starkstromkonsument * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/HeaderchecksController.php b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/HeaderchecksController.php index 8c42454d1e..ba4e6e7dd6 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/HeaderchecksController.php +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/HeaderchecksController.php @@ -1,7 +1,7 @@ + * Copyright (C) 2020 Starkstromkonsument * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.php b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.php index c55a4646b0..be9da069a9 100644 --- a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.php +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/Headerchecks.php @@ -1,31 +1,34 @@ - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - class Headerchecks extends BaseModel { } diff --git a/mail/postfix/src/opnsense/mvc/app/views/OPNsense/Postfix/headerchecks.volt b/mail/postfix/src/opnsense/mvc/app/views/OPNsense/Postfix/headerchecks.volt index 320fb4fa07..c33b317d44 100644 --- a/mail/postfix/src/opnsense/mvc/app/views/OPNsense/Postfix/headerchecks.volt +++ b/mail/postfix/src/opnsense/mvc/app/views/OPNsense/Postfix/headerchecks.volt @@ -1,31 +1,30 @@ {# - -OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. -Copyright (C) 2020 Starkstromkonsument -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -#} + # + # Copyright (C) 2014-2017 Deciso B.V. + # Copyright (C) 2020 Starkstromkonsument + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} + diff --git a/sysutils/hw-probe/src/opnsense/service/conf/actions.d/actions_hwprobe.conf b/sysutils/hw-probe/src/opnsense/service/conf/actions.d/actions_hwprobe.conf new file mode 100644 index 0000000000..14c0771a83 --- /dev/null +++ b/sysutils/hw-probe/src/opnsense/service/conf/actions.d/actions_hwprobe.conf @@ -0,0 +1,5 @@ +[report] +command:/usr/local/bin/hw-probe +parameters: +type:script_output +message:collecting hardware diagnostics From 870d67212d760b32c3c66527c116ad1f474f712f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 22 Oct 2020 09:20:51 +0200 Subject: [PATCH 0246/3088] sysutils/hw-probe: small post-merges update --- README.md | 1 + sysutils/hw-probe/pkg-descr | 2 +- .../src/opnsense/mvc/app/views/OPNsense/Hwprobe/general.volt | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff0ae9493a..3a2bd61496 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ sysutils/apuled -- PC Engine APU LED control (development only) sysutils/boot-delay -- Apply a persistent 10 second boot delay sysutils/dmidecode -- Display hardware information on the dashboard sysutils/git-backup -- Track config changes using git +sysutils/hw-probe -- Collect hardware diagnostics (development only) sysutils/lcdproc-sdeclcd -- LCDProc for SDEC LCD devices sysutils/mail-backup -- Send configuration file backup by e-mail sysutils/munin-node -- Munin monitorin agent diff --git a/sysutils/hw-probe/pkg-descr b/sysutils/hw-probe/pkg-descr index efb1be1a14..b88c0c15f8 100644 --- a/sysutils/hw-probe/pkg-descr +++ b/sysutils/hw-probe/pkg-descr @@ -1 +1 @@ -Send anonymized hardware diagnostics to https://bsd-hardware.info \ No newline at end of file +Send anonymized hardware diagnostics to https://bsd-hardware.info diff --git a/sysutils/hw-probe/src/opnsense/mvc/app/views/OPNsense/Hwprobe/general.volt b/sysutils/hw-probe/src/opnsense/mvc/app/views/OPNsense/Hwprobe/general.volt index 8e1a7d353c..ea8530ea91 100644 --- a/sysutils/hw-probe/src/opnsense/mvc/app/views/OPNsense/Hwprobe/general.volt +++ b/sysutils/hw-probe/src/opnsense/mvc/app/views/OPNsense/Hwprobe/general.volt @@ -51,4 +51,3 @@ }); }); - From be4dde9ec5c182862419a84545b365e5de5e3fbf Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 23 Oct 2020 15:44:09 +0200 Subject: [PATCH 0247/3088] net/haproxy: fix typo --- net/haproxy/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 0f76d393a1..60f0f6ba29 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -25,7 +25,7 @@ Fixed: Changed: * add "Save & Test syntax" button to all "Settings" pages * add "introduction" page for Settings tab -* streamine "Settings" subtabs +* streamline "Settings" subtabs 2.23 From fc8df54f5e8ea9fa32e32c363d248a8c224d4bc2 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 23 Oct 2020 22:37:36 +0200 Subject: [PATCH 0248/3088] net/haproxy: preserve sort order of default SSL bind options --- .../mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml | 1 + .../src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml index 33081d5766..add58fc535 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml @@ -91,6 +91,7 @@ select_multiple true + true diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 87f42e7f9a..3c7763fc7b 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -130,6 +130,7 @@ N no-sslv3,no-tlsv10,no-tls-tickets + Y Y no-sslv3 From 8e2e0e794097294903efffe7247572fab3b5b8e9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 23 Oct 2020 22:38:12 +0200 Subject: [PATCH 0249/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- net/haproxy/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 65767a88aa..98aea3903e 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 2.25 +PLUGIN_VERSION= 2.26 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy20 PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 60f0f6ba29..af22b3790d 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +2.26 + +Fixed: +* preserve sort order of default SSL bind options + 2.25 Added: From 2abe16402c4267a997e9b6386b127035514115e5 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 24 Oct 2020 14:11:33 +0200 Subject: [PATCH 0250/3088] net/frr: Update help-text in OSPF (#2081) --- .../OPNsense/Quagga/forms/dialogEditOSPFInterface.xml | 2 +- .../controllers/OPNsense/Quagga/forms/dialogEditOSPFNetwork.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml index a325af7cf6..b7091f4f01 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml @@ -30,7 +30,7 @@ interface.area text - Area in wildcard mask style like 0.0.0.0 and no decimal 0 + Area in wildcard mask style like 0.0.0.0 and no decimal 0. Only use Area in Interface tab or in Network tab once. interface.cost diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFNetwork.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFNetwork.xml index 2ec7968e82..f15e330eb4 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFNetwork.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFNetwork.xml @@ -18,7 +18,7 @@ network.area text - Area in wildcard mask style like 0.0.0.0 and no decimal 0 + Area in wildcard mask style like 0.0.0.0 and no decimal 0. Only use Area in Interface tab or in Network tab once. network.arearange From 60a4dfc6c5a1ffa2cf0fff10810b7d40fb8f057f Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 28 Oct 2020 12:26:10 +0100 Subject: [PATCH 0251/3088] Update actions_hwprobe.conf (#2084) --- .../src/opnsense/service/conf/actions.d/actions_hwprobe.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysutils/hw-probe/src/opnsense/service/conf/actions.d/actions_hwprobe.conf b/sysutils/hw-probe/src/opnsense/service/conf/actions.d/actions_hwprobe.conf index 14c0771a83..b28e768009 100644 --- a/sysutils/hw-probe/src/opnsense/service/conf/actions.d/actions_hwprobe.conf +++ b/sysutils/hw-probe/src/opnsense/service/conf/actions.d/actions_hwprobe.conf @@ -1,5 +1,5 @@ [report] -command:/usr/local/bin/hw-probe +command:/usr/local/bin/hw-probe -all -upload parameters: type:script_output message:collecting hardware diagnostics From e0c09fa3570858bfd02bf391fb15f2ff0b8883b1 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 5 Nov 2020 09:26:24 +0100 Subject: [PATCH 0252/3088] net/chrony: add NTS peer mode (#2087) --- net/chrony/Makefile | 2 +- net/chrony/pkg-descr | 4 ++++ .../app/controllers/OPNsense/Chrony/forms/general.xml | 6 ++++++ .../opnsense/mvc/app/models/OPNsense/Chrony/General.xml | 4 ++++ net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh | 6 +++--- .../service/templates/OPNsense/Chrony/chrony.conf | 9 ++++++++- 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/net/chrony/Makefile b/net/chrony/Makefile index 39c87599ff..0601f4f248 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= chrony -PLUGIN_VERSION= 1.0 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= Chrony time synchronisation PLUGIN_DEPENDS= chrony PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/chrony/pkg-descr b/net/chrony/pkg-descr index de8195fad6..4464c2fa7a 100644 --- a/net/chrony/pkg-descr +++ b/net/chrony/pkg-descr @@ -4,6 +4,10 @@ better in virtual environments. Plugin Changelog ---------------- +1.1 + +* Add NTS support + 1.0 * Allow to adjust the listening port diff --git a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml index ee8d8326c2..691a2b3b91 100644 --- a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml +++ b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml @@ -11,6 +11,12 @@ text Set the port chrony listen to. + + general.ntsclient + + checkbox + Enable NTS in client mode. This will add another layer of security for peers when OPNsense is the client. Every server in Peers has to support NTS. + general.peers diff --git a/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml index 30b99eb530..969b9fc178 100644 --- a/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml +++ b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml @@ -11,6 +11,10 @@ 323 Y + + 0 + Y + 0.opnsense.pool.ntp.org Y diff --git a/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh b/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh index ddc03d6a0c..ad9060012e 100755 --- a/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh +++ b/net/chrony/src/opnsense/scripts/OPNsense/Chrony/setup.sh @@ -1,5 +1,5 @@ #!/bin/sh -mkdir -p /var/db/chrony/ /var/run/chrony/ -chown -R chronyd:chronyd /var/db/chrony/ /var/run/chrony/ -chmod 750 /var/db/chrony/ /var/run/chrony/ +mkdir -p /var/db/chrony /var/lib/chrony /var/run/chrony +chown -R chronyd:chronyd /var/db/chrony /var/lib/chrony /var/run/chrony +chmod 750 /var/db/chrony /var/lib/chrony /var/run/chrony diff --git a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf index 38397c3a6f..e800d636df 100644 --- a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf +++ b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf @@ -4,9 +4,16 @@ port {{ OPNsense.chrony.general.port }} driftfile /var/db/chrony/drift pidfile /var/run/chrony/chronyd.pid +{% if helpers.exists('OPNsense.chrony.general.ntsclient') and OPNsense.chrony.general.ntsclient == '1' %} +ntsdumpdir /var/lib/chrony +ntstrustedcerts /etc/ssl/cert.pem +nosystemcert +{% endif %} + {% if not helpers.empty('OPNsense.chrony.general.peers') %} {% for peer in OPNsense.chrony.general.peers.split(',') %} -server {{ peer }} iburst +server {{ peer }} iburst {% if helpers.exists('OPNsense.chrony.general.ntsclient') and OPNsense.chrony.general.ntsclient == '1' %}nts{% endif %} + {% endfor %} {% endif %} From 33cf9b513c2bc3fdf63469ea769f65ddd793a485 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 9 Nov 2020 11:37:21 +0100 Subject: [PATCH 0253/3088] net/frr: add community-lists to BGP (#2078) --- net/frr/pkg-descr | 1 + .../OPNsense/Quagga/Api/BgpController.php | 30 +++++++++++- .../OPNsense/Quagga/BgpController.php | 3 +- .../forms/dialogEditBGPCommunityLists.xml | 38 ++++++++++++++ .../Quagga/forms/dialogEditBGPRouteMaps.xml | 8 +++ .../mvc/app/models/OPNsense/Quagga/BGP.xml | 49 +++++++++++++++++++ .../mvc/app/views/OPNsense/Quagga/bgp.volt | 43 +++++++++++++++- .../templates/OPNsense/Quagga/bgpd.conf | 16 ++++++ 8 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPCommunityLists.xml diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 76a1e094ee..4ded6be649 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -14,6 +14,7 @@ Plugin Changelog 1.18 * Add description fields to BGP tabs +* Add BGP community-lists 1.17 diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php index 27a9278dc9..3edbe1627e 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php @@ -3,7 +3,7 @@ /** * Copyright (C) 2015 - 2017 Deciso B.V. * Copyright (C) 2017 Fabian Franz - * Copyright (C) 2017 Michael Muenz + * Copyright (C) 2017 - 2020 Michael Muenz * * All rights reserved. * @@ -136,6 +136,34 @@ public function setPrefixlistAction($uuid) return $this->setBase('prefixlist', 'prefixlists.prefixlist', $uuid); } + public function searchCommunitylistAction() + { + return $this->searchBase( + 'communitylists.communitylist', + array("enabled", "description", "number", "seqnumber", "action", "community" ) + ); + } + public function getCommunitylistAction($uuid = null) + { + $this->sessionClose(); + return $this->getBase('communitylist', 'communitylists.communitylist', $uuid); + } + + public function addCommunitylistAction() + { + return $this->addBase('communitylist', 'communitylists.communitylist'); + } + + public function delCommunitylistAction($uuid) + { + return $this->delBase('communitylists.communitylist', $uuid); + } + + public function setCommunitylistAction($uuid) + { + return $this->setBase('communitylist', 'communitylists.communitylist', $uuid); + } + public function searchRoutemapAction() { return $this->searchBase( diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/BgpController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/BgpController.php index 9b5ed53343..aaf3110635 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/BgpController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/BgpController.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Fabian Franz - Copyright (C) 2017 Michael Muenz + Copyright (C) 2017 - 2020 Michael Muenz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -33,6 +33,7 @@ public function indexAction() $this->view->formDialogEditBGPNeighbor = $this->getForm("dialogEditBGPNeighbor"); $this->view->formDialogEditBGPASPaths = $this->getForm("dialogEditBGPASPath"); $this->view->formDialogEditBGPPrefixLists = $this->getForm("dialogEditBGPPrefixLists"); + $this->view->formDialogEditBGPCommunityLists = $this->getForm("dialogEditBGPCommunityLists"); $this->view->formDialogEditBGPRouteMaps = $this->getForm("dialogEditBGPRouteMaps"); $this->view->pick('OPNsense/Quagga/bgp'); } diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPCommunityLists.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPCommunityLists.xml new file mode 100644 index 0000000000..a2755510a8 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPCommunityLists.xml @@ -0,0 +1,38 @@ +
    + + communitylist.enabled + + checkbox + Enable / Disable + + + communitylist.description + + text + Add an optional description for this Community-List. + + + communitylist.number + + text + Set the number of your Community-List. 1-99 are stardard lists while 100-500 are expanded lists. + + + communitylist.seqnumber + + text + The ACL sequence number (10-99) + + + communitylist.action + + select_multiple + Set permit for match or deny to negate the rule. + + + communitylist.community + + text + The community you want to match. You can also regex and it is not validated so please be careful. + +
    diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPRouteMaps.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPRouteMaps.xml index 31fe3b5c69..8922641212 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPRouteMaps.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPRouteMaps.xml @@ -44,6 +44,14 @@ true Select the Prefix List. +
    + + routemap.match3 + + select_multiple + + true + Select the Community List. routemap.set diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml index 4d11fa76d3..0abecfd3b3 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml @@ -202,6 +202,43 @@ + + + + 1 + Y + + + + N + + + + Y + 1 + 500 + Set a number between 1 and 500. + + + + Y + 10 + 99 + + + + Y + + Permit + Deny + + + + + Y + + + @@ -256,6 +293,18 @@ N N + + + + + Related item not found + N + N + N diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/bgp.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/bgp.volt index 635b21985c..461ea62a71 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/bgp.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/bgp.volt @@ -2,7 +2,7 @@ OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. Copyright (C) 2017 Fabian Franz -Copyright (C) 2017 Michael Muenz +Copyright (C) 2017 - 2020 Michael Muenz All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Neighbors') }}
  • {{ lang._('AS Path Lists') }}
  • {{ lang._('Prefix Lists') }}
  • +
  • {{ lang._('Community Lists') }}
  • {{ lang._('Route Maps') }}
  • @@ -130,6 +131,34 @@ POSSIBILITY OF SUCH DAMAGE.
    +
    + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Number') }}{{ lang._('Description') }}{{ lang._('Secquence Number') }}{{ lang._('Action') }}{{ lang._('Community') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    + + + +
    +
    @@ -141,6 +170,7 @@ POSSIBILITY OF SUCH DAMAGE. + @@ -225,6 +255,16 @@ $(document).ready(function() { 'options':{selection:false, multiSelect:false} } ); + $("#grid-communitylists").UIBootgrid( + { 'search':'/api/quagga/bgp/searchCommunitylist', + 'get':'/api/quagga/bgp/getCommunitylist/', + 'set':'/api/quagga/bgp/setCommunitylist/', + 'add':'/api/quagga/bgp/addCommunitylist/', + 'del':'/api/quagga/bgp/delCommunitylist/', + 'toggle':'/api/quagga/bgp/toggleCommunitylist/', + 'options':{selection:false, multiSelect:false} + } + ); $("#grid-routemaps").UIBootgrid( { 'search':'/api/quagga/bgp/searchRoutemap', 'get':'/api/quagga/bgp/getRoutemap/', @@ -241,4 +281,5 @@ $(document).ready(function() { {{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPNeighbor,'id':'DialogEditBGPNeighbor','label':lang._('Edit Neighbor')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPASPaths,'id':'DialogEditBGPASPaths','label':lang._('Edit AS Paths')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPPrefixLists,'id':'DialogEditBGPPrefixLists','label':lang._('Edit Prefix Lists')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPCommunityLists,'id':'DialogEditBGPCommunityLists','label':lang._('Edit Community Lists')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPRouteMaps,'id':'DialogEditBGPRouteMaps','label':lang._('Edit Route Maps')])}} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index 9c75e0d822..abdf1f8d9c 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -180,6 +180,14 @@ bgp as-path access-list {{ aspath.number }} {{ aspath.action }} {{ aspath.as }} {% endfor %} {% endif %} ! +{% if helpers.exists('OPNsense.quagga.bgp.communitylists.communitylist') %} +{% for communitylist in helpers.sortDictList(OPNsense.quagga.bgp.communitylists.communitylist, 'number' ) %} +{% if communitylist.enabled == '1' %} +bgp community-list {{ communitylist.number }} seq {{ communitylist.seqnumber }} {{ communitylist.action }} {{ communitylist.community }} +{% endif %} +{% endfor %} +{% endif %} +! {% if helpers.exists('OPNsense.quagga.bgp.routemaps.routemap') %} {% for routemap in helpers.sortDictList(OPNsense.quagga.bgp.routemaps.routemap, 'name', 'id' ) %} {% if routemap.enabled == '1' %} @@ -205,6 +213,14 @@ route-map {{ routemap.name }} {{ routemap.action }} {{ routemap.id }} {% endif %} {% endfor %} {% endif %} +{% if routemap.match3|default("") != "" %} +{% for communitylist in routemap.match3.split(",") %} +{% set communitylist_data = helpers.getUUID(communitylist) %} +{% if 'match3' in routemap and routemap.match3 != '' %} + match community {{ communitylist_data.number }} +{% endif %} +{% endfor %} +{% endif %} {% if routemap.set|default("") != '' and routemap.match2|default("") != '' %} set {{ routemap.set }} {% endif %} From acb6e18e4ae22ae14f1f2601268e74dd30c2b373 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 9 Nov 2020 13:37:52 +0300 Subject: [PATCH 0254/3088] Update mods-enabled-ldap (#2076) Add ldap reply Mikrotik-Wireless-VLANID and Mikrotik-Wireless-VLANID-type --- .../service/templates/OPNsense/Freeradius/mods-enabled-ldap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-ldap b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-ldap index cd80e84f29..7836acffe7 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-ldap +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-ldap @@ -64,6 +64,8 @@ ldap { reply:Tunnel-Type := 'radiusTunnelType' reply:Tunnel-Medium-Type := 'radiusTunnelMediumType' reply:Tunnel-Private-Group-Id := 'radiusTunnelPrivateGroupId' + reply:Mikrotik-Wireless-VLANID := 'radiusTunnelPrivateGroupId' + reply:Mikrotik-Wireless-VLANID-type := 'radiusTunnelType' control: += 'radiusControlAttribute' request: += 'radiusRequestAttribute' reply: += 'radiusReplyAttribute' From 7f12477cc39597a86795e38facb85fdc572b6d81 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 9 Nov 2020 12:02:35 +0100 Subject: [PATCH 0255/3088] plugins: small reformat --- .../Collectd/Api/GeneralController.php | 44 +++++++++--------- .../Collectd/Api/ServiceController.php | 44 +++++++++--------- .../OPNsense/Lldpd/Api/GeneralController.php | 44 +++++++++--------- .../OPNsense/Lldpd/Api/ServiceController.php | 44 +++++++++--------- .../Telegraf/Api/GeneralController.php | 44 +++++++++--------- .../OPNsense/Telegraf/Api/InputController.php | 44 +++++++++--------- .../Telegraf/Api/OutputController.php | 44 +++++++++--------- .../Telegraf/Api/ServiceController.php | 44 +++++++++--------- .../Freeradius/Api/ClientController.php | 44 +++++++++--------- .../Freeradius/Api/DhcpController.php | 44 +++++++++--------- .../OPNsense/Freeradius/Api/EapController.php | 44 +++++++++--------- .../Freeradius/Api/GeneralController.php | 44 +++++++++--------- .../Freeradius/Api/LdapController.php | 44 +++++++++--------- .../Freeradius/Api/LeaseController.php | 44 +++++++++--------- .../Freeradius/Api/ServiceController.php | 2 +- .../Freeradius/Api/UserController.php | 44 +++++++++--------- .../OPNsense/Quagga/Api/BgpController.php | 46 +++++++++---------- .../OPNsense/Quagga/Api/GeneralController.php | 44 +++++++++--------- .../OPNsense/Quagga/Api/ServiceController.php | 44 +++++++++--------- .../OPNsense/Quagga/BgpController.php | 45 +++++++++--------- .../OPNsense/Siproxd/Api/DomainController.php | 44 +++++++++--------- .../Siproxd/Api/GeneralController.php | 44 +++++++++--------- .../Siproxd/Api/ServiceController.php | 44 +++++++++--------- .../OPNsense/Siproxd/Api/UserController.php | 44 +++++++++--------- .../OPNsense/ClamAV/Api/GeneralController.php | 44 +++++++++--------- .../OPNsense/Tor/Api/ServiceController.php | 44 +++++++++--------- 26 files changed, 530 insertions(+), 575 deletions(-) diff --git a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/Api/GeneralController.php b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/Api/GeneralController.php index c8e3648b7e..be3333a1cd 100644 --- a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/Api/GeneralController.php +++ b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/Api/GeneralController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Collectd\Api; diff --git a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/Api/ServiceController.php b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/Api/ServiceController.php index b449936790..2d00ae3116 100644 --- a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/Api/ServiceController.php +++ b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/Api/ServiceController.php @@ -1,32 +1,30 @@ - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Collectd\Api; diff --git a/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/GeneralController.php b/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/GeneralController.php index 4dddfc38b0..a7803bb78c 100644 --- a/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/GeneralController.php +++ b/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/GeneralController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Lldpd\Api; diff --git a/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/ServiceController.php b/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/ServiceController.php index f3dbbe97e1..48121f98f5 100644 --- a/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/ServiceController.php +++ b/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/ServiceController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Lldpd\Api; diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/GeneralController.php b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/GeneralController.php index ea1f8bcbad..ae4cc64269 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/GeneralController.php +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/GeneralController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Telegraf\Api; diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/InputController.php b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/InputController.php index 9349d15b0b..f16a61746c 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/InputController.php +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/InputController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Telegraf\Api; diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/OutputController.php b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/OutputController.php index baa511a50b..aba3256b30 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/OutputController.php +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/OutputController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Telegraf\Api; diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/ServiceController.php b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/ServiceController.php index ea26e27a39..22c4800cf6 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/ServiceController.php +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/ServiceController.php @@ -1,32 +1,30 @@ - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Telegraf\Api; diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/ClientController.php b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/ClientController.php index 787e9f66fa..f00443fb1b 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/ClientController.php +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/ClientController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Freeradius\Api; diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/DhcpController.php b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/DhcpController.php index 153b7849c2..fb1dd5ebdc 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/DhcpController.php +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/DhcpController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2019 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Freeradius\Api; diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/EapController.php b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/EapController.php index ac63bea73e..40bf830e7d 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/EapController.php +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/EapController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Freeradius\Api; diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/GeneralController.php b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/GeneralController.php index 33c34ec7da..f863050345 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/GeneralController.php +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/GeneralController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Freeradius\Api; diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/LdapController.php b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/LdapController.php index 8cfc713add..9374dd6281 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/LdapController.php +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/LdapController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Freeradius\Api; diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/LeaseController.php b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/LeaseController.php index d2693837b1..3cff21e0eb 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/LeaseController.php +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/LeaseController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2019 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Freeradius\Api; diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/ServiceController.php b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/ServiceController.php index 5943bda142..777f14d5de 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/ServiceController.php +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/ServiceController.php @@ -1,7 +1,7 @@ * All rights reserved. * diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/UserController.php b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/UserController.php index da4aa7fea9..b6638e2c2c 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/UserController.php +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/Api/UserController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Freeradius\Api; diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php index 3edbe1627e..0f926cf221 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php @@ -1,33 +1,31 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Fabian Franz + * Copyright (C) 2017-2020 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Quagga\Api; diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/GeneralController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/GeneralController.php index 703d41181e..e27efec61e 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/GeneralController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/GeneralController.php @@ -1,32 +1,30 @@ - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (C) 2017 Fabian Franz + * Copyright (C) 2017-2020 Michael Muenz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ namespace OPNsense\Quagga; diff --git a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/DomainController.php b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/DomainController.php index 56a74a9e03..20c57f8efb 100644 --- a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/DomainController.php +++ b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/DomainController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Siproxd\Api; diff --git a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/GeneralController.php b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/GeneralController.php index dc0d4d961c..9c14268ab6 100644 --- a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/GeneralController.php +++ b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/GeneralController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Siproxd\Api; diff --git a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/ServiceController.php b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/ServiceController.php index 876255b3be..e1634191fd 100644 --- a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/ServiceController.php +++ b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/ServiceController.php @@ -1,32 +1,30 @@ - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Siproxd\Api; diff --git a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/UserController.php b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/UserController.php index babe9391c6..76645935ce 100644 --- a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/UserController.php +++ b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/Api/UserController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Siproxd\Api; diff --git a/security/clamav/src/opnsense/mvc/app/controllers/OPNsense/ClamAV/Api/GeneralController.php b/security/clamav/src/opnsense/mvc/app/controllers/OPNsense/ClamAV/Api/GeneralController.php index 1cace827b9..082a67e78b 100644 --- a/security/clamav/src/opnsense/mvc/app/controllers/OPNsense/ClamAV/Api/GeneralController.php +++ b/security/clamav/src/opnsense/mvc/app/controllers/OPNsense/ClamAV/Api/GeneralController.php @@ -1,32 +1,30 @@ +/* + * Copyright (C) 2015-2017 Deciso B.V. + * Copyright (C) 2017 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\ClamAV\Api; diff --git a/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/Api/ServiceController.php b/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/Api/ServiceController.php index 158416e6f0..7ccba0c222 100644 --- a/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/Api/ServiceController.php +++ b/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/Api/ServiceController.php @@ -1,32 +1,30 @@ Date: Mon, 9 Nov 2020 20:29:13 -0500 Subject: [PATCH 0256/3088] Minor update to Server.xml Minor edit to make error message clearer. --- .../src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml index 01bae78842..1915fcd29a 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml @@ -13,7 +13,7 @@ Y /^([0-9a-zA-Z]){1,32}$/u - Should be a string between 1 and 32 characters. Allowed characters are 0-9a-zA-Z + Should be a string between 1 and 32 characters. Allowed characters are 0-9, a-z, and A-Z 0 From 64f29b2fc6b63b52a88bbf39efb9948b79e72de0 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 12 Nov 2020 16:02:31 +0100 Subject: [PATCH 0257/3088] FRR: uniform logging, ditch old file log. closes https://github.com/opnsense/plugins/issues/2104 --- .../Quagga/Api/DiagnosticsController.php | 4 -- .../OPNsense/Quagga/DiagnosticsController.php | 4 -- .../OPNsense/Quagga/forms/general.xml | 16 +----- .../app/models/OPNsense/Quagga/ACL/ACL.xml | 1 + .../app/models/OPNsense/Quagga/General.xml | 23 +------- .../app/models/OPNsense/Quagga/Menu/Menu.xml | 2 +- .../OPNsense/Quagga/Migrations/M1_0_2.php | 53 +++++++++++++++++++ .../mvc/app/views/OPNsense/Quagga/log.volt | 27 ---------- net/frr/src/opnsense/scripts/quagga/quagga.rb | 11 ---- .../conf/actions.d/actions_quagga.conf | 6 --- .../templates/OPNsense/Quagga/bgpd.conf | 3 -- .../templates/OPNsense/Quagga/ospf6d.conf | 3 -- .../templates/OPNsense/Quagga/ospfd.conf | 3 -- .../templates/OPNsense/Quagga/ripd.conf | 3 -- .../templates/OPNsense/Quagga/zebra.conf | 3 -- .../OPNsense/Syslog/local/routing_frr.conf | 6 +++ 16 files changed, 65 insertions(+), 103 deletions(-) create mode 100644 net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Migrations/M1_0_2.php delete mode 100644 net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/log.volt create mode 100644 net/frr/src/opnsense/service/templates/OPNsense/Syslog/local/routing_frr.conf diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php index 6dd944141c..a6d8da8f42 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php @@ -129,10 +129,6 @@ public function generalroutesAction() { return $this->get_general_information('routes'); } - public function logAction() - { - return $this->get_general_information('log')['response']['general_log']; - } public function generalroutes6Action() { return $this->get_general_information('routes6'); diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/DiagnosticsController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/DiagnosticsController.php index 0c0ccd21b5..4b74311840 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/DiagnosticsController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/DiagnosticsController.php @@ -44,8 +44,4 @@ public function generalAction() { $this->view->pick('OPNsense/Quagga/diagnosticsgeneral'); } - public function logAction() - { - $this->view->pick('OPNsense/Quagga/log'); - } } diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml index fbb34f3960..2fcfbc2b9b 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml @@ -11,27 +11,15 @@ checkbox This will activate the routing service only on the master device. - - general.enablelogfile - - checkbox - If you check this, a log file will be written to disk. - - - general.logfilelevel - - dropdown - This is the detail level of the log. A higher level means more data is logged. - general.enablesyslog - + checkbox Syslog is a service which is made to collect log messages from different software and maybe to a central logging server. Check this box if you have such a setup. general.sysloglevel - + dropdown This is the detail level of the log. A higher level means more data is logged. diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/ACL/ACL.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/ACL/ACL.xml index 3fa7a13e5b..a99328b131 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/ACL/ACL.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/ACL/ACL.xml @@ -4,6 +4,7 @@ ui/quagga/* api/quagga/* + ui/diagnostics/log/routing/frr diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml index dc5530304a..80d9576ebf 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml @@ -1,7 +1,7 @@ //OPNsense/quagga/general Quagga Routing configuration - 1.0.1 + 1.0.2 0 @@ -11,27 +11,8 @@ 0 Y - - 0 - Y - - - Y - N - notifications - - Critical - Emergencies - Errors - Alerts - Warnings - Notifications - Informational - Debugging - - - 0 + 1 Y diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml index d7da7259a8..03dca32ded 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml @@ -11,7 +11,7 @@ - + diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Migrations/M1_0_2.php b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Migrations/M1_0_2.php new file mode 100644 index 0000000000..f977352884 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Migrations/M1_0_2.php @@ -0,0 +1,53 @@ +object(); + if (!empty($cfgObj->OPNsense->quagga->general->enablelogfile)) { + if ((string)$model->enablesyslog != "1") { + $model->sysloglevel = (string)$cfgObj->OPNsense->quagga->general->logfilelevel; + } + $model->enablesyslog = "1"; + } + } + } +} diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/log.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/log.volt deleted file mode 100644 index 6f129beb97..0000000000 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/log.volt +++ /dev/null @@ -1,27 +0,0 @@ -
    -
    {{ lang._('ID') }} {{ lang._('AS Path List') }} {{ lang._('Prefix List') }}{{ lang._('Community List') }} {{ lang._('Set') }} {{ lang._('ID') }} {{ lang._('Commands') }}
    - - - - - - - - -
    {{ lang._('Date') }}{{ lang._('Time') }}{{ lang._('Service') }}{{ lang._('Message') }}
    -
    - - diff --git a/net/frr/src/opnsense/scripts/quagga/quagga.rb b/net/frr/src/opnsense/scripts/quagga/quagga.rb index e8881a4d06..a594278552 100755 --- a/net/frr/src/opnsense/scripts/quagga/quagga.rb +++ b/net/frr/src/opnsense/scripts/quagga/quagga.rb @@ -129,14 +129,6 @@ def routes6 routes(true) end - def log - File.read('/var/log/frr.log').lines.select {|l| l.strip.length > 10}.map do |line| - date, time, service, message = line.split(' ', 4) - date = date.split('/').reverse.join(".") # format dd.mm.yyyy - service = service.split(':').first if service - {date: date, time:time, service: service, message: message } - end - end end class OSPF @@ -709,9 +701,6 @@ def database_qta(lines) opts.on("-6", "--general-routes6", "Print Routing Table (IPv6)") do |od| options[:general_routes6] = od end - opts.on("-l", "--general-log", "Print Logs") do |od| - options[:general_log] = od - end ### BGP opts.on("-B", "--bgp-overview", "Print an overview of BGP") do |od| options[:bgp_overview] = od diff --git a/net/frr/src/opnsense/service/conf/actions.d/actions_quagga.conf b/net/frr/src/opnsense/service/conf/actions.d/actions_quagga.conf index 66a793e04a..1b3075f56f 100644 --- a/net/frr/src/opnsense/service/conf/actions.d/actions_quagga.conf +++ b/net/frr/src/opnsense/service/conf/actions.d/actions_quagga.conf @@ -106,12 +106,6 @@ parameters: type:script_output message: Print IPv6 Routing Table -[general-log] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --general-log -parameters: -type:script_output -message: Show Quagga logs - [general-runningconfig] command:/usr/local/bin/vtysh -c "show run" parameters: diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index abdf1f8d9c..e5d05085b2 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -5,9 +5,6 @@ ! 2017/03/03 20:21:04 ! {% if helpers.exists('OPNsense.quagga.general') %} -{% if helpers.exists('OPNsense.quagga.general.enablelogfile') and OPNsense.quagga.general.enablelogfile == '1' %} -log file /var/log/frr.log {{ OPNsense.quagga.general.logfilelevel }} -{% endif %} {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf index 607316523a..b58d95986e 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf @@ -8,9 +8,6 @@ ! 2017/03/03 20:21:04 ! {% if helpers.exists('OPNsense.quagga.general') %} -{% if helpers.exists('OPNsense.quagga.general.enablelogfile') and OPNsense.quagga.general.enablelogfile == '1' %} -log file /var/log/frr.log {{ OPNsense.quagga.general.logfilelevel }} -{% endif %} {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf index 8b7729c0e7..72c880d873 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf @@ -8,9 +8,6 @@ ! 2017/03/03 20:21:04 ! {% if helpers.exists('OPNsense.quagga.general') %} -{% if helpers.exists('OPNsense.quagga.general.enablelogfile') and OPNsense.quagga.general.enablelogfile == '1' %} -log file /var/log/frr.log {{ OPNsense.quagga.general.logfilelevel }} -{% endif %} {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ripd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ripd.conf index 6c5756f02a..ffb74650e5 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ripd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ripd.conf @@ -5,9 +5,6 @@ ! 2017/03/26 22:40:16 ! {% if helpers.exists('OPNsense.quagga.general') %} -{% if helpers.exists('OPNsense.quagga.general.enablelogfile') and OPNsense.quagga.general.enablelogfile == '1' %} -log file /var/log/frr.log {{ OPNsense.quagga.general.logfilelevel }} -{% endif %} {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf index 13d12b88c7..01a97a6f4f 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf @@ -3,9 +3,6 @@ ! Zebra configuration saved from vty ! 2017/03/03 20:21:04 ! -{% if helpers.exists('OPNsense.quagga.general.enablelogfile') and OPNsense.quagga.general.enablelogfile == '1' %} -log file /var/log/frr.log {{ OPNsense.quagga.general.logfilelevel }} -{% endif %} {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Syslog/local/routing_frr.conf b/net/frr/src/opnsense/service/templates/OPNsense/Syslog/local/routing_frr.conf new file mode 100644 index 0000000000..84bcfee810 --- /dev/null +++ b/net/frr/src/opnsense/service/templates/OPNsense/Syslog/local/routing_frr.conf @@ -0,0 +1,6 @@ +################################################################### +# Local syslog-ng configuration filter definition [FRR]. +################################################################### +filter f_local_routing_frr { + program("bgpd") or program("ospfd") or program("ospf6d") or program("ripd") or program("zebra"); +}; From 7b0659d5dd3004fc987f328c42d4f89aa3b37601 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 12 Nov 2020 22:32:48 +0100 Subject: [PATCH 0258/3088] dns/bind: reject built-in ACL names --- dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml index 6466c00332..51eb974220 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml @@ -12,8 +12,8 @@ Y - /^([0-9a-zA-Z]){1,32}$/u - Should be a string between 1 and 32 characters. Allowed characters are 0-9a-zA-Z + /^(?!any$|localhost$|localnets$|none$)[0-9a-zA-Z]{1,32}$/u + Should be a string between 1 and 32 characters. Allowed characters are 0-9a-zA-Z. Built-in ACL names must not be used: any, localhost, localnets, none. From 449fc4990180f0e3f779085fe215d5ed94095a95 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 12 Nov 2020 22:42:30 +0100 Subject: [PATCH 0259/3088] dns/bind: fix small UI glitch (truncated checkboxes) --- .../src/opnsense/mvc/app/views/OPNsense/Bind/general.volt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt index 60d74b68c6..455bee71f3 100644 --- a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt +++ b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt @@ -55,7 +55,7 @@ POSSIBILITY OF SUCH DAMAGE.
    - +
    @@ -86,7 +86,7 @@ POSSIBILITY OF SUCH DAMAGE. -
    {{ lang._('Enabled') }}
    +
    @@ -117,7 +117,7 @@ POSSIBILITY OF SUCH DAMAGE.

    {{ lang._('Records') }}

    -
    {{ lang._('Enabled') }}
    +
    From 4f39145eaf3d4bbe56417d93aaebbbf59c109c00 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 12 Nov 2020 22:50:44 +0100 Subject: [PATCH 0260/3088] dns/bind: add button to delete selected items --- .../src/opnsense/mvc/app/views/OPNsense/Bind/general.volt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt index 455bee71f3..e42640843c 100644 --- a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt +++ b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt @@ -72,6 +72,7 @@ POSSIBILITY OF SUCH DAMAGE. @@ -108,6 +109,7 @@ POSSIBILITY OF SUCH DAMAGE. @@ -136,6 +138,7 @@ POSSIBILITY OF SUCH DAMAGE. @@ -219,9 +222,11 @@ $( document ).ready(function() { if (ids.length > 0) { request['domain'] = ids[0]; $("#recordAddBtn").show(); + $("#recordDelBtn").show(); $("#record-area").show(); } else { $("#recordAddBtn").hide(); + $("#recordDelBtn").hide(); $("#record-area").hide(); } return request; From e703a8d19b0a855c0188dc10c9b5a2e24ff51af7 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 12 Nov 2020 22:51:24 +0100 Subject: [PATCH 0261/3088] dns/bind: bump version --- dns/bind/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 3323aea673..48b788c2ae 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.13 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.14 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com From f6a694c1a20e03de71c147511c063d7a0a71f8da Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 12 Nov 2020 22:58:21 +0100 Subject: [PATCH 0262/3088] dns/bind: update changelog --- dns/bind/pkg-descr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 99d74dce55..545d1b6b60 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -8,6 +8,12 @@ necessary for asking and answering name service questions. Plugin Changelog ================ +1.14 + +* Reject built-in ACL names +* Fix truncated checkboxes +* Add button to delete selected items + 1.13 * Update BIND to 9.16 From ff83e858d9269db01b70c863dff1dc699d03c184 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 12 Nov 2020 23:08:42 +0100 Subject: [PATCH 0263/3088] dns/bind: relax ACL name mask --- dns/bind/pkg-descr | 1 + dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 545d1b6b60..4c59d1e865 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -13,6 +13,7 @@ Plugin Changelog * Reject built-in ACL names * Fix truncated checkboxes * Add button to delete selected items +* Relax ACL name mask (allow underscores and hyphens) 1.13 diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml index 51eb974220..6abff3a73a 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml @@ -12,8 +12,8 @@ Y - /^(?!any$|localhost$|localnets$|none$)[0-9a-zA-Z]{1,32}$/u - Should be a string between 1 and 32 characters. Allowed characters are 0-9a-zA-Z. Built-in ACL names must not be used: any, localhost, localnets, none. + /^(?!any$|localhost$|localnets$|none$)[0-9a-zA-Z_\-]{1,32}$/u + Should be a string between 1 and 32 characters. Allowed characters are 0-9a-zA-Z_-. Built-in ACL names must not be used: any, localhost, localnets, none. From a3d383b2825cb18907ec9082cb4cbdcc1d3025cd Mon Sep 17 00:00:00 2001 From: ElNounch Date: Sat, 14 Nov 2020 18:04:00 +0100 Subject: [PATCH 0264/3088] Enable usage of no, one or several addresses per hosts --- .../controllers/OPNsense/Tinc/forms/dialogHost.xml | 2 +- .../controllers/OPNsense/Tinc/forms/dialogNetwork.xml | 2 +- .../opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml | 4 ++-- .../src/opnsense/scripts/OPNsense/Tinc/lib/objects.py | 11 ++++++++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogHost.xml b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogHost.xml index b2fda29f2f..232e97fa5c 100644 --- a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogHost.xml +++ b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogHost.xml @@ -21,7 +21,7 @@ host.extaddress text - This machines external address to use + This machines external addresses to use (separated by comma) host.extport diff --git a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml index e2d9697f80..4fec66b52a 100644 --- a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml +++ b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml @@ -69,7 +69,7 @@ network.extaddress text - This machines external address to use + This machines external addresses to use (separated by comma) network.extport diff --git a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml index e8abbc0c0c..89dc220e47 100644 --- a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml +++ b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml @@ -22,7 +22,7 @@ Please specify a valid hostname. - Y + N /^([0-9a-zA-Z\.,_\-:]){0,1024}$/u @@ -132,7 +132,7 @@ Port number must be between 1...65535 - Y + N /^([0-9a-zA-Z\.,_\-:]){0,1024}$/u diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py index 6b9ccfcd3c..cece619f48 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py @@ -30,8 +30,6 @@ def __init__(self): self._payload = dict() self._payload['hostname'] = None self._payload['network'] = None - self._payload['address'] = None - self._payload['port'] = None def is_valid(self): for key in self._payload: @@ -97,6 +95,10 @@ def set_PMTUDiscovery(self, value): def config_text(self): result = list() result.append('AddressFamily=any') + if 'address' in self._payload: + addresses = self._payload['address'].split(',') + for address in addresses: + result.append('Address=%s %s' % (address, self._payload['port'])) result.append('Mode=%(mode)s' % self._payload) result.append('PMTUDiscovery=%(PMTUDiscovery)s' % self._payload) result.append('Port=%(port)s' % self._payload) @@ -137,7 +139,10 @@ def set_connectto(self, value): def config_text(self): result = list() - result.append('Address=%(address)s %(port)s'%self._payload) + if 'address' in self._payload: + addresses = self._payload['address'].split(',') + for address in addresses: + result.append('Address=%s %s' % (address, self._payload['port'])) if 'subnet' in self._payload: networks = self._payload['subnet'].split(',') for network in networks: From 151bc98f3ece2f9fa78be97ff9657001ea90ddbc Mon Sep 17 00:00:00 2001 From: ElNounch Date: Sun, 15 Nov 2020 17:56:28 +0100 Subject: [PATCH 0265/3088] Using list view for both external addresses and hosted subnets Every generated config files last line ends with a newline --- .../OPNsense/Tinc/forms/dialogHost.xml | 10 ++++-- .../OPNsense/Tinc/forms/dialogNetwork.xml | 10 ++++-- .../mvc/app/models/OPNsense/Tinc/Tinc.xml | 27 ++++++++++++--- .../scripts/OPNsense/Tinc/lib/objects.py | 34 +++++++++++-------- 4 files changed, 56 insertions(+), 25 deletions(-) diff --git a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogHost.xml b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogHost.xml index 232e97fa5c..0e5bc3c348 100644 --- a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogHost.xml +++ b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogHost.xml @@ -20,8 +20,10 @@ host.extaddress - text - This machines external addresses to use (separated by comma) + select_multiple + + true + External address of selected machine host.extport @@ -32,7 +34,9 @@ host.subnet - text + select_multiple + + true This machines part of the network diff --git a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml index 4fec66b52a..1c2224c4d8 100644 --- a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml +++ b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml @@ -68,8 +68,10 @@ network.extaddress - text - This machines external addresses to use (separated by comma) + select_multiple + + true + External addresses of this machine network.extport @@ -80,7 +82,9 @@ network.subnet - text + select_multiple + + true This machines part of the network diff --git a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml index 89dc220e47..e9ebf4b97e 100644 --- a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml +++ b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml @@ -21,9 +21,11 @@ /^([0-9a-zA-Z\_]){1,1024}$/u Please specify a valid hostname. - + N - /^([0-9a-zA-Z\.,_\-:]){0,1024}$/u + 1 + , + Y Y @@ -41,6 +43,7 @@ N Y , + Y Subnet field must be set in router mode. @@ -131,15 +134,26 @@ 65535 Port number must be between 1...65535 - + N - /^([0-9a-zA-Z\.,_\-:]){0,1024}$/u + 1 + , + Y + + + Need external address if you intend to "Connect To" this host + SetIfConstraint + connectTo + 1 + + N N Y , + Y Y @@ -154,6 +168,11 @@ 1 Y + + + extaddress.check001 + + 1 diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py index cece619f48..a0031d9b07 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py @@ -30,6 +30,8 @@ def __init__(self): self._payload = dict() self._payload['hostname'] = None self._payload['network'] = None + self._payload['address'] = '' + self._payload['port'] = None def is_valid(self): for key in self._payload: @@ -53,6 +55,11 @@ def get_network(self): def get_basepath(self): return '/usr/local/etc/tinc/%(network)s' % self._payload + def get_addresses(self): + if not self._payload['address']: + return + yield from self._payload['address'].split(',') + class Network(NetwConfObject): def __init__(self): super(Network, self).__init__() @@ -95,10 +102,6 @@ def set_PMTUDiscovery(self, value): def config_text(self): result = list() result.append('AddressFamily=any') - if 'address' in self._payload: - addresses = self._payload['address'].split(',') - for address in addresses: - result.append('Address=%s %s' % (address, self._payload['port'])) result.append('Mode=%(mode)s' % self._payload) result.append('PMTUDiscovery=%(PMTUDiscovery)s' % self._payload) result.append('Port=%(port)s' % self._payload) @@ -108,7 +111,7 @@ def config_text(self): result.append('ConnectTo = %s' % (host.get_hostname(),)) result.append('Device=/dev/tinc%(id)s' % self._payload) result.append('Name=%(hostname)s' % self._payload) - return '\n'.join(result) + return '\n'.join(result) + '\n' def filename(self): return self.get_basepath() + '/tinc.conf' @@ -129,7 +132,7 @@ def __init__(self): self._payload['cipher'] = None def connect_to_this_host(self): - if self.is_valid() and self._connectTo == "1": + if self.is_valid() and self._payload['address'] and self._connectTo == "1": return True else: return False @@ -137,20 +140,21 @@ def connect_to_this_host(self): def set_connectto(self, value): self._connectTo = value.text + def get_subnets(self): + if not self._payload['subnet']: + return + yield from self._payload['subnet'].split(',') + def config_text(self): result = list() - if 'address' in self._payload: - addresses = self._payload['address'].split(',') - for address in addresses: - result.append('Address=%s %s' % (address, self._payload['port'])) - if 'subnet' in self._payload: - networks = self._payload['subnet'].split(',') - for network in networks: - result.append('Subnet=%s' % network) + for address in self.get_addresses(): + result.append('Address=%s %s' % (address, self._payload['port'])) + for network in self.get_subnets(): + result.append('Subnet=%s' % network) result.append('Cipher=%(cipher)s'%self._payload) result.append('Digest=sha256') result.append(self._payload['pubkey']) - return '\n'.join(result) + return '\n'.join(result) + '\n' def filename(self): return '%s/hosts/%s' % (self.get_basepath(), self._payload['hostname']) From 5dc2478cd7e31069b6a5fadb8750a1fc6cfb20b8 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 15 Nov 2020 19:48:52 +0100 Subject: [PATCH 0266/3088] Tinc: upgrade model version for https://github.com/opnsense/plugins/pull/2110 --- .../tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml index e9ebf4b97e..f6a077d558 100644 --- a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml +++ b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml @@ -1,6 +1,6 @@ //OPNsense/Tinc - 1.0.2 + 1.0.3 OPNsense Tinc VPN From d4d0449dc98ea0d9d84001698327e15e7d84696e Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 9 Nov 2020 16:56:37 +0100 Subject: [PATCH 0267/3088] FRR: add ui fields for https://github.com/opnsense/plugins/issues/2091 and basic template to store carp setting into (to be unsed in the event handler) --- .../Quagga/forms/dialogEditOSPFInterface.xml | 12 ++++++++++++ .../opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml | 11 +++++++++++ .../service/templates/OPNsense/Quagga/+TARGETS | 1 + .../templates/OPNsense/Quagga/ospfd_carp.conf | 11 +++++++++++ 4 files changed, 35 insertions(+) create mode 100644 net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd_carp.conf diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml index b7091f4f01..1413f214f7 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml @@ -37,6 +37,18 @@ text + + interface.cost_demoted + + text + + + interface.carp_depend_on + + dropdown + The carp VHID to depend on, when this virtual address is not in master state, + the interface cost will be set to the demoted cost (specified above). + interface.hellointerval diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml index ef022849ad..445f2786a4 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml @@ -165,6 +165,17 @@ 4294967295 Cost must be between 0 and 4294967295. + + + 0 + N + 4294967295 + Cost must be between 0 and 4294967295. + + + carp + N + 0 diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS index b01f28018f..a09b88d86a 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS @@ -1,5 +1,6 @@ bgpd.conf:/usr/local/etc/frr/bgpd.conf ospfd.conf:/usr/local/etc/frr/ospfd.conf +ospfd_carp.conf:/usr/local/etc/frr/ospfd_carp.conf ospf6d.conf:/usr/local/etc/frr/ospf6d.conf ripd.conf:/usr/local/etc/frr/ripd.conf frr:/etc/rc.conf.d/frr diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd_carp.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd_carp.conf new file mode 100644 index 0000000000..90e2149e26 --- /dev/null +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd_carp.conf @@ -0,0 +1,11 @@ +{% if helpers.exists('OPNsense.quagga.ospf.interfaces.interface') %} +{% for interface in helpers.toList('OPNsense.quagga.ospf.interfaces.interface') %} +{% if interface.enabled == '1' %} +[interface_interface.interfacename] +interface={{interface.interfacename}} +default_cost={{interface.cost|default('10')}} +demoted_cost={{interface.cost_demoted|default('')}} +carp_depend_on={{interface.carp_depend_on|default('')}} +{% endif %} +{% endfor %} +{% endif %} From 7a3eafbba7937403f1b73e9db5ee2c91118ebf48 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 10 Nov 2020 10:54:30 +0100 Subject: [PATCH 0268/3088] FRR: OSPF interface form, align form with model. for https://github.com/opnsense/plugins/issues/2098 --- .../OPNsense/Quagga/forms/dialogEditOSPFInterface.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml index 1413f214f7..34842de349 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPFInterface.xml @@ -7,13 +7,13 @@ interface.interfacename - select_multiple + dropdown Select an interface where this settings apply to. interface.authtype - select_multiple + dropdown interface.authkey @@ -77,6 +77,6 @@ interface.networktype - select_multiple + dropdown From cedb08e92e9bc64dc787529c00dc844da1d44f2e Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 10 Nov 2020 15:08:54 +0100 Subject: [PATCH 0269/3088] FRR: ospf interface cost boundaries as defined in http://docs.frrouting.org/en/latest/ospfd.html#interfaces (1-65535) --- .../opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml index 445f2786a4..83ade2b6ff 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml @@ -160,17 +160,17 @@ - 0 + 1 N - 4294967295 - Cost must be between 0 and 4294967295. + 65535 + Cost must be between 1 and 65535. - 0 + 1 N - 4294967295 - Cost must be between 0 and 4294967295. + 65535 + Cost must be between 1 and 65535. carp From b49b29bc9da22d40061da991c48117bf0a5be067 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 10 Nov 2020 17:59:57 +0100 Subject: [PATCH 0270/3088] FRR: work in progress event handler for https://github.com/opnsense/plugins/issues/2091 Initial boilerplate code to extract interface address (vhid) status and control vtysh for status and configuration. The code in carp_event_handler is only intended to test some callouts, the general idea is to hook InterfaceStatus() and VtySH() objects into an event handler object inherited from baseEventHandler(), which is responsible for detecting the changes and reconfiguring the daemon. --- .../opnsense/scripts/frr/carp_event_handler | 39 +++++++ .../src/opnsense/scripts/frr/lib/__init__.py | 109 ++++++++++++++++++ net/frr/src/opnsense/scripts/frr/lib/base.py | 38 ++++++ 3 files changed, 186 insertions(+) create mode 100755 net/frr/src/opnsense/scripts/frr/carp_event_handler create mode 100644 net/frr/src/opnsense/scripts/frr/lib/__init__.py create mode 100644 net/frr/src/opnsense/scripts/frr/lib/base.py diff --git a/net/frr/src/opnsense/scripts/frr/carp_event_handler b/net/frr/src/opnsense/scripts/frr/carp_event_handler new file mode 100755 index 0000000000..ba490b1b18 --- /dev/null +++ b/net/frr/src/opnsense/scripts/frr/carp_event_handler @@ -0,0 +1,39 @@ +#!/usr/local/bin/python3 +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +from lib import InterfaceStatus, VtySH + + +if __name__ == '__main__': + ifstatus = InterfaceStatus() + vtysh = VtySH() + if vtysh.is_active: + print (ifstatus.address_status('10.111.112.113')) + if vtysh.is_running('ospfd'): + ospf_interfaces = vtysh.execute('show ip ospf interface json') + vtysh.execute(['interface le1', 'ip ospf cost 65535'], translate=None, configure=True) + print(ospf_interfaces) diff --git a/net/frr/src/opnsense/scripts/frr/lib/__init__.py b/net/frr/src/opnsense/scripts/frr/lib/__init__.py new file mode 100644 index 0000000000..85753b0df2 --- /dev/null +++ b/net/frr/src/opnsense/scripts/frr/lib/__init__.py @@ -0,0 +1,109 @@ +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +import time +import subprocess +import ujson + +class InterfaceStatus: + def __init__(self): + self._carp_addresses = dict() + self.parse() + + def parse(self): + """ parse ifconfig output + """ + carp_statuses = dict() + carp_addresses = dict() + current_if = None + for line in subprocess.run(['/sbin/ifconfig', '-a'], capture_output=True, text=True).stdout.split('\n'): + parts = line.split() + if not line.startswith('\t'): + current_if = line.split(':')[0] + elif line.startswith('\tcarp: '): + carp_statuses[parts[3]] = parts[1] + elif line.find('vhid') > -1: + carp_addresses[parts[1]] = {'vhid': parts[-1], 'status': 'none'} + + for address in carp_addresses: + if carp_addresses[address]['vhid'] in carp_statuses: + carp_addresses[address]['status'] = carp_statuses[carp_addresses[address]['vhid']].strip().lower() + + self._carp_addresses = carp_addresses + + def address_status(self, address): + if address in self._carp_addresses: + return self._carp_addresses[address]['status'] + return 'none' + + +class VtySHExecError(Exception): + pass + +class VtySH: + def __init__(self): + self._daemons = [] + self.init() + + def init(self): + # wait maximum 30 seconds for daemon to startup + for i in range(30): + try: + self._daemons = self.execute('show daemons', lambda x: x.decode().split()) + break + except VtySHExecError: + time.sleep(1) + + def is_running(self, daemon): + return daemon in self._daemons + + @property + def is_active(self): + return len(self._daemons) > 0 + + def execute(self, command, translate=ujson.loads, configure=False): + args = ['/usr/local/bin/vtysh'] + if configure: + args = args + ['-c', 'configure terminal'] + else: + args.append('-u') + + if type(command) is list: + for cmd in command: + args = args + ['-c', cmd] + else: + args = args + ['-c', command] + + response = subprocess.run(args, capture_output=True) + if response.stderr: + raise VtySHExecError(response.stderr) + if translate: + try: + return translate(response.stdout) + except ValueError: + raise ValueError(response.stdout) + else: + return response.stdout diff --git a/net/frr/src/opnsense/scripts/frr/lib/base.py b/net/frr/src/opnsense/scripts/frr/lib/base.py new file mode 100644 index 0000000000..c584bcc0f5 --- /dev/null +++ b/net/frr/src/opnsense/scripts/frr/lib/base.py @@ -0,0 +1,38 @@ +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" + +class baseEventHandler: + def __init__(self, ifstatus, vtysh): + self.ifstatus = ifstatus + self.vtysh = vtysh + + @property + def should_run(self): + return False + + def execute(self): + pass From f29d8ddf0b4efdea9ab7a115695f2642bf6262ff Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 11 Nov 2020 18:04:34 +0100 Subject: [PATCH 0271/3088] FRR: work in progress carp event handler + ospfd implementation for https://github.com/opnsense/plugins/issues/2091 --- .../opnsense/scripts/frr/carp_event_handler | 18 ++-- .../src/opnsense/scripts/frr/lib/__init__.py | 4 +- net/frr/src/opnsense/scripts/frr/lib/base.py | 2 +- .../scripts/frr/lib/events/__init__.py | 44 +++++++++ .../opnsense/scripts/frr/lib/events/ospfd.py | 96 +++++++++++++++++++ .../templates/OPNsense/Quagga/ospfd_carp.conf | 8 +- 6 files changed, 160 insertions(+), 12 deletions(-) create mode 100644 net/frr/src/opnsense/scripts/frr/lib/events/__init__.py create mode 100644 net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py diff --git a/net/frr/src/opnsense/scripts/frr/carp_event_handler b/net/frr/src/opnsense/scripts/frr/carp_event_handler index ba490b1b18..3256478b8b 100755 --- a/net/frr/src/opnsense/scripts/frr/carp_event_handler +++ b/net/frr/src/opnsense/scripts/frr/carp_event_handler @@ -25,15 +25,21 @@ POSSIBILITY OF SUCH DAMAGE. """ +import sys +import syslog +import lib.events from lib import InterfaceStatus, VtySH - if __name__ == '__main__': + syslog.openlog('frr_carp', logoption=syslog.LOG_DAEMON, facility=syslog.LOG_LOCAL1) + syslog.syslog(syslog.LOG_NOTICE, 'FRR received carp configuration event.') ifstatus = InterfaceStatus() vtysh = VtySH() if vtysh.is_active: - print (ifstatus.address_status('10.111.112.113')) - if vtysh.is_running('ospfd'): - ospf_interfaces = vtysh.execute('show ip ospf interface json') - vtysh.execute(['interface le1', 'ip ospf cost 65535'], translate=None, configure=True) - print(ospf_interfaces) + for event in lib.events.get_events(): + event_object = event(ifstatus=ifstatus, vtysh=vtysh) + if event_object.should_run: + syslog.syslog(syslog.LOG_NOTICE, 'FRR trigger %s event.' % event_object.__class__.__name__) + event_object.execute() + else: + syslog.syslog(syslog.LOG_ERR, 'no frr deamons active.') diff --git a/net/frr/src/opnsense/scripts/frr/lib/__init__.py b/net/frr/src/opnsense/scripts/frr/lib/__init__.py index 85753b0df2..bada445eca 100644 --- a/net/frr/src/opnsense/scripts/frr/lib/__init__.py +++ b/net/frr/src/opnsense/scripts/frr/lib/__init__.py @@ -69,8 +69,8 @@ def __init__(self): self.init() def init(self): - # wait maximum 30 seconds for daemon to startup - for i in range(30): + # wait a maximum of 5 seconds for daemon to startup + for i in range(5): try: self._daemons = self.execute('show daemons', lambda x: x.decode().split()) break diff --git a/net/frr/src/opnsense/scripts/frr/lib/base.py b/net/frr/src/opnsense/scripts/frr/lib/base.py index c584bcc0f5..76efb5db8d 100644 --- a/net/frr/src/opnsense/scripts/frr/lib/base.py +++ b/net/frr/src/opnsense/scripts/frr/lib/base.py @@ -25,7 +25,7 @@ """ -class baseEventHandler: +class BaseEventHandler: def __init__(self, ifstatus, vtysh): self.ifstatus = ifstatus self.vtysh = vtysh diff --git a/net/frr/src/opnsense/scripts/frr/lib/events/__init__.py b/net/frr/src/opnsense/scripts/frr/lib/events/__init__.py new file mode 100644 index 0000000000..b9dfe7d8b0 --- /dev/null +++ b/net/frr/src/opnsense/scripts/frr/lib/events/__init__.py @@ -0,0 +1,44 @@ +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +import glob +import importlib +import sys +import os +from ..base import BaseEventHandler + + +def get_events(): + """ iterate event handlers + """ + for filename in glob.glob("%s/*.py" % os.path.dirname(__file__)): + importlib.import_module(".%s" % os.path.splitext(os.path.basename(filename))[0], __name__) + + for module_name in dir(sys.modules[__name__]): + for attribute_name in dir(getattr(sys.modules[__name__], module_name)): + cls = getattr(getattr(sys.modules[__name__], module_name), attribute_name) + if isinstance(cls, type) and issubclass(cls, BaseEventHandler) and cls != BaseEventHandler: + yield cls diff --git a/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py b/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py new file mode 100644 index 0000000000..d692747088 --- /dev/null +++ b/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py @@ -0,0 +1,96 @@ +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +import os +import syslog +from configparser import ConfigParser +from ..base import BaseEventHandler + + +class OspfdEventHandler(BaseEventHandler): + _config = '/usr/local/etc/frr/ospfd_carp.conf' + + @property + def should_run(self): + return self.vtysh.is_running('ospfd') + + def _read_config(self): + result = dict() + if os.path.isfile(self._config): + cnf = ConfigParser() + cnf.read(self._config) + not_empty = lambda x, y: cnf.has_option(x, y) and cnf.get(x, y) != '' and cnf.get(x, y) != '0' + for section in cnf.sections(): + if not_empty(section, 'interface') and not_empty(section, 'interface') \ + and not_empty(section, 'demoted_cost') and not_empty(section, 'carp_depend_on'): + default_cost = cnf.getint(section, 'default_cost') if not_empty(section, 'default_cost') else None + result[cnf.get(section, 'interface')] = { + 'demoted_cost': cnf.getint(section, 'demoted_cost'), + 'carp_depend_on': cnf.get(section, 'carp_depend_on'), + 'default_cost': default_cost, + } + + return result + + def execute(self): + if os.path.isfile(self._config): + ospf_interfaces = self.vtysh.execute('show ip ospf interface json') + config_interfaces = self._read_config() + cnf = ConfigParser() + cnf.read(self._config) + for intf in config_interfaces: + if 'interfaces' in ospf_interfaces and intf in ospf_interfaces['interfaces']: + ospf_intf_cost = ospf_interfaces['interfaces'][intf]['cost'] + is_intf_master = self.ifstatus.address_status(config_interfaces[intf]['carp_depend_on']) == 'master' + is_ospf_dem = ospf_intf_cost == config_interfaces[intf]['demoted_cost'] + if is_intf_master and is_ospf_dem: + # promote ospf interface + conf_cost = config_interfaces[intf]['default_cost'] + if conf_cost is None: + syslog.syslog( + syslog.LOG_NOTICE, 'ospfd promote interface %s (no default cost configured).' % intf + ) + self.vtysh.execute( + ['interface %s' % intf, 'no ip ospf cost'], translate=None, configure=True + ) + elif conf_cost != ospf_intf_cost: + syslog.syslog( + syslog.LOG_NOTICE, 'ospfd promote interface %s (cost %d).' % (intf, conf_cost) + ) + self.vtysh.execute( + ['interface %s' % intf, 'ip ospf cost %d' % conf_cost], + translate=None, configure=True + ) + elif not is_intf_master and not is_ospf_dem: + # demote ospf interface + conf_cost = config_interfaces[intf]['demoted_cost'] + syslog.syslog( + syslog.LOG_NOTICE, 'ospfd demote interface %s (cost %d).' % (intf, conf_cost) + ) + self.vtysh.execute( + ['interface %s' % intf, 'ip ospf cost %d' % conf_cost], + translate=None, configure=True + ) diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd_carp.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd_carp.conf index 90e2149e26..724d7cb3c1 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd_carp.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd_carp.conf @@ -1,9 +1,11 @@ +{% from 'OPNsense/Macros/interface.macro' import physical_interface %} {% if helpers.exists('OPNsense.quagga.ospf.interfaces.interface') %} {% for interface in helpers.toList('OPNsense.quagga.ospf.interfaces.interface') %} {% if interface.enabled == '1' %} -[interface_interface.interfacename] -interface={{interface.interfacename}} -default_cost={{interface.cost|default('10')}} +[{{ interface['@uuid'] }}] +enabled={{interface.enabled|default('0')}} +interface={{physical_interface(interface.interfacename)}} +default_cost={{interface.cost|default('')}} demoted_cost={{interface.cost_demoted|default('')}} carp_depend_on={{interface.carp_depend_on|default('')}} {% endif %} From 1965e0197142947e2d372347fbc9dc9115cb7a68 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 12 Nov 2020 16:47:28 +0100 Subject: [PATCH 0272/3088] FRR: hook carp_event_handler logging to standard sysog handler for https://github.com/opnsense/plugins/issues/2091 --- .../service/templates/OPNsense/Syslog/local/routing_frr.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Syslog/local/routing_frr.conf b/net/frr/src/opnsense/service/templates/OPNsense/Syslog/local/routing_frr.conf index 84bcfee810..ad0869d3c7 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Syslog/local/routing_frr.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Syslog/local/routing_frr.conf @@ -2,5 +2,5 @@ # Local syslog-ng configuration filter definition [FRR]. ################################################################### filter f_local_routing_frr { - program("bgpd") or program("ospfd") or program("ospf6d") or program("ripd") or program("zebra"); + program("bgpd") or program("ospfd") or program("ospf6d") or program("ripd") or program("zebra") or program("frr_carp"); }; From c9cfd6021e6b997b7f5a2eae9b0179b5c83fc64a Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 12 Nov 2020 18:41:42 +0100 Subject: [PATCH 0273/3088] FRR: trigger carp event handler on service start for https://github.com/opnsense/plugins/issues/2091 --- net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr | 1 + 1 file changed, 1 insertion(+) diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr index e2b5da14dc..f119450b6a 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr @@ -12,6 +12,7 @@ if helpers.exists('OPNsense.quagga.ospf6.enabled') and OPNsense.quagga.ospf6.ena if helpers.exists('OPNsense.quagga.ripng.enabled') and OPNsense.quagga.ripng.enabled == '1' %} ripngd{% endif %}{% if helpers.exists('OPNsense.quagga.isis.enabled') and OPNsense.quagga.isis.enabled == '1' %} isisd{% endif %}" frr_carp_demote="{% if not helpers.empty('OPNsense.quagga.ospf.carp_demote') %} ospfd{% endif %}" +start_postcmd="/usr/local/opnsense/scripts/frr/carp_event_handler" {% else %} frr_enable="NO" {% endif %} From 76c8c7eba1b49b1a98e16b2cc8f5305f0bc9fda6 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 13 Nov 2020 17:05:31 +0100 Subject: [PATCH 0274/3088] FRR: change existing carp event to signal frr carp event handler when not using the start/stop carp option (only active when in master mode). for https://github.com/opnsense/plugins/issues/2091 --- net/frr/src/etc/rc.syshook.d/carp/50-frr | 46 ++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/net/frr/src/etc/rc.syshook.d/carp/50-frr b/net/frr/src/etc/rc.syshook.d/carp/50-frr index 0c9841529e..05c8c0e8d3 100755 --- a/net/frr/src/etc/rc.syshook.d/carp/50-frr +++ b/net/frr/src/etc/rc.syshook.d/carp/50-frr @@ -32,29 +32,31 @@ require_once('config.inc'); require_once('util.inc'); require_once('plugins.inc.d/frr.inc'); -if (!frr_carp_enabled()) { - /* nothing to do */ - exit(0); -} - -$subsystem = !empty($argv[1]) ? $argv[1] : ''; -$type = !empty($argv[2]) ? $argv[2] : ''; +if (frr_carp_enabled()) { + // XXX: carp enable/disable mode + $subsystem = !empty($argv[1]) ? $argv[1] : ''; + $type = !empty($argv[2]) ? $argv[2] : ''; -if ($type != 'MASTER' && $type != 'BACKUP') { - log_error("Carp '$type' event unknown from source '{$subsystem}'"); - exit(1); -} + if ($type != 'MASTER' && $type != 'BACKUP') { + log_error("Carp '$type' event unknown from source '{$subsystem}'"); + exit(1); + } -if (!strstr($subsystem, '@')) { - log_error("Carp '$type' event triggered from wrong source '{$subsystem}'"); - exit(1); -} + if (!strstr($subsystem, '@')) { + log_error("Carp '$type' event triggered from wrong source '{$subsystem}'"); + exit(1); + } -switch ($type) { - case 'MASTER': - shell_exec('/usr/local/etc/rc.d/frr start'); - break; - case 'BACKUP': - shell_exec('/usr/local/etc/rc.d/frr stop'); - break; + switch ($type) { + case 'MASTER': + shell_exec('/usr/local/etc/rc.d/frr start'); + break; + case 'BACKUP': + shell_exec('/usr/local/etc/rc.d/frr stop'); + break; + } +} elseif (frr_enabled()) { + // XXX: when not toggling between active and disabled, pass event so underlaying protocols can + // determine which actions to perform when reaching a certain state. + shell_exec('/usr/local/opnsense/scripts/frr/carp_event_handler'); } From 3c988330e29f3bed803886f01b4ae7a5f77dcd23 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 16 Nov 2020 21:29:47 +0100 Subject: [PATCH 0275/3088] FRR: change version tag after adding https://github.com/opnsense/plugins/issues/2091 --- net/frr/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 69b1b0e236..02c92992a5 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.18 +PLUGIN_VERSION= 1.19 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From 713ed181628ff6225599b23c57744da318f5d3c1 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 16 Nov 2020 21:52:50 +0100 Subject: [PATCH 0276/3088] FRR: carp_event_handler annotate function parameters --- net/frr/src/opnsense/scripts/frr/lib/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/frr/src/opnsense/scripts/frr/lib/base.py b/net/frr/src/opnsense/scripts/frr/lib/base.py index 76efb5db8d..075bf0032b 100644 --- a/net/frr/src/opnsense/scripts/frr/lib/base.py +++ b/net/frr/src/opnsense/scripts/frr/lib/base.py @@ -24,9 +24,11 @@ POSSIBILITY OF SUCH DAMAGE. """ +from . import InterfaceStatus, VtySH + class BaseEventHandler: - def __init__(self, ifstatus, vtysh): + def __init__(self, ifstatus: InterfaceStatus, vtysh: VtySH): self.ifstatus = ifstatus self.vtysh = vtysh From 1f1ed62a6dd1916e708c874b002ffc4677ca2310 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 17 Nov 2020 10:09:26 +0100 Subject: [PATCH 0277/3088] FRR: carp_event_handler annotate function parameters (2) --- net/frr/src/opnsense/scripts/frr/lib/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/frr/src/opnsense/scripts/frr/lib/__init__.py b/net/frr/src/opnsense/scripts/frr/lib/__init__.py index bada445eca..21ef2ce233 100644 --- a/net/frr/src/opnsense/scripts/frr/lib/__init__.py +++ b/net/frr/src/opnsense/scripts/frr/lib/__init__.py @@ -27,6 +27,8 @@ import time import subprocess import ujson +from collections.abc import Callable + class InterfaceStatus: def __init__(self): @@ -54,7 +56,7 @@ def parse(self): self._carp_addresses = carp_addresses - def address_status(self, address): + def address_status(self, address: str): if address in self._carp_addresses: return self._carp_addresses[address]['status'] return 'none' @@ -77,14 +79,14 @@ def init(self): except VtySHExecError: time.sleep(1) - def is_running(self, daemon): + def is_running(self, daemon: str): return daemon in self._daemons @property def is_active(self): return len(self._daemons) > 0 - def execute(self, command, translate=ujson.loads, configure=False): + def execute(self, command: str, translate: Callable=ujson.loads, configure: bool=False): args = ['/usr/local/bin/vtysh'] if configure: args = args + ['-c', 'configure terminal'] From c462b0e40f378ef7db2618401268ff56e5d8e020 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 Nov 2020 14:13:06 +0100 Subject: [PATCH 0278/3088] security/tinc: ok to bump version --- security/tinc/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/tinc/Makefile b/security/tinc/Makefile index 3b6a0356ec..b85f2f0211 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= tinc -PLUGIN_VERSION= 1.5 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.6 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org From e809b8cc61b3d862a33b846f1cf89b689d856294 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 Nov 2020 14:16:54 +0100 Subject: [PATCH 0279/3088] net/frr: extend changelog --- net/frr/pkg-descr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 4ded6be649..d8b7cb4958 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -11,6 +11,10 @@ switching and routing, Internet access routers, and Internet peering. Plugin Changelog ================ +1.19 + +* OSPF influence interface cost via carp + 1.18 * Add description fields to BGP tabs From 0e9c1a1bcfeb0cefd4d4785bfe765d587cac0098 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 Nov 2020 14:19:05 +0100 Subject: [PATCH 0280/3088] net/frr: this as well --- net/frr/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index d8b7cb4958..01e0a13c62 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -14,6 +14,7 @@ Plugin Changelog 1.19 * OSPF influence interface cost via carp +* Uniform logging 1.18 From 828ced9afaafd0991204020495502b0b84315d08 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 Nov 2020 14:22:44 +0100 Subject: [PATCH 0281/3088] net/frr: fix lint pass --- net/frr/src/opnsense/scripts/frr/lib/__init__.py | 0 net/frr/src/opnsense/scripts/frr/lib/base.py | 0 net/frr/src/opnsense/scripts/frr/lib/events/__init__.py | 0 net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 net/frr/src/opnsense/scripts/frr/lib/__init__.py mode change 100644 => 100755 net/frr/src/opnsense/scripts/frr/lib/base.py mode change 100644 => 100755 net/frr/src/opnsense/scripts/frr/lib/events/__init__.py mode change 100644 => 100755 net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py diff --git a/net/frr/src/opnsense/scripts/frr/lib/__init__.py b/net/frr/src/opnsense/scripts/frr/lib/__init__.py old mode 100644 new mode 100755 diff --git a/net/frr/src/opnsense/scripts/frr/lib/base.py b/net/frr/src/opnsense/scripts/frr/lib/base.py old mode 100644 new mode 100755 diff --git a/net/frr/src/opnsense/scripts/frr/lib/events/__init__.py b/net/frr/src/opnsense/scripts/frr/lib/events/__init__.py old mode 100644 new mode 100755 diff --git a/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py b/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py old mode 100644 new mode 100755 From 078257cdb3daff37bdad9b94cd26c9914640aaf3 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 22 Nov 2020 00:03:40 +0100 Subject: [PATCH 0282/3088] security/acme-client: fix creation of nsupdate secrets file --- security/acme-client/pkg-descr | 5 +++++ .../library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 9e90b9e385..788a21e8a4 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +2.1 + +Fixed: +* fix creation of nsupdate secrets file + 2.0 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php index 5fe117e5e5..4d6f349d58 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNsupdate.php @@ -39,9 +39,9 @@ class DnsNsupdate extends Base implements LeValidationInterface { public function prepare() { - $configdir = (string)sprintf(self::ACME_CONFIG_DIR, $this->cert_uuid); + $configdir = (string)sprintf(self::ACME_CONFIG_DIR, $this->cert_id); $secret_key_filename = "${configdir}/secret.key"; - $secret_key_data = (string)$this->config->dns_nsupdate_key . '\n'; + $secret_key_data = (string)$this->config->dns_nsupdate_key . "\n"; file_put_contents($secret_key_filename, $secret_key_data); // Add env variables From 12a34717ea445b15ef0ab3cf565e25e7d9e21ff3 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 22 Nov 2020 00:03:58 +0100 Subject: [PATCH 0283/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 97a5889dff..b38548cc80 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 2.0 +PLUGIN_VERSION= 2.1 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From db1d677bbe8b455cd43082367b29ac7e7f294f32 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 22 Nov 2020 00:49:24 +0100 Subject: [PATCH 0284/3088] security/acme-client: fix typo, improve wording --- security/acme-client/pkg-descr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 788a21e8a4..2593a7e784 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -23,13 +23,13 @@ Added: * add plugin changelog Fixed: -* fix bug where configuration could get lost (#1526) +* fix bug where configuration changes could get lost (#1526) * fix Cyon DNS API (password not set) Changed: * now an Automation may run multiple times during bulk issue/renewal (previously only once) * rename "Validation Methods" to "Challenge Types" to adopt official LE wording -* rename Menu entry "Automation" to "Automations" +* rename menu entry "Automation" to "Automations" * specify python version for gcloud SDK * rephrase several log messages * add more detailed output when debug logging is enabled From 2953b022372348e5695628ea8be2431f68f87151 Mon Sep 17 00:00:00 2001 From: Boris Date: Tue, 24 Nov 2020 10:49:10 +0100 Subject: [PATCH 0285/3088] security/acme-client: add support for deSEC.io API (#2120) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * security/acme-client: add support for deSEC.io API Co-authored-by: Boris Stäheli --- security/acme-client/pkg-descr | 3 ++ .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsDedyn.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 33 ++++++++------ 4 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDedyn.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 2593a7e784..a7e1a22ee6 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -10,6 +10,9 @@ Plugin Changelog 2.1 +Added: +* add support for deSEC.io domain API (#2120) + Fixed: * fix creation of nsupdate secrets file diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 10ec7609c1..7866682af6 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1181,4 +1181,19 @@ dropdown + + + header + + + + validation.dns_desec_token + + password + + + validation.dns_desec_name + + text + diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDedyn.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDedyn.php new file mode 100644 index 0000000000..8c27dc4705 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDedyn.php @@ -0,0 +1,45 @@ +acme_env['DEDYN_TOKEN'] = (string)$this->config->dns_desec_token; + $this->acme_env['DEDYN_NAME'] = (string)$this->config->dns_desec_name; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 9f7b7f6337..b87b20dbc1 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -382,6 +382,7 @@ CloudXNS.com API Core-Networks API cyon.ch API + deSEC.io API DigitalOcean API DirectAdmin API DNSimple API @@ -507,10 +508,10 @@ N - N + N - N + N N @@ -520,19 +521,19 @@ 1 - N + N - N + N - N + N - N + N - N + N N @@ -708,20 +709,20 @@ N - N + N - N + N - N - https://api.loopia.se/RPCSERV + N + https://api.loopia.se/RPCSERV - N + N - N + N N @@ -935,6 +936,12 @@ SHA1 + + N + + + N + From b16c30c9fb4a1a706c5d2796e35a0671c51742de Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 24 Nov 2020 10:50:58 +0100 Subject: [PATCH 0286/3088] security/acme-client: post-merge fix for #2120 --- .../AcmeClient/LeValidation/{DnsDedyn.php => DnsDesec.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/{DnsDedyn.php => DnsDesec.php} (100%) diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDedyn.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDesec.php similarity index 100% rename from security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDedyn.php rename to security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDesec.php From f44af645e98798b92640a60e4cfbfdc9e4a8f6a4 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 3 Dec 2020 15:47:42 +0100 Subject: [PATCH 0287/3088] security/acme-client: fix certificate chain when CA changes, closes #2126 --- security/acme-client/pkg-descr | 1 + .../mvc/app/library/OPNsense/AcmeClient/LeCertificate.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index a7e1a22ee6..f96250468e 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -15,6 +15,7 @@ Added: Fixed: * fix creation of nsupdate secrets file +* fix certificate chain when existing cert was signed by a new CA (#2126) 2.0 diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index ac238c2beb..d19bc71c3c 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -262,6 +262,8 @@ public function import(bool $skip_validation = false) $cfgCert->crt = $cert['crt']; $cfgCert->prv = $cert['prv']; $cfgCert->descr = $cert['descr']; + // Update CA ref, because it may be signed by a different CA. + $cfgCert->caref = $cert['caref']; break; } } From 7e71ab69deccedff216b58d90443362172741022 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 5 Dec 2020 09:13:40 +0100 Subject: [PATCH 0288/3088] net/frr: Add BGP neighbor timers and graceful restart (#2112) --- net/frr/pkg-descr | 2 ++ .../OPNsense/Quagga/Api/BgpController.php | 3 +++ .../controllers/OPNsense/Quagga/forms/bgp.xml | 7 ++++++ .../Quagga/forms/dialogEditBGPNeighbor.xml | 23 ++++++++++++++++++- .../mvc/app/models/OPNsense/Quagga/BGP.xml | 21 ++++++++++++++++- .../templates/OPNsense/Quagga/bgpd.conf | 11 +++++++++ 6 files changed, 65 insertions(+), 2 deletions(-) diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 01e0a13c62..efddc98aea 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -20,6 +20,8 @@ Plugin Changelog * Add description fields to BGP tabs * Add BGP community-lists +* Add option for BGP graceful restart +* Allow to set BGP neighbor timers 1.17 diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php index 0f926cf221..68fb8c75ba 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php @@ -48,6 +48,9 @@ public function searchNeighborAction() "updatesource", "nexthopself", "multihop", + "keepalive", + "holddown", + "connecttimer", "defaultoriginate", "linkedPrefixlistIn", "linkedPrefixlistOut", diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/bgp.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/bgp.xml index b0128e5ff2..d3bc6cca5d 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/bgp.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/bgp.xml @@ -18,6 +18,13 @@ true In some cases it might be clearer to set a fixed router-id. + + bgp.graceful + + checkbox + true + BGP graceful restart functionality as defined in RFC-4724 defines the mechanisms that allows BGP speaker to continue to forward data packets along known routes while the routing protocol information is being restored. + bgp.networks diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml index 6476f9ee9f..7f170a4cb1 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml @@ -38,7 +38,28 @@ checkbox - + + neighbor.keepalive + + text + true + Keepalive timer to check if the neighbor is still up. Default when unset is 60 seconds. + + + neighbor.holddown + + text + true + The time in seconds when a neighbor is considered dead. This is usually 3 times the keeplive timer and when unset 180 seconds. + + + neighbor.connecttimer + + text + true + The time in seconds how fast a neighbor tries to reconnect. + + neighbor.defaultoriginate checkbox diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml index 0abecfd3b3..e1106e13e1 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml @@ -1,7 +1,7 @@ //OPNsense/quagga/bgp BGP Routing configuration - 1.0.4 + 1.0.5 0 @@ -17,6 +17,10 @@ N /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ + + 0 + Y + N @@ -70,6 +74,21 @@ 0 N + + N + 1 + 1000 + + + N + 3 + 3000 + + + N + 1 + 65000 + 0 N diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index e5d05085b2..86a75860ad 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -15,6 +15,9 @@ log syslog {{ OPNsense.quagga.general.sysloglevel }} {% if helpers.exists('OPNsense.quagga.bgp.asnumber') and OPNsense.quagga.bgp.asnumber != '' %} router bgp {{ OPNsense.quagga.bgp.asnumber }} no bgp ebgp-requires-policy +{% if helpers.exists('OPNsense.quagga.bgp.graceful') and OPNsense.quagga.bgp.graceful == '1' %} + bgp graceful-restart +{% endif %} {% if helpers.exists('OPNsense.quagga.bgp.routerid') and OPNsense.quagga.bgp.routerid != '' %} bgp router-id {{ OPNsense.quagga.bgp.routerid }} {% endif %} @@ -28,6 +31,14 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if 'multihop' in neighbor and neighbor.multihop == '1' %} neighbor {{ neighbor.address }} ebgp-multihop {% endif %} +{% if 'keepalive' in neighbor and neighbor.keepalive != '' %} +{% if 'holddown' in neighbor and neighbor.holddown != '' %} + neighbor {{ neighbor.address }} timers {{ neighbor.keepalive }} {{ neighbor.holddown }} +{% endif %} +{% endif %} +{% if 'connecttimer' in neighbor and neighbor.connecttimer != '' %} + neighbor {{ neighbor.address }} timers connect {{ neighbor.connecttimer }} +{% endif %} {% endif %} {% endfor %} {% endif %} From 19c74251e03cd3eeabb403baac41987e4a8616b8 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Sat, 5 Dec 2020 09:18:28 +0100 Subject: [PATCH 0289/3088] [Freeradius] Create option to set EAP-TTLS-GTC for FreeRadius (#2089) Creates an option to set freeradius to use EAP-TTLS-GTC. This can, for example, be used to connect to LDAP databases with hashed passwords. Signed-off-by: Kjeld Schouten-Lebbing --- .../src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml | 1 + .../service/templates/OPNsense/Freeradius/mods-enabled-eap | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml index f2b451bea4..9ec71ef013 100644 --- a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml +++ b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml @@ -13,6 +13,7 @@ PEAP TLS TTLS + TTLS-GTC diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-eap b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-eap index 5dc3b327fd..8093143e8b 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-eap +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-eap @@ -628,8 +628,11 @@ eap { # EAP conversation, then this configuration entry is # ignored. # + {% if helpers.exists('OPNsense.freeradius.eap.default_eap_type') and OPNsense.freeradius.eap.default_eap_type == 'ttls-gtc' %} + default_eap_type = gtc + {% else %} default_eap_type = md5 - + {% endif %} # The tunneled authentication request does not usually # contain useful attributes like 'Calling-Station-Id', # etc. These attributes are outside of the tunnel, From a3ce3c356c72e6392ad235e171b16899b7bb9a84 Mon Sep 17 00:00:00 2001 From: chrissyn <62061776+chrissyn@users.noreply.github.com> Date: Sat, 5 Dec 2020 19:06:02 +0100 Subject: [PATCH 0290/3088] Update LeCertificate.php fixes #2128 --- .../mvc/app/library/OPNsense/AcmeClient/LeCertificate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index d19bc71c3c..20ca634476 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -637,7 +637,7 @@ public function setValidation() } // Configure validation object - $val->setNames($this->config->name, $this->config->altNames); + $val->setNames($this->config->name, $this->config->altNames, $this->config->aliasmode, $this->config->domainalias, $this->config->challengealias); $val->setRenewal((int)$this->config->renewInterval); $val->setForce($this->force); // strip prefix from key value From 8a72865e007cd157f0cbf6eace34a67971525c46 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 6 Dec 2020 22:46:00 +0100 Subject: [PATCH 0291/3088] net/frr: style sweep --- .../controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml index 7f170a4cb1..146dff7db0 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml @@ -58,7 +58,7 @@ text true The time in seconds how fast a neighbor tries to reconnect. - + neighbor.defaultoriginate From 02c79ea0fb909fa343a0049da380758bad55d0cd Mon Sep 17 00:00:00 2001 From: Alexander Korinek Date: Fri, 11 Dec 2020 07:18:31 +0100 Subject: [PATCH 0292/3088] wireguard - add IPv6 gateway support for PBR (#2136) --- .../templates/OPNsense/Wireguard/wireguard-server.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf b/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf index f3452f629f..0d07a5ff3e 100644 --- a/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf +++ b/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf @@ -18,8 +18,8 @@ PrivateKey = {{ server_list.privkey }} Table = off {% endif %} {% if server_list.disableroutes == '1' and server_list.gateway|default('') != '' %} -PostUp = route add {{ server_list.gateway }} -iface %i -PostDown = route del {{ server_list.gateway }} -iface %i +PostUp = route {{- ' -6' if ':' in server_list.gateway }} add {{ server_list.gateway }} -iface %i +PostDown = route {{- ' -6' if ':' in server_list.gateway }} del {{ server_list.gateway }} -iface %i {% endif %} {% if server_list.peers|default('') != '' %} {% for peerlist in server_list.peers.split(",") %} From 46196b9e24ec5add0f0a561ef70fa0944f37cffc Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 11 Dec 2020 08:30:03 +0100 Subject: [PATCH 0293/3088] net/wireguard: bump version (#2140) --- net/wireguard/Makefile | 2 +- net/wireguard/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 09f28f5957..d6b8f09d22 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 1.3 +PLUGIN_VERSION= 1.4 PLUGIN_COMMENT= WireGuard VPN service PLUGIN_DEPENDS= wireguard PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 0becbd029f..ff1299e523 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,10 @@ WWW: https://www.wireguard.com/ Changelog --------- +1.4 + +* Add IPv6 gateway support (contributed by Alexander Korinek) + 1.3 * Client/peer name validation to use HostnameField From 73cabd03e579eedda0991cace307386ada818793 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 13 Dec 2020 07:47:20 +0100 Subject: [PATCH 0294/3088] net/frr: add IntegerField for auto-cost calculation (#2144) --- net/frr/Makefile | 2 +- net/frr/pkg-descr | 4 ++++ .../mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml | 7 +++++++ .../src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml | 6 ++++++ .../opnsense/service/templates/OPNsense/Quagga/ospfd.conf | 3 +++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 02c92992a5..1cad170a05 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.19 +PLUGIN_VERSION= 1.20 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index efddc98aea..087fcf1367 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -11,6 +11,10 @@ switching and routing, Internet access routers, and Internet peering. Plugin Changelog ================ +1.20 + +* Allow to adjust reference cost for OSPF calculation + 1.19 * OSPF influence interface cost via carp diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml index 0305f58910..ba766ee930 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml @@ -22,6 +22,13 @@ true If you have a CARP setup, you may want to configure a router id in case of a conflict. + + ospf.costreference + + text + true + Here you can adjust the reference cost in Mbps for path calculation. Mostly needed when you bundle interfaces to higher bandwidth. + ospf.passiveinterfaces diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml index 83ade2b6ff..56b7ebaf3f 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml @@ -16,6 +16,12 @@ N /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ + + N + 1 + 4294967 + Must be a number between 1 and 4294967. + 0 Y diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf index 72c880d873..ff4acea718 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf @@ -38,6 +38,9 @@ interface {{ physical_interface(interface.interfacename) }} {% endif %} ! router ospf +{% if helpers.exists('OPNsense.quagga.ospf.costreference') and OPNsense.quagga.ospf.costreference != '' %} + auto-cost reference-bandwidth {{ OPNsense.quagga.ospf.costreference }} +{% endif %} {% if helpers.exists('OPNsense.quagga.ospf.routerid') and OPNsense.quagga.ospf.routerid != '' %} ospf router-id {{ OPNsense.quagga.ospf.routerid }} {% endif %} From bcda3348297d3f86630b13a463aa30cd77eb5b97 Mon Sep 17 00:00:00 2001 From: Marc Leuser Date: Sun, 13 Dec 2020 08:36:04 +0100 Subject: [PATCH 0295/3088] net/frr: Add FRR profile selection (defaults directive) (#2131) --- net/frr/pkg-descr | 1 + .../app/controllers/OPNsense/Quagga/forms/general.xml | 7 +++++++ .../opnsense/mvc/app/models/OPNsense/Quagga/General.xml | 9 +++++++++ .../opnsense/service/templates/OPNsense/Quagga/bgpd.conf | 3 +++ .../service/templates/OPNsense/Quagga/ospf6d.conf | 3 +++ .../service/templates/OPNsense/Quagga/ospfd.conf | 3 +++ .../opnsense/service/templates/OPNsense/Quagga/ripd.conf | 3 +++ .../service/templates/OPNsense/Quagga/zebra.conf | 3 +++ 8 files changed, 32 insertions(+) diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 087fcf1367..5b865aa850 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -19,6 +19,7 @@ Plugin Changelog * OSPF influence interface cost via carp * Uniform logging +* Add configuration profile selection 1.18 diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml index 2fcfbc2b9b..29c3e7bd71 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml @@ -5,6 +5,13 @@ checkbox This will activate the routing service. + + general.profile + + dropdown + true + FRR documentation for more information.]]> + general.enablecarp diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml index 80d9576ebf..de9a496bde 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml @@ -7,6 +7,15 @@ 0 Y + + Y + N + traditional + + Traditional + Datacenter + + 0 Y diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index 86a75860ad..4bd7d7ef60 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -8,6 +8,9 @@ {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} +{% if helpers.exists('OPNsense.quagga.general.profile') %} +frr defaults {{ OPNsense.quagga.general.profile }} +{% endif %} {% endif %} ! ! diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf index b58d95986e..603950f669 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf @@ -11,6 +11,9 @@ {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} +{% if helpers.exists('OPNsense.quagga.general.profile') %} +frr defaults {{ OPNsense.quagga.general.profile }} +{% endif %} {% endif %} ! ! diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf index ff4acea718..dda33b080a 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf @@ -11,6 +11,9 @@ {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} +{% if helpers.exists('OPNsense.quagga.general.profile') %} +frr defaults {{ OPNsense.quagga.general.profile }} +{% endif %} {% endif %} ! ! diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ripd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ripd.conf index ffb74650e5..70532d4f1a 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ripd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ripd.conf @@ -8,6 +8,9 @@ {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} +{% if helpers.exists('OPNsense.quagga.general.profile') %} +frr defaults {{ OPNsense.quagga.general.profile }} +{% endif %} {% endif %} ! router rip diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf index 01a97a6f4f..06de1506be 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf @@ -3,6 +3,9 @@ ! Zebra configuration saved from vty ! 2017/03/03 20:21:04 ! +{% if helpers.exists('OPNsense.quagga.general.profile') %} +frr defaults {{ OPNsense.quagga.general.profile }} +{% endif %} {% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} log syslog {{ OPNsense.quagga.general.sysloglevel }} {% endif %} From 2af12712c68dc529e23764815df3be9fc33f31ca Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 13 Dec 2020 08:38:04 +0100 Subject: [PATCH 0296/3088] net/frr: fix previous --- net/frr/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 5b865aa850..a25daaa3e0 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -14,12 +14,12 @@ Plugin Changelog 1.20 * Allow to adjust reference cost for OSPF calculation +* Add configuration profile selection 1.19 * OSPF influence interface cost via carp * Uniform logging -* Add configuration profile selection 1.18 From a37538b636fba7b8cfd4bd3a676dc86abf61b2f5 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 13 Dec 2020 12:36:56 +0100 Subject: [PATCH 0297/3088] security/acme-client: use configured DNS sleep time for Namesilo, fixes #2121 --- security/acme-client/pkg-descr | 5 +++++ .../OPNsense/AcmeClient/forms/dialogValidation.xml | 5 +++++ .../library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php | 2 -- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index f96250468e..df3044f386 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +2.2 + +Changed: +* BREAKING: use configured DNS sleep time for Namesilo instead of hardcoded value (#2121) + 2.1 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 7866682af6..4ad41e7ea0 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -752,6 +752,11 @@ header + + + header + + validation.dns_namesilo_key diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php index 1cfa7f3267..98eca7ccfb 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNamesilo.php @@ -40,7 +40,5 @@ class DnsNamesilo extends Base implements LeValidationInterface public function prepare() { $this->acme_env['Namesilo_Key'] = (string)$this->config->dns_namesilo_key; - // Namesilo applies changes to DNS records only every 15 minutes. - $this->acme_args[] = '--dnssleep 960'; } } From 0fe2422fa0a76248ba7c358cb170d31a7c894c65 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 13 Dec 2020 12:53:06 +0100 Subject: [PATCH 0298/3088] security/acme-client: remove all hardcoded DNS sleep times The report in #2121 made it clear that it was never a good idea to use a hardcoded value in the first place. It is very likely a breaking change for some users, so I've added notes to the GUI and the plugin changelog. --- security/acme-client/pkg-descr | 4 ++++ .../AcmeClient/forms/dialogValidation.xml | 20 +++++++++++++++++++ .../AcmeClient/LeValidation/DnsLexicon.php | 5 ----- .../AcmeClient/LeValidation/DnsLinode.php | 2 -- .../AcmeClient/LeValidation/DnsLinodeV4.php | 2 -- .../AcmeClient/LeValidation/DnsNetcup.php | 2 -- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index df3044f386..5496892288 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -12,6 +12,10 @@ Plugin Changelog Changed: * BREAKING: use configured DNS sleep time for Namesilo instead of hardcoded value (#2121) +* BREAKING: use configured DNS sleep time for Lexicon/Namesilo instead of hardcoded value +* BREAKING: use configured DNS sleep time for Linode instead of hardcoded value +* BREAKING: use configured DNS sleep time for Linode v4 instead of hardcoded value +* BREAKING: use configured DNS sleep time for Netcup instead of hardcoded value 2.1 diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 4ad41e7ea0..00ca5e203d 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -603,6 +603,11 @@ header + + + header + + validation.dns_lexicon_provider @@ -623,6 +628,11 @@ header + + + header + + validation.dns_linode_key @@ -633,6 +643,11 @@ header + + + header + + validation.dns_linode_v4_key @@ -767,6 +782,11 @@ header + + + header + + validation.dns_netcup_cid diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLexicon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLexicon.php index 2ffc6d1ec4..0173baa30a 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLexicon.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLexicon.php @@ -46,10 +46,5 @@ public function prepare() $this->acme_env['PROVIDER'] = $provider; $this->acme_env[$env_user] = (string)$this->config->dns_lexicon_user; $this->acme_env[$env_token] = (string)$this->config->dns_lexicon_token; - - if ((string)$this->config->dns_lexicon_provider == 'namesilo') { - // Namesilo applies changes to DNS records only every 15 minutes. - $this->acme_args[] = '--dnssleep 960'; - } } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinode.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinode.php index 2b2453b8bd..e641fa4832 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinode.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinode.php @@ -40,7 +40,5 @@ class DnsLinode extends Base implements LeValidationInterface public function prepare() { $this->acme_env['LINODE_API_KEY'] = (string)$this->config->dns_linode_key; - // Linode can take up to 15 to update DNS records - $this->acme_args[] = '--dnssleep 960'; } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinodeV4.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinodeV4.php index c69293a243..2bad2738a1 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinodeV4.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsLinodeV4.php @@ -40,7 +40,5 @@ class DnsLinodeV4 extends Base implements LeValidationInterface public function prepare() { $this->acme_env['LINODE_V4_API_KEY'] = (string)$this->config->dns_linode_v4_key; - // Linode can take up to 15 to update DNS records - $this->acme_args[] = '--dnssleep 960'; } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNetcup.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNetcup.php index b4afca6cb5..3c9955edaf 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNetcup.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsNetcup.php @@ -42,7 +42,5 @@ public function prepare() $this->acme_env['NC_CID'] = (string)$this->config->dns_netcup_cid; $this->acme_env['NC_Apikey'] = (string)$this->config->dns_netcup_key; $this->acme_env['NC_Apipw'] = (string)$this->config->dns_netcup_pw; - // netcup applies changes to DNS records only every 10 minutes. - $this->acme_args[] = '--dnssleep 600'; } } From 9c25ef44a5866986856c6b631cae821d562e6178 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 13 Dec 2020 13:06:26 +0100 Subject: [PATCH 0299/3088] security/acme-client: update changelog, refs #2130 --- security/acme-client/pkg-descr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 5496892288..67271d4430 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -10,6 +10,9 @@ Plugin Changelog 2.2 +Fixed: +* fix DNS challenge alias mode (#2128, #2130) + Changed: * BREAKING: use configured DNS sleep time for Namesilo instead of hardcoded value (#2121) * BREAKING: use configured DNS sleep time for Lexicon/Namesilo instead of hardcoded value From 7bae0539c4f2f7190082f3f7f6694af00adb7079 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 13 Dec 2020 13:20:16 +0100 Subject: [PATCH 0300/3088] security/acme-client: add support for hexonet.com DNS API, closes #2134 --- security/acme-client/pkg-descr | 3 ++ .../AcmeClient/forms/dialogValidation.xml | 16 +++++++ .../AcmeClient/LeValidation/DnsHexonet.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 4 files changed, 71 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHexonet.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 67271d4430..b559755f7b 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -10,6 +10,9 @@ Plugin Changelog 2.2 +Added: +* add support for hexonet.com DNS API (#2134) + Fixed: * fix DNS challenge alias mode (#2128, #2130) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 00ca5e203d..e6999e3a99 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1221,4 +1221,20 @@ text + + + header + + + + validation.dns_hexonet_login + + text + This should be a combination of the username and role ID. For example, when the username is "myuser" and role ID is "testrole", then "myuser!testrole" must be used here. + + + validation.dns_hexonet_password + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHexonet.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHexonet.php new file mode 100644 index 0000000000..570b59dbfc --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsHexonet.php @@ -0,0 +1,45 @@ +acme_env['Hexonet_Login'] = (string)$this->config->dns_hexonet_login; + $this->acme_env['Hexonet_Password'] = (string)$this->config->dns_hexonet_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index b87b20dbc1..02722c751e 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -401,6 +401,7 @@ Google Cloud DNS API GratisDNS.dk Hetzner DNS API + hexonet.com DNS API hosting.de API Hurricane Electric Infoblox API @@ -917,6 +918,12 @@ N + + N + + + N + N From 449342dd771ff0c4937b72d844b697fbf1b645d4 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 13 Dec 2020 13:25:07 +0100 Subject: [PATCH 0301/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index b38548cc80..c64e3b48a7 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 2.1 +PLUGIN_VERSION= 2.2 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From 43b93e7bd98960b4743a1c9e80dfa6863f71ba26 Mon Sep 17 00:00:00 2001 From: Marc Leuser Date: Sat, 12 Dec 2020 22:57:07 +0100 Subject: [PATCH 0302/3088] rip out legacy code --- net/frr/Makefile | 2 +- .../src/opnsense/scripts/quagga/diag-bgp.sh | 20 - net/frr/src/opnsense/scripts/quagga/quagga.rb | 757 ------------------ .../conf/actions.d/actions_quagga.conf | 188 +++-- 4 files changed, 143 insertions(+), 824 deletions(-) delete mode 100755 net/frr/src/opnsense/scripts/quagga/diag-bgp.sh delete mode 100755 net/frr/src/opnsense/scripts/quagga/quagga.rb diff --git a/net/frr/Makefile b/net/frr/Makefile index 1cad170a05..ae31d1269d 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.20 PLUGIN_COMMENT= The FRRouting Protocol Suite -PLUGIN_DEPENDS= frr7 ruby +PLUGIN_DEPENDS= frr7 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com .include "../../Mk/plugins.mk" diff --git a/net/frr/src/opnsense/scripts/quagga/diag-bgp.sh b/net/frr/src/opnsense/scripts/quagga/diag-bgp.sh deleted file mode 100755 index 4d6e81f268..0000000000 --- a/net/frr/src/opnsense/scripts/quagga/diag-bgp.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -case "$1" in - bgp) - vtysh -d bgpd -c "show ip bgp" - ;; - summary) - vtysh -d bgpd -c "show bgp summary" - ;; - neighbor) - vtysh -d bgpd -c "show ip bgp neighbors $2" - ;; - neighbor-adv) - vtysh -d bgpd -c "show ip bgp neighbors $2 advertised-routes" - ;; - *) - echo "Usage: $0 bgp|summary|neighbor |neighbor-adv " - exit 1 -esac -exit 0 diff --git a/net/frr/src/opnsense/scripts/quagga/quagga.rb b/net/frr/src/opnsense/scripts/quagga/quagga.rb deleted file mode 100755 index a594278552..0000000000 --- a/net/frr/src/opnsense/scripts/quagga/quagga.rb +++ /dev/null @@ -1,757 +0,0 @@ -#!/usr/local/bin/ruby -=begin -Copyright 2017 Fabian Franz -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -=end - -require 'json' -require 'shellwords' -require 'pp' - -$QUAGGA_DEBUG = false - -class VTYSH - def initialize(path = '/usr/local/bin/vtysh') - @path = path - end - - def execute(param) - o = `#{@path} -c #{param.shellescape}` - raise "error" if o.length <= 2 - raise "command error - command: #{param}" if o.include? "% Unknown command" - o - end - - #def execute(param) - # fn = param.sub("show","sh").gsub(" ","_") - # File.read(fn) - #end -end - -class QuaggaTableReader - attr_accessor :headers - def initialize(headers = []) - @headers = headers - end - def read_headline(line, start_without_header = false, start_without_header_name = 'status') - # get begin of header (number of the first char of the string) - header = line - header_offset = {} - header_offset[0] = start_without_header_name if start_without_header - @headers.map do |x| - header_offset[header.index(x)] = x.strip - end - - - # make ranges: this will make a range of the first char of the sting until - # the the char befor the next heading begins - ranges = [] - 0.upto (header_offset.keys.length - 2) do |i| - ranges << ((header_offset.keys[i])...(header_offset.keys[i + 1])) - end - # the last one has no next heading - this will go to the end of the line - ranges.push ((header_offset.keys.last)..-1) # path - @header_offset = header_offset - @ranges = ranges - nil - end - - def read_entry(line, expand_fields = {}) - raise "heading missing" unless @ranges - tmp = {} - return tmp unless line&.strip.length > 2 - - @ranges.each do |r| - # the string starts here - b = r.begin - # get the heading starting where the string starts - n = @header_offset[b] - # get the data or return an empty string - tmp[n] = line[r]&.strip || "" - end - # replace characters by the meaning - expand_fields.keys.each do |key| - tmp[key] = tmp[key].split("").map {|x| {dn: expand_fields[key][x], abb: x} } if tmp[key] - end - tmp - end -end - -class General - def initialize(vtysh) - @vtysh = vtysh - end - def routes(ipv6 = false) - lines = @vtysh.execute("show ip#{ipv6 ? 'v6' : ''} route").lines - - # headers - meanings = {} - while (line = lines.shift.strip) != '' - line = line.gsub('Codes: ','') - line.split(",").each do |meaning| - short, long = meaning.strip.split(" - ") - meanings[short] = long - end - end - - # you don't have to understand this regex ;) - entry_regex = /(\S+?)\s+?(\S+?)(?: \[(\d+)\/(\d+)\])? (?:(?:via (\S+?)|is ([^,]+?)|), ([^,\n]+)|(unreachable \(blackhole\)))(?:, (\S+))?/ - entries = [] - while (line = lines.shift&.strip) - if line.length > 10 - code, network, ad, metric, via, direct, interface, unreachable, time = line.scan(entry_regex).first - code = code.split('').map {|c| {short: c, long: meanings[c]}} - entries << {code: code, network: (network || direct), ad: ad, via: via || unreachable, metric: metric, interface: interface, time: time } - end - end - entries - end - - def routes6 - routes(true) - end - -end - -class OSPF - def initialize(vtysh) - @vtysh = vtysh - end - def neighbors - qta = QuaggaTableReader.new(["Neighbor ID", "Pri", "State", "Dead Time", "Address", "Interface", "RXmtL", "RqstL", "DBsmL"]) - lines = @vtysh.execute("show ip ospf neighbor").lines - lines.shift # empty line - data = [] - qta.read_headline(lines.shift) - while (line = lines.shift) && (line.length > 2) - data << qta.read_entry(line) - end - data - end - - def interface - lines = @vtysh.execute("show ip ospf interface").lines - interfaces = {} - current_if = '' - while line = lines.shift - next if line.strip.length <= 1 - if line[0] != ' ' # we are in a heading - current_if = line.split(" ").first - interfaces[current_if] = {} - current_if = interfaces[current_if] - current_if[:enabled] = true - lines.shift - else - line.strip! - case line - when 'OSPF not enabled on this interface' - current_if[:enabled] = false - when /Internet Address ([^,]+?), Broadcast ([^,]+?), Area (.*)/ - current_if[:address] = $1 - current_if[:broadcast] = $2 - current_if[:area] = $3 - when /MTU mismatch detection:(.*)/ - current_if[:mtu_mismatch_detection] = ($1 == 'enabled') - when /Router ID ([^,]+?), Network Type ([^,]+?), Cost: (\d+)/ - current_if[:router_id] = $1 - current_if[:network_type] = $2 - current_if[:cost] = $3.to_i - when /Transmit Delay is (\d+) sec, State ([^,]+?), Priority (\d+)/ - current_if[:transmit_delay] = $1.to_i - current_if[:state] = $2 - current_if[:priority] = $3.to_i - when "No designated router on this network" - current_if[:designated_router] = nil - when /Designated Router \(ID\) ([^,]+?), Interface Address (.*)/ - current_if[:designated_router] = $1 - current_if[:designated_router_interface_address] = $2 - when "No backup designated router on this network" - current_if[:backup_designated_router] = nil - when /Timer intervals configured, Hello (\d+)s, Dead (\d+)s, Wait (\d+)s, Retransmit (\d+)/ - current_if[:intervals] = {hello: $1.to_i, dead: $2.to_i, wait: $3.to_i, retransmit: $4.to_i} - when /Multicast group memberships: (.*)/ - current_if[:multicast_group_memberships] = $1.split(" ") - when /Hello due in ([\d\.]+|inactive)s?/ - current_if[:hello_due_in] = $1 == 'inactive' ? $1 : $1.to_f - when /Neighbor Count is (\d+), Adjacent neighbor count is (\d+)/ - current_if[:neighbor_count] = $1.to_i - current_if[:adjacent_neighbor_count] = $2.to_i - else - # make sure there is an array to write in - current_if[:unparsed] ||= [] - current_if[:unparsed] << line - puts line if $QUAGGA_DEBUG - end - end - end - interfaces - end - - def database - lines = @vtysh.execute("show ip ospf database").lines - db = {} - heading = '' - router = '' - router_link_states_area = '' - mode = :none - qta = nil - while line = lines.shift - next if line == '' - if line[0] == ' ' # heading - heading = line.strip - case heading - when /OSPF Router with ID \(([\.\d]+)\)/ - router = $1 - db[router] ||= {} - mode = :router - when /Router Link States \(Area ([\.\d]+)\)/ - router_link_states_area = $1 - db[router]['router_link_state_area'] ||= {} - db[router]['router_link_state_area'][$1] ||= [] - mode = :router_link_state - qta = nil - when /Net Link States \(Area ([\.\d]+)\)/ - net_link_states_area = $1 - db[router]['net_link_state_area'] ||= {} - db[router]['net_link_state_area'][$1] ||= [] - mode = :net_link_state - qta = nil - when 'AS External Link States' - mode = :states - db[router]['external_states'] ||= [] - qta = nil - else - puts "unknown heading" if $QUAGGA_DEBUG - end - else - if qta == nil - case mode - when :router_link_state - qta = QuaggaTableReader.new(["Link ID", "ADV Router", "Age", "Seq#", "CkSum", "Link count"]) - when :net_link_state - qta = QuaggaTableReader.new(["Link ID", "ADV Router", "Age", "Seq#", "CkSum"]) - when :states - qta = QuaggaTableReader.new(["Link ID", "ADV Router", "Age", "Seq#", "CkSum", "Route\n"]) - else - next - end - headline = lines.shift - qta.read_headline(headline,true) - else - entry = qta.read_entry(line) - case mode - when :router_link_state - db[router]['router_link_state_area'][router_link_states_area] << entry - when :net_link_state - db[router]['net_link_state_area'][net_link_states_area] << entry - when :states - db[router]['external_states'] << entry - end - end - end - # table - end - db - end - - def route - lines = @vtysh.execute("show ip ospf route").lines - heading = '' - route = {} - last_line = [] - while line = lines.shift - if line[0] == "=" #heading - heading = line.scan(/=* ([^=]*) =*/).first.first - route[heading] = [] - else # data - case line.strip - when /N\s+([\d\.\/]+)\s+\[(\d+)\]\s+area:\s(.*)/ - last_line = {network: $1, cost: $2.to_i, area: $3, type: 'N'} - route[heading] << last_line - when /N (E(?:\d+) (?:\S+))\s+\[([\d\/]+)\] tag: (\d+)/ - last_line = {network: $1, cost: $2, tag: $3.to_i, type: 'N'} - route[heading] << last_line - when /(?:(directly attached) to|via ([^,]+),) (.*)/ - last_line[:via] = $1 || $2 - last_line[:via_interface] = $3 - when /R\s+(\S+)\s+\[(\d+)\] area: ([^,]+)(, ASBR)/ - last_line = {ip: $1, cost: $2.to_i, area: $3, asbr: (", ASBR" == $4), type: 'R'} - route[heading] << last_line - else - puts line if $QUAGGA_DEBUG - end - end - end - route - end - - def overview - lines = @vtysh.execute("show ip ospf").lines - overview = {rfc2328_conform: false, asbr: false} - while line = lines.shift&.strip - case line - when /OSPF Routing Process, Router ID: ([\d\.]+)/ - overview[:router_id] = $1 - when "This implementation conforms to RFC2328" - overview[:rfc2328_conform] = true - when /OpaqueCapability flag is (\S+)/ - overview[:opaque_capability] = ($1 == 'enabled') - when /Initial SPF scheduling delay (\d+) millisec\(s\)/ - overview[:initial_spf_scheduling_delay] = $1.to_i - when /(Min|Max)imum hold time between consecutive SPFs (\d+) millisec\(s\)/ - overview[:hold_time] ||= {} - overview[:hold_time][$1.downcase] = $2.to_i - when "This router is an ASBR (injecting external routing information)" - overview[:asbr] = true - when /Number of external LSA (\d+). Checksum Sum ([x\d]+)/ - overview[:external_lsa] = {count: $1.to_i, checksum: $2} - when /Number of opaque AS LSA (\d+). Checksum Sum ([x\d]+)/ - overview[:opaque_as_lsa] = {count: $1.to_i, checksum: $2} - when /Refresh timer (\d+) secs/ - overview[:refresh_timer] = $1.to_i - when /Number of areas attached to this router: (\d+)/ - overview[:areas_attached_count] = $1.to_i - when /Hold time multiplier is currently (\d+)/ - overview[:current_hold_time_multipier] = $1.to_i - when /RFC1583Compatibility flag is (\S+)/ - overview[:rfc1583_compatibility] = ($1 == 'enabled') - when /SPF timer is (.*)/ - overview[:spf_timer] = $1 - when "" - break - else - puts line if $QUAGGA_DEBUG - end - end - # general overview has ended - now the area overviews come - overview[:areas] = {} - current_area = {} - while line = lines.shift&.strip - case line - when /Area ID: (.*)/ - current_area = {} - overview[:areas][$1] = current_area - when /Number of interfaces in this area: Total: (\d+), Active: (\d+)/ - current_area[:interfaces] = {total: $1.to_i,active: $2.to_i} - when /Number of (router|network|summary) LSA (\d+). Checksum Sum ([\da-fx]+)/ - current_area[:lsa] ||= {} - current_area[:lsa][$1] = {count: $2.to_i, checksum: $3} - when /Number of LSA (\d+)/ - current_area[:lsa] ||= {} - current_area[:lsa][:count] = $1.to_i - when /Number of (opaque (?:area|link)|NSSA|ASBR summary) LSA (\d+). Checksum Sum ([\da-fx]+)/ - current_area[:lsa] ||= {} - current_area[:lsa][$1] = {count: $2.to_i, checksum: $3} - when /Number of fully adjacent neighbors in this area: (\d+)/ - current_area[:fully_adjacent_neighbor_count] = $1.to_i - when /SPF algorithm executed (\d) times/ - current_area[:spf_exec_count] = $1.to_i - when "Area has no authentication" - current_area[:auth] = "none" - else - puts line if $QUAGGA_DEBUG - end - end - overview - end -end - -class BGP - def initialize(sh) - @vtysh = sh - end - - def overview - output = @vtysh.execute('show ip bgp') - return {} if output.include? "No BGP process is configured" - return {} unless output.include? 'version' # we get an empty output if quagga is not running - output = output.split("\n") - bgp = {} - - # Process the header/definitions - while line = output.shift&.rstrip - case line - when /^BGP table version/ - x,y = line.scan(/.*?version is (\d+).*?ID is ([0-9\.]+).*/).first - bgp['table_version'] = x - bgp['local_router_id'] = y - when /^Status codes/ - # find out, what the status abbreviations mean - status_codes = {} - line.split(":").last.strip.split(",").each do |x| - k,v = x.strip.split(" ") - status_codes[k] = v - end - while line.end_with? "," - line = output.shift - line.strip.split(",").each do |x| - k,v = x.strip.split(" ") - status_codes[k] = v - end - end - when /^Origin codes/ - # same like before but for the origin codes - origin_codes = {} - line.split(":").last.strip.split(",").each do |x| - k,v = x.strip.split(" - ") - origin_codes[k] = v - end - when /^Nexthop codes/ - # Just eat this line, nothing to do with it - when "" - # Found the end of the header, reached the table - break - else - # eat all other (unexpected) lines - puts line if $QUAGGA_DEBUG - end - end - - # Process the tabular data - bgp['output'] = [] - qta = QuaggaTableReader.new(["Network", "Next Hop", "Metric", "LocPrf", "Weight", "Path"]) - qta.read_headline(output.shift,true) - while line = output.shift&.strip - break if line == '' - data = qta.read_entry(line) - data['status'] = data['status'].split("").map {|x| {dn: status_codes[x], abb: x} } - data['Path'] = data['Path'].split("").map {|x| {dn: origin_codes[x], abb: x} } - bgp['output'] << data - end - bgp - end -end - -class OSPFv3 - def initialize(sh) - @vtysh = sh - end - - def overview - lines = @vtysh.execute("show ipv6 ospf6").lines - overview = {} - while line = lines.shift&.strip - case line - when /OSPFv3 Routing Process \((\d+)\) with Router-ID ([\d\.]+)/ - overview[:router_id] = $2 - overview[:routing_process] = $1.to_i - when /Initial SPF scheduling delay (\d+) millisec\(s\)/ - overview[:initial_spf_scheduling_delay] = $1.to_i - # this line contains a typo in the output - I made it to work with and without - # this typo - when /(Min|Max)imum hold time between consecutive SPFs (\d+) milli?second\(s\)/ - overview[:hold_time] ||= {} - overview[:hold_time][$1.downcase] = $2.to_i - when "This router is an ASBR (injecting external routing information)" - overview[:asbr] = true - when /SPF timer is (.*)/ - overview[:spf_timer] = $1 - when /Running (.*)/ - overview[:running_time] = $1 - when /Number of AS scoped LSAs is (\d+)/ - overview[:number_as_scoped] = $1.to_i - when /Hold time multiplier is currently (\d+)/ - overview[:current_hold_time_multipier] = $1.to_i - when /Number of areas in this router is (\d+)/ - overview[:number_of_areas] = $1.to_i - when "" - break - else - # debug - puts line if $QUAGGA_DEBUG - end - end - # general overview has ended - now the area overviews come - overview[:areas] = {} - current_area = {} - while line = lines.shift&.strip - case line - when /^Area ([\d\.]*)/ - current_area = {} - overview[:areas][$1] = current_area - when /Interface attached to this area: (.*)/ - current_area[:interfaces] = $1.split(" ") - when /Number of Area scoped LSAs is (.*)/ - current_area[:number_lsas] = $1.to_i - else - puts line if $QUAGGA_DEBUG - end - end - overview - end - - def linkstate - lines = @vtysh.execute("show ipv6 ospf6 linkstate").lines - linkstate = {} - - qta = nil - current_area = [] - while line = lines.shift&.strip - case line - when /SPF Result in Area (.*)/ - linkstate[$1] = current_area = [] - qta = QuaggaTableReader.new(["Type","Router-ID", "Net-ID", "Rtr-Bits", "Options", "Cost"]) - lines.shift - qta.read_headline(lines.shift) - else - if line.length > 10 - current_area << qta.read_entry(line) - end - end - end - linkstate - end - - def route - route = [] - lines = @vtysh.execute("show ipv6 ospf6 route").lines - - lines.each do |line| - f1, f2, network, gateway, interface, time = line.strip.split(/\s+/) - route << { f1: f1, - f2: f2, - network: network, - gateway: gateway, - interface: interface, - time: time } - end - route - end - - def neighbors - qta = QuaggaTableReader.new(["Neighbor ID","Pri", "DeadTime", "State/IfState", "Duration I/F[State]"]) - neighbor = [] - nb = @vtysh.execute("show ipv6 ospf6 neighbor").lines - qta.read_headline(nb.shift.strip) - while line = nb.shift&.strip - puts line - if line.length > 10 - tmp = qta.read_entry(line) - tmp['Pri'] = tmp['Pri'].to_i - neighbor << tmp - end - end - neighbor - end - def database - lines = @vtysh.execute("show ipv6 ospf6 database").lines - database = {} - mode = :none - area = '' - qta = :none - while line = lines.shift&.strip - case line - when /Area Scoped Link State Database \(Area (.*)\)/ - mode = :scoped_link_db - database[:scoped_link_db] ||= {} - database[:scoped_link_db][$1] = area = [] - qta = database_qta(lines) - when /I\/F Scoped Link State Database \(I\/F (\S+) in Area (.*)\)/ - mode = :if_scoped_link_state - database[:if_scoped_link_state] ||= {} - database[:if_scoped_link_state][$1] ||= {} - area = database[:if_scoped_link_state][$1][$2] ||= [] - qta= database_qta(lines) - when "AS Scoped Link State Database" - mode = :as_scoped - area = database[:as_scoped] ||= [] - qta=database_qta(lines) - # note: i have no data for this but i think it looks like the others - else - if line.length > 10 - area << qta.read_entry(line) - end - end - end - database - end - - def interface - lines = @vtysh.execute("show ipv6 ospf6 interface").lines - int = {} - current_if = {} - while line = lines.shift - if line.length > 5 - case line.strip - when /(\S+) is (down|up), type ([A-Z]+)/ - current_if = int[$1] = {up: ($2 == "up" ? true : false), - type: $3, - enabled: true} - when /Interface ID: (\d+)/ - current_if[:id] = $1.to_i - when /OSPF not enabled on this interface/ - current_if[:enabled] = false - when /Instance ID (\d+), Interface MTU (\d+) \(autodetect: (\d+)\)/ - current_if[:instance_id] = $1.to_i - current_if[:interface_mtu] = $2.to_i - current_if[:interface_mtu_autodetect] = $3.to_i - when "Internet Address:" - # ignore - when /(inet |inet6): (\S+)/ - current_if[:IPv6] ||= [] - current_if[:IPv4] ||= [] - family = $1 == 'inet6' ? :IPv6 : :IPv4 - address = $2 - current_if[family] << address - when /MTU mismatch detection: (en|dis)abled/ - current_if[:mtu_mismatch_detection] = $1 == 'en' - when /DR: (\S+) BDR: (\S+)/ - current_if[:designated_router] = $1 - current_if[:backup_designated_router] = $2 - when /State (\S+), Transmit Delay (\d+) sec, Priority (\d+)/ - current_if[:state] = $1 - current_if[:transmit_delay] = $2.to_i - current_if[:priority] = $3.to_i - when /Number of I\/F scoped LSAs is (\d+)/ - current_if[:number_if_scoped_lsas] = $1.to_i - when /(\d+) Pending LSAs for (\S+) in Time ([\d:]+)(?: (.*))/ - current_if[:pending_lsas] ||= {} - current_if[:pending_lsas][$2] = {time: $3, - count: $1, - flags: $4} - when "Timer intervals configured:" - # ignore - when /Hello (\d+), Dead (\d+), Retransmit (\d+)/ - current_if[:timers] = {hello: $1.to_i, - dead: $2.to_i, - retransmit: $3.to_i } - when /Area ID (\S+), Cost (\d+)/ - current_if[:area_cost] ||= [] - current_if[:area_cost] << {area: $1, cost: $2.to_i } - else - puts line if $QUAGGA_DEBUG - end - end - end - int - end - - private - def database_qta(lines) - # DON'T REMOVE THE SPACES!!! - # For some reasons the fields are right aligned with the fields which makes it hard - # to parse. I don't know a better way to get the correct offset except automatically. - # (Detection of semantic of the fields) - qta = QuaggaTableReader.new(["Type", "LSId", "AdvRouter", " Age", " SeqNum"," Payload"]) - lines.shift - qta.read_headline(lines.shift) - qta - end -end - -require 'optparse' -options = {} - -OptionParser.new do |opts| - opts.banner = "Usage: #{__FILE__} -s section [section specific params]" - #### OSPFv2 - opts.on("-d", "--ospf-database", "Prints the OSPF Database") do |od| - options[:ospf_database] = od - end - opts.on("-r", "--ospf-route", 'print OSPF routing table') do |od| - options[:ospf_route] = od - end - opts.on("-i", "--ospf-interface", 'print OSPF interface information') do |od| - options[:ospf_interface] = od - end - opts.on("-n", "--ospf-neighbor", 'Print OSPF neighbors') do |od| - options[:ospf_neighbors] = od - end - opts.on("-o", "--ospf-overview", "Print OSPF summary") do |od| - options[:ospf_overview] = od - end - #### OSPFv3 - opts.on("-D", "--ospfv3-database", "Prints the OSPFv3 Database") do |od| - options[:ospfv3_database] = od - end - opts.on("-t", "--ospfv3-route", 'print OSPFv3 routing table') do |od| - options[:ospfv3_route] = od - end - opts.on("-I", "--ospfv3-interface", 'print OSPFv3 interface information') do |od| - options[:ospfv3_interface] = od - end - opts.on("-N", "--ospfv3-neighbor", 'Print OSPFv3 neighbors') do |od| - options[:ospfv3_neighbors] = od - end - opts.on("-O", "--ospfv3-overview", "Print OSPFv3 summary") do |od| - options[:ospfv3_overview] = od - end - #### general things about routing - opts.on("-R", "--general-routes", "Print Routing Table (IPv4)") do |od| - options[:general_routes] = od - end - opts.on("-6", "--general-routes6", "Print Routing Table (IPv6)") do |od| - options[:general_routes6] = od - end - ### BGP - opts.on("-B", "--bgp-overview", "Print an overview of BGP") do |od| - options[:bgp_overview] = od - end - ### program opts - opts.on("-H", "--human-readable", "Print the output human readable (not json)") do |od| - options[:human_readable] = od - end - opts.on("-X", "--debug", "Prints debug output") do |od| - $QUAGGA_DEBUG = true - end - opts.on("-h", "--help", "Prints this help") do - puts opts - exit - end -end.parse! -# use the lib -sh = VTYSH.new -ospf = OSPF.new sh -ospfv3 = OSPFv3.new sh -bgp = BGP.new sh -general = General.new sh - -result = {} -options.keys.each do |k| - # if it is true - if options[k] - begin - if k.to_s.include? 'ospf_' - cmd = k.to_s.split('_').last - result[k] = ospf.send(cmd) - elsif k.to_s.include? 'ospfv3' - cmd = k.to_s.split('_').last - result[k] = ospfv3.send(cmd) - elsif k.to_s.include? 'general' - cmd = k.to_s.split('_').last - result[k] = general.send(cmd) - elsif k.to_s.include? 'bgp' - cmd = k.to_s.split('_').last - result[k] = bgp.send(cmd) - end - rescue # do nothing on an error - result[k] = "error" - puts $! if $QUAGGA_DEBUG - end - end -end - -# ospf.database, general.routes, ospf.interface, ospf.neighbors, ospf.route, ospf.overview -if options[:human_readable] - pp result -else - print result.to_json -end diff --git a/net/frr/src/opnsense/service/conf/actions.d/actions_quagga.conf b/net/frr/src/opnsense/service/conf/actions.d/actions_quagga.conf index 1b3075f56f..9875177dad 100644 --- a/net/frr/src/opnsense/service/conf/actions.d/actions_quagga.conf +++ b/net/frr/src/opnsense/service/conf/actions.d/actions_quagga.conf @@ -22,92 +22,188 @@ parameters: type:script_output message:request quagga -[diag-bgp] -command:/usr/local/opnsense/scripts/quagga/diag-bgp.sh -parameters:%s +[diagnostics.general_running-config] +command:/usr/local/bin/vtysh -c "show running-config" +parameters: +type:script_output +message:FRR diagnosticts "show running-config" + +[diagnostics.general_route] +command:/usr/local/bin/vtysh -c "show ip route" +parameters: +type:script_output +message:FRR diagnosticts "show ip route" + +[diagnostics.general_route_json] +command:/usr/local/bin/vtysh -c "show ip route json" +parameters: +type:script_output +message:FRR diagnosticts "show ip route json" + +[diagnostics.general_route6] +command:/usr/local/bin/vtysh -c "show ipv6 route" +parameters: +type:script_output +message:FRR diagnosticts "show ipv6 route" + +[diagnostics.general_route6_json] +command:/usr/local/bin/vtysh -c "show ipv6 route json" +parameters: +type:script_output +message:FRR diagnosticts "show ipv6 route json" + +[diagnostics.bgp_overview] +command:/usr/local/bin/vtysh -c "show ip bgp" +parameters: +type:script_output +message:FRR diagnostics "show ip bgp" + +[diagnostics.bgp_overview_json] +command:/usr/local/bin/vtysh -c "show ip bgp json" +parameters: +type:script_output +message:FRR diagnostics "show ip bgp json" + +[diagnostics.bgp_summary] +command:/usr/local/bin/vtysh -c "show ip bgp summary" +parameters: +type:script_output +message:FRR diagnostics "show ip bgp summary" + +[diagnostics.bgp_summary_json] +command:/usr/local/bin/vtysh -c "show ip bgp summary json" +parameters: +type:script_output +message:FRR diagnostics "show ip bgp summary json" + +[diagnostics.bgp_neighbors] +command:/usr/local/bin/vtysh -c "show ip bgp neighbors" +parameters: +type:script_output +message:FRR diagnostics "show ip bgp neighbors" + +[diagnostics.bgp_neighbors_json] +command:/usr/local/bin/vtysh -c "show ip bgp neighbors json" +parameters: +type:script_output +message:FRR diagnostics "show ip bgp neighbors json" + +[diagnostics.ospf_overview] +command:/usr/local/bin/vtysh -c "show ip ospf" +parameters: +type:script_output +message:FRR diagnostics "show ip ospf" + +[diagnostics.ospf_overview_json] +command:/usr/local/bin/vtysh -c "show ip ospf json" +parameters: +type:script_output +message:FRR diagnostics "show ip ospf json" + +[diagnostics.ospf_neighbor] +command:/usr/local/bin/vtysh -c "show ip ospf neighbor" +parameters: +type:script_output +message:FRR diagnostics "show ip ospf neighbor" + +[diagnostics.ospf_neighbor_json] +command:/usr/local/bin/vtysh -c "show ip ospf neighbor json" +parameters: +type:script_output +message:FRR diagnostics "show ip ospf neighbor json" + +[diagnostics.ospf_route] +command:/usr/local/bin/vtysh -c "show ip ospf route" +parameters: +type:script_output +message:FRR diagnostics "show ip ospf route" + +[diagnostics.ospf_route_json] +command:/usr/local/bin/vtysh -c "show ip ospf route json" +parameters: type:script_output -message:bgp diagnostics +message:FRR diagnostics "show ip ospf route json" -[diag-bgp2] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --bgp-overview +[diagnostics.ospf_database] +command:/usr/local/bin/vtysh -c "show ip ospf database" parameters: type:script_output -message:bgp diagnostics +message:FRR diagnostics "show ip ospf database" -[ospf-database] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospf-database +[diagnostics.ospf_database_json] +command:exit 1 parameters: type:script_output -message: Shows the OSPF database +message:FRR diagnostics "show ip ospf database json" (not implemented) -[ospf-route] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospf-route +[diagnostics.ospf_interface] +command:/usr/local/bin/vtysh -c "show ip ospf interface" parameters: type:script_output -message: print OSPF routing table +message:FRR diagnostics "show ip ospf interface" -[ospf-interface] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospf-interface +[diagnostics.ospf_interface_json] +command:/usr/local/bin/vtysh -c "show ip ospf interface json" parameters: type:script_output -message: print OSPF interface information +message:FRR diagnostics "show ip ospf interface json" -[ospf-neighbor] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospf-neighbor +[diagnostics.ospfv3_overview] +command:/usr/local/bin/vtysh -c "show ipv6 ospf6" parameters: type:script_output -message: Print OSPF neighbors +message:FRR diagnostics "show ipv6 ospf6" -[ospf-overview] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospf-overview +[diagnostics.ospfv3_overview_json] +command:exit 1 parameters: type:script_output -message: Print OSPF summary +message:FRR diagnostics "show ipv6 ospf6 json" (not implemented) -[ospfv3-database] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospfv3-database +[diagnostics.ospfv3_neighbor] +command:/usr/local/bin/vtysh -c "show ipv6 ospf6 neighbor" parameters: type:script_output -message: Shows the OSPF database +message:FRR diagnostics "show ipv6 ospf6 neighbor" -[ospfv3-route] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospfv3-route +[diagnostics.ospfv3_neighbor_json] +command:exit 1 parameters: type:script_output -message: print OSPF routing table +message:FRR diagnostics "show ipv6 ospf6 neighbor json" (not implemented) -[ospfv3-interface] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospfv3-interface +[diagnostics.ospfv3_route] +command:/usr/local/bin/vtysh -c "show ipv6 ospf6 route" parameters: type:script_output -message: print OSPF interface information +message:FRR diagnostics "show ipv6 ospf6 route" -[ospfv3-neighbor] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospfv3-neighbor +[diagnostics.ospfv3_route_json] +command:exit 1 parameters: type:script_output -message: Print OSPF neighbors +message:FRR diagnostics "show ipv6 ospf6 route json" (not implemented) -[ospfv3-overview] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --ospfv3-overview +[diagnostics.ospfv3_database] +command:/usr/local/bin/vtysh -c "show ipv6 ospf6 database" parameters: type:script_output -message: Print OSPF summary +message:FRR diagnostics "show ipv6 ospf6 database" -[general-routes] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --general-routes +[diagnostics.ospfv3_database_json] +command:exit 1 parameters: type:script_output -message: Print IPv4 Routing Table +message:FRR diagnostics "show ipv6 ospf6 database json" (not implemented) -[general-routes6] -command:/usr/local/opnsense/scripts/quagga/quagga.rb --general-routes6 +[diagnostics.ospfv3_interface] +command:/usr/local/bin/vtysh -c "show ipv6 ospf6 interface" parameters: type:script_output -message: Print IPv6 Routing Table +message:FRR diagnostics "show ipv6 ospf6 interface" -[general-runningconfig] -command:/usr/local/bin/vtysh -c "show run" +[diagnostics.ospfv3_interface_json] +command:exit 1 parameters: type:script_output -message: Show running configuration +message:FRR diagnostics "show ipv6 ospf6 interface json" (not implemented) From fb2c9f1af2aa32a980aa6836b2139e3d10ac725e Mon Sep 17 00:00:00 2001 From: Marc Leuser Date: Sat, 12 Dec 2020 22:57:47 +0100 Subject: [PATCH 0303/3088] rework and streamline API --- .../Quagga/Api/DiagnosticsController.php | 108 +++++++++--------- 1 file changed, 51 insertions(+), 57 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php index a6d8da8f42..a4f3e358cb 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php @@ -41,96 +41,90 @@ */ class DiagnosticsController extends ApiControllerBase { - /** - * show ip bgp - * @return array - */ - public function showipbgpAction() + private function getInformation(string $daemon, string $name, string $format): array { $backend = new Backend(); - $response = json_decode(trim($backend->configdRun("quagga diag-bgp2"))); - return array("response" => $response); + $response = $backend->configdRun("quagga diagnostics ".$daemon."_".$name.($format === "json" ? "_json" : "")); + return array("response" => ($format === "json" ? json_decode($response) : $response)); } - /** - * show ip bgp summary - * @return array - */ - public function showipbgpsummaryAction() - { - $backend = new Backend(); - $response = $backend->configdRun("quagga diag-bgp summary"); - return array("response" => $response); - } - public function showrunningconfigAction() + + public function generalrunningconfigAction(): array { - $backend = new Backend(); - $response = $backend->configdRun("quagga general-runningconfig"); - return array("response" => $response); + return $this->getInformation("general", "running-config", "plain"); } - private function get_ospf_information($name) + + public function generalrouteAction($format = "json"): array { - $backend = new Backend(); - return array("response" => json_decode(trim($backend->configdRun("quagga ospf-$name")))); + return $this->getInformation("general", "route", $format); } - private function get_ospf3_information($name) + + public function generalroute6Action($format = "json"): array { - $backend = new Backend(); - return array("response" => json_decode(trim($backend->configdRun("quagga ospfv3-$name")))); + return $this->getInformation("general", "route6", $format); } - // OSPFv2 - public function ospfoverviewAction() + + public function bgpoverviewAction($format = "json"): array { - return $this->get_ospf_information('overview'); + return $this->getInformation("bgp", "overview", $format); } - public function ospfneighborAction() + + public function bgpsummaryAction($format = "json"): array { - return $this->get_ospf_information('neighbor'); + return $this->getInformation("bgp", "summary", $format); } - public function ospfrouteAction() + + public function bgpneighborsAction($format = "json"): array { - return $this->get_ospf_information('route'); + return $this->getInformation("bgp", "neighbors", $format); } - public function ospfdatabaseAction() + + public function ospfoverviewAction($format = "json"): array { - return $this->get_ospf_information('database'); + return $this->getInformation("ospf", "overview", $format); } - public function ospfinterfaceAction() + + public function ospfneighborAction($format = "json"): array { - return $this->get_ospf_information('interface'); + return $this->getInformation("ospf", "neighbor", $format); } - // OSPFv3 - public function ospfv3overviewAction() + + public function ospfrouteAction($format = "json"): array { - return $this->get_ospf3_information('overview'); + return $this->getInformation("ospf", "route", $format); } - public function ospfv3neighborAction() + + public function ospfdatabaseAction($format = "json"): array { - return $this->get_ospf3_information('neighbor'); + return $this->getInformation("ospf", "database", $format); } - public function ospfv3routeAction() + + public function ospfinterfaceAction($format = "json"): array { - return $this->get_ospf3_information('route'); + return $this->getInformation("ospf", "interface", $format); } - public function ospfv3databaseAction() + + public function ospfv3overviewAction($format = "json"): array { - return $this->get_ospf3_information('database'); + return $this->getInformation("ospfv3", "overview", $format); } - public function ospfv3interfaceAction() + + public function ospfv3neighborAction($format = "json"): array { - return $this->get_ospf3_information('interface'); + return $this->getInformation("ospfv3", "neighbor", $format); } - // General - private function get_general_information($name) + + public function ospfv3routeAction($format = "json"): array { - $backend = new Backend(); - return array("response" => json_decode(trim($backend->configdRun("quagga general-$name")), true)); + return $this->getInformation("ospfv3", "route", $format); } - public function generalroutesAction() + + public function ospfv3databaseAction($format = "json"): array { - return $this->get_general_information('routes'); + return $this->getInformation("ospfv3", "database", $format); } - public function generalroutes6Action() + + public function ospfv3interfaceAction($format = "json"): array { - return $this->get_general_information('routes6'); + return $this->getInformation("ospfv3", "interface", $format); } } From 80a3b49c4f7996c9042bd1fa2a7b3afd00fa21bc Mon Sep 17 00:00:00 2001 From: Marc Leuser Date: Sat, 12 Dec 2020 23:21:04 +0100 Subject: [PATCH 0304/3088] start fixing frontend at least... something... is working --- .../opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt | 2 +- .../mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt index 06818b0cd4..4e4479dcfd 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt @@ -91,7 +91,7 @@ $(document).ready(function() { $('#overview').html(content) }); - ajaxCall(url="/api/quagga/diagnostics/showipbgpsummary", sendData={}, callback=function(data,status) { + ajaxCall(url="/api/quagga/diagnostics/bgpsummary/plain", sendData={}, callback=function(data,status) { $("#summarycontent").text(data['response']); }); }); diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt index 4e15ea266f..9728e15364 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsgeneral.volt @@ -110,7 +110,7 @@ $(document).ready(function() { $('#routing6').html(content) //$('#routing6 table').bootgrid({converters: dataconverters}) }); - ajaxCall(url="/api/quagga/diagnostics/showrunningconfig", sendData={}, callback=function(data,status) { + ajaxCall(url="/api/quagga/diagnostics/generalrunningconfig", sendData={}, callback=function(data,status) { $("#runningconfig").text(data['response']); }); From 01348b31a53d4db18f05b6714480bd24c7427898 Mon Sep 17 00:00:00 2001 From: Marc Leuser Date: Sun, 13 Dec 2020 16:17:19 +0100 Subject: [PATCH 0305/3088] fix OSPF diagnostics page (wip) database not yet implemented tooltip for route type doesn't work --- .../OPNsense/Quagga/diagnosticsospf.volt | 303 +++++++++--------- 1 file changed, 155 insertions(+), 148 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt index 0ac926d068..856dced2a3 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt @@ -33,51 +33,47 @@ POSSIBILITY OF SUCH DAMAGE. - + - + - + - + - + - + - + - + - - - - - + - + - +
    {{ lang._('Enabled') }} +
    +
    +
    {{ lang._('RFC2328 Conform') }}<%= checkmark(ospf_overview['rfc2328_conform']) %><%= checkmark(rfc2328Conform) %>
    {{ lang._('ASBR') }}<%= checkmark(ospf_overview['asbr']) %><%= checkmark(asbrRouter == "injectingExternalRoutingInformation") %>
    {{ lang._('Router ID') }}<%= ospf_overview['router_id'] %><%= routerId %>
    {{ lang._('RFC1583 Compatibility') }}<%= checkmark(ospf_overview['rfc1583_compatibility']) %><%= checkmark(typeof rfc1583Compatibility != "undefined" && rfc1583Compatibility) %>
    {{ lang._('Opaque Capability') }}<%= checkmark(ospf_overview['opaque_capability']) %><%= checkmark(typeof opaqueCapable != "undefined" && opaqueCapable) %>
    {{ lang._('Initial SPF Scheduling Delay') }}<%= ospf_overview['initial_spf_scheduling_delay'] %><%= spfScheduleDelayMsecs %> {{ lang._('Milliseconds') }}
    {{ lang._('Minimum Hold Time') }}<%= ospf_overview['hold_time']['min'] %> {{ lang._('Milliseconds') }}<%= holdtimeMinMsecs %> {{ lang._('Milliseconds') }}
    {{ lang._('Maximum Hold Time') }}<%= ospf_overview['hold_time']['max'] %> {{ lang._('Milliseconds') }}<%= holdtimeMaxMsecs %> {{ lang._('Milliseconds') }}
    {{ lang._('Current Hold Time Multipier') }}<%= ospf_overview['current_hold_time_multipier'] %>
    {{ lang._('SPF Timer') }}<%= ospf_overview['spf_timer'] %><%= holdtimeMultplier %>
    {{ lang._('Refresh Timer') }}<%= ospf_overview['refresh_timer'] %><%= refreshTimerMsecs %> {{ lang._('Milliseconds') }}
    {{ lang._('Areas Attached Count') }}<%= ospf_overview['areas_attached_count'] %><%= attachedAreaCounter %>
    @@ -94,67 +90,98 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('External LSA') }} - <%= ospf_overview['external_lsa']['count'] %> - <%= ospf_overview['external_lsa']['checksum'] %> + <%= lsaExternalCounter %> + <%= lsaExternalChecksum %> {{ lang._('Opaque AS LSA') }} - <%= ospf_overview['opaque_as_lsa']['count'] %> - <%= ospf_overview['opaque_as_lsa']['checksum'] %> + <%= lsaAsopaqueCounter %> + <%= lsaAsOpaqueChecksum %>

    {{ lang._('Areas') }}

    -<% if (ospf_overview['areas']) { %> - <% areas = ospf_overview['areas'] %> - <% _.each(_.keys(areas), function(areaname) { %> - <% area = areas[areaname] %> -

    <%= areaname %>

    - +<% if (areas) { %> + <% _.forEach(areas, function(area, areaname) { %> +
    +
    + + + + + + - + - + - + - +
    <%= areaname %>{{ lang._('Count') }}
    {{ lang._('Interfaces: Total') }}<%= area['interfaces']['total'] %><%= area['areaIfTotalCounter'] %>
    {{ lang._('Interfaces: Active') }}<%= area['interfaces']['active'] %><%= area['areaIfActiveCounter'] %>
    {{ lang._('Fully Adjacent Neighbor Count') }}<%= area['fully_adjacent_neighbor_count'] %><%= area['nbrFullAdjacentCounter'] %>
    {{ lang._('SPF Execution Count') }}<%= area['spf_exec_count'] %><%= area['spfExecutedCounter'] %>
    - + - <% _.each(_.keys(area['lsa']), function(lsaname) { %> - <% lsa = area['lsa'][lsaname] %> - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - <% }) %>
    {{ lang._('LSA Type') }} {{ lang._('Count') }} {{ lang._('Checksum') }}
    <%= translate(lsaname) %><%= lsa['count'] %><%= lsa['checksum'] %>{{ lang._('Router') }}<%= area['lsaRouterNumber'] %><%= area['lsaRouterChecksum'] %>
    {{ lang._('Network') }}<%= area['lsaNetworkNumber'] %><%= area['lsaNetworkChecksum'] %>
    {{ lang._('Summary') }}<%= area['lsaSummaryNumber'] %><%= area['lsaSummaryChecksum'] %>
    {{ lang._('ASBR Summary') }}<%= area['lsaAsbrNumber'] %><%= area['lsaAsbrChecksum'] %>
    {{ lang._('NSSA') }}<%= area['lsaNssaNumber'] %><%= area['lsaNssaChecksum'] %>
    {{ lang._('Opaque Link') }}<%= area['lsaOpaqueLinkNumber'] %><%= area['lsaOpaqueLinkChecksum'] %>
    {{ lang._('Opaque Area') }}<%= area['lsaOpaqueAreaNumber'] %><%= area['lsaOpaqueAreaNumber'] %>
    <% }) %> <% } %> ---> + + --> -
    -
    -
    -
    -
    
    -    
    +
    +
    +
    +
    
    +  
    diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt index f8dc9eee60..b27fc4a7fa 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt @@ -28,119 +28,118 @@ POSSIBILITY OF SUCH DAMAGE. #} - - + -
    -
    -
    -
    -
    
    -    
    -
    -
    +
    +
    +
    +
    
    +  
    +
    +
    From 124a54153c030a902e2a144987b29d097a20c18d Mon Sep 17 00:00:00 2001 From: Marc Leuser Date: Mon, 14 Dec 2020 11:54:19 +0100 Subject: [PATCH 0316/3088] heading and one more small style/format fix --- .../mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt index fec0a295b7..6e78fe80e0 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt @@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. #} - - + From 41ec7749c6562a01da08f6fd11f820a0d16368aa Mon Sep 17 00:00:00 2001 From: Marc Leuser Date: Mon, 14 Dec 2020 21:50:13 +0100 Subject: [PATCH 0318/3088] BGP ipv6 support and clearer protocol distinction --- .../Quagga/Api/DiagnosticsController.php | 23 +++- .../app/models/OPNsense/Quagga/Menu/Menu.xml | 4 +- .../views/OPNsense/Quagga/diagnosticsbgp.volt | 39 +++---- .../OPNsense/Quagga/diagnosticsgeneral.volt | 9 +- .../conf/actions.d/actions_quagga.conf | 104 +++++++++++++++--- 5 files changed, 130 insertions(+), 49 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php index a4f3e358cb..f19af0e86b 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php @@ -55,7 +55,14 @@ public function generalrunningconfigAction(): array public function generalrouteAction($format = "json"): array { - return $this->getInformation("general", "route", $format); + $routes4 = $this->getInformation("general", "route4", $format)['response']; + $routes6 = $this->getInformation("general", "route6", $format)['response']; + return array("response" => ($format === "json" ? array("ipv4" => $routes4, "ipv6" => $routes6) : $routes4.$routes6)); + } + + public function generalroute4Action($format = "json"): array + { + return $this->getInformation("general", "route4", $format); } public function generalroute6Action($format = "json"): array @@ -63,9 +70,19 @@ public function generalroute6Action($format = "json"): array return $this->getInformation("general", "route6", $format); } - public function bgpoverviewAction($format = "json"): array + public function bgprouteAction($format = "json"): array + { + return $this->getInformation("bgp", "route", $format); + } + + public function bgproute4Action($format = "json"): array + { + return $this->getInformation("bgp", "route4", $format); + } + + public function bgproute6Action($format = "json"): array { - return $this->getInformation("bgp", "overview", $format); + return $this->getInformation("bgp", "route6", $format); } public function bgpsummaryAction($format = "json"): array diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml index 03dca32ded..e294cc1151 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml @@ -5,12 +5,12 @@ - + - + diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt index 2f26a136f2..760745325f 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt @@ -34,24 +34,10 @@ POSSIBILITY OF SUCH DAMAGE. - + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('id') }}{{ lang._('Proxy') }}{{ lang._('Server') }}{{ lang._('Address') }}{{ lang._('Status') }}{{ lang._('Check Status') }}{{ lang._('Weight') }}{{ lang._('Sessions') }}{{ lang._('Bytes in') }}{{ lang._('Bytes out') }}{{ lang._('Active') }}{{ lang._('Downtime') }}{{ lang._('Last Change') }}{{ lang._('Commands') }}
    + + + + +
    +
    +
    + +{{ partial("layout_partials/base_dialog_processing") }} diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py new file mode 100644 index 0000000000..c7f37eafa1 --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py @@ -0,0 +1,3 @@ +"""haproxy lib for socket commands. +Based on: https://github.com/neurogeek/haproxyctl""" +__version__ = "1.0" diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py new file mode 100644 index 0000000000..0316bd99ef --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py @@ -0,0 +1,237 @@ +# pylint: disable=locally-disabled, too-few-public-methods, no-self-use, invalid-name +"""cmds.py - Implementations of the different HAProxy commands""" + +import re +import csv +import json +from io import StringIO + + +class Cmd(): + """Cmd - Command base class""" + req_args = [] + args = {} + cmdTxt = "" + helpTxt = "" + + # pylint: disable=unused-argument + def __init__(self, *args, **kwargs): + """Argument to the command are given in kwargs only. We ignore *args.""" + self.args = kwargs + valid_kwargs = [k for (k, v) in kwargs.items() if v is not None] + + if not all([a in valid_kwargs for a in self.req_args]): + raise Exception(f"Wrong number of arguments. Required arguments are: {self.WhatArgs()}") + + def WhatArgs(self): + """Returns a formatted string of arguments to this command.""" + return ",".join(self.req_args) + + @classmethod + def getHelp(cls): + """Get formatted help string for this command.""" + txtArgs = ",".join(cls.req_args) + + if not txtArgs: + txtArgs = "None" + return " ".join((cls.helpTxt, "Arguments: %s" % txtArgs)) + + def getCmd(self): + """Gets the command line for this command. + The default behavior is to apply the args dict to cmdTxt + """ + return self.cmdTxt % self.args + + def getResult(self, res): + """Returns raw results gathered from HAProxy""" + if res == '\n': + res = None + return res + + def getResultObj(self, res): + """Returns refined output from HAProxy, packed inside a Python obj i.e. a dict()""" + return res + + +class setServerAgent(Cmd): + """Set server agent command.""" + cmdTxt = "set server %(backend)s/%(server)s agent %(value)s\r\n" + req_args = ['backend', 'server', 'value'] + helpTxt = "Force a server's agent to a new state." + + +class setServerHealth(Cmd): + """Set server health command.""" + cmdTxt = "set server %(backend)s/%(server)s health %(value)s\r\n" + req_args = ['backend', 'server', 'value'] + helpTxt = "Force a server's health to a new state." + + +class setServerState(Cmd): + """Set server state command.""" + cmdTxt = "set server %(backend)s/%(server)s state %(value)s\r\n" + req_args = ['backend', 'server', 'value'] + helpTxt = "Force a server's administrative state to a new state." + + +class setServerWeight(Cmd): + """Set server weight command.""" + cmdTxt = "set server %(backend)s/%(server)s weight %(value)s\r\n" + req_args = ['backend', 'server', 'value'] + helpTxt = "Force a server's weight to a new state." + + +class showFBEnds(Cmd): + """Base class for getting a listing Frontends and Backends""" + switch = "" + cmdTxt = "show stat\r\n" + + def getResult(self, res): + return "\n".join(self._getResult(res)) + + def getResultObj(self, res): + return self._getResult(res) + + def _getResult(self, res): + """Show Frontend/Backends. To do this, we extract info from + the stat command and filter out by a specific + switch (FRONTEND/BACKEND)""" + + if not self.switch: + raise Exception("No action specified") + + result = [] + lines = res.split('\n') + cl = re.compile("^[^,].+," + self.switch.upper() + ",.*$") + + for e in lines: + me = re.match(cl, e) + if me: + result.append(e.split(",")[0]) + return result + + +class showFrontends(showFBEnds): + """Show frontends command.""" + switch = "frontend" + helpTxt = "List all Frontends." + + +class showBackends(showFBEnds): + """Show backends command.""" + switch = "backend" + helpTxt = "List all Backends." + + +class showInfo(Cmd): + """Show info HAProxy command""" + cmdTxt = "show info\r\n" + helpTxt = "Show info on HAProxy instance." + + def getResultObj(self, res): + resDict = {} + for line in res.split('\n'): + k, v = line.split(':') + resDict[k] = v + + return resDict + + +class showSessions(Cmd): + """Show sess HAProxy command""" + cmdTxt = "show sess\r\n" + helpTxt = "Show HAProxy sessions." + + def getResultObj(self, res): + return res.split('\n') + + +class baseStat(Cmd): + """Base class for stats commands.""" + + def getDict(self, res): + # clean response + res = re.sub(r'^# ', '', res, re.MULTILINE) + res = re.sub(r',\n', '\n', res, re.MULTILINE) + res = re.sub(r',\n\n', '\n', res, re.MULTILINE) + + csv_string = StringIO(res) + return csv.DictReader(csv_string, delimiter=',') + + def getBootstrapOutput(self, **kwargs): + rows = kwargs['rows'] + # search + if kwargs['search']: + filtered_rows = [] + for row in rows: + def inner(row): + for k, v in row.items(): + if kwargs['search'] in v: + return row + return None + + match = inner(row) + if match: + filtered_rows.append(match) + rows = filtered_rows + + # sort + rows.sort(key=lambda k: k[kwargs['sort_col']], reverse=True if kwargs['sort_dir'] == 'desc' else False) + + # pager + total = len(rows) + pages = [rows[i:i + kwargs['page_rows']] for i in range(0, total, kwargs['page_rows'])] + if pages and (kwargs['page'] > len(pages) or kwargs['page'] < 1): + raise KeyError(f"Current page {kwargs['page']} does not exist. Available pages: {len(pages)}") + page = pages[kwargs['page'] - 1] if pages else [] + + return json.dumps({ + "rows": page, + "total": total, + "rowCount": kwargs['page_rows'], + "current": kwargs['page'] + }) + + +class showServers(baseStat): + """Show all servers. If backend is given, show only servers for this backend. """ + cmdTxt = "show stat\r\n" + helpTxt = "Lists all servers. Filter for servers in backend, if set." + + def getResult(self, res): + if self.args['output'] == 'json': + return json.dumps(self.getResultObj(res)) + + if self.args['output'] == 'bootstrap': + rows = self.getResultObj(res) + args = { + "rows": rows, + "page": int(self.args['page']) if self.args['page'] != None else 1, + "page_rows": int(self.args['page_rows']) if self.args['page_rows'] != None else len(rows), + "search": self.args['search'], + "sort_col": self.args['sort_col'] if self.args['sort_col'] else 'id', + "sort_dir": self.args['sort_dir'], + } + return self.getBootstrapOutput(**args) + + return self.getResultObj(res) + + def getResultObj(self, res): + servers = [] + + reader = self.getDict(res) + for row in reader: + # show only server + if row['svname'] in ['BACKEND', 'FRONTEND']: + continue + + # filter server for given backend + if self.args['backend'] and row['pxname'] != self.args['backend']: + continue + + # add id + row['id'] = f"{row['pxname']}/{row['svname']}" + row.move_to_end('id', last=False) + servers.append(dict(row)) + + return servers diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py new file mode 100644 index 0000000000..962a15cf5e --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py @@ -0,0 +1,83 @@ +# pylint: disable=locally-disabled, too-few-public-methods, no-self-use, invalid-name +"""conn.py - Connection module.""" +import re +from socket import socket, AF_INET, AF_UNIX, SOCK_STREAM +from haproxy import const + +class HapError(Exception): + """Generic exception for haproxyctl.""" + pass + +class HaPConn(object): + """HAProxy Socket object. + This class abstract the socket interface so + commands can be sent to HAProxy and results received and + parse by the command objects""" + + def __init__(self, sfile, socket_module=socket): + """Initializes an HAProxy and opens a connection to it + (sfile, type) -> Path for the UNIX socket""" + + self.sock = None + sfile = sfile.strip() + stype = AF_UNIX + self.socket_module = socket_module + + mobj = re.match( + '(?Punix://|tcp://)(?P[^:]+):*(?P[0-9]*)$', sfile) + + if mobj: + proto = mobj.groupdict().get('proto', None) + addr = mobj.groupdict().get('addr', None) + port = mobj.groupdict().get('port', '') + + if not addr or not proto: + raise HapError('Could not determine type of socket.') + + if proto == const.HAP_TCP_PATH: + if not port: + raise HapError('When using a tcp socket, a port is needed.') + stype = AF_INET + sfile = (addr, int(port)) + + if proto == const.HAP_UNIX_PATH: + stype = AF_UNIX + sfile = addr + + # Fallback should be sfile/AF_UNIX by default + self.sfile = (sfile, stype) + self.open() + + def open(self): + """Opens a connection for the socket. + This function should only be called if + self.closed() method was called""" + + sfile, stype = self.sfile + self.sock = self.socket_module(stype, SOCK_STREAM) + self.sock.connect(sfile) + + def sendCmd(self, cmd, objectify=False): + """Receives a command obj and sends it to the socket. Receives the output and passes it + through the command to parse it. + objectify -> Return an object instead of plain text""" + + res = "" + try: + self.sock.send(cmd.getCmd()) + except TypeError: + self.sock.send(bytearray(cmd.getCmd(), 'ASCII')) + output = self.sock.recv(const.HAP_BUFSIZE) + + while output: + res += output.decode('ASCII') + output = self.sock.recv(const.HAP_BUFSIZE) + + if objectify: + return cmd.getResultObj(res) + + return cmd.getResult(res) + + def close(self): + """Closes the socket""" + self.sock.close() diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py new file mode 100644 index 0000000000..ebd60d8c89 --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py @@ -0,0 +1,7 @@ +"""const.py - Constants for haproxyctl.""" +HAP_OK = 1 +HAP_ERR = 2 +HAP_SOCK_ERR = 3 +HAP_BUFSIZE = 8192 +HAP_UNIX_PATH = 'unix://' +HAP_TCP_PATH = 'tcp://' diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py new file mode 100644 index 0000000000..032954583d --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py @@ -0,0 +1,73 @@ +# pylint: disable=star-args, locally-disabled, too-few-public-methods, no-self-use, invalid-name +"""test_cmds.py - Unittests related to command implementations.""" +import sys, os, unittest + +sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) +from haproxy import cmds + +class TestCommands(unittest.TestCase): + """Tests all of the commands.""" + def setUp(self): + + self.Resp = {"disable" : "disable server redis-ro/redis-ro0", + "set-server-agent" : "set server redis-ro/redis-ro0 agent up", + "set-server-health" : "set server redis-ro/redis-ro0 health stopping", + "set-server-state" : "set server redis-ro/redis-ro0 state drain", + "set-server-weight" : "set server redis-ro/redis-ro0 weight 10", + "frontends" : "show stat", + "info" : "show info", + "sessions" : "show sess", + "servers" : "show stat", + + } + + self.Resp = dict([(k, v + "\r\n") for k, v in self.Resp.items()]) + + def test_setServerAgent(self): + """Test 'set server agent' command""" + args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "up"} + cmdSetServerAgent = cmds.setServerAgent(**args).getCmd() + self.assertEqual(cmdSetServerAgent, self.Resp["set-server-agent"]) + + def test_setServerHealth(self): + """Test 'set server health' command""" + args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "stopping"} + cmdSetServerHealth = cmds.setServerHealth(**args).getCmd() + self.assertEqual(cmdSetServerHealth, self.Resp["set-server-health"]) + + def test_setServerState(self): + """Test 'set server state' command""" + args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "drain"} + cmdSetServerState = cmds.setServerState(**args).getCmd() + self.assertEqual(cmdSetServerState, self.Resp["set-server-state"]) + + def test_setServerWeight(self): + """Test 'set server weight' command""" + args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "10"} + cmdSetServerState = cmds.setServerWeight(**args).getCmd() + self.assertEqual(cmdSetServerState, self.Resp["set-server-weight"]) + + def test_showFrontends(self): + """Test 'frontends/backends' commands""" + args = {} + cmdFrontends = cmds.showFrontends(**args).getCmd() + self.assertEqual(cmdFrontends, self.Resp["frontends"]) + + def test_showInfo(self): + """Test 'show info' command""" + cmdShowInfo = cmds.showInfo().getCmd() + self.assertEqual(cmdShowInfo, self.Resp["info"]) + + def test_showSessions(self): + """Test 'show info' command""" + cmdShowInfo = cmds.showSessions().getCmd() + self.assertEqual(cmdShowInfo, self.Resp["sessions"]) + + def test_showServers(self): + """Test 'show info' command""" + args = {"backend": "redis-ro"} + cmdShowInfo = cmds.showServers(**args).getCmd() + self.assertEqual(cmdShowInfo, self.Resp["servers"]) + +if __name__ == '__main__': + unittest.main() diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py new file mode 100644 index 0000000000..fc6aac966b --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py @@ -0,0 +1,59 @@ +# pylint: disable=locally-disabled, too-few-public-methods, no-self-use, invalid-name, broad-except +"""test_conn.py - Unittests related to connections to HAProxy.""" +import sys, os +sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) +from haproxy import conn +import unittest +from socket import AF_INET, AF_UNIX + +class SimpleConnMock(object): + """Simple socket mock.""" + def __init__(self, stype, stream): + self.stype = stype + self.stream = stream + + def connect(self, addr): + """Mocked socket.connect method.""" + pass + +class TestConnection(unittest.TestCase): + """Tests different aspects of haproxyctl's connections to HAProxy.""" + + def testConnSimple(self): + """Tests that connection to non-protocol path works and fallsback to UNIX socket.""" + sfile = "/some/path/to/socket.sock" + c = conn.HaPConn(sfile, socket_module=SimpleConnMock) + addr, stype = c.sfile + self.assertEqual(sfile, addr) + self.assertEqual(stype, AF_UNIX) + + def testConnUnixString(self): + """Tests that unix:// protocol works and connects to a socket.""" + sfile = "unix:///some/path/to/socket.socket" + c = conn.HaPConn(sfile, socket_module=SimpleConnMock) + addr, stype = c.sfile + self.assertEqual("/some/path/to/socket.socket", addr) + self.assertEqual(stype, AF_UNIX) + + def testConnTCPString(self): + """Tests that tcp:// protocol works and connects to an IP.""" + sfile = "tcp://1.2.3.4:8080" + c = conn.HaPConn(sfile, socket_module=SimpleConnMock) + addr, stype = c.sfile + ip, port = addr + self.assertEqual("1.2.3.4", ip) + self.assertEqual(8080, port) + self.assertEqual(stype, AF_INET) + + def testConnTCPStringNoPort(self): + """Tests that passing a tcp:// address with no port, raises an Exception.""" + sfile = "tcp://1.2.3.4" + # Not using assertRaises because we still support 2.6 + try: + conn.HaPConn(sfile, socket_module=SimpleConnMock) + raise Exception('Connection should have thrown an exception') + except conn.HapError: + pass + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py new file mode 100755 index 0000000000..fc42c7c144 --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python3 +import os +import sys +import argparse +import traceback + +sys.path.append(os.path.join(os.path.dirname(__file__), 'lib')) +from haproxy.conn import HaPConn +from haproxy import cmds + +SOCKET = '/var/run/haproxy.socket' +VALID_COMMANDS = { + "set-server-agent": cmds.setServerAgent, + "set-server-health": cmds.setServerHealth, + "set-server-state": cmds.setServerState, + "set-server-weight": cmds.setServerWeight, + "show-frontends": cmds.showFrontends, + "show-backends": cmds.showBackends, + "show-info": cmds.showInfo, + "show-sessions": cmds.showSessions, + "show-servers": cmds.showServers, +} + +def get_args(): + parser = argparse.ArgumentParser(description='Send haproxy commands via socket.') + parser.add_argument( + 'command', + choices=list(VALID_COMMANDS), + help='The command to execute via haproxy socket' + ) + parser.add_argument( + '--backend', + help='Attempt action on given backend.', + default=None + ) + parser.add_argument( + '--server', + help='Attempt action on given server.', + default=None + ) + parser.add_argument( + '--server-ids', + help='Attempt action on a list of server, specified as a comma seperated list e.g. back1/server1,back2/server3', + default=None + ) + parser.add_argument( + '--value', + help='Specify value for a set command.', + default=None + ) + parser.add_argument( + '--output', + help='Specify output format.', + choices=['json', 'bootstrap'], + default=None + ) + parser.add_argument( + '--page-rows', + help='Limit output to the specified numbers of rows per page.', + default=None + ) + parser.add_argument( + '--page', + help='Output page number.', + default=None + ) + parser.add_argument( + '--search', + help='Search for string.', + default=None + ) + parser.add_argument( + '--sort-col', + help='Sort output on this column.', + default=None + ) + parser.add_argument( + '--sort-dir', + help='Sort output in this direction.', + default=None + ) + parser.add_argument( + '--debug', + type=bool, + help='Show debug output.', + default=False + ) + + return parser.parse_args() + +args = get_args() +command_class = VALID_COMMANDS.get(args.command, None) +command_args = {key: val for key, val in vars(args).items() if key != "command"} + +try: + if args.server_ids: + # bulk + command_bulk_args = command_args + command_bulk_args.pop('server_ids', None) + for server_id in args.server_ids.split(","): + command_bulk_args.update({ + 'backend': server_id.split("/")[0], + 'server': server_id.split("/")[1] + }) + con = HaPConn(SOCKET) + if con: + result = con.sendCmd(command_class(**command_bulk_args), objectify=False) + if result: + print(f"{server_id}: {result.strip()}") + con.close() + + else: + # single + con = HaPConn(SOCKET) + if con: + result = con.sendCmd(command_class(**command_args), objectify=False) + if result: + print(result.strip()) + else: + print(f"Could not open socket {SOCKET}") + +except Exception as exc: + print(f"While talking to {SOCKET}: {exc}") + if args['debug']: + tb = traceback.format_exc() + print(tb) diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index 02896ebe0b..ce1ef790b6 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -45,3 +45,33 @@ command:/usr/local/opnsense/scripts/OPNsense/HAProxy/queryStats.php parameters:%s type:script_output message:requesting haproxy statistics + +[server_status_list] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +parameters: show-servers --output bootstrap --page-rows %s --page %s --search %s --sort-col %s --sort-dir %s +type:script_output +message:show server status list + +[server_state] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +parameters: set-server-state --backend %s --server %s --value %s +type:script_output +message:change haproxy server state + +[server_weight] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +parameters: set-server-weight --backend %s --server %s --value %s +type:script_output +message:change haproxy server weight + +[server_state_bulk] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +parameters: set-server-state --server-ids %s --value %s +type:script_output +message:change haproxy state for multiple server + +[server_weight_bulk] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +parameters: set-server-weight --server-ids %s --value %s +type:script_output +message:change haproxy weight for multiple server \ No newline at end of file From dd38b7d7a267e81bf59cb61a15e4f511e82ff799 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Feb 2021 08:53:28 +0100 Subject: [PATCH 0388/3088] net/haproxy: lint pass et al, bump revision to denote changes --- LICENSE | 1 + net/haproxy/Makefile | 1 + .../opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py | 0 .../src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py | 0 .../src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py | 0 .../src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py | 0 .../scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py | 0 .../scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py | 0 .../scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py | 2 +- .../src/opnsense/service/conf/actions.d/actions_haproxy.conf | 2 +- 10 files changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py mode change 100644 => 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py mode change 100644 => 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py mode change 100644 => 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py mode change 100644 => 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py mode change 100644 => 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py mode change 100644 => 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py diff --git a/LICENSE b/LICENSE index 6e7b1da527..e045225ed3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ Copyright (c) 2015-2020 Ad Schellevis +Copyright (c) 2021 Andreas Stuerz Copyright (c) 2019 Cloudfence - Julio Camargo (JCC) Copyright (c) 2005-2006 Colin Smith Copyright (c) 2020 D. Domig diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 98aea3903e..3fcb8e78a4 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 2.26 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy20 PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py old mode 100644 new mode 100755 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py old mode 100644 new mode 100755 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py old mode 100644 new mode 100755 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py old mode 100644 new mode 100755 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py old mode 100644 new mode 100755 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py old mode 100644 new mode 100755 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py old mode 100644 new mode 100755 index fc6aac966b..ea8c15f607 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py @@ -56,4 +56,4 @@ def testConnTCPStringNoPort(self): pass if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index ce1ef790b6..d286d73bff 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -74,4 +74,4 @@ message:change haproxy state for multiple server command:/usr/local/opnsense/scripts/OPNsense/HAProxy/socketCommand.py parameters: set-server-weight --server-ids %s --value %s type:script_output -message:change haproxy weight for multiple server \ No newline at end of file +message:change haproxy weight for multiple server From d17f76185ad52e4271b3c71da7424c3c1794758d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Feb 2021 09:01:23 +0100 Subject: [PATCH 0389/3088] dns/dyndns: bump revision after change --- dns/dyndns/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 2553b19f55..71ce6cee70 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.23 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From b3e2e8633a26ee57be11cc00414d1ec8bc6d81fe Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Feb 2021 22:35:26 +0100 Subject: [PATCH 0390/3088] vendor/sunnyvalley: add proper PLUGIN_WWW --- vendor/sunnyvalley/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/vendor/sunnyvalley/Makefile b/vendor/sunnyvalley/Makefile index e2687ad998..58fc4cc315 100644 --- a/vendor/sunnyvalley/Makefile +++ b/vendor/sunnyvalley/Makefile @@ -2,6 +2,7 @@ PLUGIN_NAME= sunnyvalley PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= Vendor repository for Sensei (Next Generation Firewall Extensions) PLUGIN_MAINTAINER= opensource@sunnyvalley.io +PLUGIN_WWW= https://www.sunnyvalley.io PLUGIN_DEPENDS= ${PLUGIN_FLAVOUR:tl} .include "../../Mk/plugins.mk" From e06826bf9e71e2a8f8825cc3dd0bc1e00ba8c2e4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Feb 2021 22:58:17 +0100 Subject: [PATCH 0391/3088] Framework: support version meta data JSON file --- Mk/defaults.mk | 15 +++++++++++++-- Mk/plugins.mk | 21 +++++++++++++++------ Scripts/version.sh | 34 ++++++++++++++++++++++++++++++++++ Templates/version | 11 +++++++++++ 4 files changed, 73 insertions(+), 8 deletions(-) create mode 100755 Scripts/version.sh create mode 100644 Templates/version diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 089cdc705f..1ec722ffe0 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -26,9 +26,14 @@ LOCALBASE?= /usr/local PAGER?= less -PKG!= which pkg || echo true +PKG= ${LOCALBASE}/sbin/pkg +.if ! exists(${PKG}) +PKG= true +.endif GIT!= which git || echo true +GITVERSION= ${SCRIPTSDIR}/version.sh + _PLUGIN_ARCH!= uname -p PLUGIN_ARCH?= ${_PLUGIN_ARCH} @@ -64,7 +69,13 @@ PLUGIN_PYTHON?= 37 REPLACEMENTS= PLUGIN_ABI \ PLUGIN_ARCH \ - PLUGIN_FLAVOUR + PLUGIN_FLAVOUR \ + PLUGIN_HASH \ + PLUGIN_MAINTAINER \ + PLUGIN_NAME \ + PLUGIN_PKGNAME \ + PLUGIN_PKGVERSION \ + PLUGIN_WWW SED_REPLACE= # empty diff --git a/Mk/plugins.mk b/Mk/plugins.mk index b1eff47759..119380b033 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -27,13 +27,22 @@ all: check .include "defaults.mk" +PLUGINSDIR= ${.CURDIR}/../.. +TEMPLATESDIR= ${PLUGINSDIR}/Templates +SCRIPTSDIR= ${PLUGINSDIR}/Scripts + +.if exists(${GIT}) && exists(${GITVERSION}) +PLUGIN_COMMIT!= ${GITVERSION} +.else +PLUGIN_COMMIT= unknown 0 undefined +.endif + +PLUGIN_HASH?= ${PLUGIN_COMMIT:[3]} + PLUGIN_DESC= pkg-descr PLUGIN_SCRIPTS= +PRE_INSTALL +POST_INSTALL \ +PRE_DEINSTALL +POST_DEINSTALL -PLUGINSDIR= ${.CURDIR}/../.. -TEMPLATESDIR= ${PLUGINSDIR}/Templates - PLUGIN_WWW?= https://opnsense.org/ PLUGIN_REVISION?= 0 @@ -183,7 +192,7 @@ install: check mv "${DESTDIR}${LOCALBASE}/$${FILE}" "${DESTDIR}${LOCALBASE}/$${FILE%%.in}"; \ fi; \ done - @echo "${PLUGIN_PKGVERSION}" > "${DESTDIR}${LOCALBASE}/opnsense/version/${PLUGIN_NAME}" + cat ${TEMPLATESDIR}/version | sed ${SED_REPLACE} > "${DESTDIR}${LOCALBASE}/opnsense/version/${PLUGIN_NAME}" plist: check @(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \ @@ -312,9 +321,9 @@ sweep: check fi find ${.CURDIR}/src ! -name "*.min.*" ! -name "*.svg" \ ! -name "*.ser" -type f -print0 | \ - xargs -0 -n1 ${.CURDIR}/../../Scripts/cleanfile + xargs -0 -n1 ${SCRIPTSDIR}/cleanfile find ${.CURDIR} -type f -depth 1 -print0 | \ - xargs -0 -n1 ${.CURDIR}/../../Scripts/cleanfile + xargs -0 -n1 ${SCRIPTSDIRs/cleanfile STYLEDIRS?= src/etc/inc src/opnsense diff --git a/Scripts/version.sh b/Scripts/version.sh new file mode 100755 index 0000000000..402d840839 --- /dev/null +++ b/Scripts/version.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# Copyright (c) 2015 Franco Fichtner +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +set -e + +VERSION=$(git describe --abbrev=0 --always ${1}) +REVISION=$(git rev-list ${VERSION}.. --count) +HASH=$(git rev-list HEAD --max-count=1 | cut -c1-9) + +echo ${VERSION} ${REVISION} ${HASH} diff --git a/Templates/version b/Templates/version new file mode 100644 index 0000000000..95baa8fe04 --- /dev/null +++ b/Templates/version @@ -0,0 +1,11 @@ +{ + "product_abi": "%%PLUGIN_ABI%%", + "product_arch": "%%PLUGIN_ARCH%%", + "product_email": "%%PLUGIN_MAINTAINER%%", + "product_flavour": "%%PLUGIN_FLAVOUR%%", + "product_hash": "%%PLUGIN_HASH%%", + "product_id": "%%PLUGIN_PKGNAME%%", + "product_name": "%%PLUGIN_NAME%%", + "product_version": "%%PLUGIN_PKGVERSION%%", + "product_website": "%%PLUGIN_WWW%%" +} From 629eb160cef153831509d3d80b0d42ec64735420 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Feb 2021 23:04:03 +0100 Subject: [PATCH 0392/3088] Framework: small tweaks on previous --- Mk/plugins.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 119380b033..51de1e95e8 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -192,7 +192,7 @@ install: check mv "${DESTDIR}${LOCALBASE}/$${FILE}" "${DESTDIR}${LOCALBASE}/$${FILE%%.in}"; \ fi; \ done - cat ${TEMPLATESDIR}/version | sed ${SED_REPLACE} > "${DESTDIR}${LOCALBASE}/opnsense/version/${PLUGIN_NAME}" + @cat ${TEMPLATESDIR}/version | sed ${SED_REPLACE} > "${DESTDIR}${LOCALBASE}/opnsense/version/${PLUGIN_NAME}" plist: check @(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \ @@ -246,6 +246,8 @@ package: check @echo -n ">>> Staging files for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}..." @${MAKE} DESTDIR=${WRKSRC} install @echo " done" + @echo ">>> Generated version info for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}:" + @cat ${WRKSRC}/usr/local/opnsense/version/${PLUGIN_NAME} @echo ">>> Packaging files for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}:" @${PKG} create -v -m ${WRKSRC} -r ${WRKSRC} \ -p ${WRKSRC}/plist -o ${PKGDIR} From 94493cb32ce5a55340952c08e95cbd37dddea6df Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Feb 2021 09:30:40 +0100 Subject: [PATCH 0393/3088] Framework: exclude txz archives --- Mk/plugins.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 51de1e95e8..48bca3e95b 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -308,7 +308,7 @@ lint-php: check ! -name "*.xml" ! -name "*.xml.sample" ! -name "*.eot" \ ! -name "*.svg" ! -name "*.woff" ! -name "*.woff2" \ ! -name "*.otf" ! -name "*.png" ! -name "*.js" ! -name "*.md" \ - ! -name "*.scss" ! -name "*.py" ! -name "*.ttf" \ + ! -name "*.scss" ! -name "*.py" ! -name "*.ttf" ! -name "*.txz" \ ! -name "*.tgz" ! -name "*.xml.dist" ! -name "*.sh" \ -type f -print0 | xargs -0 -n1 php -l From 8793d16effea39a8f05affb7f5b2a0437bd7668e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Feb 2021 10:01:14 +0100 Subject: [PATCH 0394/3088] Framework: allow manual PLUGINSDIR and use it everywhere --- Mk/plugins.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 48bca3e95b..ac202ae301 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2020 Franco Fichtner +# Copyright (c) 2015-2021 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,9 +27,9 @@ all: check .include "defaults.mk" -PLUGINSDIR= ${.CURDIR}/../.. -TEMPLATESDIR= ${PLUGINSDIR}/Templates +PLUGINSDIR?= ${.CURDIR}/../.. SCRIPTSDIR= ${PLUGINSDIR}/Scripts +TEMPLATESDIR= ${PLUGINSDIR}/Templates .if exists(${GIT}) && exists(${GITVERSION}) PLUGIN_COMMIT!= ${GITVERSION} @@ -333,7 +333,7 @@ style: check @: > ${.CURDIR}/.style.out .for STYLEDIR in ${STYLEDIRS} @if [ -d ${.CURDIR}/${STYLEDIR} ]; then \ - (phpcs --standard=${.CURDIR}/../../ruleset.xml \ + (phpcs --standard=${PLUGINSDIR}/ruleset.xml \ ${.CURDIR}/${STYLEDIR} || true) > \ ${.CURDIR}/.style.out; \ fi @@ -348,7 +348,7 @@ style: check style-fix: check .for STYLEDIR in ${STYLEDIRS} @if [ -d ${.CURDIR}/${STYLEDIR} ]; then \ - phpcbf --standard=${.CURDIR}/../../ruleset.xml \ + phpcbf --standard=${PLUGINSDIR}/ruleset.xml \ ${.CURDIR}/${STYLEDIR} || true; \ fi .endfor From 3e72b0f5b7d9d10a62e1d29e5887abce1e9d8ef2 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 8 Feb 2021 22:52:00 +0100 Subject: [PATCH 0395/3088] security/acme-client: fix missing "--ecc" parameter, closes #2223 --- security/acme-client/pkg-descr | 5 +++++ .../app/library/OPNsense/AcmeClient/LeValidation/Base.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index ef9766b167..72ac1d1b4e 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +2.4 + +Fixed: +* fix missing "--ecc" parameter when renewing ECC certs (#2223) + 2.3 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php index 5f2eb9169e..a541584ac1 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php @@ -137,7 +137,7 @@ public function run(bool $renew = false) if ($this->cert_keylength == 'ec256' || $this->cert_keylength == 'ec384') { if ($renew == true) { // If it's a renew then pass --ecc to acme client to locate the correct cert directory - $acme_args[] = '--ecc'; + $this->acme_args[] = '--ecc'; } } From 4593ef3f9f6c248aa804181f4b09d5d62c8ffe61 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 8 Feb 2021 22:54:26 +0100 Subject: [PATCH 0396/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 86b2e519e1..86b992e8dc 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 2.3 +PLUGIN_VERSION= 2.4 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From ca98e9fdb2daa829100e55b6423b716899bcdb90 Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Tue, 9 Feb 2021 16:00:39 +0100 Subject: [PATCH 0397/3088] add yaml service template with configured haproxy ssl certificates in config.xml --- net/haproxy/Makefile | 2 +- .../templates/OPNsense/HAProxy/+TARGETS | 1 + .../templates/OPNsense/HAProxy/sslCerts.yaml | 61 +++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 98aea3903e..90228279f6 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 2.26 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer -PLUGIN_DEPENDS= haproxy20 +PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS index 6e4c913d20..a8fa7728cf 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS @@ -1,2 +1,3 @@ haproxy.conf:/usr/local/etc/haproxy.conf rc.conf.d:/etc/rc.conf.d/haproxy +sslCerts.yaml:/usr/local/etc/haproxy/sslCerts.yaml \ No newline at end of file diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml new file mode 100644 index 0000000000..0b98ab5e15 --- /dev/null +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml @@ -0,0 +1,61 @@ +# +# Automatically generated configuration. +# Do not edit this file manually. +# +# List all frontends with configured ssl certificates in config.xml +{# ################## #} +{# ##### Macros ##### #} +{# ################## #} +{% macro getCA(refId) -%} +{% set result = '{}' %} +{% for data in helpers.getNodeByTag('ca') if data.refid == refId %} +{{ data.crt -}} +{% else %} +{{ "{}" }} +{% endfor %} +{%- endmacro %} +{% macro getCert(refId, indent=4) -%} +{% for data in helpers.getNodeByTag('cert') if data.refid == refId %} +{% if data.caref %} +{% do data.update({'ca': getCA(data.caref)}) %} +{% else %} +{% do data.update({'ca': {} }) %} +{% endif %} +crt: {{ data.crt }} +key: {{ data.prv }} +ca: {{ data.ca }} +{% endfor %} +{%- endmacro %} +{# ################## #} +{# ##### Main ##### #} +{# ################## #} +{% set enabled_frontends = [] %} +{% set crt_list_template = "/tmp/haproxy/ssl/%s.certlist" %} +{% set cert_template = "/tmp/haproxy/ssl/%s.pem" %} +{% for frontend in helpers.toList('OPNsense.HAProxy.frontends.frontend') %} +{% set certs = [] %} +{% for cert in frontend.get('ssl_default_certificate', '').split(',') + frontend.get('ssl_certificates', '').split(',') if cert %} +{% do certs.append(cert) %} +{% endfor %} +{% do frontend.update({'certs': certs}) %} +{% if frontend.enabled == '1' and frontend.ssl_enabled == '1' and frontend.certs|length > 0 %} +{% do enabled_frontends.append(frontend) %} +{% endif %} +{% endfor %} +{% if helpers.exists('OPNsense.HAProxy.frontends') and enabled_frontends|length > 0 %} +frontends: +{% for frontend in enabled_frontends %} + "{{ frontend.id }}": + name: {{ frontend.name }} + crt_list_path: {{ cert_template % frontend.id }} + certs: +{% for cert_refid in frontend.certs %} + {{ cert_refid }}: + path: {{ cert_template % cert_refid }} + default: {{ "True" if frontend.ssl_default_certificate == cert_refid else "False" }} +{{ getCert(cert_refid) | indent( width=8, indentfirst=True) -}} +{% endfor %} +{% endfor %} +{% else %} +frontends: {} +{% endif %} \ No newline at end of file From 2cf5a36f7d3ef258b06aa9c9e9e14f1c46ee1a63 Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Tue, 9 Feb 2021 17:03:36 +0100 Subject: [PATCH 0398/3088] add unit tests for haproxy ssl commands --- .../HAProxy/lib/haproxy/tests/test_cmds.py | 133 +++++++++++++++--- 1 file changed, 114 insertions(+), 19 deletions(-) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py index 032954583d..5786b67807 100644 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py @@ -18,7 +18,17 @@ def setUp(self): "info" : "show info", "sessions" : "show sess", "servers" : "show stat", - + "show-all-ssl-crt-list" : "show ssl crt-list", + "show-details-ssl-crt-list" : "show ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + "show-all-ssl-certs" : "show ssl cert", + "show-details-ssl-certs" : "show ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + "add-to-crt-list" : "add ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", + "del-from-crt-list" : "del ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", + "add-ssl-cert" : "new ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + "update-ssl-cert" : "set ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem ", + "del-ssl-cert" : "del ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + "commit-ssl-cert" : "commit ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + "abort-ssl-cert" : "abort ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", } self.Resp = dict([(k, v + "\r\n") for k, v in self.Resp.items()]) @@ -26,48 +36,133 @@ def setUp(self): def test_setServerAgent(self): """Test 'set server agent' command""" args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "up"} - cmdSetServerAgent = cmds.setServerAgent(**args).getCmd() - self.assertEqual(cmdSetServerAgent, self.Resp["set-server-agent"]) + cmdOutput = cmds.setServerAgent(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["set-server-agent"]) def test_setServerHealth(self): """Test 'set server health' command""" args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "stopping"} - cmdSetServerHealth = cmds.setServerHealth(**args).getCmd() - self.assertEqual(cmdSetServerHealth, self.Resp["set-server-health"]) + cmdOutput = cmds.setServerHealth(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["set-server-health"]) def test_setServerState(self): """Test 'set server state' command""" args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "drain"} - cmdSetServerState = cmds.setServerState(**args).getCmd() - self.assertEqual(cmdSetServerState, self.Resp["set-server-state"]) + cmdOutput = cmds.setServerState(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["set-server-state"]) def test_setServerWeight(self): """Test 'set server weight' command""" args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "10"} - cmdSetServerState = cmds.setServerWeight(**args).getCmd() - self.assertEqual(cmdSetServerState, self.Resp["set-server-weight"]) + cmdOutput = cmds.setServerWeight(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["set-server-weight"]) def test_showFrontends(self): """Test 'frontends/backends' commands""" args = {} - cmdFrontends = cmds.showFrontends(**args).getCmd() - self.assertEqual(cmdFrontends, self.Resp["frontends"]) + cmdOutput = cmds.showFrontends(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["frontends"]) def test_showInfo(self): """Test 'show info' command""" - cmdShowInfo = cmds.showInfo().getCmd() - self.assertEqual(cmdShowInfo, self.Resp["info"]) + cmdOutput = cmds.showInfo().getCmd() + self.assertEqual(cmdOutput, self.Resp["info"]) def test_showSessions(self): - """Test 'show info' command""" - cmdShowInfo = cmds.showSessions().getCmd() - self.assertEqual(cmdShowInfo, self.Resp["sessions"]) + """Test 'show sess' command""" + cmdOutput = cmds.showSessions().getCmd() + self.assertEqual(cmdOutput, self.Resp["sessions"]) def test_showServers(self): - """Test 'show info' command""" + """Test 'show stat' command""" args = {"backend": "redis-ro"} - cmdShowInfo = cmds.showServers(**args).getCmd() - self.assertEqual(cmdShowInfo, self.Resp["servers"]) + cmdOutput = cmds.showServers(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["servers"]) + + def test_showAllSslCrtList(self): + """Test 'show ssl crt-list' command""" + cmdOutput = cmds.showAllSslCrtList().getCmd() + self.assertEqual(cmdOutput, self.Resp["show-all-ssl-crt-list"]) + + def test_showDetailsSslCrtList(self): + """Test 'show ssl crt-list ' command""" + args = { + "filename": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + } + cmdOutput = cmds.test_showDetailsSslCrtList(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["show-details-ssl-crt-list"]) + + def test_showAllSslCerts(self): + """Test 'show ssl cert' command""" + cmdOutput = cmds.showAllSslCerts().getCmd() + self.assertEqual(cmdOutput, self.Resp["show-all-ssl-certs"]) + + def test_showDetailsSslCerts(self): + """Test 'show ssl cert ' command""" + args = { + "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem" + } + cmdOutput = cmds.showDetailsSslCerts(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["show-details-ssl-certs"]) + + def test_addToSslCrtList(self): + """Test 'add ssl crt-list ' command""" + args = { + "filename": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem" + } + cmdOutput = cmds.addToSslCrtList(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["add-to-crt-list"]) + + def test_delFromSslCrtList(self): + """Test 'del ssl crt-list ' command""" + args = { + "filename": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem" + } + cmdOutput = cmds.delFromSslCrtList(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["del-from-crt-list"]) + + def test_addSslCrt(self): + """Test 'new ssl cert ' command""" + args = { + "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + } + cmdOutput = cmds.addSslCrt(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["add-ssl-cert"]) + + def test_updateSslCrt(self): + """Test 'new ssl cert ' command""" + args = { + "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + "payload" : "TODO" + } + cmdOutput = cmds.updateSslCrt(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["update-ssl-cert"]) + + def test_delSslCrt(self): + """Test 'del ssl cert ' command""" + args = { + "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + } + cmdOutput = cmds.delSslCrt(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["del-ssl-cert"]) + + def test_commitSslCrt(self): + """Test 'commit ssl cert ' command""" + args = { + "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + } + cmdOutput = cmds.commitSslCrt(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["commit-ssl-cert"]) + + def test_abortSslCrt(self): + """Test 'abort ssl cert ' command""" + args = { + "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + } + cmdOutput = cmds.abortSslCrt(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["abort-ssl-cert"]) if __name__ == '__main__': unittest.main() From 7fafce17c13a20a0fb4915e6fd6eb24018a96449 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 11 Feb 2021 09:12:33 +0100 Subject: [PATCH 0399/3088] security/tor: close enough, eh?! --- security/tor/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/tor/Makefile b/security/tor/Makefile index c1ae5fbb86..32b6d40eb2 100644 --- a/security/tor/Makefile +++ b/security/tor/Makefile @@ -3,6 +3,6 @@ PLUGIN_VERSION= 1.8 PLUGIN_REVISION= 1 PLUGIN_COMMENT= The Onion Router PLUGIN_DEPENDS= tor ruby -PLUGIN_MAINTAINER= ranz.fabian.94@gmail.com +PLUGIN_MAINTAINER= franz.fabian.94@gmail.com .include "../../Mk/plugins.mk" From 5897bee7bea103cedb15043ad354accce9c119cf Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 11 Feb 2021 10:40:50 +0100 Subject: [PATCH 0400/3088] security/acme-client: use mod_deflate PR: https://forum.opnsense.org/index.php?topic=21432.0 --- .../templates/OPNsense/AcmeClient/lighttpd-acme-challenge.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/service/templates/OPNsense/AcmeClient/lighttpd-acme-challenge.conf b/security/acme-client/src/opnsense/service/templates/OPNsense/AcmeClient/lighttpd-acme-challenge.conf index d88517cada..c5746dddfe 100644 --- a/security/acme-client/src/opnsense/service/templates/OPNsense/AcmeClient/lighttpd-acme-challenge.conf +++ b/security/acme-client/src/opnsense/service/templates/OPNsense/AcmeClient/lighttpd-acme-challenge.conf @@ -10,7 +10,7 @@ server.network-backend = "writev" #server.use-ipv6 = "enable" # modules to load -server.modules = ( "mod_access", "mod_expire", "mod_compress", "mod_redirect", +server.modules = ( "mod_access", "mod_expire", "mod_deflate", "mod_redirect", "mod_alias", "mod_rewrite" ) From 4da0f2c25f40f4d9060649758ce3d88aa2d45c7b Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Thu, 11 Feb 2021 16:02:07 +0100 Subject: [PATCH 0401/3088] refactor output mode for socket cmds add ssl handling socket commands --- .../OPNsense/HAProxy/lib/haproxy/cmds.py | 236 ++++++++++++------ .../OPNsense/HAProxy/lib/haproxy/conn.py | 2 +- .../HAProxy/lib/haproxy/tests/test_cmds.py | 234 +++++++++++++---- .../scripts/OPNsense/HAProxy/socketCommand.py | 34 +++ 4 files changed, 380 insertions(+), 126 deletions(-) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py index 0316bd99ef..3d13d42a82 100644 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py @@ -1,12 +1,9 @@ -# pylint: disable=locally-disabled, too-few-public-methods, no-self-use, invalid-name """cmds.py - Implementations of the different HAProxy commands""" - import re import csv import json from io import StringIO - class Cmd(): """Cmd - Command base class""" req_args = [] @@ -42,44 +39,201 @@ def getCmd(self): """ return self.cmdTxt % self.args + def getBootstrapOutput(self, resObj): + """ Returns results gathered from HAProxy as jquery bootstrap output """ + args = { + "rows": resObj, + "page": int(self.args['page']) if self.args['page'] != None else 1, + "page_rows": int(self.args['page_rows']) if self.args['page_rows'] != None else len(rows), + "search": self.args['search'], + "sort_col": self.args['sort_col'] if self.args['sort_col'] else 'id', + "sort_dir": self.args['sort_dir'], + } + rows = args['rows'] + # search + if args['search']: + filtered_rows = [] + for row in rows: + def inner(row): + for k, v in row.items(): + if args['search'] in v: + return row + return None + + match = inner(row) + if match: + filtered_rows.append(match) + rows = filtered_rows + + # sort + rows.sort(key=lambda k: k[args['sort_col']], reverse=True if args['sort_dir'] == 'desc' else False) + + # pager + total = len(rows) + pages = [rows[i:i + args['page_rows']] for i in range(0, total, args['page_rows'])] + if pages and (args['page'] > len(pages) or args['page'] < 1): + raise KeyError(f"Current page {args['page']} does not exist. Available pages: {len(pages)}") + page = pages[args['page'] - 1] if pages else [] + + return json.dumps({ + "rows": page, + "total": total, + "rowCount": args['page_rows'], + "current": args['page'] + }) + + def getJsonOutput(self, resObj): + """Returns results gathered from HAProxy as json""" + return json.dumps(resObj) + def getResult(self, res): """Returns raw results gathered from HAProxy""" if res == '\n': res = None + + if self.args['output'] == 'json': + return self.getJsonOutput(self.getResultObj(res)) + + if self.args['output'] == 'bootstrap': + return self.getBootstrapOutput(self.getResultObj(res)) + return res def getResultObj(self, res): """Returns refined output from HAProxy, packed inside a Python obj i.e. a dict()""" return res - class setServerAgent(Cmd): - """Set server agent command.""" cmdTxt = "set server %(backend)s/%(server)s agent %(value)s\r\n" req_args = ['backend', 'server', 'value'] helpTxt = "Force a server's agent to a new state." - class setServerHealth(Cmd): - """Set server health command.""" cmdTxt = "set server %(backend)s/%(server)s health %(value)s\r\n" req_args = ['backend', 'server', 'value'] helpTxt = "Force a server's health to a new state." - class setServerState(Cmd): - """Set server state command.""" cmdTxt = "set server %(backend)s/%(server)s state %(value)s\r\n" req_args = ['backend', 'server', 'value'] helpTxt = "Force a server's administrative state to a new state." - class setServerWeight(Cmd): - """Set server weight command.""" cmdTxt = "set server %(backend)s/%(server)s weight %(value)s\r\n" req_args = ['backend', 'server', 'value'] helpTxt = "Force a server's weight to a new state." +class showSslCrtLists(Cmd): + cmdTxt = "show ssl crt-list\r\n" + helpTxt = "Show the list of crt-lists." + + def getResultObj(self, res): + result = { "crt_lists": []} + for line in res.split("\n"): + if line.startswith('/'): + result["crt_lists"].append(line) + return result + +class showSslCrtList(Cmd): + cmdTxt = "show ssl crt-list %(crt_list)s\r\n" + req_args = ['crt_list'] + helpTxt = "Show the the content of a crt-list." + + def getResultObj(self, res): + result = {} + list_id = None + for line in res.split("\n"): + if line.startswith('# '): + list_id = line.split("# ")[1] + result[f"{list_id}"] = [] + + if list_id and line.startswith('/'): + result[f"{list_id}"].append(line) + + if result: + return result + + return {"error": res.strip()} + +class showSslCerts(Cmd): + cmdTxt = "show ssl cert\r\n" + helpTxt = "Display the SSL certificates used in memory." + + def getResultObj(self, res): + result = { + "transaction": [], + "filename": [] + } + for line in res.split("\n"): + if line.startswith('*'): + result['transaction'].append(line) + elif line.startswith('/'): + result['filename'].append(line) + return result + +class showSslCert(Cmd): + cmdTxt = "show ssl cert %(certfile)s\r\n" + req_args = ['certfile'] + helpTxt = "Display the details of a SSL certificate used in memory." + + def getResultObj(self, res): + result = {} + cert_id = None + for line in res.split("\n"): + if line: + key = line.split(":")[0] + val = line.split(":")[1].strip() + + if key == 'Filename': + cert_id = val + result[f"{cert_id}"] = {} + + if cert_id: + result[f"{cert_id}"][key] = val + + if result: + return result + + return {"error": res.strip()} + +class addToSslCrtList(Cmd): + cmdTxt = "add ssl crt-list %(crt_list)s %(certfile)s\r\n" + req_args = ['crt_list', 'certfile'] + helpTxt = "Add a ssl cert to a crt-list." + +class delFromSslCrtList(Cmd): + cmdTxt = "del ssl crt-list %(crt_list)s %(certfile)s\r\n" + req_args = ['crt_list', 'certfile'] + helpTxt = "Delete a ssl cert from a crt-list." + +class newSslCrt(Cmd): + """" Create an empty slot for the certificate in HAProxy’s memory """ + cmdTxt = "new ssl cert %(certfile)s\r\n" + req_args = ['certfile'] + helpTxt = "Create a new certificate file to be used in a crt-list or a directory." + +class updateSslCrt(Cmd): + """" Begin a transaction to upload the certificate into a slot in HAProxy’s memory """ + cmdTxt = "set ssl cert %(certfile)s <<\n%(payload)s\r\n" + req_args = ['certfile', 'payload'] + helpTxt = "Replace a certificate file." + +class delSslCrt(Cmd): + """" Begin a transaction to remove the certificate from a slot in HAProxy’s memory """ + cmdTxt = "del ssl cert %(certfile)s\r\n" + req_args = ['certfile'] + helpTxt = "Delete delete an unused certificate file." + +class commitSslCrt(Cmd): + """ Commit the transaction so HAProxy detects the change. """ + cmdTxt = "commit ssl cert %(certfile)s\r\n" + req_args = ['certfile'] + helpTxt = "Commit a certificate file." + +class abortSslCrt(Cmd): + cmdTxt = "abort ssl cert %(certfile)s\r\n" + req_args = ['certfile'] + helpTxt = "Abort a transaction for a certificate file." class showFBEnds(Cmd): """Base class for getting a listing Frontends and Backends""" @@ -110,19 +264,16 @@ def _getResult(self, res): result.append(e.split(",")[0]) return result - class showFrontends(showFBEnds): """Show frontends command.""" switch = "frontend" helpTxt = "List all Frontends." - class showBackends(showFBEnds): """Show backends command.""" switch = "backend" helpTxt = "List all Backends." - class showInfo(Cmd): """Show info HAProxy command""" cmdTxt = "show info\r\n" @@ -136,7 +287,6 @@ def getResultObj(self, res): return resDict - class showSessions(Cmd): """Show sess HAProxy command""" cmdTxt = "show sess\r\n" @@ -145,7 +295,6 @@ class showSessions(Cmd): def getResultObj(self, res): return res.split('\n') - class baseStat(Cmd): """Base class for stats commands.""" @@ -158,64 +307,11 @@ def getDict(self, res): csv_string = StringIO(res) return csv.DictReader(csv_string, delimiter=',') - def getBootstrapOutput(self, **kwargs): - rows = kwargs['rows'] - # search - if kwargs['search']: - filtered_rows = [] - for row in rows: - def inner(row): - for k, v in row.items(): - if kwargs['search'] in v: - return row - return None - - match = inner(row) - if match: - filtered_rows.append(match) - rows = filtered_rows - - # sort - rows.sort(key=lambda k: k[kwargs['sort_col']], reverse=True if kwargs['sort_dir'] == 'desc' else False) - - # pager - total = len(rows) - pages = [rows[i:i + kwargs['page_rows']] for i in range(0, total, kwargs['page_rows'])] - if pages and (kwargs['page'] > len(pages) or kwargs['page'] < 1): - raise KeyError(f"Current page {kwargs['page']} does not exist. Available pages: {len(pages)}") - page = pages[kwargs['page'] - 1] if pages else [] - - return json.dumps({ - "rows": page, - "total": total, - "rowCount": kwargs['page_rows'], - "current": kwargs['page'] - }) - - class showServers(baseStat): """Show all servers. If backend is given, show only servers for this backend. """ cmdTxt = "show stat\r\n" helpTxt = "Lists all servers. Filter for servers in backend, if set." - def getResult(self, res): - if self.args['output'] == 'json': - return json.dumps(self.getResultObj(res)) - - if self.args['output'] == 'bootstrap': - rows = self.getResultObj(res) - args = { - "rows": rows, - "page": int(self.args['page']) if self.args['page'] != None else 1, - "page_rows": int(self.args['page_rows']) if self.args['page_rows'] != None else len(rows), - "search": self.args['search'], - "sort_col": self.args['sort_col'] if self.args['sort_col'] else 'id', - "sort_dir": self.args['sort_dir'], - } - return self.getBootstrapOutput(**args) - - return self.getResultObj(res) - def getResultObj(self, res): servers = [] @@ -234,4 +330,4 @@ def getResultObj(self, res): row.move_to_end('id', last=False) servers.append(dict(row)) - return servers + return servers \ No newline at end of file diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py index 962a15cf5e..0c38673c16 100644 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py @@ -70,7 +70,7 @@ def sendCmd(self, cmd, objectify=False): output = self.sock.recv(const.HAP_BUFSIZE) while output: - res += output.decode('ASCII') + res += output.decode('UTF-8') output = self.sock.recv(const.HAP_BUFSIZE) if objectify: diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py index 5786b67807..01887f583f 100644 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py @@ -5,55 +5,178 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) from haproxy import cmds + class TestCommands(unittest.TestCase): """Tests all of the commands.""" + def setUp(self): + self.maxDiff = None + self.pem_cert_content = """ + -----BEGIN CERTIFICATE----- + MIIGNjCCBR6gAwIBAgITAPoWnilNUBNcAb8iJ2dgK1eXeTANBgkqhkiG9w0BAQsF + ADAiMSAwHgYDVQQDDBdGYWtlIExFIEludGVybWVkaWF0ZSBYMTAeFw0yMTAyMDMw + ODQ2MTBaFw0yMTA1MDQwODQ2MTBaMBoxGDAWBgNVBAMTD3Rlc3QuYW5kZW1hbi5k + ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL7DSlOfRdoKZdX825O4 + Q+uEN85NYR/SJtSLDfaaRebanbDzxp90PEIHCqZyf0q7Zz5eF6qd2ycldtJSVk8b + lVOyJjPIOLUrUAeF6I07b/AOBO/8DU9G3lARSOQkPmC80ahGAW3F1eaccf08qncW + CGxKKXmeL9mbAsA4k6+6pIq8YRBqMCE2bkRQ/scAa8pL7ms5hceONWfqjHC12zIp + yavvnfNVZ6z7QlwHEh3Rajk1IaHLyE7+9+oQ3zXqFtM6sBvXlvVhwsizgkH3ZodN + 81ycvHoP1MWqHGHX0klREQ9qRrHuSuqHsjJHX8gtbqI2Z9DVOUUEunbIkImTwqYj + e5tp7g4RQJUgAdsauyN02NTdeUeci+JDvA3FHJpAtA7tDXIeNcyPjRho17i4VUIc + Yasu5JDF0iSPDT/Srxt6EsDntDFDco1HXMsFqUhMbY2+gUWC3P0n98VWSO+BCtAd + Fbc4+N3QEM8RnQKI86WHR/vnVDoigOhALupXa6czjLGMjaSLDI0nyJ5M81r8ZuBZ + Wu2Q6HTikNmoWl3w6x+9WvY6TQd9OpCjQUu13UMVAco8CGEOj0ZqhhLTccX8dxPK + /01bXMtFRivJfe6vML+O0N54JbI5caXmaEdcEuazAVJWt1ZPGFTMjiw/O0S6Hb0V + YJKXqjJs9t95O5MpL9W4YvGxAgMBAAGjggJrMIICZzAOBgNVHQ8BAf8EBAMCBaAw + HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYD + VR0OBBYEFHQLXiD/GxQD11ocGiFauejS5RRmMB8GA1UdIwQYMBaAFMDMA0a5WCDM + XHJw8+EuyyCm9Wg6MHcGCCsGAQUFBwEBBGswaTAyBggrBgEFBQcwAYYmaHR0cDov + L29jc3Auc3RnLWludC14MS5sZXRzZW5jcnlwdC5vcmcwMwYIKwYBBQUHMAKGJ2h0 + dHA6Ly9jZXJ0LnN0Zy1pbnQteDEubGV0c2VuY3J5cHQub3JnLzAaBgNVHREEEzAR + gg90ZXN0LmFuZGVtYW4uZGUwTAYDVR0gBEUwQzAIBgZngQwBAgEwNwYLKwYBBAGC + 3xMBAQEwKDAmBggrBgEFBQcCARYaaHR0cDovL2Nwcy5sZXRzZW5jcnlwdC5vcmcw + ggEDBgorBgEEAdZ5AgQCBIH0BIHxAO8AdQAW6GnB0ZXq18P4lxrj8HYB94zhtp0x + qFIYtoN/MagVCAAAAXdnSPbpAAAEAwBGMEQCICAST5iJD7DVrcKRvu9rvNVVnkOW + hAYUgihWr/1Gu6VdAiAcRcZYBP0hIHmFExM9ehJ+J7YmqM35SyiC7s0chsNdHQB2 + AN2ZNPyl5ySAyVZofYE0mQhJskn3tWnYx7yrP1zB825kAAABd2dI+N0AAAQDAEcw + RQIgaaUndm8O3+nCl5OHTf6rOdi9VF9szVckdgDargdWKkgCIQCAjW4UvuMIv4Bt + c6auowPcpdqHjL8XRcztJA3XUGRGHTANBgkqhkiG9w0BAQsFAAOCAQEABza4/ocY + J/XwN8PP+Ane7fVerqL7mRfhzJhxz4mbCPfv4Drq3kUu9fnhR/vaGgdaNdnO83a9 + PUBCm6FCPMcVwX0uKDJ9J4Xj+SVjnVu4+7uhS5LyygtaegoBZyMb5ppxWH1n5r47 + 10ug+KptERFf1datb8/jsEVF7rYCtPXBygjfGAbGuCxViakr4BNcOBPNL+MusfvP + qpH8kEyPAIwHX02XvvpLTy77qiyTpQSuFOusOJptNNqBUeBehqpf8FHn01fnKkcW + pKmFJ2e2VSnTZIBJvD58HMR+WNAEp7tHffHk2z/mPPtdRdxW5Zieoe5+6+HDtwgG + +VCAIWMkC36Dvg== + -----END CERTIFICATE----- + + -----BEGIN RSA PRIVATE KEY----- + MIIJKgIBAAKCAgEAvsNKU59F2gpl1fzbk7hD64Q3zk1hH9Im1IsN9ppF5tqdsPPG + n3Q8QgcKpnJ/SrtnPl4Xqp3bJyV20lJWTxuVU7ImM8g4tStQB4XojTtv8A4E7/wN + T0beUBFI5CQ+YLzRqEYBbcXV5pxx/TyqdxYIbEopeZ4v2ZsCwDiTr7qkirxhEGow + ITZuRFD+xwBrykvuazmFx441Z+qMcLXbMinJq++d81VnrPtCXAcSHdFqOTUhocvI + Tv736hDfNeoW0zqwG9eW9WHCyLOCQfdmh03zXJy8eg/UxaocYdfSSVERD2pGse5K + 6oeyMkdfyC1uojZn0NU5RQS6dsiQiZPCpiN7m2nuDhFAlSAB2xq7I3TY1N15R5yL + 4kO8DcUcmkC0Du0Nch41zI+NGGjXuLhVQhxhqy7kkMXSJI8NP9KvG3oSwOe0MUNy + jUdcywWpSExtjb6BRYLc/Sf3xVZI74EK0B0Vtzj43dAQzxGdAojzpYdH++dUOiKA + 6EAu6ldrpzOMsYyNpIsMjSfInkzzWvxm4Fla7ZDodOKQ2ahaXfDrH71a9jpNB306 + kKNBS7XdQxUByjwIYQ6PRmqGEtNxxfx3E8r/TVtcy0VGK8l97q8wv47Q3nglsjlx + peZoR1wS5rMBUla3Vk8YVMyOLD87RLodvRVgkpeqMmz233k7kykv1bhi8bECAwEA + AQKCAgEAswbSPXJPetahRdcdNyAKVgBq4ykJinSOTpAF1bZo/cOTlFrjwAe0+X5k + R1tTDQ6dURG7AjtNTgrB3Za6O1m2paqeYaB5X8U7QSQx4EG0xsRRa+vPjeQDhX8D + OmCtTdpGpLa2Zo/xM5EFBVUm4cYCt6ZOED4dyAnK5hzytUvjWfR6343Yh4LurxyY + TqidgGgMZALDA0n54wFjNe/lu8kt5Ddns9MmDlhrqbRVEzjSiMfNPWvjHAf7IGcf + JBkBvNDqL+b/XGCYDgUxrLkDNt44E2VhGOi8lZkVM9n5FyeGbEIgAKKTGlGpMbh8 + MoA4wPFwMrO5IIXUfN+zjfnnBkZsnAomGQYDh/hrsQPwU7MoyfO0Wzw+RzLWK8JH + EnjR7O/Lgh+A2AdLhCLiRC5td2uuJ2yLRIRUlcQPsCsYnCCL6Ip9IwK1idmQySGw + bG83decXNSJUv5h3qF6f3fl+JPrHnAbviBzEJ67xAf1MdHbFxwYvRFVfEHj9RZ3W + z+cw7ofD8XVHTfXn0XipvYqI/bVsitMXI35pOt+/ZV8rjJlXopw+IV6U9/60cBkk + BXC7ONDyH2pNwxPbRgcLm2sEK0L9qhxRzCj0iD1WyOAiFJX4ytVbJhR7pt0goiun + i2XDh2l8hoK1lKZNS/yJ+VhnbX595mdqScmIXD8utlgK8f0bLfECggEBAORXimSK + gzegnsBjieTtzC6MmRRxxN46vnMZ2LCeLMxhs3vM7LBcBfsQYqbt/FVFtYBRpr+d + TGTmfPXqKuSqbtAbghxAMo/lECXzALa0nQSsz1fFhX8B7slFarsDmmCb1GmXF/kG + ku/Uoa7jmY3htBj5rjVHjDKPZFVetU+2wbuwlU17Bj4nlSzqud4NMlu56pm3FZ/1 + BAhMxm3z6dLnOgqJzpN1QmKZHNkjLmi8fza/HQM5pP3DpQcPiyuLzywGIqHaO1qT + OIdpZfLEvNpMV7bJ2bagv5nX3TVRWWsBkh0HCAuH30qqaVPpQvkPem1zsM3x+D5q + +PhMIPGpbQiUyCUCggEBANXefd0ZcJymG15WJyO44eFwzgMz9ezfdB8INa+vCOiZ + Y7FtYDgEKu4uzBxtMjO4mQO6DCkfi7JwTJFN4ag3dJEJNGmrf7Xe84IAImJQk0Of + BojAXCFAuNf1Xl3prkvnvtzNirwQMHCUbv5wYzOqglgj2i/hjIj3/Wbt91riq5j+ + 4qQT4kkw/XgCtbQ27HohKIcC/mXbHchEi7NtXrGoM1xqmu1mGH1uul3LQ6p5VwHc + ZFiIAC0awsx9Qe9khZ5EGpZuS0tqJsREcv8ygYMvWcPJEv8aMQM7Nj4biA5rKEgo + L+66ibpntldvbz2qntEvJ2rKzGci0RDUQHy4sW8/d50CggEBAKCZaX7ZZPzk/YL2 + /2+CSQ+cV7ZnZj2fN4Ag96UROxTsyp4SPY60yogQuDIMRGN9SfDcfNlcOvTkn5Me + hdiafqHkFxjjlixawYbPaPsYAS/ek156UDBKHbZ2GmE6YYP9VeKGIJhHpWUFOkqV + TdTaoB7IzVwv3E1bSQg6Om+8bHoj8n6yPmvMz0DuPpgM1BRrqLNAb/c3DwT/ari+ + ywBJHSt4TVCtMmnCouWdtvB3U0ogFLnF+2N4DUPwDMQt6yJdllIb+Y706NdkrA2Z + jfJDq5WmVnf6i4gaqTzs4GVAj5HW9jOV9ti/DqGz+CTQXB1LN1lCDIVqG34XnTwb + G9LjQfkCggEAZwYAt4tTtgJGWNFDlW+wT/sZIm3bX7ncpD4+Ll0w+2s4nPXFTfaj + /4zHgkIP1t5rx2HODdlGYDS8jZpow7HDE0LN3sFgienWf5808QtDhWWLrkCLoPEe + mdl3FeJFtgby6EaTODjMPM8kEKlvACp5E6BhsIMEQc7EYNrtNvjOFKtj3go+DWfu + EeusQB3dGI/0h+UnS0WcOSbb7RkYbphJ9ZDdBNMTpQi7+ga6l9pP0XOrWwJYo2Gq + yPrl0j4oJ69C54hF+RQvjIg0pT5dKSacJTYtUnn5dkcFwDFe/yMbinbhcCynwAXJ + zqC9g4U3cCk44bbDdENPVr4IOox13NND+QKCAQEAilm2oMZoP3WGkBMTSzJl6OGd + F8NnE95noleknNFYuThhCT6T4Z1s28VpxXV7d0DTNOtXj+TzeZq4jrwkgOSZbif0 + 8ky4gRZmm0iFwvAu8ZXk1olHbhMZnCOfh0Qhd4bU2tSoWgWVIAQWEHUhDI7Q1rsX + s4sCjYHKuNMEKdfYvxtKeiunoFqdmT65hwM9o3TfvJfm/RChb7i/nVruXQ6IhPEM + 9WYZS7hlKyqVBESJuonR15biy7Xov5ELl6A821cskZO3vTwtlBSeCDiqaeVLpKR3 + aYwf5YZo7v+N8KBSLEdLNjoKK4PfXUdczD7uOUllbd4/MRgCn4EmFvmpljGiEQ== + -----END RSA PRIVATE KEY----- + + + -----BEGIN CERTIFICATE----- + MIIEqzCCApOgAwIBAgIRAIvhKg5ZRO08VGQx8JdhT+UwDQYJKoZIhvcNAQELBQAw + GjEYMBYGA1UEAwwPRmFrZSBMRSBSb290IFgxMB4XDTE2MDUyMzIyMDc1OVoXDTM2 + MDUyMzIyMDc1OVowIjEgMB4GA1UEAwwXRmFrZSBMRSBJbnRlcm1lZGlhdGUgWDEw + ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDtWKySDn7rWZc5ggjz3ZB0 + 8jO4xti3uzINfD5sQ7Lj7hzetUT+wQob+iXSZkhnvx+IvdbXF5/yt8aWPpUKnPym + oLxsYiI5gQBLxNDzIec0OIaflWqAr29m7J8+NNtApEN8nZFnf3bhehZW7AxmS1m0 + ZnSsdHw0Fw+bgixPg2MQ9k9oefFeqa+7Kqdlz5bbrUYV2volxhDFtnI4Mh8BiWCN + xDH1Hizq+GKCcHsinDZWurCqder/afJBnQs+SBSL6MVApHt+d35zjBD92fO2Je56 + dhMfzCgOKXeJ340WhW3TjD1zqLZXeaCyUNRnfOmWZV8nEhtHOFbUCU7r/KkjMZO9 + AgMBAAGjgeMwgeAwDgYDVR0PAQH/BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAw + HQYDVR0OBBYEFMDMA0a5WCDMXHJw8+EuyyCm9Wg6MHoGCCsGAQUFBwEBBG4wbDA0 + BggrBgEFBQcwAYYoaHR0cDovL29jc3Auc3RnLXJvb3QteDEubGV0c2VuY3J5cHQu + b3JnLzA0BggrBgEFBQcwAoYoaHR0cDovL2NlcnQuc3RnLXJvb3QteDEubGV0c2Vu + Y3J5cHQub3JnLzAfBgNVHSMEGDAWgBTBJnSkikSg5vogKNhcI5pFiBh54DANBgkq + hkiG9w0BAQsFAAOCAgEABYSu4Il+fI0MYU42OTmEj+1HqQ5DvyAeyCA6sGuZdwjF + UGeVOv3NnLyfofuUOjEbY5irFCDtnv+0ckukUZN9lz4Q2YjWGUpW4TTu3ieTsaC9 + AFvCSgNHJyWSVtWvB5XDxsqawl1KzHzzwr132bF2rtGtazSqVqK9E07sGHMCf+zp + DQVDVVGtqZPHwX3KqUtefE621b8RI6VCl4oD30Olf8pjuzG4JKBFRFclzLRjo/h7 + IkkfjZ8wDa7faOjVXx6n+eUQ29cIMCzr8/rNWHS9pYGGQKJiY2xmVC9h12H99Xyf + zWE9vb5zKP3MVG6neX1hSdo7PEAb9fqRhHkqVsqUvJlIRmvXvVKTwNCP3eCjRCCI + PTAvjV+4ni786iXwwFYNz8l3PmPLCyQXWGohnJ8iBm+5nk7O2ynaPVW0U2W+pt2w + SVuvdDM5zGv2f9ltNWUiYZHJ1mmO97jSY/6YfdOUH66iRtQtDkHBRdkNBsMbD+Em + 2TgBldtHNSJBfB3pm9FblgOcJ0FSWcUDWJ7vO0+NTXlgrRofRT6pVywzxVo6dND0 + WzYlTWeUVsO40xJqhgUQRER9YLOLxJ0O6C8i0xFxAMKOtSdodMB3RIwt7RFQ0uyt + n5Z5MqkYhlMI3J1tPRTp1nEt9fyGspBOO05gi148Qasp+3N+svqKomoQglNoAxU= + -----END CERTIFICATE----- + """ - self.Resp = {"disable" : "disable server redis-ro/redis-ro0", - "set-server-agent" : "set server redis-ro/redis-ro0 agent up", - "set-server-health" : "set server redis-ro/redis-ro0 health stopping", - "set-server-state" : "set server redis-ro/redis-ro0 state drain", - "set-server-weight" : "set server redis-ro/redis-ro0 weight 10", - "frontends" : "show stat", - "info" : "show info", - "sessions" : "show sess", - "servers" : "show stat", - "show-all-ssl-crt-list" : "show ssl crt-list", - "show-details-ssl-crt-list" : "show ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", - "show-all-ssl-certs" : "show ssl cert", - "show-details-ssl-certs" : "show ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - "add-to-crt-list" : "add ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", - "del-from-crt-list" : "del ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", - "add-ssl-cert" : "new ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - "update-ssl-cert" : "set ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem ", - "del-ssl-cert" : "del ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - "commit-ssl-cert" : "commit ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - "abort-ssl-cert" : "abort ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + self.Resp = { + "disable": "disable server redis-ro/redis-ro0", + "set-server-agent": "set server redis-ro/redis-ro0 agent up", + "set-server-health": "set server redis-ro/redis-ro0 health stopping", + "set-server-state": "set server redis-ro/redis-ro0 state drain", + "set-server-weight": "set server redis-ro/redis-ro0 weight 10", + "frontends": "show stat", + "info": "show info", + "sessions": "show sess", + "servers": "show stat", + "show-ssl-crt-lists": "show ssl crt-list", + "show-ssl-crt-list": "show ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + "show-ssl-certs": "show ssl cert", + "show-ssl-cert": "show ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + "add-to-crt-list": "add ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", + "del-from-crt-list": "del ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", + "new-ssl-cert": "new ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + "update-ssl-cert": "set ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem <<\n%s" % self.pem_cert_content, + "del-ssl-cert": "del ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + "commit-ssl-cert": "commit ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", + "abort-ssl-cert": "abort ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", } self.Resp = dict([(k, v + "\r\n") for k, v in self.Resp.items()]) def test_setServerAgent(self): """Test 'set server agent' command""" - args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "up"} + args = {"backend": "redis-ro", "server": "redis-ro0", "value": "up"} cmdOutput = cmds.setServerAgent(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["set-server-agent"]) def test_setServerHealth(self): """Test 'set server health' command""" - args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "stopping"} + args = {"backend": "redis-ro", "server": "redis-ro0", "value": "stopping"} cmdOutput = cmds.setServerHealth(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["set-server-health"]) def test_setServerState(self): """Test 'set server state' command""" - args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "drain"} + args = {"backend": "redis-ro", "server": "redis-ro0", "value": "drain"} cmdOutput = cmds.setServerState(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["set-server-state"]) def test_setServerWeight(self): """Test 'set server weight' command""" - args = {"backend": "redis-ro", "server" : "redis-ro0", "value": "10"} + args = {"backend": "redis-ro", "server": "redis-ro0", "value": "10"} cmdOutput = cmds.setServerWeight(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["set-server-weight"]) @@ -79,63 +202,63 @@ def test_showServers(self): cmdOutput = cmds.showServers(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["servers"]) - def test_showAllSslCrtList(self): + def test_showSslCrtLists(self): """Test 'show ssl crt-list' command""" - cmdOutput = cmds.showAllSslCrtList().getCmd() - self.assertEqual(cmdOutput, self.Resp["show-all-ssl-crt-list"]) + cmdOutput = cmds.showSslCrtLists().getCmd() + self.assertEqual(cmdOutput, self.Resp["show-ssl-crt-lists"]) - def test_showDetailsSslCrtList(self): - """Test 'show ssl crt-list ' command""" + def test_showSslCrtList(self): + """Test 'show ssl crt-list ' command""" args = { - "filename": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + "crt_list": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", } - cmdOutput = cmds.test_showDetailsSslCrtList(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["show-details-ssl-crt-list"]) + cmdOutput = cmds.showSslCrtList(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["show-ssl-crt-list"]) - def test_showAllSslCerts(self): + def test_showSslCerts(self): """Test 'show ssl cert' command""" - cmdOutput = cmds.showAllSslCerts().getCmd() - self.assertEqual(cmdOutput, self.Resp["show-all-ssl-certs"]) + cmdOutput = cmds.showSslCerts().getCmd() + self.assertEqual(cmdOutput, self.Resp["show-ssl-certs"]) - def test_showDetailsSslCerts(self): + def test_showSslCert(self): """Test 'show ssl cert ' command""" args = { - "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem" + "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem" } - cmdOutput = cmds.showDetailsSslCerts(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["show-details-ssl-certs"]) + cmdOutput = cmds.showSslCert(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["show-ssl-cert"]) def test_addToSslCrtList(self): - """Test 'add ssl crt-list ' command""" + """Test 'add ssl crt-list ' command""" args = { - "filename": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", - "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem" + "crt_list": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem" } cmdOutput = cmds.addToSslCrtList(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["add-to-crt-list"]) def test_delFromSslCrtList(self): - """Test 'del ssl crt-list ' command""" + """Test 'del ssl crt-list ' command""" args = { - "filename": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", - "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem" + "crt_list": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem" } cmdOutput = cmds.delFromSslCrtList(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["del-from-crt-list"]) - def test_addSslCrt(self): + def test_newSslCrt(self): """Test 'new ssl cert ' command""" args = { - "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", } - cmdOutput = cmds.addSslCrt(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["add-ssl-cert"]) + cmdOutput = cmds.newSslCrt(**args).getCmd() + self.assertEqual(cmdOutput, self.Resp["new-ssl-cert"]) def test_updateSslCrt(self): - """Test 'new ssl cert ' command""" + """Test 'set ssl cert ' command""" args = { - "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", - "payload" : "TODO" + "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", + "payload": "%s" % self.pem_cert_content } cmdOutput = cmds.updateSslCrt(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["update-ssl-cert"]) @@ -143,7 +266,7 @@ def test_updateSslCrt(self): def test_delSslCrt(self): """Test 'del ssl cert ' command""" args = { - "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", } cmdOutput = cmds.delSslCrt(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["del-ssl-cert"]) @@ -151,7 +274,7 @@ def test_delSslCrt(self): def test_commitSslCrt(self): """Test 'commit ssl cert ' command""" args = { - "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", } cmdOutput = cmds.commitSslCrt(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["commit-ssl-cert"]) @@ -159,10 +282,11 @@ def test_commitSslCrt(self): def test_abortSslCrt(self): """Test 'abort ssl cert ' command""" args = { - "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem", + "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", } cmdOutput = cmds.abortSslCrt(**args).getCmd() self.assertEqual(cmdOutput, self.Resp["abort-ssl-cert"]) + if __name__ == '__main__': unittest.main() diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py index fc42c7c144..11a084f856 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py @@ -19,6 +19,17 @@ "show-info": cmds.showInfo, "show-sessions": cmds.showSessions, "show-servers": cmds.showServers, + "show-ssl-crt-lists": cmds.showSslCrtLists, + "show-ssl-crt-list": cmds.showSslCrtList, + "show-ssl-certs": cmds.showSslCerts, + "show-ssl-cert": cmds.showSslCert, + "add-to-crt-list": cmds.addToSslCrtList, + "del-from-crt-list": cmds.delFromSslCrtList, + "new-ssl-cert": cmds.newSslCrt, + "update-ssl-cert": cmds.updateSslCrt, + "del-ssl-cert": cmds.delSslCrt, + "commit-ssl-cert": cmds.commitSslCrt, + "abort-ssl-cert": cmds.abortSslCrt, } def get_args(): @@ -48,6 +59,21 @@ def get_args(): help='Specify value for a set command.', default=None ) + parser.add_argument( + '--payload', + help='Specify payload for a update command. either string or filepath', + default=None + ) + parser.add_argument( + '--crt-list', + help='Set a filepath for a crt-list.', + default=None + ) + parser.add_argument( + '--certfile', + help='Set a filepath for a certificate.', + default=None + ) parser.add_argument( '--output', help='Specify output format.', @@ -89,6 +115,14 @@ def get_args(): return parser.parse_args() args = get_args() +if args.payload and os.path.isfile(args.payload): + with open(args.payload) as payload_file: + payload_content = "" + for line in payload_file: + if line.rstrip(): + payload_content += line + args.payload = payload_content + command_class = VALID_COMMANDS.get(args.command, None) command_args = {key: val for key, val in vars(args).items() if key != "command"} From 3a029db4000584f51422b1f5e2d91c3bab5f64a8 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 12 Feb 2021 23:01:32 +0100 Subject: [PATCH 0402/3088] security/acme-client: fix log file location, closes #2227 --- security/acme-client/pkg-descr | 1 + .../opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 72ac1d1b4e..bacc33ad18 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -12,6 +12,7 @@ Plugin Changelog Fixed: * fix missing "--ecc" parameter when renewing ECC certs (#2223) +* fix log file location (#2227) 2.3 diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php index c3ae40817d..0a6fbba495 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php @@ -123,6 +123,8 @@ public function loadConfig(string $path, string $uuid) // Store config objects $this->config = $obj; $this->model = $model; + // Set log file + $this->acme_args[] = LeUtils::execSafe('--log %s', self::ACME_LOG_FILE); return true; } From 988829bdd0f98c59188cccefe1c4fdfe34f6fe80 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 15 Feb 2021 00:55:26 +0100 Subject: [PATCH 0403/3088] security/acme-client: revamp logs page --- security/acme-client/pkg-descr | 9 ++ .../src/etc/inc/plugins.inc.d/acmeclient.inc | 9 ++ .../OPNsense/AcmeClient/LogsController.php | 45 ++++++ .../library/OPNsense/AcmeClient/LeCommon.php | 12 +- .../models/OPNsense/AcmeClient/Menu/Menu.xml | 5 +- .../app/views/OPNsense/AcmeClient/logs.volt | 130 ++++++++++++++++++ .../systemhealth/logformats/acmeclient.py | 63 +++++++++ .../src/www/diag_logs_acmeclient.php | 7 - .../www/diag_logs_template_acme-client.inc | 117 ---------------- 9 files changed, 270 insertions(+), 127 deletions(-) create mode 100644 security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/LogsController.php create mode 100644 security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/logs.volt create mode 100755 security/acme-client/src/opnsense/scripts/systemhealth/logformats/acmeclient.py delete mode 100644 security/acme-client/src/www/diag_logs_acmeclient.php delete mode 100644 security/acme-client/src/www/diag_logs_template_acme-client.inc diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index bacc33ad18..2d89753b0a 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -10,9 +10,18 @@ Plugin Changelog 2.4 +Added: +* add new page to show AcmeClient entries from system log + Fixed: * fix missing "--ecc" parameter when renewing ECC certs (#2223) * fix log file location (#2227) +* fix GUI log formatting (by using the syslog log) + +Changed: +* let acme.sh log through syslog +* revamp logs page, move acme.sh log to a sub tab +* remove legacy logs page 2.3 diff --git a/security/acme-client/src/etc/inc/plugins.inc.d/acmeclient.inc b/security/acme-client/src/etc/inc/plugins.inc.d/acmeclient.inc index a210c2f85a..801a1fb076 100644 --- a/security/acme-client/src/etc/inc/plugins.inc.d/acmeclient.inc +++ b/security/acme-client/src/etc/inc/plugins.inc.d/acmeclient.inc @@ -71,6 +71,15 @@ function acmeclient_services() return $services; } +function acmeclient_syslog() +{ + $logfacilities = array(); + $logfacilities['acmeclient'] = array( + 'facility' => array('acmeclient', 'acme.sh') + ); + return $logfacilities; +} + /** * NOTE: Does NOT support configuration sync (xmlrpc). The required acme.sh * state files are missing on the secondary node and thus all attempts diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/LogsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/LogsController.php new file mode 100644 index 0000000000..927e31f9dc --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/LogsController.php @@ -0,0 +1,45 @@ +view->pick('OPNsense/AcmeClient/logs'); + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php index 0a6fbba495..151445d0c7 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php @@ -123,8 +123,6 @@ public function loadConfig(string $path, string $uuid) // Store config objects $this->config = $obj; $this->model = $model; - // Set log file - $this->acme_args[] = LeUtils::execSafe('--log %s', self::ACME_LOG_FILE); return true; } @@ -155,26 +153,36 @@ public function setLoglevel() switch ($loglevel) { case 'extended': + $this->acme_args[] = '--syslog 6'; $this->acme_args[] = '--log-level 2'; $this->debug = false; break; case 'debug': + $this->acme_args[] = '--syslog 7'; $this->acme_args[] = '--debug'; $this->debug = true; break; case 'debug2': + $this->acme_args[] = '--syslog 7'; $this->acme_args[] = '--debug 2'; $this->debug = true; break; case 'debug3': + $this->acme_args[] = '--syslog 7'; $this->acme_args[] = '--debug 3'; $this->debug = true; break; default: + $this->acme_args[] = '--syslog 6'; $this->acme_args[] = '--log-level 1'; $this->debug = false; break; } + + // Set log file + // NOTE: This log file is no longer exposed to the GUI. However, it may + // still turn out to be useful for debug purposes in rare egde cases. + $this->acme_args[] = LeUtils::execSafe('--log %s', self::ACME_LOG_FILE); } /** diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Menu/Menu.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Menu/Menu.xml index 79a8f7cf87..33a92cfb5f 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Menu/Menu.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Menu/Menu.xml @@ -9,7 +9,10 @@ - + + + + diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/logs.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/logs.volt new file mode 100644 index 0000000000..ae057bc86f --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/logs.volt @@ -0,0 +1,130 @@ +{# + # Copyright (c) 2019 Deciso B.V. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} + + + + + + +
    + +
    +
    +
    + + + + + + + + + + +
    {{ lang._('Date') }}{{ lang._('Process') }}{{ lang._('Line') }}
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + +
    {{ lang._('Date') }}{{ lang._('Process') }}{{ lang._('Line') }}
    +
    +
    +
    + +
    diff --git a/security/acme-client/src/opnsense/scripts/systemhealth/logformats/acmeclient.py b/security/acme-client/src/opnsense/scripts/systemhealth/logformats/acmeclient.py new file mode 100755 index 0000000000..a311773ecb --- /dev/null +++ b/security/acme-client/src/opnsense/scripts/systemhealth/logformats/acmeclient.py @@ -0,0 +1,63 @@ +""" + Copyright (c) 2021 Frank Wall + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import re +import datetime +from . import BaseLogFormat + +class AcmeclientLogFormat(BaseLogFormat): + def __init__(self, filename): + super(AcmeclientLogFormat, self).__init__(filename) + # XXX This is ugly, but it's the only way to override the line() method. + self._priority = 1 + self._startup_timestamp = datetime.datetime.now() + + def match(self, line): + return self._filename.find('acmeclient') > -1 and len(line) > 15 and re.match(r'(?:[01]\d|2[0123]):(?:[012345]\d):(?:[012345]\d)', line[7:15]) + + def timestamp(self, line): + # syslog format, strip timestamp and return actual log data + ts = datetime.datetime.strptime("%s %s" % (self._startup_timestamp.year, line[0:15]), "%Y %b %d %H:%M:%S") + ts = ts.replace(year=self._startup_timestamp.year) + if (self._startup_timestamp - ts).days < 0: + # likely previous year, (month for this year not reached yet) + ts = ts.replace(year=ts.year - 1) + return ts.isoformat() + + @staticmethod + def line(line): + # parse [date] [hostname] [process_name] [line] format + response = line[16:] + tmp = response.find(':') + pre = response[tmp+1:].strip() if tmp > -1 else response[response.find(' ')+1:].strip() + # strip the duplicate date from the line + return pre[30:].strip() + + @staticmethod + def process_name(line): + response = line[16:] + tmp = response.find(':') + return response[:tmp].strip().split()[-1] if tmp > -1 else "" diff --git a/security/acme-client/src/www/diag_logs_acmeclient.php b/security/acme-client/src/www/diag_logs_acmeclient.php deleted file mode 100644 index e5d406e957..0000000000 --- a/security/acme-client/src/www/diag_logs_acmeclient.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Copyright (C) 2004-2009 Scott Ullrich - * Copyright (C) 2003-2004 Manuel Kasper - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -require_once("guiconfig.inc"); -require_once("system.inc"); -require_once("interfaces.inc"); - -/* expects $logfile to point to the system path */ -/* expects $logclog to be true or false */ - -require_once 'diag_logs_common.inc'; - -$filtertext = ''; -$nentries = 50; - -if (isset($config['syslog']['nentries'])) { - $nentries = $config['syslog']['nentries']; -} - -if (!empty($_POST['clear'])) { - if ($logclog) { - system_clear_clog($logfile); - } else { - system_clear_log($logfile); - } -} - -if (isset($_POST['filtertext'])) { - $filtertext = $_POST['filtertext']; -} - -include("head.inc"); -?> - - - -
    -
    -
    -
    -

    -

    -
    -
    - -
    -
    -

    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    - From 82f54924915d8e71756f18cea795d6f130ed9dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= <34602360+opnsenseuser@users.noreply.github.com> Date: Mon, 15 Feb 2021 08:47:44 +0100 Subject: [PATCH 0404/3088] Themes Cicada/Vicuna/Tukan updates (#2238) a few color fixes for Cicada a few color fixes and traffic widget color fix for vicuna a few color fixes for sensei and "pick a color" fix for Tukan --- misc/theme-cicada/Makefile | 2 +- .../cicada/assets/stylesheets/main.scss | 266 +++++------------- .../www/themes/cicada/build/css/main.css | 18 +- .../build/css/pick-a-color-1.2.3.min.css | 2 +- misc/theme-tukan/Makefile | 2 +- .../themes/tukan/assets/stylesheets/main.scss | 4 + .../www/themes/tukan/build/css/main.css | 4 + .../build/css/pick-a-color-1.2.3.min.css | 86 ++++++ misc/theme-vicuna/Makefile | 2 +- .../vicuna/assets/stylesheets/main.scss | 12 +- .../vicuna/assets/stylesheets/tokenizer2.scss | 2 +- .../www/themes/vicuna/build/css/main.css | 12 +- .../www/themes/vicuna/build/css/nv.d3.css | 5 - .../build/css/pick-a-color-1.2.3.min.css | 2 +- .../www/themes/vicuna/build/css/tokenize2.css | 2 +- 15 files changed, 199 insertions(+), 222 deletions(-) create mode 100644 misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/pick-a-color-1.2.3.min.css diff --git a/misc/theme-cicada/Makefile b/misc/theme-cicada/Makefile index af5a7440ac..bfe671f7dc 100644 --- a/misc/theme-cicada/Makefile +++ b/misc/theme-cicada/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-cicada -PLUGIN_VERSION= 1.26 +PLUGIN_VERSION= 1.27 PLUGIN_COMMENT= The cicada theme - dark grey PLUGIN_MAINTAINER= rene@team-rebellion.net diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss index 8621584cdb..2e4f3edf7a 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss @@ -3495,297 +3495,231 @@ input { select { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] select { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } textarea { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] textarea { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="text"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="text"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="password"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="password"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="datetime"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="datetime"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="datetime-local"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="datetime-local"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="date"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="date"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="month"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="month"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="time"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="time"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="week"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="week"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="number"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="number"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="email"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="email"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="url"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="url"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="search"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="search"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="tel"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="tel"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } input[type="color"] { &[disabled], &[readonly] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } } fieldset[disabled] input[type="color"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none !important; border-color: #191919; } select { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3794,9 +3728,7 @@ select { fieldset[disabled]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3805,9 +3737,7 @@ fieldset[disabled]:hover { textarea { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3816,9 +3746,7 @@ textarea { fieldset[disabled]:hover textarea:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3827,9 +3755,7 @@ fieldset[disabled]:hover textarea:hover { input[type="text"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3838,9 +3764,7 @@ input[type="text"] { fieldset[disabled]:hover input[type="text"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3849,9 +3773,7 @@ fieldset[disabled]:hover input[type="text"]:hover { input[type="password"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3860,9 +3782,7 @@ input[type="password"] { fieldset[disabled]:hover input[type="password"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3871,9 +3791,7 @@ fieldset[disabled]:hover input[type="password"]:hover { input[type="datetime"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3882,9 +3800,7 @@ input[type="datetime"] { fieldset[disabled]:hover input[type="datetime"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3893,9 +3809,7 @@ fieldset[disabled]:hover input[type="datetime"]:hover { input[type="datetime-local"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3904,9 +3818,7 @@ input[type="datetime-local"] { fieldset[disabled]:hover input[type="datetime-local"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3915,9 +3827,7 @@ fieldset[disabled]:hover input[type="datetime-local"]:hover { input[type="date"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3926,9 +3836,7 @@ input[type="date"] { fieldset[disabled]:hover input[type="date"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3937,9 +3845,7 @@ fieldset[disabled]:hover input[type="date"]:hover { input[type="month"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3948,9 +3854,7 @@ input[type="month"] { fieldset[disabled]:hover input[type="month"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3959,9 +3863,7 @@ fieldset[disabled]:hover input[type="month"]:hover { input[type="time"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3970,9 +3872,7 @@ input[type="time"] { fieldset[disabled]:hover input[type="time"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3981,9 +3881,7 @@ fieldset[disabled]:hover input[type="time"]:hover { input[type="week"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -3992,9 +3890,7 @@ input[type="week"] { fieldset[disabled]:hover input[type="week"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4003,9 +3899,7 @@ fieldset[disabled]:hover input[type="week"]:hover { input[type="number"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4014,9 +3908,7 @@ input[type="number"] { fieldset[disabled]:hover input[type="number"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4025,9 +3917,7 @@ fieldset[disabled]:hover input[type="number"]:hover { input[type="email"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4036,9 +3926,7 @@ input[type="email"] { fieldset[disabled]:hover input[type="email"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4047,9 +3935,7 @@ fieldset[disabled]:hover input[type="email"]:hover { input[type="url"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4058,9 +3944,7 @@ input[type="url"] { fieldset[disabled]:hover input[type="url"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4069,9 +3953,7 @@ fieldset[disabled]:hover input[type="url"]:hover { input[type="search"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4080,9 +3962,7 @@ input[type="search"] { fieldset[disabled]:hover input[type="search"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4091,9 +3971,7 @@ fieldset[disabled]:hover input[type="search"]:hover { input[type="tel"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4102,9 +3980,7 @@ input[type="tel"] { fieldset[disabled]:hover input[type="tel"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4113,9 +3989,7 @@ fieldset[disabled]:hover input[type="tel"]:hover { input[type="color"] { &[disabled]:hover, &[readonly]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -4124,9 +3998,7 @@ input[type="color"] { fieldset[disabled]:hover input[type="color"]:hover { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity = 80); + background-color: none; border: 1px solid #191919; -webkit-box-shadow: none; box-shadow: none; @@ -10411,10 +10283,10 @@ label > input { .ipsec-tab { background-color: #3a3a3a !important; - color: #928873 !important; + color: #FFF !important; &.activetab { - background-color: #262626 !important; + background-color: #2d2d2d !important; color: #dd630d !important; } } @@ -10752,7 +10624,7 @@ ul.jqtree-tree { } .interface-table { - background-color: #242424 !important; + background-color: #191919 !important; } .modal-side-settings { @@ -10767,3 +10639,7 @@ ul.jqtree-tree { background-color: #d77610 !important; color: #FFF !important; } + +.table.border { + border: 1px solid #191919 !important; +} diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css index 59211a51fa..919e308ea3 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css @@ -2472,9 +2472,7 @@ input[type="color"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity=80); + background-color: none !important; border-color: #191919; } select[disabled]:hover, select[readonly]:hover, fieldset[disabled]:hover, @@ -2526,9 +2524,7 @@ input[type="color"] { cursor: not-allowed; - background-color: #686868; - opacity: 0.8; - filter: alpha(opacity=80); + background-color: none; border:1px solid #191919; -webkit-box-shadow: none; box-shadow: none; } @@ -6331,11 +6327,11 @@ label > input[type="radio"] { #ipsec .ipsec-tab { background-color: #3a3a3a !important; - color: #928873 !important; + color: #FFF !important; } #ipsec .ipsec-tab.activetab { - background-color: #262626 !important; + background-color: #2d2d2d !important; color: #dd630d !important; } .fw_pass { @@ -6605,7 +6601,7 @@ ul.jqtree-tree .jqtree-title { } .interface-table { - background-color: #242424 !important; + background-color: #191919 !important; } .modal-side-settings { @@ -6620,3 +6616,7 @@ ul.jqtree-tree .jqtree-title { background-color: #d77610 !important; color: #FFF !important; } + +.table.border { + border: 1px solid #191919 !important; +} diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/pick-a-color-1.2.3.min.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/pick-a-color-1.2.3.min.css index 91c8033748..8010d43e5c 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/pick-a-color-1.2.3.min.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/pick-a-color-1.2.3.min.css @@ -22,7 +22,7 @@ .pick-a-color-markup .color-menu .color-preview.violet{background-color:#ee81ee} .pick-a-color-markup .color-menu .color-preview.purple{background-color:#80007f} .pick-a-color-markup .color-menu .color-preview.black{background-color:#000} -.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{padding:5px 15px 3px 15px;cursor:default;min-height:25px;color:#fff}.pick-a-color-markup .color-menu .basicColors-content li>a:hover,.pick-a-color-markup .color-menu .savedColors-content li>a:hover{background-color:transparent} +.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{padding:5px 15px 3px 15px;cursor:default;min-height:25px;color:#fff}.pick-a-color-markup .color-menu .basicColors-content li>a:hover,.pick-a-color-markup .color-menu .savedColors-content li>a:hover{background-color:none} @media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{min-height:40px}} .pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{color:#dd630d;background-image:none;filter:none;text-decoration:none;font-weight:bold}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{background-color:#fff;font-weight:normal}} .pick-a-color-markup .color-menu .btn.color-select{margin:0px 5px;height:20px;padding:0px 5px;margin-top:0px;line-height:1.5px;border-radius:4px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .btn.color-select{height:35px}} diff --git a/misc/theme-tukan/Makefile b/misc/theme-tukan/Makefile index ef96f6a111..9408a172ae 100644 --- a/misc/theme-tukan/Makefile +++ b/misc/theme-tukan/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-tukan -PLUGIN_VERSION= 1.23 +PLUGIN_VERSION= 1.24 PLUGIN_COMMENT= The tukan theme - blue/white PLUGIN_MAINTAINER= rene@team-rebellion.net diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss index fffb043fd8..9319aaa62a 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss @@ -10679,3 +10679,7 @@ input[type="checkbox"] { label.btn.au-target { color: #FFF !important; } + +.table.border { + border: 1px solid #bdbdbd; +} diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css index 36f2577243..df4a0ea045 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css @@ -6513,3 +6513,7 @@ input[type="checkbox"].checkbox-switch:checked + i::before, input[type="checkbox label.btn.au-target { color: #FFF !important; } + +.table.border { + border: 1px solid #bdbdbd; +} diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/pick-a-color-1.2.3.min.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/pick-a-color-1.2.3.min.css new file mode 100644 index 0000000000..0606f04c53 --- /dev/null +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/pick-a-color-1.2.3.min.css @@ -0,0 +1,86 @@ + +.pick-a-color-markup *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} +.pick-a-color-markup .hex-pound{padding-left:8px;padding-right:8px}@media screen and (max-width:991px){.pick-a-color-markup .hex-pound{padding:3px 5px 0px 5px;min-height:30px}} +.pick-a-color-markup .pick-a-color{padding:5px}@media screen and (max-width:991px){.pick-a-color-markup .pick-a-color{width:100%;font-size:18px;padding:9px;min-width:222px;height:47px}} +.pick-a-color-markup .input-group-btn .color-dropdown{padding:6px 5px}.pick-a-color-markup .input-group-btn .color-dropdown.no-hex{border-bottom-left-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .input-group-btn .color-dropdown:focus{background-color:#fff} +@media screen and (max-width:991px){.pick-a-color-markup .input-group-btn .color-dropdown{height:47px}} +.pick-a-color-markup .color-preview{border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 0 2px 2px rgba(0,0,0,0.075);box-shadow:inset 0 0 2px 2px rgba(0,0,0,0.075);height:1.429em;width:1.429em;display:inline-block;cursor:pointer;margin-right:5px}.pick-a-color-markup .color-preview.current-color{margin-bottom:-5px} +@media screen and (max-width:991px){.pick-a-color-markup .color-preview{height:1.875em;width:1.875em}} +.pick-a-color-markup .color-menu{text-align:left;padding:5px 0px;width:330px;font-size:14px;left:auto;}.pick-a-color-markup .color-menu.color-menu--inline{left:-285px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu.color-menu--inline{left:-242px}} +@media screen and (max-width:991px){.pick-a-color-markup .color-menu{left:-242px;width:293px}}.pick-a-color-markup .color-menu.small{width:100px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu.small{left:-105px}} +.pick-a-color-markup .color-menu.no-hex{left:0px} +.pick-a-color-markup .color-menu ul{padding:0px;margin:0px} +.pick-a-color-markup .color-menu li{list-style-type:none;padding:5px 0px;margin:0px} +.pick-a-color-markup .color-menu .color-preview{vertical-align:middle;margin:0px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .color-preview{height:35px;width:35px}}.pick-a-color-markup .color-menu .color-preview.current-color,.pick-a-color-markup .color-menu .color-preview.white{background-color:#fff} +.pick-a-color-markup .color-menu .color-preview.red{background-color:#f00} +.pick-a-color-markup .color-menu .color-preview.orange{background-color:#f60} +.pick-a-color-markup .color-menu .color-preview.yellow{background-color:#ff0} +.pick-a-color-markup .color-menu .color-preview.green{background-color:#008000} +.pick-a-color-markup .color-menu .color-preview.blue{background-color:#00f} +.pick-a-color-markup .color-menu .color-preview.indigo{background-color:#4a0080} +.pick-a-color-markup .color-menu .color-preview.violet{background-color:#ee81ee} +.pick-a-color-markup .color-menu .color-preview.purple{background-color:#80007f} +.pick-a-color-markup .color-menu .color-preview.black{background-color:#000} +.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{padding:5px 15px 3px 15px;cursor:default;min-height:25px;color:#FFF}.pick-a-color-markup .color-menu .basicColors-content li>a:hover,.pick-a-color-markup .color-menu .savedColors-content li>a:hover{background-color:none} +@media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{min-height:40px}} +.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{color:#FFF;background-image:none;filter:none;text-decoration:none;font-weight:bold}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{background-color:#fff;font-weight:normal}} +.pick-a-color-markup .color-menu .btn.color-select{margin:0px 5px;height:20px;padding:0px 5px;margin-top:0px;line-height:1.5px;border-radius:4px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .btn.color-select{height:35px}} +.pick-a-color-markup .caret{margin-bottom:3px;color: #000;} +.pick-a-color-markup .color-menu-instructions,.pick-a-color-markup .advanced-instructions{text-align:center;padding:0px 6px;margin:0px;font-size:14px;font-weight:normal}@media screen and (min-width:992px){.pick-a-color-markup .color-menu-instructions,.pick-a-color-markup .advanced-instructions{display:none}} +.pick-a-color-markup .color-label{vertical-align:middle;margin:0px;margin-left:10px;cursor:pointer}@media screen and (max-width:991px){.pick-a-color-markup .color-label{margin-left:8px}} +.pick-a-color-markup .color-box{height:20px;width:200px;position:absolute;left:115px;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 0 2px 2px rgba(0,0,0,0.075);box-shadow:inset 0 0 2px 2px rgba(0,0,0,0.075);cursor:pointer}@media screen and (max-width:991px){.pick-a-color-markup .color-box{width:160px;height:35px}} +.pick-a-color-markup .black .highlight-band-stripe{background-color:#fff} +.pick-a-color-markup .spectrum-white{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#808080));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#808080 100%));background-image:-moz-linear-gradient(left, #fff 0, #808080 100%);background-image:linear-gradient(to right, #fff 0, #808080 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ff808080', GradientType=1)}.pick-a-color-markup .spectrum-white .highlight-band{left:0px} +.pick-a-color-markup .spectrum-red{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #f00), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #f00 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #f00 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #f00 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #f00 50%, #000 100%);background-repeat:repeat-x} +.pick-a-color-markup .spectrum-orange{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #f60), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #f60 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #f60 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #f60 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #f60 50%, #000 100%);background-repeat:repeat-x} +.pick-a-color-markup .spectrum-yellow{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #ff0), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #ff0 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #ff0 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #ff0 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #ff0 50%, #000 100%);background-repeat:repeat-x} +.pick-a-color-markup .spectrum-green{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #80ff80), color-stop(.5, #008000), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #80ff80 0, #008000 50%, #000 100%);background-image:-webkit-linear-gradient(left, #80ff80 0, #008000 50%, #000 100%);background-image:-o-linear-gradient(left, #80ff80 0, #008000 50%, #000 100%);background-image:linear-gradient(to right, #80ff80 0, #008000 50%, #000 100%);background-repeat:repeat-x} +.pick-a-color-markup .spectrum-blue{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #00f), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #00f 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #00f 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #00f 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #00f 50%, #000 100%);background-repeat:repeat-x} +.pick-a-color-markup .spectrum-purple{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #ff80ff), color-stop(.5, #80007f), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #ff80ff 0, #80007f 50%, #000 100%);background-image:-webkit-linear-gradient(left, #ff80ff 0, #80007f 50%, #000 100%);background-image:-o-linear-gradient(left, #ff80ff 0, #80007f 50%, #000 100%);background-image:linear-gradient(to right, #ff80ff 0, #80007f 50%, #000 100%);background-repeat:repeat-x} +.pick-a-color-markup .spectrum-black{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#000), to(#808080));background-image:-webkit-linear-gradient(left, color-stop(#000 0), color-stop(#808080 100%));background-image:-moz-linear-gradient(left, #000 0, #808080 100%);background-image:linear-gradient(to right, #000 0, #808080 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff000000', endColorstr='#ff808080', GradientType=1)}.pick-a-color-markup .spectrum-black .highlight-band{left:0px;border:1px solid #808080} +.pick-a-color-markup .ie-spectrum{height:20px;width:100px;display:inline-block;top:-1}.pick-a-color-markup .ie-spectrum.hue{width:50.5px}@media screen and (max-width:991px){.pick-a-color-markup .ie-spectrum.hue{width:45.5px}} +@media screen and (max-width:991px){.pick-a-color-markup .ie-spectrum{width:80px;height:35px}} +.pick-a-color-markup .red-spectrum-0,.pick-a-color-markup .lightness-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#f00));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#f00 100%));background-image:-moz-linear-gradient(left, #fff 0, #f00 100%);background-image:linear-gradient(to right, #fff 0, #f00 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffff0000', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .red-spectrum-1,.pick-a-color-markup .lightness-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#f00), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#f00 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #f00 0, #000 100%);background-image:linear-gradient(to right, #f00 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff0000', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px} +.pick-a-color-markup .lightness-spectrum-0,.pick-a-color-markup .lightness-spectrum-1{width:150px}@media screen and (max-width:991px){.pick-a-color-markup .lightness-spectrum-0,.pick-a-color-markup .lightness-spectrum-1{width:135px}} +.pick-a-color-markup .orange-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#f60));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#f60 100%));background-image:-moz-linear-gradient(left, #fff 0, #f60 100%);background-image:linear-gradient(to right, #fff 0, #f60 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffff6600', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .orange-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#f60), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#f60 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #f60 0, #000 100%);background-image:linear-gradient(to right, #f60 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff6600', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px} +.pick-a-color-markup .yellow-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#ff0));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#ff0 100%));background-image:-moz-linear-gradient(left, #fff 0, #ff0 100%);background-image:linear-gradient(to right, #fff 0, #ff0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffffff00', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .yellow-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#ff0), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#ff0 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #ff0 0, #000 100%);background-image:linear-gradient(to right, #ff0 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff00', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px} +.pick-a-color-markup .green-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#80ff80), to(#008000));background-image:-webkit-linear-gradient(left, color-stop(#80ff80 0), color-stop(#008000 100%));background-image:-moz-linear-gradient(left, #80ff80 0, #008000 100%);background-image:linear-gradient(to right, #80ff80 0, #008000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff80ff80', endColorstr='#ff008000', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .green-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#008000), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#008000 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #008000 0, #000 100%);background-image:linear-gradient(to right, #008000 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff008000', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px} +.pick-a-color-markup .blue-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#fff), to(#00f));background-image:-webkit-linear-gradient(left, color-stop(#fff 0), color-stop(#00f 100%));background-image:-moz-linear-gradient(left, #fff 0, #00f 100%);background-image:linear-gradient(to right, #fff 0, #00f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ff0000ff', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .blue-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#00f), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#00f 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #00f 0, #000 100%);background-image:linear-gradient(to right, #00f 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000ff', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px} +.pick-a-color-markup .purple-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#ff80ff), to(#80007f));background-image:-webkit-linear-gradient(left, color-stop(#ff80ff 0), color-stop(#80007f 100%));background-image:-moz-linear-gradient(left, #ff80ff 0, #80007f 100%);background-image:linear-gradient(to right, #ff80ff 0, #80007f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff80ff', endColorstr='#ff80007f', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .purple-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#80007f), to(#000));background-image:-webkit-linear-gradient(left, color-stop(#80007f 0), color-stop(#000 100%));background-image:-moz-linear-gradient(left, #80007f 0, #000 100%);background-image:linear-gradient(to right, #80007f 0, #000 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff80007f', endColorstr='#ff000000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px} +.pick-a-color-markup .saturation-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#808080), to(#bf4040));background-image:-webkit-linear-gradient(left, color-stop(#808080 0), color-stop(#bf4040 100%));background-image:-moz-linear-gradient(left, #808080 0, #bf4040 100%);background-image:linear-gradient(to right, #808080 0, #bf4040 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff808080', endColorstr='#ffbf4040', GradientType=1);border-bottom-left-radius:4px;border-top-left-radius:4px;width:150px}@media screen and (max-width:991px){.pick-a-color-markup .saturation-spectrum-0{width:135px}} +.pick-a-color-markup .saturation-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#bf4040), to(#f00));background-image:-webkit-linear-gradient(left, color-stop(#bf4040 0), color-stop(#f00 100%));background-image:-moz-linear-gradient(left, #bf4040 0, #f00 100%);background-image:linear-gradient(to right, #bf4040 0, #f00 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbf4040', endColorstr='#ffff0000', GradientType=1);border-bottom-right-radius:4px;border-top-right-radius:4px;width:150px}@media screen and (max-width:991px){.pick-a-color-markup .saturation-spectrum-1{width:135px}} +.pick-a-color-markup .hue-spectrum-0{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#f00), to(#ff0));background-image:-webkit-linear-gradient(left, color-stop(#f00 0), color-stop(#ff0 100%));background-image:-moz-linear-gradient(left, #f00 0, #ff0 100%);background-image:linear-gradient(to right, #f00 0, #ff0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff0000', endColorstr='#ffffff00', GradientType=1)} +.pick-a-color-markup .hue-spectrum-1{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#ff0), to(#0f0));background-image:-webkit-linear-gradient(left, color-stop(#ff0 0), color-stop(#0f0 100%));background-image:-moz-linear-gradient(left, #ff0 0, #0f0 100%);background-image:linear-gradient(to right, #ff0 0, #0f0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff00', endColorstr='#ff00ff00', GradientType=1)} +.pick-a-color-markup .hue-spectrum-2{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#0f0), to(#0ff));background-image:-webkit-linear-gradient(left, color-stop(#0f0 0), color-stop(#0ff 100%));background-image:-moz-linear-gradient(left, #0f0 0, #0ff 100%);background-image:linear-gradient(to right, #0f0 0, #0ff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff00', endColorstr='#ff00ffff', GradientType=1);left:-1px;position:relative} +.pick-a-color-markup .hue-spectrum-3{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#0ff), to(#00f));background-image:-webkit-linear-gradient(left, color-stop(#0ff 0), color-stop(#00f 100%));background-image:-moz-linear-gradient(left, #0ff 0, #00f 100%);background-image:linear-gradient(to right, #0ff 0, #00f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ffff', endColorstr='#ff0000ff', GradientType=1);left:-1px;position:relative} +.pick-a-color-markup .hue-spectrum-4{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#00f), to(#f0f));background-image:-webkit-linear-gradient(left, color-stop(#00f 0), color-stop(#f0f 100%));background-image:-moz-linear-gradient(left, #00f 0, #f0f 100%);background-image:linear-gradient(to right, #00f 0, #f0f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000ff', endColorstr='#ffff00ff', GradientType=1);left:-1px;position:relative} +.pick-a-color-markup .hue-spectrum-5{background-image:-webkit-gradient(linear, 0 top, 100% top, from(#f0f), to(#f00));background-image:-webkit-linear-gradient(left, color-stop(#f0f 0), color-stop(#f00 100%));background-image:-moz-linear-gradient(left, #f0f 0, #f00 100%);background-image:linear-gradient(to right, #f0f 0, #f00 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00ff', endColorstr='#ffff0000', GradientType=1);left:-2px;position:relative} +.pick-a-color-markup .highlight-band{border:1px solid #222;border-radius:2px;-webkit-box-shadow:1px 1px 1px #333;box-shadow:1px 1px 1px #333;height:19px;width:11px;display:inline-block;cursor:pointer;cursor:-webkit-grab;cursor:-moz-grab;position:absolute;top:-1px;left:94.5px;text-align:center}@media screen and (max-width:991px){.pick-a-color-markup .highlight-band{width:21px;left:69.5px;height:34px}} +.pick-a-color-markup .highlight-band-stripe{min-height:80%;min-width:1px;background-color:#000;opacity:0.40;margin:2px 1px;display:inline-block;-webkit-box-shadow:1px 0 2px 0 #fff;box-shadow:1px 0 2px 0 #fff}@media screen and (max-width:991px){.pick-a-color-markup .highlight-band-stripe{margin:4px 2px}} +.pick-a-color-markup .color-menu-tabs{padding:5px 3px 3px 10px;font-size:12px;color:#333;border-bottom:1px solid #ccc;margin-bottom:5px}.pick-a-color-markup .color-menu-tabs .tab{padding:4px 5px;margin:5px;border-left:1px solid #fff;border-right:1px solid #fff;cursor:pointer;background-color:#fff}.pick-a-color-markup .color-menu-tabs .tab:hover{padding-bottom:6px;border-top:1px solid #ccc;border-right:1px solid #ccc;border-left:1px solid #ccc;border-top-right-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .color-menu-tabs a{color:#333;text-decoration:none} +.pick-a-color-markup .color-menu-tabs .tab-active{border-bottom:3px solid #fff;padding-bottom:5px;border-top:1px solid #ccc;border-right:1px solid #ccc;border-left:1px solid #ccc;border-top-right-radius:4px;border-top-left-radius:4px} +.pick-a-color-markup .active-content{display:block} +.pick-a-color-markup .inactive-content{display:none} +.pick-a-color-markup .savedColors-content{padding:5px 15px;white-space:normal}.pick-a-color-markup .savedColors-content li.color-item>a{margin-left:7px;padding-left:8px;border-radius:4px} +.pick-a-color-markup .saved-color-col{position:relative;left:-15px;float:left;width:149px}@media screen and (max-width:991px){.pick-a-color-markup .saved-color-col{width:130px}} +.pick-a-color-markup .advanced-content ul{margin-top:10px} +.pick-a-color-markup .advanced-content li{padding:5px 15px 3px 15px;cursor:default;min-height:25px;height:50px;position:relative}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content li{min-height:70px}} +.pick-a-color-markup .advanced-content .color-preview{height:50px;width:300px;float:left;margin:0px 0px 10px 0px;background-color:#f00;text-align:center}.pick-a-color-markup .advanced-content .color-preview .color-select.btn.advanced{margin-top:15px;display:none}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .color-preview .color-select.btn.advanced{display:inline;margin-top:7px}} +.pick-a-color-markup .advanced-content .color-preview:hover .color-select.btn.advanced{display:inline} +@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .color-preview{width:270px;margin-left:-10px}} +.pick-a-color-markup .advanced-content .spectrum-hue{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #f00), color-stop(17%, #ff0), color-stop(34%, #0f0), color-stop(51%, #0ff), color-stop(68%, #00f), color-stop(85%, #f0f), color-stop(100%, #f00));background-image:-moz-linear-gradient(left center, #f00 0, #ff0 17%, #0f0 24%, #0ff 51%, #00f 68%, #f0f 85%, #f00 100%);background-image:-webkit-linear-gradient(left, #f00 0, #ff0 17%, #0f0 24%, #0ff 51%, #00f 68%, #f0f 85%, #f00 100%);background-image:-o-linear-gradient(left, #f00 0, #ff0 17%, #0f0 24%, #0ff 51%, #00f 68%, #f0f 85%, #f00 100%);background-image:linear-gradient(to right, #f00 0, #ff0 17%, #0f0 24%, #0ff 51%, #00f 68%, #f0f 85%, #f00 100%);background-repeat:repeat-x}.pick-a-color-markup .advanced-content .spectrum-hue .highlight-band{left:0px} +.pick-a-color-markup .advanced-content .spectrum-lightness{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #fff), color-stop(.5, #f00), color-stop(1, #000));background-image:-moz-linear-gradient(left center, #fff 0, #f00 50%, #000 100%);background-image:-webkit-linear-gradient(left, #fff 0, #f00 50%, #000 100%);background-image:-o-linear-gradient(left, #fff 0, #f00 50%, #000 100%);background-image:linear-gradient(to right, #fff 0, #f00 50%, #000 100%);background-repeat:repeat-x} +.pick-a-color-markup .advanced-content .spectrum-saturation{background-image:-webkit-gradient(linear, left top, right top, color-stop(0, #808080), color-stop(.5, #f00), color-stop(1, #f00));background-image:-moz-linear-gradient(left center, #808080 0, #f00 50%, #f00 100%);background-image:-webkit-linear-gradient(left, #808080 0, #f00 50%, #f00 100%);background-image:-o-linear-gradient(left, #808080 0, #f00 50%, #f00 100%);background-image:linear-gradient(to right, #808080 0, #f00 50%, #f00 100%);background-repeat:repeat-x}.pick-a-color-markup .advanced-content .spectrum-saturation .highlight-band{left:287px}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .spectrum-saturation .highlight-band{left:247px}} +.pick-a-color-markup .advanced-content .spectrum-lightness .highlight-band{left:143.5px}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .spectrum-lightness .highlight-band{left:123.5px}} +.pick-a-color-markup .advanced-content .lightness-text,.pick-a-color-markup .advanced-content .hue-text,.pick-a-color-markup .advanced-content .saturation-text,.pick-a-color-markup .advanced-content .preview-text{vertical-align:middle;text-align:center;display:block} +.pick-a-color-markup .advanced-content .color-box{left:15px;top:25px;width:300px}@media screen and (max-width:991px){.pick-a-color-markup .advanced-content .color-box{width:270px;left:10px}} +.pick-a-color-markup .advanced-content .preview-item{height:80px} +@-moz-document url-prefix(){@media screen and (max-width:991px){div.pick-a-color-markup .color-menu{left:0px}}} diff --git a/misc/theme-vicuna/Makefile b/misc/theme-vicuna/Makefile index 4f2a6fac81..7c1be4db2f 100644 --- a/misc/theme-vicuna/Makefile +++ b/misc/theme-vicuna/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-vicuna -PLUGIN_VERSION= 1.2 +PLUGIN_VERSION= 1.3 PLUGIN_COMMENT= The vicuna theme - dark anthrazit PLUGIN_MAINTAINER= rene@team-rebellion.net diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss index 4b118209c0..3d05ec02f6 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss @@ -10434,12 +10434,14 @@ label > input { } .ipsec-tab { - background-color: #839caa !important; + background-color: #202f3a !important; color: #FFF !important; + opacity: 0.5; &.activetab { - background-color: #315a71 !important; - color: #FFF !important; + background-color: #202f3a !important; + color: #D77610 !important; + opacity: 1; } } } @@ -10760,3 +10762,7 @@ ul.jqtree-tree { background-color: #d77610 !important; color: #FFF !important; } + +.table.border { + border: 1px solid #181818 !important; +} diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/tokenizer2.scss b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/tokenizer2.scss index 4df1e1901d..789bae6c27 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/tokenizer2.scss +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/tokenizer2.scss @@ -38,7 +38,7 @@ > { .token { padding: 0 1.2em 0 5px; - background-color: #d7af10; + background-color: #d77610; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css index f9406046cd..8234f124a8 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css @@ -6333,13 +6333,15 @@ label > input[type="radio"] { } #ipsec .ipsec-tab { - background-color: #839caa !important; + background-color: #202f3a !important; color: #FFF !important; + opacity: 0.5; } #ipsec .ipsec-tab.activetab { - background-color: #315a71 !important; - color: #FFF !important; + background-color: #202f3a !important; + color: #D77610 !important; + opacity: 1; } .fw_pass { background-color: #203a23 !important; @@ -6577,3 +6579,7 @@ ul.jqtree-tree .jqtree-title { background-color: #d77610 !important; color: #FFF !important; } + +.table.border { + border: 1px solid #181818 !important; +} diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/nv.d3.css b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/nv.d3.css index 5f3eea0020..ea4b9f5e0e 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/nv.d3.css +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/nv.d3.css @@ -335,11 +335,6 @@ svg.nvd3-svg { fill-opacity: .7; } -circle.nv-legend-symbol { - fill: rgb(151, 151, 151) !important; - stroke: rgb(151, 151, 151) !important; -} - /********** * Print */ diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/pick-a-color-1.2.3.min.css b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/pick-a-color-1.2.3.min.css index 74517c454e..8e3bcc16cc 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/pick-a-color-1.2.3.min.css +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/pick-a-color-1.2.3.min.css @@ -22,7 +22,7 @@ .pick-a-color-markup .color-menu .color-preview.violet{background-color:#ee81ee} .pick-a-color-markup .color-menu .color-preview.purple{background-color:#80007f} .pick-a-color-markup .color-menu .color-preview.black{background-color:#000} -.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{padding:5px 15px 3px 15px;cursor:default;min-height:25px;color:#fff}.pick-a-color-markup .color-menu .basicColors-content li>a:hover,.pick-a-color-markup .color-menu .savedColors-content li>a:hover{background-color:transparent} +.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{padding:5px 15px 3px 15px;cursor:default;min-height:25px;color:#fff}.pick-a-color-markup .color-menu .basicColors-content li>a:hover,.pick-a-color-markup .color-menu .savedColors-content li>a:hover{background-color:none} @media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{min-height:40px}} .pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{color:#dd630d;background-image:none;filter:none;text-decoration:none;font-weight:bold}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{background-color:#fff;font-weight:normal}} .pick-a-color-markup .color-menu .btn.color-select{margin:0px 5px;height:20px;padding:0px 5px;margin-top:0px;line-height:1.5px;border-radius:4px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .btn.color-select{height:35px}} diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/tokenize2.css b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/tokenize2.css index c2403aa472..f1fbdbbca9 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/tokenize2.css +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/tokenize2.css @@ -35,7 +35,7 @@ .tokenize > .tokens-container > .token { padding: 0 1.2em 0 5px; - background-color: #d7af10; + background-color: #d77610; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; From 4ab914ceaf4443bb222f72d14d69f930d13f6add Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Feb 2021 09:52:10 +0100 Subject: [PATCH 0405/3088] Framework: add revision bump helper and fix a typo --- Makefile | 2 +- Mk/plugins.mk | 5 ++++- Scripts/revbump.sh | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 Scripts/revbump.sh diff --git a/Makefile b/Makefile index 6c21da0d95..82aa061e95 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ list: .endfor # shared targets that are sane to run from the root directory -TARGETS= clean lint style style-fix style-python sweep test +TARGETS= clean lint revision style style-fix style-python sweep test .for TARGET in ${TARGETS} ${TARGET}: diff --git a/Mk/plugins.mk b/Mk/plugins.mk index ac202ae301..56ff42e2d8 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -325,7 +325,10 @@ sweep: check ! -name "*.ser" -type f -print0 | \ xargs -0 -n1 ${SCRIPTSDIR}/cleanfile find ${.CURDIR} -type f -depth 1 -print0 | \ - xargs -0 -n1 ${SCRIPTSDIRs/cleanfile + xargs -0 -n1 ${SCRIPTSDIR}/cleanfile + +revision: + ${SCRIPTSDIR}/revbump.sh ${.CURDIR} STYLEDIRS?= src/etc/inc src/opnsense diff --git a/Scripts/revbump.sh b/Scripts/revbump.sh new file mode 100755 index 0000000000..135168df57 --- /dev/null +++ b/Scripts/revbump.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +DIR=${1} + +if [ -z "${DIR}" ]; then + DIR=. +fi + +REV=$(make -C ${DIR} -V PLUGIN_REVISION) +REV=$(expr ${REV} \+ 1) + +grep -v ^PLUGIN_REVISION ${DIR}/Makefile > ${DIR}/Makefile.tmp +sed -e "s/^\(PLUGIN_VERSION.*\)/\1\nPLUGIN_REVISION= ${REV}/g" ${DIR}/Makefile.tmp > ${DIR}/Makefile +rm -f ${DIR}/Makefile.tmp From df1e33afa6f4f4659ca4d644cadb91acb8c27547 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Feb 2021 09:55:38 +0100 Subject: [PATCH 0406/3088] Framework: mute script invoke --- Mk/plugins.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 56ff42e2d8..01a35264c1 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -328,7 +328,7 @@ sweep: check xargs -0 -n1 ${SCRIPTSDIR}/cleanfile revision: - ${SCRIPTSDIR}/revbump.sh ${.CURDIR} + @${SCRIPTSDIR}/revbump.sh ${.CURDIR} STYLEDIRS?= src/etc/inc src/opnsense From 3e02a4c67c78c85b7583947841cee04583df6496 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Feb 2021 10:10:07 +0100 Subject: [PATCH 0407/3088] Framework: tedious work on FreeBSD... --- Scripts/revbump.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/revbump.sh b/Scripts/revbump.sh index 135168df57..120b0fce41 100755 --- a/Scripts/revbump.sh +++ b/Scripts/revbump.sh @@ -12,5 +12,6 @@ REV=$(make -C ${DIR} -V PLUGIN_REVISION) REV=$(expr ${REV} \+ 1) grep -v ^PLUGIN_REVISION ${DIR}/Makefile > ${DIR}/Makefile.tmp -sed -e "s/^\(PLUGIN_VERSION.*\)/\1\nPLUGIN_REVISION= ${REV}/g" ${DIR}/Makefile.tmp > ${DIR}/Makefile +sed -e "s/^\(PLUGIN_VERSION.*\)/\1%PLUGIN_REVISION= ${REV}/g" \ + ${DIR}/Makefile.tmp | tr '%' '\n' > ${DIR}/Makefile rm -f ${DIR}/Makefile.tmp From 96ffd1ec9071fce339e829fc5fa3b2dd2aaf8a9a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Feb 2021 10:32:44 +0100 Subject: [PATCH 0408/3088] misc/theme-rebellion: revision bump --- misc/theme-rebellion/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/theme-rebellion/Makefile b/misc/theme-rebellion/Makefile index d64b12ab93..97bd1578d4 100644 --- a/misc/theme-rebellion/Makefile +++ b/misc/theme-rebellion/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= theme-rebellion PLUGIN_VERSION= 1.8.6 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= A suitably dark theme PLUGIN_MAINTAINER= team-rebellion@queens-park.com From 2782d51eae2cd5829c1cea65c35308e9f070d144 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Feb 2021 10:35:27 +0100 Subject: [PATCH 0409/3088] www: revision bump --- www/c-icap/Makefile | 1 + www/cache/Makefile | 1 + www/nginx/Makefile | 2 +- www/web-proxy-sso/Makefile | 2 +- www/web-proxy-useracl/Makefile | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/www/c-icap/Makefile b/www/c-icap/Makefile index ae60824d71..4d7407750a 100644 --- a/www/c-icap/Makefile +++ b/www/c-icap/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= c-icap PLUGIN_VERSION= 1.7 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= c-icap connects the web proxy with a virus scanner PLUGIN_DEPENDS= c-icap c-icap-modules PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/www/cache/Makefile b/www/cache/Makefile index 65dbb3d28b..4cb74de418 100644 --- a/www/cache/Makefile +++ b/www/cache/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= cache PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Webserver cache PLUGIN_DEPENDS= php${PLUGIN_PHP}-opcache PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 94215b98eb..c9df402b35 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= nginx PLUGIN_VERSION= 1.20 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/web-proxy-sso/Makefile b/www/web-proxy-sso/Makefile index dabf634498..7eb73383aa 100644 --- a/www/web-proxy-sso/Makefile +++ b/www/web-proxy-sso/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= web-proxy-sso PLUGIN_VERSION= 2.2 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Kerberos authentication module PLUGIN_DEPENDS= msktutil cyrus-sasl-gssapi PLUGIN_MAINTAINER= evbevz@gmail.com diff --git a/www/web-proxy-useracl/Makefile b/www/web-proxy-useracl/Makefile index e80e2166c9..a2374138c9 100644 --- a/www/web-proxy-useracl/Makefile +++ b/www/web-proxy-useracl/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= web-proxy-useracl PLUGIN_VERSION= 1.1 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Group and user ACL for the web proxy PLUGIN_MAINTAINER= kekek2@ya.ru PLUGIN_WWW= https://smart-soft.ru From eccb081fc41bdb3f42835347c4b95788c24df5d1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Feb 2021 10:36:25 +0100 Subject: [PATCH 0410/3088] vendor: revision bump --- vendor/sunnyvalley/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/vendor/sunnyvalley/Makefile b/vendor/sunnyvalley/Makefile index 58fc4cc315..6d082409e3 100644 --- a/vendor/sunnyvalley/Makefile +++ b/vendor/sunnyvalley/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= sunnyvalley PLUGIN_VERSION= 1.2 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Vendor repository for Sensei (Next Generation Firewall Extensions) PLUGIN_MAINTAINER= opensource@sunnyvalley.io PLUGIN_WWW= https://www.sunnyvalley.io From 360eb16b0f445aa4caaa2cb5f4972ee86d077370 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Feb 2021 10:38:02 +0100 Subject: [PATCH 0411/3088] sysutils: revision bump --- sysutils/api-backup/Makefile | 1 + sysutils/apuled/Makefile | 1 + sysutils/boot-delay/Makefile | 1 + sysutils/dmidecode/Makefile | 1 + sysutils/git-backup/Makefile | 11 ++++++----- sysutils/hw-probe/Makefile | 1 + sysutils/lcdproc-sdeclcd/Makefile | 1 + sysutils/mail-backup/Makefile | 1 + sysutils/munin-node/Makefile | 1 + sysutils/node_exporter/Makefile | 1 + sysutils/nut/Makefile | 1 + sysutils/smart/Makefile | 2 +- sysutils/virtualbox/Makefile | 1 + sysutils/vmware/Makefile | 1 + sysutils/xen/Makefile | 1 + 15 files changed, 20 insertions(+), 6 deletions(-) diff --git a/sysutils/api-backup/Makefile b/sysutils/api-backup/Makefile index 418499d5e0..d1a243984a 100644 --- a/sysutils/api-backup/Makefile +++ b/sysutils/api-backup/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= api-backup PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Provide the functionality to download the config.xml PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/sysutils/apuled/Makefile b/sysutils/apuled/Makefile index 4ecabf7214..7dc896fa79 100644 --- a/sysutils/apuled/Makefile +++ b/sysutils/apuled/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= apuled PLUGIN_VERSION= 0.2 +PLUGIN_REVISION= 1 PLUGIN_DEVEL= yes PLUGIN_COMMENT= PC Engine APU LED control PLUGIN_MAINTAINER= julio@cloudfence.com.br diff --git a/sysutils/boot-delay/Makefile b/sysutils/boot-delay/Makefile index be3331711f..38582b59c0 100644 --- a/sysutils/boot-delay/Makefile +++ b/sysutils/boot-delay/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= boot-delay PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Apply a persistent 10 second boot delay PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/sysutils/dmidecode/Makefile b/sysutils/dmidecode/Makefile index 55c0cc39e7..428d1621a2 100644 --- a/sysutils/dmidecode/Makefile +++ b/sysutils/dmidecode/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= dmidecode PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Display hardware information on the dashboard PLUGIN_DEPENDS= dmidecode PLUGIN_MAINTAINER= evbevz@gmail.com diff --git a/sysutils/git-backup/Makefile b/sysutils/git-backup/Makefile index 2948e1fb12..da33116f5d 100644 --- a/sysutils/git-backup/Makefile +++ b/sysutils/git-backup/Makefile @@ -1,7 +1,8 @@ -PLUGIN_NAME= git-backup -PLUGIN_VERSION= 1.0 -PLUGIN_COMMENT= Track config changes using git -PLUGIN_DEPENDS= git -PLUGIN_MAINTAINER= ad@opnsense.org +PLUGIN_NAME= git-backup +PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 +PLUGIN_COMMENT= Track config changes using git +PLUGIN_DEPENDS= git +PLUGIN_MAINTAINER= ad@opnsense.org .include "../../Mk/plugins.mk" diff --git a/sysutils/hw-probe/Makefile b/sysutils/hw-probe/Makefile index eaf0ab3b23..34b17c90bb 100644 --- a/sysutils/hw-probe/Makefile +++ b/sysutils/hw-probe/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= hw-probe PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Collect hardware diagnostics PLUGIN_DEPENDS= hw-probe PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/sysutils/lcdproc-sdeclcd/Makefile b/sysutils/lcdproc-sdeclcd/Makefile index 94a4eabe55..a709853da7 100644 --- a/sysutils/lcdproc-sdeclcd/Makefile +++ b/sysutils/lcdproc-sdeclcd/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= lcdproc-sdeclcd PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= LCDProc for SDEC LCD devices PLUGIN_DEPENDS= lcdproc PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/sysutils/mail-backup/Makefile b/sysutils/mail-backup/Makefile index 27fa1a4fa4..fc3e7b560e 100644 --- a/sysutils/mail-backup/Makefile +++ b/sysutils/mail-backup/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= mail-backup PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Send configuration file backup by e-mail PLUGIN_DEPENDS= gnupg phpmailer PLUGIN_MAINTAINER= machadovilaca@gmail.com diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile index 4540d03cc2..9012e10407 100644 --- a/sysutils/munin-node/Makefile +++ b/sysutils/munin-node/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= munin-node PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Munin monitorin agent PLUGIN_DEPENDS= munin-node PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/sysutils/node_exporter/Makefile b/sysutils/node_exporter/Makefile index a6cc24adbb..0252194203 100644 --- a/sysutils/node_exporter/Makefile +++ b/sysutils/node_exporter/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= node_exporter PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Prometheus exporter for machine metrics PLUGIN_DEPENDS= node_exporter PLUGIN_MAINTAINER= dharrigan@gmail.com diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index 2262b7e182..52fe1c9c98 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= nut PLUGIN_VERSION= 1.7 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Network UPS Tools PLUGIN_DEPENDS= nut PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/sysutils/smart/Makefile b/sysutils/smart/Makefile index 1f10056065..a02589a0be 100644 --- a/sysutils/smart/Makefile +++ b/sysutils/smart/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= smart PLUGIN_VERSION= 2.1 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= SMART tools PLUGIN_DEPENDS= smartmontools PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/sysutils/virtualbox/Makefile b/sysutils/virtualbox/Makefile index 54bfb253e4..19a947dbc8 100644 --- a/sysutils/virtualbox/Makefile +++ b/sysutils/virtualbox/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= virtualbox PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= VirtualBox guest additions PLUGIN_DEPENDS= virtualbox-ose-additions-nox11 PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/sysutils/vmware/Makefile b/sysutils/vmware/Makefile index cc2eda97b0..307d0f9bf7 100644 --- a/sysutils/vmware/Makefile +++ b/sysutils/vmware/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= vmware PLUGIN_VERSION= 1.5 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= VMware tools PLUGIN_DEPENDS= open-vm-tools-nox11 PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/sysutils/xen/Makefile b/sysutils/xen/Makefile index 8d73803559..a807b5b1c3 100644 --- a/sysutils/xen/Makefile +++ b/sysutils/xen/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= xen PLUGIN_VERSION= 1.2 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Xen guest utilities PLUGIN_DEPENDS= xe-guest-utilities PLUGIN_MAINTAINER= franco@opnsense.org From ff935d691d2f3b194d9082b192d5c6fc2ffee205 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Feb 2021 10:39:22 +0100 Subject: [PATCH 0412/3088] benchmarks|databases|devel: revision bump --- benchmarks/iperf/Makefile | 1 + databases/redis/Makefile | 1 + devel/debug/Makefile | 1 + devel/grid_example/Makefile | 1 + devel/helloworld/Makefile | 1 + 5 files changed, 5 insertions(+) diff --git a/benchmarks/iperf/Makefile b/benchmarks/iperf/Makefile index e32555da33..4c72430699 100644 --- a/benchmarks/iperf/Makefile +++ b/benchmarks/iperf/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= iperf PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Connection speed tester PLUGIN_DEPENDS= iperf3 ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/databases/redis/Makefile b/databases/redis/Makefile index 35faf0478c..c633518201 100644 --- a/databases/redis/Makefile +++ b/databases/redis/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= redis PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Redis DB PLUGIN_DEPENDS= redis PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/devel/debug/Makefile b/devel/debug/Makefile index 1f821dd593..13fe7f3d9b 100644 --- a/devel/debug/Makefile +++ b/devel/debug/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= debug PLUGIN_VERSION= 1.3 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Debugging Tools PLUGIN_DEPENDS= php${PLUGIN_PHP}-pear-PHP_CodeSniffer \ php${PLUGIN_PHP}-pecl-xdebug \ diff --git a/devel/grid_example/Makefile b/devel/grid_example/Makefile index dfc4cf776d..3b7bda5db9 100644 --- a/devel/grid_example/Makefile +++ b/devel/grid_example/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= grid_example PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= A sample framework application PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/devel/helloworld/Makefile b/devel/helloworld/Makefile index de639c35d5..bf22cc416b 100644 --- a/devel/helloworld/Makefile +++ b/devel/helloworld/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= helloworld PLUGIN_VERSION= 1.3 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= A sample framework application PLUGIN_MAINTAINER= ad@opnsense.org From b6bbd6a32e60e55f6cddb62598853645ee644922 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 15 Feb 2021 21:57:56 +0100 Subject: [PATCH 0413/3088] security/acme-client: fix OCSP setting not honored, closes #2234 --- security/acme-client/pkg-descr | 1 + .../OPNsense/AcmeClient/LeCertificate.php | 1 + .../OPNsense/AcmeClient/.AcmeClient.xml.swp | Bin 0 -> 16384 bytes 3 files changed, 2 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/.AcmeClient.xml.swp diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 2d89753b0a..213eb1121d 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -17,6 +17,7 @@ Fixed: * fix missing "--ecc" parameter when renewing ECC certs (#2223) * fix log file location (#2227) * fix GUI log formatting (by using the syslog log) +* fix OCSP setting not honored (#2234) Changed: * let acme.sh log through syslog diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index 8e0be409ee..6855acb3b1 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -656,6 +656,7 @@ public function setValidation() $val->setNames($this->config->name, $this->config->altNames, $this->config->aliasmode, $this->config->domainalias, $this->config->challengealias); $val->setRenewal((int)$this->config->renewInterval); $val->setForce($this->force); + $val->setOcsp((string)$this->config->ocsp == 1 ? true : false); // strip prefix from key value $val->setKey(substr($this->config->keyLength, 4)); $val->prepare(); diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/.AcmeClient.xml.swp b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/.AcmeClient.xml.swp new file mode 100644 index 0000000000000000000000000000000000000000..cb9344443839d7d3a58e6d925c166511fd93baf8 GIT binary patch literal 16384 zcmeI3Uu+yl9mgk>HYu%B6hK1aWs)?FP2yeKu_ISZH*rj&B#N8JP9p`Man`$Y=Oz2+ zx;yJXO#@PqkZ6hu4^)**Zy=;t0JQn%uwW=t0$wIDYi18&@1Z(j#ugp(9px)AIPB?Qaj`%jIWRIjB(>eWYbX88j)y)j ziWhno7AP!GSfH>#VS&N|g#`)=6c#8f01JrfcJd9JKcTE~UY)lzo&TqfEMxdell(&^ zKdH*EHpxFw@-wRZMw9$~B|oOhPpA%L{rInvA6D`wo8kCb^{+O`|J5Ylaa&q3YyaJ*`#VS&N|g#`)=FqT-IgN{NdOMxotei^tI0o%_P;l*cDFI z<+9q^=hkZHOxLlK4o&eWGArCjI>>E$eBzAMf<{SSs2>Pg4r1TdnBIC(Yr}e?ZEOFN z&f#?tsbG{ZPO8{WRCUc&!#6$7^z2*9ePmsEFh_7NGE}=-dS-fBN|Gu$zgQH+p~a2t zWfV;*ot>GkD&)4n+G@dal+VIqCi892Q88i3z_~S|!c6+I$x)Fuy7^I|+SStY&5nw; zT6BtviOjbfhziUpx57j*F?nj! z7kgNEVs4Bd934VG8_F6wD`$E(<@mKrhGqTwg4X((+6QIZ*_VcDtWg`Ke_|0H=C9}0 zqUpNaukbTLxLN8S92+|@)~os>qg@+d^uXA7TN5-W)QttWzvP60@8NyW9QW&|t8z_C z{Mu%yvq)5o8DZiz(+WLWYYl5N1Pu;?+mnM~|79E4zSwcPOx0aRXO(Z~n4VN4>Y}w1 z>)a=n#fH4PO{B=SY9p_0XtO%wC|joY&JU)Cs@SRVNm#R0?b_WsZwp(uZrOg%Lc5zh ze?J`an746jVj{ilxT51eFsT-V4!m#ZwfBQ{rmI3CYvdhl-L_e_tF(D!g-#NQ-ETF& z7A!;>e)YbNNDpfA*E-wFcIL}nLu$dHBB_gP!;D2R&3(RXx}74bZTw2JuMLOcHe-R+ z-9>e+P07!yd4@aj9K zr?}V~VS=*4)vBQBd-2jFwW{gGGVj5ZXN+h=8oHQ$O@$sZEMe$*Z^t8zON4}ZGLJNf z%>VZx2c49;DDwa8@5`?v$A1Pq0;a%y;5u^qYv89K1}DK6z*Xe-SHK(?0k?yz$nC!e zEHDnXfgd5K{}wn42EYyE^4|v$cmV7GzeFByfme~YKMgD}4*raM{oCL#$j@H`SHJ~u zC-^yX^Si-2$j6@pkAZ#QP2}MkxDEUsx%czn2-po?hrZ8%$AAmYgHu4-;RxvAkTy+h zDPyf=AT#_kgIt}OX0WU{Cqi{A@XJmmCwP+^tflK6=jfzr>pVTfU2X|#QY-L0)3<3k z3_L0pIdz>#beENl=Q*yRDt(Jj$0J5YbLpQM>Gr5dG^sbSMJDaup=rOSsk zeQCVClnTg*tO9zqCwqq zfs19%eL9?U4fdzdTWO-@D$hJKx@aWcoh|95(%isoX}M(2mj(}OCH>OnJ((l>58daA zFYQ#7?$u)l!$w}4-)wh5&e}Lix%(_%5#2i3GV^66Eyan6o_)^3F2SI=jC5V+t{az=YxrE+{Tu7_ Date: Mon, 15 Feb 2021 22:11:16 +0100 Subject: [PATCH 0414/3088] security/acme-client: add tooltips for certificate command buttons, closes #2188 --- security/acme-client/pkg-descr | 1 + .../views/OPNsense/AcmeClient/certificates.volt | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 213eb1121d..f830046bf5 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -12,6 +12,7 @@ Plugin Changelog Added: * add new page to show AcmeClient entries from system log +* add tooltips for certificate command buttons (#2188) Fixed: * fix missing "--ecc" parameter when renewing ECC certs (#2223) diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt index 2d172eb017..c30891a762 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt @@ -59,13 +59,13 @@ POSSIBILITY OF SUCH DAMAGE. url: '/api/acmeclient/certificates/search', formatters: { "commands": function (column, row) { - return " " + - "" + - "" + - "" + - "" + - "" + - ""; + return " " + + "" + + "" + + "" + + "" + + "" + + ""; }, "rowtoggle": function (column, row) { if (parseInt(row[column.id], 2) == 1) { From 429eda9b1c2c21cfd47ee7b50ed286b2d393b071 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 15 Feb 2021 22:25:22 +0100 Subject: [PATCH 0415/3088] security/acme-client: remove temp file --- .../OPNsense/AcmeClient/.AcmeClient.xml.swp | Bin 16384 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/.AcmeClient.xml.swp diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/.AcmeClient.xml.swp b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/.AcmeClient.xml.swp deleted file mode 100644 index cb9344443839d7d3a58e6d925c166511fd93baf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI3Uu+yl9mgk>HYu%B6hK1aWs)?FP2yeKu_ISZH*rj&B#N8JP9p`Man`$Y=Oz2+ zx;yJXO#@PqkZ6hu4^)**Zy=;t0JQn%uwW=t0$wIDYi18&@1Z(j#ugp(9px)AIPB?Qaj`%jIWRIjB(>eWYbX88j)y)j ziWhno7AP!GSfH>#VS&N|g#`)=6c#8f01JrfcJd9JKcTE~UY)lzo&TqfEMxdell(&^ zKdH*EHpxFw@-wRZMw9$~B|oOhPpA%L{rInvA6D`wo8kCb^{+O`|J5Ylaa&q3YyaJ*`#VS&N|g#`)=FqT-IgN{NdOMxotei^tI0o%_P;l*cDFI z<+9q^=hkZHOxLlK4o&eWGArCjI>>E$eBzAMf<{SSs2>Pg4r1TdnBIC(Yr}e?ZEOFN z&f#?tsbG{ZPO8{WRCUc&!#6$7^z2*9ePmsEFh_7NGE}=-dS-fBN|Gu$zgQH+p~a2t zWfV;*ot>GkD&)4n+G@dal+VIqCi892Q88i3z_~S|!c6+I$x)Fuy7^I|+SStY&5nw; zT6BtviOjbfhziUpx57j*F?nj! z7kgNEVs4Bd934VG8_F6wD`$E(<@mKrhGqTwg4X((+6QIZ*_VcDtWg`Ke_|0H=C9}0 zqUpNaukbTLxLN8S92+|@)~os>qg@+d^uXA7TN5-W)QttWzvP60@8NyW9QW&|t8z_C z{Mu%yvq)5o8DZiz(+WLWYYl5N1Pu;?+mnM~|79E4zSwcPOx0aRXO(Z~n4VN4>Y}w1 z>)a=n#fH4PO{B=SY9p_0XtO%wC|joY&JU)Cs@SRVNm#R0?b_WsZwp(uZrOg%Lc5zh ze?J`an746jVj{ilxT51eFsT-V4!m#ZwfBQ{rmI3CYvdhl-L_e_tF(D!g-#NQ-ETF& z7A!;>e)YbNNDpfA*E-wFcIL}nLu$dHBB_gP!;D2R&3(RXx}74bZTw2JuMLOcHe-R+ z-9>e+P07!yd4@aj9K zr?}V~VS=*4)vBQBd-2jFwW{gGGVj5ZXN+h=8oHQ$O@$sZEMe$*Z^t8zON4}ZGLJNf z%>VZx2c49;DDwa8@5`?v$A1Pq0;a%y;5u^qYv89K1}DK6z*Xe-SHK(?0k?yz$nC!e zEHDnXfgd5K{}wn42EYyE^4|v$cmV7GzeFByfme~YKMgD}4*raM{oCL#$j@H`SHJ~u zC-^yX^Si-2$j6@pkAZ#QP2}MkxDEUsx%czn2-po?hrZ8%$AAmYgHu4-;RxvAkTy+h zDPyf=AT#_kgIt}OX0WU{Cqi{A@XJmmCwP+^tflK6=jfzr>pVTfU2X|#QY-L0)3<3k z3_L0pIdz>#beENl=Q*yRDt(Jj$0J5YbLpQM>Gr5dG^sbSMJDaup=rOSsk zeQCVClnTg*tO9zqCwqq zfs19%eL9?U4fdzdTWO-@D$hJKx@aWcoh|95(%isoX}M(2mj(}OCH>OnJ((l>58daA zFYQ#7?$u)l!$w}4-)wh5&e}Lix%(_%5#2i3GV^66Eyan6o_)^3F2SI=jC5V+t{az=YxrE+{Tu7_ Date: Tue, 16 Feb 2021 15:17:29 +0100 Subject: [PATCH 0416/3088] plugins: style sweep --- .../src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 8 ++++---- .../OPNsense/Quagga/Api/DiagnosticsController.php | 4 ++-- .../app/library/OPNsense/AcmeClient/LeCertificate.php | 8 ++++---- www/nginx/src/opnsense/scripts/nginx/setup.php | 11 ++++++----- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index df3cb8ce1e..67c250a3a0 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -883,11 +883,11 @@ class updatedns case 'gratisdns': $server = "https://admin.gratisdns.com/ddns.php"; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - if(substr_count($this->_dnsHost, ".") < 2) { - $domain = $this->_dnsHost; - $hostname = $this->_dnsHost; + if (substr_count($this->_dnsHost, ".") < 2) { + $domain = $this->_dnsHost; + $hostname = $this->_dnsHost; } else { - list($hostname, $domain) = explode(".", $this->_dnsHost, 2); + list($hostname, $domain) = explode(".", $this->_dnsHost, 2); } curl_setopt($ch, CURLOPT_URL, $server . '?u=' . urlencode($this->_dnsUser) . '&p=' . $this->_dnsPass . '&h=' . $this->_dnsHost . '&d=' . $domain . '&i=' . $this->_dnsIP); break; diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php index 7426a5f53e..a92a3d8e05 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/DiagnosticsController.php @@ -44,7 +44,7 @@ class DiagnosticsController extends ApiControllerBase private function getInformation(string $daemon, string $name, string $format): array { $backend = new Backend(); - $response = $backend->configdRun("quagga diagnostics ".$daemon."_".$name.($format === "json" ? "_json" : "")); + $response = $backend->configdRun("quagga diagnostics " . $daemon . "_" . $name . ($format === "json" ? "_json" : "")); return array("response" => ($format === "json" ? json_decode($response) : $response)); } @@ -60,7 +60,7 @@ public function generalrouteAction($format = "json"): array if ($format === "json") { return array("response" => array("ipv4" => $routes4, "ipv6" => $routes6)); } else { - return array("response" => $routes4.$routes6); + return array("response" => $routes4 . $routes6); } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index 6855acb3b1..97b4d2364e 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -344,11 +344,11 @@ public function issue() // Check if called by auto renewal process. if (($acme_action == 'renew') and ($this->cron == 1) and ($auto_renewal == 0)) { - LeUtils::log('auto renewal is globally disabled, skipping certificate: ' . (string)$this->config->name); - return false; + LeUtils::log('auto renewal is globally disabled, skipping certificate: ' . (string)$this->config->name); + return false; } elseif (($acme_action == 'renew') and ($this->cron == 1) and ((string)$this->config->autoRenewal == 0)) { - LeUtils::log('auto renewal is disabled for certificate: ' . (string)$this->config->name); - return false; + LeUtils::log('auto renewal is disabled for certificate: ' . (string)$this->config->name); + return false; } LeUtils::log("${acme_action} certificate: " . (string)$this->config->name); diff --git a/www/nginx/src/opnsense/scripts/nginx/setup.php b/www/nginx/src/opnsense/scripts/nginx/setup.php index 8623106bd8..d8452c804b 100755 --- a/www/nginx/src/opnsense/scripts/nginx/setup.php +++ b/www/nginx/src/opnsense/scripts/nginx/setup.php @@ -200,13 +200,14 @@ function find_ca($refid) $cas = array(); $carefs = explode(",", $upstream['tls_trusted_certificate']); foreach ($carefs as $caref) { - $ca = find_ca($caref); - if (isset($ca)) { - $cas[] = base64_decode($ca['crt']); - } + $ca = find_ca($caref); + if (isset($ca)) { + $cas[] = base64_decode($ca['crt']); + } } export_pem_file( - '/usr/local/etc/nginx/key/trust_upstream_' . $upstream_uuid . '.pem','', + '/usr/local/etc/nginx/key/trust_upstream_' . $upstream_uuid . '.pem', + '', implode("\n", $cas) ); } From 41147352172bcf3da69ffc291277fe7be6b94a1b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Feb 2021 15:21:09 +0100 Subject: [PATCH 0417/3088] dns/dyndns: bump revision --- dns/dyndns/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 71ce6cee70..451840d028 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.23 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From 1cb7f4640b8e13e38a882db62bdedf13ab43d269 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Feb 2021 15:22:23 +0100 Subject: [PATCH 0418/3088] LICENSE: sync --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e045225ed3..7079730ae9 100644 --- a/LICENSE +++ b/LICENSE @@ -24,7 +24,7 @@ Copyright (c) 2020 Marc Leuser Copyright (c) 2020 Martin Wasley Copyright (c) 2017-2020 Michael Muenz Copyright (c) 2004-2012 Scott Ullrich -Copyright (c) 2010-2012 Seth Mos +Copyright (c) 2010 Seth Mos Copyright (c) 2008 Shrew Soft Inc. Copyright (c) 2017-2019 Smart-Soft Copyright (c) 2013 Stanley P. Miller \ stan-qaz From 70afeb30954aafa2c0c5600fa24cdde074a217d4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Feb 2021 15:24:32 +0100 Subject: [PATCH 0419/3088] dns: bump revision --- dns/bind/Makefile | 1 + dns/dnscrypt-proxy/Makefile | 2 +- dns/rfc2136/Makefile | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 96f13f860c..e16959f8e3 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= bind PLUGIN_VERSION= 1.16 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/dnscrypt-proxy/Makefile b/dns/dnscrypt-proxy/Makefile index e120fa9126..54b2cc4b25 100644 --- a/dns/dnscrypt-proxy/Makefile +++ b/dns/dnscrypt-proxy/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= dnscrypt-proxy PLUGIN_VERSION= 1.8 -PLUGIN_REVISIOM= 1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Flexible DNS proxy supporting DNSCrypt and DoH PLUGIN_DEPENDS= dnscrypt-proxy2 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/rfc2136/Makefile b/dns/rfc2136/Makefile index 39ebb08552..c186e4856d 100644 --- a/dns/rfc2136/Makefile +++ b/dns/rfc2136/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= rfc2136 PLUGIN_VERSION= 1.6 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= RFC-2136 Support PLUGIN_MAINTAINER= franco@opnsense.org PLUGIN_DEPENDS= bind-tools From c1f19dc659e1a6a5cbc454c6025ef9ce9a34808e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Feb 2021 15:29:12 +0100 Subject: [PATCH 0420/3088] security/tor: bump revision --- security/tor/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/tor/Makefile b/security/tor/Makefile index 32b6d40eb2..e13b2366cd 100644 --- a/security/tor/Makefile +++ b/security/tor/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= tor PLUGIN_VERSION= 1.8 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= The Onion Router PLUGIN_DEPENDS= tor ruby PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From 33b855d5f51348e2c8ff63e9f7265ce7de05f096 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Feb 2021 15:31:45 +0100 Subject: [PATCH 0421/3088] net/frr: bump revision --- net/frr/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 880012ffc5..9172a4a4ab 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.21 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From bd5817d5926ab94cab2c3a7f875538fbdc9b7122 Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Tue, 16 Feb 2021 17:28:25 +0100 Subject: [PATCH 0422/3088] get current state from local and remote --- .../OPNsense/HAProxy/lib/haproxy/cmds.py | 8 +- .../scripts/OPNsense/HAProxy/socketCommand.py | 3 +- .../scripts/OPNsense/HAProxy/syncCerts.py | 252 ++++++++++++++++++ .../templates/OPNsense/HAProxy/sslCerts.yaml | 2 +- 4 files changed, 258 insertions(+), 7 deletions(-) create mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py index 3d13d42a82..81e8b3351a 100644 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py @@ -145,10 +145,10 @@ def getResultObj(self, res): for line in res.split("\n"): if line.startswith('# '): list_id = line.split("# ")[1] - result[f"{list_id}"] = [] + result["certs"] = [] if list_id and line.startswith('/'): - result[f"{list_id}"].append(line) + result["certs"].append(line) if result: return result @@ -186,10 +186,9 @@ def getResultObj(self, res): if key == 'Filename': cert_id = val - result[f"{cert_id}"] = {} if cert_id: - result[f"{cert_id}"][key] = val + result[key] = val if result: return result @@ -261,6 +260,7 @@ def _getResult(self, res): for e in lines: me = re.match(cl, e) if me: + print(e) result.append(e.split(",")[0]) return result diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py index 11a084f856..fd9b438c0a 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py @@ -51,7 +51,7 @@ def get_args(): ) parser.add_argument( '--server-ids', - help='Attempt action on a list of server, specified as a comma seperated list e.g. back1/server1,back2/server3', + help='Attempt action on a list of server, specified as a comma separated list e.g. back1/server1,back2/server3', default=None ) parser.add_argument( @@ -142,7 +142,6 @@ def get_args(): if result: print(f"{server_id}: {result.strip()}") con.close() - else: # single con = HaPConn(SOCKET) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py new file mode 100755 index 0000000000..7b3d09bbc2 --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python3 +# Sync ssl certificates from a yaml file into haproxy memory +import os +import sys +import argparse +import traceback +import yaml +import ssl +from io import StringIO +import base64 +import OpenSSL + + +sys.path.append(os.path.join(os.path.dirname(__file__), 'lib')) +from haproxy.conn import HaPConn +from haproxy import cmds + + +class Diff: + def __init__(self, local=None, remote=None): + if local is None: + local = [] + if remote is None: + remote = [] + + self.local = local + self.remote = remote + self.state = str(self) + + def show_state(self): + """ Shows current local and remote state """ + print("## STATE ##") + print(str(self)) + + def show_diff(self): + """ Shows what will be synced to target """ + print("## DIFF ##") + print("TODO: Show the diff") + + def sync(self): + print("## SYNC ##") + print("TODO: Sync to target") + + def __iter__(self): + return iter(self.local) + + def __str__(self): + result = "" + for item in self: + result += f"{str(item)}\n" + return result + + +class SyncWithTarget: + """ Base class for sync objects to a target """ + def __init__(self, socket='/var/run/haproxy.socket'): + self.socket = socket + + def execute_remote_cmd(self, command_class, **command_args): + con = HaPConn(self.socket) + if con: + result = con.sendCmd(command_class(**command_args), objectify=True) + con.close() + return result + + def get_remote_state(self, command_class, **command_args): + return self.execute_remote_cmd(command_class, **command_args) + + +class CertList(SyncWithTarget): + """ Represents a haproxy ssl-crt-list """ + def __init__(self, path, certs=None): + super().__init__() + if certs is None: + certs = [] + self.path = path + self.certs = certs + self.local = self.get_local_state() + self.remote = self.get_remote_state(cmds.showSslCrtList, crt_list=self.path) + + def __iter__(self): + return iter(self.local) + + def __str__(self): + result = f"CRT LIST: {self.path}\n" + result += f" LOCAL: {self.local}\n" + result += f" REMOTE: {self.remote}\n" + for cert in self.certs: + result += f"\n{str(cert)}\n" + return result + + def get_local_state(self): + return [f"{repr(cert)}" for cert in self.certs] + + def get_remote_state(self, command_class, **command_args): + crt_list_data = super().get_remote_state(command_class, **command_args) + return crt_list_data.get('certs', {}) + + +class Cert(SyncWithTarget): + """ Represents a haproxy ssl-cert """ + def __init__(self, path, pem): + super().__init__() + self.path = path + self.pem = pem + self.local = self.get_local_state() + self.remote = self.get_remote_state(cmds.showSslCert, certfile=self.path) + + def __repr__(self): + return self.path + + def __str__(self): + result = f" CERT: {self.path}" + result += f"\n LOCAL: {self.local}" + result += f"\n REMOTE: {self.remote}" + return result + + def get_cert_data(self, dump=False, encoding='utf-8'): + result = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, self.pem) + if dump: + result = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_TEXT, result).decode(encoding) + return result + + def glue(self, components): + return "".join("/{0:s}={1:s}".format(name.decode(), value.decode()) for name, value in components) + + def get_local_state(self): + cert_obj = self.get_cert_data() + return { + "Serial": '%.2x' % cert_obj.get_serial_number(), + "Subject": self.glue(cert_obj.get_subject().get_components()), + "Issuer": self.glue(cert_obj.get_issuer().get_components()) + } + + def get_remote_state(self, command_class, **command_args): + cert_data = super().get_remote_state(command_class, **command_args) + if 'error' in cert_data: + return {} + return { + "Serial": cert_data['Serial'], + "Subject": cert_data['Subject'], + "Issuer": cert_data['Issuer'] + } + +def dict_from_yaml(path): + with open(path, 'r') as yaml_file: + data = yaml.load(yaml_file, Loader=yaml.SafeLoader) + return data + + +def skip_frontend(frontend_id, frontend): + filter_frontend_names = list(filter(None, args.frontends.split(","))) + filter_frontend_ids = list(filter(None, args.frontend_ids.split(","))) + + skip_id = False + if filter_frontend_names and frontend['name'] not in filter_frontend_names: + skip_id = True + + skip_name = False + if filter_frontend_ids and frontend_id not in filter_frontend_ids: + skip_name = True + + return skip_id and skip_name + + +def get_cert_data(cert, dump=False, encoding='utf-8'): + if os.path.isfile(cert): + cert = open(cert).read() + + cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert) + if dump: + cert = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_TEXT, cert).decode(encoding) + + return cert + + +def base64_decode(base64_str, encoding='utf-8'): + if base64_str: + base64_bytes = base64_str.encode(encoding) + message_bytes = base64.b64decode(base64_bytes) + message = message_bytes.decode(encoding) + return message + return '' + +def get_args(): + # noinspection PyTypeChecker + parser = argparse.ArgumentParser( + description=""" + Sync ssl certificates into HAProxy’s memory with certificates read from a configfile. If no frontend filter is + given, all certificates will be synced.""", + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + parser.add_argument( + '--config', + help='Path to the ssl certificate information configfile.', + default="/usr/local/etc/haproxy/sslCerts.yaml" + ) + parser.add_argument( + '--frontends', + help='Attempt action on a list of frontend names, specified as a comma separated list.', + default="" + ) + parser.add_argument( + '--frontend_ids', + help='Attempt action on a list of frontend ids, specified as a comma separated list.', + default="" + ) + parser.add_argument( + '--output', + help='Specify output format.', + choices=['json', 'raw'], + default="raw" + ) + parser.add_argument( + '--debug', + type=bool, + help='Show debug output.', + default=False + ) + return parser.parse_args() + + +args = get_args() +config = dict_from_yaml(args.config) + +""" Get ssl crt-list with certificates from configfile""" +crt_lists = [] +for frontend_id, frontend in config['frontends'].items(): + if skip_frontend(id, frontend_id): + continue + + certs = [] + for cert_id, cert_data in frontend['certs'].items(): + crt = base64_decode(cert_data['crt']) + key = base64_decode(cert_data['key']) + ca = base64_decode(cert_data['ca']) + full_cert = crt + key + ca + + certs.append(Cert(path=cert_data['path'], pem=full_cert)) + + crt_lists.append(CertList(path=frontend['crt_list_path'], certs=certs)) + +""" Sync ssl certs from configfile to HaProxy """ +diff = Diff(local=crt_lists) +diff.show_state() +diff.show_diff() +diff.sync() + + +#print(crt_lists) +#print(diff) +#diff.sync() diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml index 0b98ab5e15..56fed45739 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml @@ -47,7 +47,7 @@ frontends: {% for frontend in enabled_frontends %} "{{ frontend.id }}": name: {{ frontend.name }} - crt_list_path: {{ cert_template % frontend.id }} + crt_list_path: {{ crt_list_template % frontend.id }} certs: {% for cert_refid in frontend.certs %} {{ cert_refid }}: From c9e718f6c82b302f1d29cf38bc2c135fc7d3f555 Mon Sep 17 00:00:00 2001 From: jkellerer Date: Sun, 21 Feb 2021 23:05:42 +0100 Subject: [PATCH 0423/3088] Nginx: Refactored "ngx_autoblock" to reduce cpu consumption (#1773) * Nginx/Autoblock: Refactored "ngx_autoblock.php" to reduce resource & cpu consumption. Also fixed issues: - $is_ten_minutes triggered always except every 10 minutes. - IPs are not just added but also removed (fixes race conditions between UI and script-invocation). * Nginx/Autoblock: Fixed errors caused by concurrent invocation. Improved resilience against calling the script while another instance is still running. --- .../opnsense/scripts/nginx/ngx_autoblock.php | 312 +++++++++++++----- 1 file changed, 238 insertions(+), 74 deletions(-) diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php b/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php index 0cd6074992..4c7b712da9 100755 --- a/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php @@ -42,6 +42,7 @@ function nginx_print_error($msg) array('status' => 'error', 'message' => $msg) ); } + function exec_hidden($command): void { $descriptorspec = array( @@ -55,110 +56,273 @@ function exec_hidden($command): void proc_close($process); } } -function add_to_blocklist($tablename, $ip) + +function modify_blocklist($tablename, array $allIps, $operation = "add"): void { - $escaped = escapeshellarg($ip); - exec_hidden("/sbin/pfctl -t ${tablename} -T add ${escaped}"); + if (empty($allIps) || !in_array($operation, ["add", "delete"])) + return; + + $tablename = escapeshellarg($tablename); + $operation = escapeshellarg($operation); + + $longestIp = array_reduce($allIps, function ($length, $ip) { + return max($length, strlen(escapeshellarg($ip))); + }, 0); + + $chunkSize = floor(4096 / ($longestIp + 1)); + $chunkSize = min(128, max(4, $chunkSize)); + + foreach (array_chunk($allIps, $chunkSize) as $ips) { + $escapedIps = join(" ", array_map("escapeshellarg", $ips)); + + exec_hidden("/sbin/pfctl -t ${tablename} -T ${operation} ${escapedIps}"); + } } +function read_all_from_blocklist($tablename) +{ + $tablename = escapeshellarg($tablename); + + $descriptorspec = [ + 1 => ['pipe', 'w'], + 2 => ['file', "/dev/null", "w"], + ]; + + $process = proc_open("/sbin/pfctl -t ${tablename} -T show", $descriptorspec, $pipes); + if (is_resource($process)) { + $ips = []; + while ($ip = fgets($pipes[1], 96)) + $ips[] = strtolower(trim($ip)); + + fclose($pipes[1]); + proc_close($process); + + return $ips; + } else { + return false; + } +} + +function get_files_lastmodified(array $files): array +{ + // Maps [file => filemtime] + // File times of special files: + // - Non existing => random mtime + // - No content => -1 + $times = []; + foreach ($files as $file) { + $mtime = @filemtime($file) ?: rand(); + $times[$file] = @filesize($file) === 0 ? -1 : $mtime; + } + return $times; +} function reopen_logs() { exec_hidden('/usr/local/sbin/nginx -s reopen'); } -$permanent_ban_file = '/var/log/nginx/permanentban.access.log'; -$permanent_ban_file_work = $permanent_ban_file . '.work'; -$autoblock_alias_name = 'nginx_autoblock'; -define('CRON_RUN_TEN_MINUTES', 10); -$is_ten_minutes = intval(date('i')) % CRON_RUN_TEN_MINUTES != 0; +const STATE_FILE = '/tmp/ngx_autoblock.state.json'; +const CONFIG_FILE = '/conf/config.xml'; +const PERMANENT_BAN_FILE = '/var/log/nginx/permanentban.access.log'; +const PERMANENT_BAN_FILE_WORK = PERMANENT_BAN_FILE . '.work'; + +const TLS_HANDSHAKE_FILE = '/var/log/nginx/tls_handshake.log'; +const TLS_HANDSHAKE_FILE_WORK = TLS_HANDSHAKE_FILE . '.work'; +const TLS_HANDSHAKE_PROCESSING_TASK = '/usr/local/opnsense/scripts/nginx/tls_ua_fingerprint.php'; + +const AUTOBLOCK_ALIAS_NAME = 'nginx_autoblock'; + +const CRON_RUN_TEN_MINUTES = 10; +$is_ten_minutes = intval(date('i')) % CRON_RUN_TEN_MINUTES == 0; + +// Move log files and inform Nginx that we deleted them +function create_work_files($include_tls_handshake) +{ + $mapping = [PERMANENT_BAN_FILE => PERMANENT_BAN_FILE_WORK]; + if ($include_tls_handshake) { + $mapping[TLS_HANDSHAKE_FILE] = TLS_HANDSHAKE_FILE_WORK; + } + + $existing_sources = array_filter(array_keys($mapping), "file_exists"); + $work_files = []; + + if (count($existing_sources) == count($mapping)) { + foreach ($mapping as $source => $target) { + // Check if we already processing $target in another process and skip it if not stale + if (file_exists($target)) { + if (time() - (@filemtime($target) ?: 0) > (5 * 60)) + @unlink($target); + else + continue; + } + + // Try to create work and log on failure + if (@rename($source, $target)) { + @touch($target); + $work_files[] = $target; + } else { + log_error("Failed renaming '$source' to '$target'. Skipping source for next run."); + } + } + } else { + //Concurrent invocation. Can be silently ignored since no work files are collected. + //log_error("Skipping processing. Missing: " . join(", ", array_diff(array_keys($mapping), $existing_sources))); + } -if (!file_exists($permanent_ban_file)) { - nginx_print_error('No Log exists - nothing to do'); - // let create it reopen_logs(); - exit(0); -} + register_shutdown_function("cleanup_work_files", $work_files); -// move the file, and inform nginx that we deleted the file -rename($permanent_ban_file, $permanent_ban_file_work); -if ($is_ten_minutes) { - rename('/var/log/nginx/tls_handshake.log', '/var/log/nginx/tls_handshake.log.work'); + return $work_files; } -reopen_logs(); -if ($is_ten_minutes) { - mwexec_bg('/usr/local/opnsense/scripts/nginx/tls_ua_fingerprint.php'); + +function cleanup_work_files($work_files) +{ + foreach ($work_files as $file) + @unlink($file); } -$log_parser = new AccessLogParser($permanent_ban_file_work); +// Checking if our sources are modified and create work files as needed (do nothing if sources are unchanged) +$work_files = (function () use ($is_ten_minutes) { + $sources = get_files_lastmodified([CONFIG_FILE, PERMANENT_BAN_FILE]); -$log_lines = $log_parser->get_result(); + $state = @json_decode(@file_get_contents(STATE_FILE), true); + $changed = empty($state) + || !isset($state["sources"]) + || $state["sources"] != $sources; -$model = new Alias(); + if ($changed || $is_ten_minutes) { + // Rename sources to ".work" and tell nginx to reopen logs. + // Triggering TLS-handshake processor every 10 minutes. + $work_files = create_work_files($is_ten_minutes); -$blacklist_element = null; -foreach ($model->aliases->alias->iterateItems() as $alias) { - if ((string)$alias->name == $autoblock_alias_name) { - if ((string)$alias->type != 'external') { - nginx_print_error('alias is misconfigured - exiting'); - exit(0); - } else { - $blacklist_element = $alias; - break; + // Store state + if (!empty($work_files)) { + if (!is_array($state)) + $state = []; + $state["sources"] = get_files_lastmodified(array_keys($sources)); + @file_put_contents(STATE_FILE, json_encode($state)); } + + return $work_files; + } else { + // Sources are not modified, nothing to do when not in "$is_ten_minutes". + exit(0); } -} +})(); -// does not exist yet, create it -if ($blacklist_element == null) { - $blacklist_element = $model->aliases->alias->Add(); - $blacklist_element->name = $autoblock_alias_name; - $blacklist_element->type = "external"; - $model->serializeToConfig(); +// Triggering TLS-handshake processor when corresponding work file exists. +if (in_array(TLS_HANDSHAKE_FILE_WORK, $work_files)) { + mwexec(TLS_HANDSHAKE_PROCESSING_TASK); } -$model = new Nginx(); -$alias_ips = []; -foreach ($model->ban->iterateItems() as $entry) { - $alias_ips[] = (string)$entry->ip; +// Abort if permanent ban file is missing +if (!in_array(PERMANENT_BAN_FILE_WORK, $work_files)) { + nginx_print_error('No Log exists - nothing to do'); + exit(0); } -$new_ips = array_unique( - array_map(function ($row) { - if (stripos($row->remote_ip, '.') !== false) { - return $row->remote_ip; +// Verifing autoblock fw-alias and adding it if missing +(function () { + $model = new Alias(); + + $blacklist_element = null; + foreach ($model->aliases->alias->iterateItems() as $alias) { + if ((string)$alias->name == AUTOBLOCK_ALIAS_NAME) { + if ((string)$alias->type != 'external') { + nginx_print_error('alias is misconfigured - exiting'); + exit(0); + } else { + $blacklist_element = $alias; + break; + } } - // in case of IPv6, we have to use the network address instead - // danger of DoS because the attacker should have at least 2 ** 64 IPs - return Net_IPv6::getNetmask($row->remote_ip, 64) . '/64'; - }, $log_lines) -); - -$change_required = false; - -foreach (array_diff($new_ips, $alias_ips) as $new_ip) { - $entry = $model->ban->Add(); - $entry->ip = $new_ip; - $entry->time = time(); - $change_required = true; -} + } -if ($change_required) { - $val_result = $model->performValidation(false); - if (count($val_result) !== 0) { - print_r($val_result); - exit(1); + // does not exist yet, create it + if ($blacklist_element == null) { + $blacklist_element = $model->aliases->alias->Add(); + $blacklist_element->name = AUTOBLOCK_ALIAS_NAME; + $blacklist_element->type = "external"; + $model->serializeToConfig(); } +})(); + +// Getting new banned IPs list +$banned_ips = (function () { + // Reading stored banned IPs from config + $model = new Nginx(); + $alias_ips = []; + foreach ($model->ban->iterateItems() as $entry) { + $alias_ips[] = (string)$entry->ip; + } + + // Collecting all new IPs from ban file not yet in $alias_ips. + $new_ips = (function () use ($alias_ips) { + // Read IPs from the log file + $log_parser = new AccessLogParser(PERMANENT_BAN_FILE_WORK); + $log_lines = $log_parser->get_result(); + $new_ips = array_unique( + array_map(function ($row) { + if (stripos($row->remote_ip, '.') !== false) { + return $row->remote_ip; + } + // in case of IPv6, we have to use the network address instead + // danger of DoS because the attacker should have at least 2 ** 64 IPs + return Net_IPv6::getNetmask($row->remote_ip, 64) . '/64'; + }, $log_lines) + ); + + // Return only IPs not yet in $alias_ips + return array_diff($new_ips, $alias_ips); + })(); + + // Transfering new IPs into $alias_ips and store them permanently. + $new_and_alias_ips = (function () use ($model, $new_ips, $alias_ips) { + $change_required = false; + + foreach ($new_ips as $new_ip) { + $alias_ips[] = $new_ip; + + $entry = $model->ban->Add(); + $entry->ip = $new_ip; + $entry->time = time(); + $change_required = true; + } + + if ($change_required) { + $val_result = $model->performValidation(false); + if (count($val_result) !== 0) { + print_r($val_result); + exit(1); + } + + $model->serializeToConfig(); + Config::getInstance()->save(); + } + + return $alias_ips; + })(); + + // Returning banned IPs (= combination of (new_ips + alias_ips)) + return $new_and_alias_ips; +})(); - $model->serializeToConfig(); - Config::getInstance()->save(); -} echo '{"status":"saved"}'; -// all ips are used because the others may not be set for some reason -foreach ($model->ban->iterateItems() as $entry) { - add_to_blocklist($autoblock_alias_name, (string)$entry->ip); -} +// Updating PF table with banned IPs +(function () use ($banned_ips) { + $ips_to_add = $banned_ips; + $ips_to_remove = []; + + // Checking which IPs are in the table and apply changes + $ips_in_table = read_all_from_blocklist(AUTOBLOCK_ALIAS_NAME); + if (!empty($ips_in_table)) { + $ips_to_add = array_diff($banned_ips, $ips_in_table); + $ips_to_remove = array_diff($ips_in_table, $banned_ips); + } -@unlink($permanent_ban_file_work); + modify_blocklist(AUTOBLOCK_ALIAS_NAME, $ips_to_add, "add"); + modify_blocklist(AUTOBLOCK_ALIAS_NAME, $ips_to_remove, "delete"); +})(); From 4b7238cbc22e8e4985282918a83d61cce502c5fb Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Sun, 21 Feb 2021 23:21:56 +0100 Subject: [PATCH 0424/3088] www/nginx: add release note for nginx autoban feature --- www/nginx/Makefile | 2 +- www/nginx/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index c9df402b35..4964118c00 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.20 +PLUGIN_VERSION= 1.21 PLUGIN_REVISION= 2 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 7940a98286..f4dc18e6a1 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -8,6 +8,10 @@ reuse, SSL offload and HTTP media streaming. Plugin Changelog ================ +1.21 + +* fix performance issue with autoban feature (contributed by jkellerer) + 1.20 * User interface improvements of NAXSI configuration (contributed by 8191) From cdd4d15db74a0f4c9489e0c3b82d8fdd4f25cbd5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 22 Feb 2021 15:14:03 +0100 Subject: [PATCH 0425/3088] security: bump revision numbers --- security/clamav/Makefile | 1 + security/etpro-telemetry/Makefile | 2 +- security/intrusion-detection-content-et-pro/Makefile | 1 + security/intrusion-detection-content-pt-open/Makefile | 1 + security/intrusion-detection-content-snort-vrt/Makefile | 1 + security/maltrail/Makefile | 1 + security/openconnect/Makefile | 1 + security/softether/Makefile | 1 + security/stunnel/Makefile | 1 + security/tinc/Makefile | 2 +- 10 files changed, 10 insertions(+), 2 deletions(-) diff --git a/security/clamav/Makefile b/security/clamav/Makefile index 0010bcb43b..668ca3fd0c 100644 --- a/security/clamav/Makefile +++ b/security/clamav/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= clamav PLUGIN_VERSION= 1.7 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Antivirus engine for detecting malicious threats PLUGIN_DEPENDS= clamav PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/etpro-telemetry/Makefile b/security/etpro-telemetry/Makefile index 3a959c0848..6c41f6a7ca 100644 --- a/security/etpro-telemetry/Makefile +++ b/security/etpro-telemetry/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= etpro-telemetry PLUGIN_VERSION= 1.4 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= ET Pro Telemetry Edition PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://docs.opnsense.org/manual/etpro_telemetry.html diff --git a/security/intrusion-detection-content-et-pro/Makefile b/security/intrusion-detection-content-et-pro/Makefile index fafdd5cfd4..f9c5095c04 100644 --- a/security/intrusion-detection-content-et-pro/Makefile +++ b/security/intrusion-detection-content-et-pro/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= intrusion-detection-content-et-pro PLUGIN_VERSION= 1.0.2 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= IDS Proofpoint ET Pro ruleset (needs a valid subscription) PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://www.proofpoint.com/us/threat-insight/et-pro-ruleset diff --git a/security/intrusion-detection-content-pt-open/Makefile b/security/intrusion-detection-content-pt-open/Makefile index 8e7246d5fd..255baf5fe9 100644 --- a/security/intrusion-detection-content-pt-open/Makefile +++ b/security/intrusion-detection-content-pt-open/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= intrusion-detection-content-pt-open PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= IDS PT Research ruleset (only for non-commercial use) PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://www.ptsecurity.com/ww-en/ diff --git a/security/intrusion-detection-content-snort-vrt/Makefile b/security/intrusion-detection-content-snort-vrt/Makefile index d4e31d8943..a2f900e6b7 100644 --- a/security/intrusion-detection-content-snort-vrt/Makefile +++ b/security/intrusion-detection-content-snort-vrt/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= intrusion-detection-content-snort-vrt PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= IDS Snort VRT ruleset (needs registration or subscription) PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://www.snort.org/downloads#rules diff --git a/security/maltrail/Makefile b/security/maltrail/Makefile index 874f9d5de8..9371d85122 100644 --- a/security/maltrail/Makefile +++ b/security/maltrail/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= maltrail PLUGIN_VERSION= 1.6 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Malicious traffic detection system PLUGIN_DEPENDS= maltrail PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/openconnect/Makefile b/security/openconnect/Makefile index e922426b2c..afd5f9a200 100644 --- a/security/openconnect/Makefile +++ b/security/openconnect/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= openconnect PLUGIN_VERSION= 1.4.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= OpenConnect Client PLUGIN_DEPENDS= openconnect PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/softether/Makefile b/security/softether/Makefile index 81341b10a7..e1e595bcc9 100644 --- a/security/softether/Makefile +++ b/security/softether/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= softether PLUGIN_VERSION= 0.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Cross-platform Multi-protocol VPN Program PLUGIN_DEPENDS= softether PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index ed8d72bbbb..4cbdf5bc41 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= stunnel PLUGIN_VERSION= 1.0.2 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel diff --git a/security/tinc/Makefile b/security/tinc/Makefile index 45b3c7279b..4e6a8afafe 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= tinc PLUGIN_VERSION= 1.6 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org From a9d1b8b7417d966d63104837e11a6cc511b72b5d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 22 Feb 2021 15:22:40 +0100 Subject: [PATCH 0426/3088] net: revision bumps --- net/chrony/Makefile | 1 + net/firewall/Makefile | 1 + net/freeradius/Makefile | 1 + net/ftp-proxy/Makefile | 2 +- net/google-cloud-sdk/Makefile | 1 + net/igmp-proxy/Makefile | 1 + net/mdns-repeater/Makefile | 11 ++++++----- net/ntopng/Makefile | 1 + net/relayd/Makefile | 1 + net/shadowsocks/Makefile | 2 +- net/siproxd/Makefile | 1 + net/tayga/Makefile | 1 + net/udpbroadcastrelay/Makefile | 1 + net/upnp/Makefile | 1 + net/vnstat/Makefile | 1 + net/wireguard/Makefile | 2 +- net/wol/Makefile | 1 + net/zerotier/Makefile | 2 +- 18 files changed, 23 insertions(+), 9 deletions(-) diff --git a/net/chrony/Makefile b/net/chrony/Makefile index 0601f4f248..a905579e2f 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= chrony PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Chrony time synchronisation PLUGIN_DEPENDS= chrony PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/firewall/Makefile b/net/firewall/Makefile index 5c667b1ee0..4b40f0f05c 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= firewall PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Firewall API supplemental package PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index a473a81ae9..a62c2a0d52 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= freeradius PLUGIN_VERSION= 1.9.9 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/ftp-proxy/Makefile b/net/ftp-proxy/Makefile index 20403a1da3..78c8fc10ba 100644 --- a/net/ftp-proxy/Makefile +++ b/net/ftp-proxy/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= ftp-proxy PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= Control ftp-proxy processes PLUGIN_MAINTAINER= frank.brendel@eurolog.com diff --git a/net/google-cloud-sdk/Makefile b/net/google-cloud-sdk/Makefile index 6e832d0562..c836863108 100644 --- a/net/google-cloud-sdk/Makefile +++ b/net/google-cloud-sdk/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= google-cloud-sdk PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Google Cloud SDK PLUGIN_DEPENDS= google-cloud-sdk PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/igmp-proxy/Makefile b/net/igmp-proxy/Makefile index 4284a2b46b..d5546cdb17 100644 --- a/net/igmp-proxy/Makefile +++ b/net/igmp-proxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= igmp-proxy PLUGIN_VERSION= 1.5 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= igmpproxy PLUGIN_COMMENT= IGMP-Proxy Service PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/mdns-repeater/Makefile b/net/mdns-repeater/Makefile index 3843c85d9e..2c17394c8d 100644 --- a/net/mdns-repeater/Makefile +++ b/net/mdns-repeater/Makefile @@ -1,7 +1,8 @@ -PLUGIN_NAME= mdns-repeater -PLUGIN_VERSION= 1.0 -PLUGIN_COMMENT= Proxy multicast DNS between networks -PLUGIN_MAINTAINER= franz.fabian.94@gmail.com -PLUGIN_DEPENDS= mdns-repeater +PLUGIN_NAME= mdns-repeater +PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 +PLUGIN_COMMENT= Proxy multicast DNS between networks +PLUGIN_MAINTAINER= franz.fabian.94@gmail.com +PLUGIN_DEPENDS= mdns-repeater .include "../../Mk/plugins.mk" diff --git a/net/ntopng/Makefile b/net/ntopng/Makefile index c31a997406..fdced159bb 100644 --- a/net/ntopng/Makefile +++ b/net/ntopng/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= ntopng PLUGIN_VERSION= 1.2 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Traffic Analysis and Flow Collection PLUGIN_DEPENDS= ntopng PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/relayd/Makefile b/net/relayd/Makefile index 0a357bf307..c7bd04749f 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= relayd PLUGIN_VERSION= 2.4 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com diff --git a/net/shadowsocks/Makefile b/net/shadowsocks/Makefile index 7a1b462f9a..478086ece7 100644 --- a/net/shadowsocks/Makefile +++ b/net/shadowsocks/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= shadowsocks PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Secure socks5 proxy PLUGIN_DEPENDS= shadowsocks-libev PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/siproxd/Makefile b/net/siproxd/Makefile index 79394e6b0f..d10bb8f394 100644 --- a/net/siproxd/Makefile +++ b/net/siproxd/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= siproxd PLUGIN_VERSION= 1.3 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Siproxd is a proxy daemon for the SIP protocol PLUGIN_DEPENDS= siproxd PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/tayga/Makefile b/net/tayga/Makefile index 6945498327..33f54830ff 100644 --- a/net/tayga/Makefile +++ b/net/tayga/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= tayga PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Tayga NAT64 PLUGIN_DEPENDS= tayga PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/udpbroadcastrelay/Makefile b/net/udpbroadcastrelay/Makefile index 0977354b33..b8aa04860e 100644 --- a/net/udpbroadcastrelay/Makefile +++ b/net/udpbroadcastrelay/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= udpbroadcastrelay PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Control ubpbroadcastrelay processes PLUGIN_DEPENDS= udpbroadcastrelay PLUGIN_MAINTAINER= mjwasley@gmail.com diff --git a/net/upnp/Makefile b/net/upnp/Makefile index cd7ac42494..9dca9a4c47 100644 --- a/net/upnp/Makefile +++ b/net/upnp/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= upnp PLUGIN_VERSION= 1.4 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= miniupnpd PLUGIN_COMMENT= Universal Plug and Play Service PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile index 59374556bc..bd8388bee2 100644 --- a/net/vnstat/Makefile +++ b/net/vnstat/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= vnstat PLUGIN_VERSION= 1.2 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= vnStat is a console-based network traffic monitor PLUGIN_DEPENDS= vnstat PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index fe52b80fbf..9a3654e78f 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 1.4 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= WireGuard VPN service PLUGIN_DEPENDS= wireguard PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wol/Makefile b/net/wol/Makefile index bbae997f3f..7f29a872c1 100644 --- a/net/wol/Makefile +++ b/net/wol/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wol PLUGIN_VERSION= 2.3 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= wol PLUGIN_COMMENT= Wake on LAN Service PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index 6efe44df93..bc69d92c72 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= zerotier PLUGIN_VERSION= 1.3.2 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= Virtual Networks That Just Work PLUGIN_DEPENDS= zerotier PLUGIN_MAINTAINER= dharrigan@gmail.com From 5f70df6b3a633813c48c87a0203d698ce6421295 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 22 Feb 2021 15:24:06 +0100 Subject: [PATCH 0427/3088] net-mgmt: bump revision --- net-mgmt/collectd/Makefile | 1 + net-mgmt/lldpd/Makefile | 1 + net-mgmt/net-snmp/Makefile | 1 + net-mgmt/netdata/Makefile | 1 + net-mgmt/nrpe/Makefile | 2 +- net-mgmt/telegraf/Makefile | 1 + net-mgmt/zabbix-agent/Makefile | 1 + net-mgmt/zabbix4-proxy/Makefile | 1 + net-mgmt/zabbix5-proxy/Makefile | 1 + 9 files changed, 9 insertions(+), 1 deletion(-) diff --git a/net-mgmt/collectd/Makefile b/net-mgmt/collectd/Makefile index a67fb72124..d4a91d1854 100644 --- a/net-mgmt/collectd/Makefile +++ b/net-mgmt/collectd/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= collectd PLUGIN_VERSION= 1.3 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Collect system and application performance metrics periodically PLUGIN_DEPENDS= collectd5 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/lldpd/Makefile b/net-mgmt/lldpd/Makefile index fe282e13e8..0b778bcae3 100644 --- a/net-mgmt/lldpd/Makefile +++ b/net-mgmt/lldpd/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= lldpd PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= LLDP allows you to know exactly on which port is a server PLUGIN_DEPENDS= lldpd PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile index bd26747faf..77c00a3b9d 100644 --- a/net-mgmt/net-snmp/Makefile +++ b/net-mgmt/net-snmp/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= net-snmp PLUGIN_VERSION= 1.4 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Net-SNMP is a daemon for the SNMP protocol PLUGIN_DEPENDS= net-snmp PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/netdata/Makefile b/net-mgmt/netdata/Makefile index 0a4b8cf344..3c5fd6b740 100644 --- a/net-mgmt/netdata/Makefile +++ b/net-mgmt/netdata/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= netdata PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Real-time performance monitoring PLUGIN_DEPENDS= netdata PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile index e23a519ff7..b6c26d948a 100644 --- a/net-mgmt/nrpe/Makefile +++ b/net-mgmt/nrpe/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= nrpe PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Execute nagios plugins PLUGIN_DEPENDS= nrpe3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index 32f0fd6027..284cc8f355 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= telegraf PLUGIN_VERSION= 1.8.3 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/zabbix-agent/Makefile b/net-mgmt/zabbix-agent/Makefile index 148ae72c19..af1be66116 100644 --- a/net-mgmt/zabbix-agent/Makefile +++ b/net-mgmt/zabbix-agent/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= zabbix-agent PLUGIN_VERSION= 1.8 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Zabbix monitoring agent PLUGIN_DEPENDS= zabbix5-agent PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net-mgmt/zabbix4-proxy/Makefile b/net-mgmt/zabbix4-proxy/Makefile index ae1fd3930c..d9ece0f6f9 100644 --- a/net-mgmt/zabbix4-proxy/Makefile +++ b/net-mgmt/zabbix4-proxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= zabbix4-proxy PLUGIN_VERSION= 1.2 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Zabbix Proxy enables decentralized monitoring PLUGIN_DEPENDS= zabbix4-proxy PLUGIN_CONFLICTS= zabbix5-proxy diff --git a/net-mgmt/zabbix5-proxy/Makefile b/net-mgmt/zabbix5-proxy/Makefile index 89d4d33dde..fd8d3942b6 100644 --- a/net-mgmt/zabbix5-proxy/Makefile +++ b/net-mgmt/zabbix5-proxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= zabbix5-proxy PLUGIN_VERSION= 1.3 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Zabbix Proxy enables decentralized monitoring PLUGIN_DEPENDS= zabbix5-proxy PLUGIN_CONFLICTS= zabbix4-proxy From 9df5e84a381f1c333c5093e05adca15a9c4d8ed1 Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Tue, 23 Feb 2021 08:57:37 +0100 Subject: [PATCH 0428/3088] sync local changes to remote via socket --- .../OPNsense/HAProxy/lib/haproxy/cmds.py | 4 +- .../HAProxy/lib/haproxy/tests/test_cmds.py | 2 +- .../scripts/OPNsense/HAProxy/syncCerts.py | 578 ++++++++++++++---- 3 files changed, 455 insertions(+), 129 deletions(-) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py index 81e8b3351a..391527d890 100644 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py @@ -135,7 +135,7 @@ def getResultObj(self, res): return result class showSslCrtList(Cmd): - cmdTxt = "show ssl crt-list %(crt_list)s\r\n" + cmdTxt = "show ssl crt-list -n %(crt_list)s\r\n" req_args = ['crt_list'] helpTxt = "Show the the content of a crt-list." @@ -330,4 +330,4 @@ def getResultObj(self, res): row.move_to_end('id', last=False) servers.append(dict(row)) - return servers \ No newline at end of file + return servers diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py index 01887f583f..18a175aeed 100644 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py @@ -142,7 +142,7 @@ def setUp(self): "sessions": "show sess", "servers": "show stat", "show-ssl-crt-lists": "show ssl crt-list", - "show-ssl-crt-list": "show ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", + "show-ssl-crt-list": "show ssl crt-list -n /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", "show-ssl-certs": "show ssl cert", "show-ssl-cert": "show ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", "add-to-crt-list": "add ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py index 7b3d09bbc2..d8f3d72b06 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py @@ -3,145 +3,452 @@ import os import sys import argparse -import traceback import yaml -import ssl -from io import StringIO import base64 import OpenSSL - +import json +from typing import List sys.path.append(os.path.join(os.path.dirname(__file__), 'lib')) from haproxy.conn import HaPConn from haproxy import cmds -class Diff: - def __init__(self, local=None, remote=None): - if local is None: - local = [] - if remote is None: - remote = [] - - self.local = local - self.remote = remote - self.state = str(self) - - def show_state(self): - """ Shows current local and remote state """ - print("## STATE ##") - print(str(self)) - - def show_diff(self): - """ Shows what will be synced to target """ - print("## DIFF ##") - print("TODO: Show the diff") - - def sync(self): - print("## SYNC ##") - print("TODO: Sync to target") - - def __iter__(self): - return iter(self.local) - - def __str__(self): - result = "" - for item in self: - result += f"{str(item)}\n" - return result - - class SyncWithTarget: """ Base class for sync objects to a target """ + def __init__(self, socket='/var/run/haproxy.socket'): self.socket = socket - def execute_remote_cmd(self, command_class, **command_args): + def _execute_remote_cmd(self, command_class, **command_args): con = HaPConn(self.socket) if con: - result = con.sendCmd(command_class(**command_args), objectify=True) + command_obj = command_class(**command_args) + result = con.sendCmd(command_obj, objectify=True) con.close() return result - def get_remote_state(self, command_class, **command_args): - return self.execute_remote_cmd(command_class, **command_args) + def _calc_diff(self): + """ return needed operations to get remote object in sync """ + raise Exception("need to be implemented!") + + def diff_list(self, first: List, second: List): + second = set(second) + return [item for item in first if item not in second] + + +class Diff(SyncWithTarget): + """ Represents a full diff to sync with remote """ + + def __init__(self, crt_lists=None): + super().__init__() + if crt_lists is None: + crt_lists = [] + self._crt_lists = crt_lists + self._diff = self._calc_diff() + self._status = self._get_status() + self._transactions = self._get_transactions() + + @property + def diff(self): + return self._diff + + @property + def crt_lists(self): + return self._crt_lists + + @property + def transactions(self): + return self._transactions + + @property + def status(self): + return self._status + + def _calc_diff(self): + result = {} + for crt_list in self: + result[crt_list.frontend_id] = crt_list.diff + return result + + def abort(self, output_format): + """ Abort transactions""" + aborted = [] + for certfile in self.transactions: + certfile = certfile.replace('*/', "/") + + output = self._execute_remote_cmd(cmds.abortSslCrt, certfile=certfile) + aborted.append({ + "cert": certfile, + "output": output, + }) + + if output_format == 'json': + print(json.dumps({'abort': aborted})) + + if output_format == 'raw': + for item in aborted: + print(f"ABORT transaction: {item['cert']}") + print(f" {repr(item['output'])}") + + def _get_transactions(self): + """ get open transactions""" + return self._execute_remote_cmd(cmds.showSslCerts)['transaction'] + + def _get_status(self): + status = {} + crt_list: CertList + for crt_list in self.crt_lists: + status[crt_list.frontend_id] = { + "frontend_name": crt_list.frontend_name, + "path": crt_list.path, + "local_certs": crt_list.local, + "local_default": crt_list.local_default, + "remote_certs": crt_list.remote, + "remote_default": crt_list.remote_default, + } + cert: Cert + status[crt_list.frontend_id]['certs'] = {} + for cert in crt_list.certs: + status[crt_list.frontend_id]['certs'][cert.cert_id] = { + 'path': cert.path, + 'local': cert.local, + 'remote': cert.local, + } + return status + + def show_status(self, output_format): + """ Shows current local and remote state """ + if output_format == 'json': + print(json.dumps(self.status)) + + if output_format == 'raw': + print("## STATUS ##") + for frontend_id, crt_list in self.status.items(): + print(f"CRT_LIST: {crt_list['path']}") + print(f" FRONTEND NAME: {crt_list['frontend_name']}") + print(f" FRONTEND ID: {frontend_id}") + print(f" LOCAL CERTS: {crt_list['local_certs']}") + print(f" REMOTE CERTS: {crt_list['remote_certs']}") + print(f" LOCAL DEFAULT: {crt_list['local_default']}") + print(f" REMOTE DEFAULT: {crt_list['remote_default']}") + + for cert_id, cert in crt_list['certs'].items(): + print() + print(f" CERT: {cert['path']}") + print(f" LOCAL: {cert['local']}") + print(f" REMOTE: {cert['remote']}") + print() + + def show_diff(self, output_format): + """ Shows what will be synced to target """ + if output_format == 'json': + print(json.dumps(self.diff)) + + if output_format == 'raw': + print("## DIFF ##") + for frontend_id, diff in self.diff.items(): + print(f"CRT LIST: {diff['path']}") + print(f" FRONTEND NAME: {diff['frontend_name']}") + print(f" FRONTEND ID: {diff['frontend_id']}") + for update in diff['update']: + print(f" CERT UPDATE:") + print(f" Cert: {update['certfile']}") + print(f" Serial: {update['meta']['Serial']}") + print(f" Issuer: {update['meta']['Issuer']}") + print(f" Subject: {update['meta']['Subject']}") + else: + if not diff['update']: + print(f" CERT UPDATE: []") + print(f" CERT ADD : {diff['add']}") + print(f" CERT DEL : {diff['del']}") + + def show_transactions(self, output_format): + + if output_format == 'json': + print(json.dumps({'transactions': self.transactions})) + + if output_format == 'raw': + print("## OPEN TRANSACTIONS ##") + for cert in self.transactions: + print(cert) + + def sync(self, output_format): + """ Sync to target """ + sync = {} + certs_to_delete = [] + for frontend_id, diff in self.diff.items(): + sync[frontend_id] = { + 'frontend_name': diff['frontend_name'], + 'frontend_id': diff['frontend_id'], + 'path': diff['path'], + 'add': [], + 'remove': [], + 'update': [], + 'del': [] + } + + # update cert content + for cert in diff['update']: + messages = [] + if cert['certfile'] in diff['add']: + output = self._execute_remote_cmd(cmds.newSslCrt, certfile=cert['certfile']) + messages.append(output) + + output = self._execute_remote_cmd(cmds.updateSslCrt, certfile=cert['certfile'], payload=cert['pem']) + messages.append(output) + + output = self._execute_remote_cmd(cmds.commitSslCrt, certfile=cert['certfile']) + messages.append(output) + + sync[frontend_id]['update'].append({ + 'cert': cert['certfile'], + 'messages': messages + }) + + # add to crt-list + for cert in diff['add']: + messages = [] + output = self._execute_remote_cmd(cmds.addToSslCrtList, crt_list=diff['path'], certfile=cert) + messages.append(output) + sync[frontend_id]['add'].append({ + 'cert': cert, + 'messages': messages + }) + + # remove from crt-list + for cert in diff['del']: + messages = [] + output = self._execute_remote_cmd(cmds.delFromSslCrtList, crt_list=diff['path'], certfile=cert) + messages.append(output) + certs_to_delete.append(cert.split(":")[0]) + sync[frontend_id]['remove'].append({ + 'cert': cert, + 'messages': messages + }) + + # delete unused certs operation - haproxy does not allow to delete certs in use + for cert in certs_to_delete: + messages = [] + output = self._execute_remote_cmd(cmds.delSslCrt, certfile=cert) + messages.append(output) + sync[frontend_id]['del'].append({ + 'cert': cert, + 'messages': messages + }) + + if output_format == 'json': + print(json.dumps(self.diff)) + + if output_format == 'raw': + print("## SYNC ##") + for frontend_id, crt_list in sync.items(): + print(f"CRT-LIST: {crt_list['path']}") + print(f" FRONTEND NAME: {crt_list['frontend_name']}") + print(f" FRONTEND ID: {crt_list['frontend_id']}") + for cert in crt_list['update']: + print(f" UPDATE: {cert['cert']}") + for message in cert['messages']: + print(" " + repr(message)) + for cert in crt_list['add']: + print(f" ADD: {cert['cert']}") + for message in cert['messages']: + print(" " + repr(message)) + + for cert in crt_list['remove']: + print(f" REMOVE: {cert['cert']}") + for message in cert['messages']: + print(" " + repr(message)) + + for cert in crt_list['del']: + print(f" DEL: {cert['cert']}") + for message in cert['messages']: + print(" " + repr(message)) + print() + + def __iter__(self): + return iter(self._crt_lists) + + def __str__(self): + return self.status class CertList(SyncWithTarget): """ Represents a haproxy ssl-crt-list """ - def __init__(self, path, certs=None): + + def __init__(self, path, frontend_id=None, frontend_name=None, certs=None, default_cert=None): super().__init__() if certs is None: certs = [] - self.path = path - self.certs = certs - self.local = self.get_local_state() - self.remote = self.get_remote_state(cmds.showSslCrtList, crt_list=self.path) + self._path = path + self._certs = certs + self._frontend_name = frontend_name + self._frontend_id = frontend_id + self._local_default = default_cert + self._local = self._get_local_state() + self._remote_ln = self._get_remote_state(cmds.showSslCrtList, crt_list=self._path) + self._remote = [cert_ln.split(":")[0] for cert_ln in self._remote_ln] + self._diff = self._calc_diff() + + @property + def path(self): + return self._path + + @property + def frontend_name(self): + return self._frontend_name + + @property + def frontend_id(self): + return self._frontend_id + + @property + def certs(self): + return self._certs + + @property + def local_default(self): + return self._local_default + + @property + def remote_default(self): + return next(iter(self._remote), None) + + @property + def local(self): + return self._local + + @property + def remote_ln(self): + """ Certs with line number""" + return self._remote_ln + + @property + def remote(self): + """ + if default certs are different return remote certs with line numbers, so they are deleted in the crt list. + This ensures that the default cert is always on top. + """ + if self._local_default is not None and self.local_default != self.remote_default: + return self._remote_ln + return self._remote + + @property + def diff(self): + return self._diff + + def _calc_diff(self): + """ return needed operations to get remote object in sync """ + diff = { + 'frontend_name': self.frontend_name, + 'frontend_id': self.frontend_id, + 'path': self.path, + 'add': [], + 'del': [], + 'update': [] + } + # skip when there is no remote crt list + if self.remote is None: + return diff - def __iter__(self): - return iter(self.local) + # certs to add, delete and update on the remote target + diff['add'] = self.diff_list(self.local, self.remote) + diff['del'] = self.diff_list(self.remote, self.local) + diff['update'] = [cert.diff for cert in self.certs if cert.diff] - def __str__(self): - result = f"CRT LIST: {self.path}\n" - result += f" LOCAL: {self.local}\n" - result += f" REMOTE: {self.remote}\n" - for cert in self.certs: - result += f"\n{str(cert)}\n" - return result + return diff - def get_local_state(self): - return [f"{repr(cert)}" for cert in self.certs] + def _get_local_state(self): + return [f"{repr(cert)}" for cert in self._certs] - def get_remote_state(self, command_class, **command_args): - crt_list_data = super().get_remote_state(command_class, **command_args) - return crt_list_data.get('certs', {}) + def _get_remote_state(self, command_class, **command_args): + crt_list_data = self._execute_remote_cmd(command_class, **command_args) + return crt_list_data.get('certs', None) + + def __iter__(self): + return iter(self._local) class Cert(SyncWithTarget): """ Represents a haproxy ssl-cert """ - def __init__(self, path, pem): + + def __init__(self, path, pem, cert_id=None): super().__init__() - self.path = path - self.pem = pem - self.local = self.get_local_state() - self.remote = self.get_remote_state(cmds.showSslCert, certfile=self.path) + self._path = path + self._pem = pem + self._cert_id = cert_id + self._local = self._get_local_state() + self._remote = self._get_remote_state(cmds.showSslCert, certfile=self._path) + self._diff = self._calc_diff() - def __repr__(self): - return self.path + @property + def path(self): + return self._path - def __str__(self): - result = f" CERT: {self.path}" - result += f"\n LOCAL: {self.local}" - result += f"\n REMOTE: {self.remote}" - return result + @property + def cert_id(self): + return self._cert_id - def get_cert_data(self, dump=False, encoding='utf-8'): + @property + def pem(self): + return self._pem.replace("\n\n", "\n") + + @property + def local(self): + return self._local + + @property + def remote(self): + return self._remote + + @property + def diff(self): + return self._diff + + def __repr__(self): + return self._path + + def _get_cert_data(self, dump=False, encoding='utf-8'): result = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, self.pem) if dump: result = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_TEXT, result).decode(encoding) return result - def glue(self, components): + def _glue(self, components): return "".join("/{0:s}={1:s}".format(name.decode(), value.decode()) for name, value in components) - def get_local_state(self): - cert_obj = self.get_cert_data() + def _get_local_state(self): + cert_obj = self._get_cert_data() return { - "Serial": '%.2x' % cert_obj.get_serial_number(), - "Subject": self.glue(cert_obj.get_subject().get_components()), - "Issuer": self.glue(cert_obj.get_issuer().get_components()) + "Serial": '%.2x'.upper() % cert_obj.get_serial_number(), + "Subject": self._glue(cert_obj.get_subject().get_components()), + "Issuer": self._glue(cert_obj.get_issuer().get_components()) } - def get_remote_state(self, command_class, **command_args): - cert_data = super().get_remote_state(command_class, **command_args) + def _get_remote_state(self, command_class, **command_args): + cert_data = self._execute_remote_cmd(command_class, **command_args) + if 'error' in cert_data: - return {} + return cert_data + + if cert_data['Status'] == 'Empty': + return {'Status': cert_data['Status']} + return { - "Serial": cert_data['Serial'], - "Subject": cert_data['Subject'], - "Issuer": cert_data['Issuer'] + "Serial": cert_data.get('Serial', None), + "Subject": cert_data.get('Subject', None), + "Issuer": cert_data.get('Issuer', None), } + def _calc_diff(self): + result = {} + if self._remote != self._local: + result['certfile'] = self.path + result['pem'] = self.pem + result['meta'] = self.local + return result + + def dict_from_yaml(path): with open(path, 'r') as yaml_file: data = yaml.load(yaml_file, Loader=yaml.SafeLoader) @@ -152,15 +459,15 @@ def skip_frontend(frontend_id, frontend): filter_frontend_names = list(filter(None, args.frontends.split(","))) filter_frontend_ids = list(filter(None, args.frontend_ids.split(","))) - skip_id = False - if filter_frontend_names and frontend['name'] not in filter_frontend_names: - skip_id = True + if not filter_frontend_ids and not filter_frontend_names: + return False - skip_name = False - if filter_frontend_ids and frontend_id not in filter_frontend_ids: - skip_name = True + if filter_frontend_ids and frontend_id in filter_frontend_ids: + return False + if filter_frontend_names and frontend['name'] in filter_frontend_names: + return False - return skip_id and skip_name + return True def get_cert_data(cert, dump=False, encoding='utf-8'): @@ -182,6 +489,7 @@ def base64_decode(base64_str, encoding='utf-8'): return message return '' + def get_args(): # noinspection PyTypeChecker parser = argparse.ArgumentParser( @@ -190,6 +498,12 @@ def get_args(): given, all certificates will be synced.""", formatter_class=argparse.ArgumentDefaultsHelpFormatter ) + parser.add_argument( + 'command', + choices=['status', 'diff', 'sync', 'transactions', 'abort'], + nargs='+', + help="Execute one or more operations." + ) parser.add_argument( '--config', help='Path to the ssl certificate information configfile.', @@ -201,7 +515,7 @@ def get_args(): default="" ) parser.add_argument( - '--frontend_ids', + '--frontend-ids', help='Attempt action on a list of frontend ids, specified as a comma separated list.', default="" ) @@ -211,42 +525,54 @@ def get_args(): choices=['json', 'raw'], default="raw" ) - parser.add_argument( - '--debug', - type=bool, - help='Show debug output.', - default=False - ) return parser.parse_args() -args = get_args() -config = dict_from_yaml(args.config) - -""" Get ssl crt-list with certificates from configfile""" -crt_lists = [] -for frontend_id, frontend in config['frontends'].items(): - if skip_frontend(id, frontend_id): - continue +def get_crt_lists_from_config(configfile): + """ Get ssl crt-list with certificates from configfile""" + config = dict_from_yaml(configfile) + crt_lists = [] + for frontend_id, frontend in config['frontends'].items(): + if skip_frontend(frontend_id, frontend): + continue + + certs = [] + default_cert = None + for cert_id, cert_data in frontend['certs'].items(): + crt = base64_decode(cert_data['crt']) + key = base64_decode(cert_data['key']) + ca = base64_decode(cert_data['ca']) + full_cert = crt + key + ca + + if cert_data['default']: + default_cert = cert_data['path'] + + certs.append(Cert(path=cert_data['path'], pem=full_cert, cert_id=cert_id)) + + params = { + 'path': frontend['crt_list_path'], + 'frontend_id': frontend_id, + 'frontend_name': frontend['name'], + 'certs': certs, + 'default_cert': default_cert + } + crt_lists.append(CertList(**params)) - certs = [] - for cert_id, cert_data in frontend['certs'].items(): - crt = base64_decode(cert_data['crt']) - key = base64_decode(cert_data['key']) - ca = base64_decode(cert_data['ca']) - full_cert = crt + key + ca + return crt_lists - certs.append(Cert(path=cert_data['path'], pem=full_cert)) - crt_lists.append(CertList(path=frontend['crt_list_path'], certs=certs)) +args = get_args() +crt_lists = get_crt_lists_from_config(args.config) +diff = Diff(crt_lists=crt_lists) """ Sync ssl certs from configfile to HaProxy """ -diff = Diff(local=crt_lists) -diff.show_state() -diff.show_diff() -diff.sync() - - -#print(crt_lists) -#print(diff) -#diff.sync() +if "status" in args.command: + diff.show_status(args.output) +if "diff" in args.command: + diff.show_diff(args.output) +if "abort" in args.command: + diff.abort(args.output) +if "transactions" in args.command: + diff.show_transactions(args.output) +if "sync" in args.command: + diff.sync(args.output) From 7231fcfa0dc514619d0d0c3b2c9697a0722d25fa Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Tue, 23 Feb 2021 10:15:07 +0100 Subject: [PATCH 0429/3088] add config.d services --- .../scripts/OPNsense/HAProxy/syncCerts.py | 1 - .../conf/actions.d/actions_haproxy.conf | 26 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py index d8f3d72b06..87632bda09 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py @@ -164,7 +164,6 @@ def show_diff(self, output_format): print(f" CERT DEL : {diff['del']}") def show_transactions(self, output_format): - if output_format == 'json': print(json.dumps({'transactions': self.transactions})) diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index ce1ef790b6..7301e83e84 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -74,4 +74,28 @@ message:change haproxy state for multiple server command:/usr/local/opnsense/scripts/OPNsense/HAProxy/socketCommand.py parameters: set-server-weight --server-ids %s --value %s type:script_output -message:change haproxy weight for multiple server \ No newline at end of file +message:change haproxy weight for multiple server + +[cert_diff] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +parameters: diff --output json --frontends %s +type:script_output +message:Show diff between configured ssl certificates and certs from HAProxy memory for multiple frontends + +[cert_sync] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +parameters: sync --frontends %s --output json +type:script_output +message:Sync ssl certificates into HAProxy memory for multiple frontends + +[cert_diff_bulk] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py diff --output json +parameters: +type:script_output +message:Show diff between configured ssl certificates and certs from HAProxy memory for all frontends + +[cert_sync_bulk] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py sync --output json +parameters: +type:script_output +message:Sync ssl certificates into HAProxy memory for all frontends From 1c5346467de9870019d26b5a4741656826a9cda4 Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Tue, 23 Feb 2021 16:36:02 +0100 Subject: [PATCH 0430/3088] fix status remote cert display add description for cert_sync_bulk --- .../src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py | 4 ++-- .../src/opnsense/service/conf/actions.d/actions_haproxy.conf | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py index 87632bda09..0427b2e7ed 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py @@ -113,7 +113,7 @@ def _get_status(self): status[crt_list.frontend_id]['certs'][cert.cert_id] = { 'path': cert.path, 'local': cert.local, - 'remote': cert.local, + 'remote': cert.remote, } return status @@ -260,7 +260,7 @@ def sync(self, output_format): print(" " + repr(message)) for cert in crt_list['del']: - print(f" DEL: {cert['cert']}") + print(f"\n DEL: {cert['cert']}") for message in cert['messages']: print(" " + repr(message)) print() diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index 7301e83e84..48bcc629d0 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -99,3 +99,4 @@ command:/usr/local/opnsense/scripts/OPNsense/HAProxy/syncCerts.py sync --output parameters: type:script_output message:Sync ssl certificates into HAProxy memory for all frontends +description:Sync ssl certificates changes into HAProxy memory From 1a52a30246247d3ceba3075085580e3be87dd6c1 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 2 Feb 2021 15:38:02 +0100 Subject: [PATCH 0431/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index c37496e583..9ae44f3d7d 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 2.26 +PLUGIN_VERSION= 3.0 PLUGIN_REVISION= 1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy From 666554593748340d165c0de70dff69ffa5046bc7 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 2 Feb 2021 15:39:19 +0100 Subject: [PATCH 0432/3088] net/haproxy: update changelog --- net/haproxy/pkg-descr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index af22b3790d..8fd3de23c1 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.0 + +Added: +* new feature to change server state and weight on-the-fly (#2213) + 2.26 Fixed: From 43f984def679c4416124b4ce3ed061b22d9289b1 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 4 Feb 2021 21:09:56 +0100 Subject: [PATCH 0433/3088] net/haproxy: translate tooltips, refs #2213 --- net/haproxy/Makefile | 1 - .../app/views/OPNsense/HAProxy/maintenance.volt | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 9ae44f3d7d..fa8508ba7a 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 3.0 -PLUGIN_REVISION= 1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt index 33332c27b1..63c870e6df 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt @@ -45,10 +45,10 @@ POSSIBILITY OF SUCH DAMAGE. formatters: { "commands": function (column, row) { buttons = "" - buttons += "" - buttons += " " - buttons += " " - buttons += " " + buttons += "" + buttons += " " + buttons += " " + buttons += " " return buttons; }, }, @@ -272,10 +272,10 @@ POSSIBILITY OF SUCH DAMAGE. - - - - + + + + From 436f5801f415d200426a842f1dbd32474e213e28 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 4 Feb 2021 22:29:14 +0100 Subject: [PATCH 0434/3088] net/haproxy: update default SSL settings --- net/haproxy/pkg-descr | 7 +++++++ .../OPNsense/HAProxy/forms/dialogFrontend.xml | 18 +++++++++--------- .../OPNsense/HAProxy/forms/generalTuning.xml | 18 +++++++++--------- .../app/models/OPNsense/HAProxy/HAProxy.xml | 18 +++++++++++------- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 8fd3de23c1..60f1c4d12a 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -10,6 +10,13 @@ Plugin Changelog Added: * new feature to change server state and weight on-the-fly (#2213) +* add new SSL bind option: prefer-client-ciphers + +Changed: +* change default SSL version to TLSv1.2 (ssl-min-ver) +* remove weak ciphers from (default) SSL settings +* remove default SSL bind options that would conflict with ssl-min-ver +* move SSL bind options below other SSL settings, they are rarely used nowadays 2.26 diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml index 754bd8b038..4a12988a5c 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml @@ -89,15 +89,6 @@ header - - frontend.ssl_bindOptions - - select_multiple - - true - true - - frontend.ssl_minVersion @@ -146,6 +137,15 @@ text + + frontend.ssl_bindOptions + + select_multiple + + true + true + + header diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml index add58fc535..f34ae4ee9a 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml @@ -85,15 +85,6 @@ checkbox - - haproxy.general.tuning.ssl_bindOptions - - select_multiple - - true - true - - haproxy.general.tuning.ssl_minVersion @@ -118,4 +109,13 @@ text + + haproxy.general.tuning.ssl_bindOptions + + select_multiple + + true + true + + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 3c7763fc7b..a855cf6320 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 2.10.0 + 3.0.0 the HAProxy load balancer @@ -129,7 +129,7 @@ N - no-sslv3,no-tlsv10,no-tls-tickets + prefer-client-ciphers Y Y @@ -144,11 +144,13 @@ force-tlsv11 force-tlsv12 force-tlsv13 + prefer-client-ciphers strict-sni N + TLSv1.2 SSLv3 TLSv1.0 @@ -168,11 +170,11 @@ - ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256 + ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256 N - TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256 + TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 N @@ -461,7 +463,7 @@ N - no-sslv3,no-tlsv10,no-tls-tickets + prefer-client-ciphers Y Y @@ -476,11 +478,13 @@ force-tlsv11 force-tlsv12 force-tlsv13 + prefer-client-ciphers strict-sni N + TLSv1.2 SSLv3 TLSv1.0 @@ -500,11 +504,11 @@ - ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256 + ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256 N - TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256 + TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 N From e1d1a8c7823a8db5a1d13d6091e5800de75dea3e Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 5 Feb 2021 00:25:37 +0100 Subject: [PATCH 0435/3088] net/haproxy: switch to HAProxy 2.2 release series, closes #2092 --- net/haproxy/pkg-descr | 8 ++++++++ .../OPNsense/HAProxy/forms/generalTuning.xml | 6 ++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 9 +++++++-- .../scripts/OPNsense/HAProxy/socketCommand.py | 2 +- .../templates/OPNsense/HAProxy/haproxy.conf | 18 +++++++++++++----- 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 60f1c4d12a..c739a02159 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -11,12 +11,20 @@ Plugin Changelog Added: * new feature to change server state and weight on-the-fly (#2213) * add new SSL bind option: prefer-client-ciphers +* add global option to enable old buggy behaviour for PROXY v2 connections +* add support for HTTP/2 in health checks + +Fixed: +* fix maintenance page (python error: 'list' object has no attribute 'strip') Changed: * change default SSL version to TLSv1.2 (ssl-min-ver) * remove weak ciphers from (default) SSL settings * remove default SSL bind options that would conflict with ssl-min-ver * move SSL bind options below other SSL settings, they are rarely used nowadays +* change default for tune.ssl.default-dh-param from 1024 to 2048 +* use new "http-check send" command for HTTP health checks +* change default for spreadChecks from 0 to 2 2.26 diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml index f34ae4ee9a..0fd011d4db 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml @@ -68,6 +68,12 @@ text + + haproxy.general.tuning.bogusProxyEnabled + + checkbox + + haproxy.general.tuning.customOptions diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index a855cf6320..3cb8e5b2e4 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -86,7 +86,7 @@ - 1024 + 2048 1024 16384 Please specify a value between 1024 and 16384. @@ -107,12 +107,16 @@ N - 0 + 2 0 50 Please specify a value between 0 and 50. Y + + 0 + Y + 0 0 @@ -1322,6 +1326,7 @@ HTTP/1.0 [default] HTTP/1.1 + HTTP/2 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py index fd9b438c0a..554db684aa 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py @@ -148,7 +148,7 @@ def get_args(): if con: result = con.sendCmd(command_class(**command_args), objectify=False) if result: - print(result.strip()) + print(result) else: print(f"Could not open socket {SOCKET}") diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 1796018a48..8f3ce54f14 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -838,6 +838,9 @@ global {% if OPNsense.HAProxy.general.tuning.spreadChecks|default("") != "" %} spread-checks {{OPNsense.HAProxy.general.tuning.spreadChecks}} {% endif %} +{% if OPNsense.HAProxy.general.tuning.bogusProxyEnabled|default("") == '1' %} + pp2-never-send-local +{% endif %} {% if OPNsense.HAProxy.general.tuning.checkBufferSize|default("") != "" %} tune.chksize {{OPNsense.HAProxy.general.tuning.checkBufferSize}} {% endif %} @@ -1285,15 +1288,20 @@ backend {{backend.name}} {% endif %} {% endif %} {% elif healthcheck_data.type == 'http' %} -{% do healthcheck_options.append('httpchk') %} + option httpchk {# # HTTP method must be uppercase #} +{% do healthcheck_options.append('send meth') %} {% do healthcheck_options.append(healthcheck_data.http_method|upper) %} +{% do healthcheck_options.append('uri') %} {% do healthcheck_options.append(healthcheck_data.http_uri) %} -{% do healthcheck_options.append('HTTP/1.0') if healthcheck_data.http_version == 'http10' %} {# # HTTP Host header requires HTTP 1.1 #} -{% do healthcheck_options.append('HTTP/1.1') if healthcheck_data.http_version == 'http11' and healthcheck_data.http_host|default("") == "" %} -{% do healthcheck_options.append('HTTP/1.1\\r\\nHost:\ ' ~ healthcheck_data.http_host) if healthcheck_data.http_version == 'http11' and healthcheck_data.http_host|default("") != "" %} - option {{healthcheck_options|join(' ')}} +{% if (healthcheck_data.http_version == 'http11' or healthcheck_data.http_version == 'http2') and healthcheck_data.http_host|default('') != '' %} +{% do healthcheck_options.append('ver HTTP/1.1 hdr Host ' ~ healthcheck_data.http_host) if healthcheck_data.http_version == 'http11' %} +{% do healthcheck_options.append('ver HTTP/2 hdr Host ' ~ healthcheck_data.http_host) if healthcheck_data.http_version == 'http2' %} +{% elif healthcheck_data.http_version == 'http10' %} +{% do healthcheck_options.append('ver HTTP/1.0') %} +{% endif %} + http-check {{healthcheck_options|join(' ')}} {# # custom HTTP health check option #} {% if healthcheck_data.http_expressionEnabled|default("") == '1' %} {# # validate options #} From d6ea9600e089a9528a31fad50b2c9416d1a0bc0c Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 5 Feb 2021 23:51:39 +0100 Subject: [PATCH 0436/3088] net/haproxy: add config export, closes #2035 --- net/haproxy/pkg-descr | 1 + .../OPNsense/HAProxy/Api/ExportController.php | 83 ++++++++++++++++++ .../OPNsense/HAProxy/ExportController.php | 45 ++++++++++ .../app/models/OPNsense/HAProxy/Menu/Menu.xml | 1 + .../app/views/OPNsense/HAProxy/export.volt | 86 +++++++++++++++++++ .../conf/actions.d/actions_haproxy.conf | 13 +++ 6 files changed, 229 insertions(+) create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/ExportController.php create mode 100644 net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index c739a02159..122f677897 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -13,6 +13,7 @@ Added: * add new SSL bind option: prefer-client-ciphers * add global option to enable old buggy behaviour for PROXY v2 connections * add support for HTTP/2 in health checks +* add config export (#2035) Fixed: * fix maintenance page (python error: 'list' object has no attribute 'strip') diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php new file mode 100644 index 0000000000..89f9df4ca1 --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php @@ -0,0 +1,83 @@ +configdRun("haproxy showconf"); + return array("response" => $response); + } + + /** + * download config file or config archive + * @return array|mixed + */ + public function downloadAction($type) + { + $backend = new Backend(); + + if ($type == 'config') { + $result = $backend->configdRun("haproxy showconf"); + $filename = 'haproxy.conf'; + $filetype = 'text/plain'; + $content = $result; + } else { + $result = $backend->configdRun("haproxy exportall"); + $filename = 'haproxy_config_export.zip'; + $filetype = 'application/zip'; + $content = file_get_contents('/tmp/haproxy_config_export.zip'); + } + + $response = array( + 'result' => $result, + 'filename' => $filename, + 'filetype' => $filetype, + 'content' => base64_encode($content), + ); + return $response; + } +} diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/ExportController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/ExportController.php new file mode 100644 index 0000000000..390adadede --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/ExportController.php @@ -0,0 +1,45 @@ +view->pick('OPNsense/HAProxy/export'); + } +} diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml index 8d12e55ab8..520fcc7c3d 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml @@ -32,6 +32,7 @@ + diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt new file mode 100644 index 0000000000..e9134da578 --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt @@ -0,0 +1,86 @@ +{# + +Copyright (C) 2021 Frank Wall +OPNsense® is Copyright © 2014 – 2016 by Deciso B.V. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#} + + + + + +
    + +
    +
    +
    
    +            
    +
    + + +
    +
    +
    + +
    + +{{ partial("layout_partials/base_dialog_processing") }} diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index 48bcc629d0..e23f091f61 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -100,3 +100,16 @@ parameters: type:script_output message:Sync ssl certificates into HAProxy memory for all frontends description:Sync ssl certificates changes into HAProxy memory + +[showconf] +command:test -f /usr/local/etc/haproxy.conf && cat /usr/local/etc/haproxy.conf +parameters: +type:script_output +message:show haproxy config + +[exportall] +command:/usr/local/bin/zip -r /tmp/haproxy_config_export.zip /tmp/haproxy /usr/local/etc/haproxy.conf +parameters: +type:script_output +message:show haproxy config + From 3852c59f4bfba181f59ab03920d3cfe9e1c59ab8 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 7 Feb 2021 21:53:38 +0100 Subject: [PATCH 0437/3088] net/haproxy: update URLs to HAProxy 2.2 documentation, refs #2092 --- .../OPNsense/HAProxy/forms/dialogAction.xml | 10 +++++----- .../OPNsense/HAProxy/forms/dialogBackend.xml | 10 +++++----- .../OPNsense/HAProxy/forms/dialogFrontend.xml | 6 +++--- .../OPNsense/HAProxy/forms/dialogMapfile.xml | 2 +- .../opnsense/mvc/app/views/OPNsense/HAProxy/index.volt | 10 +++++----- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml index c10565e9f3..1e86836371 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml @@ -89,7 +89,7 @@ action.http_request_redirect text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]>
    @@ -128,7 +128,7 @@ action.http_request_add_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -145,7 +145,7 @@ action.http_request_set_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -251,7 +251,7 @@ action.http_response_add_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -268,7 +268,7 @@ action.http_response_set_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index 8d4479ef5c..4744fb03c6 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -28,7 +28,7 @@ backend.algorithm dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> Choose a load balancing algorithm. @@ -42,7 +42,7 @@ backend.proxyProtocol dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> true @@ -164,7 +164,7 @@ backend.persistence_cookiemode dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> backend.persistence_cookiename @@ -186,14 +186,14 @@ backend.stickiness_pattern dropdown - HAProxy documentation for a full description.
    NOTE: Consider not using this feature in multi-process mode, it can result in random behaviours.
    ]]>
    + HAProxy documentation for a full description.
    NOTE: Consider not using this feature in multi-process mode, it can result in random behaviours.
    ]]>
    Choose a persistence type.
    backend.stickiness_dataTypes select_multiple - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> backend.stickiness_expire diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml index 4a12988a5c..14e6448499 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml @@ -322,14 +322,14 @@ frontend.stickiness_pattern dropdown - HAProxy documentation for further information.]]> + HAProxy documentation for further information.]]> Choose a stick-table type. frontend.stickiness_dataTypes select_multiple - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> frontend.stickiness_expire @@ -356,7 +356,7 @@ frontend.stickiness_counter_key text - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> true diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml index 49888d4e91..f571ce69c3 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml @@ -15,6 +15,6 @@ mapfile.content textbox - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index 59adaa8923..45d6749ef9 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -645,7 +645,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Lastly, enable HAProxy using the %sService%s settings page.') | format('', '') }}
  • {{ lang._('Please be aware that you need to %smanually%s add the required firewall rules for all configured services.') | format('', '') }}

    -

    {{ lang._('Further information is available in our %sHAProxy plugin documentation%s and of course in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '', '', '') }}

    +

    {{ lang._('Further information is available in our %sHAProxy plugin documentation%s and of course in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '', '', '') }}


    @@ -687,7 +687,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('%sConditions:%s HAProxy is capable of extracting data from requests, responses and other connection data and match it against predefined patterns. Use these powerful patterns to compose a condition that may be used in multiple Rules.') | format('', '') }}
  • {{ lang._('%sRules:%s Perform a large set of actions if one or more %sConditions%s match. These Rules may be used in %sBackend Pools%s as well as %sPublic Services%s.') | format('', '', '', '', '', '', '', '') }}
  • -

    {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    +

    {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    {{ lang._('Note that it is possible to directly add options to the HAProxy configuration by using the "option pass-through", a setting that is available for several configuration items. It allows you to implement configurations that are currently not officially supported by this plugin. It is strongly discouraged to rely on this feature. Please report missing features on our GitHub page!') | format('', '') }}


    @@ -702,7 +702,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('%sGroup:%s A optional list containing one or more users. Groups usually make it easier to manage permissions for a large number of users') | format('', '') }}
  • {{ lang._('Note that users and groups must be selected from the Backend Pool or Public Service configuration in order to be used for authentication. In addition to this users and groups may also be used in Rules/Conditions.') }}

    -

    {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    +

    {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}


    @@ -720,7 +720,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sCache:%s HAProxy's cache which was designed to perform cache on small objects (favicon, css, etc.). This is a minimalist low-maintenance cache which runs in RAM.") | format('', '', '', '') }}
  • {{ lang._("%sPeers:%s Configure a communication channel between two HAProxy instances. This will propagate entries of any data-types in stick-tables between these HAProxy instances over TCP connections in a multi-master fashion. Useful when aiming for a seamless failover in a HA setup.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}


    @@ -736,7 +736,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sCPU Affinity Rules:%s This feature makes it possible to bind HAProxy's processes/threads to a specific CPU (or a CPU set). Furthermore it is possible to select CPU Affinity Rules in %sPublic Services%s to restrict them to a certain set of processes/threads/CPUs.") | format('', '', '', '') }}
  • {{ lang._("%sResolvers:%s This feature allows in-depth configuration of how HAProxy handles name resolution and interacts with name resolvers (DNS). Each resolver configuration can be used in %sBackend Pools%s to apply individual name resolution configurations.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}


    From 470a8d204aa970f38ba5ffd4c143334c26b8f290 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 9 Feb 2021 23:32:59 +0100 Subject: [PATCH 0438/3088] net/haproxy: guard service against broken configs, add config diff --- net/haproxy/pkg-descr | 4 +++ .../OPNsense/HAProxy/Api/ExportController.php | 11 ++++++ .../app/views/OPNsense/HAProxy/export.volt | 36 +++++++++++++++++++ .../mvc/app/views/OPNsense/HAProxy/index.volt | 30 +++------------- .../scripts/OPNsense/HAProxy/setup.sh | 10 ++++++ .../conf/actions.d/actions_haproxy.conf | 18 ++++++---- .../templates/OPNsense/HAProxy/+TARGETS | 2 +- 7 files changed, 79 insertions(+), 32 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 122f677897..902dc499e7 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -14,9 +14,12 @@ Added: * add global option to enable old buggy behaviour for PROXY v2 connections * add support for HTTP/2 in health checks * add config export (#2035) +* add config diff +* guard against broken config by using a staging config file Fixed: * fix maintenance page (python error: 'list' object has no attribute 'strip') +* prevent service outage by aborting "Apply" when configtest fails Changed: * change default SSL version to TLSv1.2 (ssl-min-ver) @@ -26,6 +29,7 @@ Changed: * change default for tune.ssl.default-dh-param from 1024 to 2048 * use new "http-check send" command for HTTP health checks * change default for spreadChecks from 0 to 2 +* no longer overwrite live config file when running a syntax check 2.26 diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php index 89f9df4ca1..5a3cd58f9b 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php @@ -52,6 +52,17 @@ public function configAction() return array("response" => $response); } + /** + * get config diff + * @return string + */ + public function diffAction() + { + $backend = new Backend(); + $response = $backend->configdRun("haproxy configdiff"); + return array("response" => $response); + } + /** * download config file or config archive * @return array|mixed diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt index e9134da578..ccfbb5f95d 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt @@ -39,6 +39,35 @@ POSSIBILITY OF SUCH DAMAGE. } update_showconf(); + /** + * show HAProxy config diff + */ + function update_showdiff() { + ajaxCall(url="/api/haproxy/export/diff/", sendData={}, callback=function(data,status) { + diff = ''; + var lines = data['response'].split("\n"); + $.each(lines, function(n, line) { + switch(line.substring(0,1)) { + case '+': + color = '#3bbb33'; + break; + case '-': + color = '#c13928'; + break; + case '@': + color = '#3bb9c3'; + break; + default: + color = '#000000'; + } + diff += '' + line + '
    '; + + }); + $("#showdiff").append(diff); + }); + } + update_showdiff(); + /** * download HAProxy config */ @@ -66,6 +95,7 @@ POSSIBILITY OF SUCH DAMAGE.
    @@ -81,6 +111,12 @@ POSSIBILITY OF SUCH DAMAGE.
    +
    +
    +
    +
    +
    + {{ partial("layout_partials/base_dialog_processing") }} diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index 45d6749ef9..fe86bf89c0 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -313,29 +313,9 @@ POSSIBILITY OF SUCH DAMAGE. if (data['result'].indexOf('ALERT') > -1) { BootstrapDialog.show({ type: BootstrapDialog.TYPE_DANGER, - title: "{{ lang._('HAProxy config contains critical errors') }}", - message: "{{ lang._('The HAProxy service may not be able to start due to critical errors. Try anyway?') }}", + title: "{{ lang._('HAProxy configtest found critical errors') }}", + message: "{{ lang._('The HAProxy service may not be able to start due to critical errors. Run syntax check for further details.') }}", buttons: [{ - label: '{{ lang._('Continue') }}', - cssClass: 'btn-primary', - action: function(dlg){ - ajaxCall(url="/api/haproxy/service/reconfigure", sendData={}, callback=function(data,status) { - if (status != "success" || data['status'] != 'ok') { - BootstrapDialog.show({ - type: BootstrapDialog.TYPE_WARNING, - title: "{{ lang._('Error reconfiguring HAProxy') }}", - message: data['status'], - draggable: true - }); - } - }); - // when done, disable progress animation - $('[id*="reconfigureAct_progress"]').each(function(){ - $(this).removeClass("fa fa-spinner fa-pulse"); - }); - dlg.close(); - } - }, { icon: 'fa fa-trash-o', label: '{{ lang._('Abort') }}', action: function(dlg){ @@ -385,21 +365,21 @@ POSSIBILITY OF SUCH DAMAGE. if (data['result'].indexOf('ALERT') > -1) { BootstrapDialog.show({ type: BootstrapDialog.TYPE_DANGER, - title: "{{ lang._('HAProxy config contains critical errors') }}", + title: "{{ lang._('HAProxy configtest found critical errors') }}", message: data['result'], draggable: true }); } else if (data['result'].indexOf('WARNING') > -1) { BootstrapDialog.show({ type: BootstrapDialog.TYPE_WARNING, - title: "{{ lang._('HAProxy config contains minor errors') }}", + title: "{{ lang._('HAProxy configtest found minor errors') }}", message: data['result'], draggable: true }); } else { BootstrapDialog.show({ type: BootstrapDialog.TYPE_WARNING, - title: "{{ lang._('HAProxy config test result') }}", + title: "{{ lang._('HAProxy configtest result') }}", message: "{{ lang._('Your HAProxy config contains no errors.') }}", draggable: true }); diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/setup.sh b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/setup.sh index cb88ee64dc..ca8cd48dc8 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/setup.sh +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/setup.sh @@ -18,4 +18,14 @@ find /var/haproxy -type d -exec chmod 550 {} \; /usr/local/opnsense/scripts/OPNsense/HAProxy/exportErrorFiles.php > /dev/null 2>&1 /usr/local/opnsense/scripts/OPNsense/HAProxy/exportMapFiles.php > /dev/null 2>&1 +# deploy new config +case "$1" in +deploy) + # run syntax check against newly generated config + if /usr/local/sbin/haproxy -c -f /usr/local/etc/haproxy.conf.staging > /dev/null 2>&1; then + cp /usr/local/etc/haproxy.conf.staging /usr/local/etc/haproxy.conf + fi + ;; +esac + exit 0 diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index e23f091f61..07341474e7 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -5,7 +5,7 @@ type:script_output message:setup haproxy service requirements [start] -command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh start +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh deploy; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh start parameters: type:script message:starting haproxy @@ -17,19 +17,19 @@ type:script message:stopping haproxy [restart] -command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh restart +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh deploy; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh restart parameters: type:script message:restarting haproxy [reload] -command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh reload || /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh restart +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh deploy; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh reload || /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh restart parameters: type:script message:reloading haproxy [configtest] -command:/usr/local/etc/rc.d/haproxy configtest 2>&1 || exit 0 +command:/usr/local/sbin/haproxy -c -f /usr/local/etc/haproxy.conf.staging 2>&1 || exit 0 parameters: type:script_output message:testing haproxy configuration @@ -102,14 +102,20 @@ message:Sync ssl certificates into HAProxy memory for all frontends description:Sync ssl certificates changes into HAProxy memory [showconf] -command:test -f /usr/local/etc/haproxy.conf && cat /usr/local/etc/haproxy.conf +command:test -f /usr/local/etc/haproxy.conf.staging && cat /usr/local/etc/haproxy.conf.staging parameters: type:script_output message:show haproxy config [exportall] -command:/usr/local/bin/zip -r /tmp/haproxy_config_export.zip /tmp/haproxy /usr/local/etc/haproxy.conf +command:/usr/local/bin/zip -r /tmp/haproxy_config_export.zip /tmp/haproxy /usr/local/etc/haproxy.conf.staging parameters: type:script_output message:show haproxy config +[configdiff] +command:/usr/bin/diff -Naur /usr/local/etc/haproxy.conf /usr/local/etc/haproxy.conf.staging; exit 0 +parameters: +type:script_output +message:diff haproxy config + diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS index a8fa7728cf..389191f4d7 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS @@ -1,3 +1,3 @@ -haproxy.conf:/usr/local/etc/haproxy.conf +haproxy.conf:/usr/local/etc/haproxy.conf.staging rc.conf.d:/etc/rc.conf.d/haproxy sslCerts.yaml:/usr/local/etc/haproxy/sslCerts.yaml \ No newline at end of file From 9ae43dc1f8b14af6957893156eb8e3fc358d6ff3 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 10 Feb 2021 15:06:07 +0100 Subject: [PATCH 0439/3088] net/haproxy: add link to Config Diff page, fix direct tab links --- net/haproxy/pkg-descr | 1 + .../mvc/app/views/OPNsense/HAProxy/export.volt | 10 ++++++++++ .../mvc/app/views/OPNsense/HAProxy/index.volt | 2 +- .../mvc/app/views/OPNsense/HAProxy/statistics.volt | 11 +++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 902dc499e7..511582ebec 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -20,6 +20,7 @@ Added: Fixed: * fix maintenance page (python error: 'list' object has no attribute 'strip') * prevent service outage by aborting "Apply" when configtest fails +* fix direct links to individual statistics tabs Changed: * change default SSL version to TLSv1.2 (ssl-min-ver) diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt index ccfbb5f95d..9b4d7d0721 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt @@ -90,6 +90,16 @@ POSSIBILITY OF SUCH DAMAGE. }); }); + // update history on tab state and implement navigation + if(window.location.hash != "") { + $('a[href="' + window.location.hash + '"]').click() + } + $('.nav-tabs a').on('shown.bs.tab', function (e) { + history.pushState(null, null, e.target.hash); + }); + $(window).on('hashchange', function(e) { + $('a[href="' + window.location.hash + '"]').click() + }); }); diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index fe86bf89c0..e9fa6c2e09 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -314,7 +314,7 @@ POSSIBILITY OF SUCH DAMAGE. BootstrapDialog.show({ type: BootstrapDialog.TYPE_DANGER, title: "{{ lang._('HAProxy configtest found critical errors') }}", - message: "{{ lang._('The HAProxy service may not be able to start due to critical errors. Run syntax check for further details.') }}", + message: "{{ lang._('The HAProxy service may not be able to start due to critical errors. Run syntax check for further details or review the changes in the %sConfiguration Diff%s.')|format('','') }}", buttons: [{ icon: 'fa fa-trash-o', label: '{{ lang._('Abort') }}', diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/statistics.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/statistics.volt index 52be520da7..1f2c4085dd 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/statistics.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/statistics.volt @@ -157,6 +157,17 @@ POSSIBILITY OF SUCH DAMAGE. $("#update-status").click(); $("#update-counters").click(); $("#update-tables").click(); + + // update history on tab state and implement navigation + if(window.location.hash != "") { + $('a[href="' + window.location.hash + '"]').click() + } + $('.nav-tabs a').on('shown.bs.tab', function (e) { + history.pushState(null, null, e.target.hash); + }); + $(window).on('hashchange', function(e) { + $('a[href="' + window.location.hash + '"]').click() + }); }); From d5b7a679b86f9af1e46bf6920c37a38aa15d0ec9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 15 Feb 2021 23:44:28 +0100 Subject: [PATCH 0440/3088] net/haproxy: add basic OCSP stapling support, closes #1430 --- net/haproxy/pkg-descr | 2 + .../HAProxy/forms/generalSettings.xml | 6 ++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 4 ++ .../scripts/OPNsense/HAProxy/exportCerts.php | 6 ++ .../scripts/OPNsense/HAProxy/setup.sh | 9 +++ .../scripts/OPNsense/HAProxy/updateOcsp.sh | 70 +++++++++++++++++++ .../conf/actions.d/actions_haproxy.conf | 9 +++ .../templates/OPNsense/HAProxy/rc.conf.d | 5 ++ 8 files changed, 111 insertions(+) create mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 511582ebec..3c0d71c5f2 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -16,6 +16,7 @@ Added: * add config export (#2035) * add config diff * guard against broken config by using a staging config file +* add basic OCSP stapling support (#1430) Fixed: * fix maintenance page (python error: 'list' object has no attribute 'strip') @@ -31,6 +32,7 @@ Changed: * use new "http-check send" command for HTTP health checks * change default for spreadChecks from 0 to 2 * no longer overwrite live config file when running a syntax check +* make restart/reload commands usable in cron jobs 2.26 diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml index 78d7ce4b2a..5869a62e64 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml @@ -21,6 +21,12 @@ checkbox
    + + haproxy.general.storeOcsp + + checkbox + + haproxy.general.showIntro diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 3cb8e5b2e4..89d711a031 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -16,6 +16,10 @@ 0 Y + + 0 + N + 1 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportCerts.php b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportCerts.php index ea4c086f55..7bfa268199 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportCerts.php +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/exportCerts.php @@ -80,7 +80,13 @@ if (!empty((string)$cert->caref)) { $cert = (array)$cert; $ca = ca_chain($cert); + // append the CA to the certificate data $pem_content .= "\n" . $ca; + // additionally export CA to it's own file, + // not required for HAProxy, but makes OCSP handling easier + $output_ca_filename = $export_path . $cert_refid . ".issuer"; + file_put_contents($output_ca_filename, $ca); + chmod($output_ca_filename, 0600); } } // generate pem file for individual certs diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/setup.sh b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/setup.sh index ca8cd48dc8..8dc393461a 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/setup.sh +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/setup.sh @@ -1,5 +1,9 @@ #!/bin/sh +if [ -f /etc/rc.conf.d/haproxy ]; then +. /etc/rc.conf.d/haproxy +fi + # NOTE: Keep /var/haproxy on this list, see GH issue opnsense/plugins #39. HAPROXY_DIRS="/var/haproxy /var/haproxy/var/run /tmp/haproxy /tmp/haproxy/ssl /tmp/haproxy/lua /tmp/haproxy/errorfiles /tmp/haproxy/mapfiles" @@ -18,6 +22,11 @@ find /var/haproxy -type d -exec chmod 550 {} \; /usr/local/opnsense/scripts/OPNsense/HAProxy/exportErrorFiles.php > /dev/null 2>&1 /usr/local/opnsense/scripts/OPNsense/HAProxy/exportMapFiles.php > /dev/null 2>&1 +# update OCSP data +if [ "${haproxy_ocsp}" == "YES" ]; then + /usr/local/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh > /dev/null 2>&1 +fi + # deploy new config case "$1" in deploy) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh new file mode 100755 index 0000000000..12c4c8724e --- /dev/null +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# This file is based on: +# https://github.com/acmesh-official/acme.sh/blob/master/deploy/haproxy.sh +# +# Copyright (C) 2021 Neil Pang +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +HAPROXY_DIR="/tmp/haproxy/ssl" + +for _pem in "$HAPROXY_DIR"/*.pem; do + cert_file="$(basename "$_pem")" + _issuer="${HAPROXY_DIR}/${cert_file%.pem}.issuer" + _ocsp="${_pem}.ocsp" + cert_cn="$(openssl x509 -in "$_pem" -noout -text | sed -nE 's/.*Subject:.*CN = ([^,]*)(,.*)?$/\1/p')" + + if [ ! -f "$_issuer" ]; then + continue + fi + + if [ -r "${_issuer}" ]; then + _ocsp_url="$(openssl x509 -noout -ocsp_uri -in "$_pem")" + if [ -n "$_ocsp_url" ]; then + _ocsp_host="$(echo "$_ocsp_url" | cut -d/ -f3)" + subjectdn="$(openssl x509 -in "$_issuer" -subject -noout | cut -d'/' -f2,3,4,5,6,7,8,9,10)" + issuerdn="$(openssl x509 -in "$_issuer" -issuer -noout | cut -d'/' -f2,3,4,5,6,7,8,9,10)" + if [ "$subjectdn" = "$issuerdn" ]; then + _cafile_argument="-CAfile \"${_issuer}\"" + else + _cafile_argument="" + fi + _openssl_version=$(openssl version | cut -d' ' -f2) + _openssl_major=$(echo "${_openssl_version}" | cut -d '.' -f1) + _openssl_minor=$(echo "${_openssl_version}" | cut -d '.' -f2) + if [ "${_openssl_major}" -eq "1" ] && [ "${_openssl_minor}" -ge "1" ] || [ "${_openssl_major}" -ge "2" ]; then + _header_sep="=" + else + _header_sep=" " + fi + + _openssl_ocsp_cmd="openssl ocsp \ + -issuer \"${_issuer}\" \ + -cert \"${_pem}\" \ + -url \"${_ocsp_url}\" \ + -header Host${_header_sep}\"${_ocsp_host}\" \ + -respout \"${_ocsp}\" \ + -verify_other \"${_issuer}\" \ + ${_cafile_argument} \ + | grep -q \"${_pem}: good\"" + + eval "${_openssl_ocsp_cmd}" + _ret=$? + + if [ "${_ret}" != "0" ]; then + echo "Updating OCSP stapling failed with return code ${_ret}" + fi + fi + fi +done diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index 07341474e7..1e45bc9549 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -20,12 +20,14 @@ message:stopping haproxy command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh deploy; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh restart parameters: type:script +description:Restart HAProxy service message:restarting haproxy [reload] command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh deploy; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh reload || /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh restart parameters: type:script +description:Reload HAProxy service message:reloading haproxy [configtest] @@ -119,3 +121,10 @@ parameters: type:script_output message:diff haproxy config +[update_ocsp] +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh +parameters: +type:script_output +description:Update HAProxy OCSP data +message:update haproxy ocsp data + diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d index 50cee173c1..261881284a 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d @@ -3,6 +3,11 @@ haproxy_enable=YES haproxy_var_script="/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh" haproxy_pidfile="/var/run/haproxy.pid" haproxy_config="/usr/local/etc/haproxy.conf" +{% if helpers.exists('OPNsense.HAProxy.general.storeOcsp') and OPNsense.HAProxy.general.storeOcsp|default("0") == "1" %} +haproxy_ocsp=YES +{% else %} +haproxy_ocsp=NO +{% endif %} {% if helpers.exists('OPNsense.HAProxy.general.gracefulStop') and OPNsense.HAProxy.general.gracefulStop|default("0") == "1" %} haproxy_hardstop=NO {% else %} From bf6a08d3381910515f0c1ca33220a4612ae9ea82 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 18 Feb 2021 21:46:46 +0100 Subject: [PATCH 0441/3088] net/haproxy: show a message when config files are identical --- .../app/views/OPNsense/HAProxy/export.volt | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt index 9b4d7d0721..160d93df9b 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt @@ -45,24 +45,28 @@ POSSIBILITY OF SUCH DAMAGE. function update_showdiff() { ajaxCall(url="/api/haproxy/export/diff/", sendData={}, callback=function(data,status) { diff = ''; - var lines = data['response'].split("\n"); - $.each(lines, function(n, line) { - switch(line.substring(0,1)) { - case '+': - color = '#3bbb33'; - break; - case '-': - color = '#c13928'; - break; - case '@': - color = '#3bb9c3'; - break; - default: - color = '#000000'; - } - diff += '' + line + '
    '; - - }); + if (data['response'] && data['response'].trim()) { + var lines = data['response'].split("\n"); + $.each(lines, function(n, line) { + switch(line.substring(0,1)) { + case '+': + color = '#3bbb33'; + break; + case '-': + color = '#c13928'; + break; + case '@': + color = '#3bb9c3'; + break; + default: + color = '#000000'; + } + diff += '' + line + '
    '; + + }); + } else { + diff = "
    {{ lang._('New and old config files are identical.') }}
    "; + } $("#showdiff").append(diff); }); } From 8189ff71dff5c52f6bf4cd7f0c2d81a1229d3695 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 18 Feb 2021 23:24:44 +0100 Subject: [PATCH 0442/3088] net/haproxy: add support for e-mail alerts and mailers, closes #1669 --- net/haproxy/pkg-descr | 1 + .../HAProxy/Api/SettingsController.php | 30 ++++++++ .../OPNsense/HAProxy/IndexController.php | 1 + .../OPNsense/HAProxy/forms/dialogBackend.xml | 6 ++ .../OPNsense/HAProxy/forms/dialogMailer.xml | 61 ++++++++++++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 71 +++++++++++++++++++ .../app/models/OPNsense/HAProxy/Menu/Menu.xml | 1 + .../mvc/app/views/OPNsense/HAProxy/index.volt | 50 +++++++++++++ .../templates/OPNsense/HAProxy/haproxy.conf | 40 +++++++++++ 9 files changed, 261 insertions(+) create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMailer.xml diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 3c0d71c5f2..dab4836e58 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -17,6 +17,7 @@ Added: * add config diff * guard against broken config by using a staging config file * add basic OCSP stapling support (#1430) +* add support for e-mail alerts and mailers (#1669) Fixed: * fix maintenance page (python error: 'list' object has no attribute 'strip') diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php index ef5f8f65d4..0cd365dc45 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php @@ -409,4 +409,34 @@ public function searchresolversAction() { return $this->searchBase('resolvers.resolver', array('enabled', 'name', 'nameservers'), 'name'); } + + public function getmailerAction($uuid = null) + { + return $this->getBase('mailer', 'mailers.mailer', $uuid); + } + + public function setmailerAction($uuid) + { + return $this->setBase('mailer', 'mailers.mailer', $uuid); + } + + public function addmailerAction() + { + return $this->addBase('mailer', 'mailers.mailer'); + } + + public function delmailerAction($uuid) + { + return $this->delBase('mailers.mailer', $uuid); + } + + public function togglemailerAction($uuid, $enabled = null) + { + return $this->toggleBase('mailers.mailer', $uuid); + } + + public function searchmailersAction() + { + return $this->searchBase('mailers.mailer', array('enabled', 'name', 'mailservers', 'sender', 'recipient'), 'name'); + } } diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php index 141fac3e51..8e2b52f65b 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php @@ -53,6 +53,7 @@ public function indexAction() $this->view->formDialogGroup = $this->getForm("dialogGroup"); $this->view->formDialogHealthcheck = $this->getForm("dialogHealthcheck"); $this->view->formDialogLua = $this->getForm("dialogLua"); + $this->view->formDialogMailer = $this->getForm("dialogMailer"); $this->view->formDialogMapfile = $this->getForm("dialogMapfile"); $this->view->formDialogResolver = $this->getForm("dialogResolver"); $this->view->formDialogServer = $this->getForm("dialogServer"); diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index 4744fb03c6..a17a99b86c 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -119,6 +119,12 @@ true
    + + backend.linkedMailer + + dropdown + + header diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMailer.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMailer.xml new file mode 100644 index 0000000000..cbede5c7cc --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMailer.xml @@ -0,0 +1,61 @@ +
    + + mailer.enabled + + checkbox + Enable this mailer configuration. + + + mailer.name + + text + Choose a name for this mailer configuration. + + + mailer.description + + text + Choose a optional description for this mailer configuration. + + + mailer.mailservers + + select_multiple + + true + true + + Enter ip:port here. Finish with TAB. + + + mailer.sender + + text + + + + mailer.recipient + + text + + + + mailer.loglevel + + dropdown + + + + mailer.timeout + + text + + + + mailer.hostname + + text + + true + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 89d711a031..7e2086bd91 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -928,6 +928,18 @@ Please specify a value between 1 and 100. N + + + + + Related mailer not found + N + N + 0 N @@ -2623,5 +2635,64 @@ + + + + Y + + + 1 + Y + + + /^[^\t^,^;^\.^\[^\]^\{^\}]{1,255}$/u + Should be a string between 1 and 255 characters. + Y + + + N + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + + + Y + Y + Y + /^((([0-9a-zA-Z._\-\*:\[\]]+:[0-9]+(-[0-9]+)?)([,]){0,1}))*/u + lower + Please provide mailserver addresses, i.e. 192.168.1.1:25. + + + Y + + + Y + + + Y + alert + + emerg + alert + crit + err + warning + notice + info + debug + + + + 30 + 4 + 10000 + Please specify a value between 4 and 10000 seconds. + Y + + + N + + + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml index 520fcc7c3d..0d78bf3eb3 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Menu/Menu.xml @@ -21,6 +21,7 @@ + diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index e9fa6c2e09..bbb6586802 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -212,6 +212,19 @@ POSSIBILITY OF SUCH DAMAGE. } ); + $("#grid-mailers").UIBootgrid( + { search:'/api/haproxy/settings/searchMailers', + get:'/api/haproxy/settings/getMailer/', + set:'/api/haproxy/settings/setMailer/', + add:'/api/haproxy/settings/addMailer/', + del:'/api/haproxy/settings/delMailer/', + toggle:'/api/haproxy/settings/toggleMailer/', + options: { + rowCount:[10,25,50,100,500,1000] + } + } + ); + // hook into on-show event for dialog to extend layout. $('#DialogAcl').on('shown.bs.modal', function (e) { $("#acl\\.expression").change(function(){ @@ -608,6 +621,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Map Files') }}
  • {{ lang._('CPU Affinity Rules') }}
  • {{ lang._('Resolvers') }}
  • +
  • {{ lang._('E-Mail Alerts') }}
  • @@ -715,6 +729,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sMap Files:%s A map allows to map a data in input to an other one on output. For example, this makes it possible to map a large number of domains to backend pools without using the GUI. Map files need to be used in %sRules%s, otherwise they are ignored.") | format('', '', '', '') }}
  • {{ lang._("%sCPU Affinity Rules:%s This feature makes it possible to bind HAProxy's processes/threads to a specific CPU (or a CPU set). Furthermore it is possible to select CPU Affinity Rules in %sPublic Services%s to restrict them to a certain set of processes/threads/CPUs.") | format('', '', '', '') }}
  • {{ lang._("%sResolvers:%s This feature allows in-depth configuration of how HAProxy handles name resolution and interacts with name resolvers (DNS). Each resolver configuration can be used in %sBackend Pools%s to apply individual name resolution configurations.") | format('', '', '', '') }}
  • +
  • {{ lang._("%sE-Mail Alerts:%s It is possible to send email alerts when the state of servers changes. Each configuration can be used in %sBackend Pools%s to send e-mail alerts to the configured recipient.") | format('', '', '', '') }}
  • {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}


    @@ -1149,6 +1164,40 @@ POSSIBILITY OF SUCH DAMAGE. +
    + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Mailer ID') }}{{ lang._('Enabled') }}{{ lang._('Name') }}{{ lang._('Sender') }}{{ lang._('Recipient') }}{{ lang._('Commands') }}{{ lang._('ID') }}
    + + +
    +
    +
    + + +
    +
    +
    +
    +
    @@ -1242,3 +1291,4 @@ POSSIBILITY OF SUCH DAMAGE. {{ partial("layout_partials/base_dialog",['fields':formDialogMapfile,'id':'DialogMapfile','label':lang._('Edit Map File')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogCpu,'id':'DialogCpu','label':lang._('Edit CPU Affinity Rule')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogResolver,'id':'DialogResolver','label':lang._('Edit Resolver')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogMailer,'id':'DialogMailer','label':lang._('Edit E-Mail Alert')])}} diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 8f3ce54f14..64f07b7cb4 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1049,6 +1049,29 @@ resolvers {{resolver.id}} {% endfor %} {%- endif -%} +{# ############################### #} +{# MAILERS #} +{# ############################### #} + +{% if helpers.exists('OPNsense.HAProxy.mailers') %} +{% for mailer in helpers.toList('OPNsense.HAProxy.mailers.mailer') %} +{% if mailer.enabled == '1' %} +# Mailer: {{mailer.name}} +mailers {{mailer.id}} + timeout mail {{mailer.timeout}}s +{% if mailer.mailservers|default("") != "" %} +{% for mailserver in mailer.mailservers.split(",") %} + mailer {{mailserver}} {{mailserver}} +{% endfor %} +{% endif %} + +{% else %} +# Mailer (DISABLED): {{mailer.name}} + +{% endif %} +{% endfor %} +{%- endif -%} + {# ############################### #} {# FRONTENDS #} {# ############################### #} @@ -1353,6 +1376,23 @@ backend {{backend.name}} # health checking is DISABLED {% set healthcheck_enabled = '0' %} {% endif %} +{# # mailer #} +{% if backend.linkedMailer|default("") != "" %} +{% set mailer_data = helpers.getUUID(backend.linkedMailer) %} +{% if mailer_data == {} %} +# ERROR: mailer data not found ({{backend.linkedMailer}}) +{% elif mailer_data.enabled == '0' %} +# NOTE: specified mailer is disabled ({{mailer_data.name}}) +{% else %} + email-alert mailers {{mailer_data.id}} + email-alert from {{mailer_data.sender}} + email-alert to {{mailer_data.recipient}} + email-alert level {{mailer_data.loglevel}} +{% if mailer_data.hostname|default("") != "" %} + email-alert myhostname {{mailer_data.hostname}} +{% endif %} +{% endif %} +{% endif %} {# # NOTE: Usually the frontend and the backend are in the same mode, #} {# # but we have no way to know what frontend uses this backend. #} {# # Hence we can't automatically set the mode and thus need a #} From 63dde5fc65ec670a3f698cf7609d38dc8d0cc289 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 19 Feb 2021 00:18:01 +0100 Subject: [PATCH 0443/3088] net/haproxy: add support for custom header checks, closes #1907 --- net/haproxy/pkg-descr | 1 + .../OPNsense/HAProxy/forms/dialogAcl.xml | 85 +++++++++++++++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 55 ++++++++++++ .../templates/OPNsense/HAProxy/haproxy.conf | 35 ++++++++ 4 files changed, 176 insertions(+) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index dab4836e58..9ace5e7874 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -18,6 +18,7 @@ Added: * guard against broken config by using a staging config file * add basic OCSP stapling support (#1430) * add support for e-mail alerts and mailers (#1669) +* add support for custom header checks (#1907) Fixed: * fix maintenance page (python error: 'list' object has no attribute 'strip') diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml index a0a7a5b7c7..3d5bb47cd4 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml @@ -148,6 +148,91 @@ text + + + header + + + + acl.cust_hdr_beg_name + + text + + + + acl.cust_hdr_beg + + text + + + + + header + + + + acl.cust_hdr_end_name + + text + + + + acl.cust_hdr_end + + text + + + + + header + + + + acl.cust_hdr_name + + text + + + + acl.cust_hdr + + text + + + + + header + + + + acl.cust_hdr_reg_name + + text + + + + acl.cust_hdr_reg + + text + + + + + header + + + + acl.cust_hdr_sub_name + + text + + + + acl.cust_hdr_sub + + text + + header diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 7e2086bd91..211350c1f4 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1466,6 +1466,11 @@ Path regex Path contains subdir Path contains string + HTTP Header starts with + HTTP Header ends with + HTTP Header matches + HTTP Header regex + HTTP Header contains URL parameter contains SSL Client certificate is valid SSL Client certificate verify error result @@ -1563,6 +1568,56 @@ Should be a string between 1 and 255 characters. N + + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + N + + + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + N + + + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + N + + + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + N + + + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + N + + + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + N + + + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + N + + + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + N + + + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + N + + + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + N + /^.{1,4096}$/u N diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 64f07b7cb4..5dff7a2f7a 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -158,6 +158,41 @@ {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} +{% elif acl_data.expression == 'cust_hdr_beg' %} +{% if acl_data.cust_hdr_beg|default("") != "" and acl_data.cust_hdr_beg_name|default("") != "" %} +{% do acl_options.append('hdr_beg(' ~ acl_data.cust_hdr_beg_name ~ ') -i ' ~ acl_data.cust_hdr_beg) %} +{% else %} +{% set acl_enabled = '0' %} + # ERROR: missing parameters +{% endif %} +{% elif acl_data.expression == 'cust_hdr_end' %} +{% if acl_data.cust_hdr_end|default("") != "" and acl_data.cust_hdr_end_name|default("") %} +{% do acl_options.append('hdr_end(' ~ acl_data.cust_hdr_end_name ~ ') -i ' ~ acl_data.cust_hdr_end) %} +{% else %} +{% set acl_enabled = '0' %} + # ERROR: missing parameters +{% endif %} +{% elif acl_data.expression == 'cust_hdr' %} +{% if acl_data.cust_hdr|default("") != "" and acl_data.cust_hdr_name|default("") != "" %} +{% do acl_options.append('hdr(' ~ acl_data.cust_hdr_name ~ ') -i ' ~ acl_data.cust_hdr) %} +{% else %} +{% set acl_enabled = '0' %} + # ERROR: missing parameters +{% endif %} +{% elif acl_data.expression == 'cust_hdr_reg' %} +{% if acl_data.cust_hdr_reg|default("") != "" and acl_data.cust_hdr_reg_name|default("") != "" %} +{% do acl_options.append('hdr_reg(' ~ acl_data.cust_hdr_reg_name ~ ') -i ' ~ acl_data.cust_hdr_reg) %} +{% else %} +{% set acl_enabled = '0' %} + # ERROR: missing parameters +{% endif %} +{% elif acl_data.expression == 'cust_hdr_sub' %} +{% if acl_data.cust_hdr_sub|default("") != "" and acl_data.cust_hdr_sub_name|default("") != "" %} +{% do acl_options.append('hdr_sub(' ~ acl_data.cust_hdr_sub_name ~ ') -i ' ~ acl_data.cust_hdr_sub) %} +{% else %} +{% set acl_enabled = '0' %} + # ERROR: missing parameters +{% endif %} {% elif acl_data.expression == 'url_param' %} {% if acl_data.url_param_value|default("") != "" and acl_data.url_param|default("") != "" %} {% do acl_options.append('url_param(' ~ acl_data.url_param ~ ') -i ' ~ acl_data.url_param_value) %} From 1f07481bc3fe1ec012bfd162ac303434c2300e70 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 20 Feb 2021 01:41:14 +0100 Subject: [PATCH 0444/3088] net/haproxy: add support for server templates, closes #1975 --- net/haproxy/pkg-descr | 4 + .../HAProxy/Api/SettingsController.php | 2 +- .../OPNsense/HAProxy/forms/dialogBackend.xml | 16 + .../OPNsense/HAProxy/forms/dialogServer.xml | 58 +++- .../app/models/OPNsense/HAProxy/HAProxy.xml | 70 ++++- .../OPNsense/HAProxy/Migrations/M3_0_0.php | 44 +++ .../mvc/app/views/OPNsense/HAProxy/index.volt | 21 +- .../templates/OPNsense/HAProxy/haproxy.conf | 274 ++++++++++-------- 8 files changed, 358 insertions(+), 131 deletions(-) create mode 100644 net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_0_0.php diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 9ace5e7874..a8d97d6955 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -19,6 +19,9 @@ Added: * add basic OCSP stapling support (#1430) * add support for e-mail alerts and mailers (#1669) * add support for custom header checks (#1907) +* add support for server templates (#1975) +* add support for additional resolver options (#1975) +* add support for resolve-prefer option (#1975) Fixed: * fix maintenance page (python error: 'list' object has no attribute 'strip') @@ -35,6 +38,7 @@ Changed: * change default for spreadChecks from 0 to 2 * no longer overwrite live config file when running a syntax check * make restart/reload commands usable in cron jobs +* relax GUI input validation for servers, move validation to jinja template (#1975) 2.26 diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php index 0cd365dc45..e899a083d2 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php @@ -132,7 +132,7 @@ public function toggleServerAction($uuid, $enabled = null) public function searchServersAction() { - return $this->searchBase('servers.server', array('enabled', 'name', 'address', 'port', 'description'), 'name'); + return $this->searchBase('servers.server', array('enabled', 'name', 'type', 'address', 'port', 'description'), 'name'); } public function getHealthcheckAction($uuid = null) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index a17a99b86c..31e0eda988 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -61,6 +61,22 @@ true + + backend.resolverOpts + + select_multiple + + true + + Type option name or choose from list. + + + backend.resolvePrefer + + dropdown + + true + backend.source diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml index 0eede8c31d..1436580cf5 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml @@ -7,9 +7,9 @@ server.name - + text - Name to identify this server. + Name to identify a static server. When creating a server template, then this prefix is used for the server names to be built. server.description @@ -17,6 +17,17 @@ text Description for this server. + + server.type + + dropdown + Either configure a static server or a template to initialize multiple servers with shared parameters. + + + + header + + server.address @@ -24,6 +35,42 @@ Enter server address. + + + header + + + + server.serviceName + + text + + + + server.number + + text + + + + server.linkedResolver + + dropdown + + + + server.resolverOpts + + select_multiple + + true + + Type option name or choose from list. + + + + header + server.port @@ -36,6 +83,13 @@ dropdown + + server.resolvePrefer + + dropdown + + true + server.ssl diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 211350c1f4..e889fb8f9f 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -880,6 +880,24 @@ N N + + N + Y + Y + + allow-dup-ip + ignore-weight + prevent-dup-ip + + + + N + N + + prefer IPv4 + prefer IPv6 [default] + + /^((([0-9a-zA-Z._\-\*:]+)))*/u lower @@ -1197,7 +1215,7 @@
    /^([0-9a-zA-Z\.,_\-:]){0,1024}$/u Please specify a valid servername or IP address. - Y + N
    1 @@ -1213,7 +1231,7 @@ N - Y + N active active [default] @@ -1221,6 +1239,54 @@ disabled + + Y + static + + static + + + + + /^([0-9a-zA-Z\.,_\-:]){0,1024}$/u + Please specify a valid service name. + N + + + /^[0-9]+(-[0-9]+)?/u + Please specify a valid number or range. + N + + + + + + Related resolver not found + N + N + + + N + Y + Y + + allow-dup-ip + ignore-weight + prevent-dup-ip + + + + N + N + + prefer IPv4 + prefer IPv6 [default] + + 0 Y diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_0_0.php b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_0_0.php new file mode 100644 index 0000000000..fff7515d3e --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_0_0.php @@ -0,0 +1,44 @@ +getNodeByReference('servers.server')->iterateItems() as $server) { + $server->type = 'static'; + } + } +} diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index bbb6586802..63ff12973d 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -230,7 +230,6 @@ POSSIBILITY OF SUCH DAMAGE. $("#acl\\.expression").change(function(){ var service_id = 'table_' + $(this).val(); $(".expression_table").hide(); - // $(".table_"+$(this).val()).show(); $("."+service_id).show(); }); $("#acl\\.expression").change(); @@ -241,7 +240,6 @@ POSSIBILITY OF SUCH DAMAGE. $("#action\\.type").change(function(){ var service_id = 'table_' + $(this).val(); $(".type_table").hide(); - // $(".table_"+$(this).val()).show(); $("."+service_id).show(); }); $("#action\\.type").change(); @@ -308,6 +306,16 @@ POSSIBILITY OF SUCH DAMAGE. $("#healthcheck\\.type").change(); }) + // hook into on-show event for dialog to extend layout. + $('#DialogServer').on('shown.bs.modal', function (e) { + $("#server\\.type").change(function(){ + var service_id = 'table_server_type_' + $(this).val(); + $(".table_server_type").hide(); + $("."+service_id).show(); + }); + $("#server\\.type").change(); + }) + /*********************************************************************** * Commands **********************************************************************/ @@ -647,12 +655,12 @@ POSSIBILITY OF SUCH DAMAGE.

    {{ lang._('Real Servers') }}

    -

    {{ lang._('HAProxy needs to know which servers should be used to serve content. The following minimum information must be provided for each server:') }}

    +

    {{ lang._('HAProxy needs to know which servers should be used to serve content. Either add a static server configuration or use a template to initialize multiple servers at once. The latter one can also be used to discover the available services via DNS SRV records. The following minimum information must be provided for each server:') }}

      -
    • {{ lang._('%sFQDN or IP:%s The IP address or fully-qualified domain name that should be used when communicating with your server.') | format('', '') }}
    • -
    • {{ lang._('%sPort:%s The TCP or UDP port that should be used. If unset, the same port the client connected to will be used.') | format('', '') }}
    • +
    • {{ lang._('%sStatic Servers:%s The IP address or fully-qualified domain name that should be used when communicating with your server. Additionally the TCP or UDP port that should be used. If unset, the same port the client connected to will be used.') | format('', '') }}
    • +
    • {{ lang._('%sServer Templates:%s A prefix is required to build the server names. Additionally a service name or FQDN is required to identify the servers this template initializes') | format('', '') }}
    -

    {{ lang._("Please note that advanced mode settings allow you to disable a certain server or to configure it as a backup server in a Backend Pool. Another neat option is the possibility to adjust a server's weight relative to other servers in the same Backend Pool.") }}

    +

    {{ lang._("Please note that advanced mode settings allow you to adjust a server's weight relative to other servers in the same Backend Pool, in addition to fine-grained health check options.") }}

    {{ lang._('Note that it is possible to directly add options to the HAProxy configuration by using the "option pass-through", a setting that is available for several configuration items. It allows you to implement configurations that are currently not officially supported by this plugin. It is strongly discouraged to rely on this feature. Please report missing features on our GitHub page!') | format('', '') }}


    @@ -809,6 +817,7 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Enabled') }} {{ lang._('Server ID') }} {{ lang._('Server Name') }} + {{ lang._('Type') }} {{ lang._('Server Address') }} {{ lang._('Server Port') }} {{ lang._('Description') }} diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 5dff7a2f7a..c0d06021a2 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1496,135 +1496,169 @@ backend {{backend.name}} {% if server_data == {} %} # ERROR: server data not found ({{server}}) {% else %} -{# # collect optional server parameters #} -{% set server_options = [] %} -{# # check if health check is enabled #} -{% if healthcheck_enabled == '1' %} -{% do server_options.append('check') %} -{# # This can be configured in multiple places. #} -{# # Priority for which value is used: backend > server > health check #} -{% if backend.checkInterval|default("") != "" %} -{% do server_options.append('inter ' ~ backend.checkInterval) %} -{% elif server_data.checkInterval|default("") != "" %} -{% do server_options.append('inter ' ~ server_data.checkInterval) %} -{% elif healthcheck_data.interval|default("") != "" %} -{% do server_options.append('inter ' ~ healthcheck_data.interval) %} +{# # check if all required server parameters are set #} +{% if (server_data.type|default("") == 'static' and server_data.address|default("") == '') or (server_data.type|default("") == 'template' and (server_data.serviceName|default("") == '' or server_data.number|default("") == '')) %} +# ERROR: server is invalid, required parameters not set ({{server_data.name}}) +{% else %} +{# # server type #} +{% set server_basics = [] %} +{% if server_data.type|default("") == 'static' %} +{% do server_basics.append('server ' ~ server_data.name ~ ' ' ~ server_data.address) %} +{% else %} +{% do server_basics.append('server-template ' ~ server_data.name ~ ' ' ~ server_data.number ~ ' ' ~ server_data.serviceName) %} {% endif %} -{# # use a different interval when server is in DOWN state #} -{% if backend.checkDownInterval|default("") != "" %} -{% do server_options.append('downinter ' ~ backend.checkDownInterval) %} -{% elif server_data.checkDownInterval|default("") != "" %} -{% do server_options.append('downinter ' ~ server_data.checkDownInterval) %} +{# # collect optional server parameters #} +{% set server_options = [] %} +{# # check if health check is enabled #} +{% if healthcheck_enabled == '1' %} +{% do server_options.append('check') %} +{# # This can be configured in multiple places. #} +{# # Priority for which value is used: backend > server > health check #} +{% if backend.checkInterval|default("") != "" %} +{% do server_options.append('inter ' ~ backend.checkInterval) %} +{% elif server_data.checkInterval|default("") != "" %} +{% do server_options.append('inter ' ~ server_data.checkInterval) %} +{% elif healthcheck_data.interval|default("") != "" %} +{% do server_options.append('inter ' ~ healthcheck_data.interval) %} +{% endif %} +{# # use a different interval when server is in DOWN state #} +{% if backend.checkDownInterval|default("") != "" %} +{% do server_options.append('downinter ' ~ backend.checkDownInterval) %} +{% elif server_data.checkDownInterval|default("") != "" %} +{% do server_options.append('downinter ' ~ server_data.checkDownInterval) %} +{% endif %} +{# # unhealthy threshold #} +{% if backend.healthCheckFall|default("") != "" %} +{% do server_options.append('fall ' ~ backend.healthCheckFall) %} +{% endif %} +{# # healthy threshold #} +{% if backend.healthCheckRise|default("") != "" %} +{% do server_options.append('rise ' ~ backend.healthCheckRise) %} +{% endif %} +{# # use a different port for health check #} +{% if healthcheck_data.checkport|default("") != "" %} +{# # prefer port from health check template #} +{% do server_options.append('port ' ~ healthcheck_data.checkport) %} +{% elif server_data.checkport|default("") != "" %} +{% do server_options.append('port ' ~ server_data.checkport) %} +{% endif %} +{# # force SSL encryption for health checks #} +{% if healthcheck_data.force_ssl|default('') == '1' %} +{% do server_options.append('check-ssl ') %} +{% endif %} +{# # add all additions from healthchecks here #} +{% do server_options.append(healthcheck_additions|join(' ')) if healthcheck_additions.length != '0' %} {% endif %} -{# # unhealthy threshold #} -{% if backend.healthCheckFall|default("") != "" %} -{% do server_options.append('fall ' ~ backend.healthCheckFall) %} +{# # server weight #} +{% do server_options.append('weight ' ~ server_data.weight) if server_data.weight|default("") != "" %} +{# # server role/mode #} +{% if server_data.mode|default("") != 'active' %} +{% do server_options.append(server_data.mode) %} {% endif %} -{# # healthy threshold #} -{% if backend.healthCheckRise|default("") != "" %} -{% do server_options.append('rise ' ~ backend.healthCheckRise) %} +{# # server ssl communication #} +{% if server_data.ssl|default("") == '1' %} +{% do server_options.append('ssl') %} +{# # HTTP/2 #} +{% if backend.http2Enabled|default("") == '1' and backend.ba_advertised_protocols|default("") != "" %} +{# # convert protocols to HAProxy-compatible format #} +{% set alpn_options = backend.ba_advertised_protocols|replace('http10', 'http/1.0')|replace('http11', 'http/1.1') %} +{% do server_options.append('alpn ' ~ alpn_options) %} +{% endif %} +{# # HTTP/2 without TLS #} +{% elif backend.http2Enabled|default("") == '1' and backend.http2Enabled_nontls|default("") == '1' %} +{% do server_options.append('proto h2') %} {% endif %} -{# # use a different port for health check #} -{% if healthcheck_data.checkport|default("") != "" %} -{# # prefer port from health check template #} -{% do server_options.append('port ' ~ healthcheck_data.checkport) %} -{% elif server_data.checkport|default("") != "" %} -{% do server_options.append('port ' ~ server_data.checkport) %} +{# # ssl verification can be enabled for two reasons: #} +{# # 1. in server settings: to verify *all* communication to this server #} +{# # 2. in health checks: to verify *only* health check communication to this server #} +{# # When 1. is enabled, health checks are automatically secured. #} +{# # Use-case for 2: when using TCP for server communication, but HTTPS for health checks. #} +{% if server_data.ssl|default("") == '1' or (healthcheck_enabled == '1' and healthcheck_data.force_ssl|default('') == '1') %} +{# # get status of ssl verification #} +{% set ssl_verify_enabled = '0' %} +{% if helpers.exists('OPNsense.HAProxy.general.tuning.sslServerVerify') and OPNsense.HAProxy.general.tuning.sslServerVerify|default("") != 'ignore' %} +{# # NOTE: Global parameter overrides per-server configuration. #} +{% set ssl_verify_enabled = '1' if OPNsense.HAProxy.general.tuning.sslServerVerify|default("") == 'required' %} +{% elif server_data.sslVerify|default("") == '1' %} +{% set ssl_verify_enabled = '1' %} +{% endif %} +{# # configure ssl verification #} +{% if ssl_verify_enabled == '1' %} +{# # enable SSL verification #} +{% do server_options.append('verify required') %} +{# # check for SSL CA #} +{% if server_data.sslCA|default("") != "" %} +{% do server_options.append('ca-file /tmp/haproxy/ssl/' ~ server_data.id ~ '.calist') %} +{% else %} +{# # fallback to system CA Root Certificates #} +{% do server_options.append('ca-file /etc/ssl/cert.pem') %} +{% endif %} +{# # check for SSL CRL #} +{% if server_data.sslCRL|default("") != "" %} +{% do server_options.append('crl-file /tmp/haproxy/ssl/' ~ server_data.sslCRL ~ '.pem') %} +{% endif %} +{# # check for SSL client cert #} +{% if server_data.sslClientCertificate|default("") != "" %} +{% do server_options.append('crt /tmp/haproxy/ssl/' ~ server_data.sslClientCertificate ~ '.pem') %} +{% endif %} +{% else %} +{% do server_options.append('verify none') %} +{% endif %} {% endif %} -{# # force SSL encryption for health checks #} -{% if healthcheck_data.force_ssl|default('') == '1' %} -{% do server_options.append('check-ssl ') %} +{# # resolver #} +{% set resolver_id = '' %} +{% set resolver_opts = '' %} +{% if backend.linkedResolver|default("") != "" %} +{# # prefer backend configuration #} +{% set resolver_id = backend.linkedResolver %} +{% set resolver_opts = backend.resolverOpts %} +{% elif server_data.linkedResolver|default("") != "" and server_data.type|default("") == 'template' %} +{# # use resolver for server template #} +{% set resolver_id = server_data.linkedResolver %} +{% set resolver_opts = server_data.resolverOpts %} {% endif %} -{# # add all additions from healthchecks here #} -{% do server_options.append(healthcheck_additions|join(' ')) if healthcheck_additions.length != '0' %} -{% endif %} -{# # server weight #} -{% do server_options.append('weight ' ~ server_data.weight) if server_data.weight|default("") != "" %} -{# # server role/mode #} -{% if server_data.mode|default("") != 'active' %} -{% do server_options.append(server_data.mode) %} -{% endif %} -{# # server ssl communication #} -{% if server_data.ssl|default("") == '1' %} -{% do server_options.append('ssl') %} -{# # HTTP/2 #} -{% if backend.http2Enabled|default("") == '1' and backend.ba_advertised_protocols|default("") != "" %} -{# # convert protocols to HAProxy-compatible format #} -{% set alpn_options = backend.ba_advertised_protocols|replace('http10', 'http/1.0')|replace('http11', 'http/1.1') %} -{% do server_options.append('alpn ' ~ alpn_options) %} +{% if resolver_id != '' %} +{% set resolver_data = helpers.getUUID(resolver_id) %} +{% do server_options.append('resolvers ' ~ resolver_data.id) %} +{# # additional resolver options #} +{% if resolver_opts != '' %} +{% do server_options.append('resolve-opts ' ~ resolver_opts) %} +{% endif %} {% endif %} -{# # HTTP/2 without TLS #} -{% elif backend.http2Enabled|default("") == '1' and backend.http2Enabled_nontls|default("") == '1' %} -{% do server_options.append('proto h2') %} -{% endif %} -{# # ssl verification can be enabled for two reasons: #} -{# # 1. in server settings: to verify *all* communication to this server #} -{# # 2. in health checks: to verify *only* health check communication to this server #} -{# # When 1. is enabled, health checks are automatically secured. #} -{# # Use-case for 2: when using TCP for server communication, but HTTPS for health checks. #} -{% if server_data.ssl|default("") == '1' or (healthcheck_enabled == '1' and healthcheck_data.force_ssl|default('') == '1') %} -{# # get status of ssl verification #} -{% set ssl_verify_enabled = '0' %} -{% if helpers.exists('OPNsense.HAProxy.general.tuning.sslServerVerify') and OPNsense.HAProxy.general.tuning.sslServerVerify|default("") != 'ignore' %} -{# # NOTE: Global parameter overrides per-server configuration. #} -{% set ssl_verify_enabled = '1' if OPNsense.HAProxy.general.tuning.sslServerVerify|default("") == 'required' %} -{% elif server_data.sslVerify|default("") == '1' %} -{% set ssl_verify_enabled = '1' %} +{# # prefer selected IP family for DNS resolution #} +{% if backend.resolvePrefer|default("") != "" %} +{# # prefer backend configuration #} +{% do server_options.append('resolve-prefer ' ~ backend.resolvePrefer) %} +{% elif server_data.linkedResolver|default("") != "" %} +{% do server_options.append('resolve-prefer ' ~ server_data.resolvePrefer) %} {% endif %} -{# # configure ssl verification #} -{% if ssl_verify_enabled == '1' %} -{# # enable SSL verification #} -{% do server_options.append('verify required') %} -{# # check for SSL CA #} -{% if server_data.sslCA|default("") != "" %} -{% do server_options.append('ca-file /tmp/haproxy/ssl/' ~ server_data.id ~ '.calist') %} -{% else %} -{# # fallback to system CA Root Certificates #} -{% do server_options.append('ca-file /etc/ssl/cert.pem') %} -{% endif %} -{# # check for SSL CRL #} -{% if server_data.sslCRL|default("") != "" %} -{% do server_options.append('crl-file /tmp/haproxy/ssl/' ~ server_data.sslCRL ~ '.pem') %} -{% endif %} -{# # check for SSL client cert #} -{% if server_data.sslClientCertificate|default("") != "" %} -{% do server_options.append('crt /tmp/haproxy/ssl/' ~ server_data.sslClientCertificate ~ '.pem') %} -{% endif %} -{% else %} -{% do server_options.append('verify none') %} +{# # source address #} +{% if backend.source|default("") != "" %} +{# # prefer backend configuration #} +{% do server_options.append('source ' ~ backend.source) %} +{% elif server_data.source|default("") != "" %} +{% do server_options.append('source ' ~ server_data.source) %} +{% endif %} +{# # PROXY protocol #} +{% if backend.proxyProtocol|default("") == "v1" %} +{% do server_options.append('send-proxy') %} +{% do server_options.append('check-send-proxy') %} +{% elif backend.proxyProtocol|default("") == "v2" %} +{% do server_options.append('send-proxy-v2') %} +{% do server_options.append('check-send-proxy') %} +{% endif %} +{# # cookie-based persistence #} +{% if backend.persistence|default("") == "cookie" %} +{% do server_options.append('cookie ' ~ server_data.id|replace(".", "")) %} +{% endif %} +{# # server advanced options #} +{% if server_data.advanced|default("") != "" %} +{% do server_options.append(server_data.advanced) %} +{% endif %} +{# # server enabled? #} +{% if server_data.enabled == '1' %} + {{server_basics|join(' ')}}{% if backend.tuning_noport != '1' %}{% if server_data.port|default("") != "" %}:{{server_data.port}}{% endif %}{% endif %} {{server_options|join(' ')}} {% endif %} -{% endif %} -{# # resolver #} -{% if backend.linkedResolver|default("") != "" %} -{% set resolver_data = helpers.getUUID(backend.linkedResolver) %} -{% do server_options.append('resolvers ' ~ resolver_data.id) %} -{% endif %} -{# # source address #} -{% if backend.source|default("") != "" %} -{# # prefer backend configuration #} -{% do server_options.append('source ' ~ backend.source) %} -{% elif server_data.source|default("") != "" %} -{% do server_options.append('source ' ~ server_data.source) %} -{% endif %} -{# # PROXY protocol #} -{% if backend.proxyProtocol|default("") == "v1" %} -{% do server_options.append('send-proxy') %} -{% do server_options.append('check-send-proxy') %} -{% elif backend.proxyProtocol|default("") == "v2" %} -{% do server_options.append('send-proxy-v2') %} -{% do server_options.append('check-send-proxy') %} -{% endif %} -{# # cookie-based persistence #} -{% if backend.persistence|default("") == "cookie" %} -{% do server_options.append('cookie ' ~ server_data.id|replace(".", "")) %} -{% endif %} -{# # server advanced options #} -{% if server_data.advanced|default("") != "" %} -{% do server_options.append(server_data.advanced) %} -{% endif %} -{# # server enabled? #} -{% if server_data.enabled == '1' %} - server {{server_data.name}} {{server_data.address}}:{% if backend.tuning_noport != '1' %}{% if server_data.port|default("") != "" %}{{server_data.port}}{% endif %}{% endif %} {{server_options|join(' ')}} {% endif %} {% endif %} {% endfor %} From f39b0c1648c227ce2984d3851921416a5f49b53e Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 21 Feb 2021 23:50:00 +0100 Subject: [PATCH 0445/3088] net/haproxy: ignore mailers that are not in use, refs #1669 --- .../templates/OPNsense/HAProxy/haproxy.conf | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index c0d06021a2..091d1d4d06 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1091,15 +1091,31 @@ resolvers {{resolver.id}} {% if helpers.exists('OPNsense.HAProxy.mailers') %} {% for mailer in helpers.toList('OPNsense.HAProxy.mailers.mailer') %} {% if mailer.enabled == '1' %} +{# # check if mailer is configured in a backend #} +{% set ns = namespace(mailer_found=false) %} +{% if helpers.exists('OPNsense.HAProxy.backends') %} +{% for backend in helpers.toList('OPNsense.HAProxy.backends.backend') %} +{# # backend must be enabled #} +{% if backend.enabled == '1' and backend.linkedMailer|default('') == mailer['@uuid'] %} +{% set ns.mailer_found = True %} +{% endif %} +{% endfor %} +{% endif %} +{# # only add mailers that are in use to avoid config test warnings #} +{% if ns.mailer_found %} # Mailer: {{mailer.name}} mailers {{mailer.id}} timeout mail {{mailer.timeout}}s -{% if mailer.mailservers|default("") != "" %} -{% for mailserver in mailer.mailservers.split(",") %} +{% if mailer.mailservers|default("") != "" %} +{% for mailserver in mailer.mailservers.split(",") %} mailer {{mailserver}} {{mailserver}} -{% endfor %} -{% endif %} +{% endfor %} +{% endif %} + +{% else %} +# NOTE: Mailer {{mailer.name}} ignored: not configured in any backend +{% endif %} {% else %} # Mailer (DISABLED): {{mailer.name}} From 8433328437b2f82e4bfa88c77ba7ede91a93047d Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 22 Feb 2021 00:02:46 +0100 Subject: [PATCH 0446/3088] net/haproxy: show help text when no config file was found --- .../opnsense/mvc/app/views/OPNsense/HAProxy/export.volt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt index 160d93df9b..19c31de7a3 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/export.volt @@ -34,7 +34,13 @@ POSSIBILITY OF SUCH DAMAGE. */ function update_showconf() { ajaxCall(url="/api/haproxy/export/config/", sendData={}, callback=function(data,status) { - $("#showconf").text(data['response']); + if (data['response'] && data['response'].trim()) { + $("#showconf").text(data['response']); + } else { + conf_help = "
    {{ lang._('Config file not found. Run a syntax check to create it.') }}
    "; + $("#showconfempty").append(conf_help); + $("#showconf").hide(); + } }); } update_showconf(); @@ -116,6 +122,7 @@ POSSIBILITY OF SUCH DAMAGE.
    +
    
                 

    From 3c74cadb4121cc2f966e484ff26a4a9b363445e1 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 23 Feb 2021 17:04:53 +0100 Subject: [PATCH 0447/3088] net/haproxy: improve help text --- .../app/controllers/OPNsense/HAProxy/forms/generalSettings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml index 5869a62e64..d0efde12b2 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml @@ -25,7 +25,7 @@ haproxy.general.storeOcsp checkbox - + haproxy.general.showIntro From 4a88b924afbee46fb01655b049a5ed2f4b08e15d Mon Sep 17 00:00:00 2001 From: jkellerer Date: Tue, 23 Feb 2021 20:51:13 +0100 Subject: [PATCH 0448/3088] NodeExporter: Added ZFS toggle (defaults to off), fixes #1930 (#2071) * NodeExporter: Added ZFS toggle (defaults to off), fixes #1930 This change also fixes toggles for collectors that are enabled by default: cpu, exec, filesystem, loadavg, meminfo, netdev, time. * Update sysutils/node_exporter/Makefile * Update sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml * NodeExporter: Self-assigned plugin maintainer Co-authored-by: Franco Fichtner --- sysutils/node_exporter/Makefile | 5 ++- sysutils/node_exporter/pkg-descr | 30 ++++++++++++++++ .../OPNsense/NodeExporter/forms/general.xml | 6 ++++ .../models/OPNsense/NodeExporter/General.xml | 4 +++ .../OPNsense/NodeExporter/node_exporter | 35 +++++++++++-------- 5 files changed, 62 insertions(+), 18 deletions(-) diff --git a/sysutils/node_exporter/Makefile b/sysutils/node_exporter/Makefile index 0252194203..985de5c2e2 100644 --- a/sysutils/node_exporter/Makefile +++ b/sysutils/node_exporter/Makefile @@ -1,8 +1,7 @@ PLUGIN_NAME= node_exporter -PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= Prometheus exporter for machine metrics PLUGIN_DEPENDS= node_exporter -PLUGIN_MAINTAINER= dharrigan@gmail.com +PLUGIN_MAINTAINER= jkegh@k123.eu .include "../../Mk/plugins.mk" diff --git a/sysutils/node_exporter/pkg-descr b/sysutils/node_exporter/pkg-descr index 92c19ad602..16c736a183 100644 --- a/sysutils/node_exporter/pkg-descr +++ b/sysutils/node_exporter/pkg-descr @@ -2,3 +2,33 @@ Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors. WWW: https://github.com/prometheus/node_exporter + + +Changelog +--------- + +1.1 + +* Allow to toggle the "zfs" collector +* Fixed disabling collectors: + cpu + exec + filesystem + loadavg + meminfo + netdev + time + +1.0 + +* Node exporter server +* Allow to toggle collectors: + cpu + exec + filesystem + loadavg + meminfo + netdev + ntp + time + devstat diff --git a/sysutils/node_exporter/src/opnsense/mvc/app/controllers/OPNsense/NodeExporter/forms/general.xml b/sysutils/node_exporter/src/opnsense/mvc/app/controllers/OPNsense/NodeExporter/forms/general.xml index 97e4196c12..8269302b1a 100644 --- a/sysutils/node_exporter/src/opnsense/mvc/app/controllers/OPNsense/NodeExporter/forms/general.xml +++ b/sysutils/node_exporter/src/opnsense/mvc/app/controllers/OPNsense/NodeExporter/forms/general.xml @@ -77,4 +77,10 @@ checkbox Enable the NTP collector. + + general.zfs + + checkbox + Enable the ZFS collector. + diff --git a/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml b/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml index a2884f82f8..c47915f10b 100644 --- a/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml +++ b/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml @@ -62,5 +62,9 @@ 0 N + + 0 + N + diff --git a/sysutils/node_exporter/src/opnsense/service/templates/OPNsense/NodeExporter/node_exporter b/sysutils/node_exporter/src/opnsense/service/templates/OPNsense/NodeExporter/node_exporter index 0e74613f44..a5d3b02fcc 100644 --- a/sysutils/node_exporter/src/opnsense/service/templates/OPNsense/NodeExporter/node_exporter +++ b/sysutils/node_exporter/src/opnsense/service/templates/OPNsense/NodeExporter/node_exporter @@ -4,44 +4,49 @@ {% if helpers.exists('OPNsense.NodeExporter.enabled') and OPNsense.NodeExporter.enabled == '1' %} {%- set collector = "--collector." -%} +{%- set no_collector = "--no-collector." -%} -{%- if OPNsense.NodeExporter.cpu == '1' -%} - {%- set cpu = collector + "cpu " -%} +{%- if helpers.empty('OPNsense.NodeExporter.cpu') -%} + {%- set cpu = no_collector + "cpu " -%} {%- endif -%} -{%- if OPNsense.NodeExporter.exec == '1' -%} - {%- set exec = collector + "exec " -%} +{%- if helpers.empty('OPNsense.NodeExporter.exec') -%} + {%- set exec = no_collector + "exec " -%} {%- endif -%} -{%- if OPNsense.NodeExporter.filesystem == '1' -%} - {%- set filesystem = collector + "filesystem " -%} +{%- if helpers.empty('OPNsense.NodeExporter.filesystem') -%} + {%- set filesystem = no_collector + "filesystem " -%} {%- endif -%} -{%- if OPNsense.NodeExporter.loadavg == '1' -%} - {%- set loadavg = collector + "loadavg " -%} +{%- if helpers.empty('OPNsense.NodeExporter.loadavg') -%} + {%- set loadavg = no_collector + "loadavg " -%} {%- endif -%} -{%- if OPNsense.NodeExporter.meminfo == '1' -%} - {%- set meminfo = collector + "meminfo " -%} +{%- if helpers.empty('OPNsense.NodeExporter.meminfo') -%} + {%- set meminfo = no_collector + "meminfo " -%} {%- endif -%} -{%- if OPNsense.NodeExporter.netdev == '1' -%} - {%- set netdev = collector + "netdev " -%} +{%- if helpers.empty('OPNsense.NodeExporter.netdev') -%} + {%- set netdev = no_collector + "netdev " -%} {%- endif -%} {%- if OPNsense.NodeExporter.ntp == '1' -%} {%- set ntp = collector + "ntp " -%} {%- endif -%} -{%- if OPNsense.NodeExporter.time == '1' -%} - {%- set time = collector + "time " -%} +{%- if helpers.empty('OPNsense.NodeExporter.time') -%} + {%- set time = no_collector + "time " -%} {%- endif -%} {%- if OPNsense.NodeExporter.devstat == '1' -%} {%- set devstat = collector + "devstat " -%} {%- endif -%} -node_exporter_args="{{ cpu }}{{ exec }}{{ filesystem }}{{ loadavg }}{{ meminfo }}{{ netdev }}{{ ntp }}{{ time }}{{ devstat }}" +{%- if helpers.empty('OPNsense.NodeExporter.zfs') -%} + {%- set zfs = no_collector + "zfs " -%} +{%- endif -%} + +node_exporter_args="{{ cpu }}{{ exec }}{{ filesystem }}{{ loadavg }}{{ meminfo }}{{ netdev }}{{ ntp }}{{ time }}{{ devstat }}{{ zfs }}" node_exporter_listen_address="{{ OPNsense.NodeExporter.listenaddress }}:{{ OPNsense.NodeExporter.listenport }}" node_exporter_enable="YES" From 10b235e3d8fe267ed518f5a42c389a0929057ef4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Feb 2021 10:22:22 +0100 Subject: [PATCH 0449/3088] Framework: use -v rather than -V for full expansion --- Makefile | 4 ++-- Scripts/revbump.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 82aa061e95..76fc96735e 100644 --- a/Makefile +++ b/Makefile @@ -38,8 +38,8 @@ PLUGIN_DIRS+= ${_${CATEGORY}} list: .for PLUGIN_DIR in ${PLUGIN_DIRS} - @echo ${PLUGIN_DIR} -- $$(${MAKE} -C ${PLUGIN_DIR} -V PLUGIN_COMMENT) \ - $$(if [ -n "$$(${MAKE} -C ${PLUGIN_DIR} -V PLUGIN_DEVEL _PLUGIN_DEVEL=)" ]; then echo "(development only)"; fi) + @echo ${PLUGIN_DIR} -- $$(${MAKE} -C ${PLUGIN_DIR} -v PLUGIN_COMMENT) \ + $$(if [ -n "$$(${MAKE} -C ${PLUGIN_DIR} -v PLUGIN_DEVEL _PLUGIN_DEVEL=)" ]; then echo "(development only)"; fi) .endfor # shared targets that are sane to run from the root directory diff --git a/Scripts/revbump.sh b/Scripts/revbump.sh index 120b0fce41..31f1fa974f 100755 --- a/Scripts/revbump.sh +++ b/Scripts/revbump.sh @@ -8,7 +8,7 @@ if [ -z "${DIR}" ]; then DIR=. fi -REV=$(make -C ${DIR} -V PLUGIN_REVISION) +REV=$(make -C ${DIR} -v PLUGIN_REVISION) REV=$(expr ${REV} \+ 1) grep -v ^PLUGIN_REVISION ${DIR}/Makefile > ${DIR}/Makefile.tmp From a20b641219e0f03f14e7468ba1ba6374d3f70a78 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Feb 2021 10:25:41 +0100 Subject: [PATCH 0450/3088] net/haproxy: whitespace cleanups --- .../controllers/OPNsense/HAProxy/Api/ExportController.php | 2 +- .../scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py | 5 ++--- .../src/opnsense/service/conf/actions.d/actions_haproxy.conf | 1 - .../src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS | 2 +- .../service/templates/OPNsense/HAProxy/sslCerts.yaml | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php index 5a3cd58f9b..dbf6ed9152 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php @@ -68,7 +68,7 @@ public function diffAction() * @return array|mixed */ public function downloadAction($type) - { + { $backend = new Backend(); if ($type == 'config') { diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py index 18a175aeed..3277871636 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py @@ -48,7 +48,7 @@ def setUp(self): pKmFJ2e2VSnTZIBJvD58HMR+WNAEp7tHffHk2z/mPPtdRdxW5Zieoe5+6+HDtwgG +VCAIWMkC36Dvg== -----END CERTIFICATE----- - + -----BEGIN RSA PRIVATE KEY----- MIIJKgIBAAKCAgEAvsNKU59F2gpl1fzbk7hD64Q3zk1hH9Im1IsN9ppF5tqdsPPG n3Q8QgcKpnJ/SrtnPl4Xqp3bJyV20lJWTxuVU7ImM8g4tStQB4XojTtv8A4E7/wN @@ -100,8 +100,7 @@ def setUp(self): 9WYZS7hlKyqVBESJuonR15biy7Xov5ELl6A821cskZO3vTwtlBSeCDiqaeVLpKR3 aYwf5YZo7v+N8KBSLEdLNjoKK4PfXUdczD7uOUllbd4/MRgCn4EmFvmpljGiEQ== -----END RSA PRIVATE KEY----- - - + -----BEGIN CERTIFICATE----- MIIEqzCCApOgAwIBAgIRAIvhKg5ZRO08VGQx8JdhT+UwDQYJKoZIhvcNAQELBQAw GjEYMBYGA1UEAwwPRmFrZSBMRSBSb290IFgxMB4XDTE2MDUyMzIyMDc1OVoXDTM2 diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index 1e45bc9549..fcd742c0c1 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -127,4 +127,3 @@ parameters: type:script_output description:Update HAProxy OCSP data message:update haproxy ocsp data - diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS index 389191f4d7..b42f343eb9 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/+TARGETS @@ -1,3 +1,3 @@ haproxy.conf:/usr/local/etc/haproxy.conf.staging rc.conf.d:/etc/rc.conf.d/haproxy -sslCerts.yaml:/usr/local/etc/haproxy/sslCerts.yaml \ No newline at end of file +sslCerts.yaml:/usr/local/etc/haproxy/sslCerts.yaml diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml index 56fed45739..fd766e0025 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/sslCerts.yaml @@ -58,4 +58,4 @@ frontends: {% endfor %} {% else %} frontends: {} -{% endif %} \ No newline at end of file +{% endif %} From 2f888b6092563b747ab84e0400eb8832437478ed Mon Sep 17 00:00:00 2001 From: Andreas Stuerz Date: Thu, 25 Feb 2021 17:02:55 +0100 Subject: [PATCH 0451/3088] add show diff single add apply diff single --- .../HAProxy/Api/MaintenanceController.php | 74 +++++- .../views/OPNsense/HAProxy/maintenance.volt | 138 +++++++++- .../scripts/OPNsense/HAProxy/syncCerts.py | 250 ++++++++++++++---- .../conf/actions.d/actions_haproxy.conf | 16 +- 4 files changed, 417 insertions(+), 61 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php index 0a2e180da6..ce3977ecab 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php @@ -41,6 +41,18 @@ */ class MaintenanceController extends ApiControllerBase { + /** + * jQuery bootstrap certificates diff list + * @return array|mixed + */ + public function searchCertificateDiffAction() + { + return $this->getData( + ["cert_diff_list"], + ["rowCount", "current", "searchPhrase", "sort"] + ); + } + /** * jQuery bootstrap server list * @return array|mixed @@ -53,6 +65,42 @@ public function searchServerAction() ); } + /** + * sync certificate for frontends + * @return array|mixed + */ + public function certSyncAction() + { + return $this->syncCerts( + ["cert_sync"], + ["frontend_ids"] + ); + } + + /** + * show certificate diff for frontends + * @return array|mixed + */ + public function certDiffAction() + { + return $this->getData( + ["cert_diff"], + ["frontend_ids"] + ); + } + + /** + * show certificate actions for frontends + * @return array|mixed + */ + public function certActionsAction() + { + return $this->getData( + ["cert_actions"], + ["frontend_ids"] + ); + } + /** * set server weight * @return array|mixed @@ -145,7 +193,7 @@ protected function getData(array $command, array $arguments = []) } /** - * Executes a backend command to save data + * Executes a backend command which returns output on error * @param array $command * @param array $arguments * @return array|string[] @@ -167,4 +215,28 @@ protected function saveData(array $command, array $arguments = []) "message" => 'only accept POST Requests.' ]; } + + /** + * Executes a ssl certificate sync + * @param array $command + * @param array $arguments + * @return array|string[] + */ + protected function syncCerts(array $command, array $arguments = []) + { + if ($this->request->isPost()) { + $output = $this->safeBackendCmd($command, $arguments); + $result = json_decode($output, true); + + return [ + "status" => "ok", + "result" => $result, + ]; + } + return [ + "status" => 'unavailable', + "message" => 'only accept POST Requests.' + ]; + } + } diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt index 63c870e6df..30ac21b465 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt @@ -26,9 +26,114 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #} - From 5cb97e8110cb11c34da9379ea4d5f2000edaefdf Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 2 Mar 2021 17:02:36 +0100 Subject: [PATCH 0465/3088] net/haproxy: use a consistent wording throughout (GUI only, backend unchanged) While here, improve visibility of important table data in maintenance page. --- .../views/OPNsense/HAProxy/maintenance.volt | 26 +++++++++---------- .../conf/actions.d/actions_haproxy.conf | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt index 9db0cab18b..7934afc067 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt @@ -64,7 +64,7 @@ POSSIBILITY OF SUCH DAMAGE. $.post('/api/haproxy/maintenance/certDiff', payload, function(data) { BootstrapDialog.show({ type: BootstrapDialog.TYPE_INFO, - title: "{{ lang._('Diff between configured and active ssl certificates') }}", + title: "{{ lang._('Diff between configured and active SSL certificates') }}", message: `
    ${data}
    `, buttons: [{ label: '{{ lang._('Close') }}', @@ -80,7 +80,7 @@ POSSIBILITY OF SUCH DAMAGE. $.post('/api/haproxy/maintenance/certActions', payload, function(data_actions) { question = '' question += `
    ${data_actions}
    `; - question += '{{ lang._('Apply ssl certificates to HaProxy?') }}

    '; + question += '{{ lang._('Apply SSL certificates to HAProxy?') }}

    '; stdDialogConfirm('{{ lang._('Confirmation Required') }}', question, @@ -92,7 +92,7 @@ POSSIBILITY OF SUCH DAMAGE. var error_msg = syncErrorMessage(data.result.modified, data.result.deleted); BootstrapDialog.show({ type: BootstrapDialog.TYPE_DANGER, - title: "{{ lang._('Error applying ssl certificates to HAProxy') }}", + title: "{{ lang._('Error applying SSL certificates to HAProxy') }}", message: error_msg, buttons: [{ label: '{{ lang._('Close') }}', @@ -124,8 +124,8 @@ POSSIBILITY OF SUCH DAMAGE. formatters: { "commands": function (column, row) { buttons = "" - buttons += "" - buttons += " " + buttons += "" + buttons += " " return buttons; }, }, @@ -202,7 +202,7 @@ POSSIBILITY OF SUCH DAMAGE. var error_msg = syncErrorMessage(data.result.modified, data.result.deleted); BootstrapDialog.show({ type: BootstrapDialog.TYPE_DANGER, - title: "{{ lang._('Error applying ssl certificates to HAProxy') }}", + title: "{{ lang._('Error applying SSL certificates to HAProxy') }}", message: error_msg, buttons: [{ label: '{{ lang._('Close') }}', @@ -344,7 +344,7 @@ POSSIBILITY OF SUCH DAMAGE. }); question += ''; question += '{{ lang._('State: ') }}' + state + '

    '; - question += '{{ lang._('Set administrative state for all selected server?') }}

    '; + question += '{{ lang._('Set administrative state for all selected servers?') }}

    '; stdDialogConfirm('{{ lang._('Confirmation Required') }}', question, @@ -389,7 +389,7 @@ POSSIBILITY OF SUCH DAMAGE. question += '
    '; question += ''; question += '
    '; - question += '{{ lang._('Set weight for all selected server?') }}

    '; + question += '{{ lang._('Set weight for all selected servers?') }}

    '; stdDialogConfirm('{{ lang._('Confirmation Required') }}', question, @@ -451,11 +451,11 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('id') }} - {{ lang._('Proxy') }} - {{ lang._('Server') }} + {{ lang._('Virtual Service') }} + {{ lang._('Real Server') }} {{ lang._('Address') }} {{ lang._('Status') }} - {{ lang._('Check Status') }} + {{ lang._('Check Status') }} {{ lang._('Weight') }} {{ lang._('Sessions') }} {{ lang._('Bytes in') }} @@ -501,8 +501,8 @@ POSSIBILITY OF SUCH DAMAGE. - - + + diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index ac6bd8336e..a9f3c5b25b 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -113,7 +113,7 @@ command:configctl template reload OPNsense/HAProxy 2 > /dev/null; /usr/local/opn parameters: type:script_output message:Sync ssl certificates into HAProxy memory for all frontends -description:Sync ssl certificates changes into HAProxy memory +description:Sync SSL certificate changes into running HAProxy service [showconf] command:test -f /usr/local/etc/haproxy.conf.staging && cat /usr/local/etc/haproxy.conf.staging From 89534c805a9fe52755bdbbbfa599b39ea7018876 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 3 Mar 2021 16:17:48 +0100 Subject: [PATCH 0466/3088] add pre-defined cron jobs to maintenance page --- net/haproxy/pkg-descr | 1 + .../HAProxy/Api/MaintenanceController.php | 104 +++++++++++++++++- .../HAProxy/MaintenanceController.php | 1 + .../HAProxy/forms/maintenanceCronjobs.xml | 46 ++++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 76 +++++++++++++ .../views/OPNsense/HAProxy/maintenance.volt | 84 +++++++++++++- 6 files changed, 309 insertions(+), 3 deletions(-) create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/maintenanceCronjobs.xml diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 4fc52805dc..4e83fe3062 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -23,6 +23,7 @@ Added: * add support for server templates (#1975) * add support for additional resolver options (#1975) * add support for resolve-prefer option (#1975) +* add pre-defined cron jobs to maintenance page Fixed: * prevent service outage by aborting "Apply" when configtest fails diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php index c727e60176..1aac6f4ec7 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php @@ -31,16 +31,21 @@ namespace OPNsense\HAProxy\Api; -use OPNsense\Base\ApiControllerBase; +use OPNsense\Base\ApiMutableModelControllerBase; use OPNsense\Core\Backend; +use OPNsense\Core\Config; +use OPNsense\Cron\Cron; use OPNsense\HAProxy\HAProxy; /** * Class MaintenanceController * @package OPNsense\HAProxy */ -class MaintenanceController extends ApiControllerBase +class MaintenanceController extends ApiMutableModelControllerBase { + protected static $internalModelName = 'haproxy'; + protected static $internalModelClass = '\OPNsense\HAProxy\HAProxy'; + /** * jQuery bootstrap certificates diff list * @return array|mixed @@ -268,4 +273,99 @@ protected function syncCerts(array $command, array $arguments = []) ]; } + /** + * create new cron job or return already available one + * @return array status action + */ + public function fetchCronIntegrationAction() + { + $result = array("result" => "no change"); + + if ($this->request->isPost()) { + $mdlHaproxy = $this->getModel(); + $backend = new Backend(); + + // Define possible cron jobs with their configd actions + $cronjobs = array( + 'syncCerts' => 'cert_sync_bulk', + 'updateOcsp' => 'update_ocsp', + 'reloadService' => 'reload', + 'restartService' => 'restart', + ); + + // Iterate over all possible cron jobs + foreach ($cronjobs as $cron => $cron_action) { + + // Name of the item that holds the cron UUID + $cron_ref = "${cron}Cron"; + + // Check if the cron job is enabled or disabled + if ((string)$mdlHaproxy->maintenance->cronjobs->$cron == "1") { + // Check if a cron job already exists + if ((string)$mdlHaproxy->maintenance->cronjobs->$cron_ref == "") { + + // Create new cron job + $mdlCron = new Cron(); + // NOTE: Only configd actions are valid commands for cronjobs + // and they *must* provide a description that is not empty. + $cron_uuid = $mdlCron->newDailyJob( + "HAProxy", + "haproxy ${cron_action}", + "Added by HAProxy plugin", + "*", + "1" + ); + $mdlHaproxy->maintenance->cronjobs->$cron_ref = $cron_uuid; + + // Save updated configuration. + if ($mdlCron->performValidation()->count() == 0) { + $mdlCron->serializeToConfig(); + // save data to config, do not validate because the current in memory model doesn't know about the + // cron item just created. + $mdlHaproxy->serializeToConfig($validateFullModel = false, $disable_validation = true); + Config::getInstance()->save(); + // Refresh the crontab + $backend->configdRun('template reload OPNsense/Cron'); + // (res)start daemon + $backend->configdRun("cron restart"); + $this->getLogger()->error("HAProxy: successfully created cron job $cron ($cron_uuid)"); + $result['result'] = "new"; + $result['uuid'] = $cron_uuid; + } else { + $this->getLogger()->error("HAProxy: unable to create cron job $cron"); + $result['result'] = "unable to add cron"; + } + } + } else { + // Check if a cron job exists + if ((string)$mdlHaproxy->maintenance->cronjobs->$cron_ref != "") { + + // Clean existin entry + $cron_uuid = (string)$mdlHaproxy->maintenance->cronjobs->$cron_ref; + $mdlHaproxy->maintenance->cronjobs->$cron_ref = ""; + + // Delete the cronjob item + $mdlCron = new Cron(); + if ($mdlCron->jobs->job->del($cron_uuid)) { + // If item is removed, serialize to config and save + $mdlCron->serializeToConfig(); + $mdlHaproxy->serializeToConfig($validateFullModel = false, $disable_validation = true); + Config::getInstance()->save(); + // Regenerate the crontab + $backend->configdRun('template reload OPNsense/Cron'); + // (res)start daemon + $backend->configdRun("cron restart"); + $this->getLogger()->error("HAProxy: successfully deleted cron job $cron ($cron_uuid)"); + $result['result'] = "deleted"; + } else { + $this->getLogger()->error("HAProxy: unable to delete cron job $cron ($cron_uuid)"); + $result['result'] = "unable to delete cron"; + } + } + } + } + } + + return $result; + } } diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/MaintenanceController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/MaintenanceController.php index d5a073cc78..92ef3a0511 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/MaintenanceController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/MaintenanceController.php @@ -41,5 +41,6 @@ public function indexAction() { // choose template $this->view->pick('OPNsense/HAProxy/maintenance'); + $this->view->maintenanceCronjobsForm = $this->getForm("maintenanceCronjobs"); } } diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/maintenanceCronjobs.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/maintenanceCronjobs.xml new file mode 100644 index 0000000000..f9c4edf83f --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/maintenanceCronjobs.xml @@ -0,0 +1,46 @@ +
    + + + header + + + + haproxy.maintenance.cronjobs.syncCerts + + checkbox + Automation instead of this cron job.]]> + + + + header + + + + haproxy.maintenance.cronjobs.updateOcsp + + checkbox + HAProxy service settings.]]> + + + + header + + + + haproxy.maintenance.cronjobs.reloadService + + checkbox + + + + + header + + + + haproxy.maintenance.cronjobs.restartService + + checkbox + + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index e889fb8f9f..8c172b6cfd 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -2815,5 +2815,81 @@ + + + + 0 + N + + + + + OPNsense.Cron.Cron + jobs.job + description + + /HAProxy/ + + + + Related cron not found. + N + + + 0 + N + + + + + OPNsense.Cron.Cron + jobs.job + description + + /HAProxy/ + + + + Related cron not found. + N + + + 0 + N + + + + + OPNsense.Cron.Cron + jobs.job + description + + /HAProxy/ + + + + Related cron not found. + N + + + 0 + N + + + + + OPNsense.Cron.Cron + jobs.job + description + + /HAProxy/ + + + + Related cron not found. + N + + + diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt index 7934afc067..159a67159a 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt @@ -28,6 +28,72 @@ POSSIBILITY OF SUCH DAMAGE. #}
    @@ -514,6 +581,21 @@ POSSIBILITY OF SUCH DAMAGE.
    + +
    +
    + {{ partial("layout_partials/base_form",['fields':maintenanceCronjobsForm,'id':'frm_cronjobs'])}} +
    +
    + +
    +
    +
    + {{ lang._('%sNOTE:%s When enabling multiple cron jobs, please adjust them so that they do not run at the same time. Check the %scron settings page%s for more cron job details and additional customization options.') | format('', '', '', '') }} +
    +
    +
    +
    {{ partial("layout_partials/base_dialog_processing") }} From e2feb5e5b858c2366d69e26de0209c1e2a79af1a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 5 Mar 2021 00:05:23 +0100 Subject: [PATCH 0467/3088] net/haproxy: add inline command help, shorten tooltips --- .../views/OPNsense/HAProxy/maintenance.volt | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt index 159a67159a..3ab54d181c 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt @@ -51,7 +51,7 @@ POSSIBILITY OF SUCH DAMAGE. content_id = "[id=\"haproxy.maintenance.cronjobs." + key + "\"]"; $(content_id).each(function(){ // Finally add the link to the cron job edit page. - cron_link = "
    {{ lang._('Configure cron job') }}"; + cron_link = "
    {{ lang._('Configure cron job') }}"; $(this).closest("td").append(cron_link); }); }; @@ -190,8 +190,8 @@ POSSIBILITY OF SUCH DAMAGE. formatters: { "commands": function (column, row) { buttons = "" - buttons += "" - buttons += " " + buttons += "" + buttons += " " return buttons; }, }, @@ -300,10 +300,10 @@ POSSIBILITY OF SUCH DAMAGE. formatters: { "commands": function (column, row) { buttons = "" - buttons += "" - buttons += " " - buttons += " " - buttons += " " + buttons += "" + buttons += " " + buttons += " " + buttons += " " return buttons; }, }, @@ -539,14 +539,24 @@ POSSIBILITY OF SUCH DAMAGE. - - - - + + + + +
    +

    {{ lang._("%sChoose a command to change a server's state in runtime:%s") | format('', '') }}

    +
      +
    • {{ lang._('%sSet state to ready:%s This puts the server in normal mode.') | format('', '') }}
    • +
    • {{ lang._('%sSet state to drain:%s This removes the server from load balancing. Health checks will continue to run and it still accepts new persistent connections.') | format('', '') }}
    • +
    • {{ lang._('%sSet state to maintenance:%s This disables any traffic to the server. Health checks will also be disabled.') | format('', '') }}
    • +
    • {{ lang._("%sChange server weight:%s Adjust the server's weight relative to other servers. Servers will receive a load proportional to their weight.") | format('', '') }}
    • +
    +

    {{ lang._('%sNOTE:%s These changes will not be persisted across restarts of HAProxy.') | format('', '') }}

    +
    @@ -568,8 +578,8 @@ POSSIBILITY OF SUCH DAMAGE. - - + + @@ -580,6 +590,14 @@ POSSIBILITY OF SUCH DAMAGE.

    +
    +

    {{ lang._("%sApply SSL certificate changes in runtime:%s") | format('', '') }}

    +
      +
    • {{ lang._('%sShow diff:%s Show difference between configured SSL certificates and SSL certificates from the running HAProxy service.') | format('', '') }}
    • +
    • {{ lang._('%sApply changes:%s Apply all changes by syncing all shown SSL certificates into running HAProxy service.') | format('', '') }}
    • +
    +

    {{ lang._('%sNOTE:%s Changes can only be applied for Public Services that already exist in the running HAProxy service. When adding or removing Public Services HAProxy must be reloaded or restarted.') | format('', '') }}

    +
    From 40e943a2f1089ef1abbb3ac51512b8beeeae771c Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 5 Mar 2021 00:42:18 +0100 Subject: [PATCH 0468/3088] security/acme-client: quality of life improvements for cron handling, refs #2178 --- security/acme-client/pkg-descr | 8 ++++++++ .../OPNsense/AcmeClient/Api/SettingsController.php | 6 +++++- .../mvc/app/views/OPNsense/AcmeClient/settings.volt | 10 ++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index f830046bf5..0be03d6644 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,14 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +2.5 + +Fixed: +* ensure that the auto renewal cron job is properly disabled (#2178) + +Changed: +* reload settings page to show/hide cron tab + 2.4 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php index 3dcd37d54c..3dee7cfb25 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php @@ -86,6 +86,8 @@ public function fetchCronIntegrationAction() Config::getInstance()->save(); // Refresh the crontab $backend->configdRun('template reload OPNsense/Cron'); + // (res)start daemon + $backend->configdRun("cron restart"); $result['result'] = "new"; $result['uuid'] = $cron_uuid; } else { @@ -99,7 +101,7 @@ public function fetchCronIntegrationAction() ) { // Get UUID, clean existin entry $cron_uuid = (string)$mdlAcme->settings->UpdateCron; - $mdlAcme->settings->UpdateCron = null; + $mdlAcme->settings->UpdateCron = ""; $mdlCron = new Cron(); // Delete the cronjob item if ($mdlCron->jobs->job->del($cron_uuid)) { @@ -109,6 +111,8 @@ public function fetchCronIntegrationAction() Config::getInstance()->save(); // Regenerate the crontab $backend->configdRun('template reload OPNsense/Cron'); + // (res)start daemon + $backend->configdRun("cron restart"); $result['result'] = "deleted"; } else { $result['result'] = "unable to delete cron"; diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt index bb67c87c0f..2800f4cbef 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt @@ -54,8 +54,6 @@ POSSIBILITY OF SUCH DAMAGE. // Save & reconfigure acme-client to activate changes $("#reconfigureAct").click(function(){ - // TODO: reload the page afterwards to show/hide the "Schedule" tab - // set progress animation $('[id*="reconfigureAct_progress"]').each(function(){ $(this).addClass("fa fa-spinner fa-pulse"); @@ -99,6 +97,10 @@ POSSIBILITY OF SUCH DAMAGE. // when done, disable progress animation $('[id*="reconfigureAct_progress"]').each(function(){ $(this).removeClass("fa fa-spinner fa-pulse"); + // reload page to show or hide links to cron edit page + setTimeout(function () { + window.location.reload(true) + }, 300); }); dlg.close(); } @@ -132,6 +134,10 @@ POSSIBILITY OF SUCH DAMAGE. // when done, disable progress animation $('[id*="reconfigureAct_progress"]').each(function(){ $(this).removeClass("fa fa-spinner fa-pulse"); + // reload page to show or hide links to cron edit page + setTimeout(function () { + window.location.reload(true) + }, 300); }); }); }); From de3526057cdc5e13cf9412477fbda083bfe5296f Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 5 Mar 2021 00:42:46 +0100 Subject: [PATCH 0469/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 86b992e8dc..790c3b15a9 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 2.4 +PLUGIN_VERSION= 2.5 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From ca30bb9ab60572bb78951f0250bc5a9204318e8d Mon Sep 17 00:00:00 2001 From: Nicola Bonavita Date: Fri, 5 Mar 2021 11:12:06 +0100 Subject: [PATCH 0470/3088] security/stunnel: Add client mode option to services (#2166) --- .../controllers/OPNsense/Stunnel/forms/dialogService.xml | 6 ++++++ .../opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml | 6 +++++- .../service/templates/OPNsense/Stunnel/stunnel.conf | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml index 368810bf79..2b7f7bb649 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml @@ -60,6 +60,12 @@ Additions may need a restart of stunnel (when the certificate was already used). ]]> + + service.clientmode + + checkbox + + service.ciphers diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml index 4f5689ae84..13e2f02fd6 100644 --- a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml +++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml @@ -1,6 +1,6 @@ //OPNsense/Stunnel - 1.0.2 + 1.0.3 Stunnel TLS encryption proxy @@ -63,6 +63,10 @@ 0 Y + + 0 + Y + TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,DHE-RSA-AES128-GCM-SHA256,DHE-RSA-AES256-GCM-SHA384 Y diff --git a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf index d9f28b339b..8c3ee5ecca 100644 --- a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf +++ b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf @@ -31,6 +31,9 @@ verifyChain = yes CRLpath = {% if helpers.empty('OPNsense.Stunnel.general.chroot') %}/var/run/stunnel{% endif %}/certs/ {% endif %} {% endif %} +{% if service.clientmode|default('0') == '1' %} +client = yes +{% endif %} {% set ciphers =[] %} {% set ciphersuites =[] %} {% for cipher in service.ciphers.split(',') %} From 2267242449233888750d5df390e4bc21388927ea Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Mar 2021 13:46:27 +0100 Subject: [PATCH 0471/3088] net/haproxy: style adjustments --- .../OPNsense/HAProxy/Api/ExportController.php | 16 ++++++++-------- .../HAProxy/Api/MaintenanceController.php | 3 --- .../app/views/OPNsense/HAProxy/maintenance.volt | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php index dbf6ed9152..71e1d39477 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ExportController.php @@ -72,15 +72,15 @@ public function downloadAction($type) $backend = new Backend(); if ($type == 'config') { - $result = $backend->configdRun("haproxy showconf"); - $filename = 'haproxy.conf'; - $filetype = 'text/plain'; - $content = $result; + $result = $backend->configdRun("haproxy showconf"); + $filename = 'haproxy.conf'; + $filetype = 'text/plain'; + $content = $result; } else { - $result = $backend->configdRun("haproxy exportall"); - $filename = 'haproxy_config_export.zip'; - $filetype = 'application/zip'; - $content = file_get_contents('/tmp/haproxy_config_export.zip'); + $result = $backend->configdRun("haproxy exportall"); + $filename = 'haproxy_config_export.zip'; + $filetype = 'application/zip'; + $content = file_get_contents('/tmp/haproxy_config_export.zip'); } $response = array( diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php index 1aac6f4ec7..e62d995273 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/MaintenanceController.php @@ -295,7 +295,6 @@ public function fetchCronIntegrationAction() // Iterate over all possible cron jobs foreach ($cronjobs as $cron => $cron_action) { - // Name of the item that holds the cron UUID $cron_ref = "${cron}Cron"; @@ -303,7 +302,6 @@ public function fetchCronIntegrationAction() if ((string)$mdlHaproxy->maintenance->cronjobs->$cron == "1") { // Check if a cron job already exists if ((string)$mdlHaproxy->maintenance->cronjobs->$cron_ref == "") { - // Create new cron job $mdlCron = new Cron(); // NOTE: Only configd actions are valid commands for cronjobs @@ -339,7 +337,6 @@ public function fetchCronIntegrationAction() } else { // Check if a cron job exists if ((string)$mdlHaproxy->maintenance->cronjobs->$cron_ref != "") { - // Clean existin entry $cron_uuid = (string)$mdlHaproxy->maintenance->cronjobs->$cron_ref; $mdlHaproxy->maintenance->cronjobs->$cron_ref = ""; diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt index 3ab54d181c..ae75d8a20f 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/maintenance.volt @@ -210,7 +210,7 @@ POSSIBILITY OF SUCH DAMAGE. var row_id = $(this).data("row-id"); var rows = $("#grid-certificates").bootgrid("getCurrentRows"); var row = rows.filter(function(row) { - return row.id == row_id; + return row.id == row_id; })[0]; var requested_count = row.total_count; var frontend_ids = row.id From 83f0b8904918e2d9368c85f12039b5ee015a01c2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Mar 2021 13:46:43 +0100 Subject: [PATCH 0472/3088] www/nginx: style adjustments --- .../opnsense/scripts/nginx/ngx_autoblock.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php b/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php index 4c7b712da9..dd953087f7 100755 --- a/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_autoblock.php @@ -59,8 +59,9 @@ function exec_hidden($command): void function modify_blocklist($tablename, array $allIps, $operation = "add"): void { - if (empty($allIps) || !in_array($operation, ["add", "delete"])) + if (empty($allIps) || !in_array($operation, ["add", "delete"])) { return; + } $tablename = escapeshellarg($tablename); $operation = escapeshellarg($operation); @@ -91,8 +92,9 @@ function read_all_from_blocklist($tablename) $process = proc_open("/sbin/pfctl -t ${tablename} -T show", $descriptorspec, $pipes); if (is_resource($process)) { $ips = []; - while ($ip = fgets($pipes[1], 96)) + while ($ip = fgets($pipes[1], 96)) { $ips[] = strtolower(trim($ip)); + } fclose($pipes[1]); proc_close($process); @@ -152,10 +154,11 @@ function create_work_files($include_tls_handshake) foreach ($mapping as $source => $target) { // Check if we already processing $target in another process and skip it if not stale if (file_exists($target)) { - if (time() - (@filemtime($target) ?: 0) > (5 * 60)) + if (time() - (@filemtime($target) ?: 0) > (5 * 60)) { @unlink($target); - else + } else { continue; + } } // Try to create work and log on failure @@ -179,8 +182,9 @@ function create_work_files($include_tls_handshake) function cleanup_work_files($work_files) { - foreach ($work_files as $file) + foreach ($work_files as $file) { @unlink($file); + } } // Checking if our sources are modified and create work files as needed (do nothing if sources are unchanged) @@ -199,8 +203,9 @@ function cleanup_work_files($work_files) // Store state if (!empty($work_files)) { - if (!is_array($state)) + if (!is_array($state)) { $state = []; + } $state["sources"] = get_files_lastmodified(array_keys($sources)); @file_put_contents(STATE_FILE, json_encode($state)); } From 7845166d0d3a32b2f9a63dda7341790c5376fab3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Mar 2021 13:52:44 +0100 Subject: [PATCH 0473/3088] security/stunnel: new version --- security/stunnel/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index 4cbdf5bc41..6ddef16665 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,7 +1,6 @@ PLUGIN_NAME= stunnel -PLUGIN_VERSION= 1.0.2 -PLUGIN_REVISION= 1 -PLUGIN_COMMENT= stunnel TLS proxy +PLUGIN_VERSION= 1.0.3 +PLUGIN_COMMENT= Stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel From f0ec64d1304558295f1bfbea2cf97d619684a228 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Mar 2021 13:56:05 +0100 Subject: [PATCH 0474/3088] README: sync --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e970151c0e..b5698e1495 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ security/intrusion-detection-content-snort-vrt -- IDS Snort VRT ruleset (needs r security/maltrail -- Malicious traffic detection system security/openconnect -- OpenConnect Client security/softether -- Cross-platform Multi-protocol VPN Program (development only) -security/stunnel -- stunnel TLS proxy +security/stunnel -- Stunnel TLS proxy security/tinc -- Tinc VPN security/tor -- The Onion Router sysutils/api-backup -- Provide the functionality to download the config.xml From 5b7b779e3f5cdb0cebdb98a67023029c4c348116 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 5 Mar 2021 23:50:44 +0100 Subject: [PATCH 0475/3088] security/acme-client: update acme.sh URLs to acmesh-official --- .../OPNsense/AcmeClient/forms/dialogCertificate.xml | 4 ++-- .../mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php | 4 ++-- .../opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml index e387fc7866..ee0eb8dafe 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml @@ -101,7 +101,7 @@ certificate.domainalias text - acme.sh documentation for further information.]]> + acme.sh documentation for further information.]]> @@ -112,6 +112,6 @@ certificate.challengealias text - acme.sh documentation for further information.]]> + acme.sh documentation for further information.]]> diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php index a541584ac1..a694432288 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php @@ -232,7 +232,7 @@ public function setNames(string $certname, string $altnames = '', string $aliasm $this->acme_args[] = LeUtils::execSafe('--domain %s', $certname); // Main domain: Use DNS alias mode for domain validation? - // https://github.com/Neilpang/acme.sh/wiki/DNS-alias-mode + // https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mode if ($this->getMethod() == 'dns01') { switch ((string)$aliasmode) { case 'automatic': @@ -256,7 +256,7 @@ public function setNames(string $certname, string $altnames = '', string $aliasm $this->acme_args[] = LeUtils::execSafe('--domain %s', $altname); // altNames: Use DNS alias mode for domain validation? - // https://github.com/Neilpang/acme.sh/wiki/DNS-alias-mode + // https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mode if ($this->getMethod() == 'dns01') { switch ((string)$this->cert_aliasmode) { case 'automatic': diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt index 2800f4cbef..2d1b034e74 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt @@ -252,7 +252,7 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Please use the %sissue tracker%s to report bugs or request new features.') | format('', '') }}

    -

    {{ lang._('This plugin includes code from the %s project.') | format('Neilpang/acme.sh' ) }} {{ lang._('Licensed under GPLv3.') }}
    {{ lang._('Let"s Encrypt(tm) is a trademark of the Internet Security Research Group. All rights reserved.') }}

    +

    {{ lang._('This plugin includes code from the %s project.') | format('acmesh-official/acme.sh' ) }} {{ lang._('Licensed under GPLv3.') }}
    {{ lang._('Let"s Encrypt(tm) is a trademark of the Internet Security Research Group. All rights reserved.') }}


    From cea04d9795c8f00305ba785525f9f40265c96cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= <34602360+opnsenseuser@users.noreply.github.com> Date: Wed, 10 Mar 2021 17:28:33 +0100 Subject: [PATCH 0476/3088] Theme Cicada/Vicuna little design update (#2251) --- misc/theme-cicada/Makefile | 2 +- .../cicada/assets/stylesheets/main.scss | 25 +++++++++--- .../www/themes/cicada/build/css/main.css | 23 ++++++++--- misc/theme-vicuna/Makefile | 2 +- .../vicuna/assets/stylesheets/main.scss | 40 +++++++++++++------ .../www/themes/vicuna/build/css/main.css | 40 ++++++++++++------- 6 files changed, 93 insertions(+), 39 deletions(-) diff --git a/misc/theme-cicada/Makefile b/misc/theme-cicada/Makefile index bfe671f7dc..33e19692fc 100644 --- a/misc/theme-cicada/Makefile +++ b/misc/theme-cicada/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-cicada -PLUGIN_VERSION= 1.27 +PLUGIN_VERSION= 1.28 PLUGIN_COMMENT= The cicada theme - dark grey PLUGIN_MAINTAINER= rene@team-rebellion.net diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss index 2e4f3edf7a..bd810ace9d 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss @@ -1453,7 +1453,8 @@ h6 { } h1, .h1 { - font-size: 23px; + font-size: 22px; + text-transform: uppercase; } h2, .h2 { @@ -9155,7 +9156,7 @@ button.close { .show { display: block !important; - color: #B3B3B3; + color: #22C400; } .invisible { @@ -9465,7 +9466,7 @@ body { border-radius: 0; min-height: 47px; height: auto; - padding: 6px 14px 5px 14px; + padding: 7px 14px 5px 14px; -webkit-box-shadow: 0 3px 4px rgb(23, 23, 23); box-shadow: 0 3px 4px rgb(23, 23, 23); } @@ -9490,7 +9491,7 @@ body { .page-content-main { min-height: calc(100% - 64px); - padding: 9px 0px 21px 0px; + padding: 7px 0px 21px 0px; } .page-side { @@ -10026,7 +10027,7 @@ button.toggle-sidebar { } .table > tbody > tr > td:last-child { - padding-right: 15px; + padding-right: 5px; } /* helpers */ @@ -10643,3 +10644,17 @@ ul.jqtree-tree { .table.border { border: 1px solid #191919 !important; } + +.rule.text-muted > td { + &:nth-child(1n+3) { + text-decoration: line-through; + } + + &:last-child { + text-decoration: none; + } +} + +#reports-tab { + border-bottom: 1px solid #191919; +} diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css index 919e308ea3..41b44822a9 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css @@ -1050,7 +1050,8 @@ h6, .h6 { font-size: 75%; } h1, .h1 { - font-size: 23px; } + font-size: 22px; + text-transform: uppercase; } h2, .h2 { font-size: 16px; } @@ -5505,7 +5506,7 @@ button.close { .show { display: block !important; - color:#B3B3B3;} + color: #22C400; } .invisible { visibility: hidden; } @@ -5743,7 +5744,7 @@ body { border-radius: 0; min-height: 47px; height: auto; - padding: 6px 14px 5px 14px; + padding: 7px 14px 5px 14px; -webkit-box-shadow: 0 3px 4px rgb(23, 23, 23); box-shadow: 0 3px 4px rgb(23, 23, 23); } .page-content-head, .content-box-head { @@ -5757,7 +5758,7 @@ body { .page-content-main { min-height: calc(100% - 64px); - padding: 9px 0px 21px 0px; } + padding: 7px 0px 21px 0px; } .page-side { background: #202020; @@ -6144,7 +6145,7 @@ button.toggle-sidebar { font-weight: normal; } .table > tbody > tr > td:last-child { -padding-right: 15px; } + padding-right: 5px; } /* helpers */ .__nowrap { @@ -6620,3 +6621,15 @@ ul.jqtree-tree .jqtree-title { .table.border { border: 1px solid #191919 !important; } + +.rule.text-muted > td:nth-child(1n+3) { + text-decoration: line-through; +} + +.rule.text-muted > td:last-child { + text-decoration:none; +} + +#reports-tab { + border-bottom: 1px solid #191919; +} diff --git a/misc/theme-vicuna/Makefile b/misc/theme-vicuna/Makefile index 7c1be4db2f..0bfdb6476c 100644 --- a/misc/theme-vicuna/Makefile +++ b/misc/theme-vicuna/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-vicuna -PLUGIN_VERSION= 1.3 +PLUGIN_VERSION= 1.4 PLUGIN_COMMENT= The vicuna theme - dark anthrazit PLUGIN_MAINTAINER= rene@team-rebellion.net diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss index 3d05ec02f6..0ef531fdf7 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss @@ -8,7 +8,6 @@ padding-right: 1px !important; padding-left: 5px !important; min-height: 25px !important; - border: 1px solid #191919; .btn-group .btn { color: #FFFFFF !important; @@ -756,7 +755,7 @@ td, th { .glyphicon-arrow-up:before { content: "\e093"; - color: #1d511c !important; + color: #196a18 !important; } .glyphicon-arrow-down:before { @@ -1082,7 +1081,7 @@ td, th { .glyphicon-transfer:before { content: "\e178"; - color: #1d511c !important; + color: #196a18 !important; } .glyphicon-cutlery:before { @@ -1453,7 +1452,8 @@ h6 { } h1, .h1 { - font-size: 23px; + font-size: 22px; + text-transform: uppercase; } h2, .h2 { @@ -1552,7 +1552,7 @@ a.text-primary:hover { } .text-success { - color: #027700; + color: #05a202; } a.text-success:hover { @@ -7279,12 +7279,12 @@ a.label { } .label-success { - background-color: #1d511c; + background-color: #196a18; border-color: #191919; &[href] { &:hover, &:focus { - background-color: #1d511c; + background-color: #196a18; border-color: #191919; } } @@ -7633,7 +7633,7 @@ a.thumbnail { } .progress-bar-success { - background-color: #1d511c; + background-color: #196a18; } .progress-striped .progress-bar-success { @@ -9263,7 +9263,7 @@ button.close { .show { display: block !important; - color: #757575; + color: #22C400; } .invisible { @@ -9571,10 +9571,10 @@ body { margin-left: 20px; margin-right: 20px; border-top: 1px solid #191919; - border-radius: 3px; + border-radius: 0; min-height: 47px; height: auto; - padding: 6px 14px 5px 14px; + padding: 7px 14px 5px 14px; -webkit-box-shadow: 0 3px 4px rgb(23, 23, 23); box-shadow: 0 3px 4px rgb(23, 23, 23); } @@ -9601,7 +9601,7 @@ body { .page-content-main { min-height: calc(100% - 64px); - padding: 9px 0px 21px 0px; + padding: 10px 0px 21px 0px; } .page-side { @@ -10156,7 +10156,7 @@ button.toggle-sidebar { } .table > tbody > tr > td:last-child { - padding-right: 15px; + padding-right: 5px; } /* helpers */ @@ -10766,3 +10766,17 @@ ul.jqtree-tree { .table.border { border: 1px solid #181818 !important; } + +.rule.text-muted > td { + &:nth-child(1n+3) { + text-decoration: line-through; + } + + &:last-child { + text-decoration: none; + } +} + +#reports-tab { + border-bottom: 1px solid #191919; +} diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css index 8234f124a8..5fc68c4414 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css @@ -6,8 +6,7 @@ padding-top: 1px !important; padding-right: 1px !important; padding-left: 5px !important; - min-height: 25px !important; - border: 1px solid #191919; } + min-height: 25px !important; } .widgetdiv .content-box-head .btn-group .btn { color: #FFFFFF !important; @@ -596,7 +595,7 @@ th { .glyphicon-arrow-up:before { content: "\e093"; - color: #1d511c !important; } + color: #196a18 !important; } .glyphicon-arrow-down:before { content: "\e094"; @@ -841,7 +840,7 @@ th { .glyphicon-transfer:before { content: "\e178"; - color:#1d511c !important; } + color:#196a18 !important; } .glyphicon-cutlery:before { content: "\e179"; } @@ -1051,7 +1050,8 @@ h6, .h6 { font-size: 75%; } h1, .h1 { - font-size: 23px; } + font-size: 22px; + text-transform: uppercase; } h2, .h2 { font-size: 16px; } @@ -1127,7 +1127,7 @@ a.text-primary:hover { color: #b85904; } .text-success { - color: #027700; } + color: #05a202; } a.text-success:hover { color: #7fc54f; } @@ -4209,10 +4209,10 @@ a.label:hover, a.label:focus { .label-success { - background-color: #1d511c; + background-color: #196a18; border-color: #191919;} .label-success[href]:hover, .label-success[href]:focus { - background-color: #1d511c; + background-color: #196a18; border-color: #191919; } @@ -4452,7 +4452,7 @@ a.thumbnail.active { box-shadow: none; } .progress-bar-success { - background-color: #1d511c; } + background-color: #196a18; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); @@ -5486,7 +5486,7 @@ button.close { .show { display: block !important; - color:#757575;} + color: #22C400; } .invisible { visibility: hidden; } @@ -5724,10 +5724,10 @@ body { margin-left: 20px; margin-right: 20px; border-top: 1px solid #191919; - border-radius: 3px; + border-radius: 0; min-height: 47px; height:auto; - padding: 6px 14px 5px 14px; + padding: 7px 14px 5px 14px; -webkit-box-shadow: 0 3px 4px rgb(23, 23, 23); box-shadow: 0 3px 4px rgb(23, 23, 23); } @@ -5743,7 +5743,7 @@ body { .page-content-main { min-height: calc(100% - 64px); - padding: 9px 0px 21px 0px; } + padding: 10px 0px 21px 0px; } .page-side { background: #172229; @@ -6132,7 +6132,7 @@ button.toggle-sidebar { font-weight: normal; } .table > tbody > tr > td:last-child { -padding-right: 15px; } + padding-right: 5px; } /* helpers */ .__nowrap { @@ -6583,3 +6583,15 @@ ul.jqtree-tree .jqtree-title { .table.border { border: 1px solid #181818 !important; } + +.rule.text-muted > td:nth-child(1n+3) { + text-decoration: line-through; +} + +.rule.text-muted > td:last-child { + text-decoration:none; +} + +#reports-tab { + border-bottom: 1px solid #191919; +} From e7eed12d7b2c3fbcc71719e430a3382da6c4796f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= <34602360+opnsenseuser@users.noreply.github.com> Date: Wed, 10 Mar 2021 17:33:16 +0100 Subject: [PATCH 0477/3088] Theme/Tukan - color redesign (#2249) --- misc/theme-tukan/Makefile | 2 +- .../stylesheets/bootstrap-select-1.13.3.scss | 59 +- .../themes/tukan/assets/stylesheets/main.scss | 11667 +++++----------- .../tukan/assets/stylesheets/tokenizer2.scss | 32 +- .../build/css/bootstrap-select-1.13.3.css | 2 +- .../tukan/build/css/jquery.bootgrid.css | 6 +- .../www/themes/tukan/build/css/main.css | 297 +- .../build/css/pick-a-color-1.2.3.min.css | 4 +- .../www/themes/tukan/build/css/tokenize2.css | 8 +- .../www/themes/tukan/build/images/caret.png | Bin 1219 -> 2935 bytes 10 files changed, 4024 insertions(+), 8053 deletions(-) diff --git a/misc/theme-tukan/Makefile b/misc/theme-tukan/Makefile index 9408a172ae..4d9f9cc95b 100644 --- a/misc/theme-tukan/Makefile +++ b/misc/theme-tukan/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-tukan -PLUGIN_VERSION= 1.24 +PLUGIN_VERSION= 1.25 PLUGIN_COMMENT= The tukan theme - blue/white PLUGIN_MAINTAINER= rene@team-rebellion.net diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/bootstrap-select-1.13.3.scss b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/bootstrap-select-1.13.3.scss index 150b35e363..6d3fa13e9f 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/bootstrap-select-1.13.3.scss +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/bootstrap-select-1.13.3.scss @@ -11,7 +11,9 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel .bootstrap-select { width: 348px \0; + /*IE9 and below*/ + > { .dropdown-toggle { position: relative; @@ -19,16 +21,20 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel z-index: 1; text-align: right; white-space: nowrap; + &.bs-placeholder { - color: #fff; + color: #000; + &:hover, &:focus, &:active { - color: #fff; + color: #000; } + &.btn-primary, &.btn-secondary, &.btn-success, &.btn-danger, &.btn-info, &.btn-dark, &.btn-primary:hover, &.btn-secondary:hover, &.btn-success:hover, &.btn-danger:hover, &.btn-info:hover, &.btn-dark:hover, &.btn-primary:focus, &.btn-secondary:focus, &.btn-success:focus, &.btn-danger:focus, &.btn-info:focus, &.btn-dark:focus, &.btn-primary:active, &.btn-secondary:active, &.btn-success:active, &.btn-danger:active, &.btn-info:active, &.btn-dark:active { color: #ffffff; } } } + select { position: absolute !important; bottom: 0; @@ -39,6 +45,7 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel padding: 0 !important; opacity: 0 !important; border: none; + &.mobile-device { top: 0; left: 0; @@ -62,9 +69,11 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel &.fit-width { width: auto !important; } + &:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { width: 348px; } + &.form-control { margin-bottom: 0; padding: 0; @@ -79,15 +88,18 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel .bootstrap-select { &.form-control.input-group-btn { z-index: auto; + &:not(:first-child):not(:last-child) > .btn { border-radius: 0; } } + &:not(.input-group-btn), &[class*="col-"] { float: none; display: inline-block; margin-left: 0; } + &.dropdown-menu-right, &[class*="col-"].dropdown-menu-right { float: right; } @@ -118,9 +130,11 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel line-height: inherit; border-radius: inherit; } + &.form-control-sm .dropdown-toggle { padding: 0.25rem 0.5rem; } + &.form-control-lg .dropdown-toggle { padding: 0.5rem 1rem; } @@ -133,31 +147,38 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel .bootstrap-select { &.disabled { cursor: not-allowed; + &:focus { outline: none !important; } } + > .disabled { cursor: not-allowed; } + > .disabled:focus { outline: none !important; } + &.bs-container { position: absolute; top: 0; left: 0; height: 0 !important; padding: 0 !important; + .dropdown-menu { z-index: 1060; } } + .dropdown-toggle { &:before { content: ''; display: inline-block; } + .filter-option { position: absolute; top: 0; @@ -170,12 +191,15 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel width: 100%; text-align: left; } + .filter-option-inner { padding-right: inherit; } + .filter-option-inner-inner { overflow: hidden; } + .caret { position: absolute; top: 50%; @@ -194,14 +218,17 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel &[class*="col-"] .dropdown-toggle { width: 100%; } + .dropdown-menu { min-width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; + > .inner:focus { outline: none !important; } + &.inner { position: static; float: none; @@ -212,37 +239,46 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel -webkit-box-shadow: none; box-shadow: none; } + li { position: relative; + &.active small { color: rgba(255, 255, 255, 0.5) !important; } + &.disabled a { cursor: not-allowed; } + a { cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; + &.opt { position: relative; padding-left: 2.25em; } + span { &.check-mark { display: none; } + &.text { display: inline-block; } } } + small { padding-left: 0.5em; } } + .notify { position: absolute; bottom: 5px; @@ -261,27 +297,32 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel box-sizing: border-box; } } + .no-results { padding: 3px; background: #f5f5f5; margin: 0 5px; white-space: nowrap; } + &.fit-width .dropdown-toggle { .filter-option { position: static; display: inline; padding: 0; } + .filter-option-inner, .filter-option-inner-inner { display: inline; } + .caret { position: static; top: auto; margin-top: -1px; } } + &.show-tick .dropdown-menu { .selected span.check-mark { position: absolute; @@ -289,10 +330,12 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel right: 15px; top: 5px; } + li a span.text { margin-right: 34px; } } + .bs-ok-default:after { content: ''; display: block; @@ -305,10 +348,12 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel -o-transform: rotate(45deg); transform: rotate(45deg); } + &.show-menu-arrow { &.open > .dropdown-toggle, &.show > .dropdown-toggle { z-index: 1061; } + .dropdown-toggle .filter-option { &:before { content: ''; @@ -320,6 +365,7 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel left: 9px; display: none; } + &:after { content: ''; border-left: 6px solid transparent; @@ -331,6 +377,7 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel display: none; } } + &.dropup .dropdown-toggle .filter-option { &:before { bottom: auto; @@ -338,6 +385,7 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel border-top: 7px solid rgba(204, 204, 204, 0.2); border-bottom: 0; } + &:after { bottom: auto; top: -4px; @@ -345,16 +393,19 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel border-bottom: 0; } } + &.pull-right .dropdown-toggle .filter-option { &:before { right: 12px; left: auto; } + &:after { right: 13px; left: auto; } } + &.open > .dropdown-toggle .filter-option:before, &.show > .dropdown-toggle .filter-option:before, &.open > .dropdown-toggle .filter-option:after, &.show > .dropdown-toggle .filter-option:after { display: block; } @@ -370,6 +421,7 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; + .btn-group button { width: 50%; } @@ -381,6 +433,7 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; + .btn-group button { width: 100%; } @@ -390,6 +443,7 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel + .bs-actionsbox { padding: 0 8px 4px; } + .form-control { margin-bottom: 0; width: 100%; @@ -405,6 +459,7 @@ select.bs-select-hidden, .bootstrap-select > select.bs-select-hidden, select.sel .dropdown-menu > li > a { padding: 3px 20px 3px 30px; } + &.show-tick .dropdown-menu .selected span.check-mark { left: 10px; } diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss index 9319aaa62a..f99129bc81 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss @@ -1,357 +1,296 @@ @charset "UTF-8"; - .widgetdiv .content-box-head { - background: #294c5f !important; + background: #354248 !important; color: #FFF !important; padding-bottom: 1px !important; padding-top: 1px !important; padding-right: 1px !important; - padding-left: 5px !important; + padding-left: 4px !important; min-height: 25px !important; - border: 1px solid #fff; + border: 1px solid #2f2f2f; } - .btn-group .btn { + .widgetdiv .content-box-head .btn-group .btn { color: #FFFFFF !important; background: none; - border: 0px; - - .glyphicon { - color: #FFFFFF !important; - } - } - - .list-inline li > h3 { - padding-top: 4px; - } -} + border: 0px; } + .widgetdiv .content-box-head .btn-group .btn .glyphicon { + color: #FFFFFF !important; } + .widgetdiv .content-box-head .list-inline li > h3 { + padding-top: 4px; } @font-face { font-family: 'SourceSansProBold'; - src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Bold/SourceSansPro-Bold.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Bold/SourceSansPro-Bold.ttf") format("truetype"); -} - + src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Bold/SourceSansPro-Bold.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Bold/SourceSansPro-Bold.ttf") format("truetype"); } @font-face { font-family: 'SourceSansProSemibold'; - src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf") format("truetype"); -} - + src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf") format("truetype"); } @font-face { font-family: 'SourceSansProRegular'; - src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf") format("truetype"); -} - + src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf") format("truetype"); } + /*! normalize.css v3.0.1 | MIT License | git.io/normalize */ - -table html { +table +html { font-family: sans-serif; -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; -} + -webkit-text-size-adjust: 100%; } body { - margin: 0; -} - -article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { - display: block; -} - -audio, canvas, progress, video { + margin: 0; } + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; } + +audio, +canvas, +progress, +video { display: inline-block; - vertical-align: baseline; -} + vertical-align: baseline; } audio:not([controls]) { display: none; - height: 0; -} + height: 0; } -[hidden], template { - display: none; -} +[hidden], +template { + display: none; } a { - color: #FF6C06; + color: #D95E04; text-decoration: none; background: transparent; - outline: 0; + outline: 0; } - &:link, &:active { - outline: 0; - } + a:link, a:active { + outline: 0; } - &:hover, &:focus { - color: #FF6C06; - text-decoration: underline; - } -} + a:hover, a:focus { + color: #D95E04; + text-decoration: underline; } abbr[title] { - border-bottom: 1px dotted; -} + border-bottom: 1px dotted; } -b, strong { - font-weight: bold; -} +b, +strong { + font-weight: bold; } dfn { - font-style: italic; -} + font-style: italic; } h1 { - font-size: 2em; - margin: 0.67em 0; -} + font-size: 8em; + margin: 0.67em 0; } mark { background: #ff0; - color: #000; -} + color: #000; } small { - font-size: 80%; -} + font-size: 80%; } -sub { +sub, +sup { font-size: 75%; line-height: 0; position: relative; - vertical-align: baseline; -} + vertical-align: baseline; } sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; - top: -0.5em; -} + top: -0.5em; } sub { - bottom: -0.25em; -} + bottom: -0.25em; } img { - border: 0; -} + border: 0; } svg:not(:root) { - overflow: hidden; -} + overflow: hidden; } figure { - margin: 1em 40px; -} + margin: 1em 40px; } hr { -moz-box-sizing: content-box; box-sizing: content-box; - height: 0; -} + height: 0; } pre { - overflow: auto; -} + overflow: auto; } -code, kbd, pre, samp { +code, +kbd, +pre, +samp { font-family: monospace, monospace; - font-size: 1em; -} + font-size: 1em; } -button, input, optgroup, select, textarea { +button, +input, +optgroup, +select, +textarea { color: inherit; font: inherit; - margin: 0; -} + margin: 0; } button { - overflow: visible; - text-transform: none; -} + overflow: visible; } +button, select { - text-transform: none; -} + text-transform: none; } -button, html input[type="button"] { +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { -webkit-appearance: button; - cursor: pointer; -} - -input { - &[type="reset"], &[type="submit"] { - -webkit-appearance: button; - cursor: pointer; - } -} + cursor: pointer; } -button[disabled], html input[disabled] { - cursor: default; -} +button[disabled], +html input[disabled] { + cursor: default; } -button::-moz-focus-inner { +button::-moz-focus-inner, +input::-moz-focus-inner { border: 0; - padding: 0; -} + padding: 0; } input { - &::-moz-focus-inner { - border: 0; - padding: 0; - } + line-height: normal; } - line-height: normal; +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; } - &[type="checkbox"], &[type="radio"] { - box-sizing: border-box; - padding: 0; - } +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; } - &[type="number"] { - &::-webkit-inner-spin-button, &::-webkit-outer-spin-button { - height: auto; - } - } - - &[type="search"] { - -webkit-appearance: textfield; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box; - - &::-webkit-search-cancel-button, &::-webkit-search-decoration { - -webkit-appearance: none; - } - } -} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; } + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} + padding: 0.35em 0.625em 0.75em; } legend { border: 0; - padding: 0; -} + padding: 0; } textarea { - overflow: auto; -} + overflow: auto; } optgroup { - font-weight: bold; -} + font-weight: bold; } table { border-collapse: none; border-spacing: 0; color: #000; - background-color: #F0F0F0; - width: 100%; -} + background-color: #fff; + width: 100%; } -td, th { - padding: 0; -} +td, +th { + padding: 0; } @media print { * { text-shadow: none !important; color: #000 !important; background: transparent !important; - box-shadow: none !important; - } - - a { - text-decoration: underline; + box-shadow: none !important; } - &:visited { - text-decoration: underline; - } + a, + a:visited { + text-decoration: underline; } - &[href]:after { - content: " (" attr(href) ")"; - } - } + a[href]:after { + content: " (" attr(href) ")"; } abbr[title]:after { - content: " (" attr(title) ")"; - } + content: " (" attr(title) ")"; } - a { - &[href^="javascript:"]:after, &[href^="#"]:after { - content: ""; - } - } + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; } - pre, blockquote { + pre, + blockquote { border: 1px solid #999; - page-break-inside: avoid; - } + page-break-inside: avoid; } thead { - display: table-header-group; - } + display: table-header-group; } - tr { - page-break-inside: avoid; - } + tr, + img { + page-break-inside: avoid; } img { - page-break-inside: avoid; - max-width: 100% !important; - } + max-width: 100% !important; } - p, h2, h3 { + p, + h2, + h3 { orphans: 3; - widows: 3; - } + widows: 3; } - h2, h3 { - page-break-after: avoid; - } + h2, + h3 { + page-break-after: avoid; } select { - background: #fff !important; - } + background: #fff !important; } .navbar { - display: none; - } + display: none; } - .table { - td, th { - background-color: #fff !important; - } - } + .table td, + .table th { + background-color: #fff !important; } - .btn > .caret, .dropup > .btn > .caret { - border-top-color: #000 !important; - } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; } .label { - border: 1px solid #000; - } + border: 1px solid #000; } .table { - border-collapse: collapse !important; - } - - .table-bordered { - th, td { - border: 1px solid #ddd !important; - } - } -} + border-collapse: collapse !important; } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; } } @font-face { font-family: 'Glyphicons Halflings'; src: url("../fonts/bootstrap/glyphicons-halflings-regular.eot"); - src: url("../fonts/bootstrap/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/bootstrap/glyphicons-halflings-regular.woff") format("woff"), url("../fonts/bootstrap/glyphicons-halflings-regular.ttf") format("truetype"), url("../fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg"); -} - + src: url("../fonts/bootstrap/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/bootstrap/glyphicons-halflings-regular.woff") format("woff"), url("../fonts/bootstrap/glyphicons-halflings-regular.ttf") format("truetype"), url("../fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg"); } .glyphicon { position: relative; top: 1px; @@ -361,863 +300,658 @@ td, th { font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} + -moz-osx-font-smoothing: grayscale; } .glyphicon-asterisk:before { - content: "\2a"; -} + content: "\2a"; } .glyphicon-plus:before { - content: "\2b"; -} + content: "\2b"; } .glyphicon-euro:before { - content: "\20ac"; -} + content: "\20ac"; } .glyphicon-minus:before { - content: "\2212"; -} + content: "\2212"; } .glyphicon-cloud:before { - content: "\2601"; -} + content: "\2601"; } .glyphicon-envelope:before { - content: "\2709"; -} + content: "\2709"; } .glyphicon-pencil:before { - content: "\270f"; -} + content: "\270f"; } .glyphicon-glass:before { - content: "\e001"; -} + content: "\e001"; } .glyphicon-music:before { - content: "\e002"; -} + content: "\e002"; } .icon.glyphicon.input-group-addon.glyphicon-search:before, .glyphicon-search:before { content: "\e003"; - color: #FFF !important; -} + color: #FFF !important; } .glyphicon-heart:before { - content: "\e005"; -} + content: "\e005"; } .glyphicon-star:before { - content: "\e006"; -} + content: "\e006"; } .glyphicon-star-empty:before { - content: "\e007"; -} + content: "\e007"; } .glyphicon-user:before { - content: "\e008"; -} + content: "\e008"; } .glyphicon-film:before { - content: "\e009"; -} + content: "\e009"; } .glyphicon-th-large:before { - content: "\e010"; -} + content: "\e010"; } .glyphicon-th:before { - content: "\e011"; -} + content: "\e011"; } .glyphicon-th-list:before { - content: "\e012"; -} + content: "\e012"; } .glyphicon-ok:before { - content: "\e013"; -} + content: "\e013"; } .glyphicon-remove:before { - content: "\e014"; -} + content: "\e014"; } .glyphicon-zoom-in:before { - content: "\e015"; -} + content: "\e015"; } .glyphicon-zoom-out:before { - content: "\e016"; -} + content: "\e016"; } .glyphicon-off:before { - content: "\e017"; -} + content: "\e017"; } .glyphicon-signal:before { - content: "\e018"; -} + content: "\e018"; } .glyphicon-cog:before { - content: "\e019"; -} + content: "\e019"; } .glyphicon-trash:before { - content: "\e020"; -} + content: "\e020"; } .glyphicon-home:before { - content: "\e021"; -} + content: "\e021"; } .glyphicon-file:before { - content: "\e022"; -} + content: "\e022"; } .glyphicon-time:before { - content: "\e023"; -} + content: "\e023"; } .glyphicon-road:before { - content: "\e024"; -} + content: "\e024"; } .glyphicon-download-alt:before { - content: "\e025"; -} + content: "\e025"; } .glyphicon-download:before { - content: "\e026"; -} + content: "\e026"; } .glyphicon-upload:before { - content: "\e027"; -} + content: "\e027"; } .glyphicon-inbox:before { - content: "\e028"; -} + content: "\e028"; } .glyphicon-play-circle:before { - content: "\e029"; -} + content: "\e029"; } .glyphicon-repeat:before { - content: "\e030"; -} + content: "\e030"; } .glyphicon-refresh:before { - content: "\e031"; -} + content: "\e031"; } .glyphicon-list-alt:before { - content: "\e032"; -} + content: "\e032"; } .glyphicon-lock:before { - content: "\e033"; -} + content: "\e033"; } .glyphicon-flag:before { - content: "\e034"; -} + content: "\e034"; } .glyphicon-headphones:before { - content: "\e035"; -} + content: "\e035"; } .glyphicon-volume-off:before { - content: "\e036"; -} + content: "\e036"; } .glyphicon-volume-down:before { - content: "\e037"; -} + content: "\e037"; } .glyphicon-volume-up:before { - content: "\e038"; -} + content: "\e038"; } .glyphicon-qrcode:before { - content: "\e039"; -} + content: "\e039"; } .glyphicon-barcode:before { - content: "\e040"; -} + content: "\e040"; } .glyphicon-tag:before { - content: "\e041"; -} + content: "\e041"; } .glyphicon-tags:before { - content: "\e042"; -} + content: "\e042"; } .glyphicon-book:before { - content: "\e043"; -} + content: "\e043"; } .glyphicon-bookmark:before { - content: "\e044"; -} + content: "\e044"; } .glyphicon-print:before { - content: "\e045"; -} + content: "\e045"; } .glyphicon-camera:before { - content: "\e046"; -} + content: "\e046"; } .glyphicon-font:before { - content: "\e047"; -} + content: "\e047"; } .glyphicon-bold:before { - content: "\e048"; -} + content: "\e048"; } .glyphicon-italic:before { - content: "\e049"; -} + content: "\e049"; } .glyphicon-text-height:before { - content: "\e050"; -} + content: "\e050"; } .glyphicon-text-width:before { - content: "\e051"; -} + content: "\e051"; } .glyphicon-align-left:before { - content: "\e052"; -} + content: "\e052"; } .glyphicon-align-center:before { - content: "\e053"; -} + content: "\e053"; } .glyphicon-align-right:before { - content: "\e054"; -} + content: "\e054"; } .glyphicon-align-justify:before { - content: "\e055"; -} + content: "\e055"; } .glyphicon-list:before { - content: "\e056"; -} + content: "\e056"; } .glyphicon-indent-left:before { - content: "\e057"; -} + content: "\e057"; } .glyphicon-indent-right:before { - content: "\e058"; -} + content: "\e058"; } .glyphicon-facetime-video:before { - content: "\e059"; -} + content: "\e059"; } .glyphicon-picture:before { - content: "\e060"; -} + content: "\e060"; } .glyphicon-map-marker:before { - content: "\e062"; -} + content: "\e062"; } .glyphicon-adjust:before { - content: "\e063"; -} + content: "\e063"; } .glyphicon-tint:before { - color: #3F0; - content: "\e064"; -} + color:#3F0; + content: "\e064"; } .glyphicon-edit:before { - content: "\e065"; -} + content: "\e065"; } .glyphicon-share:before { - content: "\e066"; -} + content: "\e066"; } .glyphicon-check:before { - content: "\e067"; -} + content: "\e067"; } .glyphicon-move:before { - content: "\e068"; -} + content: "\e068"; } .glyphicon-step-backward:before { - content: "\e069"; -} + content: "\e069"; } .glyphicon-fast-backward:before { - content: "\e070"; -} + content: "\e070"; } .glyphicon-backward:before { - content: "\e071"; -} + content: "\e071"; } .glyphicon-play:before { - content: "\e072"; -} + content: "\e072"; } .glyphicon-pause:before { - content: "\e073"; -} + content: "\e073"; } .glyphicon-stop:before { - content: "\e074"; -} + content: "\e074"; } .glyphicon-forward:before { - content: "\e075"; -} + content: "\e075"; } .glyphicon-fast-forward:before { - content: "\e076"; -} + content: "\e076"; } .glyphicon-step-forward:before { - content: "\e077"; -} + content: "\e077"; } .glyphicon-eject:before { - content: "\e078"; -} + content: "\e078"; } .glyphicon-chevron-left:before { - content: "\e079"; -} + content: "\e079"; } .glyphicon-chevron-right:before { - content: "\e080"; -} + content: "\e080"; } .glyphicon-plus-sign:before { - content: "\e081"; -} + content: "\e081"; } .glyphicon-minus-sign:before { - content: "\e082"; -} + content: "\e082"; } .glyphicon-remove-sign:before { - content: "\e083"; -} + content: "\e083"; } .glyphicon-ok-sign:before { - content: "\e084"; -} + content: "\e084"; } .glyphicon-question-sign:before { - content: "\e085"; -} + content: "\e085"; } .glyphicon-info-sign:before { - content: "\e086"; -} + content: "\e086"; } .glyphicon-screenshot:before { - content: "\e087"; -} + content: "\e087"; } .glyphicon-remove-circle:before { - content: "\e088"; -} + content: "\e088"; } .glyphicon-ok-circle:before { - content: "\e089"; -} + content: "\e089"; } .glyphicon-ban-circle:before { - content: "\e090"; -} + content: "\e090"; } .glyphicon-arrow-left:before { - content: "\e091"; -} + content: "\e091"; } .glyphicon-arrow-right:before { - content: "\e092"; -} + content: "\e092"; } .glyphicon-arrow-up:before { content: "\e093"; - color: #4FB654 !important; -} + color: #4FB654 !important; } .glyphicon-arrow-down:before { content: "\e094"; - color: #FF5E3B !important; -} + color: #FF5E3B !important; } .glyphicon-share-alt:before { - content: "\e095"; -} + content: "\e095"; } .glyphicon-resize-full:before { - content: "\e096"; -} + content: "\e096"; } .glyphicon-resize-small:before { - content: "\e097"; -} + content: "\e097"; } .glyphicon-exclamation-sign:before { - content: "\e101"; -} + content: "\e101"; } .glyphicon-gift:before { - content: "\e102"; -} + content: "\e102"; } .glyphicon-leaf:before { - content: "\e103"; -} + content: "\e103"; } .glyphicon-fire:before { - content: "\e104"; -} + content: "\e104"; } .glyphicon-eye-open:before { - content: "\e105"; -} + content: "\e105"; } .glyphicon-eye-close:before { - content: "\e106"; -} + content: "\e106"; } .glyphicon-warning-sign:before { - content: "\e107"; -} + content: "\e107"; } .glyphicon-plane:before { - content: "\e108"; -} + content: "\e108"; } .glyphicon-calendar:before { - content: "\e109"; -} + content: "\e109"; } .glyphicon-random:before { - content: "\e110"; -} + content: "\e110"; } .glyphicon-comment:before { - content: "\e111"; -} + content: "\e111"; } .glyphicon-magnet:before { - content: "\e112"; -} + content: "\e112"; } .glyphicon-chevron-up:before { - content: "\e113"; -} + content: "\e113"; } .glyphicon-chevron-down:before { - content: "\e114"; -} + content: "\e114"; } .glyphicon-retweet:before { - content: "\e115"; -} + content: "\e115"; } .glyphicon-shopping-cart:before { - content: "\e116"; -} + content: "\e116"; } .glyphicon-folder-close:before { - content: "\e117"; -} + content: "\e117"; } .glyphicon-folder-open:before { - content: "\e118"; -} + content: "\e118"; } .glyphicon-resize-vertical:before { - content: "\e119"; -} + content: "\e119"; } .glyphicon-resize-horizontal:before { - content: "\e120"; -} + content: "\e120"; } .glyphicon-hdd:before { - content: "\e121"; -} + content: "\e121"; } .glyphicon-bullhorn:before { - content: "\e122"; -} + content: "\e122"; } .glyphicon-bell:before { - content: "\e123"; -} + content: "\e123"; } .glyphicon-certificate:before { - content: "\e124"; -} + content: "\e124"; } .glyphicon-thumbs-up:before { - content: "\e125"; -} + content: "\e125"; } .glyphicon-thumbs-down:before { - content: "\e126"; -} + content: "\e126"; } .glyphicon-hand-right:before { - content: "\e127"; -} + content: "\e127"; } .glyphicon-hand-left:before { - content: "\e128"; -} + content: "\e128"; } .glyphicon-hand-up:before { - content: "\e129"; -} + content: "\e129"; } .glyphicon-hand-down:before { - content: "\e130"; -} + content: "\e130"; } .glyphicon-circle-arrow-right:before { - content: "\e131"; -} + content: "\e131"; } .glyphicon-circle-arrow-left:before { - content: "\e132"; -} + content: "\e132"; } .glyphicon-circle-arrow-up:before { - content: "\e133"; -} + content: "\e133"; } .glyphicon-circle-arrow-down:before { - content: "\e134"; -} + content: "\e134"; } .glyphicon-globe:before { - content: "\e135"; -} + content: "\e135"; } .glyphicon-wrench:before { - content: "\e136"; -} + content: "\e136"; } .glyphicon-tasks:before { - content: "\e137"; -} + content: "\e137"; } .glyphicon-filter:before { - content: "\e138"; -} + content: "\e138"; } .glyphicon-briefcase:before { - content: "\e139"; -} + content: "\e139"; } .glyphicon-fullscreen:before { - content: "\e140"; -} + content: "\e140"; } .glyphicon-dashboard:before { - content: "\e141"; -} + content: "\e141"; } .glyphicon-paperclip:before { - content: "\e142"; -} + content: "\e142"; } .glyphicon-heart-empty:before { - content: "\e143"; -} + content: "\e143"; } .glyphicon-link:before { - content: "\e144"; -} + content: "\e144"; } .glyphicon-phone:before { - content: "\e145"; -} + content: "\e145"; } .glyphicon-pushpin:before { - content: "\e146"; -} + content: "\e146"; } .glyphicon-usd:before { - content: "\e148"; -} + content: "\e148"; } .glyphicon-gbp:before { - content: "\e149"; -} + content: "\e149"; } .glyphicon-sort:before { - content: "\e150"; -} + content: "\e150"; } .glyphicon-sort-by-alphabet:before { - content: "\e151"; -} + content: "\e151"; } .glyphicon-sort-by-alphabet-alt:before { - content: "\e152"; -} + content: "\e152"; } .glyphicon-sort-by-order:before { - content: "\e153"; -} + content: "\e153"; } .glyphicon-sort-by-order-alt:before { - content: "\e154"; -} + content: "\e154"; } .glyphicon-sort-by-attributes:before { - content: "\e155"; -} + content: "\e155"; } .glyphicon-sort-by-attributes-alt:before { - content: "\e156"; -} + content: "\e156"; } .glyphicon-unchecked:before { - content: "\e157"; -} + content: "\e157"; } .glyphicon-expand:before { - content: "\e158"; -} + content: "\e158"; } .glyphicon-collapse-down:before { - content: "\e159"; -} + content: "\e159"; } .glyphicon-collapse-up:before { - content: "\e160"; -} + content: "\e160"; } .glyphicon-log-in:before { - content: "\e161"; -} + content: "\e161"; } .glyphicon-flash:before { - content: "\e162"; -} + content: "\e162"; } .glyphicon-log-out:before { - content: "\e163"; -} + content: "\e163"; } .glyphicon-new-window:before { - content: "\e164"; -} + content: "\e164"; } .glyphicon-record:before { - content: "\e165"; -} + content: "\e165"; } .glyphicon-save:before { - content: "\e166"; -} + content: "\e166"; } .glyphicon-open:before { - content: "\e167"; -} + content: "\e167"; } .glyphicon-saved:before { - content: "\e168"; -} + content: "\e168"; } .glyphicon-import:before { - content: "\e169"; -} + content: "\e169"; } .glyphicon-export:before { - content: "\e170"; -} + content: "\e170"; } .glyphicon-send:before { - content: "\e171"; -} + content: "\e171"; } .glyphicon-floppy-disk:before { - content: "\e172"; -} + content: "\e172"; } .glyphicon-floppy-saved:before { - content: "\e173"; -} + content: "\e173"; } .glyphicon-floppy-remove:before { - content: "\e174"; -} + content: "\e174"; } .glyphicon-floppy-save:before { - content: "\e175"; -} + content: "\e175"; } .glyphicon-floppy-open:before { - content: "\e176"; -} + content: "\e176"; } .glyphicon-credit-card:before { - content: "\e177"; -} + content: "\e177"; } .glyphicon-transfer:before { content: "\e178"; - color: #4FB654 !important; -} + color:#4FB654 !important; } .glyphicon-cutlery:before { - content: "\e179"; -} + content: "\e179"; } .glyphicon-header:before { - content: "\e180"; -} + content: "\e180"; } .glyphicon-compressed:before { - content: "\e181"; -} + content: "\e181"; } .glyphicon-earphone:before { - content: "\e182"; -} + content: "\e182"; } .glyphicon-phone-alt:before { - content: "\e183"; -} + content: "\e183"; } .glyphicon-tower:before { - content: "\e184"; -} + content: "\e184"; } .glyphicon-stats:before { - content: "\e185"; -} + content: "\e185"; } .glyphicon-sd-video:before { - content: "\e186"; -} + content: "\e186"; } .glyphicon-hd-video:before { - content: "\e187"; -} + content: "\e187"; } .glyphicon-subtitles:before { - content: "\e188"; -} + content: "\e188"; } .glyphicon-sound-stereo:before { - content: "\e189"; -} + content: "\e189"; } .glyphicon-sound-dolby:before { - content: "\e190"; -} + content: "\e190"; } .glyphicon-sound-5-1:before { - content: "\e191"; -} + content: "\e191"; } .glyphicon-sound-6-1:before { - content: "\e192"; -} + content: "\e192"; } .glyphicon-sound-7-1:before { - content: "\e193"; -} + content: "\e193"; } .glyphicon-copyright-mark:before { - content: "\e194"; -} + content: "\e194"; } .glyphicon-registration-mark:before { - content: "\e195"; -} + content: "\e195"; } .glyphicon-cloud-download:before { - content: "\e197"; -} + content: "\e197"; } .glyphicon-cloud-upload:before { - content: "\e198"; -} + content: "\e198"; } .glyphicon-tree-conifer:before { - content: "\e199"; -} + content: "\e199"; } .glyphicon-tree-deciduous:before { - content: "\e200"; -} + content: "\e200"; } * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; - text-decoration: none; + text-decoration:none;} - &:before, &:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } -} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } html { font-size: 10px; - -webkit-tap-highlight-color: transparent; -} + -webkit-tap-highlight-color: transparent; } body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; + font-size:14px; line-height: 1.428571429; color: #000; } -input, button, select, textarea { +input, +button, +select, +textarea { font-family: inherit; font-size: inherit; - line-height: inherit; -} + line-height: inherit; } figure { - margin: 0; -} + margin: 0; } img { - vertical-align: middle; -} + vertical-align: middle; } .img-responsive { display: block; width: 100% \9; max-width: 100%; - height: auto; -} + height: auto; } .img-rounded { - border-radius: 6px; -} + border-radius: 6px; } .img-thumbnail { padding: 4px; @@ -1231,19 +965,16 @@ img { display: inline-block; width: 100% \9; max-width: 100%; - height: auto; -} + height: auto; } .img-circle { - border-radius: 50%; -} + border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; - border-top: 1px solid #eeeeee; -} + border-top: 1px solid #eeeeee; } .sr-only { position: absolute; @@ -1253,553 +984,338 @@ hr { padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); - border: 0; -} + border: 0; } + +.sr-only-focusable:active, .sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; } -.sr-only-focusable { - &:active, &:focus { - position: static; - width: auto; - height: auto; - margin: 0; - overflow: visible; - clip: auto; - } -} -h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { - font-family: "SourceSansProSemiBold"; +h1, h2, h3, h4, h5, h6, +.h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 100; line-height: 1.4; - color: inherit; -} - -h1 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -h2 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -h3 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -h4 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -h5 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -h6 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -.h1 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -.h2 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -.h3 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -.h4 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} - -.h5 { - small, .small { + color: inherit; } + h1 small, + h1 .small, h2 small, + h2 .small, h3 small, + h3 .small, h4 small, + h4 .small, h5 small, + h5 .small, h6 small, + h6 .small, + .h1 small, + .h1 .small, .h2 small, + .h2 .small, .h3 small, + .h3 .small, .h4 small, + .h4 .small, .h5 small, + .h5 .small, .h6 small, + .h6 .small { font-weight: normal; line-height: 1; - color: #b6b6b6; - } -} - -.h6 { - small, .small { - font-weight: normal; - line-height: 1; - color: #b6b6b6; - } -} + color: #b6b6b6; } -h1, .h1, h2, .h2, h3, .h3 { +h1, .h1, +h2, .h2, +h3, .h3 { margin-top: 20px; - margin-bottom: 10px; -} - -h1 { - small, .small { - font-size: 65%; - } -} - -.h1 { - small, .small { - font-size: 65%; - } -} - -h2 { - small, .small { - font-size: 65%; - } -} - -.h2 { - small, .small { - font-size: 65%; - } -} - -h3 { - small, .small { - font-size: 65%; - } -} - -.h3 { - small, .small { - font-size: 65%; - } -} - -h4, .h4, h5, .h5, h6, .h6 { + margin-bottom: 10px; } + h1 small, + h1 .small, .h1 small, + .h1 .small, + h2 small, + h2 .small, .h2 small, + .h2 .small, + h3 small, + h3 .small, .h3 small, + .h3 .small { + font-size: 65%; } + +h4, .h4, +h5, .h5, +h6, .h6 { margin-top: 10px; - margin-bottom: 10px; -} - -h4 { - small, .small { - font-size: 75%; - } -} - -.h4 { - small, .small { - font-size: 75%; - } -} - -h5 { - small, .small { - font-size: 75%; - } -} - -.h5 { - small, .small { - font-size: 75%; - } -} - -h6 { - small, .small { - font-size: 75%; - } -} - -.h6 { - small, .small { - font-size: 75%; - } -} + margin-bottom: 10px; } + h4 small, + h4 .small, .h4 small, + .h4 .small, + h5 small, + h5 .small, .h5 small, + .h5 .small, + h6 small, + h6 .small, .h6 small, + .h6 .small { + font-size: 75%; } h1, .h1 { - font-size: 23px; -} + font-size: 24px; + font-weight: bold; } h2, .h2 { - font-size: 16px; -} + font-size: 16px; } h3, .h3 { - font-size: 14px; -} + font-size:14px; } h4, .h4 { - font-size: 18px; -} + font-size: 18px; } h5, .h5 { - font-size: 14px; -} + font-size:14px; } h6, .h6 { - font-size: 12px; -} + font-size:12px; } p { - margin: 0 0 10px; -} + margin: 0 0 10px; } .lead { margin-bottom: 20px; font-size: 16px; font-weight: 300; - line-height: 1.4; -} - -@media (min-width: 768px) { - .lead { - font-size: 21px; - } -} + line-height: 1.4; } + @media (min-width: 768px) { + .lead { + font-size: 21px; } } -small, .small { - font-size: 85%; -} +small, +.small { + font-size: 85%; } cite { - font-style: normal; -} + font-style: normal; } -mark, .mark { +mark, +.mark { background-color: #fcf8e3; - padding: .2em; -} + padding: .2em; } .text-left { - text-align: left; -} + text-align: left; } .text-right { - text-align: right; -} + text-align: right; } .text-center { - text-align: center; -} + text-align: center; } .text-justify { - text-align: justify; -} + text-align: justify; } .text-nowrap { - white-space: nowrap; -} + white-space: nowrap; } .text-lowercase { - text-transform: lowercase; -} + text-transform: lowercase; } .text-uppercase { - text-transform: uppercase; -} + text-transform: uppercase; } .text-capitalize { - text-transform: capitalize; -} + text-transform: capitalize; } .text-muted { - color: inherit; -} + color: inherit; } .text-primary { - color: #FF8B00; -} + color: #FF8B00; } a.text-primary:hover { - color: #b85904; -} + color: #b85904; } .text-success { - color: #4FB654; -} + color: #4FB654; } a.text-success:hover { - color: #7fc54f; -} + color: #7fc54f; } .text-info { - color: #47809f; -} + color: #ff6e05; } a.text-info:hover { - color: #245269; -} + color: #245269; } .text-warning { - color: #f0ad4e; -} + color: #f0ad4e; } a.text-warning:hover { - color: #ec971f; -} + color: #ec971f; } .text-danger { - color: #CB4326; -} + color: #CB4326; } a.text-danger:hover { - color: #D8482A; -} + color: #D8482A; } .bg-primary { - color: #fff; - background-color: #FF8B00; -} + color: #fff; } + +.bg-primary { + background-color: #FF8B00; } a.bg-primary:hover { - background-color: #b85904; -} + background-color: #b85904; } .bg-success { - background-color: #9BD275; -} + background-color: #9BD275; } a.bg-success:hover { - background-color: #7fc54f; -} + background-color: #7fc54f; } .bg-info { - background-color: #d9edf7; -} + background-color: #d9edf7; } a.bg-info:hover { - background-color: #afd9ee; -} + background-color: #afd9ee; } .bg-warning { - background-color: #fcf8e3; -} + background-color: #fcf8e3; } a.bg-warning:hover { - background-color: #f7ecb5; -} + background-color: #f7ecb5; } .bg-danger { - background-color: #F05050; -} + background-color: #F05050; } a.bg-danger:hover { - background-color: #ec2121; -} + background-color: #ec2121; } + +fa.fa-long-arrow-right { + color: #d951ff !important; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; - border-bottom: 1px solid #eeeeee; -} - -ul, ol { - margin-top: 0; - margin-bottom: 10px; -} - -ul { - ul, ol { - margin-bottom: 0; - } -} + border-bottom: 1px solid #eeeeee; } +ul, ol { - ul, ol { - margin-bottom: 0; - } -} - -.list-unstyled { + margin-top: 0; + margin-bottom: 10px; } + ul ul, + ul ol, + ol ul, + ol ol { + margin-bottom: 0; } + +.list-unstyled, .list-inline { padding-left: 0; - list-style: none; -} + list-style: none; } .list-inline { - padding-left: 0; - list-style: none; - margin-left: -5px; - - > li { + margin-left: -5px; } + .list-inline > li { float: left; padding-left: 5px; - padding-right: 5px; - } -} + padding-right: 5px; } dl { margin-top: 0; - margin-bottom: 20px; -} + margin-bottom: 20px; } -dt, dd { - line-height: 1.428571429; -} +dt, +dd { + line-height: 1.428571429; } dt { - font-weight: bold; -} + font-weight: bold; } dd { - margin-left: 0; -} - -.dl-horizontal dd { - &:before { - content: " "; - display: table; - } - - &:after { - content: " "; - display: table; - clear: both; - } -} + margin-left: 0; } +.dl-horizontal dd:before, .dl-horizontal dd:after { + content: " "; + display: table; } +.dl-horizontal dd:after { + clear: both; } @media (min-width: 768px) { - .dl-horizontal { - dt { - float: left; - width: 160px; - clear: left; - text-align: right; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - dd { - margin-left: 180px; - } - } -} + .dl-horizontal dt { + float: left; + width: 160px; + clear: left; + text-align: right; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } + .dl-horizontal dd { + margin-left: 180px; } } -abbr { - &[title], &[data-original-title] { - cursor: help; - border-bottom: 1px dotted #777777; - } -} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #777777; } .initialism { font-size: 90%; - text-transform: uppercase; -} + text-transform: uppercase; } blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; - border-left: 5px solid #eeeeee; - - p:last-child, ul:last-child, ol:last-child { - margin-bottom: 0; - } - - footer, small, .small { + border-left: 5px solid #eeeeee; } + blockquote p:last-child, + blockquote ul:last-child, + blockquote ol:last-child { + margin-bottom: 0; } + blockquote footer, + blockquote small, + blockquote .small { display: block; font-size: 80%; line-height: 1.428571429; - color: #777777; - } - - footer:before, small:before, .small:before { - content: '\2014 \00A0'; - } -} + color: #777777; } + blockquote footer:before, + blockquote small:before, + blockquote .small:before { + content: '\2014 \00A0'; } -.blockquote-reverse, blockquote.pull-right { +.blockquote-reverse, +blockquote.pull-right { padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; - text-align: right; -} - -.blockquote-reverse { - footer:before, small:before, .small:before { - content: ''; - } -} - -blockquote.pull-right { - footer:before, small:before, .small:before { - content: ''; - } -} - -.blockquote-reverse { - footer:after, small:after, .small:after { - content: '\00A0 \2014'; - } -} - -blockquote { - &.pull-right { - footer:after, small:after, .small:after { - content: '\00A0 \2014'; - } - } - - &:before, &:after { - content: ""; - } -} + text-align: right; } + .blockquote-reverse footer:before, + .blockquote-reverse small:before, + .blockquote-reverse .small:before, + blockquote.pull-right footer:before, + blockquote.pull-right small:before, + blockquote.pull-right .small:before { + content: ''; } + .blockquote-reverse footer:after, + .blockquote-reverse small:after, + .blockquote-reverse .small:after, + blockquote.pull-right footer:after, + blockquote.pull-right small:after, + blockquote.pull-right .small:after { + content: '\00A0 \2014'; } + +blockquote:before, +blockquote:after { + content: ""; } address { margin-bottom: 20px; font-style: normal; - line-height: 1.428571429; -} + line-height: 1.428571429; } -code, kbd, pre, samp { - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; -} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; - border-radius: 3px; -} + border-radius: 3px; } kbd { padding: 2px 4px; @@ -1807,14 +1323,11 @@ kbd { color: #fff; background-color: #2d2d2d; border-radius: 3px; - box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); - - kbd { + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } + kbd kbd { padding: 0; font-size: 100%; - box-shadow: none; - } -} + box-shadow: none; } pre { display: block; @@ -1827,1356 +1340,846 @@ pre { color: #000; background-color: inherit; border: inherit; - border-radius: 3px; - - code { + border-radius: 3px; } + pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; - border-radius: 0; - } -} + border-radius: 0; } .pre-scrollable { max-height: 340px; - overflow-y: scroll; -} + overflow-y: scroll; } -.container, .container-fluid { +.container { margin-right: auto; margin-left: auto; padding-left: 20px; - padding-right: 20px; - - &:before { + padding-right: 20px; } + .container:before, .container:after { content: " "; - display: table; - } - - &:after { + display: table; } + .container:after { + clear: both; } + @media (min-width: 768px) { + .container { + width: 760px; } } + @media (min-width: 992px) { + .container { + width: 980px; } } + @media (min-width: 1200px) { + .container { + width: 1180px; } } + +.container-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 20px; + padding-right: 20px; } + .container-fluid:before, .container-fluid:after { content: " "; - display: table; - clear: both; - } -} - -@media (min-width: 768px) { - .container { - width: 760px; - } -} - -@media (min-width: 992px) { - .container { - width: 980px; - } -} - -@media (min-width: 1200px) { - .container { - width: 1180px; - } -} + display: table; } + .container-fluid:after { + clear: both; } .row { margin-left: -20px; - margin-right: -20px; - - &:before { - content: " "; - display: table; - } - - &:after { + margin-right: -20px; } + .row:before, .row:after { content: " "; - display: table; - clear: both; - } -} + display: table; } + .row:after { + clear: both; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { position: relative; min-height: 1px; padding-left: 20px; - padding-right: 20px; -} + padding-right: 20px; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { - float: left; -} + float: left; } .col-xs-1 { - width: 8.33333%; -} + width: 8.33333%; } .col-xs-2 { - width: 16.66667%; -} + width: 16.66667%; } .col-xs-3 { - width: 25%; -} + width: 25%; } .col-xs-4 { - width: 33.33333%; -} + width: 33.33333%; } .col-xs-5 { - width: 41.66667%; -} + width: 41.66667%; } .col-xs-6 { - width: 50%; -} + width: 50%; } .col-xs-7 { - width: 58.33333%; -} + width: 58.33333%; } .col-xs-8 { - width: 66.66667%; -} + width: 66.66667%; } .col-xs-9 { - width: 75%; -} + width: 75%; } .col-xs-10 { - width: 83.33333%; -} + width: 83.33333%; } .col-xs-11 { - width: 91.66667%; -} + width: 91.66667%; } .col-xs-12 { - width: 100%; -} + width: 100%; } .col-xs-pull-0 { - right: auto; -} + right: auto; } .col-xs-pull-1 { - right: 8.33333%; -} + right: 8.33333%; } .col-xs-pull-2 { - right: 16.66667%; -} + right: 16.66667%; } .col-xs-pull-3 { - right: 25%; -} + right: 25%; } .col-xs-pull-4 { - right: 33.33333%; -} + right: 33.33333%; } .col-xs-pull-5 { - right: 41.66667%; -} + right: 41.66667%; } .col-xs-pull-6 { - right: 50%; -} + right: 50%; } .col-xs-pull-7 { - right: 58.33333%; -} + right: 58.33333%; } .col-xs-pull-8 { - right: 66.66667%; -} + right: 66.66667%; } .col-xs-pull-9 { - right: 75%; -} + right: 75%; } .col-xs-pull-10 { - right: 83.33333%; -} + right: 83.33333%; } .col-xs-pull-11 { - right: 91.66667%; -} + right: 91.66667%; } .col-xs-pull-12 { - right: 100%; -} + right: 100%; } .col-xs-push-0 { - left: auto; -} + left: auto; } .col-xs-push-1 { - left: 8.33333%; -} + left: 8.33333%; } .col-xs-push-2 { - left: 16.66667%; -} + left: 16.66667%; } .col-xs-push-3 { - left: 25%; -} + left: 25%; } .col-xs-push-4 { - left: 33.33333%; -} + left: 33.33333%; } .col-xs-push-5 { - left: 41.66667%; -} + left: 41.66667%; } .col-xs-push-6 { - left: 50%; -} + left: 50%; } .col-xs-push-7 { - left: 58.33333%; -} + left: 58.33333%; } .col-xs-push-8 { - left: 66.66667%; -} + left: 66.66667%; } .col-xs-push-9 { - left: 75%; -} + left: 75%; } .col-xs-push-10 { - left: 83.33333%; -} + left: 83.33333%; } .col-xs-push-11 { - left: 91.66667%; -} + left: 91.66667%; } .col-xs-push-12 { - left: 100%; -} + left: 100%; } .col-xs-offset-0 { - margin-left: 0%; -} + margin-left: 0%; } .col-xs-offset-1 { - margin-left: 8.33333%; -} + margin-left: 8.33333%; } .col-xs-offset-2 { - margin-left: 16.66667%; -} + margin-left: 16.66667%; } .col-xs-offset-3 { - margin-left: 25%; -} + margin-left: 25%; } .col-xs-offset-4 { - margin-left: 33.33333%; -} + margin-left: 33.33333%; } .col-xs-offset-5 { - margin-left: 41.66667%; -} + margin-left: 41.66667%; } .col-xs-offset-6 { - margin-left: 50%; -} + margin-left: 50%; } .col-xs-offset-7 { - margin-left: 58.33333%; -} + margin-left: 58.33333%; } .col-xs-offset-8 { - margin-left: 66.66667%; -} + margin-left: 66.66667%; } .col-xs-offset-9 { - margin-left: 75%; -} + margin-left: 75%; } .col-xs-offset-10 { - margin-left: 83.33333%; -} + margin-left: 83.33333%; } .col-xs-offset-11 { - margin-left: 91.66667%; -} + margin-left: 91.66667%; } .col-xs-offset-12 { - margin-left: 100%; -} + margin-left: 100%; } @media (min-width: 768px) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { - float: left; - } + float: left; } .col-sm-1 { - width: 8.33333%; - } + width: 8.33333%; } .col-sm-2 { - width: 16.66667%; - } + width: 16.66667%; } .col-sm-3 { - width: 25%; - } + width: 25%; } .col-sm-4 { - width: 33.33333%; - } + width: 33.33333%; } .col-sm-5 { - width: 41.66667%; - } + width: 41.66667%; } .col-sm-6 { - width: 50%; - } + width: 50%; } .col-sm-7 { - width: 58.33333%; - } + width: 58.33333%; } .col-sm-8 { - width: 66.66667%; - } + width: 66.66667%; } .col-sm-9 { - width: 75%; - } + width: 75%; } .col-sm-10 { - width: 83.33333%; - } + width: 83.33333%; } .col-sm-11 { - width: 91.66667%; - } + width: 91.66667%; } .col-sm-12 { - width: 100%; - } + width: 100%; } .col-sm-pull-0 { - right: auto; - } + right: auto; } .col-sm-pull-1 { - right: 8.33333%; - } + right: 8.33333%; } .col-sm-pull-2 { - right: 16.66667%; - } + right: 16.66667%; } .col-sm-pull-3 { - right: 25%; - } + right: 25%; } .col-sm-pull-4 { - right: 33.33333%; - } + right: 33.33333%; } .col-sm-pull-5 { - right: 41.66667%; - } + right: 41.66667%; } .col-sm-pull-6 { - right: 50%; - } + right: 50%; } .col-sm-pull-7 { - right: 58.33333%; - } + right: 58.33333%; } .col-sm-pull-8 { - right: 66.66667%; - } + right: 66.66667%; } .col-sm-pull-9 { - right: 75%; - } + right: 75%; } .col-sm-pull-10 { - right: 83.33333%; - } + right: 83.33333%; } .col-sm-pull-11 { - right: 91.66667%; - } + right: 91.66667%; } .col-sm-pull-12 { - right: 100%; - } + right: 100%; } .col-sm-push-0 { - left: auto; - } + left: auto; } .col-sm-push-1 { - left: 8.33333%; - } + left: 8.33333%; } .col-sm-push-2 { - left: 16.66667%; - } + left: 16.66667%; } .col-sm-push-3 { - left: 25%; - } + left: 25%; } .col-sm-push-4 { - left: 33.33333%; - } + left: 33.33333%; } .col-sm-push-5 { - left: 41.66667%; - } + left: 41.66667%; } .col-sm-push-6 { - left: 50%; - } + left: 50%; } .col-sm-push-7 { - left: 58.33333%; - } + left: 58.33333%; } .col-sm-push-8 { - left: 66.66667%; - } + left: 66.66667%; } .col-sm-push-9 { - left: 75%; - } + left: 75%; } .col-sm-push-10 { - left: 83.33333%; - } + left: 83.33333%; } .col-sm-push-11 { - left: 91.66667%; - } + left: 91.66667%; } .col-sm-push-12 { - left: 100%; - } + left: 100%; } .col-sm-offset-0 { - margin-left: 0%; - } + margin-left: 0%; } .col-sm-offset-1 { - margin-left: 8.33333%; - } + margin-left: 8.33333%; } .col-sm-offset-2 { - margin-left: 16.66667%; - } + margin-left: 16.66667%; } .col-sm-offset-3 { - margin-left: 25%; - } + margin-left: 25%; } .col-sm-offset-4 { - margin-left: 33.33333%; - } + margin-left: 33.33333%; } .col-sm-offset-5 { - margin-left: 41.66667%; - } + margin-left: 41.66667%; } .col-sm-offset-6 { - margin-left: 50%; - } + margin-left: 50%; } .col-sm-offset-7 { - margin-left: 58.33333%; - } + margin-left: 58.33333%; } .col-sm-offset-8 { - margin-left: 66.66667%; - } + margin-left: 66.66667%; } .col-sm-offset-9 { - margin-left: 75%; - } + margin-left: 75%; } .col-sm-offset-10 { - margin-left: 83.33333%; - } + margin-left: 83.33333%; } .col-sm-offset-11 { - margin-left: 91.66667%; - } + margin-left: 91.66667%; } .col-sm-offset-12 { - margin-left: 100%; - } -} - + margin-left: 100%; } } @media (min-width: 992px) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { - float: left; - } + float: left; } .col-md-1 { - width: 8.33333%; - } + width: 8.33333%; } .col-md-2 { - width: 16.66667%; - } + width: 16.66667%; } .col-md-3 { - width: 25%; - } + width: 25%; } .col-md-4 { - width: 33.33333%; - } + width: 33.33333%; } .col-md-5 { - width: 41.66667%; - } + width: 41.66667%; } .col-md-6 { - width: 50%; - } + width: 50%; } .col-md-7 { - width: 58.33333%; - } + width: 58.33333%; } .col-md-8 { - width: 66.66667%; - } + width: 66.66667%; } .col-md-9 { - width: 75%; - } + width: 75%; } .col-md-10 { - width: 83.33333%; - } + width: 83.33333%; } .col-md-11 { - width: 91.66667%; - } + width: 91.66667%; } .col-md-12 { - width: 100%; - } + width: 100%; } .col-md-pull-0 { - right: auto; - } + right: auto; } .col-md-pull-1 { - right: 8.33333%; - } + right: 8.33333%; } .col-md-pull-2 { - right: 16.66667%; - } + right: 16.66667%; } .col-md-pull-3 { - right: 25%; - } + right: 25%; } .col-md-pull-4 { - right: 33.33333%; - } + right: 33.33333%; } .col-md-pull-5 { - right: 41.66667%; - } + right: 41.66667%; } .col-md-pull-6 { - right: 50%; - } + right: 50%; } .col-md-pull-7 { - right: 58.33333%; - } + right: 58.33333%; } .col-md-pull-8 { - right: 66.66667%; - } + right: 66.66667%; } .col-md-pull-9 { - right: 75%; - } + right: 75%; } .col-md-pull-10 { - right: 83.33333%; - } + right: 83.33333%; } .col-md-pull-11 { - right: 91.66667%; - } + right: 91.66667%; } .col-md-pull-12 { - right: 100%; - } + right: 100%; } .col-md-push-0 { - left: auto; - } + left: auto; } .col-md-push-1 { - left: 8.33333%; - } + left: 8.33333%; } .col-md-push-2 { - left: 16.66667%; - } + left: 16.66667%; } .col-md-push-3 { - left: 25%; - } + left: 25%; } .col-md-push-4 { - left: 33.33333%; - } + left: 33.33333%; } .col-md-push-5 { - left: 41.66667%; - } + left: 41.66667%; } .col-md-push-6 { - left: 50%; - } + left: 50%; } .col-md-push-7 { - left: 58.33333%; - } + left: 58.33333%; } .col-md-push-8 { - left: 66.66667%; - } + left: 66.66667%; } .col-md-push-9 { - left: 75%; - } + left: 75%; } .col-md-push-10 { - left: 83.33333%; - } + left: 83.33333%; } .col-md-push-11 { - left: 91.66667%; - } + left: 91.66667%; } .col-md-push-12 { - left: 100%; - } + left: 100%; } .col-md-offset-0 { - margin-left: 0%; - } + margin-left: 0%; } .col-md-offset-1 { - margin-left: 8.33333%; - } + margin-left: 8.33333%; } .col-md-offset-2 { - margin-left: 16.66667%; - } + margin-left: 16.66667%; } .col-md-offset-3 { - margin-left: 25%; - } + margin-left: 25%; } .col-md-offset-4 { - margin-left: 33.33333%; - } + margin-left: 33.33333%; } .col-md-offset-5 { - margin-left: 41.66667%; - } + margin-left: 41.66667%; } .col-md-offset-6 { - margin-left: 50%; - } + margin-left: 50%; } .col-md-offset-7 { - margin-left: 58.33333%; - } + margin-left: 58.33333%; } .col-md-offset-8 { - margin-left: 66.66667%; - } + margin-left: 66.66667%; } .col-md-offset-9 { - margin-left: 75%; - } + margin-left: 75%; } .col-md-offset-10 { - margin-left: 83.33333%; - } + margin-left: 83.33333%; } .col-md-offset-11 { - margin-left: 91.66667%; - } + margin-left: 91.66667%; } .col-md-offset-12 { - margin-left: 100%; - } -} - + margin-left: 100%; } } @media (min-width: 1200px) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { - float: left; - } + float: left; } .col-lg-1 { - width: 8.33333%; - } + width: 8.33333%; } .col-lg-2 { - width: 16.66667%; - } + width: 16.66667%; } .col-lg-3 { - width: 25%; - } + width: 25%; } .col-lg-4 { - width: 33.33333%; - } + width: 33.33333%; } .col-lg-5 { - width: 41.66667%; - } + width: 41.66667%; } .col-lg-6 { - width: 50%; - } + width: 50%; } .col-lg-7 { - width: 58.33333%; - } + width: 58.33333%; } .col-lg-8 { - width: 66.66667%; - } + width: 66.66667%; } .col-lg-9 { - width: 75%; - } + width: 75%; } .col-lg-10 { - width: 83.33333%; - } + width: 83.33333%; } .col-lg-11 { - width: 91.66667%; - } + width: 91.66667%; } .col-lg-12 { - width: 100%; - } + width: 100%; } .col-lg-pull-0 { - right: auto; - } + right: auto; } .col-lg-pull-1 { - right: 8.33333%; - } + right: 8.33333%; } .col-lg-pull-2 { - right: 16.66667%; - } + right: 16.66667%; } .col-lg-pull-3 { - right: 25%; - } + right: 25%; } .col-lg-pull-4 { - right: 33.33333%; - } + right: 33.33333%; } .col-lg-pull-5 { - right: 41.66667%; - } + right: 41.66667%; } .col-lg-pull-6 { - right: 50%; - } + right: 50%; } .col-lg-pull-7 { - right: 58.33333%; - } + right: 58.33333%; } .col-lg-pull-8 { - right: 66.66667%; - } + right: 66.66667%; } .col-lg-pull-9 { - right: 75%; - } + right: 75%; } .col-lg-pull-10 { - right: 83.33333%; - } + right: 83.33333%; } .col-lg-pull-11 { - right: 91.66667%; - } + right: 91.66667%; } .col-lg-pull-12 { - right: 100%; - } + right: 100%; } .col-lg-push-0 { - left: auto; - } + left: auto; } .col-lg-push-1 { - left: 8.33333%; - } + left: 8.33333%; } .col-lg-push-2 { - left: 16.66667%; - } + left: 16.66667%; } .col-lg-push-3 { - left: 25%; - } + left: 25%; } .col-lg-push-4 { - left: 33.33333%; - } + left: 33.33333%; } .col-lg-push-5 { - left: 41.66667%; - } + left: 41.66667%; } .col-lg-push-6 { - left: 50%; - } + left: 50%; } .col-lg-push-7 { - left: 58.33333%; - } + left: 58.33333%; } .col-lg-push-8 { - left: 66.66667%; - } + left: 66.66667%; } .col-lg-push-9 { - left: 75%; - } + left: 75%; } .col-lg-push-10 { - left: 83.33333%; - } + left: 83.33333%; } .col-lg-push-11 { - left: 91.66667%; - } + left: 91.66667%; } .col-lg-push-12 { - left: 100%; - } + left: 100%; } .col-lg-offset-0 { - margin-left: 0%; - } + margin-left: 0%; } .col-lg-offset-1 { - margin-left: 8.33333%; - } + margin-left: 8.33333%; } .col-lg-offset-2 { - margin-left: 16.66667%; - } + margin-left: 16.66667%; } .col-lg-offset-3 { - margin-left: 25%; - } + margin-left: 25%; } .col-lg-offset-4 { - margin-left: 33.33333%; - } + margin-left: 33.33333%; } .col-lg-offset-5 { - margin-left: 41.66667%; - } + margin-left: 41.66667%; } .col-lg-offset-6 { - margin-left: 50%; - } + margin-left: 50%; } .col-lg-offset-7 { - margin-left: 58.33333%; - } + margin-left: 58.33333%; } .col-lg-offset-8 { - margin-left: 66.66667%; - } + margin-left: 66.66667%; } .col-lg-offset-9 { - margin-left: 75%; - } + margin-left: 75%; } .col-lg-offset-10 { - margin-left: 83.33333%; - } + margin-left: 83.33333%; } .col-lg-offset-11 { - margin-left: 91.66667%; - } + margin-left: 91.66667%; } .col-lg-offset-12 { - margin-left: 100%; - } -} + margin-left: 100%; } } th { - text-align: left; -} + text-align: left; } .table { width: 100%; max-width: 100%; - margin-bottom: 20px; - - > { - thead > tr > { - th, td { - padding: 10px 0px 10px 20px; - line-height: 1.428571429; - vertical-align: top; - border-top: 1px solid #e3e3e3; - } - } - - tbody > tr > { - th, td { - padding: 10px 0px 10px 20px; - line-height: 1.428571429; - vertical-align: top; - border-top: 1px solid #e3e3e3; - } - } - - tfoot > tr > { - th, td { - padding: 10px 0px 10px 20px; - line-height: 1.428571429; - vertical-align: top; - border-top: 1px solid #e3e3e3; - } - } - - thead > tr > th { - vertical-align: bottom; - } - - caption + thead > tr:first-child > { - th, td { - border-top: 0; - font-family: 'SourceSansProSemibold'; - font-weight: normal; - border-bottom: 1px solid #bdbdbd; - background-color: #e3e3e3; - } - } - - colgroup + thead > tr:first-child > { - th, td { - border-top: 0; - font-family: 'SourceSansProSemibold'; - font-weight: normal; - border-bottom: 1px solid #bdbdbd; - background-color: #e3e3e3; - } - } - - thead:first-child > tr:first-child > { - th, td { - border-top: 0; - font-family: 'SourceSansProSemibold'; - font-weight: normal; - border-bottom: 1px solid #bdbdbd; - background-color: #e3e3e3; - } - } - - tbody + tbody { - border-top: 2px solid #eee; - } - } - - .table { - background-color: none; - } -} - -.table-condensed > { - thead > tr > { - th, td { - padding: 5px; - } - } - - tbody > tr > { - th, td { - padding: 5px; - } - } - - tfoot > tr > { - th, td { - padding: 5px; - } - } -} + margin-bottom: 20px; } + .table > thead > tr > th, + .table > thead > tr > td, + .table > tbody > tr > th, + .table > tbody > tr > td, + .table > tfoot > tr > th, + .table > tfoot > tr > td { + padding: 10px 0px 10px 20px; + line-height: 1.428571429; + vertical-align: top; + border-top: 1px solid #f0f0f0; } + .table > thead > tr > th { + vertical-align: bottom; } + .table > caption + thead > tr:first-child > th, + .table > caption + thead > tr:first-child > td, + .table > colgroup + thead > tr:first-child > th, + .table > colgroup + thead > tr:first-child > td, + .table > thead:first-child > tr:first-child > th, + .table > thead:first-child > tr:first-child > td { + border-top: 0; + font-family: 'SourceSansProSemibold'; + font-weight: normal; + border-bottom: 1px solid #5e5e5e; + background-color: #45565f; + color: #FFF;} + .table > tbody + tbody { + border-top: 2px solid #5e5e5e; } + .table .table { + background-color: none; } + +.table-condensed > thead > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > th, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > th, +.table-condensed > tfoot > tr > td { + padding: 5px; } .table-bordered { - border: 1px solid #dbdbdb; - - > { - thead > tr > { - th, td { - border: 1px solid #dbdbdb; - } - } - - tbody > tr > { - th, td { - border: 1px solid #dbdbdb; - } - } - - tfoot > tr > { - th, td { - border: 1px solid #dbdbdb; - } - } - - thead > tr > { - th, td { - border-bottom-width: 2px; - } - } - } -} - -.table-striped > tbody > tr:nth-child(odd) > { - td, th { - background-color: #fbfbfb; - } -} - -.table-hover > tbody > tr:hover > { - td, th { - background-color: #f2fafe; - } -} - -table { - col[class*="col-"] { - position: static; - float: none; - display: table-column; - } - - td[class*="col-"], th[class*="col-"] { - position: static; - float: none; - display: table-cell; - } -} - -.table > { - thead > tr { - > { - td.active, th.active { - background-color: #E2F5FF; - } - } - - &.active > { - td, th { - background-color: #E2F5FF; - } - } - } - - tbody > tr { - > { - td.active, th.active { - background-color: #E2F5FF; - } - } - - &.active > { - td, th { - background-color: #E2F5FF; - } - } - } - - tfoot > tr { - > { - td.active, th.active { - background-color: #E2F5FF; - } - } - - &.active > { - td, th { - background-color: #E2F5FF; - } - } - } -} - -.table-hover > tbody > tr { - > { - td.active:hover, th.active:hover { - background-color: #FF8B00; - } - } - - &.active:hover > td, &:hover > .active, &.active:hover > th { - background-color: #FF8B00; - } -} - -.table > { - thead > tr { - > { - td.success, th.success { - background-color: #9BD275; - } - } - - &.success > { - td, th { - background-color: #9BD275; - } - } - } - - tbody > tr { - > { - td.success, th.success { - background-color: #9BD275; - } - } - - &.success > { - td, th { - background-color: #9BD275; - } - } - } - - tfoot > tr { - > { - td.success, th.success { - background-color: #9BD275; - } - } - - &.success > { - td, th { - background-color: #9BD275; - } - } - } -} - -.table-hover > tbody > tr { - > { - td.success:hover, th.success:hover { - background-color: #8dcc62; - } - } - - &.success:hover > td, &:hover > .success, &.success:hover > th { - background-color: #8dcc62; - } -} - -.table > { - thead > tr { - > { - td.info, th.info { - background-color: #d9edf7; - } - } - - &.info > { - td, th { - background-color: #d9edf7; - } - } - } - - tbody > tr { - > { - td.info, th.info { - background-color: #d9edf7; - } - } - - &.info > { - td, th { - background-color: #d9edf7; - } - } - } - - tfoot > tr { - > { - td.info, th.info { - background-color: #d9edf7; - } - } - - &.info > { - td, th { - background-color: #d9edf7; - } - } - } -} - -.table-hover > tbody > tr { - > { - td.info:hover, th.info:hover { - background-color: #c4e3f3; - } - } - - &.info:hover > td, &:hover > .info, &.info:hover > th { - background-color: #c4e3f3; - } -} - -.table > { - thead > tr { - > { - td.warning, th.warning { - background-color: #fcf8e3; - } - } - - &.warning > { - td, th { - background-color: #fcf8e3; - } - } - } - - tbody > tr { - > { - td.warning, th.warning { - background-color: #fcf8e3; - } - } - - &.warning > { - td, th { - background-color: #fcf8e3; - } - } - } - - tfoot > tr { - > { - td.warning, th.warning { - background-color: #fcf8e3; - } - } - - &.warning > { - td, th { - background-color: #fcf8e3; - } - } - } -} - -.table-hover > tbody > tr { - > { - td.warning:hover, th.warning:hover { - background-color: #faf2cc; - } - } - - &.warning:hover > td, &:hover > .warning, &.warning:hover > th { - background-color: #faf2cc; - } -} - -.table > { - thead > tr { - > { - td.danger, th.danger { - background-color: #F05050; - } - } - - &.danger > { - td, th { - background-color: #F05050; - } - } - } - - tbody > tr { - > { - td.danger, th.danger { - background-color: #F05050; - } - } - - &.danger > { - td, th { - background-color: #F05050; - } - } - } - - tfoot > tr { - > { - td.danger, th.danger { - background-color: #F05050; - } - } - - &.danger > { - td, th { - background-color: #F05050; - } - } - } -} - -.table-hover > tbody > tr { - > { - td.danger:hover, th.danger:hover { - background-color: #ee3939; - } - } + border: 1px solid #dbdbdb; } + .table-bordered > thead > tr > th, + .table-bordered > thead > tr > td, + .table-bordered > tbody > tr > th, + .table-bordered > tbody > tr > td, + .table-bordered > tfoot > tr > th, + .table-bordered > tfoot > tr > td { + border: 1px solid #dbdbdb; } + .table-bordered > thead > tr > th, + .table-bordered > thead > tr > td { + border-bottom-width: 2px; } + +.table-striped > tbody > tr:nth-child(odd) > td, +.table-striped > tbody > tr:nth-child(odd) > th { + background-color: #fff; } + +.table-hover > tbody > tr:hover > td, +.table-hover > tbody > tr:hover > th { + background-color: #738087; + color: #FFF; } + +table col[class*="col-"] { + position: static; + float: none; + display: table-column; } - &.danger:hover > td, &:hover > .danger, &.danger:hover > th { - background-color: #ee3939; - } -} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + float: none; + display: table-cell; } + +.table > thead > tr > td.active, +.table > thead > tr > th.active, .table > thead > tr.active > td, .table > thead > tr.active > th, +.table > tbody > tr > td.active, +.table > tbody > tr > th.active, +.table > tbody > tr.active > td, +.table > tbody > tr.active > th, +.table > tfoot > tr > td.active, +.table > tfoot > tr > th.active, +.table > tfoot > tr.active > td, +.table > tfoot > tr.active > th { + background-color: #E2F5FF; } + +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { + background-color: #FF8B00; } + +.table > thead > tr > td.success, +.table > thead > tr > th.success, .table > thead > tr.success > td, .table > thead > tr.success > th, +.table > tbody > tr > td.success, +.table > tbody > tr > th.success, +.table > tbody > tr.success > td, +.table > tbody > tr.success > th, +.table > tfoot > tr > td.success, +.table > tfoot > tr > th.success, +.table > tfoot > tr.success > td, +.table > tfoot > tr.success > th { + background-color: #9BD275; } + +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { + background-color: #8dcc62; } + +.table > thead > tr > td.info, +.table > thead > tr > th.info, .table > thead > tr.info > td, .table > thead > tr.info > th, +.table > tbody > tr > td.info, +.table > tbody > tr > th.info, +.table > tbody > tr.info > td, +.table > tbody > tr.info > th, +.table > tfoot > tr > td.info, +.table > tfoot > tr > th.info, +.table > tfoot > tr.info > td, +.table > tfoot > tr.info > th { + background-color: #d9edf7; } + +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; } + +.table > thead > tr > td.warning, +.table > thead > tr > th.warning, .table > thead > tr.warning > td, .table > thead > tr.warning > th, +.table > tbody > tr > td.warning, +.table > tbody > tr > th.warning, +.table > tbody > tr.warning > td, +.table > tbody > tr.warning > th, +.table > tfoot > tr > td.warning, +.table > tfoot > tr > th.warning, +.table > tfoot > tr.warning > td, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; } + +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; } + +.table > thead > tr > td.danger, +.table > thead > tr > th.danger, .table > thead > tr.danger > td, .table > thead > tr.danger > th, +.table > tbody > tr > td.danger, +.table > tbody > tr > th.danger, +.table > tbody > tr.danger > td, +.table > tbody > tr.danger > th, +.table > tfoot > tr > td.danger, +.table > tfoot > tr > th.danger, +.table > tfoot > tr.danger > td, +.table > tfoot > tr.danger > th { + background-color: #F05050; } + +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { + background-color: #ee3939; } @media screen and (max-width: 767px) { .table-responsive { @@ -3185,98 +2188,44 @@ table { overflow-y: hidden; overflow-x: auto; -ms-overflow-style: -ms-autohiding-scrollbar; - /* border: 1px solid $table-border-color; */ - -webkit-overflow-scrolling: touch; - - > { - .table { - margin-bottom: 0; - - > { - thead > tr > { - th, td { - white-space: nowrap; - } - } - - tbody > tr > { - th, td { - white-space: nowrap; - } - } - - tfoot > tr > { - th, td { - white-space: nowrap; - } - } - } - } - - .table-bordered { - border: 0; - - > { - thead > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - - tbody > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - - tfoot > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - - thead > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - - tbody > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - - tfoot > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - - tbody > tr:last-child > { - th, td { - border-bottom: 0; - } - } - - tfoot > tr:last-child > { - th, td { - border-bottom: 0; - } - } - } - } - } - } -} + -webkit-overflow-scrolling: touch; } + .table-responsive > .table { + margin-bottom: 0; } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; } + .table-responsive > .table-bordered { + border: 0; } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; } } fieldset { padding: 0; margin: 0; border: 0; - min-width: 0; -} + min-width: 0; } legend { display: block; @@ -3287,1243 +2236,475 @@ legend { line-height: inherit; color: #2d2d2d; border: 0; - border-bottom: 1px solid #e5e5e5; -} + border-bottom: 1px solid #e5e5e5; } label { display: inline-block; max-width: 100%; margin-bottom: 5px; - font-weight: normal; -} + font-weight: normal; } -input { - &[type="search"] { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - - &[type="radio"], &[type="checkbox"] { - margin: 4px 0 0; - margin-top: 1px \9; - line-height: normal; - } - - &[type="file"] { - display: block; - } +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } - &[type="range"] { - display: block; - width: 100%; - } -} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; } -select { - &[multiple], &[size] { - height: auto; - } -} +input[type="file"] { + display: block; } + +input[type="range"] { + display: block; + width: 100%; } + +select[multiple], +select[size] { + height: auto; } + +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: none; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; } -input { - &[type="file"]:focus, &[type="radio"]:focus, &[type="checkbox"]:focus { - outline: none; - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; - } -} output { display: block; padding-top: 7px; - font-size: 14px; + font-size:14px; line-height: 1.428571429; - color: #000; -} - -select, textarea { + color: #000; } + +select, +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"] + { display: block; width: 100%; height: 34px; padding: 6px 12px; - font-size: 14px; + font-size:14px; line-height: 1.428571429; color: #000; background-color: #FFF; background-image: none; - border: 1px solid #4d83a1; + border: 1px solid #1b4257; border-radius: 3px; text-overflow: ellipsis; max-width: 348px; -webkit-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s; -o-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s; - transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s; -} + transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s; } + + select:hover, + textarea:hover, + input[type="text"]:hover, + input[type="password"]:hover, + input[type="datetime"]:hover, + input[type="datetime-local"]:hover, + input[type="date"]:hover, + input[type="month"]:hover, + input[type="time"]:hover, + input[type="week"]:hover, + input[type="number"]:hover, + input[type="email"]:hover, + input[type="url"]:hover, + input[type="search"]:hover, + input[type="tel"]:hover, + input[type="color"]:hover + { + color: #000; + background-color: none; + border-color: #ff6e05; + outline: 0; } + + select:focus, + textarea:focus, + input[type="text"]:focus, + input[type="password"]:focus, + input[type="datetime"]:focus, + input[type="datetime-local"]:focus, + input[type="date"]:focus, + input[type="month"]:focus, + input[type="time"]:focus, + input[type="week"]:focus, + input[type="number"]:focus, + input[type="email"]:focus, + input[type="url"]:focus, + input[type="search"]:focus, + input[type="tel"]:focus, + input[type="color"]:focus + + { + color: #000; + border-color: #FF6E05; + background-color: none; + outline: 0; } + + select::-moz-placeholder, + textarea::-moz-placeholder, + input[type="text"]::-moz-placeholder, + input[type="password"]::-moz-placeholder, + input[type="datetime"]::-moz-placeholder, + input[type="datetime-local"]::-moz-placeholder, + input[type="date"]::-moz-placeholder, + input[type="month"]::-moz-placeholder, + input[type="time"]::-moz-placeholder, + input[type="week"]::-moz-placeholder, + input[type="number"]::-moz-placeholder, + input[type="email"]::-moz-placeholder, + input[type="url"]::-moz-placeholder, + input[type="search"]::-moz-placeholder, + input[type="tel"]::-moz-placeholder, + input[type="color"]::-moz-placeholder + { + color: #b7b7b7; + opacity: 1; + filter: alpha(opacity=100); } + + select:-ms-input-placeholder, + textarea:-ms-input-placeholder, + input[type="text"]:-ms-input-placeholder, + input[type="password"]:-ms-input-placeholder, + input[type="datetime"]:-ms-input-placeholder, + input[type="datetime-local"]:-ms-input-placeholder, + input[type="date"]:-ms-input-placeholder, + input[type="month"]:-ms-input-placeholder, + input[type="time"]:-ms-input-placeholder, + input[type="week"]:-ms-input-placeholder, + input[type="number"]:-ms-input-placeholder, + input[type="email"]:-ms-input-placeholder, + input[type="url"]:-ms-input-placeholder, + input[type="search"]:-ms-input-placeholder, + input[type="tel"]:-ms-input-placeholder, + input[type="color"]:-ms-input-placeholder + { + color: #777777; } + + select::-webkit-input-placeholder, + textarea::-webkit-input-placeholder, + input[type="text"]::-webkit-input-placeholder, + input[type="password"]::-webkit-input-placeholder, + input[type="datetime"]::-webkit-input-placeholder, + input[type="datetime-local"]::-webkit-input-placeholder, + input[type="date"]::-webkit-input-placeholder, + input[type="month"]::-webkit-input-placeholder, + input[type="time"]::-webkit-input-placeholder, + input[type="week"]::-webkit-input-placeholder, + input[type="number"]::-webkit-input-placeholder, + input[type="email"]::-webkit-input-placeholder, + input[type="url"]::-webkit-input-placeholder, + input[type="search"]::-webkit-input-placeholder, + input[type="tel"]::-webkit-input-placeholder, + input[type="color"]::-webkit-input-placeholder + { + color: #777777; } + + select[disabled], select[readonly], fieldset[disabled] select, + textarea[disabled], + textarea[readonly], fieldset[disabled] + textarea, + input[type="text"][disabled], + input[type="text"][readonly], fieldset[disabled] + input[type="text"], + input[type="password"][disabled], + input[type="password"][readonly], fieldset[disabled] + input[type="password"], + input[type="datetime"][disabled], + input[type="datetime"][readonly], fieldset[disabled] + input[type="datetime"], + input[type="datetime-local"][disabled], + input[type="datetime-local"][readonly], fieldset[disabled] + input[type="datetime-local"], + input[type="date"][disabled], + input[type="date"][readonly], fieldset[disabled] + input[type="date"], + input[type="month"][disabled], + input[type="month"][readonly], fieldset[disabled] + input[type="month"], + input[type="time"][disabled], + input[type="time"][readonly], fieldset[disabled] + input[type="time"], + input[type="week"][disabled], + input[type="week"][readonly], fieldset[disabled] + input[type="week"], + input[type="number"][disabled], + input[type="number"][readonly], fieldset[disabled] + input[type="number"], + input[type="email"][disabled], + input[type="email"][readonly], fieldset[disabled] + input[type="email"], + input[type="url"][disabled], + input[type="url"][readonly], fieldset[disabled] + input[type="url"], + input[type="search"][disabled], + input[type="search"][readonly], fieldset[disabled] + input[type="search"], + input[type="tel"][disabled], + input[type="tel"][readonly], fieldset[disabled] + input[type="tel"], + input[type="color"][disabled], + input[type="color"][readonly], fieldset[disabled] + input[type="color"] +{ + cursor: not-allowed; + background-color: #f0f0f0; + opacity: 1.0; + filter: alpha(opacity=100); + border-color: #a8a8a8; + color:#a8a8a8;} + + select[disabled]:hover, select[readonly]:hover, fieldset[disabled]:hover, + textarea[disabled]:hover, + textarea[readonly]:hover, fieldset[disabled]:hover + textarea:hover, + input[type="text"][disabled]:hover, + input[type="text"][readonly]:hover, fieldset[disabled]:hover + input[type="text"]:hover, + input[type="password"][disabled]:hover, + input[type="password"][readonly]:hover, fieldset[disabled]:hover + input[type="password"]:hover, + input[type="datetime"][disabled]:hover, + input[type="datetime"][readonly]:hover, fieldset[disabled]:hover + input[type="datetime"]:hover, + input[type="datetime-local"][disabled]:hover, + input[type="datetime-local"][readonly]:hover, fieldset[disabled]:hover + input[type="datetime-local"]:hover, + input[type="date"][disabled]:hover, + input[type="date"][readonly]:hover, fieldset[disabled]:hover + input[type="date"]:hover, + input[type="month"][disabled]:hover, + input[type="month"][readonly]:hover, fieldset[disabled]:hover + input[type="month"]:hover, + input[type="time"][disabled]:hover, + input[type="time"][readonly]:hover, fieldset[disabled]:hover + input[type="time"]:hover, + input[type="week"][disabled]:hover, + input[type="week"][readonly]:hover, fieldset[disabled]:hover + input[type="week"]:hover, + input[type="number"][disabled]:hover, + input[type="number"][readonly]:hover, fieldset[disabled]:hover + input[type="number"]:hover, + input[type="email"][disabled]:hover, + input[type="email"][readonly]:hover, fieldset[disabled]:hover + input[type="email"]:hover, + input[type="url"][disabled]:hover, + input[type="url"][readonly]:hover, fieldset[disabled]:hover + input[type="url"]:hover, + input[type="search"][disabled]:hover, + input[type="search"][readonly]:hover, fieldset[disabled]:hover + input[type="search"]:hover, + input[type="tel"][disabled]:hover, + input[type="tel"][readonly]:hover, fieldset[disabled]:hover + input[type="tel"]:hover, + input[type="color"][disabled]:hover, + input[type="color"][readonly]:hover, fieldset[disabled]:hover + input[type="color"]:hover + + { + cursor: not-allowed; + background-color: #f0f0f0; + color:#a8a8a8; + opacity: 1.0; + filter: alpha(opacity=100); + -webkit-box-shadow: none; + box-shadow: none; } -input { - &[type="text"], &[type="password"], &[type="datetime"], &[type="datetime-local"], &[type="date"], &[type="month"], &[type="time"], &[type="week"], &[type="number"], &[type="email"], &[type="url"], &[type="search"], &[type="tel"], &[type="color"] { - display: block; - width: 100%; - height: 34px; - padding: 6px 12px; - font-size: 14px; - line-height: 1.428571429; - color: #000; - background-color: #FFF; - background-image: none; - border: 1px solid #4d83a1; - border-radius: 3px; - text-overflow: ellipsis; - max-width: 348px; - -webkit-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s; - -o-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s; - transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s; - } -} +textarea { + height: auto; } -select:hover, textarea:hover { - color: #000; - background-color: none; - border-color: #00A7FF; - outline: 0; -} +input[type="search"] { + -webkit-appearance: none; } -input { - &[type="text"]:hover, &[type="password"]:hover, &[type="datetime"]:hover, &[type="datetime-local"]:hover, &[type="date"]:hover, &[type="month"]:hover, &[type="time"]:hover, &[type="week"]:hover, &[type="number"]:hover, &[type="email"]:hover, &[type="url"]:hover, &[type="search"]:hover, &[type="tel"]:hover, &[type="color"]:hover { - color: #000; - background-color: none; - border-color: #00A7FF; - outline: 0; - } -} +input[type="date"], +input[type="time"], +input[type="datetime-local"], +input[type="month"] { + line-height: 34px; + line-height: 1.42857 \0; } + input[type="date"].input-sm, .form-horizontal .form-group-sm input[type="date"].form-control, .input-group-sm > input[type="date"].form-control, + .input-group-sm > input[type="date"].input-group-addon, + .input-group-sm > .input-group-btn > input[type="date"].btn, + input[type="time"].input-sm, + .form-horizontal .form-group-sm input[type="time"].form-control, + .input-group-sm > input[type="time"].form-control, + .input-group-sm > input[type="time"].input-group-addon, + .input-group-sm > .input-group-btn > input[type="time"].btn, + input[type="datetime-local"].input-sm, + .form-horizontal .form-group-sm input[type="datetime-local"].form-control, + .input-group-sm > input[type="datetime-local"].form-control, + .input-group-sm > input[type="datetime-local"].input-group-addon, + .input-group-sm > .input-group-btn > input[type="datetime-local"].btn, + input[type="month"].input-sm, + .form-horizontal .form-group-sm input[type="month"].form-control, + .input-group-sm > input[type="month"].form-control, + .input-group-sm > input[type="month"].input-group-addon, + .input-group-sm > .input-group-btn > input[type="month"].btn { + line-height: 30px; } + input[type="date"].input-lg, .form-horizontal .form-group-lg input[type="date"].form-control, .input-group-lg > input[type="date"].form-control, + .input-group-lg > input[type="date"].input-group-addon, + .input-group-lg > .input-group-btn > input[type="date"].btn, + input[type="time"].input-lg, + .form-horizontal .form-group-lg input[type="time"].form-control, + .input-group-lg > input[type="time"].form-control, + .input-group-lg > input[type="time"].input-group-addon, + .input-group-lg > .input-group-btn > input[type="time"].btn, + input[type="datetime-local"].input-lg, + .form-horizontal .form-group-lg input[type="datetime-local"].form-control, + .input-group-lg > input[type="datetime-local"].form-control, + .input-group-lg > input[type="datetime-local"].input-group-addon, + .input-group-lg > .input-group-btn > input[type="datetime-local"].btn, + input[type="month"].input-lg, + .form-horizontal .form-group-lg input[type="month"].form-control, + .input-group-lg > input[type="month"].form-control, + .input-group-lg > input[type="month"].input-group-addon, + .input-group-lg > .input-group-btn > input[type="month"].btn { + line-height: 46px; } -select:focus, textarea:focus { - color: #000; - border-color: #00A7FF; - background-color: none; - outline: 0; -} +.form-group { + margin-bottom: 15px; } -input { - &[type="text"]:focus, &[type="password"]:focus, &[type="datetime"]:focus, &[type="datetime-local"]:focus, &[type="date"]:focus, &[type="month"]:focus, &[type="time"]:focus, &[type="week"]:focus, &[type="number"]:focus, &[type="email"]:focus, &[type="url"]:focus, &[type="search"]:focus, &[type="tel"]:focus, &[type="color"]:focus { - color: #000; - border-color: #00A7FF; - background-color: none; - outline: 0; - } -} - -select::-moz-placeholder, textarea::-moz-placeholder { - color: #b7b7b7; - opacity: 1; - filter: alpha(opacity = 100); -} - -input { - &[type="text"]::-moz-placeholder, &[type="password"]::-moz-placeholder, &[type="datetime"]::-moz-placeholder, &[type="datetime-local"]::-moz-placeholder, &[type="date"]::-moz-placeholder, &[type="month"]::-moz-placeholder, &[type="time"]::-moz-placeholder, &[type="week"]::-moz-placeholder, &[type="number"]::-moz-placeholder, &[type="email"]::-moz-placeholder, &[type="url"]::-moz-placeholder, &[type="search"]::-moz-placeholder, &[type="tel"]::-moz-placeholder, &[type="color"]::-moz-placeholder { - color: #b7b7b7; - opacity: 1; - filter: alpha(opacity = 100); - } -} - -select:-ms-input-placeholder, textarea:-ms-input-placeholder { - color: #777777; -} - -input { - &[type="text"]:-ms-input-placeholder, &[type="password"]:-ms-input-placeholder, &[type="datetime"]:-ms-input-placeholder, &[type="datetime-local"]:-ms-input-placeholder, &[type="date"]:-ms-input-placeholder, &[type="month"]:-ms-input-placeholder, &[type="time"]:-ms-input-placeholder, &[type="week"]:-ms-input-placeholder, &[type="number"]:-ms-input-placeholder, &[type="email"]:-ms-input-placeholder, &[type="url"]:-ms-input-placeholder, &[type="search"]:-ms-input-placeholder, &[type="tel"]:-ms-input-placeholder, &[type="color"]:-ms-input-placeholder { - color: #777777; - } -} - -select::-webkit-input-placeholder, textarea::-webkit-input-placeholder { - color: #777777; -} - -input { - &[type="text"]::-webkit-input-placeholder, &[type="password"]::-webkit-input-placeholder, &[type="datetime"]::-webkit-input-placeholder, &[type="datetime-local"]::-webkit-input-placeholder, &[type="date"]::-webkit-input-placeholder, &[type="month"]::-webkit-input-placeholder, &[type="time"]::-webkit-input-placeholder, &[type="week"]::-webkit-input-placeholder, &[type="number"]::-webkit-input-placeholder, &[type="email"]::-webkit-input-placeholder, &[type="url"]::-webkit-input-placeholder, &[type="search"]::-webkit-input-placeholder, &[type="tel"]::-webkit-input-placeholder, &[type="color"]::-webkit-input-placeholder { - color: #777777; - } -} - -select { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] select { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -textarea { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] textarea { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="text"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="text"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="password"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="password"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="datetime"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="datetime"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="datetime-local"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="datetime-local"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="date"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="date"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="month"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="month"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="time"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="time"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="week"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="week"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="number"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="number"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="email"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="email"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="url"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="url"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="search"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="search"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="tel"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="tel"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -input[type="color"] { - &[disabled], &[readonly] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; - } -} - -fieldset[disabled] input[type="color"] { - cursor: not-allowed; - background-color: #f0f0f0; - opacity: 1.0; - filter: alpha(opacity = 100); - border-color: #4d83a1; - color: #a8a8a8; -} - -select { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -textarea { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover textarea:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="text"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="text"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="password"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="password"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="datetime"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="datetime"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="datetime-local"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="datetime-local"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="date"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="date"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="month"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="month"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="time"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="time"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="week"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="week"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="number"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="number"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="email"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="email"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="url"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="url"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="search"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="search"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="tel"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="tel"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -input[type="color"] { - &[disabled]:hover, &[readonly]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled]:hover input[type="color"]:hover { - cursor: not-allowed; - background-color: #f0f0f0; - color: #a8a8a8; - opacity: 1.0; - filter: alpha(opacity = 100); - -webkit-box-shadow: none; - box-shadow: none; -} - -textarea { - height: auto; -} - -input { - &[type="search"] { - -webkit-appearance: none; - } - - &[type="date"], &[type="time"], &[type="datetime-local"], &[type="month"] { - line-height: 34px; - line-height: 1.42857 \0; - } - - &[type="date"].input-sm { - line-height: 30px; - } -} - -.form-horizontal .form-group-sm input[type="date"].form-control { - line-height: 30px; -} - -.input-group-sm > { - input[type="date"] { - &.form-control, &.input-group-addon { - line-height: 30px; - } - } - - .input-group-btn > input[type="date"].btn { - line-height: 30px; - } -} - -input[type="time"].input-sm, .form-horizontal .form-group-sm input[type="time"].form-control { - line-height: 30px; -} - -.input-group-sm > { - input[type="time"] { - &.form-control, &.input-group-addon { - line-height: 30px; - } - } - - .input-group-btn > input[type="time"].btn { - line-height: 30px; - } -} - -input[type="datetime-local"].input-sm, .form-horizontal .form-group-sm input[type="datetime-local"].form-control { - line-height: 30px; -} - -.input-group-sm > { - input[type="datetime-local"] { - &.form-control, &.input-group-addon { - line-height: 30px; - } - } - - .input-group-btn > input[type="datetime-local"].btn { - line-height: 30px; - } -} - -input[type="month"].input-sm, .form-horizontal .form-group-sm input[type="month"].form-control { - line-height: 30px; -} - -.input-group-sm > { - input[type="month"] { - &.form-control, &.input-group-addon { - line-height: 30px; - } - } - - .input-group-btn > input[type="month"].btn { - line-height: 30px; - } -} - -input[type="date"].input-lg, .form-horizontal .form-group-lg input[type="date"].form-control { - line-height: 46px; -} - -.input-group-lg > { - input[type="date"] { - &.form-control, &.input-group-addon { - line-height: 46px; - } - } - - .input-group-btn > input[type="date"].btn { - line-height: 46px; - } -} - -input[type="time"].input-lg, .form-horizontal .form-group-lg input[type="time"].form-control { - line-height: 46px; -} - -.input-group-lg > { - input[type="time"] { - &.form-control, &.input-group-addon { - line-height: 46px; - } - } - - .input-group-btn > input[type="time"].btn { - line-height: 46px; - } -} - -input[type="datetime-local"].input-lg, .form-horizontal .form-group-lg input[type="datetime-local"].form-control { - line-height: 46px; -} - -.input-group-lg > { - input[type="datetime-local"] { - &.form-control, &.input-group-addon { - line-height: 46px; - } - } - - .input-group-btn > input[type="datetime-local"].btn { - line-height: 46px; - } -} - -input[type="month"].input-lg, .form-horizontal .form-group-lg input[type="month"].form-control { - line-height: 46px; -} - -.input-group-lg > { - input[type="month"] { - &.form-control, &.input-group-addon { - line-height: 46px; - } - } - - .input-group-btn > input[type="month"].btn { - line-height: 46px; - } -} - -.form-group { - margin-bottom: 15px; -} - -.radio, .checkbox { +.radio, +.checkbox { position: relative; display: block; min-height: 20px; margin-top: 10px; - margin-bottom: 10px; -} - -.radio label, .checkbox label { - padding-left: 20px; - margin-bottom: 0; - font-weight: normal; - cursor: pointer; -} + margin-bottom: 10px; } + .radio label, + .checkbox label { + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; } -.radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { position: absolute; margin-left: -20px; - margin-top: 4px \9; -} + margin-top: 4px \9; } -.radio + .radio, .checkbox + .checkbox { - margin-top: -5px; -} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; } -.radio-inline, .checkbox-inline { +.radio-inline, +.checkbox-inline { display: inline-block; padding-left: 20px; margin-bottom: 0; vertical-align: middle; font-weight: normal; - cursor: pointer; -} + cursor: pointer; } -.radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { margin-top: 0; - margin-left: 10px; -} - -input[type="radio"] { - &[disabled], &.disabled { - cursor: not-allowed; - } -} - -fieldset[disabled] input[type="radio"] { - cursor: not-allowed; -} + margin-left: 10px; } +input[type="radio"][disabled], input[type="radio"].disabled, fieldset[disabled] input[type="radio"], +input[type="checkbox"][disabled], +input[type="checkbox"].disabled, fieldset[disabled] input[type="checkbox"] { - &[disabled], &.disabled { - cursor: not-allowed; - } -} + cursor: not-allowed; } -fieldset[disabled] input[type="checkbox"], .radio-inline.disabled, fieldset[disabled] .radio-inline, .checkbox-inline.disabled, fieldset[disabled] .checkbox-inline, .radio.disabled label, fieldset[disabled] .radio label, .checkbox.disabled label, fieldset[disabled] .checkbox label { - cursor: not-allowed; -} +.radio-inline.disabled, fieldset[disabled] .radio-inline, +.checkbox-inline.disabled, fieldset[disabled] +.checkbox-inline { + cursor: not-allowed; } + +.radio.disabled label, fieldset[disabled] .radio label, +.checkbox.disabled label, fieldset[disabled] +.checkbox label { + cursor: not-allowed; } .form-control-static { padding-top: 7px; padding-bottom: 7px; - margin-bottom: 0; - - &.input-lg { - padding-left: 0; - padding-right: 0; - } -} - -.form-horizontal .form-group-lg .form-control-static.form-control { - padding-left: 0; - padding-right: 0; -} - -.input-group-lg > { - .form-control-static { - &.form-control, &.input-group-addon { - padding-left: 0; - padding-right: 0; - } - } - - .input-group-btn > .form-control-static.btn { - padding-left: 0; - padding-right: 0; - } -} - -.form-control-static.input-sm, .form-horizontal .form-group-sm .form-control-static.form-control { - padding-left: 0; - padding-right: 0; -} - -.input-group-sm > { - .form-control-static { - &.form-control, &.input-group-addon { - padding-left: 0; - padding-right: 0; - } - } - - .input-group-btn > .form-control-static.btn { + margin-bottom: 0; } + .form-control-static.input-lg, .form-horizontal .form-group-lg .form-control-static.form-control, .input-group-lg > .form-control-static.form-control, + .input-group-lg > .form-control-static.input-group-addon, + .input-group-lg > .input-group-btn > .form-control-static.btn, .form-control-static.input-sm, .form-horizontal .form-group-sm .form-control-static.form-control, .input-group-sm > .form-control-static.form-control, + .input-group-sm > .form-control-static.input-group-addon, + .input-group-sm > .input-group-btn > .form-control-static.btn { padding-left: 0; - padding-right: 0; - } -} + padding-right: 0; } -.input-sm, .form-horizontal .form-group-sm .form-control { +.input-sm, .form-horizontal .form-group-sm .form-control, .input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; - border-radius: 3px; -} - -.input-group-sm > { - .form-control, .input-group-addon, .input-group-btn > .btn { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; - } -} + border-radius: 3px; } -select.input-sm, .form-horizontal .form-group-sm select.form-control { +select.input-sm, .form-horizontal .form-group-sm select.form-control, .input-group-sm > select.form-control, +.input-group-sm > select.input-group-addon, +.input-group-sm > .input-group-btn > select.btn { height: 30px; - line-height: 30px; -} - -.input-group-sm > { - select { - &.form-control, &.input-group-addon { - height: 30px; - line-height: 30px; - } - } - - .input-group-btn > select.btn { - height: 30px; - line-height: 30px; - } -} - -textarea.input-sm, .form-horizontal .form-group-sm textarea.form-control { - height: auto; -} - -.input-group-sm > { - textarea { - &.form-control, &.input-group-addon { - height: auto; - } - } - - .input-group-btn > textarea.btn { - height: auto; - } -} - -select[multiple].input-sm, .form-horizontal .form-group-sm select[multiple].form-control { - height: auto; -} - -.input-group-sm > { - select[multiple] { - &.form-control, &.input-group-addon { - height: auto; - } - } - - .input-group-btn > select[multiple].btn { - height: auto; - } -} - -.input-lg, .form-horizontal .form-group-lg .form-control { + line-height: 30px; } + +textarea.input-sm, .form-horizontal .form-group-sm textarea.form-control, .input-group-sm > textarea.form-control, +.input-group-sm > textarea.input-group-addon, +.input-group-sm > .input-group-btn > textarea.btn, +select[multiple].input-sm, +.form-horizontal .form-group-sm select[multiple].form-control, +.input-group-sm > select[multiple].form-control, +.input-group-sm > select[multiple].input-group-addon, +.input-group-sm > .input-group-btn > select[multiple].btn { + height: auto; } + +.input-lg, .form-horizontal .form-group-lg .form-control, .input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.33; - border-radius: 6px; -} - -.input-group-lg > { - .form-control, .input-group-addon, .input-group-btn > .btn { - height: 46px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.33; - border-radius: 6px; - } -} + border-radius: 6px; } -select.input-lg, .form-horizontal .form-group-lg select.form-control { +select.input-lg, .form-horizontal .form-group-lg select.form-control, .input-group-lg > select.form-control, +.input-group-lg > select.input-group-addon, +.input-group-lg > .input-group-btn > select.btn { height: 46px; - line-height: 46px; -} - -.input-group-lg > { - select { - &.form-control, &.input-group-addon { - height: 46px; - line-height: 46px; - } - } - - .input-group-btn > select.btn { - height: 46px; - line-height: 46px; - } -} - -textarea.input-lg, .form-horizontal .form-group-lg textarea.form-control { - height: auto; -} - -.input-group-lg > { - textarea { - &.form-control, &.input-group-addon { - height: auto; - } - } - - .input-group-btn > textarea.btn { - height: auto; - } -} - -select[multiple].input-lg, .form-horizontal .form-group-lg select[multiple].form-control { - height: auto; -} - -.input-group-lg > { - select[multiple] { - &.form-control, &.input-group-addon { - height: auto; - } - } - - .input-group-btn > select[multiple].btn { - height: auto; - } -} + line-height: 46px; } + +textarea.input-lg, .form-horizontal .form-group-lg textarea.form-control, .input-group-lg > textarea.form-control, +.input-group-lg > textarea.input-group-addon, +.input-group-lg > .input-group-btn > textarea.btn, +select[multiple].input-lg, +.form-horizontal .form-group-lg select[multiple].form-control, +.input-group-lg > select[multiple].form-control, +.input-group-lg > select[multiple].input-group-addon, +.input-group-lg > .input-group-btn > select[multiple].btn { + height: auto; } .has-feedback { - position: relative; - - .form-control { - padding-right: 42.5px; - } -} + position: relative; } + .has-feedback .form-control { + padding-right: 42.5px; } .form-control-feedback { position: absolute; @@ -4534,890 +2715,421 @@ select[multiple].input-lg, .form-horizontal .form-group-lg select[multiple].form width: 34px; height: 34px; line-height: 34px; - text-align: center; -} + text-align: center; } -.input-lg + .form-control-feedback, .form-horizontal .form-group-lg .form-control + .form-control-feedback { +.input-lg + .form-control-feedback, .form-horizontal .form-group-lg .form-control + .form-control-feedback, .input-group-lg > .form-control + .form-control-feedback, +.input-group-lg > .input-group-addon + .form-control-feedback, +.input-group-lg > .input-group-btn > .btn + .form-control-feedback { width: 46px; height: 46px; - line-height: 46px; -} - -.input-group-lg > { - .form-control + .form-control-feedback, .input-group-addon + .form-control-feedback, .input-group-btn > .btn + .form-control-feedback { - width: 46px; - height: 46px; - line-height: 46px; - } -} + line-height: 46px; } -.input-sm + .form-control-feedback, .form-horizontal .form-group-sm .form-control + .form-control-feedback { +.input-sm + .form-control-feedback, .form-horizontal .form-group-sm .form-control + .form-control-feedback, .input-group-sm > .form-control + .form-control-feedback, +.input-group-sm > .input-group-addon + .form-control-feedback, +.input-group-sm > .input-group-btn > .btn + .form-control-feedback { width: 30px; height: 30px; - line-height: 30px; -} - -.input-group-sm > { - .form-control + .form-control-feedback, .input-group-addon + .form-control-feedback, .input-group-btn > .btn + .form-control-feedback { - width: 30px; - height: 30px; - line-height: 30px; - } -} - -.has-success { - .help-block, .control-label, .radio, .checkbox, .radio-inline, .checkbox-inline { - color: #9BD275; - } - - .form-control { - border-color: #9BD275; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - - &:focus { - border-color: #7fc54f; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d3ebc2; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d3ebc2; - } - } - - .input-group-addon { - color: #9BD275; - border-color: #9BD275; - background-color: #9BD275; - } - - .form-control-feedback { - color: #9BD275; - } -} - -.has-warning { - .help-block, .control-label, .radio, .checkbox, .radio-inline, .checkbox-inline { - color: #f0ad4e; - } - - .form-control { - border-color: #f0ad4e; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - - &:focus { - border-color: #ec971f; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac; - } - } - - .input-group-addon { - color: #f0ad4e; - border-color: #f0ad4e; - background-color: #fcf8e3; - } - - .form-control-feedback { - color: #f0ad4e; - } -} - -.has-error { - .help-block, .control-label, .radio, .checkbox, .radio-inline, .checkbox-inline { - color: #FC3803; - } - - .form-control { - border-color: #FC3803; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - - &:focus { - border-color: #FC2E03; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8aeae; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8aeae; - } - } - - .input-group-addon { - color: #F05050; - border-color: #F05050; - background-color: #F05050; - } - - .form-control-feedback { - color: #F05050; - } -} + line-height: 30px; } + +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline { + color: #9BD275; } +.has-success .form-control { + border-color: #9BD275; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } + .has-success .form-control:focus { + border-color: #7fc54f; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d3ebc2; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d3ebc2; } + +.has-success .input-group-addon { + color: #9BD275; + border-color: #9BD275; + background-color: #9BD275; } +.has-success .form-control-feedback { + color: #9BD275; } + +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline { + color: #f0ad4e; } +.has-warning .form-control { + border-color: #f0ad4e; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } + .has-warning .form-control:focus { + border-color: #ec971f; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8d9ac; } +.has-warning .input-group-addon { + color: #f0ad4e; + border-color: #f0ad4e; + background-color: #fcf8e3; } +.has-warning .form-control-feedback { + color: #f0ad4e; } + +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline { + color: #FC3803; } +.has-error .form-control { + border-color: #FC3803; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } + .has-error .form-control:focus { + border-color: #FC2E03; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8aeae; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f8aeae; } + +.has-error .input-group-addon { + color: #F05050; + border-color: #F05050; + background-color: #F05050; } +.has-error .form-control-feedback { + color: #F05050; } .has-feedback label.sr-only ~ .form-control-feedback { - top: 0; -} + top: 0; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; - color: #7c7c7a; -} + color: #7c7c7a; } @media (min-width: 768px) { .form-inline .form-group, .navbar-form .form-group { display: inline-block; margin-bottom: 0; - vertical-align: middle; - } - + vertical-align: middle; } .form-inline .form-control, .navbar-form .form-control { display: inline-block; width: auto; - vertical-align: middle; - } - + vertical-align: middle; } .form-inline .input-group, .navbar-form .input-group { display: inline-table; - vertical-align: middle; - } - - .form-inline .input-group .input-group-addon, .navbar-form .input-group .input-group-addon, .form-inline .input-group .input-group-btn, .navbar-form .input-group .input-group-btn, .form-inline .input-group .form-control, .navbar-form .input-group .form-control { - width: auto; - } - + vertical-align: middle; } + .form-inline .input-group .input-group-addon, .navbar-form .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .navbar-form .input-group .input-group-btn, + .form-inline .input-group .form-control, + .navbar-form .input-group .form-control { + width: auto; } .form-inline .input-group > .form-control, .navbar-form .input-group > .form-control { - width: 100%; - } - + width: 100%; } .form-inline .control-label, .navbar-form .control-label { margin-bottom: 0; - vertical-align: middle; - } - - .form-inline .radio, .navbar-form .radio, .form-inline .checkbox, .navbar-form .checkbox { + vertical-align: middle; } + .form-inline .radio, .navbar-form .radio, + .form-inline .checkbox, + .navbar-form .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; - vertical-align: middle; - } - - .form-inline .radio label, .navbar-form .radio label, .form-inline .checkbox label, .navbar-form .checkbox label { - padding-left: 0; - } - - .form-inline .radio input[type="radio"], .navbar-form .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"], .navbar-form .checkbox input[type="checkbox"] { + vertical-align: middle; } + .form-inline .radio label, .navbar-form .radio label, + .form-inline .checkbox label, + .navbar-form .checkbox label { + padding-left: 0; } + .form-inline .radio input[type="radio"], .navbar-form .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"], + .navbar-form .checkbox input[type="checkbox"] { position: relative; - margin-left: 0; - } - + margin-left: 0; } .form-inline .has-feedback .form-control-feedback, .navbar-form .has-feedback .form-control-feedback { - top: 0; - } -} - -.form-horizontal { - .radio, .checkbox, .radio-inline, .checkbox-inline { - margin-top: 0; - margin-bottom: 0; - padding-top: 7px; - } - - .radio, .checkbox { - min-height: 27px; - } - - .form-group { - margin-left: -20px; - margin-right: -20px; - - &:before { - content: " "; - display: table; - } - - &:after { - content: " "; - display: table; - clear: both; - } - } - - .has-feedback control-feedback { - top: 0; - right: 20px; - } -} + top: 0; } } +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 7px; } +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; } +.form-horizontal .form-group { + margin-left: -20px; + margin-right: -20px; } + .form-horizontal .form-group:before, .form-horizontal .form-group:after { + content: " "; + display: table; } + .form-horizontal .form-group:after { + clear: both; } @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; margin-bottom: 0; - padding-top: 7px; - } -} - + padding-top: 7px; } } +.form-horizontal .has-feedback control-feedback { + top: 0; + right: 20px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { - padding-top: 14.3px; - } -} - + padding-top: 14.3px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { - padding-top: 6px; - } -} + padding-top: 6px; } } .btn { display: inline-block; margin-bottom: 0; - font-weight: normal; - text-align: center; - vertical-align: middle; - cursor: pointer; - background-image: none; - white-space: nowrap; - padding: 6px 12px; - font-size: 14px; - line-height: 1.428571429; - border-radius: 3px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - color: #FFFFFF; - background-color: #457995; - border: 1px solid #1b4257; - outline: 0; - - &:active, &.active { - color: #FFF; - background-color: #30596f; - outline: 0; - border-color: #1d1d1d; - text-decoration: none; - } -} - -.open > .btn.dropdown-toggle { - color: #FFF; - background-color: #30596f; - outline: 0; - border-color: #1d1d1d; - text-decoration: none; -} - -.btn { - &:hover, &:focus { - background-color: #315a71; - color: #FFF; - border-radius: 3px; - border: 1px solid #1b4257; - text-decoration: none; - } - - &:active, &.active { - background-image: none; - outline: 0; - } -} - -.open > .btn.dropdown-toggle { - background-image: none; - outline: 0; -} - -.btn { - &.disabled { - background-color: #FFFFFF; - border-color: #1d1d1d; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #FFFFFF; - border-color: #1d1d1d; - outline: 0; - } - } - - &[disabled] { - background-color: #FFFFFF; - border-color: #1d1d1d; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #FFFFFF; - border-color: #1d1d1d; - outline: 0; - } - } -} - -fieldset[disabled] .btn { - background-color: #FFFFFF; + font-weight: normal; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-image: none; + white-space: nowrap; + padding: 6px 12px; + font-size:14px; + line-height: 1.428571429; + border-radius: 3px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: #000; + background-color: none; + border: 1px solid #1b4257; + outline:0; } +.btn:active, .btn.active, .open > .btn.dropdown-toggle { + color: #000; + background-color: none; + outline:0; border-color: #1d1d1d; - outline: 0; - - &:hover, &:focus, &:active, &.active { + text-decoration: none; } +.btn:hover, .btn:focus { + background-color: #dbdbdb; + color: #000; + border-radius: 3px; + border: 1px solid #1b4257; + text-decoration: none;} + + .btn:active, .btn.active, .open > .btn.dropdown-toggle { + background-image: none; + outline:0; } + .btn.disabled, .btn.disabled:hover, .btn.disabled:focus, .btn.disabled:active, .btn.disabled.active, .btn[disabled], .btn[disabled]:hover, .btn[disabled]:focus, .btn[disabled]:active, .btn[disabled].active, fieldset[disabled] .btn, fieldset[disabled] .btn:hover, fieldset[disabled] .btn:focus, fieldset[disabled] .btn:active, fieldset[disabled] .btn.active { background-color: #FFFFFF; border-color: #1d1d1d; - outline: 0; - } -} + outline:0; } -.btn { - .badge { + .btn .badge { color: #FFFFFF; - background-color: #3e3e3e; - } - - &:focus, &:active:focus, &.active:focus { + background-color: #3e3e3e; } + .btn:focus, .btn:active:focus, .btn.active:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; - outline: 0; - } - - &:active, &.active { - outline: 0; - } + outline:0; } - &.disabled, &[disabled] { + .btn:active, .btn.active { + outline: 0; } + .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; pointer-events: none; opacity: 0.30; - filter: alpha(opacity = 30); + filter: alpha(opacity=30); -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled] .btn { - cursor: not-allowed; - pointer-events: none; - opacity: 0.30; - filter: alpha(opacity = 30); - -webkit-box-shadow: none; - box-shadow: none; -} - -.act_flush { - &:hover, &:focus { - color: #FFF; - background-color: #336480; - border-color: 1px solid #1d1d1d; - outline: 0; - } -} - -.btn-default { - &:active, &.active { - background-image: none; - outline: 0; - } -} - -.open > .btn-default.dropdown-toggle { - background-image: none; - outline: 0; -} - -.btn-default { - &.disabled { - background-color: #FFFFFF; - border-color: 1px solid #1d1d1d; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #FFFFFF; - border-color: 1px solid #1d1d1d; - outline: 0; - } - } - - &[disabled] { - background-color: #FFFFFF; - border-color: 1px solid #1d1d1d; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #FFFFFF; - border-color: 1px solid #1d1d1d; - outline: 0; - } - } -} + box-shadow: none; } -fieldset[disabled] .btn-default { - background-color: #FFFFFF; +.act_flush:hover, .act_flush:focus { + color: #000; + background-color: #dbdbdb; border-color: 1px solid #1d1d1d; - outline: 0; + outline:0; } - &:hover, &:focus, &:active, &.active { + .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle { + background-color: #dbdbdb; + color:#000; + outline:0; } + .btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled]:active, .btn-default[disabled].active, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active { background-color: #FFFFFF; border-color: 1px solid #1d1d1d; - outline: 0; - } -} - -.btn-default .badge { - color: #FFFFFF; - background-color: #3e3e3e; - outline: 0; -} + outline:0; } + .btn-default .badge { + color: #FFFFFF; + background-color: #3e3e3e; + outline:0; } .btn-primary { color: #fff !important; - background-color: #FF7E25; - border: 1px solid #6c6c6c; - outline: 0; - - &:hover, &:focus, &:active, &.active { + background-color: #FF6E05; + border: 1px solid #1b4257; + outline:0; } + .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle { color: #fff; background-color: #EC7726; - border-color: 1px solid #6c6c6c; - outline: 0; - } -} - -.open > .btn-primary.dropdown-toggle { - color: #fff; - background-color: #EC7726; - border-color: 1px solid #6c6c6c; - outline: 0; -} - -.btn-primary { - &:active, &.active { - background-image: none; - } -} + border-color: 1px solid #1b4257; + outline:0; } -.open > .btn-primary.dropdown-toggle { - background-image: none; -} - -.btn-primary { - &.disabled { - background-color: #FF7E25; - border-color: #6c6c6c; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #FF7E25; - border-color: #6c6c6c; - outline: 0; - } - } - - &[disabled] { - background-color: #FF7E25; - border-color: #6c6c6c; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #FF7E25; - border-color: #6c6c6c; - outline: 0; - } - } -} - -fieldset[disabled] .btn-primary { - background-color: #FF7E25; - border-color: #6c6c6c; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #FF7E25; - border-color: #6c6c6c; - outline: 0; - } -} + .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle { + background-image: none; } + .btn-primary.disabled, .btn-primary.disabled:hover, .btn-primary.disabled:focus, .btn-primary.disabled:active, .btn-primary.disabled.active, .btn-primary[disabled], .btn-primary[disabled]:hover, .btn-primary[disabled]:focus, .btn-primary[disabled]:active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-primary:hover, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary:active, fieldset[disabled] .btn-primary.active { + background-color: #FF6E05; + border-color: #1b4257; + outline:0; } -.btn-primary .badge { - color: #FF8B00; - background-color: #fff; -} + .btn-primary .badge { + color: #FF8B00; + background-color: #fff; } .btn-success { color: #fff; background-color: #85ce53; - border-color: #323232; - - &:hover, &:focus, &:active, &.active { + border-color: #323232; } + .btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle { color: #fff; background-color: #7fc54f; border-color: #323232; - outline: 0; - } -} - -.open > .btn-success.dropdown-toggle { - color: #fff; - background-color: #7fc54f; - border-color: #323232; - outline: 0; -} - -.btn-success { - &:active, &.active { - background-image: none; - } -} - -.open > .btn-success.dropdown-toggle { - background-image: none; -} - -.btn-success { - &.disabled { - background-color: #9BD275; - border-color: #8dcc62; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #9BD275; - border-color: #8dcc62; - outline: 0; - } - } - - &[disabled] { - background-color: #9BD275; - border-color: #8dcc62; - outline: 0; - - &:hover, &:focus, &:active, &.active { - background-color: #9BD275; - border-color: #8dcc62; - outline: 0; - } - } -} - -fieldset[disabled] .btn-success { - background-color: #9BD275; - border-color: #8dcc62; - outline: 0; - - &:hover, &:focus, &:active, &.active { + outline:0; } + .btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle { + background-image: none; } + .btn-success.disabled, .btn-success.disabled:hover, .btn-success.disabled:focus, .btn-success.disabled:active, .btn-success.disabled.active, .btn-success[disabled], .btn-success[disabled]:hover, .btn-success[disabled]:focus, .btn-success[disabled]:active, .btn-success[disabled].active, fieldset[disabled] .btn-success, fieldset[disabled] .btn-success:hover, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success:active, fieldset[disabled] .btn-success.active { background-color: #9BD275; border-color: #8dcc62; - outline: 0; - } -} + outline:0; } -.btn-success .badge { - color: #9BD275; - background-color: #fff; -} + .btn-success .badge { + color: #9BD275; + background-color: #fff; } .btn-info { color: #fff; background-color: #B0CDDB; - border-color: #9ec2d3; - - &:hover, &:focus, &:active, &.active { + border-color: #9ec2d3; } + .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open > .btn-info.dropdown-toggle { color: #fff; background-color: #8db7cb; - border-color: #74a7c0; - } -} - -.open > .btn-info.dropdown-toggle { - color: #fff; - background-color: #8db7cb; - border-color: #74a7c0; -} - -.btn-info { - &:active, &.active { - background-image: none; - } -} + border-color: #74a7c0; } -.open > .btn-info.dropdown-toggle { - background-image: none; -} - -.btn-info { - &.disabled { - background-color: #B0CDDB; - border-color: #9ec2d3; - - &:hover, &:focus, &:active, &.active { - background-color: #B0CDDB; - border-color: #9ec2d3; - } - } - - &[disabled] { - background-color: #B0CDDB; - border-color: #9ec2d3; - - &:hover, &:focus, &:active, &.active { - background-color: #B0CDDB; - border-color: #9ec2d3; - } - } -} - -fieldset[disabled] .btn-info { - background-color: #B0CDDB; - border-color: #9ec2d3; - - &:hover, &:focus, &:active, &.active { + .btn-info:active, .btn-info.active, .open > .btn-info.dropdown-toggle { + background-image: none; } + .btn-info.disabled, .btn-info.disabled:hover, .btn-info.disabled:focus, .btn-info.disabled:active, .btn-info.disabled.active, .btn-info[disabled], .btn-info[disabled]:hover, .btn-info[disabled]:focus, .btn-info[disabled]:active, .btn-info[disabled].active, fieldset[disabled] .btn-info, fieldset[disabled] .btn-info:hover, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info:active, fieldset[disabled] .btn-info.active { background-color: #B0CDDB; - border-color: #9ec2d3; - } -} + border-color: #9ec2d3; } -.btn-info .badge { - color: #B0CDDB; - background-color: #fff; -} + .btn-info .badge { + color: #B0CDDB; + background-color: #fff; } .btn-warning { color: #fff; - background-color: #FF7E25; - border-color: #1b4257; - - &:hover, &:focus, &:active, &.active { + background-color: #FF6E05; + border-color: #1b4257; } + .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle { color: #fff; background-color: #EC7726; - border-color: #1b4257; - } -} - -.open > .btn-warning.dropdown-toggle { - color: #fff; - background-color: #EC7726; - border-color: #1b4257; -} - -.btn-warning { - &:active, &.active { - background-image: none; - } -} - -.open > .btn-warning.dropdown-toggle { - background-image: none; -} - -.btn-warning { - &.disabled { - background-color: #f0ad4e; - border-color: #eea236; + border-color: #1b4257; } - &:hover, &:focus, &:active, &.active { - background-color: #f0ad4e; - border-color: #eea236; - } - } - - &[disabled] { - background-color: #f0ad4e; - border-color: #eea236; - - &:hover, &:focus, &:active, &.active { - background-color: #f0ad4e; - border-color: #eea236; - } - } -} - -fieldset[disabled] .btn-warning { - background-color: #f0ad4e; - border-color: #eea236; - - &:hover, &:focus, &:active, &.active { + .btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle { + background-image: none; } + .btn-warning.disabled, .btn-warning.disabled:hover, .btn-warning.disabled:focus, .btn-warning.disabled:active, .btn-warning.disabled.active, .btn-warning[disabled], .btn-warning[disabled]:hover, .btn-warning[disabled]:focus, .btn-warning[disabled]:active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-warning:hover, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning:active, fieldset[disabled] .btn-warning.active { background-color: #f0ad4e; - border-color: #eea236; - } -} + border-color: #eea236; } -.btn-warning .badge { - color: #f0ad4e; - background-color: #fff; -} + .btn-warning .badge { + color: #f0ad4e; + background-color: #fff; } .btn-danger { color: #fff; background-color: #CB4326; - border-color: #1B4257; - - &:hover, &:focus, &:active, &.active { + border-color: #1B4257; } + .btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open > .btn-danger.dropdown-toggle { color: #fff; background-color: #B63B21; - border-color: #1B4257; - } -} - -.open > .btn-danger.dropdown-toggle { - color: #fff; - background-color: #B63B21; - border-color: #1B4257; -} - -.btn-danger { - &:active, &.active { - background-image: none; - } -} - -.open > .btn-danger.dropdown-toggle { - background-image: none; -} - -.btn-danger { - &.disabled { - background-color: #F05050; - border-color: #ee3939; - - &:hover, &:focus, &:active, &.active { - background-color: #F05050; - border-color: #ee3939; - } - } - - &[disabled] { - background-color: #F05050; - border-color: #ee3939; - - &:hover, &:focus, &:active, &.active { - background-color: #F05050; - border-color: #ee3939; - } - } -} - -fieldset[disabled] .btn-danger { - background-color: #F05050; - border-color: #ee3939; - - &:hover, &:focus, &:active, &.active { + border-color: #1B4257; } + .btn-danger:active, .btn-danger.active, .open > .btn-danger.dropdown-toggle { + background-image: none; } + .btn-danger.disabled, .btn-danger.disabled:hover, .btn-danger.disabled:focus, .btn-danger.disabled:active, .btn-danger.disabled.active, .btn-danger[disabled], .btn-danger[disabled]:hover, .btn-danger[disabled]:focus, .btn-danger[disabled]:active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger, fieldset[disabled] .btn-danger:hover, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger:active, fieldset[disabled] .btn-danger.active { background-color: #F05050; - border-color: #ee3939; - } -} - -.btn-danger .badge { - color: #F05050; - background-color: #fff; -} + border-color: #ee3939; } + .btn-danger .badge { + color: #F05050; + background-color: #fff; } .btn-link { color: #FF8B00; font-weight: normal; cursor: pointer; - border-radius: 0; - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; - - &:active, &[disabled] { + border-radius: 0; } + .btn-link, .btn-link:active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; -webkit-box-shadow: none; - box-shadow: none; - } -} - -fieldset[disabled] .btn-link { - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; -} - -.btn-link { - border-color: transparent; - - &:hover, &:focus, &:active { - border-color: transparent; - } - - &:hover, &:focus { + box-shadow: none; } + .btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { + border-color: transparent; } + .btn-link:hover, .btn-link:focus { color: #9f4d03; text-decoration: underline; - background-color: transparent; - } - - &[disabled] { - &:hover, &:focus { - color: #777777; - text-decoration: none; - } - } -} + background-color: transparent; } -fieldset[disabled] .btn-link { - &:hover, &:focus { + .btn-link[disabled]:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:hover, fieldset[disabled] .btn-link:focus { color: #777777; - text-decoration: none; - } -} + text-decoration: none; } + .btn-lg, .btn-group-lg > .btn { padding: 9px 12px; font-size: 18px; - line-height: 1.33; -} + line-height: 1.33; } .btn-sm, .btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; - border-radius: 3px; -} + border-radius: 3px; } .btn-xs, .btn-group-xs > .btn { padding: 1px 4px; font-size: 12px; line-height: 1.5; - border-radius: 3px; -} + border-radius: 3px; } .btn-block { display: block; - width: 100%; + width: 100%; } - + .btn-block { - margin-top: 5px; - } -} +.btn-block + .btn-block { + margin-top: 5px; } -input { - &[type="submit"].btn-block, &[type="reset"].btn-block, &[type="button"].btn-block { - width: 100%; - } -} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; } .fade { opacity: 0; - filter: alpha(opacity = 0); + filter: alpha(opacity=0); -webkit-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; - transition: opacity 0.15s linear; + transition: opacity 0.15s linear; } + .fade.in { + opacity: 1; filter: alpha(opacity=100); } - &.in { - opacity: 1; - filter: alpha(opacity = 100); - } -} .collapse { - display: none; - - &.in { - display: block; - } -} + display: none; } + .collapse.in { + display: block; } tr.collapse.in { - display: table-row; -} + display: table-row; } tbody.collapse.in { - display: table-row-group; -} + display: table-row-group; } .collapsing { position: relative; @@ -5425,8 +3137,7 @@ tbody.collapse.in { overflow: hidden; -webkit-transition: height 0.35s ease; -o-transition: height 0.35s ease; - transition: height 0.35s ease; -} + transition: height 0.35s ease; } .caret { display: inline-block; @@ -5436,16 +3147,14 @@ tbody.collapse.in { vertical-align: middle; border-top: 4px solid; border-right: 4px solid transparent; - border-left: 4px solid transparent; -} + border-left: 4px solid transparent; } .dropdown { - position: relative; -} + position: relative; } + .dropdown-toggle:focus { - outline: 0; -} + outline: 0; } .dropdown-menu { position: absolute; @@ -5458,10 +3167,10 @@ tbody.collapse.in { padding: 5px 0; margin: 2px 0 0; list-style: none; - font-size: 14px; + font-size:14px; text-align: left; - background-color: #315a71; - color: #fff; + background-color: #f0f0f0; + color: #000; border-left: 1px solid #1b4257; border-right: 1px solid #1b4257; border-bottom: 1px solid #1b4257; @@ -5469,93 +3178,65 @@ tbody.collapse.in { -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); background-clip: padding-box; - -webkit-box-shadow: 3px 8px 10px 0px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 3px 8px 10px 0px rgba(0, 0, 0, 0.6); - box-shadow: 3px 8px 10px 0px rgba(0, 0, 0, 0.6); - opacity: 0.97; + -webkit-box-shadow: 3px 8px 10px 0px rgba(0, 0, 0, 0.60); + -moz-box-shadow: 3px 8px 10px 0px rgba(0, 0, 0, 0.60); + box-shadow: 3px 8px 10px 0px rgba(0, 0, 0, 0.60); + opacity: 0.97; } - &.pull-right { + .dropdown-menu.pull-right { right: 0; left: auto; - background-color: #e5e5e5; - } + background-color: #e5e5e5; } - .divider { + .dropdown-menu .divider { height: 1px; margin: 9px 0; overflow: hidden; - background-color: #e5e5e5; - } - - > { - li > a { - display: block; - padding: 3px 20px; - clear: both; - font-weight: normal; - line-height: 1.428571429; - color: #fff; - white-space: nowrap; - outline: 0; - - &:hover, &:focus { - text-decoration: none; - color: #FFFFFF; - background-color: #FF7E25; - } - } - - .active > a { - color: #fff; - text-decoration: none; - outline: 0; - background-color: #FF7E25; + background-color: #e5e5e5; } + .dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.428571429; + color: #000; + white-space: nowrap; + outline:0;} - &:hover, &:focus { - color: #fff; - text-decoration: none; - outline: 0; - background-color: #FF7E25; - } - } +.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { + text-decoration: none; + color: #FFFFFF; + background-color: #FF6E05; } - .disabled > a { - color: #777777; +.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { + color: #fff; + text-decoration: none; + outline: 0; + background-color: #FF6E05; } - &:hover, &:focus { - color: #777777; - } +.dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { + color: #777777; } - &:hover, &:focus { - text-decoration: none; - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); - cursor: not-allowed; - } - } - } -} +.dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; } -.open > { - .dropdown-menu { - display: block; - } - a { - outline: 0; - } -} +.open > .dropdown-menu { + display: block; } +.open > a { + outline: 0; } .dropdown-menu-right { left: auto; - right: 0; -} + right: 0; } .dropdown-menu-left { left: 0; - right: auto; -} + right: auto; } .dropdown-header { display: block; @@ -5563,8 +3244,7 @@ tbody.collapse.in { font-size: 12px; line-height: 1.428571429; color: #b0b0b0; - white-space: nowrap; -} + white-space: nowrap; } .dropdown-backdrop { position: fixed; @@ -5572,805 +3252,467 @@ tbody.collapse.in { right: 0; bottom: 0; top: 0; - z-index: 990; -} + z-index: 990; } .pull-right > .dropdown-menu { right: 0; - left: auto; -} + left: auto; } -.dropup .caret, .navbar-fixed-bottom .dropdown .caret { +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px solid; - content: ""; -} - -.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { + content: ""; } +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; - margin-bottom: 1px; -} + margin-bottom: 1px; } @media (min-width: 768px) { - .navbar-right { - .dropdown-menu { - right: 0; - left: auto; - } - - .dropdown-menu-left { - left: 0; - right: auto; - } - } -} - -.btn-group, .btn-group-vertical { + .navbar-right .dropdown-menu { + right: 0; + left: auto; } + .navbar-right .dropdown-menu-left { + left: 0; + right: auto; } } +.btn-group, +.btn-group-vertical { position: relative; display: inline-block; - vertical-align: middle; -} - -.btn-group > .btn, .btn-group-vertical > .btn { - position: relative; - float: left; -} - -.btn-group > .btn { - &:hover, &:focus, &:active, &.active { - z-index: 2; - -webkit-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; - -o-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; - transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; - } -} - -.btn-group-vertical > .btn { - &:hover, &:focus, &:active, &.active { - z-index: 2; - -webkit-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; - -o-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; - transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; - } -} - -.btn-group > .btn:focus, .btn-group-vertical > .btn:focus { - outline: 0; -} - -.btn-group { - .btn + { - .btn, .btn-group { - margin-left: -1px; - } - } - - .btn-group + { - .btn, .btn-group { - margin-left: -1px; - } - } -} + vertical-align: middle; } + .btn-group > .btn, + .btn-group-vertical > .btn { + position: relative; + float: left; } + .btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, + .btn-group-vertical > .btn:hover, + .btn-group-vertical > .btn:focus, + .btn-group-vertical > .btn:active, + .btn-group-vertical > .btn.active { + z-index: 2; + -webkit-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; + -o-transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; + transition: border-color ease-in-out 0.1s, box-shadow ease-in-out 0.1s !important; } + .btn-group > .btn:focus, + .btn-group-vertical > .btn:focus { + outline: 0; } + +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; } .btn-toolbar { - margin-left: -5px; - - &:before { + margin-left: -5px; } + .btn-toolbar:before, .btn-toolbar:after { content: " "; - display: table; - } + display: table; } + .btn-toolbar:after { + clear: both; } + .btn-toolbar .btn-group, + .btn-toolbar .input-group { + float: left; } + .btn-toolbar > .btn, + .btn-toolbar > .btn-group, + .btn-toolbar > .input-group { + margin-left: 5px; } + +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; } + +.btn-group > .btn:first-child { + margin-left: 0; } + .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; } + +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; } - &:after { - content: " "; - display: table; - clear: both; - } +.btn-group > .btn-group { + float: left; } - .btn-group, .input-group { - float: left; - } +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; } - > { - .btn, .btn-group, .input-group { - margin-left: 5px; - } - } -} +.btn-group > .btn-group:first-child > .btn:last-child, +.btn-group > .btn-group:first-child > .dropdown-toggle { + border-bottom-right-radius: 0; + border-top-right-radius: 0; } -.btn-group { - > { - .btn { - &:not(:first-child):not(:last-child):not(.dropdown-toggle) { - border-radius: 0; - } - - &:first-child { - margin-left: 0; - - &:not(:last-child):not(.dropdown-toggle) { - border-bottom-right-radius: 0; - border-top-right-radius: 0; - } - } - - &:last-child:not(:first-child) { - border-bottom-left-radius: 0; - border-top-left-radius: 0; - } - } - - .dropdown-toggle:not(:first-child) { - border-bottom-left-radius: 0; - border-top-left-radius: 0; - } - - .btn-group { - float: left; +.btn-group > .btn-group:last-child > .btn:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; } - &:not(:first-child):not(:last-child) > .btn { - border-radius: 0; - } - - &:first-child > { - .btn:last-child, .dropdown-toggle { - border-bottom-right-radius: 0; - border-top-right-radius: 0; - } - } - - &:last-child > .btn:first-child { - border-bottom-left-radius: 0; - border-top-left-radius: 0; - } - } - } - - .dropdown-toggle { - &:active, &:hover { - outline: 0; - color: #FFFFFF; - background-color: none; - border-color: #000; - } - } +.btn-group .dropdown-toggle:active, .btn-group .dropdown-toggle:hover, .btn-group.open .dropdown-toggle { + outline: 0; + color: #000; + background-color: none; + border-color: #000; } - &.open .dropdown-toggle { - outline: 0; - color: #FFFFFF; - background-color: none; - border-color: #000; - } - - > { - .btn + .dropdown-toggle { - padding-left: 8px; - padding-right: 8px; - } - - .btn-lg + .dropdown-toggle { - padding-left: 12px; - padding-right: 12px; - } - } -} +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; } -.btn-group-lg.btn-group > .btn + .dropdown-toggle { +.btn-group > .btn-lg + .dropdown-toggle, .btn-group-lg.btn-group > .btn + .dropdown-toggle { padding-left: 12px; - padding-right: 12px; -} + padding-right: 12px; } -.btn-group.open .dropdown-toggle.btn-link { - -webkit-box-shadow: none; - box-shadow: none; -} +.btn-group.open .dropdown-toggle {} + .btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; } .btn .caret { - margin-left: 0; -} + margin-left: 0; } .btn-lg .caret, .btn-group-lg > .btn .caret { border-width: 5px 5px 0; - border-bottom-width: 0; -} - -.dropup { - .btn-lg .caret, .btn-group-lg > .btn .caret { - border-width: 0 5px 5px; - } -} - -.btn-group-vertical > { - .btn { - display: block; - float: none; - width: 100%; - max-width: 100%; - } - - .btn-group { - display: block; - float: none; - width: 100%; - max-width: 100%; - - > .btn { - display: block; - float: none; - width: 100%; - max-width: 100%; - } - - &:before { - content: " "; - display: table; - } - - &:after { - content: " "; - display: table; - clear: both; - } + border-bottom-width: 0; } - > .btn { - float: none; - } - } +.dropup .btn-lg .caret, .dropup .btn-group-lg > .btn .caret { + border-width: 0 5px 5px; } - .btn + { - .btn, .btn-group { - margin-top: -1px; - margin-left: 0; - } - } +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; } +.btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after { + content: " "; + display: table; } +.btn-group-vertical > .btn-group:after { + clear: both; } +.btn-group-vertical > .btn-group > .btn { + float: none; } +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; } - .btn-group + { - .btn, .btn-group { - margin-top: -1px; - margin-left: 0; - } - } +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; } +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 3px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; } +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-bottom-left-radius: 3px; + border-top-right-radius: 0; + border-top-left-radius: 0; } - .btn { - &:not(:first-child):not(:last-child) { - border-radius: 0; - } +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; } - &:first-child:not(:last-child) { - border-top-right-radius: 3px; - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - } +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; } - &:last-child:not(:first-child) { - border-bottom-left-radius: 3px; - border-top-right-radius: 0; - border-top-left-radius: 0; - } - } - - .btn-group { - &:not(:first-child):not(:last-child) > .btn { - border-radius: 0; - } - - &:first-child:not(:last-child) > { - .btn:last-child, .dropdown-toggle { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - } - } - - &:last-child:not(:first-child) > .btn:first-child { - border-top-right-radius: 0; - border-top-left-radius: 0; - } - } -} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; - border-collapse: separate; - - > { - .btn { - float: none; - display: table-cell; - width: 1%; - } - - .btn-group { - float: none; - display: table-cell; - width: 1%; - - .btn { - width: 100%; - } - - .dropdown-menu { - left: auto; - } - } - } -} - -[data-toggle="buttons"] > .btn > input { - &[type="radio"], &[type="checkbox"] { - position: absolute; - z-index: -1; - opacity: 0; - filter: alpha(opacity = 0); - } -} + border-collapse: separate; } + .btn-group-justified > .btn, + .btn-group-justified > .btn-group { + float: none; + display: table-cell; + width: 1%; } + .btn-group-justified > .btn-group .btn { + width: 100%; } + .btn-group-justified > .btn-group .dropdown-menu { + left: auto; } + +[data-toggle="buttons"] > .btn > input[type="radio"], +[data-toggle="buttons"] > .btn > input[type="checkbox"] { + position: absolute; + z-index: -1; + opacity: 0; + filter: alpha(opacity=0); } .input-group { position: relative; display: table; - border-collapse: separate; - - &[class*="col-"] { + border-collapse: separate; } + .input-group[class*="col-"] { float: none; padding-left: 0; - padding-right: 0; - } - - .form-control { + padding-right: 0; } + .input-group .form-control { position: relative; z-index: 2; float: left; width: 100%; - margin-bottom: 0; - } -} - -.input-group-addon, .input-group-btn, .input-group .form-control { - display: table-cell; -} - -.input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { - border-radius: 0; -} - -.input-group-addon, .input-group-btn { + margin-bottom: 0; } + +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; } + .input-group-addon:not(:first-child):not(:last-child), + .input-group-btn:not(:first-child):not(:last-child), + .input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; } + +.input-group-addon, +.input-group-btn { width: 1%; white-space: nowrap; - vertical-align: middle; -} + vertical-align: middle; } .input-group-addon { padding: 6px 12px; - font-size: 14px; + font-size:14px; font-weight: normal; line-height: 1; color: #FFF; text-align: center; background-color: #eeeeee; border: 1px solid #ccc; - border-radius: 3px; - - &.input-sm { - padding: 5px 10px; - font-size: 12px; - border-radius: 3px; - } -} - -.form-horizontal .form-group-sm .input-group-addon.form-control { - padding: 5px 10px; - font-size: 12px; - border-radius: 3px; -} - -.input-group-sm > { - .input-group-addon, .input-group-btn > .input-group-addon.btn { + border-radius: 3px; } + .input-group-addon.input-sm, .form-horizontal .form-group-sm .input-group-addon.form-control, + .input-group-sm > .input-group-addon, + .input-group-sm > .input-group-btn > .input-group-addon.btn { padding: 5px 10px; font-size: 12px; - border-radius: 3px; - } -} - -.input-group-addon.input-lg, .form-horizontal .form-group-lg .input-group-addon.form-control { - padding: 10px 16px; - font-size: 18px; - border-radius: 6px; -} - -.input-group-lg > { - .input-group-addon, .input-group-btn > .input-group-addon.btn { + border-radius: 3px; } + .input-group-addon.input-lg, .form-horizontal .form-group-lg .input-group-addon.form-control, + .input-group-lg > .input-group-addon, + .input-group-lg > .input-group-btn > .input-group-addon.btn { padding: 10px 16px; font-size: 18px; - border-radius: 6px; - } -} - -.input-group-addon input { - &[type="radio"], &[type="checkbox"] { - margin-top: 0; - } -} - -.input-group .form-control:first-child, .input-group-addon:first-child { + border-radius: 6px; } + .input-group-addon input[type="radio"], + .input-group-addon input[type="checkbox"] { + margin-top: 0; } + +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { border-bottom-right-radius: 0; - border-top-right-radius: 0; -} - -.input-group-btn { - &:first-child > { - .btn, .btn-group > .btn, .dropdown-toggle { - border-bottom-right-radius: 0; - border-top-right-radius: 0; - } - } - - &:last-child > { - .btn:not(:last-child):not(.dropdown-toggle), .btn-group:not(:last-child) > .btn { - border-bottom-right-radius: 0; - border-top-right-radius: 0; - } - } -} + border-top-right-radius: 0; } .input-group-addon:first-child { - border-right: 0; -} - -.input-group .form-control:last-child, .input-group-addon:last-child { + border-right: 0; } + +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { border-bottom-left-radius: 0; - border-top-left-radius: 0; -} - -.input-group-btn { - &:last-child > { - .btn, .btn-group > .btn, .dropdown-toggle { - border-bottom-left-radius: 0; - border-top-left-radius: 0; - } - } - - &:first-child > { - .btn:not(:first-child), .btn-group:not(:first-child) > .btn { - border-bottom-left-radius: 0; - border-top-left-radius: 0; - } - } -} + border-top-left-radius: 0; } .input-group-addon:last-child { - border-left: 0; -} + border-left: 0; } .input-group-btn { position: relative; font-size: 0; - white-space: nowrap; - - > .btn { - position: relative; - - + .btn { - margin-left: -1px; - } - - &:hover, &:focus, &:active { - z-index: 2; - } - } - - &:first-child > { - .btn, .btn-group { - margin-right: -1px; - } - } - - &:last-child > { - .btn, .btn-group { - margin-left: -1px; - } - } -} + white-space: nowrap; } + .input-group-btn > .btn { + position: relative; } + .input-group-btn > .btn + .btn { + margin-left: -1px; } + .input-group-btn > .btn:hover, .input-group-btn > .btn:focus, .input-group-btn > .btn:active { + z-index: 2; } + .input-group-btn:first-child > .btn, + .input-group-btn:first-child > .btn-group { + margin-right: -1px; } + .input-group-btn:last-child > .btn, + .input-group-btn:last-child > .btn-group { + margin-left: -1px; } .nav { margin-bottom: 0; padding-left: 0; - list-style: none; - - &:before { - content: " "; - display: table; - } - - &:after { + list-style: none; } + .nav:before, .nav:after { content: " "; - display: table; - clear: both; - } - - > li { - position: relative; - display: block; - - > a { - position: relative; - display: block; - padding: 10px 15px; - color: #FFF; - border-radius: 0px; - border-top-right-radius: 10px; - margin-right: 0px; - background-color: #315a71; - opacity: 0.6; - filter: alpha(opacity = 50); - } - } -} - -.nav-tabs > li > a { - position: relative; - display: block; - padding: 10px 15px; - color: #FFF; - border-radius: 0px; - border-top-right-radius: 10px; - margin-right: 0px; - background-color: #315a71; - opacity: 0.6; - filter: alpha(opacity = 50); -} - -.nav > li { - &#menu_messages { - > a { - position: relative; - display: block; - padding: none; - color: #FF7E25; - background-color: transparent; - margin-right: 10px; - border: none; - opacity: 1.0; - } - - > a:hover { - text-decoration: underline; - } - } - - > a { - &:hover, &:focus { - text-decoration: none; - background-color: #315a71; - color: #FFF; - opacity: 0.8; - } - } -} - -a:focus { - text-decoration: underline; -} - -.nav { - > li.disabled > a { - color: #fff; - - &:hover, &:focus { - color: #fff; - text-decoration: none; - background-color: #839caa; - opacity: 0.9; - cursor: not-allowed; - } - } - - .open > a { - background-color: #336480; - cursor: pointer; - - &:hover, &:focus { - background-color: #336480; - cursor: pointer; - } - } - - .nav-divider { + display: table; } + .nav:after { + clear: both; } + .nav > li { + position: relative; + display: block; } + .nav > li > a, .nav-tabs > li > a { + position: relative; + display: block; + padding: 10px 15px; + color: #FFF; + border-radius: 0px; + border-top-right-radius: 10px; + margin-right: 0px; + background-color: #172c38; + opacity: 0.6; + filter: alpha(opacity=50);} + .nav > li#menu_messages > a { + position: relative; + display: block; + padding: none; + color:#FF6E05; + background-color:transparent; + margin-right: 10px; + border:none; + opacity: 1.0;} + .nav > li > a:hover, .nav > li > a:focus { + text-decoration: none; + background-color: #172c38; + color: #FFF; + opacity: 0.8; } + .nav > li#menu_messages > a:hover, a:focus { + text-decoration: underline; } + + .nav > li.disabled > a { + color: #fff; } + .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { + color: #fff; + text-decoration: none; + background-color: #839caa; + opacity:0.9; + cursor: not-allowed; } + + .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { + background-color: #172c38; + cursor:pointer; } + + .nav .nav-divider { height: 1px; margin: 9px 0; overflow: hidden; - background-color: #e5e5e5; - } - - > li > a > img { - max-width: none; - } -} + background-color: #e5e5e5; } + .nav > li > a > img { + max-width: none; } .nav-tabs { - margin-right: 1px; - - > li { - float: left; - - > a { + margin-right: 1px; } + .nav-tabs > li { + float: left; } + .nav-tabs > li > a { line-height: 1.428571429; - border: none; - cursor: pointer; - - &:hover { - opacity: 0.8; - filter: alpha(opacity = 80); - } - } - - &.active > a { + border:none; + cursor:pointer;} + .nav-tabs > li > a:hover {opacity: 0.8; filter: alpha(opacity=80);} + .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #FFF; background-color: #393939; border-bottom-color: transparent; cursor: pointer; - opacity: 1; - filter: alpha(opacity = 100); - - &:hover, &:focus { - color: #FFF; - background-color: #393939; - border-bottom-color: transparent; - cursor: pointer; - opacity: 1; - filter: alpha(opacity = 100); - } - } - } -} - -.nav-pills > li { - float: left; - - > a { - border-radius: 0; - } - - &.active > a { + opacity: 1; + filter: alpha(opacity=100);} + + .nav-pills > li { + float: left; } + .nav-pills > li > a { + border-radius: 0; } + .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #fff; background-color: #1b4257; - opacity: 1.0; - - &:hover, &:focus { - color: #fff; - background-color: #1b4257; - opacity: 1.0; - } - } -} + opacity: 1.0; } .nav-stacked > li { - float: none; - - + li { + float: none; } + .nav-stacked > li + li { margin-top: 2px; - margin-left: 0; - } -} + margin-left: 0; } .nav-justified, .nav-tabs.nav-justified { - width: 100%; -} - -.nav-justified > li, .nav-tabs.nav-justified > li { - float: none; -} - -.nav-justified > li > a, .nav-tabs.nav-justified > li > a { - text-align: left; - margin-bottom: 5px; -} - -.nav-justified > .dropdown .dropdown-menu { - top: auto; - left: auto; -} - -@media (min-width: 768px) { + width: 100%; } .nav-justified > li, .nav-tabs.nav-justified > li { - display: table-cell; - width: 1%; - } - - .nav-justified > li > a, .nav-tabs.nav-justified > li > a { - margin-bottom: 0; - } -} + float: none; } + .nav-justified > li > a, .nav-tabs.nav-justified > li > a { + text-align: left; + margin-bottom: 5px; } + .nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; } + @media (min-width: 768px) { + .nav-justified > li, .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; } + .nav-justified > li > a, .nav-tabs.nav-justified > li > a { + margin-bottom: 0; } } .nav-tabs-justified, .nav-tabs.nav-justified { - border-bottom: 0; -} - -.nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a { - margin-right: 0; - border-radius: 3px; -} - -.nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:focus { - border: 1px solid #656565; -} - -@media (min-width: 768px) { + border-bottom: 0; } .nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a { - border-bottom: 1px solid #656565; - border-radius: 3px 3px 0 0; - } - - .nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:focus { - border-bottom-color: transparent; - } -} - -.tab-content > { - .tab-pane { - display: none; - } - - .active { - display: block; - } -} + margin-right: 0; + border-radius: 3px; } + .nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus, + .nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #656565; } + @media (min-width: 768px) { + .nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #656565; + border-radius: 3px 3px 0 0; } + .nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: transparent; } } + +.tab-content > .tab-pane { + display: none; } + .tab-content > .active { + display: block; } .tab-pane .content-box { - border: none !important; + border:none !important; box-shadow: none; - -webkit-box-shadow: none; -} + -webkit-box-shadow: none; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-right-radius: 0; border-top-left-radius: 0; - cursor: pointer; -} + cursor:pointer;} + .navbar { position: relative; min-height: 50px; margin-bottom: 0; - border: 1px solid transparent; - - &:before { - content: " "; - display: table; - } - - &:after { - content: " "; - display: table; - clear: both; - } -} - -@media (min-width: 768px) { - .navbar { - border-radius: 0; - } -} - -.navbar-header { - &:before { - content: " "; - display: table; - } - - &:after { + border: 1px solid transparent; } + .navbar:before, .navbar:after { content: " "; - display: table; - clear: both; - } -} - + display: table; } + .navbar:after { + clear: both; } + @media (min-width: 768px) { + .navbar { + border-radius: 0; } } + +.navbar-header:before, .navbar-header:after { + content: " "; + display: table; } +.navbar-header:after { + clear: both; } @media (min-width: 768px) { .navbar-header { - float: left; - } -} + float: left; } } .navbar-collapse { overflow-x: visible; @@ -6378,143 +3720,92 @@ a:focus { padding-left: 20px; border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); - -webkit-overflow-scrolling: touch; - - &:before { + -webkit-overflow-scrolling: touch; } + .navbar-collapse:before, .navbar-collapse:after { content: " "; - display: table; - } - - &:after { - content: " "; - display: table; - clear: both; - } - - &.in { - overflow-y: auto; - } -} - -@media (min-width: 768px) { - .navbar-collapse { - width: auto; - border-top: 0; - box-shadow: none; - - &.collapse { - display: block !important; - height: auto !important; - padding-bottom: 0; - overflow: visible !important; - } - - &.in { - overflow-y: visible; - } - } - - .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { - padding-left: 0; - padding-right: 0; - } -} - -.navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { - max-height: 340px; -} - -@media (max-width: 480px) and (orientation: landscape) { - .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { - max-height: 200px; - } -} - -.container > { - .navbar-header, .navbar-collapse { - margin-right: -20px; - margin-left: -20px; - } -} - -.container-fluid > { - .navbar-header, .navbar-collapse { - margin-right: -20px; - margin-left: -20px; - } -} - -@media (min-width: 768px) { - .container > { - .navbar-header, .navbar-collapse { - margin-right: 0; - margin-left: 0; - } - } - - .container-fluid > { - .navbar-header, .navbar-collapse { + display: table; } + .navbar-collapse:after { + clear: both; } + .navbar-collapse.in { + overflow-y: auto; } + @media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + box-shadow: none; } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; } + .navbar-collapse.in { + overflow-y: visible; } + .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { + padding-left: 0; + padding-right: 0; } } + +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; } + @media (max-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; } } + +.container > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-header, +.container-fluid > .navbar-collapse { + margin-right: -20px; + margin-left: -20px; } + @media (min-width: 768px) { + .container > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-header, + .container-fluid > .navbar-collapse { margin-right: 0; - margin-left: 0; - } - } -} + margin-left: 0; } } .navbar-static-top { z-index: 1000; - border-width: 0 0 1px; -} - -@media (min-width: 768px) { - .navbar-static-top { - border-radius: 0; - } -} + border-width: 0 0 1px; } + @media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; } } -.navbar-fixed-top, .navbar-fixed-bottom { +.navbar-fixed-top, +.navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} - -@media (min-width: 768px) { - .navbar-fixed-top, .navbar-fixed-bottom { - border-radius: 0; - } -} + transform: translate3d(0, 0, 0); } + @media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; } } .navbar-fixed-top { top: 0; - border-width: 0 0 1px; -} + border-width: 0 0 1px; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; - border-width: 1px 0 0; -} + border-width: 1px 0 0; } .navbar-brand { float: left; padding: 15px 20px; font-size: 18px; - height: 50px; - - &:hover, &:focus { - text-decoration: none; - } -} + height: 50px; } + .navbar-brand:hover, .navbar-brand:focus { + text-decoration: none; } -@media (min-width: 768px) { - .navbar > { - .container .navbar-brand, .container-fluid .navbar-brand { - margin-left: -20px; - } - } -} + @media (min-width: 768px) { + .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { + margin-left: -20px; } } .navbar-toggle { position: relative; @@ -6526,94 +3817,60 @@ a:focus { background-color: transparent; background-image: none; border: 1px solid transparent; - border-radius: 3px; - - &:focus { - outline: 0; - } - - .icon-bar { + border-radius: 3px; } + .navbar-toggle:focus { + outline: 0; } + .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; - border-radius: 1px; - - + .icon-bar { - margin-top: 4px; - } - } -} - -@media (min-width: 768px) { - .navbar-toggle { - display: none; - } -} + border-radius: 1px; } + .navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; } + @media (min-width: 768px) { + .navbar-toggle { + display: none; } } .navbar-nav { - margin: 7.5px -20px; - - > li > a { + margin: 7.5px -20px; } + .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; - line-height: 20px; - } -} - -@media (max-width: 767px) { - .navbar-nav .open .dropdown-menu { - position: static; - float: none; - width: auto; - margin-top: 0; - background-color: transparent; - border: 0; - box-shadow: none; - - > li > a, .dropdown-header { - padding: 5px 15px 5px 25px; - } - - > li > a { - line-height: 20px; - - &:hover, &:focus { - background-image: none; - } - } - } -} - -@media (min-width: 768px) { - .navbar-nav { - float: left; - margin: 0; - - > li { + line-height: 20px; } + @media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + box-shadow: none; } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; } + .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; } } + @media (min-width: 768px) { + .navbar-nav { float: left; - - > a { - padding-top: 15px; - padding-bottom: 15px; - } - } - - &.navbar-right:last-child { - margin-right: -20px; - } - } -} + margin: 0; } + .navbar-nav > li { + float: left; } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; } + .navbar-nav.navbar-right:last-child { + margin-right: -20px; } } @media (min-width: 768px) { .navbar-left { - float: left !important; - } + float: left !important; } .navbar-right { - float: right !important; - } -} - + float: right !important; } } .navbar-form { margin-left: -20px; margin-right: -20px; @@ -6623,613 +3880,306 @@ a:focus { -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); margin-top: 8px; - margin-bottom: 8px; -} - -@media (max-width: 767px) { - .navbar-form .form-group { - margin-bottom: 5px; - } -} - -@media (min-width: 768px) { - .navbar-form { - width: auto; - border: 0; - margin-left: 0; - margin-right: 0; - padding-top: 0; - padding-bottom: 0; - -webkit-box-shadow: none; - box-shadow: none; - - &.navbar-right:last-child { - margin-right: -20px; - } - } -} + margin-bottom: 8px; } + @media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; } } + @media (min-width: 768px) { + .navbar-form { + width: auto; + border: 0; + margin-left: 0; + margin-right: 0; + padding-top: 0; + padding-bottom: 0; + -webkit-box-shadow: none; + box-shadow: none; } + .navbar-form.navbar-right:last-child { + margin-right: -20px; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; - border-top-right-radius: 0; - border-top-left-radius: 0; -} - -.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; -} - -.navbar-btn { - margin-top: 8px; - margin-bottom: 8px; - - &.btn-sm { - margin-top: 10px; - margin-bottom: 10px; - } -} - -.btn-group-sm > .navbar-btn.btn { - margin-top: 10px; - margin-bottom: 10px; -} - -.navbar-btn.btn-xs, .btn-group-xs > .navbar-btn.btn { - margin-top: 14px; - margin-bottom: 14px; -} - -.navbar-text { - margin-top: 15px; - margin-bottom: 15px; -} - -@media (min-width: 768px) { - .navbar-text { - float: left; - margin-left: 20px; - margin-right: 20px; - - &.navbar-right:last-child { - margin-right: 0; - } - } -} - -.navbar-default { - background-color: transparent; - border-color: none; - - .navbar-brand { - color: #F7F7F7; - - &:hover, &:focus { - color: #dedede; - background-color: transparent; - } - } - - .navbar-text { - color: #F7F7F7; - } - - .navbar-nav > { - li > a { - color: #F7F7F7; - - &:hover, &:focus { - color: #FF7E25; - background-color: transparent; - } - } - - .active > a { - color: #555; - background-color: #2b2b2b; - - &:hover, &:focus { - color: #555; - background-color: #2b2b2b; - } - } - - .disabled > a { - color: #ccc; - background-color: transparent; - - &:hover, &:focus { - color: #ccc; - background-color: transparent; - } - } - } - - .navbar-toggle { - border-color: #FFF; - - &:hover, &:focus { - background-color: #555; - } - - .icon-bar { - background-color: #FFF; - } - } - - .navbar-nav > .open > a { - background-color: #2b2b2b; - color: #555; - - &:hover, &:focus { - background-color: #2b2b2b; - color: #555; - } - } - - .navbar-link { - color: #F7F7F7; - - &:hover { - color: #FF8B00; - } - } - - .btn-link { - color: #F7F7F7; - - &:hover, &:focus { - color: #FF8B00; - } - - &[disabled] { - &:hover, &:focus { - color: #ccc; - } - } - } -} - -@media (max-width: 767px) { - .navbar-default .navbar-nav .open .dropdown-menu > { - li > a { - color: #F7F7F7; - - &:hover, &:focus { - color: #FF8B00; - background-color: transparent; - } - } - - .active > a { - color: #555; - background-color: #2b2b2b; + border-top-right-radius: 0; + border-top-left-radius: 0; } - &:hover, &:focus { - color: #555; - background-color: #2b2b2b; - } - } +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; } - .disabled > a { - color: #ccc; - background-color: transparent; +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; } + .navbar-btn.btn-sm, .btn-group-sm > .navbar-btn.btn { + margin-top: 10px; + margin-bottom: 10px; } + .navbar-btn.btn-xs, .btn-group-xs > .navbar-btn.btn { + margin-top: 14px; + margin-bottom: 14px; } - &:hover, &:focus { - color: #ccc; - background-color: transparent; - } - } - } -} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; } + @media (min-width: 768px) { + .navbar-text { + float: left; + margin-left: 20px; + margin-right: 20px; } + .navbar-text.navbar-right:last-child { + margin-right: 0; } } -fieldset[disabled] .navbar-default .btn-link { - &:hover, &:focus { +.navbar-default { + background-color: transparent; + border-color: none; } + .navbar-default .navbar-brand { + color: #F7F7F7; } + .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { + color: #dedede; + background-color: transparent; } + .navbar-default .navbar-text { + color: #F7F7F7; } + .navbar-default .navbar-nav > li > a { + color: #F7F7F7; } + .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { + color: #FF6E05; + background-color: transparent; } + + .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { + color: #555; + background-color: #2b2b2b; } + .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #ccc; - } -} + background-color: transparent; } + .navbar-default .navbar-toggle { + border-color: #FFF; } + .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { + background-color: #555; } + .navbar-default .navbar-toggle .icon-bar { + background-color: #FFF; } + .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { + background-color: #2b2b2b; + color: #555; } + @media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #F7F7F7; } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #FF8B00; + background-color: transparent; } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555; + background-color: #2b2b2b; } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #ccc; + background-color: transparent; } } + .navbar-default .navbar-link { + color: #F7F7F7; } + .navbar-default .navbar-link:hover { + color: #FF8B00; } + .navbar-default .btn-link { + color: #F7F7F7; } + .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { + color: #FF8B00; } + .navbar-default .btn-link[disabled]:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:hover, fieldset[disabled] .navbar-default .btn-link:focus { + color: #ccc; } .navbar-inverse { background-color: #222; - border-color: #090909; - - .navbar-brand { - color: #777777; - - &:hover, &:focus { + border-color: #090909; } + .navbar-inverse .navbar-brand { + color: #777777; } + .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #fff; - background-color: transparent; - } - } - - .navbar-text { - color: #777777; - } - - .navbar-nav > { - li > a { - color: #777777; + background-color: transparent; } - &:hover, &:focus { - color: #fff; - background-color: transparent; - } - } - - .active > a { + .navbar-inverse .navbar-text { + color: #777777; } + .navbar-inverse .navbar-nav > li > a { + color: #777777; } + .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #fff; - background-color: #090909; - - &:hover, &:focus { - color: #fff; - background-color: #090909; - } - } - - .disabled > a { - color: #3e3e3e; - background-color: transparent; - - &:hover, &:focus { - color: #3e3e3e; - background-color: transparent; - } - } - } - - .navbar-toggle { - border-color: #2d2d2d; - - &:hover, &:focus { - background-color: #2d2d2d; - } - - .icon-bar { - background-color: #fff; - } - } - - .navbar-collapse, .navbar-form { - border-color: #101010; - } - - .navbar-nav > .open > a { - background-color: #090909; + background-color: transparent; } + .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #fff; + background-color: #090909; } + .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { + color: #3e3e3e; + background-color: transparent; } + .navbar-inverse .navbar-toggle { + border-color: #2d2d2d; } + .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { + background-color: #2d2d2d; } + + .navbar-inverse .navbar-toggle .icon-bar { + background-color: #fff; } + .navbar-inverse .navbar-collapse, + .navbar-inverse .navbar-form { + border-color: #101010; } + .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { + background-color: #090909; + color: #fff; } + @media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #090909; } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #090909; } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #777777; } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #fff; + background-color: transparent; } - &:hover, &:focus { - background-color: #090909; - color: #fff; - } - } - - .navbar-link { - color: #777777; - - &:hover { + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #fff; - } - } - - .btn-link { - color: #777777; + background-color: #090909; } - &:hover, &:focus { - color: #fff; - } - - &[disabled] { - &:hover, &:focus { - color: #3e3e3e; - } - } - } -} + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #3e3e3e; + background-color: transparent; } } -@media (max-width: 767px) { - .navbar-inverse .navbar-nav .open .dropdown-menu { - > .dropdown-header { - border-color: #090909; - } - - .divider { - background-color: #090909; - } - - > { - li > a { - color: #777777; - - &:hover, &:focus { - color: #fff; - background-color: transparent; - } - } - - .active > a { - color: #fff; - background-color: #090909; - - &:hover, &:focus { - color: #fff; - background-color: #090909; - } - } - - .disabled > a { - color: #3e3e3e; - background-color: transparent; - - &:hover, &:focus { - color: #3e3e3e; - background-color: transparent; - } - } - } - } -} + .navbar-inverse .navbar-link { + color: #777777; } + .navbar-inverse .navbar-link:hover { + color: #fff; } + .navbar-inverse .btn-link { + color: #777777; } + .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { + color: #fff; } -fieldset[disabled] .navbar-inverse .btn-link { - &:hover, &:focus { - color: #3e3e3e; - } -} + .navbar-inverse .btn-link[disabled]:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:hover, fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #3e3e3e; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; - border-radius: 3px; - - > { - li { - display: inline-block; - - + li:before { - content: "/ "; - padding: 0 5px; - color: #ccc; - } - } - - .active { - color: #777777; - } - } -} + border-radius: 3px; } + .breadcrumb > li { + display: inline-block; } + .breadcrumb > li + li:before { + content: "/ "; + padding: 0 5px; + color: #ccc; } + .breadcrumb > .active { + color: #777777; } .pagination { display: inline-block; padding-left: 0; margin: 20px 0; - border-radius: 3px; - - > { - li { - display: inline; - - > { - a, span { - position: relative; - float: left; - padding: 6px 12px; - line-height: 1.428571429; - text-decoration: none; - color: #FFFFFF; - background-color: #427795; - border: 1px solid rgba(23, 44, 56, 0.4); - margin-left: -1px; - cursor: pointer; - } - } - - &:first-child > { - a, span { - margin-left: 0; - border-bottom-left-radius: 3px; - border-top-left-radius: 3px; - } - } - - &:last-child > { - a, span { - border-bottom-right-radius: 3px; - border-top-right-radius: 3px; - } - } - - > { - a { - &:hover, &:focus { - color: #FFFFFF; - background-color: #FF7E25; - } - } - - span { - &:hover, &:focus { - color: #FFFFFF; - background-color: #FF7E25; - } - } - } - } - - .active > { - a { - z-index: 2; - color: #FFFFFF; - background-color: #FF7E25; - cursor: default; - - &:hover, &:focus { - z-index: 2; - color: #FFFFFF; - background-color: #FF7E25; - cursor: default; - } - } - - span { - z-index: 2; - color: #FFFFFF; - background-color: #FF7E25; - cursor: default; - - &:hover, &:focus { - z-index: 2; - color: #FFFFFF; - background-color: #FF7E25; - cursor: default; - } - } - } - - .disabled > { - span { - color: #000; - background-color: #e3e3e3; - cursor: not-allowed; - - &:hover, &:focus { - color: #000; - background-color: #e3e3e3; - cursor: not-allowed; - } - } - - a { - color: #000; - background-color: #e3e3e3; - cursor: not-allowed; - - &:hover, &:focus { - color: #000; - background-color: #e3e3e3; - cursor: not-allowed; - } - } - } - } -} - -.pagination-lg > li { - > { - a, span { - padding: 10px 16px; - font-size: 18px; - } - } - - &:first-child > { - a, span { - border-bottom-left-radius: 6px; - border-top-left-radius: 6px; - } - } - - &:last-child > { - a, span { - border-bottom-right-radius: 6px; - border-top-right-radius: 6px; - } - } -} + border-radius: 3px; } + .pagination > li { + display: inline; } + .pagination > li > a, + .pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + line-height: 1.428571429; + text-decoration: none; + color: #FFF; + background-color: #45565f; + border: 1px solid rgba(23, 44, 56, 0.4); + margin-left: -1px; + cursor: pointer; } + .pagination > li:first-child > a, + .pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; } + .pagination > li:last-child > a, + .pagination > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; } + .pagination > li > a:hover, .pagination > li > a:focus, + .pagination > li > span:hover, + .pagination > li > span:focus { + color: #FFFFFF; + background-color: #FF6E05; } -.pagination-sm > li { - > { - a, span { - padding: 5px 10px; - font-size: 12px; - } - } + .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, + .pagination > .active > span, + .pagination > .active > span:hover, + .pagination > .active > span:focus { + z-index: 2; + color: #FFFFFF; + background-color: #FF6E05; + cursor: default; } + + .pagination > .disabled > span, + .pagination > .disabled > span:hover, + .pagination > .disabled > span:focus, + .pagination > .disabled > a, + .pagination > .disabled > a:hover, + .pagination > .disabled > a:focus { + color: #000; + background-color: #e3e3e3; + cursor: not-allowed; } - &:first-child > { - a, span { - border-bottom-left-radius: 3px; - border-top-left-radius: 3px; - } - } - &:last-child > { - a, span { - border-bottom-right-radius: 3px; - border-top-right-radius: 3px; - } - } -} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; } +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; } +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; } + +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; } +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; } +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; } .pager { padding-left: 0; margin: 20px 0; list-style: none; - text-align: center; - - &:before { - content: " "; - display: table; - } - - &:after { + text-align: center; } + .pager:before, .pager:after { content: " "; - display: table; - clear: both; - } - - li { - display: inline; - - > { - a, span { - display: inline-block; - padding: 5px 14px; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 15px; - } - - a { - &:hover, &:focus { - text-decoration: none; - background-color: #eeeeee; - } - } - } - } - - .next > { - a, span { - float: right; - } - } - - .previous > { - a, span { - float: left; - } - } - - .disabled > { - a { - color: #777777; + display: table; } + .pager:after { + clear: both; } + .pager li { + display: inline; } + .pager li > a, + .pager li > span { + display: inline-block; + padding: 5px 14px; background-color: #fff; - cursor: not-allowed; - - &:hover, &:focus { - color: #777777; - background-color: #fff; - cursor: not-allowed; - } - } + border: 1px solid #ddd; + border-radius: 15px; } + .pager li > a:hover, + .pager li > a:focus { + text-decoration: none; + background-color: #eeeeee; } + + .pager .next > a, + .pager .next > span { + float: right; } + .pager .previous > a, + .pager .previous > span { + float: left; } + .pager .disabled > a, + .pager .disabled > a:hover, + .pager .disabled > a:focus, + .pager .disabled > span { + color: #777777; + background-color: #fff; + cursor: not-allowed; } - span { - color: #777777; - background-color: #fff; - cursor: not-allowed; - } - } -} .label { display: inline; @@ -7241,91 +4191,60 @@ fieldset[disabled] .navbar-inverse .btn-link { text-align: center; white-space: nowrap; vertical-align: baseline; - border-radius: .25em; - - &:empty { - display: none; - } -} + border-radius: .25em; } + .label:empty { + display: none; } + .btn .label { + position: relative; + top: -1px; } -.btn .label { - position: relative; - top: -1px; -} +a.label:hover, a.label:focus { + color: #fff; + text-decoration: none; + cursor: pointer; } -a.label { - &:hover, &:focus { - color: #fff; - text-decoration: none; - cursor: pointer; - } -} .label-default { - background-color: #777777; - - &[href] { - &:hover, &:focus { - background-color: #5e5e5e; - border-color: #323232; - } - } -} + background-color: #777777; } + .label-default[href]:hover, .label-default[href]:focus { + background-color: #5e5e5e; + border-color: #323232;} + .label-primary { - background-color: #FF8B00; + background-color: #FF8B00; } + .label-primary[href]:hover, .label-primary[href]:focus { + background-color: #b85904; } - &[href] { - &:hover, &:focus { - background-color: #b85904; - } - } -} .label-success { - background-color: #4FB654; - border-color: #323232; - - &[href] { - &:hover, &:focus { - background-color: #7fc54f; - border-color: #323232; - } - } -} + background-color: #397E37; + border-color: #323232;} + .label-success[href]:hover, .label-success[href]:focus { + background-color: #7fc54f; + border-color: #323232; } + .label-info { - background-color: #B0CDDB; + background-color: #B0CDDB; } + .label-info[href]:hover, .label-info[href]:focus { + background-color: #8db7cb; + border-color: #323232; } - &[href] { - &:hover, &:focus { - background-color: #8db7cb; - border-color: #323232; - } - } -} .label-warning { - background-color: #f0ad4e; - - &[href] { - &:hover, &:focus { - background-color: #ec971f; - border-color: #323232; - } - } -} + background-color: #f0ad4e; } + .label-warning[href]:hover, .label-warning[href]:focus { + background-color: #ec971f; + border-color: #323232;} + .label-danger { - background-color: #DA4829; - - &[href] { - &:hover, &:focus { - background-color: #ec2121; - border-color: #323232; - } - } -} + background-color: #DA4829; } + .label-danger[href]:hover, .label-danger[href]:focus { + background-color: #ec2121; + border-color: #323232;} + .badge { display: inline-block; @@ -7338,94 +4257,56 @@ a.label { vertical-align: baseline; white-space: nowrap; text-align: center; - background-color: #777777; - border-radius: 10px; - - &:empty { - display: none; - } -} - -.btn .badge { - position: relative; - top: -1px; -} - -.btn-xs .badge, .btn-group-xs > .btn .badge { - top: 0; - padding: 1px 5px; -} - -a.list-group-item.active > .badge { - color: #FF8B00; - background-color: #fff; -} - -.nav-pills > { - .active > a > .badge { + background-color: #ff6e05; + border-radius: 10px; } + .badge:empty { + display: none; } + .btn .badge { + position: relative; + top: -1px; } + .btn-xs .badge, .btn-group-xs > .btn .badge { + top: 0; + padding: 1px 5px; } + a.list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #FF8B00; - background-color: #fff; - } + background-color: #fff; } + .nav-pills > li > a > .badge { + margin-left: 3px; } - li > a > .badge { - margin-left: 3px; - } -} +a.badge:hover, a.badge:focus { + color: #fff; + text-decoration: none; + cursor: pointer; } -a.badge { - &:hover, &:focus { - color: #fff; - text-decoration: none; - cursor: pointer; - } -} .jumbotron { padding: 30px; margin-bottom: 30px; color: inherit; - background-color: #eeeeee; - - h1, .h1 { - color: inherit; - } - - p { + background-color: #eeeeee; } + .jumbotron h1, + .jumbotron .h1 { + color: inherit; } + .jumbotron p { margin-bottom: 15px; font-size: 21px; - font-weight: 200; - } - - > hr { - border-top-color: #d5d5d5; - } -} - -.container .jumbotron { - border-radius: 6px; -} - -.jumbotron .container { - max-width: 100%; -} - -@media screen and (min-width: 768px) { - .jumbotron { - padding-top: 48px; - padding-bottom: 48px; - } - + font-weight: 200; } + .jumbotron > hr { + border-top-color: #d5d5d5; } .container .jumbotron { - padding-left: 60px; - padding-right: 60px; - } - - .jumbotron { - h1, .h1 { - font-size: 63px; - } - } -} + border-radius: 6px; } + .jumbotron .container { + max-width: 100%; } + @media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; } + .container .jumbotron { + padding-left: 60px; + padding-right: 60px; } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; } } .thumbnail { display: block; @@ -7437,1115 +4318,635 @@ a.badge { border-radius: 3px; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; - - > img, a > img { + transition: all 0.2s ease-in-out; } + .thumbnail > img, + .thumbnail a > img { display: block; width: 100% \9; max-width: 100%; height: auto; margin-left: auto; - margin-right: auto; - } - - .caption { + margin-right: auto; } + .thumbnail .caption { padding: 9px; - color: #3C3C3B; - } -} + color: #3C3C3B; } + +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #FF8B00; } -a.thumbnail { - &:hover, &:focus, &.active { - border-color: #FF8B00; - } -} .alert { padding: 15px; margin-bottom: 20px; border: 1px solid #b0b0b0; border-radius: 3px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - - h4 { - margin-top: 0; - color: inherit; - } - - .alert-link { - font-weight: bold; - } - - > { - p, ul { - margin-bottom: 0; - } - - p + p { - margin-top: 5px; - } - } -} - -.alert-dismissable, .alert-dismissible { - padding-right: 35px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); } -.alert-dismissable .close, .alert-dismissible .close { - position: relative; - top: -2px; - right: -21px; - color: inherit; -} + .alert h4 { + margin-top: 0; + color: inherit; } + .alert .alert-link { + font-weight: bold; } + .alert > p, + .alert > ul { + margin-bottom: 0; } + .alert > p + p { + margin-top: 5px; } + +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; } + .alert-dismissable .close, + .alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; } .alert-success { - background-color: #fbfbfb; - border-color: #a5a5a5; - color: #000; - - hr { - border-top-color: #8dcc62; - } - - .alert-link { - color: #72bd3e; - } -} + background-color: #fbfbfb; + border-color: #a5a5a5; + color: #000; } + .alert-success hr { + border-top-color: #8dcc62; } + .alert-success .alert-link { + color: #72bd3e; } .alert-info { - background-color: #fbfbfb; - border-color: #a5a5a5; - color: #000; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - - hr { - border-top-color: #DA4829; - } - - .alert-link { - color: #DA4829; - } + background-color: #fbfbfb; + border-color: #a5a5a5; + color: #000; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); } -.alert-warning { - background-color: #fff; - border: 1px solid #d12d0a; - color: #000; - - hr { - border-top-color: #f7e1b5; - } + .alert-info hr { + border-top-color: #DA4829; } + .alert-info .alert-link { + color: #DA4829; } - .alert-link { - color: #df8a13; - } -} +.alert-warning { + background-color: #fff; + border: 1px solid #d12d0a; + color: #000;} + .alert-warning hr { + border-top-color: #f7e1b5; } + .alert-warning .alert-link { + color: #df8a13; } .alert-danger { - background-color: #30596f; - border-color: #b0b0b0; - - hr { - border-top-color: #DA4829; - } - - .alert-link { - color: #DA4829; - } -} + background-color: #45565f; + border-color: #f00; } + .alert-danger hr { + border-top-color: #DA4829; } + .alert-danger .alert-link { + color: #DA4829; } @-webkit-keyframes progress-bar-stripes { from { - background-position: 40px 0; - } - + background-position: 40px 0; } to { - background-position: 0 0; - } -} - + background-position: 0 0; } } @keyframes progress-bar-stripes { from { - background-position: 40px 0; - } - + background-position: 40px 0; } to { - background-position: 0 0; - } -} - + background-position: 0 0; } } .progress { margin-bottom: 3px; color: #000; overflow: hidden; height: 20px; - background-color: #DBDBDB; - border-radius: 3px; - position: relative; - -webkit-box-shadow: inset 0px 1px 2px 1px rgb(172, 172, 172); - box-shadow: inset inset 0px 1px 2px 1px rgb(172, 172, 172); -} + background-color: #EAEAEA; + border: 1px solid #b9b9b9; + position: relative; } .progress-bar { float: left; width: 0%; height: 100%; font-size: 12px; - line-height: 20px; color: #fff; text-align: center; - background-color: #FF7E25; + background-color: #FF6E05; position: relative; z-index: 2; -webkit-box-shadow: inset 0 20px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 20px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; -o-transition: width 0.6s ease; - transition: width 0.6s ease; - margin: 1px 0 0 0 !important; -} + transition: width 0.6s ease; } -.progress-striped .progress-bar, .progress-bar-striped { +.progress-striped .progress-bar, +.progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-size: 40px 40px; -} + background-size: 40px 40px; } -.progress.active .progress-bar { +.progress.active .progress-bar, +.progress-bar.active { -webkit-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; -} + animation: progress-bar-stripes 2s linear infinite; } -.progress-bar { - &.active { - -webkit-animation: progress-bar-stripes 2s linear infinite; - -o-animation: progress-bar-stripes 2s linear infinite; - animation: progress-bar-stripes 2s linear infinite; - } - - &[aria-valuenow="1"], &[aria-valuenow="2"] { - min-width: 30px; - } - - &[aria-valuenow="0"] { - color: #777777; - min-width: 30px; - background-color: transparent; - background-image: none; - box-shadow: none; - } -} +.progress-bar[aria-valuenow="1"], .progress-bar[aria-valuenow="2"] { + min-width: 30px; } +.progress-bar[aria-valuenow="0"] { + color: #777777; + min-width: 30px; + background-color: transparent; + background-image: none; + box-shadow: none; } .progress-bar-success { - background-color: #4FB654; -} - -.progress-striped .progress-bar-success { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} + background-color: #4FB654; } + .progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { - background-color: #038CCF; -} - -.progress-striped .progress-bar-info { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} + background-color: #45565f; } + .progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #CCB60F; - color: #FFFFFF !important; -} - -.progress-striped .progress-bar-warning { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} + color: #FFFFFF !important; } + .progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-danger { - background-color: #CC2400; -} - -.progress-striped .progress-bar-danger { - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} - -.media, .media-body { + background-color: #CC2400; } + .progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } + +.media, +.media-body { overflow: hidden; - zoom: 1; -} + zoom: 1; } -.media { - margin-top: 15px; - - .media { - margin-top: 15px; - } +.media, +.media .media { + margin-top: 15px; } - &:first-child { - margin-top: 0; - } -} +.media:first-child { + margin-top: 0; } .media-object { - display: block; -} + display: block; } .media-heading { - margin: 0 0 5px; -} - -.media > { - .pull-left { - margin-right: 10px; - } + margin: 0 0 5px; } - .pull-right { - margin-left: 10px; - } -} +.media > .pull-left { + margin-right: 10px; } +.media > .pull-right { + margin-left: 10px; } .media-list { padding-left: 0; - list-style: none; -} + list-style: none; } .list-group { margin-bottom: 20px; - padding-left: 0; -} + padding-left: 0; } .list-group-item { position: relative; display: block; padding: 6px 8px; margin-bottom: -1px; - background-color: #294c5f; - - &:last-child { - margin-bottom: 0; - } - - > .badge { - float: right; - - + .badge { - margin-right: 5px; - } - } -} + background-color: #172c38; } + .list-group-item:last-child { + margin-bottom: 0; } + .list-group-item > .badge { + float: right; } + .list-group-item > .badge + .badge { + margin-right: 5px; } a.list-group-item { color: #FFFFFF; border-radius: 0; - outline: 0; - - .list-group-item-heading { - color: #2d2d2d; - } + outline:0; } - &:hover, &:focus { + a.list-group-item .list-group-item-heading { + color: #2d2d2d; } + a.list-group-item:hover, a.list-group-item:focus { text-decoration: none; color: #000; - background-color: #FFF; - } - - &:hover:before, &:focus:before { - background: #FFFFFF; - content: ""; - height: 42px; - left: 0; - position: absolute; - top: 0; - width: 3px; - } -} - -.list-group-item { - &.disabled { - background-color: #eeeeee; - color: #777777; - - &:hover, &:focus { - background-color: #eeeeee; - color: #777777; - } - - .list-group-item-heading, &:hover .list-group-item-heading, &:focus .list-group-item-heading { - color: inherit; - } - - .list-group-item-text, &:hover .list-group-item-text, &:focus .list-group-item-text { - color: #777777; - } - } - - &.active { - z-index: 2; - - &:hover, &:focus { - z-index: 2; - } + background-color: #FFF; } - &:before, &:hover:before, &:focus:before { - background: #ff8b00; - content: ""; - height: 42px; - left: 0; - position: absolute; - top: 0px; - width: 3px; - } - - .list-group-item-heading { - color: inherit; - - > { - small, .small { - color: inherit; - } - } - } - - &:hover .list-group-item-heading { - color: inherit; - - > { - small, .small { - color: inherit; - } - } - } - - &:focus .list-group-item-heading { - color: inherit; - - > { - small, .small { - color: inherit; - } - } - } - - .list-group-item-text, &:hover .list-group-item-text, &:focus .list-group-item-text { - color: #fedcbd; - } - - + .collapse > .list-group-item:before, &:hover + .collapse > .list-group-item:before, &:focus + .collapse > .list-group-item:before { - background: #FF8B00; + a.list-group-item:hover:before, a.list-group-item:focus:before { + background: #FFFFFF; content: ""; height: 42px; left: 0; position: absolute; - top: 0px; - width: 3px; - } - } -} + top: 0; + width: 3px; } + +.list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { + background-color: #eeeeee; + color: #777777; } + + .list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading { + color: inherit; } + + .list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text { + color: #777777; } + +.list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { + z-index: 2; } + .list-group-item.active:before, .list-group-item.active:hover:before, .list-group-item.active:focus:before { + background: #ff8b00; + content: ""; + height: 42px; + left: 0; + position: absolute; + top: 0px; + width: 3px; } + + .list-group-item.active .list-group-item-heading, + .list-group-item.active .list-group-item-heading > small, + .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading, + .list-group-item.active:hover .list-group-item-heading > small, + .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading, + .list-group-item.active:focus .list-group-item-heading > small, + .list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; } + .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { + color: #fedcbd; } + .list-group-item.active + .collapse > .list-group-item:before, .list-group-item.active:hover + .collapse > .list-group-item:before, .list-group-item.active:focus + .collapse > .list-group-item:before { + background: #FF8B00; + content: ""; + height: 42px; + left: 0; + position: absolute; + top: 0px; + width: 3px; } .list-group-item-success { color: #9BD275; - background-color: #9BD275; -} + background-color: #9BD275; } a.list-group-item-success { - color: #9BD275; - - .list-group-item-heading { - color: inherit; - } - - &:hover, &:focus { + color: #9BD275; } + a.list-group-item-success .list-group-item-heading { + color: inherit; } + a.list-group-item-success:hover, a.list-group-item-success:focus { color: #9BD275; - background-color: #8dcc62; - } - - &.active { + background-color: #8dcc62; } + a.list-group-item-success.active, a.list-group-item-success.active:hover, a.list-group-item-success.active:focus { color: #fff; background-color: #9BD275; - border-color: #9BD275; - - &:hover, &:focus { - color: #fff; - background-color: #9BD275; - border-color: #9BD275; - } - } -} + border-color: #9BD275; } .list-group-item-info { color: #31708f; - background-color: #d9edf7; -} + background-color: #d9edf7; } a.list-group-item-info { - color: #31708f; - - .list-group-item-heading { - color: inherit; - } - - &:hover, &:focus { + color: #31708f; } + a.list-group-item-info .list-group-item-heading { + color: inherit; } + a.list-group-item-info:hover, a.list-group-item-info:focus { color: #31708f; - background-color: #c4e3f3; - } - - &.active { + background-color: #c4e3f3; } + a.list-group-item-info.active, a.list-group-item-info.active:hover, a.list-group-item-info.active:focus { color: #fff; background-color: #31708f; - border-color: #31708f; - - &:hover, &:focus { - color: #fff; - background-color: #31708f; - border-color: #31708f; - } - } -} + border-color: #31708f; } .list-group-item-warning { color: #f0ad4e; - background-color: #fcf8e3; -} + background-color: #fcf8e3; } a.list-group-item-warning { - color: #f0ad4e; - - .list-group-item-heading { - color: inherit; - } - - &:hover, &:focus { + color: #f0ad4e; } + a.list-group-item-warning .list-group-item-heading { + color: inherit; } + a.list-group-item-warning:hover, a.list-group-item-warning:focus { color: #f0ad4e; - background-color: #faf2cc; - } - - &.active { + background-color: #faf2cc; } + a.list-group-item-warning.active, a.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus { color: #fff; background-color: #f0ad4e; - border-color: #f0ad4e; - - &:hover, &:focus { - color: #fff; - background-color: #f0ad4e; - border-color: #f0ad4e; - } - } -} + border-color: #f0ad4e; } .list-group-item-danger { color: #F05050; - background-color: #F05050; -} + background-color: #F05050; } a.list-group-item-danger { - color: #F05050; - - .list-group-item-heading { - color: inherit; - } - - &:hover, &:focus { + color: #F05050; } + a.list-group-item-danger .list-group-item-heading { + color: inherit; } + a.list-group-item-danger:hover, a.list-group-item-danger:focus { color: #F05050; - background-color: #ee3939; - } - - &.active { + background-color: #ee3939; } + a.list-group-item-danger.active, a.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus { color: #fff; background-color: #F05050; - border-color: #F05050; - - &:hover, &:focus { - color: #fff; - background-color: #F05050; - border-color: #F05050; - } - } -} + border-color: #F05050; } .list-group-item-heading { margin-top: 0; - margin-bottom: 5px; -} + margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; - line-height: 1.3; -} + line-height: 1.3; } .panel { border: 1px solid #b0b0b0; - margin-bottom: 20px; -} + margin-bottom: 20px; } .panel-body { padding: 15px; - background-color: #F0F0F0; - - &:before { - content: " "; - display: table; - } - - &:after { + background-color: #F0F0F0;} + .panel-body:before, .panel-body:after { content: " "; - display: table; - clear: both; - } -} + display: table; } + .panel-body:after { + clear: both; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid #b0b0b0; border-top-right-radius: 2px; border-top-left-radius: 2px; - background-color: #30596f; + background-color: #45565f; } - > .dropdown .dropdown-toggle { - color: inherit; - } -} + .panel-heading > .dropdown .dropdown-toggle { + color: inherit; } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 16px; - color: inherit; - - > a { - color: inherit; - } -} + color: inherit; } + .panel-title > a { + color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #ddd; border-bottom-right-radius: 2px; - border-bottom-left-radius: 2px; -} + border-bottom-left-radius: 2px; } .panel > .list-group { - margin-bottom: 0; - - .list-group-item { + margin-bottom: 0; } + .panel > .list-group .list-group-item { border-width: 1px 0; - border-radius: 0; - } - - &:first-child .list-group-item:first-child { - border-top: 0; - } - - &:last-child .list-group-item:last-child { - border-bottom: 0; - } -} - -.panel-heading + .list-group .list-group-item:first-child, .list-group + .panel-footer { - border-top-width: 0; -} - -.panel > { - .table, .table-responsive > .table, .panel-collapse > .table { - margin-bottom: 0; - } - - .table:first-child, .table-responsive:first-child > .table:first-child { - border-top-right-radius: 2px; - border-top-left-radius: 2px; - } - - .table:first-child > { - thead:first-child > tr:first-child { - td:first-child, th:first-child { - border-top-left-radius: 2px; - } - } - - tbody:first-child > tr:first-child { - td:first-child, th:first-child { - border-top-left-radius: 2px; - } - } - } - - .table-responsive:first-child > .table:first-child > { - thead:first-child > tr:first-child { - td:first-child, th:first-child { - border-top-left-radius: 2px; - } - } - - tbody:first-child > tr:first-child { - td:first-child, th:first-child { - border-top-left-radius: 2px; - } - } - } - - .table:first-child > { - thead:first-child > tr:first-child { - td:last-child, th:last-child { - border-top-right-radius: 2px; - } - } - - tbody:first-child > tr:first-child { - td:last-child, th:last-child { - border-top-right-radius: 2px; - } - } - } - - .table-responsive:first-child > .table:first-child > { - thead:first-child > tr:first-child { - td:last-child, th:last-child { - border-top-right-radius: 2px; - } - } - - tbody:first-child > tr:first-child { - td:last-child, th:last-child { - border-top-right-radius: 2px; - } - } - } - - .table:last-child, .table-responsive:last-child > .table:last-child { - border-bottom-right-radius: 2px; - border-bottom-left-radius: 2px; - } - - .table:last-child > { - tbody:last-child > tr:last-child { - td:first-child, th:first-child { - border-bottom-left-radius: 2px; - } - } - - tfoot:last-child > tr:last-child { - td:first-child, th:first-child { - border-bottom-left-radius: 2px; - } - } - } - - .table-responsive:last-child > .table:last-child > { - tbody:last-child > tr:last-child { - td:first-child, th:first-child { - border-bottom-left-radius: 2px; - } - } - - tfoot:last-child > tr:last-child { - td:first-child, th:first-child { - border-bottom-left-radius: 2px; - } - } - } - - .table:last-child > { - tbody:last-child > tr:last-child { - td:last-child, th:last-child { - border-bottom-right-radius: 2px; - } - } - - tfoot:last-child > tr:last-child { - td:last-child, th:last-child { - border-bottom-right-radius: 2px; - } - } - } - - .table-responsive:last-child > .table:last-child > { - tbody:last-child > tr:last-child { - td:last-child, th:last-child { - border-bottom-right-radius: 2px; - } - } - - tfoot:last-child > tr:last-child { - td:last-child, th:last-child { - border-bottom-right-radius: 2px; - } - } - } - - .panel-body + { - .table, .table-responsive { - border-top: 1px solid #eee; - } - } - - .table > tbody:first-child > tr:first-child { - th, td { - border-top: 0; - } - } - - .table-bordered, .table-responsive > .table-bordered { - border: 0; - } - - .table-bordered > { - thead > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - - tbody > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - - tfoot > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - } - - .table-responsive > .table-bordered > { - thead > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - - tbody > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - - tfoot > tr > { - th:first-child, td:first-child { - border-left: 0; - } - } - } - - .table-bordered > { - thead > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - - tbody > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - - tfoot > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - } - - .table-responsive > .table-bordered > { - thead > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - - tbody > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - - tfoot > tr > { - th:last-child, td:last-child { - border-right: 0; - } - } - } - - .table-bordered > { - thead > tr:first-child > { - td, th { - border-bottom: 0; - } - } - - tbody > tr:first-child > { - td, th { - border-bottom: 0; - } - } - } - - .table-responsive > .table-bordered > { - thead > tr:first-child > { - td, th { - border-bottom: 0; - } - } - - tbody > tr:first-child > { - td, th { - border-bottom: 0; - } - } - } - - .table-bordered > { - tbody > tr:last-child > { - td, th { - border-bottom: 0; - } - } - - tfoot > tr:last-child > { - td, th { - border-bottom: 0; - } - } - } - - .table-responsive { - > .table-bordered > { - tbody > tr:last-child > { - td, th { - border-bottom: 0; - } - } - - tfoot > tr:last-child > { - td, th { - border-bottom: 0; - } - } - } - - border: 0; - margin-bottom: 0; - } -} + border-radius: 0; } + .panel > .list-group:first-child .list-group-item:first-child { + border-top: 0; } + .panel > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; } + +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; } + +.list-group + .panel-footer { + border-top-width: 0; } + +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; } +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: 2px; + border-top-left-radius: 2px; } + .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, + .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, + .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, + .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, + .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, + .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, + .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, + .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 2px; } + .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, + .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, + .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, + .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, + .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, + .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, + .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, + .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 2px; } +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 2px; + border-bottom-left-radius: 2px; } + .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, + .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, + .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, + .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, + .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, + .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, + .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, + .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 2px; } + .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, + .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, + .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, + .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, + .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, + .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, + .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, + .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 2px; } +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive { + border-top: 1px solid #eee; } +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; } +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; } + .panel > .table-bordered > thead > tr > th:first-child, + .panel > .table-bordered > thead > tr > td:first-child, + .panel > .table-bordered > tbody > tr > th:first-child, + .panel > .table-bordered > tbody > tr > td:first-child, + .panel > .table-bordered > tfoot > tr > th:first-child, + .panel > .table-bordered > tfoot > tr > td:first-child, + .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, + .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, + .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, + .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, + .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; } + .panel > .table-bordered > thead > tr > th:last-child, + .panel > .table-bordered > thead > tr > td:last-child, + .panel > .table-bordered > tbody > tr > th:last-child, + .panel > .table-bordered > tbody > tr > td:last-child, + .panel > .table-bordered > tfoot > tr > th:last-child, + .panel > .table-bordered > tfoot > tr > td:last-child, + .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, + .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, + .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, + .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, + .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; } + .panel > .table-bordered > thead > tr:first-child > td, + .panel > .table-bordered > thead > tr:first-child > th, + .panel > .table-bordered > tbody > tr:first-child > td, + .panel > .table-bordered > tbody > tr:first-child > th, + .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, + .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, + .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, + .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; } + .panel > .table-bordered > tbody > tr:last-child > td, + .panel > .table-bordered > tbody > tr:last-child > th, + .panel > .table-bordered > tfoot > tr:last-child > td, + .panel > .table-bordered > tfoot > tr:last-child > th, + .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, + .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, + .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, + .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; } +.panel > .table-responsive { + border: 0; + margin-bottom: 0; } .panel-group { - margin-bottom: 20px; - - .panel { + margin-bottom: 20px; } + .panel-group .panel { margin-bottom: 0; - border-radius: 3px; - - + .panel { - margin-top: 5px; - } - } - - .panel-heading { - border-bottom: 0; - - + .panel-collapse > .panel-body { - border-top: 1px solid #ddd; - } - } - - .panel-footer { - border-top: 0; - - + .panel-collapse .panel-body { - border-bottom: 1px solid #ddd; - } - } -} - -.panel-default { - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - - > { - .panel-heading { - color: #fff; - border-color: #b0b0b0; - - + .panel-collapse > .panel-body { - border-top-color: #b0b0b0; - } - - .badge { - color: #f5f5f5; - background-color: #2d2d2d; - } - } - - .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #b0b0b0; - } - } -} - -.panel-primary { - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - - > { - .panel-heading { - color: #FFF; - border-color: #b0b0b0; - - + .panel-collapse > .panel-body { - border-top-color: #FF8B00; - } - - .badge { - color: #FF8B00; - background-color: #fff; - } - } - - .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #FF8B00; - } - } -} + border-radius: 3px; } + .panel-group .panel + .panel { + margin-top: 5px; } + .panel-group .panel-heading { + border-bottom: 0; } + .panel-group .panel-heading + .panel-collapse > .panel-body { + border-top: 1px solid #ddd; } + .panel-group .panel-footer { + border-top: 0; } + .panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #ddd; } + .panel-default { + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); } + .panel-default > .panel-heading { + color: #fff; + border-color: #b0b0b0; } + .panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #b0b0b0; } + .panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #2d2d2d; } + .panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #b0b0b0; } + .panel-primary { + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); } + .panel-primary > .panel-heading { + color: #FFF; + border-color: #b0b0b0; } + .panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #FF8B00; } + .panel-primary > .panel-heading .badge { + color: #FF8B00; + background-color: #fff; } + .panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #FF8B00; } .panel-success { - border-color: #9BD275; - - > { - .panel-heading { + border-color: #9BD275; } + .panel-success > .panel-heading { + color: #9BD275; + background-color: #9BD275; + border-color: #9BD275; } + .panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #9BD275; } + .panel-success > .panel-heading .badge { color: #9BD275; - background-color: #9BD275; - border-color: #9BD275; - - + .panel-collapse > .panel-body { - border-top-color: #9BD275; - } - - .badge { - color: #9BD275; - background-color: #9BD275; - } - } - - .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #9BD275; - } - } -} + background-color: #9BD275; } + .panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #9BD275; } .panel-info { - border-color: #b0b0b0; - - > { - .panel-heading { - color: #31708f; - background-color: #d9edf7; - border-color: #b0b0b0; - - + .panel-collapse > .panel-body { - border-top-color: #b0b0b0; - } - - .badge { - color: #d9edf7; - background-color: #31708f; - } - } - - .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #b0b0b0; - } - } -} + border-color: #b0b0b0; } + .panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #b0b0b0; } + .panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #b0b0b0; } + .panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; } + .panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #b0b0b0; } .panel-warning { - border-color: #faebcc; - - > { - .panel-heading { - color: #f0ad4e; - background-color: #fcf8e3; - border-color: #faebcc; - - + .panel-collapse > .panel-body { - border-top-color: #faebcc; - } - - .badge { - color: #fcf8e3; - background-color: #f0ad4e; - } - } - - .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #faebcc; - } - } -} + border-color: #faebcc; } + .panel-warning > .panel-heading { + color: #f0ad4e; + background-color: #fcf8e3; + border-color: #faebcc; } + .panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; } + .panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #f0ad4e; } + .panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; } .panel-danger { - border-color: #F05050; - - > { - .panel-heading { + border-color: #F05050; } + .panel-danger > .panel-heading { + color: #F05050; + background-color: #F05050; + border-color: #F05050; } + .panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #F05050; } + .panel-danger > .panel-heading .badge { color: #F05050; - background-color: #F05050; - border-color: #F05050; - - + .panel-collapse > .panel-body { - border-top-color: #F05050; - } - - .badge { - color: #F05050; - background-color: #F05050; - } - } - - .panel-footer + .panel-collapse > .panel-body { - border-bottom-color: #F05050; - } - } -} + background-color: #F05050; } + .panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #F05050; } .embed-responsive { position: relative; display: block; height: 0; padding: 0; - overflow: hidden; - - .embed-responsive-item, iframe, embed, object { + overflow: hidden; } + .embed-responsive .embed-responsive-item, + .embed-responsive iframe, + .embed-responsive embed, + .embed-responsive object { position: absolute; top: 0; left: 0; bottom: 0; height: 100%; width: 100%; - border: 0; - } - - &.embed-responsive-16by9 { - padding-bottom: 56.25%; - } - - &.embed-responsive-4by3 { - padding-bottom: 75%; - } -} + border: 0; } + .embed-responsive.embed-responsive-16by9 { + padding-bottom: 56.25%; } + .embed-responsive.embed-responsive-4by3 { + padding-bottom: 75%; } .well { min-height: 20px; @@ -8553,54 +4954,44 @@ a.list-group-item-danger { margin-bottom: 20px; background-color: none; border: none; - border-radius: none; - - blockquote { + border-radius: none; } + .well blockquote { border-color: #ddd; - border-color: rgba(0, 0, 0, 0.15); - } -} + border-color: rgba(0, 0, 0, 0.15); } .well-lg { padding: 24px; - border-radius: 6px; -} + border-radius: 6px; } .well-sm { padding: 9px; - border-radius: 3px; -} + border-radius: 3px; } .close { - float: right; + float:right; font-size: 21px; font-weight: bold; line-height: 1; color: #FFFFFF; text-shadow: 0 1px 0 #000; opacity: 1; - filter: alpha(opacity = 100); - - &:hover, &:focus { + filter: alpha(opacity=100); } + .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; opacity: 1; - filter: alpha(opacity = 100); - } -} + filter: alpha(opacity=100); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; - -webkit-appearance: none; -} + -webkit-appearance: none; } .modal-open { - overflow: hidden; -} + overflow: hidden; } .modal { display: none; @@ -8612,34 +5003,27 @@ button.close { left: 0; z-index: 1050; -webkit-overflow-scrolling: touch; - outline: 0; - - &.fade .modal-dialog { + outline: 0; } + .modal.fade .modal-dialog { -webkit-transform: translate3d(0, -25%, 0); transform: translate3d(0, -25%, 0); -webkit-transition: -webkit-transform 0.3s ease-out; -moz-transition: -moz-transform 0.3s ease-out; -o-transition: -o-transform 0.3s ease-out; - transition: transform 0.3s ease-out; - } - - &.in .modal-dialog { + transition: transform 0.3s ease-out; } + .modal.in .modal-dialog { -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - } -} + transform: translate3d(0, 0, 0); } .modal-open .modal { overflow-x: hidden; - overflow-y: auto; -} + overflow-y: auto; } .modal-dialog { position: relative; width: auto; margin: 62px 10px 10px 10px; - border: 1px solid #7a7a7a; -} + border: 1px solid #7a7a7a;} .modal-content { position: relative; @@ -8649,8 +5033,7 @@ button.close { -webkit-box-shadow: 0 5px 15px rgb(30, 30, 30); box-shadow: 0 5px 15px rgb(5, 5, 5); background-clip: padding-box; - outline: 0; -} + outline: 0; } .modal-backdrop { position: fixed; @@ -8659,113 +5042,79 @@ button.close { bottom: 0; left: 0; z-index: 1040; - background-color: #000; - - &.fade { + background-color: #000; } + .modal-backdrop.fade { opacity: 0; - filter: alpha(opacity = 0); - } - - &.in { + filter: alpha(opacity=0); } + .modal-backdrop.in { opacity: 0.5; - filter: alpha(opacity = 50); - } -} + filter: alpha(opacity=50); } .modal-header { - padding-left: 10px; - padding-right: 10px; - padding-top: 3px; - padding-bottom: 1px; + padding-left:10px; + padding-right:10px; + padding-top:3px; + padding-bottom:1px; border-bottom: 1px solid #4a4a4a; min-height: 16.42857px; - background-color: #427795; - color: #FFF; + background-color: #45565f; + color: #FFF; } - .close { - margin-top: -2px; - } -} +.modal-header .close { + margin-top: -2px; } .modal-title { margin: 0; - line-height: 1.428571429; -} + line-height: 1.428571429; } .modal-body { position: relative; padding: 5px; - background-color: #FFF; - - .table-hover > tbody > tr:hover > { - td, th { - background-color: #336480; - color: #FFF; - } - } -} + background-color: #FFF;} +.modal-body .table-hover > tbody > tr:hover > td, +.modal-body .table-hover > tbody > tr:hover > th { + background-color: #f06702; + color: #FFF; } .modal-footer { padding: 5px; text-align: right; - background-color: #f0f0f0; - border-top: 1px solid inherit; - - &:before { - content: " "; - display: table; - } - - &:after { + background-color: #ddd; + border-top: 1px solid inherit; } + .modal-footer:before, .modal-footer:after { content: " "; - display: table; - clear: both; - } - - .btn + .btn { + display: table; } + .modal-footer:after { + clear: both; } + .modal-footer .btn + .btn { margin-left: 5px; - margin-bottom: 0; - } - - .btn-group .btn + .btn { - margin-left: -1px; - } - - .btn-block + .btn-block { - margin-left: 0; - } -} + margin-bottom: 0; } + .modal-footer .btn-group .btn + .btn { + margin-left: -1px; } + .modal-footer .btn-block + .btn-block { + margin-left: 0; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; - overflow: scroll; -} + overflow: scroll; } @media (min-width: 768px) { .modal-dialog { width: 600px; - margin: 82px auto 30px auto; - } + margin: 82px auto 30px auto; } .modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); - box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); - } + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); } .modal-sm { - width: 300px; - } -} - + width: 300px; } } @media (min-width: 992px) { .modal-lg { - width: 900px; - } -} - + width: 900px; } } .tooltip { position: absolute; z-index: 1070; @@ -8774,113 +5123,83 @@ button.close { font-size: 12px; line-height: 1.4; opacity: 0; - filter: alpha(opacity = 0); - - &.in { + filter: alpha(opacity=0); } + .tooltip.in { opacity: 0.9; - filter: alpha(opacity = 90); - } - - &.top { + filter: alpha(opacity=90); } + .tooltip.top { margin-top: -3px; - padding: 5px 0; - } - - &.right { + padding: 5px 0; } + .tooltip.right { margin-left: 3px; - padding: 0 5px; - } - - &.bottom { + padding: 0 5px; } + .tooltip.bottom { margin-top: 3px; - padding: 5px 0; - } - - &.left { + padding: 5px 0; } + .tooltip.left { margin-left: -3px; - padding: 0 5px; - } -} + padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #fff; text-align: center; - text-decoration: none; - background-color: #000; - border-radius: 3px; -} - -.tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} - -.tooltip { - &.top .tooltip-arrow { - bottom: 0; - left: 50%; - margin-left: -5px; - border-width: 5px 5px 0; - border-top-color: #000; - } - - &.top-left .tooltip-arrow { - bottom: 0; - left: 5px; - border-width: 5px 5px 0; - border-top-color: #000; - } - - &.top-right .tooltip-arrow { - bottom: 0; - right: 5px; - border-width: 5px 5px 0; - border-top-color: #000; - } - - &.right .tooltip-arrow { - top: 50%; - left: 0; - margin-top: -5px; - border-width: 5px 5px 5px 0; - border-right-color: #000; - } - - &.left .tooltip-arrow { - top: 50%; - right: 0; - margin-top: -5px; - border-width: 5px 0 5px 5px; - border-left-color: #000; - } - - &.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-width: 0 5px 5px; - border-bottom-color: #000; - } + text-decoration: none; + background-color: #000; + border-radius: 3px; } - &.bottom-left .tooltip-arrow { - top: 0; - left: 5px; - border-width: 0 5px 5px; - border-bottom-color: #000; - } +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; } - &.bottom-right .tooltip-arrow { - top: 0; - right: 5px; - border-width: 0 5px 5px; - border-bottom-color: #000; - } -} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000; } +.tooltip.top-left .tooltip-arrow { + bottom: 0; + left: 5px; + border-width: 5px 5px 0; + border-top-color: #000; } +.tooltip.top-right .tooltip-arrow { + bottom: 0; + right: 5px; + border-width: 5px 5px 0; + border-top-color: #000; } +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000; } +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000; } +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; } +.tooltip.bottom-left .tooltip-arrow { + top: 0; + left: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000; } +.tooltip.bottom-right .tooltip-arrow { + top: 0; + right: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000; } .popover { position: absolute; @@ -8894,201 +5213,143 @@ button.close { background-color: #fff; background-clip: padding-box; border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.3); + border: 1px solid rgba(0, 0, 0, 0.30); border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - white-space: normal; - - &.top { - margin-top: -10px; - } - - &.right { - margin-left: 10px; - } - - &.bottom { - margin-top: 10px; - } - - &.left { - margin-left: -10px; - } -} + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); + white-space: normal; } + .popover.top { + margin-top: -10px; } + .popover.right { + margin-left: 10px; } + .popover.bottom { + margin-top: 10px; } + .popover.left { + margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; - font-size: 14px; + font-size:14px; font-weight: normal; line-height: 18px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; - border-radius: 5px 5px 0 0; -} + border-radius: 5px 5px 0 0; } .popover-content { - padding: 9px 14px; -} + padding: 9px 14px; } -.popover { - > .arrow { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; +.popover > .arrow, .popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; } - &:after { - position: absolute; - display: block; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 10px; - content: ""; - } +.popover > .arrow { + border-width: 11px; } - border-width: 11px; - } +.popover > .arrow:after { + border-width: 10px; + content: ""; } - &.top > .arrow { - left: 50%; - margin-left: -11px; +.popover.top > .arrow { + left: 50%; + margin-left: -11px; + border-bottom-width: 0; + border-top-color: #999999; + border-top-color: rgba(0, 0, 0, 0.25); + bottom: -11px; } + .popover.top > .arrow:after { + content: " "; + bottom: 1px; + margin-left: -10px; border-bottom-width: 0; - border-top-color: #999999; - border-top-color: rgba(0, 0, 0, 0.25); - bottom: -11px; - - &:after { - content: " "; - bottom: 1px; - margin-left: -10px; - border-bottom-width: 0; - border-top-color: #fff; - } - } - - &.right > .arrow { - top: 50%; - left: -11px; - margin-top: -11px; + border-top-color: #fff; } +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-left-width: 0; + border-right-color: #999999; + border-right-color: rgba(0, 0, 0, 0.25); } + .popover.right > .arrow:after { + content: " "; + left: 1px; + bottom: -10px; border-left-width: 0; - border-right-color: #999999; - border-right-color: rgba(0, 0, 0, 0.25); - - &:after { - content: " "; - left: 1px; - bottom: -10px; - border-left-width: 0; - border-right-color: #fff; - } - } - - &.bottom > .arrow { - left: 50%; - margin-left: -11px; + border-right-color: #fff; } +.popover.bottom > .arrow { + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999999; + border-bottom-color: rgba(0, 0, 0, 0.25); + top: -11px; } + .popover.bottom > .arrow:after { + content: " "; + top: 1px; + margin-left: -10px; border-top-width: 0; - border-bottom-color: #999999; - border-bottom-color: rgba(0, 0, 0, 0.25); - top: -11px; - - &:after { - content: " "; - top: 1px; - margin-left: -10px; - border-top-width: 0; - border-bottom-color: #fff; - } - } - - &.left > .arrow { - top: 50%; - right: -11px; - margin-top: -11px; + border-bottom-color: #fff; } +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999999; + border-left-color: rgba(0, 0, 0, 0.25); } + .popover.left > .arrow:after { + content: " "; + right: 1px; border-right-width: 0; - border-left-color: #999999; - border-left-color: rgba(0, 0, 0, 0.25); - - &:after { - content: " "; - right: 1px; - border-right-width: 0; - border-left-color: #fff; - bottom: -10px; - } - } -} + border-left-color: #fff; + bottom: -10px; } .carousel { - position: relative; -} + position: relative; } .carousel-inner { position: relative; overflow: hidden; - width: 100%; - - > { - .item { - display: none; - position: relative; - -webkit-transition: 0.6s ease-in-out left; - -o-transition: 0.6s ease-in-out left; - transition: 0.6s ease-in-out left; - - > { - img, a > img { - display: block; - width: 100% \9; - max-width: 100%; - height: auto; - line-height: 1; - } - } - } - - .active, .next, .prev { + width: 100%; } + .carousel-inner > .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; } + .carousel-inner > .item > img, + .carousel-inner > .item > a > img { display: block; - } - - .active { - left: 0; - } - - .next, .prev { - position: absolute; - top: 0; - width: 100%; - } - - .next { - left: 100%; - } - - .prev { - left: -100%; - } - - .next.left, .prev.right { - left: 0; - } - - .active { - &.left { - left: -100%; - } - - &.right { - left: 100%; - } - } - } -} + width: 100% \9; + max-width: 100%; + height: auto; + line-height: 1; } + .carousel-inner > .active, + .carousel-inner > .next, + .carousel-inner > .prev { + display: block; } + .carousel-inner > .active { + left: 0; } + .carousel-inner > .next, + .carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; } + .carousel-inner > .next { + left: 100%; } + .carousel-inner > .prev { + left: -100%; } + .carousel-inner > .next.left, + .carousel-inner > .prev.right { + left: 0; } + .carousel-inner > .active.left { + left: -100%; } + .carousel-inner > .active.right { + left: 100%; } .carousel-control { position: absolute; @@ -9097,70 +5358,57 @@ button.close { bottom: 0; width: 15%; opacity: 0.5; - filter: alpha(opacity = 50); + filter: alpha(opacity=50); font-size: 20px; color: #fff; text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); - - &.left { + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } + .carousel-control.left { background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); - } - - &.right { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); } + .carousel-control.right { left: auto; right: 0; background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); - } - - &:hover, &:focus { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); } + .carousel-control:hover, .carousel-control:focus { outline: 0; color: #fff; text-decoration: none; opacity: 0.9; - filter: alpha(opacity = 90); - } - - .icon-prev, .icon-next, .glyphicon-chevron-left, .glyphicon-chevron-right { + filter: alpha(opacity=90); } + .carousel-control .icon-prev, + .carousel-control .icon-next, + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; z-index: 5; - display: inline-block; - } - - .icon-prev, .glyphicon-chevron-left { + display: inline-block; } + .carousel-control .icon-prev, + .carousel-control .glyphicon-chevron-left { left: 50%; - margin-left: -10px; - } - - .icon-next, .glyphicon-chevron-right { + margin-left: -10px; } + .carousel-control .icon-next, + .carousel-control .glyphicon-chevron-right { right: 50%; - margin-right: -10px; - } - - .icon-prev, .icon-next { + margin-right: -10px; } + .carousel-control .icon-prev, + .carousel-control .icon-next { width: 20px; height: 20px; margin-top: -10px; - font-family: serif; - } - - .icon-prev:before { - content: '\2039'; - } - - .icon-next:before { - content: '\203a'; - } -} + font-family: serif; } + .carousel-control .icon-prev:before { + content: '\2039'; } + .carousel-control .icon-next:before { + content: '\203a'; } .carousel-indicators { position: absolute; @@ -9171,9 +5419,8 @@ button.close { margin-left: -30%; padding-left: 0; list-style: none; - text-align: center; - - li { + text-align: center; } + .carousel-indicators li { display: inline-block; width: 10px; height: 10px; @@ -9183,16 +5430,12 @@ button.close { border-radius: 10px; cursor: pointer; background-color: #000 \9; - background-color: transparent; - } - - .active { + background-color: transparent; } + .carousel-indicators .active { margin: 0; width: 12px; height: 12px; - background-color: #fff; - } -} + background-color: #fff; } .carousel-caption { position: absolute; @@ -9204,350 +5447,269 @@ button.close { padding-bottom: 20px; color: #fff; text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); - - .btn { - text-shadow: none; - } -} + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } + .carousel-caption .btn { + text-shadow: none; } @media screen and (min-width: 768px) { - .carousel-control { - .glyphicon-chevron-left, .glyphicon-chevron-right, .icon-prev, .icon-next { - width: 30px; - height: 30px; - margin-top: -15px; - font-size: 30px; - } - - .glyphicon-chevron-left, .icon-prev { - margin-left: -15px; - } - - .glyphicon-chevron-right, .icon-next { - margin-right: -15px; - } - } + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + font-size: 30px; } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -15px; } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -15px; } .carousel-caption { left: 20%; right: 20%; - padding-bottom: 30px; - } + padding-bottom: 30px; } .carousel-indicators { - bottom: 20px; - } -} - + bottom: 20px; } } .clearfix:before, .content-box:before, .clearfix:after, .content-box:after { content: " "; - display: table; -} - + display: table; } .clearfix:after, .content-box:after { - clear: both; -} + clear: both; } .center-block { display: block; margin-left: auto; - margin-right: auto; -} + margin-right: auto; } .pull-right { float: right !important; - margin-top: 0px; -} + margin-top: 0px;} .pull-left { float: left !important; - margin-top: 0px; -} + margin-top: 0px;} .hide { - display: none !important; -} + display: none !important; } .show { display: block !important; - color: #757575; -} + color: #2ba632; } .invisible { - visibility: hidden; -} + visibility: hidden; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; - border: 0; -} + border: 0; } .hidden { display: none !important; - visibility: hidden !important; -} + visibility: hidden !important; } .affix { position: fixed; -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} + transform: translate3d(0, 0, 0); } @-ms-viewport { - width: device-width; -} - -.visible-xs, .visible-sm, .visible-md, .visible-lg, .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block, .visible-print, .visible-print-block, .visible-print-inline, .visible-print-inline-block { - display: none !important; -} + width: device-width; } +.visible-xs, .visible-sm, .visible-md, .visible-lg { + display: none !important; } + +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; } @media (max-width: 767px) { .visible-xs { - display: block !important; - } + display: block !important; } table.visible-xs { - display: table; - } + display: table; } tr.visible-xs { - display: table-row !important; - } - - th.visible-xs, td.visible-xs { - display: table-cell !important; - } -} + display: table-row !important; } + th.visible-xs, + td.visible-xs { + display: table-cell !important; } } @media (max-width: 767px) { .visible-xs-block { - display: block !important; - } -} + display: block !important; } } @media (max-width: 767px) { .visible-xs-inline { - display: inline !important; - } -} + display: inline !important; } } @media (max-width: 767px) { .visible-xs-inline-block { - display: inline-block !important; - } -} + display: inline-block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { - display: block !important; - } + display: block !important; } table.visible-sm { - display: table; - } + display: table; } tr.visible-sm { - display: table-row !important; - } - - th.visible-sm, td.visible-sm { - display: table-cell !important; - } -} + display: table-row !important; } + th.visible-sm, + td.visible-sm { + display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-block { - display: block !important; - } -} + display: block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline { - display: inline !important; - } -} + display: inline !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline-block { - display: inline-block !important; - } -} + display: inline-block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { - display: block !important; - } + display: block !important; } table.visible-md { - display: table; - } + display: table; } tr.visible-md { - display: table-row !important; - } - - th.visible-md, td.visible-md { - display: table-cell !important; - } -} + display: table-row !important; } + th.visible-md, + td.visible-md { + display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-block { - display: block !important; - } -} + display: block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline { - display: inline !important; - } -} + display: inline !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline-block { - display: inline-block !important; - } -} + display: inline-block !important; } } @media (min-width: 1200px) { .visible-lg { - display: block !important; - } + display: block !important; } table.visible-lg { - display: table; - } + display: table; } tr.visible-lg { - display: table-row !important; - } - - th.visible-lg, td.visible-lg { - display: table-cell !important; - } -} + display: table-row !important; } + th.visible-lg, + td.visible-lg { + display: table-cell !important; } } @media (min-width: 1200px) { .visible-lg-block { - display: block !important; - } -} + display: block !important; } } @media (min-width: 1200px) { .visible-lg-inline { - display: inline !important; - } -} + display: inline !important; } } @media (min-width: 1200px) { .visible-lg-inline-block { - display: inline-block !important; - } -} + display: inline-block !important; } } @media (max-width: 767px) { .hidden-xs, .page-side { - display: none !important; - } -} - + display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-sm { - display: none !important; - } -} - + display: none !important; } } /* COLLAPSE SIDEBAR @media*/ @media (max-width: 768px), (max-height: 669px) { .toggle-sidebar { - display: none !important; - } -} - + display: none !important; } } /* COLLAPSE SIDEBAR @media END*/ @media (min-width: 992px) and (max-width: 1199px) { .hidden-md { - display: none !important; - } -} - + display: none !important; } } @media (min-width: 1200px) { .hidden-lg { - display: none !important; - } -} + display: none !important; } } +.visible-print { + display: none !important; } @media print { .visible-print { - display: block !important; - } + display: block !important; } table.visible-print { - display: table; - } + display: table; } tr.visible-print { - display: table-row !important; - } - - th.visible-print, td.visible-print { - display: table-cell !important; - } -} - -@media print { - .visible-print-block { - display: block !important; - } -} - -@media print { - .visible-print-inline { - display: inline !important; - } -} - -@media print { - .visible-print-inline-block { - display: inline-block !important; - } -} + display: table-row !important; } + + th.visible-print, + td.visible-print { + display: table-cell !important; } } +.visible-print-block { + display: none !important; } + @media print { + .visible-print-block { + display: block !important; } } + +.visible-print-inline { + display: none !important; } + @media print { + .visible-print-inline { + display: inline !important; } } + +.visible-print-inline-block { + display: none !important; } + @media print { + .visible-print-inline-block { + display: inline-block !important; } } @media print { .hidden-print { - display: none !important; - } -} - + display: none !important; } } * { - -webkit-font-smoothing: antialiased; -} + -webkit-font-smoothing: antialiased; } -html { +html, body { height: 100%; font-family: 'SourceSansProRegular'; scrollbar-width: thin; - scrollbar-color: #315a71 #e3e3e3; + scrollbar-color: #45565f #e3e3e3; background-color: #fff; } body { - height: 100%; - font-family: 'SourceSansProRegular'; - scrollbar-width: thin; - scrollbar-color: #315a71 #e3e3e3; - background-color: #fff; touch-action: manipulation; min-width: 320px; } .widget-sort-handle { - touch-action: none; -} + touch-action: none; } .page-head { top: 0; @@ -9555,7 +5717,7 @@ body { position: fixed; width: 100%; z-index: 2; - background-color: #172c38; + background-color:#172c38; border-bottom: 1px solid #171717; } @@ -9563,55 +5725,49 @@ body { height: calc(100% - 52px); padding-top: 52px; position: relative; - z-index: 1; - - > .row { - height: 100%; - } -} - -.page-content-head { - .container-fluid { - background-color: #FBFBFB; - margin-left: 20px; - margin-right: 20px; - border: 1px solid #b0b0b0; - border-radius: 0px; - min-height: 47px; - height: auto; - padding: 6px 14px 5px 14px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - } - - padding-bottom: 2px; - padding-top: 10px; - color: #000; -} + z-index: 1; } + .page-content > .row { + height: 100%; } +.page-content-head .container-fluid { + color:#000; + background-color: none; + margin-right: 20px; + margin-left: 20px; + border-bottom: 1px solid #aeaeae; + border-radius: 0px; + min-height: 46px; + height: 46px; + padding: 9px 14px 5px 0px; } -.content-box-head { - padding-bottom: 2px; +.page-content-head, .content-box-head { + padding-bottom: 5px; padding-top: 10px; - color: #000; + color:#000; } -.page-content-head .navbar-nav, .content-box-head .navbar-nav { - width: 100%; -} + .page-content-head .navbar-nav, .content-box-head .navbar-nav { + width: 100%; } + .page-content-head h1, .content-box-head h1, .page-content-head h2, .content-box-head h2, .page-content-head h3, .content-box-head h3 { + line-height: inherit; + margin: 0; } -.page-content-head h1, .content-box-head h1, .page-content-head h2, .content-box-head h2, .page-content-head h3, .content-box-head h3 { - line-height: inherit; - margin: 0; +.page-content-head h1, content-box-head h1 { + padding-left: 10px; + padding-right: 10px; + color: #000; + text-decoration-line: none; + font-weight: bold; + text-transform: uppercase; } .page-content-main { min-height: calc(100% - 64px); - padding: 9px 0px 21px 0px; + padding: 6px 0px 21px 0px; } .page-side { background: #172c38; - border: none; + border:none; height: 100% !important; height: calc(100% - 52px) !important; left: 0; @@ -9619,13 +5775,11 @@ body { margin-top: 52px; position: fixed; top: 0; - z-index: 3; -} + z-index: 3; } .page-side-nav--active { background: #F7F7F7; - border-left: 3px solid #FF8B00; -} + border-left: 3px solid #FF8B00; } .page-foot { bottom: 0; @@ -9636,7 +5790,7 @@ body { position: fixed; height: 20px; background: #172c38; - color: #FFF; + color:#FFF; border-top: 1px solid #162b36; } @@ -9644,565 +5798,392 @@ body { padding: 0px 0px; margin: 0px 0px; background: none; - border: 1px solid #b0b0b0; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - - hr { - border: none; - } -} - -.content-box-main { - padding-bottom: 15px; - padding-top: 15px; -} - + border: 1px solid #a8a8a8; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); } +.content-box hr { + border:none; } + .content-box-main { + padding-bottom: 15px; + padding-top: 15px; } .tab-content { - padding: 0px 0px; - margin: 0px 0px; - - > .tab-content { - padding: 0 15px; - } - - .tab-content:last-child { - margin-bottom: 0; - } -} + padding: 0px 0px; + margin: 0px 0px; } + .tab-content > .tab-content { + padding: 0 15px; } + .tab-content .tab-content:last-child { + margin-bottom: 0; } .page-content-main section[class^="col-"] + section[class^="col-"] { - padding-top: 20px; -} + padding-top: 20px; } .brand-logo { - display: none; -} - -@media (min-width: 768px) { - .brand-logo { - display: inline-block; - } -} + display: none; } + @media (min-width: 768px) { + .brand-logo { + display: inline-block; } } .brand-icon { - display: inline-block; -} - -@media (min-width: 768px) { - .brand-icon { - display: none; - } -} + display: inline-block; } + @media (min-width: 768px) { + .brand-icon { + display: none; } } @media (min-width: 768px) { .col-sm-disable-spacer { - padding-top: 0 !important; - } -} + padding-top: 0 !important; } } @media (min-width: 992px) { .col-md-disable-spacer { - padding-top: 0 !important; - } -} + padding-top: 0 !important; } } @media (min-width: 1200px) { .col-lg-disable-spacer { - padding-top: 0 !important; - } -} + padding-top: 0 !important; } } .page-login { - background: #172c38; - - .container { + background: #FFF; } + .page-login .container { min-height: 100%; - margin-bottom: -60px; - - &:after { - height: 60px; - } - } - - .login-foot { - color: #FFF; - } -} + margin-bottom: -60px; } + .page-login .container:after { + height: 60px; } +.page-login .login-foot {color:#FFF;} .login-foot { - font-size: 12px; -} + font-size: 12px; + max-width: 400px; + margin: 0px auto 0px auto; + background-color: #172c38;} .login-modal-container { - color: #FFF; - border: 1px solid #fff; + color:#FFF; + border: none; max-width: 400px; - margin: 100px auto 15px auto; -} - + margin: 100px auto 0px auto; + background-color: #172c38;} .login-modal-head { height: 75px; - padding: 0 20px; -} - + padding: 0 20px; } .login-modal-content { - padding: 20px 20px 20px 20px; -} - + padding: 20px 20px 20px 20px; } .login-modal-foot { border-top: 1px solid #E5E5E5; height: 60px; - padding: 20px 20px 0 20px; - - a { + padding: 20px 20px 0 20px; } + .login-modal-foot a { color: #7D7D7D; - text-decoration: none; - - &:hover { + text-decoration: none; } + .login-modal-foot a:hover { color: #646464; - text-decoration: underline; - } - } -} + text-decoration: underline; } @media (min-width: 768px) { .list-inline .btn-group-container { - float: right; - } -} + float: right;} } .btn.btn-fixed { max-width: 174px; - width: 100%; -} + width: 100%; } .progress-bar-placeholder { font-size: 12px; position: absolute; text-align: center; width: 100%; - z-index: 1; -} + z-index: 1; } /* BOOTSTRAP EDIT */ - .list-group-item { border-left: none; - border-right: none; - - &.collapsed .caret { + border-right: none; } + .list-group-item.collapsed .caret { border-bottom: 4px solid green; - border-top: 0; - } -} - + border-top: 0; } /* BOOTSTRAP EDIT END */ /* COLLAPSE SIDEBAR */ - main.page-content.col-lg-12 { padding-left: 90px; } #navigation.col-sidebar-left { - width: 70px; + width:70px; background-color: transparent !important; overflow: hidden; +} - > div { - &.row { - height: 100% !important; - - > nav.page-side-nav { - width: 70px; - background-color: #172c38 !important; - height: 100% !important; - border-right: 1px solid #162b36; - } - } - - > nav > #mainmenu > div > { - a.list-group-item { - font-size: 14px; - text-align: center; - - > span { - &.fa, &.glyphicon { - visibility: visible; - font-size: 20px; - } - - &.__iconspacer { - width: 50px; - height: 25px; - padding: 0px; - } - } - - width: 70px; - height: 70px; - padding-left: 0px; - padding-right: 0px; - padding-top: 15px; - border-bottom: 2px solid #1b313e; - } - - div { - &.collapsing > a.list-group-item { - padding-left: 10px !important; - font-size: 14px !important; - display: block !important; - position: absolute !important; - left: 70px !important; - } - - &.collapse.in > div.collapsing > a.list-group-item { - padding-left: 10px !important; - font-size: 14px !important; - display: block !important; - position: absolute !important; - left: 166px !important; - } - } - - a.list-group-item.active-menu-title { - color: #000 !important; - background-color: #FFF !important; - } - } - } +#navigation.col-sidebar-left > div.row { + height:100% !important; } -a.list-group-item.active-menu-title.collapsed { - color: #000 !important; - background-color: #FFF !important; +#navigation.col-sidebar-left > div.row > nav.page-side-nav { + width:70px; + background-color:#172c38 !important; + height:100% !important; + border-right: 1px solid #162b36; } -#navigation.col-sidebar-left > div > nav > #mainmenu > div > { - a.list-group-item[aria-expanded="true"] { - color: #000 !important; - background-color: #FFF !important; - } - - div { - &.collapse { - &.in { - > { - a.list-group-item[aria-expanded="true"], div.collapse.in > a.list-group-item.menu-level-3-item.active { - color: #000 !important; - background-color: #FFF !important; - } - } - - > div.collapse.in > a.list-group-item { - padding-left: 10px !important; - font-size: 14px !important; - background-color: #294c5f !important; - opacity: 0.98; - } - } - - > a.list-group-item { - padding-left: 10px !important; - font-size: 14px !important; - background-color: #294c5f !important; - opacity: 0.98; - } - - > div.collapse > a.list-group-item { - padding-left: 10px !important; - font-size: 14px !important; - } - } - - &.collapsed > a.list-group-item { - padding-left: 10px !important; - font-size: 14px !important; - } - - &.collapse { - > { - a.list-group-item, div.collapse > a.list-group-item { - padding: 3px 8px !important; - } - } - - &.in > div.collapse.in > a.list-group-item:hover { - text-decoration: none !important; - color: #000 !important; - background-color: #FFF !important; - } - } - } +#navigation.col-sidebar-left > div > nav > #mainmenu > div > a.list-group-item { + font-size:14px; + text-align:center; } -a.list-group-item:focus { - text-decoration: none !important; - color: #000 !important; - background-color: #FFF !important; +#navigation.col-sidebar-left > div > nav > #mainmenu > div > a.list-group-item > span.fa, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > a.list-group-item > span.glyphicon { + visibility: visible; + font-size:20px; } -#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > a.list-group-item { - &.active-menu-title, &:hover { - color: #000 !important; - background-color: #FFF !important; - } +#navigation.col-sidebar-left > div > nav > #mainmenu > div > a.list-group-item > span.__iconspacer { + width:50px; + height:25px; + padding:0px; +} + +#navigation.col-sidebar-left > div > nav > #mainmenu > div > a.list-group-item { + width: 70px; + height: 70px; + padding-left: 0px; + padding-right: 0px; + padding-top:15px; + border-bottom:2px solid #515151; } -a.list-group-item:focus { +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapsing > a.list-group-item { + padding-left: 10px !important; + font-size:14px !important; + display: block !important; + position: absolute !important; + left: 70px !important; +} + +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapsing > a.list-group-item { + padding-left: 10px !important; + font-size:14px !important; + display: block !important; + position: absolute !important; + left: 166px !important; +} + +#navigation.col-sidebar-left > div > nav > #mainmenu > div > a.list-group-item.active-menu-title, a.list-group-item.active-menu-title.collapsed, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > a.list-group-item[aria-expanded="true"], +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > a.list-group-item[aria-expanded="true"], +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapse.in > a.list-group-item.menu-level-3-item.active { color: #000 !important; background-color: #FFF !important; } -#navigation.col-sidebar-left > div > nav > #mainmenu > div > div { - &.collapse.in > a.list-group-item { - &.collapsed:focus, &:focus { - color: #000 !important; - background-color: #FFF !important; - } - } +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse > a.list-group-item, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapse.in > a.list-group-item { + padding-left: 10px !important; + font-size:14px !important; + background-color: #172c38 !important; + opacity: 0.98; +} - &.active-menu.collapse.in > a.list-group-item.active { - color: #000 !important; - background-color: #FFF !important; - } +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse > div.collapse > a.list-group-item, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapsed > a.list-group-item { + padding-left: 10px !important; + font-size:14px !important; +} - &.collapse.in { - width: 168px; - font-size: 14px; - z-index: 10; - position: absolute; - left: 70px; - margin-top: -70px; - border: 1px solid #1f3a4a; - -webkit-box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.5); - box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.5); - - > div.collapse.in { - width: 168px; - font-size: 14px; - z-index: 10; - position: absolute; - left: 166px; - margin-top: -26px; - border: 1px solid #1f3a4a; - -webkit-box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.5); - box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.5); - } - } - - &.collapsing, &.collapse.in > div.collapsing { - display: none; - } +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse > a.list-group-item, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse > div.collapse > a.list-group-item { + padding: 3px 8px !important; +} + +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapse.in > a.list-group-item:hover, a.list-group-item:focus { + text-decoration: none !important; + color: #000 !important; + background-color: #FFF !important; +} + +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > a.list-group-item.active-menu-title, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > a.list-group-item:hover, a.list-group-item:focus, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > a.list-group-item.collapsed:focus, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > a.list-group-item:focus, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.active-menu.collapse.in >a.list-group-item.active { + color: #000 !important; + background-color: #FFF !important; } /* Sub Level One */ +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in { + width:168px; + font-size:13px; + z-index: 10; + position: absolute; + left: 70px; + margin-top:-70px; + border:1px solid #1f3a4a; + -webkit-box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.50); + -moz-box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.50); + box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.50); +} /* Sub Level Two */ +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapse.in { + width:168px; + font-size:13px; + z-index: 10; + position: absolute; + left: 166px; + margin-top:-26px; + border:1px solid #1f3a4a; + -webkit-box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.50); + -moz-box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.50); + box-shadow: 5px 5px 6px 0px rgba(0, 0, 0, 0.50); +} + +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapsing, +#navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapsing { + display:none; +} button.toggle-sidebar { - color: #FFF; - background-color: transparent; - font-size: 14px; - border: none; + color:#FFF; + background-color:transparent; + font-size:14px; + border:none; margin-top: 18px; - float: left; - outline: none; + float:left; + outline:none; } /* COLLAPSE SIDEBAR END*/ #navigation.collapse.in { - display: block !important; -} + display: block !important; } -.list-group-submenu .list-group-item:last-child, .collapse .list-group-item:last-child { - border-bottom: none; -} +.list-group-submenu .list-group-item:last-child, +.collapse .list-group-item:last-child { + border-bottom: none; } -.dropdown-menu > li > a, .dropdown-header { - padding: 3px 10px; -} +.dropdown-menu > li > a, +.dropdown-header { + padding: 3px 10px; } -.nav-tabs { - > { - li { - border-radius: 0px; - border-top-right-radius: 10px; - margin-right: 2px; - - > a { - border-radius: 0px; - border-top-right-radius: 10px; - margin-right: 0px; - -webkit-box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.6); - box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.6); - } - } - - .dropdown > a { - -webkit-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.6); - box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.6); - - &.pull-right { - -webkit-box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.6); - box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.6); - } - } - - li { - > a { - outline: 0; - - &:hover, &:focus { - outline: 0; - } - } - - &.active > a { - background: #315a71 !important; - outline: 0; - } - - > a.visible-lg-inline-block { - &:not(.pull-right) { - border-top-right-radius: 0px !important; - padding-left: 10px !important; - padding-right: 5px !important; - } - - &.pull-right { - border-left: 0px !important; - padding-left: 5px !important; - padding-right: 10px !important; - } - } - } - } - - &.nav-justified { - border-right: 1px solid #656565; - - > li { - border-bottom: 1px solid #656565; - border-top: 1px solid #656565; - border-left: 1px solid #656565; - border-radius: 0px; - background: #818180; - - > a { - color: #FFFFFF; - font-family: 'SourceSansProSemibold'; - } - } - } -} +.nav-tabs > li { + border-radius: 0px; + border-top-right-radius: 10px; + margin-right: 2px; } -@media (min-width: 768px) { - .nav-tabs.nav-justified > li > a { - border-bottom: 1px solid transparent; - } -} +.nav-tabs > li > a { + border-radius: 0px; + border-top-right-radius: 10px; + margin-right: 0px; + -webkit-box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.60); + -moz-box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.60); + box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.60); } + +.nav-tabs > .dropdown > a { + -webkit-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.60); + -moz-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.60); + box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.60); } + +.nav-tabs > .dropdown > a.pull-right { + -webkit-box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.60); + -moz-box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.60); + box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.60); } + +.nav-tabs > li > a, +.nav-tabs > li > a:hover, +.nav-tabs > li > a:focus { + outline:0; + font-weight: 100; } + +.nav-tabs > li.active > a { + background: #172c38 !important; + outline:0; + font-weight: 100; } + +.nav-tabs > li > a.visible-lg-inline-block:not(.pull-right) { + border-top-right-radius: 0px !important; + padding-left: 10px !important; + padding-right: 5px !important; } + +.nav-tabs > li > a.visible-lg-inline-block.pull-right { + border-left: 0px !important; + padding-left: 5px !important; + padding-right: 10px !important; } -@media (max-width: 767px) { - .nav-tabs.nav-justified > li.active > a { - border-right: 0 !important; - } -} +.nav-tabs.nav-justified { + border-right: 1px solid #656565; } + .nav-tabs.nav-justified > li { + border-bottom: 1px solid #656565; + border-top: 1px solid #656565; + border-left: 1px solid #656565; + border-radius: 0px; + background: #818180; } + .nav-tabs.nav-justified > li > a { + color: #FFFFFF; + font-family: 'SourceSansProSemibold'; } + @media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid transparent; } } + @media (max-width: 767px) { + .nav-tabs.nav-justified > li.active > a { + border-right: 0 !important; } } @media (min-width: 768px) { > li.active + li > a { - border-left: 1px solid transparent; - } -} + border-left: 1px solid transparent; } } > li:last-child > a { - border-right: 1px solid transparent !important; -} - -@media (max-width: 767px) { - > li:last-child > a { - margin-bottom: 0; - } -} + border-right: 1px solid transparent !important; } + @media (max-width: 767px) { + > li:last-child > a { + margin-bottom: 0; } } .btn .glyphicon { - vertical-align: -1px; -} - + vertical-align: -1px; } +.table { width:100%; } .table { - width: 100%; - margin-bottom: 0px !important; -} + margin-bottom: 0px !important; } -.nav-tabs-justified .nav-tabs.nav-justified > .active > a:focus, .nav-tabs.nav-justified .nav-tabs.nav-justified > .active > a:focus { - border: 0px !important; -} +.nav-tabs-justified .nav-tabs.nav-justified > .active > a:focus, .nav-tabs.nav-justified .nav-tabs.nav-justified > .active > a:focus, .nav-tabs.nav-justified .nav-tabs.nav-justified > .active > a:focus { + border: 0px !important; } .table th, strong, b { - font-family: 'SourceSansProSemibold'; - font-weight: normal; -} + font-weight: 100; } .table > tbody > tr > td:last-child { - padding-right: 15px; -} + padding-right: 5px; } /* helpers */ - .__nowrap { - white-space: nowrap; -} + white-space: nowrap; } .__nomb { - margin-bottom: 0; -} + margin-bottom: 0; } .__mb { - margin-bottom: 15px; -} + margin-bottom: 15px; } .__mt { - margin-top: 15px; -} + margin-top: 15px; } .__ml { - margin-left: 15px; -} + margin-left: 15px; } .__mr { - margin-right: 15px; -} + margin-right: 15px; } .__iconspacer { - padding-right: 10px; -} + padding-right: 10px; } #mainmenu .glyphicon { - vertical-align: -2px; -} + vertical-align: -2px; } .list-group-item { overflow: hidden; - text-overflow: ellipsis; - - + div { - &.collapse { - margin-bottom: -1px; - } - - > a { - padding-left: 44px; - } - } - - &:before { + text-overflow: ellipsis; } + .list-group-item + div.collapse { + margin-bottom: -1px; } + .list-group-item + div > a { + padding-left: 44px; } + .list-group-item:before { background: #FF8B00; content: ""; height: 42px; @@ -10214,51 +6195,32 @@ button.toggle-sidebar { -webkit-transition: width .2s; -moz-transition: width .2s; -o-transition: width .2s; - transition: width .2s; - } -} + transition: width .2s; } .list-group-submenu a { - padding-left: 56px; -} + padding-left: 56px; } .active-menu-title, .active-menu a { text-decoration: none; position: relative; - background-color: #30596F; -} - -.active-menu-title:before, .active-menu a:before { - width: 3px; -} - -.active-menu-title.active { - background-color: #fff; - color: #000; -} - -.active-menu a { - &.active { - background-color: #fff; - color: #000; - } + background-color: #24323a; } + .active-menu-title:before, .active-menu a:before { + width: 3px; } + .active-menu-title.active, .active-menu a.active { + background-color: #fff; + color: #000; } - &:before { - background: #FF8B00; - } -} +.active-menu a:before { + background: #FF8B00; } .alert.alert-danger { - color: #FFF !important; -} + color: #FFF !important; } -.nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a { - border-radius: 0 !important; -} +.nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a, .nav-tabs.nav-justified > li > a { + border-radius: 0 !important; } .navbar-brand { - padding: 10px 20px; -} + padding: 10px 20px; } .label-opnsense { /* emulates btn */ @@ -10267,150 +6229,110 @@ button.toggle-sidebar { font-size: 12px; line-height: 1.5; border-radius: 3px; - border-color: #323232; -} + border-color: #323232;} .label-opnsense-sm { /* emulates btn-sm */ padding: 6px 11px; - border-color: #323232; -} + border-color: #323232;} .label-opnsense-xs { /* emulates btn-xs */ padding: 2px 5px; - border-color: #323232; -} + border-color: #323232;} ::-webkit-scrollbar { - width: 8px; -} + width: 8px; } ::-webkit-scrollbar-button { width: 8px; - height: 0px; -} + height: 0px; } ::-webkit-scrollbar-track { background: #e3e3e3; box-shadow: 0px 0px 0px; - border-radius: 0; -} + border-radius: 0; } ::-webkit-scrollbar-thumb { - background: #315a71; + background: #172c38; border: thin solid #e5e5e5; - border-radius: 0px; + border-radius: 0px; } - &:hover { - background: #ec6d12; - } -} +::-webkit-scrollbar-thumb:hover { + background: #ec6d12; } .widgetdiv { padding-top: 0px !important; - padding-bottom: 20px; -} + padding-bottom: 20px; } select { overflow: hidden; border: 1px solid #1d1d1d; - background-color: #427795; - color: #FFF; + background-color: #f0f0f0; + color: #000; -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; background-repeat: no-repeat; background-position: right; - background-image: url(/ui/themes/tukan/build/images/caret.png) !important; - - &:hover, &:active, &:focus { - overflow: hidden; - border: 1px solid #1d1d1d; - background-color: #336480; - color: #FFF; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - cursor: pointer; - background-repeat: no-repeat; - background-position: right; - background-image: url(/ui/themes/tukan/build/images/caret.png) !important; - } -} + background-image: url(/ui/themes/tukan/build/images/caret.png) !important; } -option { - &:hover, &:active, &:focus { - background-color: #FF7E25; - } -} +select:hover, select:active, select:focus { + overflow: hidden; + border: 1px solid #1d1d1d; + background-color: #f0f0f0; + color: #000; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + cursor: pointer; + background-repeat: no-repeat; + background-position: right; + background-image: url(/ui/themes/tukan/build/images/caret.png) !important; } -#grid-log th[data-column-id="__timestamp__"], #filter-log-entries th[data-column-id="__timestamp__"] { - min-width: 3.5em; -} +option:hover, option:active, option:focus { + background-color:#FF6E05; + } +#grid-log th[data-column-id="__timestamp__"], +#filter-log-entries th[data-column-id="__timestamp__"] { + min-width: 3.5em; } #grid-top { - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); -} + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); } @media screen and (max-width: 767px) { .table-responsive { - margin-bottom: 0; - - > .table > { - thead > tr > { - th, td { - white-space: normal; - } - } - - tbody > tr > { - th, td { - white-space: normal; - } - } - - tfoot > tr > { - th, td { - white-space: normal; - } - } - } - } -} - -label > input { - &[type="checkbox"], &[type="radio"] { - margin-right: .4em; - float: left; - } -} - -#log-settings { - label[for^="act"] { - margin-right: 1.5em; - } - - table > tbody > tr > td { - vertical-align: middle; - } - - select { - &#filterlogentries, &#filterlogentriesupdateinterval { - width: 5em; - } - - &#filterlogentriesinterfaces { - min-width: 100%; - max-width: 100%; - } - } -} + margin-bottom: 0; } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > tfoot > tr > td { + white-space: normal; } } + +label > input[type="checkbox"], +label > input[type="radio"] { + margin-right: .4em; + float: left; } + +#log-settings label[for^="act"] { + margin-right: 1.5em; } + +#log-settings table>tbody>tr>td { + vertical-align: middle; } + +#log-settings select#filterlogentries, +#log-settings select#filterlogentriesupdateinterval { + width: 5em; } + +#log-settings select#filterlogentriesinterfaces { + min-width: 100%; + max-width: 100%; } /* fields in firewall schedule */ - [data-state="lightcoral"] { background-color: #ffe83e; } @@ -10423,64 +6345,50 @@ label > input { background-color: #ffe83e; } -#ipsec { - #ipsec-mobile, #ipsec-tunnel, #ipsec-overview { - background-color: #f0f0f0 !important; - } - - .ipsec-tab { - background-color: #839caa !important; - color: #FFF !important; +#ipsec #ipsec-mobile, #ipsec #ipsec-tunnel, #ipsec #ipsec-overview { + background-color: #f0f0f0 !important; +} - &.activetab { - background-color: #315a71 !important; - color: #FFF !important; - } - } +#ipsec .ipsec-tab { + background-color: #45565f !important; + color: #FFF !important; } +#ipsec .ipsec-tab.activetab { + background-color: #172c38 !important; + color: #FFF !important; +} .fw_pass { background-color: #295f2b !important; - color: #FFF; + color:#FFF; } - .fw_block { - background-color: #CB4326 !important; - color: #FFF; + background-color: #A22626 !important; + color:#FFF; } - .fw_nat { background-color: #CBA026 !important; - color: #FFF; + color:#FFF; } - -/*additional extensions for theme-tukan*/ + /*additional extensions for theme-tukan*/ #tab_1 #maintabs { border-bottom: 1px solid #b0b0b0; } -textarea#update_status { - color: inherit !important; - -webkit-box-shadow: none !important; - box-shadow: none !important; - border: none !important; - - &:hover { - color: inherit !important; - -webkit-box-shadow: none !important; - box-shadow: none !important; - border: none !important; - } +textarea#update_status, textarea#update_status:hover { + color:inherit !important; + -webkit-box-shadow:none !important; + box-shadow:none !important; + border:none !important; } .fa-toggle-off::before { - color: #FF8B00 !important; - outline: none !important; -} + color:#FF8B00 !important; + outline:none !important; } .fa-toggle-on::before { - outline: none !important; + outline:none !important; } .fa-search::before, .glyphicon-search::before { @@ -10488,7 +6396,7 @@ textarea#update_status { } .glyphicon.glyphicon-search::before { - color: #000 !important; + color:#000 !important; } .fa-times-circle::before { @@ -10500,42 +6408,30 @@ textarea#update_status { content: "\f059"; cursor: pointer; } - .fa-refresh::before { content: "\f021"; } -.bootgrid-header .search .glyphicon, .bootgrid-footer .search .glyphicon, .input-group-addon { +.bootgrid-header .search .glyphicon, .bootgrid-footer .search .glyphicon,.input-group-addon { top: 0; - background-color: #FF7E25 !important; - border: 1px solid #FF7E25 !important; + background-color: #FF6E05 !important; + border: 1px solid #FF6E05 !important; } -div.container-fluid > { - .fa-search::before, .fa-refresh::before { - color: #FFFFFF !important; - } -} +div.container-fluid >.fa-search::before, div.container-fluid >.fa-refresh::before { + color: #FFFFFF !important; } -.panel-heading h3:hover { +.panel-heading h3:hover, h3:focus { color: #FFFFFF; text-decoration: none; } -h3 { - &:focus { - color: #FFFFFF; - text-decoration: none; - } - - &:link { - color: #FFFFFF; - text-decoration: underline; - } +h3:link { + color:#FFFFFF;text-decoration: underline; +} - &:hover, &:focus { - text-decoration: underline; - } +h3:hover, h3:focus { + text-decoration: underline; } #grid-log { @@ -10543,67 +6439,32 @@ h3 { } .table-condensed.table-hover { - border: 1px solid #bdbdbd; + border: 1px solid #bdbdbd; } #rules.table-condensed.table-hover { - border: none; -} - -.btn-group.bootstrap-select { - &.open, &:hover { - border-color: #323232 !important; - color: #FFFFFF !important; - } + border: none; } -.glyphicon { - &.glyphicon-play.text-muted, &.glyphicon-remove.text-muted, &.glyphicon-remove-sign.text-muted, &.glyphicon-info-sign.text-muted { - color: #000 !important; - } +.btn-group.bootstrap-select.open, .btn-group.bootstrap-select:hover { + border-color: #323232 !important; + color:#FFFFFF !important; } -.fa { - &.fa-exclamation.fa-fw.text-muted, &.fa-arrows-h.fa-fw.text-muted { - color: #000 !important; - } - - &.fa-long-arrow-left { - color: #000 !important; - - &::before { - color: #000 !important; - } - } - - &.fa-info-circle.text-muted { - color: #000 !important; - } - - &.fa-times-circle.text-muted, &.fa-times.text-muted { - color: #000 !important; - - &::before { - color: #000 !important; - } - } - - &.fa-play.text-muted::before { - color: #000 !important; - } +.glyphicon.glyphicon-play.text-muted, .glyphicon.glyphicon-remove.text-muted, .glyphicon.glyphicon-remove-sign.text-muted, .glyphicon.glyphicon-info-sign.text-muted,.fa.fa-exclamation.fa-fw.text-muted,.fa.fa-arrows-h.fa-fw.text-muted,.fa.fa-long-arrow-left,.fa.fa-long-arrow-left::before,.fa.fa-info-circle.text-muted,.fa.fa-times-circle.text-muted,.fa.fa-times-circle.text-muted::before,.fa.fa-times.text-muted,.fa.fa-times.text-muted::before,.fa.fa-play.text-muted::before { + color: #000 !important; } #system_log-widgets.content-box { - border: none; - box-shadow: none; + border:none; box-shadow: none; } -#chart, #chart_intf_in, #chart_intf_out, #chart_top_ports, #chart_top_sources, #traffic_graph_widget_chart_in, #traffic_graph_widget_chart_out { +#chart,#chart_intf_in,#chart_intf_out,#chart_top_ports,#chart_top_sources,#traffic_graph_widget_chart_in,#traffic_graph_widget_chart_out { background-color: #FFF; border: 1px solid #b0b0b0; } -/*additional extensions for sensei*/ + /*additional extensions for sensei*/ .preloader-wrapper { background-color: #e3e3e3 !important; @@ -10619,67 +6480,67 @@ h3 { box-shadow: none !important; } -input[type="checkbox"] { - &.checkbox-switch + i::before, &.checkbox-icon + i::before { - color: #CB4326 !important; - } - - &.checkbox-switch { - + i::before { - color: #CB4326 !important; - } - - &:checked + i::before { - color: #4FB654 !important; - } - } - - &.checkbox-icon:checked + i::before, &.checkbox-icon-2:checked + i::before { - color: #4FB654 !important; - } +input[type="checkbox"].checkbox-switch + i::before, input[type="checkbox"].checkbox-icon + i::before, input[type="checkbox"].checkbox-switch + i::before { + color: #CB4326 !important; +} + +input[type="checkbox"].checkbox-switch:checked + i::before, input[type="checkbox"].checkbox-icon:checked + i::before, input[type="checkbox"].checkbox-icon-2:checked + i::before { + color: #4FB654 !important; } .modal-header > span { color: #000; } -.bootstrap-datetimepicker-widget { - table td span:hover { +.bootstrap-datetimepicker-widget table td span:hover { background: none !important; - } +} - background-color: #FF7E25 !important; +.bootstrap-datetimepicker-widget { + background-color:#FF6E05 !important; } -.modal-side { - > .p-15 { - padding-left: 10px; - padding-right: 10px; - padding-top: 3px; - padding-bottom: 1px; - border-bottom: 1px solid #4a4a4a; - min-height: 16.42857px; - background-color: #427795; - color: #FFF; - } +.modal-side > .p-15 { + padding-left: 10px; + padding-right: 10px; + padding-top: 3px; + padding-bottom: 1px; + border-bottom: 1px solid #4a4a4a; + min-height: 16.42857px; + background-color: #45565f; + color: #FFF; +} +.modal-side { margin: 62px 10px 10px 10px; background-color: #f0f0f0 !important; } .panel-report-tools:hover { - color: #fff !important; + color: #FFF !important; } .alert-primary { - background-color: none !important; + background-color:none !important; color: #000 !important; } label.btn.au-target { - color: #FFF !important; + color: #000 !important; } .table.border { border: 1px solid #bdbdbd; } + +.rule.text-muted > td:nth-child(1n+3) { + text-decoration: line-through; +} + +.rule.text-muted > td:last-child { + text-decoration:none; +} + +#reports-tab { + border-bottom: 1px solid #a5a5a5; +} diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/tokenizer2.scss b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/tokenizer2.scss index bf8dfa8901..831c175858 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/tokenizer2.scss +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/tokenizer2.scss @@ -7,29 +7,34 @@ min-height: 34px; cursor: text; border-radius: 3px; - border: 1px solid #4d83a1; + border: 1px solid #a8a8a8; background-color: #ffffff; + &.disabled { background-color: #eee; cursor: not-allowed; } } + &.focus > .tokens-container { outline: 0; - border-color: #4d83a1; + border-color: #a8a8a8; background-color: #FFFFFF; -webkit-box-shadow: none; box-shadow: none; } + > .tokens-container { &.input-sm { padding: 0 0 4px 4px; min-height: 30px; } + &.input-lg { padding: 0 0 9px 9px; min-height: 46px; } + > { .token { padding: 0 1.2em 0 5px; @@ -43,6 +48,7 @@ position: relative; vertical-align: middle; } + .placeholder, .token-search { display: inline-block; margin: 5px 5px 0 0; @@ -51,35 +57,42 @@ } } } + &.sortable > .tokens-container > .token { cursor: move; } + &.single > .tokens-container > .token { display: block; border-color: #fff; background-color: transparent; } + &.sortable > .tokens-container > .token.shadow { border-color: #ccc; background-color: #ccc; filter: alpha(opacity = 50); opacity: .2; } + > .tokens-container { > { .placeholder { color: #c9c9c9; padding: 0; } + .token-search { color: #000; padding: 0; } } + &:focus, &:hover { - border-color: #00A7FF; + border-color: #FF6E05; background-color: #FFFFFF; } + > .token-search > input { padding: 0; margin: 0; @@ -88,35 +101,42 @@ border: none; outline: none; width: 100%; + &::-ms-clear { display: none; } } + &.input-sm > { .placeholder, .token-search, .token { margin: 4px 4px 0 0; } } + &.input-lg > { .placeholder, .token-search, .token { margin: 9px 9px 0 0; } } + > .token { &.pending-delete { background-color: #5b72a4; border-color: #425c96; color: #fff; + > .dismiss { color: #fff; } } + > .dismiss { position: absolute; right: 5px; color: #a9b9d8; text-decoration: none; cursor: pointer; + &:after { content: "×"; color: #000; @@ -129,6 +149,7 @@ .tokenize-dropdown { position: absolute; display: none; + > .dropdown-menu { min-height: 10px; width: 100%; @@ -136,11 +157,14 @@ margin: -1px 0 0 0; visibility: visible; opacity: 1; + li { cursor: pointer; + > a .tokenize-highlight { font-weight: bold; } + &.locked { padding: 3px 20px; color: #333; @@ -148,10 +172,12 @@ text-overflow: ellipsis; overflow-x: hidden; } + > a { text-overflow: ellipsis; overflow-x: hidden; } + &:not(.active) a { &:hover, &:focus { background-color: transparent; diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select-1.13.3.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select-1.13.3.css index d8cfa48d25..01c6683218 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select-1.13.3.css +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select-1.13.3.css @@ -25,7 +25,7 @@ select.selectpicker { .bootstrap-select > .dropdown-toggle.bs-placeholder:hover, .bootstrap-select > .dropdown-toggle.bs-placeholder:focus, .bootstrap-select > .dropdown-toggle.bs-placeholder:active { - color: #fff; + color: #000; } .bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary, .bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary, diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/jquery.bootgrid.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/jquery.bootgrid.css index 7f871447e6..3440c283d3 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/jquery.bootgrid.css +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/jquery.bootgrid.css @@ -39,8 +39,8 @@ } .bootgrid-header .actionBar .btn-group > .btn-group .dropdown-menu, .bootgrid-footer .infoBar .btn-group > .btn-group .dropdown-menu { - color: #fff; - background-color: #30596f; + color: #000; + background-color: #f0f0f0; border-color: #1d1d1d; text-align: left; } @@ -95,6 +95,7 @@ -o-text-overflow: ellipsis; text-overflow: ellipsis; white-space: nowrap; + color:#FFF; } .bootgrid-table th > .column-header-anchor > .icon { color: #000; @@ -141,6 +142,7 @@ -o-text-overflow: inherit !important; text-overflow: inherit !important; white-space: inherit !important; + color: #FFF; } .table-responsive .bootgrid-table td { overflow: inherit !important; diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css index df4a0ea045..f99129bc81 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css @@ -1,13 +1,13 @@ @charset "UTF-8"; .widgetdiv .content-box-head { - background: #294c5f !important; + background: #354248 !important; color: #FFF !important; padding-bottom: 1px !important; padding-top: 1px !important; padding-right: 1px !important; - padding-left: 5px !important; + padding-left: 4px !important; min-height: 25px !important; - border: 1px solid #fff; } + border: 1px solid #2f2f2f; } .widgetdiv .content-box-head .btn-group .btn { color: #FFFFFF !important; @@ -27,6 +27,7 @@ @font-face { font-family: 'SourceSansProRegular'; src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf") format("truetype"); } + /*! normalize.css v3.0.1 | MIT License | git.io/normalize */ table html { @@ -67,7 +68,7 @@ template { display: none; } a { - color: #FF6C06; + color: #D95E04; text-decoration: none; background: transparent; outline: 0; } @@ -76,7 +77,7 @@ a { outline: 0; } a:hover, a:focus { - color: #FF6C06; + color: #D95E04; text-decoration: underline; } abbr[title] { @@ -90,7 +91,7 @@ dfn { font-style: italic; } h1 { - font-size: 2em; + font-size: 8em; margin: 0.67em 0; } mark { @@ -210,7 +211,7 @@ table { border-collapse: none; border-spacing: 0; color: #000; - background-color: #F0F0F0; + background-color: #fff; width: 100%; } td, @@ -924,7 +925,7 @@ html { body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; + font-size:14px; line-height: 1.428571429; color: #000; } @@ -996,7 +997,6 @@ hr { h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { - font-family: "SourceSansProSemiBold"; font-weight: 100; line-height: 1.4; color: inherit; } @@ -1051,22 +1051,23 @@ h6, .h6 { font-size: 75%; } h1, .h1 { - font-size: 23px; } + font-size: 24px; + font-weight: bold; } h2, .h2 { font-size: 16px; } h3, .h3 { - font-size: 14px; } + font-size:14px; } h4, .h4 { font-size: 18px; } h5, .h5 { - font-size: 14px; } + font-size:14px; } h6, .h6 { - font-size: 12px; } + font-size:12px; } p { margin: 0 0 10px; } @@ -1132,7 +1133,7 @@ a.text-success:hover { color: #7fc54f; } .text-info { - color: #47809f; } + color: #ff6e05; } a.text-info:hover { color: #245269; } @@ -1182,6 +1183,9 @@ a.bg-warning:hover { a.bg-danger:hover { background-color: #ec2121; } +fa.fa-long-arrow-right { + color: #d951ff !important; } + .page-header { padding-bottom: 9px; margin: 40px 0 20px; @@ -2036,7 +2040,7 @@ th { padding: 10px 0px 10px 20px; line-height: 1.428571429; vertical-align: top; - border-top: 1px solid #e3e3e3; } + border-top: 1px solid #f0f0f0; } .table > thead > tr > th { vertical-align: bottom; } .table > caption + thead > tr:first-child > th, @@ -2048,10 +2052,11 @@ th { border-top: 0; font-family: 'SourceSansProSemibold'; font-weight: normal; - border-bottom: 1px solid #bdbdbd; - background-color: #e3e3e3;} + border-bottom: 1px solid #5e5e5e; + background-color: #45565f; + color: #FFF;} .table > tbody + tbody { - border-top: 2px solid #eee; } + border-top: 2px solid #5e5e5e; } .table .table { background-color: none; } @@ -2078,11 +2083,12 @@ th { .table-striped > tbody > tr:nth-child(odd) > td, .table-striped > tbody > tr:nth-child(odd) > th { - background-color: #fbfbfb; } + background-color: #fff; } .table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th { - background-color:#f2fafe; } + background-color: #738087; + color: #FFF; } table col[class*="col-"] { position: static; @@ -2271,7 +2277,7 @@ input[type="checkbox"]:focus { output { display: block; padding-top: 7px; - font-size: 14px; + font-size:14px; line-height: 1.428571429; color: #000; } @@ -2296,12 +2302,12 @@ input[type="color"] width: 100%; height: 34px; padding: 6px 12px; - font-size: 14px; + font-size:14px; line-height: 1.428571429; color: #000; background-color: #FFF; background-image: none; - border: 1px solid #4d83a1; + border: 1px solid #1b4257; border-radius: 3px; text-overflow: ellipsis; max-width: 348px; @@ -2328,7 +2334,7 @@ input[type="color"] { color: #000; background-color: none; - border-color: #00A7FF; + border-color: #ff6e05; outline: 0; } select:focus, @@ -2349,10 +2355,10 @@ input[type="color"] input[type="color"]:focus { - color: #000; - border-color: #00A7FF; - background-color: none; - outline: 0; } + color: #000; + border-color: #FF6E05; + background-color: none; + outline: 0; } select::-moz-placeholder, textarea::-moz-placeholder, @@ -2464,7 +2470,7 @@ input[type="color"] background-color: #f0f0f0; opacity: 1.0; filter: alpha(opacity=100); - border-color: #4d83a1; + border-color: #a8a8a8; color:#a8a8a8;} select[disabled]:hover, select[readonly]:hover, fieldset[disabled]:hover, @@ -2887,26 +2893,26 @@ select[multiple].input-lg, background-image: none; white-space: nowrap; padding: 6px 12px; - font-size: 14px; + font-size:14px; line-height: 1.428571429; border-radius: 3px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; - color: #FFFFFF; - background-color: #457995; + color: #000; + background-color: none; border: 1px solid #1b4257; outline:0; } .btn:active, .btn.active, .open > .btn.dropdown-toggle { - color: #FFF; - background-color: #30596f; - outline:0; - border-color: #1d1d1d; - text-decoration: none; } + color: #000; + background-color: none; + outline:0; + border-color: #1d1d1d; + text-decoration: none; } .btn:hover, .btn:focus { - background-color: #315a71; - color: #FFF; + background-color: #dbdbdb; + color: #000; border-radius: 3px; border: 1px solid #1b4257; text-decoration: none;} @@ -2939,13 +2945,14 @@ select[multiple].input-lg, box-shadow: none; } .act_flush:hover, .act_flush:focus { - color: #FFF; - background-color: #336480; + color: #000; + background-color: #dbdbdb; border-color: 1px solid #1d1d1d; outline:0; } .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle { - background-image: none; + background-color: #dbdbdb; + color:#000; outline:0; } .btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled]:active, .btn-default[disabled].active, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active { background-color: #FFFFFF; @@ -2958,20 +2965,20 @@ select[multiple].input-lg, .btn-primary { color: #fff !important; - background-color: #FF7E25; - border: 1px solid #6c6c6c; + background-color: #FF6E05; + border: 1px solid #1b4257; outline:0; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle { color: #fff; background-color: #EC7726; - border-color: 1px solid #6c6c6c; + border-color: 1px solid #1b4257; outline:0; } .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle { background-image: none; } .btn-primary.disabled, .btn-primary.disabled:hover, .btn-primary.disabled:focus, .btn-primary.disabled:active, .btn-primary.disabled.active, .btn-primary[disabled], .btn-primary[disabled]:hover, .btn-primary[disabled]:focus, .btn-primary[disabled]:active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-primary:hover, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary:active, fieldset[disabled] .btn-primary.active { - background-color: #FF7E25; - border-color: #6c6c6c; + background-color: #FF6E05; + border-color: #1b4257; outline:0; } .btn-primary .badge { @@ -3019,7 +3026,7 @@ select[multiple].input-lg, .btn-warning { color: #fff; - background-color: #FF7E25; + background-color: #FF6E05; border-color: #1b4257; } .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle { color: #fff; @@ -3160,10 +3167,10 @@ tbody.collapse.in { padding: 5px 0; margin: 2px 0 0; list-style: none; - font-size: 14px; + font-size:14px; text-align: left; - background-color: #315a71; - color: #fff; + background-color: #f0f0f0; + color: #000; border-left: 1px solid #1b4257; border-right: 1px solid #1b4257; border-bottom: 1px solid #1b4257; @@ -3192,20 +3199,20 @@ tbody.collapse.in { clear: both; font-weight: normal; line-height: 1.428571429; - color: #fff; + color: #000; white-space: nowrap; outline:0;} .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { text-decoration: none; color: #FFFFFF; - background-color: #FF7E25; } + background-color: #FF6E05; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #fff; text-decoration: none; outline: 0; - background-color: #FF7E25; } + background-color: #FF6E05; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #777777; } @@ -3343,7 +3350,7 @@ tbody.collapse.in { .btn-group .dropdown-toggle:active, .btn-group .dropdown-toggle:hover, .btn-group.open .dropdown-toggle { outline: 0; - color: #FFFFFF; + color: #000; background-color: none; border-color: #000; } @@ -3468,7 +3475,7 @@ tbody.collapse.in { .input-group-addon { padding: 6px 12px; - font-size: 14px; + font-size:14px; font-weight: normal; line-height: 1; color: #FFF; @@ -3555,21 +3562,21 @@ tbody.collapse.in { border-radius: 0px; border-top-right-radius: 10px; margin-right: 0px; - background-color: #315a71; + background-color: #172c38; opacity: 0.6; filter: alpha(opacity=50);} .nav > li#menu_messages > a { position: relative; display: block; padding: none; - color:#FF7E25; + color:#FF6E05; background-color:transparent; margin-right: 10px; border:none; opacity: 1.0;} .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; - background-color: #315a71; + background-color: #172c38; color: #FFF; opacity: 0.8; } .nav > li#menu_messages > a:hover, a:focus { @@ -3585,8 +3592,8 @@ tbody.collapse.in { cursor: not-allowed; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { - background-color: #336480; - cursor:pointer; } + background-color: #172c38; + cursor:pointer; } .nav .nav-divider { height: 1px; @@ -3933,7 +3940,7 @@ tbody.collapse.in { .navbar-default .navbar-nav > li > a { color: #F7F7F7; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { - color: #FF7E25; + color: #FF6E05; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { @@ -4069,8 +4076,8 @@ tbody.collapse.in { padding: 6px 12px; line-height: 1.428571429; text-decoration: none; - color: #FFFFFF; - background-color: #427795; + color: #FFF; + background-color: #45565f; border: 1px solid rgba(23, 44, 56, 0.4); margin-left: -1px; cursor: pointer; } @@ -4087,7 +4094,7 @@ tbody.collapse.in { .pagination > li > span:hover, .pagination > li > span:focus { color: #FFFFFF; - background-color: #FF7E25; } + background-color: #FF6E05; } .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, @@ -4095,7 +4102,7 @@ tbody.collapse.in { .pagination > .active > span:focus { z-index: 2; color: #FFFFFF; - background-color: #FF7E25; + background-color: #FF6E05; cursor: default; } .pagination > .disabled > span, @@ -4211,7 +4218,7 @@ a.label:hover, a.label:focus { .label-success { - background-color: #4FB654; + background-color: #397E37; border-color: #323232;} .label-success[href]:hover, .label-success[href]:focus { background-color: #7fc54f; @@ -4250,7 +4257,7 @@ a.label:hover, a.label:focus { vertical-align: baseline; white-space: nowrap; text-align: center; - background-color: #777777; + background-color: #ff6e05; border-radius: 10px; } .badge:empty { display: none; } @@ -4392,8 +4399,8 @@ a.thumbnail.active { color: #df8a13; } .alert-danger { - background-color: #30596f; - border-color: #b0b0b0; } + background-color: #45565f; + border-color: #f00; } .alert-danger hr { border-top-color: #DA4829; } .alert-danger .alert-link { @@ -4414,30 +4421,25 @@ a.thumbnail.active { color: #000; overflow: hidden; height: 20px; - background-color: #DBDBDB; - border-radius: 3px; - position: relative; - -webkit-box-shadow: inset 0px 1px 2px 1px rgb(172, 172, 172); - box-shadow: inset inset 0px 1px 2px 1px rgb(172, 172, 172); } + background-color: #EAEAEA; + border: 1px solid #b9b9b9; + position: relative; } .progress-bar { float: left; width: 0%; height: 100%; font-size: 12px; - line-height: 20px; color: #fff; text-align: center; - background-color: #FF7E25; + background-color: #FF6E05; position: relative; z-index: 2; -webkit-box-shadow: inset 0 20px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 20px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; -o-transition: width 0.6s ease; - transition: width 0.6s ease; - margin: 1px 0 0 0 !important; -} + transition: width 0.6s ease; } .progress-striped .progress-bar, .progress-bar-striped { @@ -4469,7 +4471,7 @@ a.thumbnail.active { background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { - background-color: #038CCF; } + background-color: #45565f; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); @@ -4526,7 +4528,7 @@ a.thumbnail.active { display: block; padding: 6px 8px; margin-bottom: -1px; - background-color: #294c5f; } + background-color: #172c38; } .list-group-item:last-child { margin-bottom: 0; } .list-group-item > .badge { @@ -4685,7 +4687,7 @@ a.list-group-item-danger { border-bottom: 1px solid #b0b0b0; border-top-right-radius: 2px; border-top-left-radius: 2px; - background-color: #30596f; } + background-color: #45565f; } .panel-heading > .dropdown .dropdown-toggle { color: inherit; } @@ -5055,7 +5057,7 @@ button.close { padding-bottom:1px; border-bottom: 1px solid #4a4a4a; min-height: 16.42857px; - background-color: #427795; + background-color: #45565f; color: #FFF; } .modal-header .close { @@ -5071,13 +5073,13 @@ button.close { background-color: #FFF;} .modal-body .table-hover > tbody > tr:hover > td, .modal-body .table-hover > tbody > tr:hover > th { - background-color: #336480; + background-color: #f06702; color: #FFF; } .modal-footer { padding: 5px; text-align: right; - background-color: #f0f0f0; + background-color: #ddd; border-top: 1px solid inherit; } .modal-footer:before, .modal-footer:after { content: " "; @@ -5228,7 +5230,7 @@ button.close { .popover-title { margin: 0; padding: 8px 14px; - font-size: 14px; + font-size:14px; font-weight: normal; line-height: 18px; background-color: #f7f7f7; @@ -5496,7 +5498,7 @@ button.close { .show { display: block !important; - color:#757575;} + color: #2ba632; } .invisible { visibility: hidden; } @@ -5697,7 +5699,7 @@ html, body { height: 100%; font-family: 'SourceSansProRegular'; scrollbar-width: thin; - scrollbar-color: #315a71 #e3e3e3; + scrollbar-color: #45565f #e3e3e3; background-color: #fff; } @@ -5727,19 +5729,18 @@ body { .page-content > .row { height: 100%; } .page-content-head .container-fluid { - background-color: #FBFBFB; - margin-left: 20px; + color:#000; + background-color: none; margin-right: 20px; - border: 1px solid #b0b0b0; + margin-left: 20px; + border-bottom: 1px solid #aeaeae; border-radius: 0px; - min-height: 47px; - height:auto; - padding: 6px 14px 5px 14px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); } + min-height: 46px; + height: 46px; + padding: 9px 14px 5px 0px; } .page-content-head, .content-box-head { - padding-bottom: 2px; + padding-bottom: 5px; padding-top: 10px; color:#000; } @@ -5750,9 +5751,18 @@ body { line-height: inherit; margin: 0; } +.page-content-head h1, content-box-head h1 { + padding-left: 10px; + padding-right: 10px; + color: #000; + text-decoration-line: none; + font-weight: bold; + text-transform: uppercase; +} + .page-content-main { min-height: calc(100% - 64px); - padding: 9px 0px 21px 0px; + padding: 6px 0px 21px 0px; } .page-side { @@ -5788,7 +5798,7 @@ body { padding: 0px 0px; margin: 0px 0px; background: none; - border: 1px solid #b0b0b0; + border: 1px solid #a8a8a8; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.30); } .content-box hr { @@ -5832,7 +5842,7 @@ body { padding-top: 0 !important; } } .page-login { - background: #172c38; } + background: #FFF; } .page-login .container { min-height: 100%; margin-bottom: -60px; } @@ -5841,13 +5851,17 @@ body { .page-login .login-foot {color:#FFF;} .login-foot { - font-size: 12px; } + font-size: 12px; + max-width: 400px; + margin: 0px auto 0px auto; + background-color: #172c38;} .login-modal-container { color:#FFF; - border: 1px solid #fff; + border: none; max-width: 400px; - margin: 100px auto 15px auto; } + margin: 100px auto 0px auto; + background-color: #172c38;} .login-modal-head { height: 75px; padding: 0 20px; } @@ -5933,12 +5947,12 @@ main.page-content.col-lg-12 { padding-left: 0px; padding-right: 0px; padding-top:15px; - border-bottom:2px solid #1b313e; + border-bottom:2px solid #515151; } #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapsing > a.list-group-item { padding-left: 10px !important; - font-size: 14px !important; + font-size:14px !important; display: block !important; position: absolute !important; left: 70px !important; @@ -5946,7 +5960,7 @@ main.page-content.col-lg-12 { #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapsing > a.list-group-item { padding-left: 10px !important; - font-size: 14px !important; + font-size:14px !important; display: block !important; position: absolute !important; left: 166px !important; @@ -5963,15 +5977,15 @@ main.page-content.col-lg-12 { #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse > a.list-group-item, #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapse.in > a.list-group-item { padding-left: 10px !important; - font-size: 14px !important; - background-color: #294c5f !important; + font-size:14px !important; + background-color: #172c38 !important; opacity: 0.98; } #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse > div.collapse > a.list-group-item, #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapsed > a.list-group-item { padding-left: 10px !important; - font-size: 14px !important; + font-size:14px !important; } #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse > a.list-group-item, @@ -5997,7 +6011,7 @@ main.page-content.col-lg-12 { /* Sub Level One */ #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in { width:168px; - font-size:14px; + font-size:13px; z-index: 10; position: absolute; left: 70px; @@ -6011,7 +6025,7 @@ main.page-content.col-lg-12 { /* Sub Level Two */ #navigation.col-sidebar-left > div > nav > #mainmenu > div > div.collapse.in > div.collapse.in { width:168px; - font-size:14px; + font-size:13px; z-index: 10; position: absolute; left: 166px; @@ -6076,11 +6090,13 @@ button.toggle-sidebar { .nav-tabs > li > a, .nav-tabs > li > a:hover, .nav-tabs > li > a:focus { - outline:0; } + outline:0; + font-weight: 100; } .nav-tabs > li.active > a { - background: #315a71 !important; - outline:0; } + background: #172c38 !important; + outline:0; + font-weight: 100; } .nav-tabs > li > a.visible-lg-inline-block:not(.pull-right) { border-top-right-radius: 0px !important; @@ -6130,11 +6146,10 @@ button.toggle-sidebar { border: 0px !important; } .table th, strong, b { - font-family: 'SourceSansProSemibold'; - font-weight: normal; } + font-weight: 100; } .table > tbody > tr > td:last-child { -padding-right: 15px; } + padding-right: 5px; } /* helpers */ .__nowrap { @@ -6188,7 +6203,7 @@ padding-right: 15px; } .active-menu-title, .active-menu a { text-decoration: none; position: relative; - background-color: #30596F; } + background-color: #24323a; } .active-menu-title:before, .active-menu a:before { width: 3px; } .active-menu-title.active, .active-menu a.active { @@ -6239,7 +6254,7 @@ padding-right: 15px; } border-radius: 0; } ::-webkit-scrollbar-thumb { - background: #315a71; + background: #172c38; border: thin solid #e5e5e5; border-radius: 0px; } @@ -6253,8 +6268,8 @@ padding-right: 15px; } select { overflow: hidden; border: 1px solid #1d1d1d; - background-color: #427795; - color: #FFF; + background-color: #f0f0f0; + color: #000; -webkit-appearance: none; -moz-appearance: none; appearance: none; @@ -6266,8 +6281,8 @@ select { select:hover, select:active, select:focus { overflow: hidden; border: 1px solid #1d1d1d; - background-color: #336480; - color: #FFF; + background-color: #f0f0f0; + color: #000; -webkit-appearance: none; -moz-appearance: none; appearance: none; @@ -6277,7 +6292,7 @@ select:hover, select:active, select:focus { background-image: url(/ui/themes/tukan/build/images/caret.png) !important; } option:hover, option:active, option:focus { - background-color:#FF7E25; + background-color:#FF6E05; } #grid-log th[data-column-id="__timestamp__"], @@ -6335,12 +6350,12 @@ label > input[type="radio"] { } #ipsec .ipsec-tab { - background-color: #839caa !important; + background-color: #45565f !important; color: #FFF !important; } #ipsec .ipsec-tab.activetab { - background-color: #315a71 !important; + background-color: #172c38 !important; color: #FFF !important; } .fw_pass { @@ -6348,7 +6363,7 @@ label > input[type="radio"] { color:#FFF; } .fw_block { - background-color: #CB4326 !important; + background-color: #A22626 !important; color:#FFF; } .fw_nat { @@ -6399,8 +6414,8 @@ textarea#update_status, textarea#update_status:hover { .bootgrid-header .search .glyphicon, .bootgrid-footer .search .glyphicon,.input-group-addon { top: 0; - background-color: #FF7E25 !important; - border: 1px solid #FF7E25 !important; + background-color: #FF6E05 !important; + border: 1px solid #FF6E05 !important; } div.container-fluid >.fa-search::before, div.container-fluid >.fa-refresh::before { @@ -6482,7 +6497,7 @@ input[type="checkbox"].checkbox-switch:checked + i::before, input[type="checkbox } .bootstrap-datetimepicker-widget { - background-color:#FF7E25 !important; + background-color:#FF6E05 !important; } .modal-side > .p-15 { @@ -6492,7 +6507,7 @@ input[type="checkbox"].checkbox-switch:checked + i::before, input[type="checkbox padding-bottom: 1px; border-bottom: 1px solid #4a4a4a; min-height: 16.42857px; - background-color: #427795; + background-color: #45565f; color: #FFF; } @@ -6502,7 +6517,7 @@ input[type="checkbox"].checkbox-switch:checked + i::before, input[type="checkbox } .panel-report-tools:hover { - color: #fff !important; + color: #FFF !important; } .alert-primary { @@ -6511,9 +6526,21 @@ input[type="checkbox"].checkbox-switch:checked + i::before, input[type="checkbox } label.btn.au-target { - color: #FFF !important; + color: #000 !important; } .table.border { - border: 1px solid #bdbdbd; + border: 1px solid #bdbdbd; +} + +.rule.text-muted > td:nth-child(1n+3) { + text-decoration: line-through; +} + +.rule.text-muted > td:last-child { + text-decoration:none; +} + +#reports-tab { + border-bottom: 1px solid #a5a5a5; } diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/pick-a-color-1.2.3.min.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/pick-a-color-1.2.3.min.css index 0606f04c53..4cfbe3d1f4 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/pick-a-color-1.2.3.min.css +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/pick-a-color-1.2.3.min.css @@ -22,9 +22,9 @@ .pick-a-color-markup .color-menu .color-preview.violet{background-color:#ee81ee} .pick-a-color-markup .color-menu .color-preview.purple{background-color:#80007f} .pick-a-color-markup .color-menu .color-preview.black{background-color:#000} -.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{padding:5px 15px 3px 15px;cursor:default;min-height:25px;color:#FFF}.pick-a-color-markup .color-menu .basicColors-content li>a:hover,.pick-a-color-markup .color-menu .savedColors-content li>a:hover{background-color:none} +.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{padding:5px 15px 3px 15px;cursor:default;min-height:25px;color:#000}.pick-a-color-markup .color-menu .basicColors-content li>a:hover,.pick-a-color-markup .color-menu .savedColors-content li>a:hover{background-color:none} @media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li>a,.pick-a-color-markup .color-menu .savedColors-content li>a{min-height:40px}} -.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{color:#FFF;background-image:none;filter:none;text-decoration:none;font-weight:bold}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{background-color:#fff;font-weight:normal}} +.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{color:#000;background-image:none;filter:none;text-decoration:none;font-weight:bold}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .basicColors-content li:hover a,.pick-a-color-markup .color-menu .savedColors-content li:hover a{background-color:#fff;font-weight:normal}} .pick-a-color-markup .color-menu .btn.color-select{margin:0px 5px;height:20px;padding:0px 5px;margin-top:0px;line-height:1.5px;border-radius:4px}@media screen and (max-width:991px){.pick-a-color-markup .color-menu .btn.color-select{height:35px}} .pick-a-color-markup .caret{margin-bottom:3px;color: #000;} .pick-a-color-markup .color-menu-instructions,.pick-a-color-markup .advanced-instructions{text-align:center;padding:0px 6px;margin:0px;font-size:14px;font-weight:normal}@media screen and (min-width:992px){.pick-a-color-markup .color-menu-instructions,.pick-a-color-markup .advanced-instructions{display:none}} diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/tokenize2.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/tokenize2.css index 56bd92a6d0..8feb992392 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/tokenize2.css +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/tokenize2.css @@ -6,8 +6,8 @@ min-height: 34px; cursor: text; border-radius: 3px; - border: 1px solid #4d83a1; - background-color: #ffffff; + border: 1px solid #a8a8a8; + background-color: #ffffff; } .tokenize > .tokens-container.disabled { @@ -17,7 +17,7 @@ .tokenize.focus > .tokens-container { outline: 0; - border-color:#4d83a1; + border-color:#a8a8a8; background-color:#FFFFFF; -webkit-box-shadow: none; box-shadow: none; @@ -80,7 +80,7 @@ .tokenize > .tokens-container:focus, .tokenize > .tokens-container:hover { - border-color:#00A7FF; + border-color:#FF6E05; background-color:#FFFFFF; } diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/images/caret.png b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/images/caret.png index eade468d75883b756f15060b233eff15e314b215..c5a91e69a3bf5d9cf9aa3d2708e50fa28a124af2 100644 GIT binary patch delta 2922 zcmV-w3zhW43HKI|8Gi-<001bu2Mz!L3b$!PLr_UWLm*IcZ)Rz1WdHz3$E}xlP*eF9 z$A9;xhlCagMM~&RdI#w>bm<@}AqgRr5K>UFA+opvYe7T=%Ze^l!L`s96|rDNz+M+* zQBc>#f}p7E1s>tOH?x1dnRha0?k8u?Jvry*{ARuv0MZD9&wo#cWdX?Gi3H((p0wDw zcpC0^03#nfkONu_rjYLu78V5l(LUV+(9HF==}ax~znL71Eo1@!g&~~85;8LoK81J> zlP?effXYYWI;%wd8LmZGL4Y)faK{XD=D2r;ljiu3*__C5FN7xnz>^pZ0S5pQ8i~`g znH;1JNf%)Y9)F9=LpTy)S7r)>g>Wgti!(AZXSfq#!=!(!!}*VzNs^ij21mkkv&>oAHOrcl& zJhK?yf%7a*i}ILfhG5}du81Bv&w|WwNqx4^Cqh!6O@9xP^pGAR;bg8aeV%htB4g$` zn;RW6&%(5bz=a$yNn9Wfm-L)0@RiJ%AzbK<$yn$?loIK`&|9pe2Nv7gM-t~nN%Hw3 zPf1OFdYB}io$e=z3$r66_ll4Oo99$UK-fZ^Fv;@)kst+#0S~YM8wfxW$OP#?1Zcn; zaDfo;k$-OtfUJjzy;?LggjXhijeyHZ5z#!5Q^cmxc}%m#G%E{BTL5OxDF}ja5E-ICDv&0m2bn-tkOSlj`9MKXI1~pZLL7(( ziJ^7SW~c}%fhwRwP#yFu)CQf0u0nm#Lue2hh2BG7U=&P(6<~E(A2x>_U=KJDj)a%P z9Dg_q&VlpcZE!hU1s{c*;q&ly_%1vEzlO(A040T@qO?$^Cl+_F~K-t=$Kdx2eS%OfGNXNV@_i(VSnyohB2S8SS%H5fVIc^W8<)?*tOVV?0#$$ zwiDZj9m0;|a5xp53C;x+)>;)Tt99YH;I?RYvQf&zW8`N51)rG!`I`_ z;`{M0@lym@f*!$%5K3SX))2N6ju6@jw+O?8DWV+FfapSuB&HHK5zC2<#7o2{#D5P` zQc~Jdj#5jdxKg=N4wL>C!Cejnb9U&C>nSZ)FHFdNLj|D`awH%4AN;+>&`COOVx<^^#@C zZjh~%ZIit(J1$3&vy=;!%aALUtACffDmNmJlh>E`k!Q*0%O94%AU{MwQFJI?6eeXe zdC6-Cvj(y8gx?bH+0d(Pj9;Y^AMAjY|DW6UvK}-IdwOh00CJca^`W&{TX>(o}Y;w5U8)MXMUCE`L>BrFua1 zlIoj93X7ZTfit8txjY8l@U% zHAXclny#8$%~H*Cny+YzG!I%jt(9Iv)FMlZ*kS)`=%sQ z57TVZ2Gc<^s#%a(o>`08TXS9Wc=Mg+-R9pdY%S6)j#xall(!79%zv|Nw|sA9Y{j&y zw7O$Ww)VB&Xx(c4&c?)sZF9ipfi1;0*mjF;m+dz@dpm($qur>zu6?5YKKuI)3Jzfo z#ST{-F^-;&8y!0wKRekuiJVS2{pD=xoaS8bJhH@K346(rB||RSE)17LE(5MK*F@K! zT?gE>+!$_EZqMCy+<#f_)$T7nj6703j(WWHwD1&op7xyZa`Ia5)#;7$_VX_E?(vcL ziSnuNdFHF_%kgdS9rLsGTkF^9kMR%m-|2s!u1;st>*!+v_5teyE(VeUBLXV|p9dKS z34+>#;oyMaUBOR6^g?(cEukQk9=a>^X_!G+R@iS#u}j02R(~#i5pEg2F1$N}60tI( zKH^iPXXN(C$5Dn+;;61@ndpS*y6A}*@0gO9fmrj{^|9CERO7gDt?{_{==kdR@nt^C zb}t)FuuUjPxVPM3`Re6YSE#N?UvXxo%u2?}lZlwbn8f*?%tV686hvm*kS<5snLI7iToZEu}2w4cCiX!F`wNpL#HLA}utnCT%)B zCcP;GpOKi+#*^oz@h)a+WUkKakn;!HY9E6 z+NiTJf8%hjUvBLt;-<7sH}fp=O7cE#j@jIvub!WqKlFp&4-Ey<1%iV6Tb#EX{1N>l z_s5>C)?4>({a(l_yjEmUR95u0m|1-7C(ED8f12Kwysc-u-Sz`Juse7=?(KBjSz97k zl2bCYD}Q)bb1AK~u=L~ZmAkK&*_0jJL);_YGf*B>-nv(J?~c7+D^e=%R(e)8?Ni&g zb>GB(*8ctj?gttVsvj&m_~mEr&kqjy9cr%9uPQr?J)C{`#gXVE-M={eQdg~7T~z(8 zhF3FC8(w>{&c3d$Uafw61Kc2P7(JSBwD*|zv47S^)5b$h)TW~2;JEnst6vj;y>}w; zMAu1&lZ~hJPVGBQIbGNcHLqzNYe{JtXpL*_YYS-WYIklw{hQfuH62YM=i<_fJ(mJ6UAgRg`9ilx_qi)BS30gbU2VJO zaDT1ky505W8@4x2-?Y7Xy2q}k`Ih~y)?UZn_P!;3XZzjy&)@dGefbXk&h@(?cl+)| z-Ft99;r_q_)`O9U=?~vM%6>HUIQI$WN#Rr3r)AI7o>l#B^n25Q-N2ba@4*|-Bc4AV zVh+9jL-@zn;rtim7iBLsU)GISjdYCqj(_&PTJ~!AHUIV0n}R>({@nN0@a?I;-2b{U z7CSclPVjE}eenmC4>cccK6Z_VjX(R8@o8$Ja8hNm_Orw1?k_Q4UQVt0iu+pr&FEYE z_rUK@rZc9e`3wPLRtlgHhm(^5cwYkmIS$bdh^{6|&uQjagXVPpEP;RGIbA(#c7FiW zxC0QC3qTN}Q4S!kmpiAeXCzakJAkdNCH^lHCR30PbWG UFVdQ&MBb@ E0O Date: Fri, 12 Mar 2021 14:34:24 +0100 Subject: [PATCH 0478/3088] net/haproxy: only accept a single value for backend/server fields, refs #2266 When Multiple=Y is set, then backend/server fields are preselected. This makes it impossible to remove backends/servers, even when the rule does not actually use them. --- net/haproxy/pkg-descr | 5 +++++ .../src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 4e83fe3062..86fcbd003e 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.1 + +Changed: +* rules: only accept a single value for backend/server fields (#2266) + 3.0 Added: diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 8c172b6cfd..3beabcd33c 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -2086,7 +2086,7 @@ Related backend item not found - Y + N N @@ -2098,7 +2098,7 @@ Related server item not found - Y + N N From 56ca1c517d57308be07b203723cd5a6147484ed9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 14 Mar 2021 22:41:22 +0100 Subject: [PATCH 0479/3088] net/haproxy: add migration to fix undeletable items, fixes #2266 --- .../app/models/OPNsense/HAProxy/HAProxy.xml | 2 +- .../OPNsense/HAProxy/Migrations/M3_1_0.php | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_1_0.php diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 3beabcd33c..58ac8e28e4 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 3.0.0 + 3.1.0 the HAProxy load balancer diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_1_0.php b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_1_0.php new file mode 100644 index 0000000000..a41024c00d --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/Migrations/M3_1_0.php @@ -0,0 +1,55 @@ +getNodeByReference('actions.action')->iterateItems() as $action) { + switch ((string)$action->type) { + case 'use_backend': + // do nothing, keep the value + break; + case 'use_server': + // do nothing, keep the value + break; + default: + // Clear referenced items if they are not in use. + $action->use_backend = null; + $action->use_server = null; + break; + } + } + } +} From f6b4c1899a0211129f0b17cb2e14284024f1847b Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 14 Mar 2021 22:44:51 +0100 Subject: [PATCH 0480/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- net/haproxy/pkg-descr | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index fa8508ba7a..c2f195fc2a 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.0 +PLUGIN_VERSION= 3.1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 86fcbd003e..69ef2148a7 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -8,6 +8,9 @@ Plugin Changelog 3.1 +Fixed: +* fix items that cannot be deleted (#2266) + Changed: * rules: only accept a single value for backend/server fields (#2266) From 6613c6abf274032e6e83584f7636a7d2d1a32102 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Mar 2021 10:25:03 +0100 Subject: [PATCH 0481/3088] misc/theme-tukan: fix whitespace --- .../opnsense/www/themes/tukan/assets/stylesheets/main.scss | 6 +++--- .../src/opnsense/www/themes/tukan/build/css/main.css | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss index f99129bc81..6c5e30aad1 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/main.scss @@ -27,7 +27,7 @@ @font-face { font-family: 'SourceSansProRegular'; src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf") format("truetype"); } - + /*! normalize.css v3.0.1 | MIT License | git.io/normalize */ table html { @@ -5851,7 +5851,7 @@ body { .page-login .login-foot {color:#FFF;} .login-foot { - font-size: 12px; + font-size: 12px; max-width: 400px; margin: 0px auto 0px auto; background-color: #172c38;} @@ -5860,7 +5860,7 @@ body { color:#FFF; border: none; max-width: 400px; - margin: 100px auto 0px auto; + margin: 100px auto 0px auto; background-color: #172c38;} .login-modal-head { height: 75px; diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css index f99129bc81..6c5e30aad1 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/main.css @@ -27,7 +27,7 @@ @font-face { font-family: 'SourceSansProRegular'; src: url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.woff") format("woff"), url("/ui/themes/tukan/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf") format("truetype"); } - + /*! normalize.css v3.0.1 | MIT License | git.io/normalize */ table html { @@ -5851,7 +5851,7 @@ body { .page-login .login-foot {color:#FFF;} .login-foot { - font-size: 12px; + font-size: 12px; max-width: 400px; margin: 0px auto 0px auto; background-color: #172c38;} @@ -5860,7 +5860,7 @@ body { color:#FFF; border: none; max-width: 400px; - margin: 100px auto 0px auto; + margin: 100px auto 0px auto; background-color: #172c38;} .login-modal-head { height: 75px; From 25ad1051b6baa143f7ce8fdb63e90f8fed5811e9 Mon Sep 17 00:00:00 2001 From: lucas12433 <41630758+lucas12433@users.noreply.github.com> Date: Mon, 15 Mar 2021 08:32:43 +0100 Subject: [PATCH 0482/3088] Update actions_wireguard.conf Make Wireguard rebootable via cron Job --- .../src/opnsense/service/conf/actions.d/actions_wireguard.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf index eda045e381..38a58fa0c8 100644 --- a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf +++ b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf @@ -21,6 +21,7 @@ command: parameters: type:script message:restarting Wireguard +description: Restart Wireguard [genkey] command:/usr/local/opnsense/scripts/OPNsense/Wireguard/genkey.sh From 4a437aa30201b3c03290ac0004d629507ab5588b Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 16 Mar 2021 14:00:56 +0100 Subject: [PATCH 0483/3088] net/wireguard: Add config sync (#2282) --- net/wireguard/Makefile | 3 +-- net/wireguard/pkg-descr | 4 ++++ net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc | 9 +++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 9a3654e78f..914a5cf2ca 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 1.4 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= WireGuard VPN service PLUGIN_DEPENDS= wireguard PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index ff1299e523..44ecbcc457 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,10 @@ WWW: https://www.wireguard.com/ Changelog --------- +1.5 + +* Allow synchronization of config + 1.4 * Add IPv6 gateway support (contributed by Alexander Korinek) diff --git a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc index ae40d9618d..d2ec171b70 100644 --- a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc @@ -68,3 +68,12 @@ function wireguard_interfaces() $interfaces['wireguard'] = $oic; return $interfaces; } + +function wireguard_xmlrpc_sync() +{ + $result = array(); + $result['id'] = 'wireguard'; + $result['section'] = 'OPNsense.wireguard'; + $result['description'] = gettext('WireGuard'); + return array($result); +} From 8749029e76fe117ab580de07f6a9e56500e3ae51 Mon Sep 17 00:00:00 2001 From: Arnavion Date: Sun, 21 Mar 2021 10:20:10 -0700 Subject: [PATCH 0484/3088] os-smart: Add new action and API parameter for JSON info from smartctl. - The existing `smart info.*` actions have been merged into one `smart info` action that takes the type as a parameter. - There is now a `smart info_json` action that runs the same `smartctl` command with an additional `--json=c` parameter for JSON output. - The `/api/smart/service/info` API now takes an optional `"json": true` request body parameter that changes the response `"output"` value from a string to a JSON object. The JSON object is the output of the `smart info_json` action. Fixes #2283 --- .../OPNsense/Smart/Api/ServiceController.php | 11 +++++- .../service/conf/actions.d/actions_smart.conf | 34 +++++-------------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php b/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php index 905315623e..324a6e1111 100644 --- a/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php +++ b/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php @@ -57,6 +57,7 @@ public function infoAction() if ($this->request->isPost()) { $device = $this->request->getPost('device'); $type = $this->request->getPost('type'); + $json = $this->request->getPost('json'); if (!in_array($device, $this->getDevices())) { return array("message" => "Invalid device name"); @@ -70,7 +71,15 @@ public function infoAction() $backend = new Backend(); - $output = $backend->configdpRun("smart", array("info", $type, "/dev/" . $device)); + $params = array("info", $type, "/dev/" . $device); + if ($json != NULL) { + $params[0] = "info_json"; + } + + $output = $backend->configdpRun("smart", $params); + if ($json != NULL) { + $output = json_decode($output, true); + } return array("output" => $output); } diff --git a/sysutils/smart/src/opnsense/service/conf/actions.d/actions_smart.conf b/sysutils/smart/src/opnsense/service/conf/actions.d/actions_smart.conf index 104c227e4d..7085815254 100644 --- a/sysutils/smart/src/opnsense/service/conf/actions.d/actions_smart.conf +++ b/sysutils/smart/src/opnsense/service/conf/actions.d/actions_smart.conf @@ -10,35 +10,17 @@ parameters: type:script_output message:list installed devices -[info.i] -command:/usr/local/sbin/smartctl -i -parameters:%s; exit 0 -type:script_output -message:Get identity info for device %s - -[info.H] -command:/usr/local/sbin/smartctl -H -parameters:%s; exit 0 +[info] +command:/usr/local/sbin/smartctl +parameters:-%s %s; exit 0 type:script_output -message:Get SMART health status info for device %s +message:exec smartctl -%s for device %s -[info.c] -command:/usr/local/sbin/smartctl -c -parameters:%s; exit 0 -type:script_output -message:Get capabilities for device %s - -[info.A] -command:/usr/local/sbin/smartctl -A -parameters:%s; exit 0 -type:script_output -message:Get vendor-specific attributes for device %s - -[info.a] -command:/usr/local/sbin/smartctl -a -parameters:%s; exit 0 +[info_json] +command:/usr/local/sbin/smartctl +parameters:-%s --json=c %s; exit 0 type:script_output -message:Get all SMART info for device %s +message:exec smartctl -%s (JSON) for device %s [log.error] command:/usr/local/sbin/smartctl -l error From 45021cd0697c881aafd3517bfdf6bce3e775f3d0 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 21 Mar 2021 19:48:52 +0100 Subject: [PATCH 0485/3088] net-mgmt/telegraf: add datadog output (#2290) --- net-mgmt/telegraf/Makefile | 3 +-- net-mgmt/telegraf/pkg-descr | 4 ++++ .../OPNsense/Telegraf/forms/output.xml | 18 ++++++++++++++++++ .../app/models/OPNsense/Telegraf/Output.xml | 14 +++++++++++++- .../templates/OPNsense/Telegraf/telegraf.conf | 11 +++++++++++ 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index 284cc8f355..c5279eb7ab 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.8.3 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.9.0 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 5dd3e3a581..b49f834fbc 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -11,6 +11,10 @@ Kafka, MQTT, NSQ, and many others. Plugin Changelog ================ +1.9.0 + +* Add Datadog output + 1.8.2 * Add 'ntpq' input diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index 0e726a008d..89f8ee137b 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -167,4 +167,22 @@ checkbox Send string metrics as Prometheus labels. + + output.datadog_enable + + checkbox + This will enable Datadog output. + + + output.datadog_url + + text + Set the URL where metrics shoud be sent to. Format is without square brackets, just like https://app.datadoghq.com/api/v1/series. + + + output.datadog_apikey + + text + Set the API Key for accessing Datadog. + diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index 7b479f0c9c..c3b090acf7 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -1,7 +1,7 @@ //OPNsense/telegraf/output Telegraf outputs configuration - 1.4.1 + 1.4.2 0 @@ -109,5 +109,17 @@ N + + 0 + N + + + + N + + + + N + diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index f9e83ea4d7..07d1d38b82 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -75,6 +75,17 @@ {% endif %} {% endif %} +{% if helpers.exists('OPNsense.telegraf.output.datadog_enable') and OPNsense.telegraf.output.datadog_enable == '1' %} +[[outputs.datadog]] +{% if helpers.exists('OPNsense.telegraf.output.datadog_url') and OPNsense.telegraf.output.datadog_url != '' %} + url = "{{ OPNsense.telegraf.output.datadog_url }}" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.datadog_apikey') and OPNsense.telegraf.output.datadog_apikey != '' %} + apikey = "{{ OPNsense.telegraf.output.datadog_apikey }}" +{% endif %} + timeout = "5s" +{% endif %} + {% if helpers.exists('OPNsense.telegraf.output.graphite_enable') and OPNsense.telegraf.output.graphite_enable == '1' %} [[outputs.graphite]] {% if helpers.exists('OPNsense.telegraf.output.graphite_server') and OPNsense.telegraf.output.graphite_server != '' %} From 61a9282bea26e03a8c21c7310611c03e1110c6e5 Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:36:09 +0300 Subject: [PATCH 0486/3088] WOL widget fix (#2291) fix button binding after cutting scripts from widgets --- net/wol/Makefile | 3 +-- .../src/www/widgets/widgets/wake_on_lan.widget.php | 12 +++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/net/wol/Makefile b/net/wol/Makefile index 7f29a872c1..818fde3268 100644 --- a/net/wol/Makefile +++ b/net/wol/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= wol -PLUGIN_VERSION= 2.3 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 2.4 PLUGIN_DEPENDS= wol PLUGIN_COMMENT= Wake on LAN Service PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/wol/src/www/widgets/widgets/wake_on_lan.widget.php b/net/wol/src/www/widgets/widgets/wake_on_lan.widget.php index adef5d97a5..843341a657 100644 --- a/net/wol/src/www/widgets/widgets/wake_on_lan.widget.php +++ b/net/wol/src/www/widgets/widgets/wake_on_lan.widget.php @@ -75,10 +75,12 @@ From 6e50ef903ae0e20d6438e510804da05935de7a38 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 22 Mar 2021 11:32:51 +0100 Subject: [PATCH 0487/3088] os-smart: simplify https://github.com/opnsense/plugins/pull/2289 a bit. --- .../controllers/OPNsense/Smart/Api/ServiceController.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php b/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php index 324a6e1111..874ba272f2 100644 --- a/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php +++ b/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php @@ -57,7 +57,7 @@ public function infoAction() if ($this->request->isPost()) { $device = $this->request->getPost('device'); $type = $this->request->getPost('type'); - $json = $this->request->getPost('json'); + $mode = empty($this->request->getPost('json')) ? "info" : "info_json"; if (!in_array($device, $this->getDevices())) { return array("message" => "Invalid device name"); @@ -71,13 +71,10 @@ public function infoAction() $backend = new Backend(); - $params = array("info", $type, "/dev/" . $device); - if ($json != NULL) { - $params[0] = "info_json"; - } + $params = array($mode, $type, "/dev/" . $device); $output = $backend->configdpRun("smart", $params); - if ($json != NULL) { + if ($mode == 'info_json') { $output = json_decode($output, true); } From 19d24b491fcfe2ab8b66aafa4146fc5a63eaad20 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 21 Mar 2021 23:51:18 +0100 Subject: [PATCH 0488/3088] add new plugin: qemu-guest-agent, closes #1586 --- emulators/qemu-guest-agent/Makefile | 8 +++ emulators/qemu-guest-agent/pkg-descr | 5 ++ .../etc/inc/plugins.inc.d/qemuguestagent.inc | 70 +++++++++++++++++++ .../QemuGuestAgent/Api/ServiceController.php | 46 ++++++++++++ .../QemuGuestAgent/Api/SettingsController.php | 46 ++++++++++++ .../QemuGuestAgent/IndexController.php | 47 +++++++++++++ .../OPNsense/QemuGuestAgent/forms/general.xml | 23 ++++++ .../OPNsense/QemuGuestAgent/ACL/ACL.xml | 11 +++ .../OPNsense/QemuGuestAgent/Menu/Menu.xml | 8 +++ .../QemuGuestAgent/QemuGuestAgent.php | 49 +++++++++++++ .../QemuGuestAgent/QemuGuestAgent.xml | 60 ++++++++++++++++ .../views/OPNsense/QemuGuestAgent/index.volt | 63 +++++++++++++++++ .../scripts/OPNsense/QemuGuestAgent/setup.sh | 10 +++ .../actions.d/actions_qemuguestagent.conf | 29 ++++++++ .../OPNsense/QemuGuestAgent/+TARGETS | 1 + .../OPNsense/QemuGuestAgent/rc.conf.d | 15 ++++ 16 files changed, 491 insertions(+) create mode 100644 emulators/qemu-guest-agent/Makefile create mode 100644 emulators/qemu-guest-agent/pkg-descr create mode 100644 emulators/qemu-guest-agent/src/etc/inc/plugins.inc.d/qemuguestagent.inc create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/Api/ServiceController.php create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/Api/SettingsController.php create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/IndexController.php create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/forms/general.xml create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/ACL/ACL.xml create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/Menu/Menu.xml create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/QemuGuestAgent.php create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/QemuGuestAgent.xml create mode 100644 emulators/qemu-guest-agent/src/opnsense/mvc/app/views/OPNsense/QemuGuestAgent/index.volt create mode 100755 emulators/qemu-guest-agent/src/opnsense/scripts/OPNsense/QemuGuestAgent/setup.sh create mode 100644 emulators/qemu-guest-agent/src/opnsense/service/conf/actions.d/actions_qemuguestagent.conf create mode 100644 emulators/qemu-guest-agent/src/opnsense/service/templates/OPNsense/QemuGuestAgent/+TARGETS create mode 100644 emulators/qemu-guest-agent/src/opnsense/service/templates/OPNsense/QemuGuestAgent/rc.conf.d diff --git a/emulators/qemu-guest-agent/Makefile b/emulators/qemu-guest-agent/Makefile new file mode 100644 index 0000000000..1f9c4268f7 --- /dev/null +++ b/emulators/qemu-guest-agent/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= qemu-guest-agent +PLUGIN_VERSION= 0.1 +PLUGIN_DEVEL= yes +PLUGIN_COMMENT= QEMU Guest Agent for OPNsense +PLUGIN_DEPENDS= qemu-guest-agent +PLUGIN_MAINTAINER= opnsense@moov.de + +.include "../../Mk/plugins.mk" diff --git a/emulators/qemu-guest-agent/pkg-descr b/emulators/qemu-guest-agent/pkg-descr new file mode 100644 index 0000000000..2ff6915607 --- /dev/null +++ b/emulators/qemu-guest-agent/pkg-descr @@ -0,0 +1,5 @@ +QEMU Guest Agent for FreeBSD + +Port homepage https://github.com/aborche/qemu-guest-agent + +WWW: http://wiki.qemu.org/Main_Page diff --git a/emulators/qemu-guest-agent/src/etc/inc/plugins.inc.d/qemuguestagent.inc b/emulators/qemu-guest-agent/src/etc/inc/plugins.inc.d/qemuguestagent.inc new file mode 100644 index 0000000000..50ad2acc9e --- /dev/null +++ b/emulators/qemu-guest-agent/src/etc/inc/plugins.inc.d/qemuguestagent.inc @@ -0,0 +1,70 @@ + gettext('QEMU Guest Agent'), + 'pidfile' => '/var/run/qemu-ga.pid', + 'configd' => array( + 'restart' => array('qemuguestagent restart'), + 'start' => array('qemuguestagent start'), + 'stop' => array('qemuguestagent stop'), + ), + 'name' => 'qemu-ga', + ); + + return $services; +} + +function qemuguestagent_xmlrpc_sync() +{ + $result = array(); + $result['id'] = 'qemuguestagent'; + $result['section'] = 'OPNsense.QemuGuestAgent'; + $result['description'] = gettext('QEMU Guest Agent'); + return array($result); +} diff --git a/emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/Api/ServiceController.php b/emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/Api/ServiceController.php new file mode 100644 index 0000000000..c07d9ff99f --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/Api/ServiceController.php @@ -0,0 +1,46 @@ +view->pick('OPNsense/QemuGuestAgent/index'); + // fetch form data "general" in + $this->view->generalForm = $this->getForm("general"); + } +} diff --git a/emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/forms/general.xml b/emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/forms/general.xml new file mode 100644 index 0000000000..86ff2811df --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/mvc/app/controllers/OPNsense/QemuGuestAgent/forms/general.xml @@ -0,0 +1,23 @@ +
    + + qemuguestagent.general.Enabled + + checkbox + Enable the QEMU guest agent service. + + + qemuguestagent.general.LogDebug + + checkbox + Log extra debugging information. + + + qemuguestagent.general.DisabledRPCs + + select_multiple + + true + true + A list of RPCs to disable. + +
    diff --git a/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/ACL/ACL.xml b/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/ACL/ACL.xml new file mode 100644 index 0000000000..05a218ed59 --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/ACL/ACL.xml @@ -0,0 +1,11 @@ + + + Services: QEMU Guest Agent + + ui/qemuguestagent/* + api/qemuguestagent/* + ui/diagnostics/log/core/qemu-ga/* + api/diagnostics/log/core/qemu-ga/* + + + diff --git a/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/Menu/Menu.xml b/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/Menu/Menu.xml new file mode 100644 index 0000000000..8cecba521b --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/Menu/Menu.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/QemuGuestAgent.php b/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/QemuGuestAgent.php new file mode 100644 index 0000000000..e84d734e47 --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/QemuGuestAgent.php @@ -0,0 +1,49 @@ +general->Enabled === "1") { + return true; + } + return false; + } +} diff --git a/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/QemuGuestAgent.xml b/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/QemuGuestAgent.xml new file mode 100644 index 0000000000..8c037740b5 --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/mvc/app/models/OPNsense/QemuGuestAgent/QemuGuestAgent.xml @@ -0,0 +1,60 @@ + + //OPNsense/QemuGuestAgent + 1.0.0 + QEMU Guest Agent for OPNsense + + + + 1 + Y + + + 0 + N + + + N + + Y + Y + + guest-exec + guest-exec-status + guest-file-close + guest-file-flush + guest-file-open + guest-file-read + guest-file-seek + guest-file-write + guest-fsfreeze-freeze + guest-fsfreeze-freeze-list + guest-fsfreeze-status + guest-fsfreeze-thaw + guest-fstrim + guest-get-fsinfo + guest-get-host-name + guest-get-memory-block-info + guest-get-memory-blocks + guest-get-osinfo + guest-get-time + guest-get-timezone + guest-get-users + guest-get-vcpus + guest-info + guest-network-get-interfaces + guest-ping + guest-set-memory-blocks + guest-set-time + guest-set-user-password + guest-set-vcpus + guest-shutdown + guest-suspend-disk + guest-suspend-hybrid + guest-suspend-ram + guest-sync + guest-sync-delimited + + + + + diff --git a/emulators/qemu-guest-agent/src/opnsense/mvc/app/views/OPNsense/QemuGuestAgent/index.volt b/emulators/qemu-guest-agent/src/opnsense/mvc/app/views/OPNsense/QemuGuestAgent/index.volt new file mode 100644 index 0000000000..49563e73e8 --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/mvc/app/views/OPNsense/QemuGuestAgent/index.volt @@ -0,0 +1,63 @@ +{# + +OPNsense® is Copyright © 2021 Frank Wall +OPNsense® is Copyright © 2014 – 2015 by Deciso B.V. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#} + + + + + +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}} +
    + +
    +
    + +
    +
    +
    diff --git a/emulators/qemu-guest-agent/src/opnsense/scripts/OPNsense/QemuGuestAgent/setup.sh b/emulators/qemu-guest-agent/src/opnsense/scripts/OPNsense/QemuGuestAgent/setup.sh new file mode 100755 index 0000000000..f3e18ed33c --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/scripts/OPNsense/QemuGuestAgent/setup.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Check if the kernel module exists +KERNMOD='virtio_console' +if [ -e /boot/kernel/${KERNMOD}.ko ]; then + # Load module + kldload $KERNMOD 2>&1 +fi + +exit 0 diff --git a/emulators/qemu-guest-agent/src/opnsense/service/conf/actions.d/actions_qemuguestagent.conf b/emulators/qemu-guest-agent/src/opnsense/service/conf/actions.d/actions_qemuguestagent.conf new file mode 100644 index 0000000000..c236540b22 --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/service/conf/actions.d/actions_qemuguestagent.conf @@ -0,0 +1,29 @@ +[start] +command:/usr/local/opnsense/scripts/OPNsense/QemuGuestAgent/setup.sh; /usr/local/etc/rc.d/qemu-guest-agent start +parameters: +type:script +message:starting qemu-guest-agent + +[stop] +command:/usr/local/etc/rc.d/qemu-guest-agent stop; exit 0 +parameters: +type:script +message:stopping qemu-guest-agent + +[restart] +command:/usr/local/opnsense/scripts/OPNsense/QemuGuestAgent/setup.sh; /usr/local/etc/rc.d/qemu-guest-agent restart +parameters: +type:script +message:restarting qemu-guest-agent + +[reload] +command:/usr/local/opnsense/scripts/OPNsense/QemuGuestAgent/setup.sh; /usr/local/etc/rc.d/qemu-guest-agent restart +parameters: +type:script +message:restarting qemu-guest-agent + +[status] +command:/usr/local/etc/rc.d/qemu-guest-agent status; exit 0 +parameters: +type:script_output +message:requesting qemu-guest-agent status diff --git a/emulators/qemu-guest-agent/src/opnsense/service/templates/OPNsense/QemuGuestAgent/+TARGETS b/emulators/qemu-guest-agent/src/opnsense/service/templates/OPNsense/QemuGuestAgent/+TARGETS new file mode 100644 index 0000000000..3bc91f3c9f --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/service/templates/OPNsense/QemuGuestAgent/+TARGETS @@ -0,0 +1 @@ +rc.conf.d:/etc/rc.conf.d/qemu_guest_agent diff --git a/emulators/qemu-guest-agent/src/opnsense/service/templates/OPNsense/QemuGuestAgent/rc.conf.d b/emulators/qemu-guest-agent/src/opnsense/service/templates/OPNsense/QemuGuestAgent/rc.conf.d new file mode 100644 index 0000000000..ea9c80f8ce --- /dev/null +++ b/emulators/qemu-guest-agent/src/opnsense/service/templates/OPNsense/QemuGuestAgent/rc.conf.d @@ -0,0 +1,15 @@ +{# Default setting is enabled, so that no GUI interaction is required. #} +{% if not (helpers.exists('OPNsense.QemuGuestAgent.general.LogDebug')) or OPNsense.QemuGuestAgent.general.Enabled|default("0") != "0" %} +{% set optional_flags = [] %} +{% do optional_flags.append('-d -l /var/log/qemu-ga.log') %} +{% if helpers.exists('OPNsense.QemuGuestAgent.general.LogDebug') and OPNsense.QemuGuestAgent.general.LogDebug|default("0") == "1" %} +{% do optional_flags.append('-v') %} +{% endif %} +{% if helpers.exists('OPNsense.QemuGuestAgent.general.DisabledRPCs') and not helpers.empty('OPNsense.QemuGuestAgent.general.DisabledRPCs') %} +{% do optional_flags.append('--blacklist=' ~ OPNsense.QemuGuestAgent.general.DisabledRPCs) %} +{% endif %} +qemu_guest_agent_enable="YES" +qemu_guest_agent_flags="{{optional_flags|join(' ')}}" +{% else %} +qemu_guest_agent_enable="NO" +{% endif %} From e154d9ca39fbcf979e5e87d794707e9acba6f484 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 22 Mar 2021 19:47:29 +0100 Subject: [PATCH 0489/3088] README: sync --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b5698e1495..78311c2290 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ dns/bind -- BIND domain name service dns/dnscrypt-proxy -- Flexible DNS proxy supporting DNSCrypt and DoH dns/dyndns -- Dynamic DNS Support dns/rfc2136 -- RFC-2136 Support +emulators/qemu-guest-agent -- QEMU Guest Agent for OPNsense (development only) mail/postfix -- SMTP mail relay mail/rspamd -- Protect your network from spam misc/theme-cicada -- The cicada theme - dark grey From 75d5af5228e866b344c46268b20827fe6f0f983f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Mar 2021 10:16:28 +0100 Subject: [PATCH 0490/3088] net/wireguard: change deps according to FreeBSD shift --- net/wireguard/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 914a5cf2ca..2e0da8f81f 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= WireGuard VPN service -PLUGIN_DEPENDS= wireguard +PLUGIN_DEPENDS= wireguard-go wireguard-tools PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" From f557e2b09a2f927a31b5fa7e2173b941e6dd0988 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 24 Mar 2021 16:35:09 +0100 Subject: [PATCH 0491/3088] XMLRPC / HA-Sync: add services keyword (introduced https://github.com/opnsense/core/issues/4834) in xmlrpc templates for existing plugins. --- dns/bind/src/etc/inc/plugins.inc.d/bind.inc | 1 + .../src/etc/inc/plugins.inc.d/qemuguestagent.inc | 1 + net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc | 1 + net/frr/src/etc/inc/plugins.inc.d/frr.inc | 1 + net/haproxy/src/etc/inc/plugins.inc.d/haproxy.inc | 1 + net/relayd/src/etc/inc/plugins.inc.d/relayd.inc | 1 + net/tayga/src/etc/inc/plugins.inc.d/tayga.inc | 1 + net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc | 1 + security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc | 1 + security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc | 1 + security/tinc/src/etc/inc/plugins.inc.d/tinc.inc | 1 + www/nginx/src/etc/inc/plugins.inc.d/nginx.inc | 1 + 12 files changed, 12 insertions(+) diff --git a/dns/bind/src/etc/inc/plugins.inc.d/bind.inc b/dns/bind/src/etc/inc/plugins.inc.d/bind.inc index 495764bb52..2b050aa2bb 100644 --- a/dns/bind/src/etc/inc/plugins.inc.d/bind.inc +++ b/dns/bind/src/etc/inc/plugins.inc.d/bind.inc @@ -60,5 +60,6 @@ function bind_xmlrpc_sync() $result['id'] = 'bind'; $result['section'] = 'OPNsense.bind'; $result['description'] = gettext('BIND domain name service'); + $result['services'] = ['named']; return array($result); } diff --git a/emulators/qemu-guest-agent/src/etc/inc/plugins.inc.d/qemuguestagent.inc b/emulators/qemu-guest-agent/src/etc/inc/plugins.inc.d/qemuguestagent.inc index 50ad2acc9e..9304b1f126 100644 --- a/emulators/qemu-guest-agent/src/etc/inc/plugins.inc.d/qemuguestagent.inc +++ b/emulators/qemu-guest-agent/src/etc/inc/plugins.inc.d/qemuguestagent.inc @@ -66,5 +66,6 @@ function qemuguestagent_xmlrpc_sync() $result['id'] = 'qemuguestagent'; $result['section'] = 'OPNsense.QemuGuestAgent'; $result['description'] = gettext('QEMU Guest Agent'); + $result['services'] = ['qemu-ga']; return array($result); } diff --git a/net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc b/net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc index c5d7a1f0aa..ba083f7722 100644 --- a/net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc +++ b/net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc @@ -82,5 +82,6 @@ function zabbixagent_xmlrpc_sync() $result['id'] = 'zabbixagent'; $result['section'] = 'OPNsense.zabbixagent.settings'; $result['description'] = gettext('Zabbix monitoring agent'); + $result['services'] = ['zabbix_agentd']; return array($result); } diff --git a/net/frr/src/etc/inc/plugins.inc.d/frr.inc b/net/frr/src/etc/inc/plugins.inc.d/frr.inc index ff2b3f5a7b..3b546e8303 100644 --- a/net/frr/src/etc/inc/plugins.inc.d/frr.inc +++ b/net/frr/src/etc/inc/plugins.inc.d/frr.inc @@ -142,5 +142,6 @@ function frr_xmlrpc_sync() $result['id'] = 'quagga'; $result['section'] = 'OPNsense.quagga'; $result['description'] = gettext('FRR'); + $result['services'] = ['frr']; return array($result); } diff --git a/net/haproxy/src/etc/inc/plugins.inc.d/haproxy.inc b/net/haproxy/src/etc/inc/plugins.inc.d/haproxy.inc index 320127ded3..cfeabbc4d2 100644 --- a/net/haproxy/src/etc/inc/plugins.inc.d/haproxy.inc +++ b/net/haproxy/src/etc/inc/plugins.inc.d/haproxy.inc @@ -79,5 +79,6 @@ function haproxy_xmlrpc_sync() $result['id'] = 'haproxy'; $result['section'] = 'OPNsense.HAProxy'; $result['description'] = gettext('HAProxy Load Balancer'); + $result['services'] = ['haproxy']; return array($result); } diff --git a/net/relayd/src/etc/inc/plugins.inc.d/relayd.inc b/net/relayd/src/etc/inc/plugins.inc.d/relayd.inc index eb3b9f931f..08b2e98b4a 100644 --- a/net/relayd/src/etc/inc/plugins.inc.d/relayd.inc +++ b/net/relayd/src/etc/inc/plugins.inc.d/relayd.inc @@ -73,6 +73,7 @@ function relayd_xmlrpc_sync() $result[] = array( 'description' => gettext('Relayd Load Balancer'), 'section' => 'OPNsense.relayd', + 'services' => ['relayd'], /* kept for backwards compat: */ 'id' => 'lb', ); diff --git a/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc b/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc index 88f8e5bcda..e273043341 100644 --- a/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc +++ b/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc @@ -59,6 +59,7 @@ function tayga_xmlrpc_sync() $result['id'] = 'taygavpn'; $result['section'] = 'OPNsense.tayga'; $result['description'] = gettext('Tayga'); + $result['services'] = ['tayga']; return array($result); } diff --git a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc index d2ec171b70..42c4f7b051 100644 --- a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc @@ -75,5 +75,6 @@ function wireguard_xmlrpc_sync() $result['id'] = 'wireguard'; $result['section'] = 'OPNsense.wireguard'; $result['description'] = gettext('WireGuard'); + $result['services'] = ['wireguard-go']; return array($result); } diff --git a/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc b/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc index 2b8c5fff2d..51550d04e1 100644 --- a/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc +++ b/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc @@ -79,5 +79,6 @@ function openconnect_xmlrpc_sync() $result['id'] = 'openconnectvpn'; $result['section'] = 'OPNsense.openconnect'; $result['description'] = gettext('OpenConnect'); + $result['services'] = ['tincd']; return array($result); } diff --git a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc index 335e708021..374e2ab1a2 100644 --- a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc +++ b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc @@ -135,6 +135,7 @@ function stunnel_xmlrpc_sync() 'description' => gettext('Stunnel'), 'section' => 'OPNsense.Stunnel', 'id' => 'stunnel', + 'services' => ['stunnel', 'identd_stunnel'], ); return $result; } diff --git a/security/tinc/src/etc/inc/plugins.inc.d/tinc.inc b/security/tinc/src/etc/inc/plugins.inc.d/tinc.inc index d2afe051bf..8d714a4a38 100644 --- a/security/tinc/src/etc/inc/plugins.inc.d/tinc.inc +++ b/security/tinc/src/etc/inc/plugins.inc.d/tinc.inc @@ -104,5 +104,6 @@ function tinc_xmlrpc_sync() $result['id'] = 'tincvpn'; $result['section'] = 'OPNsense.Tinc'; $result['description'] = gettext('Tinc VPN'); + $result['services'] = ['tincd']; return array($result); } diff --git a/www/nginx/src/etc/inc/plugins.inc.d/nginx.inc b/www/nginx/src/etc/inc/plugins.inc.d/nginx.inc index a84b5c639c..cf35e06139 100644 --- a/www/nginx/src/etc/inc/plugins.inc.d/nginx.inc +++ b/www/nginx/src/etc/inc/plugins.inc.d/nginx.inc @@ -61,5 +61,6 @@ function nginx_xmlrpc_sync() $result['id'] = 'nginx'; $result['section'] = 'OPNsense.Nginx'; $result['description'] = gettext('Nginx Load Balancer'); + $result['services'] = ['nginx']; return array($result); } From 73bc94bd5da2b822632977759e6cf96abc09f344 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 Mar 2021 18:37:46 +0200 Subject: [PATCH 0492/3088] net/freeradius: Add HA config sync (#2300) --- net/freeradius/Makefile | 3 +-- net/freeradius/pkg-descr | 4 ++++ .../src/etc/inc/plugins.inc.d/freeradius.inc | 11 ++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index a62c2a0d52..1b61d34a68 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= freeradius -PLUGIN_VERSION= 1.9.9 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.9.10 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index 76ee5794f7..d0d029ffd1 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -15,6 +15,10 @@ The server is fast, feature-rich, modular, and scalable. Plugin Changelog ================ +1.9.10 + +* Add HA config sync + 1.9.9 * Create option to set EAP-TTLS-GTC (contributed by Kjeld Schouten-Lebbing) diff --git a/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc b/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc index 64640fcd45..6f36e4bd1f 100644 --- a/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc +++ b/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc @@ -1,7 +1,7 @@ + Copyright (C) 2017 - 2021 Michael Muenz All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,3 +47,12 @@ function freeradius_services() return $services; } + +function freeradius_xmlrpc_sync() +{ + $result = array(); + $result['id'] = 'freeradius'; + $result['section'] = 'OPNsense.freeradius'; + $result['description'] = gettext('Freeradius'); + return array($result); +} From 2faa645086ac7af5a15ffa5125f69189dc0e8675 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 27 Mar 2021 19:51:56 +0100 Subject: [PATCH 0493/3088] net/freeradius: HA config sync, add services binding. for https://github.com/opnsense/plugins/pull/2300 --- net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc b/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc index 6f36e4bd1f..dfe576325c 100644 --- a/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc +++ b/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc @@ -54,5 +54,6 @@ function freeradius_xmlrpc_sync() $result['id'] = 'freeradius'; $result['section'] = 'OPNsense.freeradius'; $result['description'] = gettext('Freeradius'); + $result['services'] = ["freeradius"]; return array($result); } From 095740ab393f6e572c359fbedef17d76c3c82cd7 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 29 Mar 2021 00:01:10 +0200 Subject: [PATCH 0494/3088] net/haproxy: ignore incompatible options when LibreSSL is used, refs #2013 --- net/haproxy/pkg-descr | 5 +++++ .../service/templates/OPNsense/HAProxy/haproxy.conf | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 69ef2148a7..2dbcc504d4 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.2 + +Changed: +* ignore incompatible ciphersuites options when LibreSSL is used (#2013) + 3.1 Fixed: diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index a530b0a7a1..d9923f7996 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -926,7 +926,11 @@ global ssl-default-bind-ciphers {{ OPNsense.HAProxy.general.tuning.ssl_cipherList }} {% endif %} {% if OPNsense.HAProxy.general.tuning.ssl_cipherSuites|default("") != "" %} +{% if helpers.exists('system.firmware.flavour') and not(helpers.empty('system.firmware.flavour')) and system.firmware.flavour|default('') == 'libressl' %} + # WARNING: ssl-default-bind-ciphersuites cannot be used with flavour {{ system.firmware.flavour}}. +{% else %} ssl-default-bind-ciphersuites {{ OPNsense.HAProxy.general.tuning.ssl_cipherSuites }} +{% endif %} {% endif %} {% endif %} {# # pass-through options #} @@ -1162,7 +1166,11 @@ frontend {{frontend.name}} {% do ssl_options.append('ciphers ' ~ frontend.ssl_cipherList) %} {% endif %} {% if frontend.ssl_cipherSuites|default("") != "" %} -{% do ssl_options.append('ciphersuites ' ~ frontend.ssl_cipherSuites) %} +{% if helpers.exists('system.firmware.flavour') and not(helpers.empty('system.firmware.flavour')) and system.firmware.flavour|default('') == 'libressl' %} + # WARNING: ciphersuites cannot be used with flavour {{ system.firmware.flavour}}. +{% else %} +{% do ssl_options.append('ciphersuites ' ~ frontend.ssl_cipherSuites) %} +{% endif %} {% endif %} {# # HSTS #} {% if frontend.ssl_hstsEnabled|default("") == '1' and frontend.mode == 'http' %} From bd3811438708311dd5966a5733589879dab9c622 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 29 Mar 2021 00:04:12 +0200 Subject: [PATCH 0495/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index c2f195fc2a..381ec9f771 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.1 +PLUGIN_VERSION= 3.2 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de From 00cab9b5de04737bb44ff2f26345f141af9b7ca6 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 29 Mar 2021 09:49:13 +0200 Subject: [PATCH 0496/3088] xmlrpc has sync - typo in https://github.com/opnsense/plugins/commit/f557e2b09a2f927a31b5fa7e2173b941e6dd0988 --- security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc b/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc index 51550d04e1..c14a9d26d1 100644 --- a/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc +++ b/security/openconnect/src/etc/inc/plugins.inc.d/openconnect.inc @@ -79,6 +79,6 @@ function openconnect_xmlrpc_sync() $result['id'] = 'openconnectvpn'; $result['section'] = 'OPNsense.openconnect'; $result['description'] = gettext('OpenConnect'); - $result['services'] = ['tincd']; + $result['services'] = ['openconnect']; return array($result); } From 64ba7429d2d4dc82cfb95565797a8f2d06ca261b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 29 Mar 2021 09:44:30 +0200 Subject: [PATCH 0497/3088] sysutils/smart: bump version --- sysutils/smart/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sysutils/smart/Makefile b/sysutils/smart/Makefile index a02589a0be..ccc3474b27 100644 --- a/sysutils/smart/Makefile +++ b/sysutils/smart/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= smart -PLUGIN_VERSION= 2.1 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 2.2 PLUGIN_COMMENT= SMART tools PLUGIN_DEPENDS= smartmontools PLUGIN_MAINTAINER= franco@opnsense.org From 648b18301fa384064233a7f77487d41a610b44a2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 29 Mar 2021 09:47:59 +0200 Subject: [PATCH 0498/3088] plugins: bump a few revisions where metadata changed --- dns/bind/Makefile | 2 +- net-mgmt/zabbix-agent/Makefile | 2 +- net/frr/Makefile | 2 +- net/relayd/Makefile | 2 +- net/tayga/Makefile | 2 +- security/openconnect/Makefile | 2 +- security/tinc/Makefile | 2 +- www/nginx/Makefile | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index e16959f8e3..1909668726 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= bind PLUGIN_VERSION= 1.16 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/zabbix-agent/Makefile b/net-mgmt/zabbix-agent/Makefile index af1be66116..40f39eee66 100644 --- a/net-mgmt/zabbix-agent/Makefile +++ b/net-mgmt/zabbix-agent/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= zabbix-agent PLUGIN_VERSION= 1.8 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Zabbix monitoring agent PLUGIN_DEPENDS= zabbix5-agent PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/frr/Makefile b/net/frr/Makefile index 9172a4a4ab..11c964bfd8 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.21 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/relayd/Makefile b/net/relayd/Makefile index c7bd04749f..de76204b17 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= relayd PLUGIN_VERSION= 2.4 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com diff --git a/net/tayga/Makefile b/net/tayga/Makefile index 33f54830ff..e350d4580b 100644 --- a/net/tayga/Makefile +++ b/net/tayga/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= tayga PLUGIN_VERSION= 1.1 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Tayga NAT64 PLUGIN_DEPENDS= tayga PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/openconnect/Makefile b/security/openconnect/Makefile index afd5f9a200..ce2b17e2d6 100644 --- a/security/openconnect/Makefile +++ b/security/openconnect/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= openconnect PLUGIN_VERSION= 1.4.0 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= OpenConnect Client PLUGIN_DEPENDS= openconnect PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/tinc/Makefile b/security/tinc/Makefile index 4e6a8afafe..e7bcf5a701 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= tinc PLUGIN_VERSION= 1.6 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 4964118c00..28fcf5bbeb 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= nginx PLUGIN_VERSION= 1.21 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From 6cca3bee4e6340fa2033ef614f63897e27722907 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 29 Mar 2021 09:52:56 +0200 Subject: [PATCH 0499/3088] security/openconnect: once is enough --- security/openconnect/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/openconnect/Makefile b/security/openconnect/Makefile index ce2b17e2d6..7dc3f6859b 100644 --- a/security/openconnect/Makefile +++ b/security/openconnect/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= openconnect PLUGIN_VERSION= 1.4.0 -PLUGIN_REVISION= 3 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= OpenConnect Client PLUGIN_DEPENDS= openconnect PLUGIN_MAINTAINER= m.muenz@gmail.com From 30da21dcaff6eab6ccde8618ef0992baa49bea2e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 29 Mar 2021 09:54:51 +0200 Subject: [PATCH 0500/3088] net/freeradius: sync LICENSE and small cleanup --- LICENSE | 2 +- .../src/etc/inc/plugins.inc.d/freeradius.inc | 48 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/LICENSE b/LICENSE index 7079730ae9..64a02ae244 100644 --- a/LICENSE +++ b/LICENSE @@ -22,7 +22,7 @@ Copyright (c) 2019 Juergen Kellerer Copyright (c) 2003-2004 Manuel Kasper Copyright (c) 2020 Marc Leuser Copyright (c) 2020 Martin Wasley -Copyright (c) 2017-2020 Michael Muenz +Copyright (c) 2017-2021 Michael Muenz Copyright (c) 2004-2012 Scott Ullrich Copyright (c) 2010 Seth Mos Copyright (c) 2008 Shrew Soft Inc. diff --git a/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc b/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc index dfe576325c..ab1a541762 100644 --- a/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc +++ b/net/freeradius/src/etc/inc/plugins.inc.d/freeradius.inc @@ -1,30 +1,30 @@ - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (C) 2017-2021 Michael Muenz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ function freeradius_services() { From a35d368f5d5e9e9d2bed11780de1bf4fb5127d73 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 30 Mar 2021 09:43:05 +0200 Subject: [PATCH 0501/3088] make: core releng additions --- Mk/defaults.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 1ec722ffe0..6210fd1e89 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -121,7 +121,9 @@ mfc: ensure-stable fi .else @git checkout stable/${PLUGIN_ABI} - @git cherry-pick -x ${MFC} + @if ! git cherry-pick -x ${MFC}; then \ + git cherry-pick --abort; \ + fi .endif @git checkout master .endfor @@ -131,3 +133,8 @@ stable: master: @git checkout master + +rebase: + @git checkout stable/${PLUGIN_ABI} + @git rebase -i + @git checkout master From 78bcfc0b1b0be4aaf1c90bfda105f90abbd64058 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 31 Mar 2021 10:23:15 +0200 Subject: [PATCH 0502/3088] net/wireguard: assorted simple changes --- .../src/etc/inc/plugins.inc.d/wireguard.inc | 50 ++++++++-------- .../forms/dialogEditWireguardServer.xml | 1 + .../app/views/OPNsense/Wireguard/general.volt | 58 +++++++++---------- .../scripts/OPNsense/Wireguard/genkey.sh | 18 +++--- .../conf/actions.d/actions_wireguard.conf | 20 +++---- .../src/www/widgets/include/wireguard.inc | 1 + .../www/widgets/widgets/wireguard.widget.php | 2 +- 7 files changed, 72 insertions(+), 78 deletions(-) diff --git a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc index 42c4f7b051..f4f58fffdf 100644 --- a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc @@ -1,30 +1,30 @@ - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (C) 2018 Michael Muenz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * TERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ function wireguard_enabled() { @@ -41,7 +41,7 @@ function wireguard_services() } $services[] = array( - 'description' => gettext('Wireguard VPN'), + 'description' => gettext('WireGuard VPN'), 'configd' => array( 'restart' => array('wireguard restart'), 'start' => array('wireguard start'), diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml index 9354e8abfe..1a11881210 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml @@ -48,6 +48,7 @@ select_multiple true + true Set the interface specific DNS server. diff --git a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt index fa720d7042..60c1c6c390 100644 --- a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt +++ b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt @@ -1,31 +1,29 @@ {# - -OPNsense® is Copyright © 2014 – 2018 by Deciso B.V. -This file is Copyright © 2018 by Michael Muenz -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -#} + # OPNsense (c) 2014-2018 by Deciso B.V. + # OPNsense (c) 2018 Michael Muenz + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #}
    @@ -71,7 +69,7 @@ POSSIBILITY OF SUCH DAMAGE.

    - +

    @@ -100,7 +98,7 @@ POSSIBILITY OF SUCH DAMAGE.

    - +

    diff --git a/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/genkey.sh b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/genkey.sh index 1cb5e59201..b580bf49dc 100755 --- a/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/genkey.sh +++ b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/genkey.sh @@ -30,8 +30,8 @@ GENPRIV="/usr/local/bin/wg genkey" GENPUB="/usr/local/bin/wg pubkey" cleanup() { - # Delete old files - rm -f $TMPDIR/wireguard.* + # Delete old files + rm -f $TMPDIR/wireguard.* } private() { @@ -45,11 +45,11 @@ public() { } case "$1" in - private) - cleanup - private - ;; - public) - public - ;; +private) + cleanup + private + ;; +public) + public + ;; esac diff --git a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf index 38a58fa0c8..3257da26d0 100644 --- a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf +++ b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf @@ -5,13 +5,13 @@ command: /usr/local/etc/rc.routing_configure parameters: type:script -message:starting Wireguard +message:Starting WireGuard [stop] command:/usr/local/etc/rc.d/wireguard stop parameters: type:script -message:stopping Wireguard +message:Stopping WireGuard [restart] command: @@ -20,29 +20,23 @@ command: /usr/local/etc/rc.routing_configure parameters: type:script -message:restarting Wireguard -description: Restart Wireguard +message:Restarting WireGuard +description: Restart WireGuard [genkey] command:/usr/local/opnsense/scripts/OPNsense/Wireguard/genkey.sh parameters: %s type:script_output -message:generating Wireguard keys +message:Generating WireGuard keys [showconf] command:/usr/local/bin/wg show all parameters: type:script_output -message:show Wireguard config +message:Show WireGuard config [showhandshake] command:/usr/local/bin/wg show all latest-handshakes parameters: type:script_output -message:show Wireguard handshakes - -[widget] -command:/usr/local/bin/wg show all latest-handshakes -parameters: -type:script_output -message:show Wireguard handshakes for widget +message:Show WireGuard handshakes diff --git a/net/wireguard/src/www/widgets/include/wireguard.inc b/net/wireguard/src/www/widgets/include/wireguard.inc index 4d93377615..b95fc1fa6f 100644 --- a/net/wireguard/src/www/widgets/include/wireguard.inc +++ b/net/wireguard/src/www/widgets/include/wireguard.inc @@ -1,3 +1,4 @@ From cd055ae707f719c2d3e3627b977c8fc155dfaacc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 31 Mar 2021 10:31:18 +0200 Subject: [PATCH 0503/3088] net/wireguard: typo in refactor --- net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc index f4f58fffdf..68de9927ee 100644 --- a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc @@ -20,7 +20,7 @@ * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * TERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. From a4fab385be7c9a171872e495b6cbe403d32e31c9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 31 Mar 2021 11:41:13 +0200 Subject: [PATCH 0504/3088] net/wireguard: make listen port optional, reformat config and header style --- .../Wireguard/Api/ServerController.php | 42 +++++++++---------- .../forms/dialogEditWireguardServer.xml | 2 +- .../app/models/OPNsense/Wireguard/Server.xml | 3 +- .../OPNsense/Wireguard/wireguard-server.conf | 9 ++-- 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServerController.php b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServerController.php index c505ecb2ab..a492e93802 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServerController.php +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServerController.php @@ -1,31 +1,29 @@ +/* + * Copyright (C) 2018 Michael Muenz + * All rights reserved. * - * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ namespace OPNsense\Wireguard\Api; diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml index 1a11881210..3667908a88 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml @@ -33,7 +33,7 @@ server.port text - Set port for this instance to listen on. + Optionally set a fixed port for this instance to listen on. The standard port range starts at 51820.
    server.mtu diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml index 01bae78842..c5ff1d90f4 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml @@ -28,8 +28,7 @@ N - 51820 - Y + N 1 diff --git a/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf b/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf index 0d07a5ff3e..374c3c82ba 100644 --- a/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf +++ b/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf @@ -1,19 +1,20 @@ {% if helpers.exists('OPNsense.wireguard.general.enabled') and OPNsense.wireguard.general.enabled == '1' %} - {% if helpers.exists('OPNsense.wireguard.server.servers.server') %} {% for server_list in helpers.toList('OPNsense.wireguard.server.servers.server') %} {% if TARGET_FILTERS['OPNsense.wireguard.server.servers.server.' ~ loop.index0] or TARGET_FILTERS['OPNsense.wireguard.server.servers.server'] %} {% if server_list.enabled == '1' %} [Interface] +PrivateKey = {{ server_list.privkey }} Address = {{ server_list.tunneladdress }} +{% if server_list.port|default('') != '' %} +ListenPort = {{ server_list.port }} +{% endif %} {% if server_list.dns|default('') != '' %} DNS = {{ server_list.dns }} {% endif %} {% if server_list.mtu|default('') != '' %} MTU = {{ server_list.mtu }} {% endif %} -ListenPort = {{ server_list.port }} -PrivateKey = {{ server_list.privkey }} {% if server_list.disableroutes == '1' %} Table = off {% endif %} @@ -25,6 +26,7 @@ PostDown = route {{- ' -6' if ':' in server_list.gateway }} del {{ server_list.g {% for peerlist in server_list.peers.split(",") %} {% set peerlist2_data = helpers.getUUID(peerlist) %} {% if peerlist2_data != {} and peerlist2_data.enabled == '1' %} + [Peer] PublicKey = {{ peerlist2_data.pubkey }} {% if peerlist2_data.psk|default('') != '' %} @@ -44,5 +46,4 @@ PersistentKeepalive = {{ peerlist2_data.keepalive }} {% endif %} {% endfor %} {% endif %} - {% endif %} From aed72a5fec7bac71ef8f9d4c08be08a757ea1a39 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 31 Mar 2021 11:50:38 +0200 Subject: [PATCH 0505/3088] net/wireguard: small update to mimic default demo configuration --- .../service/templates/OPNsense/Wireguard/wireguard-server.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf b/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf index 374c3c82ba..82db761908 100644 --- a/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf +++ b/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf @@ -32,10 +32,10 @@ PublicKey = {{ peerlist2_data.pubkey }} {% if peerlist2_data.psk|default('') != '' %} PresharedKey = {{ peerlist2_data.psk }} {% endif %} -AllowedIPs = {{ peerlist2_data.tunneladdress }} {% if peerlist2_data.serveraddress|default('') != '' %} Endpoint = {{ peerlist2_data.serveraddress }}:{{ peerlist2_data.serverport }} {% endif %} +AllowedIPs = {{ peerlist2_data.tunneladdress }} {% if peerlist2_data.keepalive|default('') != '' %} PersistentKeepalive = {{ peerlist2_data.keepalive }} {% endif %} From 16f3522d08d30919b17e66bdec38352ef4c75208 Mon Sep 17 00:00:00 2001 From: tiny6996 Date: Fri, 2 Apr 2021 13:18:23 -0500 Subject: [PATCH 0506/3088] fixes #2239 addes suricata eve.json as input (#2309) --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 3 +++ .../mvc/app/controllers/OPNsense/Telegraf/forms/input.xml | 6 ++++++ .../opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml | 4 ++++ .../service/templates/OPNsense/Telegraf/telegraf.conf | 8 ++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index c5279eb7ab..fc30142acd 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.9.0 +PLUGIN_VERSION= 1.10.0 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index b49f834fbc..2bd64b400e 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -10,6 +10,9 @@ Kafka, MQTT, NSQ, and many others. Plugin Changelog ================ +1.10.0 + +* Add intrusion detection alert input 1.9.0 diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml index d7ec44fbba..992c4bb375 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml @@ -137,4 +137,10 @@ checkbox Can increase metric gather times. + + input.intrusion_detection_alerts + + checkbox + Requires Intrustion detection alerts are stored locally. + diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index c3b090acf7..588f3061cf 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -121,5 +121,9 @@ N + + 0 + N + diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index 07d1d38b82..09bff97eee 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -252,6 +252,14 @@ {% else %} dns_lookup = false {% endif %} +{% if helpers.exists('OPNsense.telegraf.input.intrusion_detection_alerts') and OPNsense.telegraf.input.intrusion_detection_alerts == '1' %} +[[inputs.tail]] + data_format = "json" + files = ["/var/log/suricata/eve.json"] + name_override = "suricata" + tag_keys = ["event_type","src_ip","src_port","dest_ip","dest_port"] + json_string_fields = ["*"] +{% endif %} {% endif %} {% endif %} From 600290ce200558017e0f157430564e5cd796a13c Mon Sep 17 00:00:00 2001 From: Christian Brueffer Date: Tue, 6 Apr 2021 11:21:55 +0200 Subject: [PATCH 0507/3088] mail/postfix: fix a bunch of parameter description typos. (#2317) --- .../app/controllers/OPNsense/Postfix/forms/general.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml index 97d2d23230..0b7f475da0 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml @@ -81,7 +81,7 @@ select_multiple true - Masquerade internal domains to the outside. When you set example.com, the domain host.internal.example.com will be rewritten to exmaple.com when mail leaves the system. + Masquerade internal domains to the outside. When you set example.com, the domain host.internal.example.com will be rewritten to example.com when mail leaves the system.
    general.disable_ssl @@ -148,7 +148,7 @@ checkbox true - If you enable this, every entry in Recipients will be checked against. When there is no match mail will be rejected. Be aware that it does not matter if the action is "OK" or "REJECT". This setup allows you to run postfix in front of an internal system and already rejecting unsolicited mail at the border. + If you enable this, every entry in Recipients will be checked against. When there is no match mail will be rejected. Be aware that it does not matter if the action is "OK" or "REJECT". This setup allows you to run postfix in front of an internal system and already reject unsolicited mail at the border. general.extensive_helo_restrictions @@ -162,7 +162,7 @@ general.reject_unknown_client_hostname - + checkbox @@ -177,7 +177,7 @@ general.reject_unknown_helo_hostname - + checkbox From 41bbb4872fe4cfed35d6eef454fdda7fe04a9fd7 Mon Sep 17 00:00:00 2001 From: Christian Brueffer Date: Tue, 6 Apr 2021 12:17:28 +0200 Subject: [PATCH 0508/3088] mail/postfix: fix more label/help typos. (#2318) --- .../mvc/app/controllers/OPNsense/Postfix/forms/general.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml index 0b7f475da0..1ad688f19d 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml @@ -123,7 +123,7 @@ general.relayhost text - Set the IP address or FQDN where all outgoung mails are sent to. + Set the IP address or FQDN where all outgoing mails are sent to. general.smtpauth_enabled @@ -198,13 +198,13 @@ general.reject_non_fqdn_sender - + checkbox For example senders without a domain or only a hostname. general.reject_non_fqdn_recipient - + checkbox For example recipients without a domain or only a hostname. From 926d426442d2e3401d0e296ee54d512de3137dce Mon Sep 17 00:00:00 2001 From: Christian Brueffer Date: Tue, 6 Apr 2021 12:22:20 +0200 Subject: [PATCH 0509/3088] sysutils/munin-node: fix description typo. (#2242) --- README.md | 2 +- sysutils/munin-node/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78311c2290..80ca245301 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ sysutils/git-backup -- Track config changes using git sysutils/hw-probe -- Collect hardware diagnostics sysutils/lcdproc-sdeclcd -- LCDProc for SDEC LCD devices sysutils/mail-backup -- Send configuration file backup by e-mail -sysutils/munin-node -- Munin monitorin agent +sysutils/munin-node -- Munin monitoring agent sysutils/node_exporter -- Prometheus exporter for machine metrics sysutils/nut -- Network UPS Tools sysutils/smart -- SMART tools diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile index 9012e10407..95702e163b 100644 --- a/sysutils/munin-node/Makefile +++ b/sysutils/munin-node/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= munin-node PLUGIN_VERSION= 1.0 PLUGIN_REVISION= 1 -PLUGIN_COMMENT= Munin monitorin agent +PLUGIN_COMMENT= Munin monitoring agent PLUGIN_DEPENDS= munin-node PLUGIN_MAINTAINER= m.muenz@gmail.com From 6a42c655b67eb8c56b61438c362d67bf832c4ec4 Mon Sep 17 00:00:00 2001 From: Christian Brueffer Date: Tue, 6 Apr 2021 14:17:54 +0200 Subject: [PATCH 0510/3088] mail/postfix: more typo fixes. (#2319) --- .../OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml | 2 +- .../mvc/app/controllers/OPNsense/Postfix/forms/general.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml index bde023d7db..5fe46d1414 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/dialogEditPostfixHeadercheck.xml @@ -16,6 +16,6 @@ dropdown See the Postfix manual about header_checks(5)]]> - RECEIVING = header_checks / DELIVERING = smtp_header_checks + RECEIVING = header_checks / DELIVERING = smtp_header_checks diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml index 1ad688f19d..7b21cc1300 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml @@ -73,7 +73,7 @@ general.message_size_limit text - Set the max size for messages to accept, default is 501200000 Byte which is 50MB. Values must be entered in Bytes. + Set the max size for messages to accept, default is 51200000 Bytes which is 50MB. Values must be entered in Bytes. general.masquerade_domains From 8ef4dbf1989da018ceeb9d2b8f99b01a2af84917 Mon Sep 17 00:00:00 2001 From: Hippi Viking <33314937+hippi-viking@users.noreply.github.com> Date: Wed, 7 Apr 2021 07:30:52 +0000 Subject: [PATCH 0511/3088] Allow maltrail sensor periodic restart from webGUI (#2322) Maltrail sensor is a memory hog (or it might leak memory), if I don't restart it every few days it crashes with OOM or worst case it takes suricata and/or ntopng with it as well. The commit makes the Maltrail sensor restart option visible webGUI's cron settings to make restarting convenient. --- .../opnsense/service/conf/actions.d/actions_maltrailsensor.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/security/maltrail/src/opnsense/service/conf/actions.d/actions_maltrailsensor.conf b/security/maltrail/src/opnsense/service/conf/actions.d/actions_maltrailsensor.conf index fa6090dd0b..51b2c66536 100644 --- a/security/maltrail/src/opnsense/service/conf/actions.d/actions_maltrailsensor.conf +++ b/security/maltrail/src/opnsense/service/conf/actions.d/actions_maltrailsensor.conf @@ -15,6 +15,7 @@ command:/usr/local/opnsense/scripts/OPNsense/Maltrail/setup.sh;/usr/local/etc/rc parameters: type:script message:restarting Maltrail sensor +description:Restart Maltrail sensor [status] command:/usr/local/etc/rc.d/opnsense-maltrailsensor status;exit 0 From c890b9795280a865bf4c9b94aefda7d9b344c87d Mon Sep 17 00:00:00 2001 From: definitio <37266727+definitio@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:22:40 +0300 Subject: [PATCH 0512/3088] Update HAProxy OCSP stapling via local UNIX socket --- .../src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh index 12c4c8724e..6bf8af9283 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/updateOcsp.sh @@ -18,6 +18,7 @@ # along with this program. If not, see . HAPROXY_DIR="/tmp/haproxy/ssl" +HAPROXY_SOCKET="/var/run/haproxy.socket" for _pem in "$HAPROXY_DIR"/*.pem; do cert_file="$(basename "$_pem")" @@ -64,6 +65,11 @@ for _pem in "$HAPROXY_DIR"/*.pem; do if [ "${_ret}" != "0" ]; then echo "Updating OCSP stapling failed with return code ${_ret}" + else + _update="$(openssl enc -base64 -A -in "${_ocsp}")" + if ! echo "set ssl ocsp-response ${_update}" | socat stdio $HAPROXY_SOCKET; then + echo "Updating haproxy OCSP stapling via socket failed" + fi fi fi fi From bf8329957a1778beacf8ee02e5aef0a8488ff7a7 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Apr 2021 09:58:02 +0200 Subject: [PATCH 0513/3088] net-mgmt/netdata: allow to set IPv6 address (#1914) --- net-mgmt/netdata/Makefile | 3 +-- net-mgmt/netdata/pkg-descr | 12 ++++++++++++ .../service/templates/OPNsense/Netdata/netdata.conf | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/net-mgmt/netdata/Makefile b/net-mgmt/netdata/Makefile index 3c5fd6b740..cb657ff660 100644 --- a/net-mgmt/netdata/Makefile +++ b/net-mgmt/netdata/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= netdata -PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= Real-time performance monitoring PLUGIN_DEPENDS= netdata PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/netdata/pkg-descr b/net-mgmt/netdata/pkg-descr index e53440aa38..3fc3732e14 100644 --- a/net-mgmt/netdata/pkg-descr +++ b/net-mgmt/netdata/pkg-descr @@ -7,3 +7,15 @@ happening on the systems it runs (including web servers, databases, applications), using highly interactive web dashboards. WWW: https://github.com/netdata/netdata + + +Plugin Changelog +================ + +1.1 + +* Allow listening to IPv6 address + +1.0 + +* Allow to set listening IP and port diff --git a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf index 4b5504a5b5..105254bcc2 100644 --- a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf +++ b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf @@ -10,7 +10,8 @@ # global netdata configuration [global] history = 86400 - bind to = {{ OPNsense.netdata.general.listen }} + bind to = {% if ':' in OPNsense.netdata.general.listen %}[{{ OPNsense.netdata.general.listen }}]{% else %} {{ OPNsense.netdata.general.listen }}{% endif %} + disconnect idle web clients after seconds = 3600 run as user = netdata web files owner = netdata From b6530b6e6205b5869ae6d601385bface9e632c26 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Apr 2021 10:06:16 +0200 Subject: [PATCH 0514/3088] mail/fetchmail: New plugin (#2093) --- mail/fetchmail/Makefile | 8 ++ mail/fetchmail/pkg-descr | 15 +++ .../src/etc/inc/plugins.inc.d/fetchmail.inc | 49 ++++++++++ .../Fetchmail/Api/GeneralController.php | 37 ++++++++ .../Fetchmail/Api/MailboxController.php | 67 ++++++++++++++ .../Fetchmail/Api/ServiceController.php | 43 +++++++++ .../OPNsense/Fetchmail/GeneralController.php | 38 ++++++++ .../OPNsense/Fetchmail/MailboxController.php | 38 ++++++++ .../forms/dialogEditFetchmailMailbox.xml | 56 ++++++++++++ .../OPNsense/Fetchmail/forms/general.xml | 14 +++ .../app/models/OPNsense/Fetchmail/ACL/ACL.xml | 9 ++ .../app/models/OPNsense/Fetchmail/General.php | 34 +++++++ .../app/models/OPNsense/Fetchmail/General.xml | 15 +++ .../app/models/OPNsense/Fetchmail/Mailbox.php | 34 +++++++ .../app/models/OPNsense/Fetchmail/Mailbox.xml | 45 +++++++++ .../models/OPNsense/Fetchmail/Menu/Menu.xml | 8 ++ .../app/views/OPNsense/Fetchmail/general.volt | 61 +++++++++++++ .../app/views/OPNsense/Fetchmail/mailbox.volt | 91 +++++++++++++++++++ .../scripts/OPNsense/Fetchmail/setup.sh | 5 + .../conf/actions.d/actions_fetchmail.conf | 24 +++++ .../templates/OPNsense/Fetchmail/+TARGETS | 2 + .../templates/OPNsense/Fetchmail/fetchmail | 6 ++ .../templates/OPNsense/Fetchmail/fetchmailrc | 14 +++ 23 files changed, 713 insertions(+) create mode 100644 mail/fetchmail/Makefile create mode 100644 mail/fetchmail/pkg-descr create mode 100644 mail/fetchmail/src/etc/inc/plugins.inc.d/fetchmail.inc create mode 100644 mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/GeneralController.php create mode 100644 mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/MailboxController.php create mode 100644 mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/ServiceController.php create mode 100644 mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/GeneralController.php create mode 100644 mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/MailboxController.php create mode 100644 mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/forms/dialogEditFetchmailMailbox.xml create mode 100644 mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/forms/general.xml create mode 100644 mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/ACL/ACL.xml create mode 100644 mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php create mode 100644 mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.xml create mode 100644 mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.php create mode 100644 mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml create mode 100644 mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Menu/Menu.xml create mode 100644 mail/fetchmail/src/opnsense/mvc/app/views/OPNsense/Fetchmail/general.volt create mode 100644 mail/fetchmail/src/opnsense/mvc/app/views/OPNsense/Fetchmail/mailbox.volt create mode 100644 mail/fetchmail/src/opnsense/scripts/OPNsense/Fetchmail/setup.sh create mode 100644 mail/fetchmail/src/opnsense/service/conf/actions.d/actions_fetchmail.conf create mode 100644 mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/+TARGETS create mode 100644 mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmail create mode 100644 mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc diff --git a/mail/fetchmail/Makefile b/mail/fetchmail/Makefile new file mode 100644 index 0000000000..a2a871f380 --- /dev/null +++ b/mail/fetchmail/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= fetchmail +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= Remote-mail retrieval utility +PLUGIN_DEPENDS= fetchmail +PLUGIN_MAINTAINER= m.muenz@gmail.com +PLUGIN_DEVEL= yes + +.include "../../Mk/plugins.mk" diff --git a/mail/fetchmail/pkg-descr b/mail/fetchmail/pkg-descr new file mode 100644 index 0000000000..8ae7146501 --- /dev/null +++ b/mail/fetchmail/pkg-descr @@ -0,0 +1,15 @@ +Fetchmail is a full-featured, robust, well-documented remote-mail retrieval and forwarding +utility intended to be used over on-demand TCP/IP links (such as SLIP or PPP connections). +It supports every remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP, +KPOP, all flavors of IMAP, ETRN, and ODMR. + +Plugin Changelog +================ + +1.0 + +* Allow fetching IMAP mailboxes +* Allow fetching POP3 mailboxes + + +WWW: https://www.fetchmail.info/ diff --git a/mail/fetchmail/src/etc/inc/plugins.inc.d/fetchmail.inc b/mail/fetchmail/src/etc/inc/plugins.inc.d/fetchmail.inc new file mode 100644 index 0000000000..1243a3e6ef --- /dev/null +++ b/mail/fetchmail/src/etc/inc/plugins.inc.d/fetchmail.inc @@ -0,0 +1,49 @@ + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +function fetchmail_services() +{ + global $config; + + $services = array(); + + if (isset($config['OPNsense']['fetchmail']['general']['enabled']) && $config['OPNsense']['fetchmail']['general']['enabled'] == 1) { + $services[] = array( + 'description' => gettext('Fetchmail'), + 'configd' => array( + 'restart' => array('fetchmail restart'), + 'start' => array('fetchmail start'), + 'stop' => array('fetchmail stop'), + ), + 'name' => 'fetchmail', + 'pidfile' => '/var/run/fetchmail/fetchmail.pid' + ); + } + + return $services; +} diff --git a/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/GeneralController.php b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/GeneralController.php new file mode 100644 index 0000000000..3a9d3ba8f8 --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/GeneralController.php @@ -0,0 +1,37 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Fetchmail\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class GeneralController extends ApiMutableModelControllerBase +{ + protected static $internalModelClass = '\OPNsense\Fetchmail\General'; + protected static $internalModelName = 'general'; +} diff --git a/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/MailboxController.php b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/MailboxController.php new file mode 100644 index 0000000000..403c36152b --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/MailboxController.php @@ -0,0 +1,67 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Fetchmail\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class MailboxController extends ApiMutableModelControllerBase +{ + protected static $internalModelName = 'mailbox'; + protected static $internalModelClass = '\OPNsense\Fetchmail\Mailbox'; + + public function searchMailboxAction() + { + return $this->searchBase('mailboxes.mailbox', array("enabled", "host", "protocol", "user", "password", "destinationmail", "destination")); + } + + public function getMailboxAction($uuid = null) + { + return $this->getBase('mailbox', 'mailboxes.mailbox', $uuid); + } + + public function addMailboxAction() + { + return $this->addBase('mailbox', 'mailboxes.mailbox'); + } + + public function delMailboxAction($uuid) + { + return $this->delBase('mailboxes.mailbox', $uuid); + } + + public function setMailboxAction($uuid) + { + return $this->setBase('mailbox', 'mailboxes.mailbox', $uuid); + } + + public function toggleMailboxAction($uuid) + { + return $this->toggleBase('mailboxes.mailbox', $uuid); + } +} diff --git a/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/ServiceController.php b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/ServiceController.php new file mode 100644 index 0000000000..d3ea06f1aa --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/Api/ServiceController.php @@ -0,0 +1,43 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Fetchmail\Api; + +use OPNsense\Base\ApiMutableServiceControllerBase; + +/** + * Class ServiceController + * @package OPNsense\Fetchmail + */ +class ServiceController extends ApiMutableServiceControllerBase +{ + protected static $internalServiceClass = '\OPNsense\Fetchmail\General'; + protected static $internalServiceTemplate = 'OPNsense/Fetchmail'; + protected static $internalServiceEnabled = 'enabled'; + protected static $internalServiceName = 'fetchmail'; +} diff --git a/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/GeneralController.php b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/GeneralController.php new file mode 100644 index 0000000000..dde96e5211 --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/GeneralController.php @@ -0,0 +1,38 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Fetchmail; + +class GeneralController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->generalForm = $this->getForm("general"); + $this->view->pick('OPNsense/Fetchmail/general'); + } +} diff --git a/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/MailboxController.php b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/MailboxController.php new file mode 100644 index 0000000000..1417158fdd --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/MailboxController.php @@ -0,0 +1,38 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Fetchmail; + +class MailboxController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->formDialogEditFetchmailMailbox = $this->getForm("dialogEditFetchmailMailbox"); + $this->view->pick('OPNsense/Fetchmail/mailbox'); + } +} diff --git a/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/forms/dialogEditFetchmailMailbox.xml b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/forms/dialogEditFetchmailMailbox.xml new file mode 100644 index 0000000000..98307b4d4e --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/forms/dialogEditFetchmailMailbox.xml @@ -0,0 +1,56 @@ +
    + + mailbox.enabled + + checkbox + This will enable or disable the mailbox retrieving. + + + mailbox.host + + text + Hostname of the mail server where mailbox is located. + + + mailbox.protocol + + dropdown + Choose the protocol to use. + + + mailbox.user + + text + Username to authenticate against remote mail server. + + + mailbox.password + + text + Password to authenticate against remote mail server. + + + mailbox.destinationmail + + text + Set the mail address to deliver fetched mails to. + + + mailbox.destination + + text + Set the mail server hostname or IP to deliver fetched mails to. + + + mailbox.usessl + + checkbox + This will enable or disable usage of encrypted connections. For IMAP and POP3 it will switch the ports to 993 and 995. + + + mailbox.sslfingerprint + + text + If the server is using a self-signed certificate, the only option fetching mails is to enter the certficiate fingerprint here. + +
    diff --git a/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/forms/general.xml b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/forms/general.xml new file mode 100644 index 0000000000..ac02481893 --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/controllers/OPNsense/Fetchmail/forms/general.xml @@ -0,0 +1,14 @@ +
    + + general.enabled + + checkbox + This will activate the Fetchmail daemon. + + + general.interval + + text + Interval in seconds how often to retrieve mails. + +
    diff --git a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/ACL/ACL.xml b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/ACL/ACL.xml new file mode 100644 index 0000000000..e3727a40ad --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + Services: Fetchmail + + ui/fetchmail/* + api/fetchmail/* + + + diff --git a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php new file mode 100644 index 0000000000..7c5a75d762 --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php @@ -0,0 +1,34 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + *ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Fetchmail; + +use OPNsense\Base\BaseModel; + +class General extends BaseModel +{ +} diff --git a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.xml b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.xml new file mode 100644 index 0000000000..09cb296c5f --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.xml @@ -0,0 +1,15 @@ + + //OPNsense/fetchmail/general + Fetchmail configuration + 0.1 + + + 0 + Y + + + 600 + Y + + + diff --git a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.php b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.php new file mode 100644 index 0000000000..e843ede942 --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.php @@ -0,0 +1,34 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + *ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Fetchmail; + +use OPNsense\Base\BaseModel; + +class Mailbox extends BaseModel +{ +} diff --git a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml new file mode 100644 index 0000000000..fe711b2c1a --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml @@ -0,0 +1,45 @@ + + //OPNsense/fetchmail/mailbox + Fetchmail configuration + 0.1 + + + + + 1 + Y + + + Y + + + Y + + POP3 + IMAP + + + + Y + + + Y + + + Y + + + Y + + + 1 + Y + + + N + /^[A-Fa-f0-9\:]$/ + + + + + diff --git a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Menu/Menu.xml b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Menu/Menu.xml new file mode 100644 index 0000000000..59c8854d8c --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Menu/Menu.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/mail/fetchmail/src/opnsense/mvc/app/views/OPNsense/Fetchmail/general.volt b/mail/fetchmail/src/opnsense/mvc/app/views/OPNsense/Fetchmail/general.volt new file mode 100644 index 0000000000..77f259c4c3 --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/views/OPNsense/Fetchmail/general.volt @@ -0,0 +1,61 @@ +{# + # + # Copyright (C) 2020 Michael Muenz + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} +
    +
    +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} +
    +
    + +
    +
    +
    +
    + + diff --git a/mail/fetchmail/src/opnsense/mvc/app/views/OPNsense/Fetchmail/mailbox.volt b/mail/fetchmail/src/opnsense/mvc/app/views/OPNsense/Fetchmail/mailbox.volt new file mode 100644 index 0000000000..3be00f23d7 --- /dev/null +++ b/mail/fetchmail/src/opnsense/mvc/app/views/OPNsense/Fetchmail/mailbox.volt @@ -0,0 +1,91 @@ +{# + # + # Copyright (C) 2020 Michael Muenz + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Host') }}{{ lang._('Protocol') }}{{ lang._('Username') }}{{ lang._('Password') }}{{ lang._('Destination') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    + + +
    +
    +
    + +

    +
    +
    +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogEditFetchmailMailbox,'id':'dialogEditFetchmailMailbox','label':lang._('Edit Mailbox')])}} + + diff --git a/mail/fetchmail/src/opnsense/scripts/OPNsense/Fetchmail/setup.sh b/mail/fetchmail/src/opnsense/scripts/OPNsense/Fetchmail/setup.sh new file mode 100644 index 0000000000..394e49ce40 --- /dev/null +++ b/mail/fetchmail/src/opnsense/scripts/OPNsense/Fetchmail/setup.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p /var/run/fetchmail +chown fetchmail:wheel /var/run/fetchmail +chmod 755 /var/run/fetchmail diff --git a/mail/fetchmail/src/opnsense/service/conf/actions.d/actions_fetchmail.conf b/mail/fetchmail/src/opnsense/service/conf/actions.d/actions_fetchmail.conf new file mode 100644 index 0000000000..9c38206dba --- /dev/null +++ b/mail/fetchmail/src/opnsense/service/conf/actions.d/actions_fetchmail.conf @@ -0,0 +1,24 @@ +[start] +command:/usr/local/opnsense/scripts/OPNsense/Fetchmail/setup.sh;/usr/local/etc/rc.d/fetchmail start +parameters: +type:script +message:starting Fetchmail + +[stop] +command:/usr/local/etc/rc.d/fetchmail stop; exit 0 +parameters: +type:script +message:stopping Fetchmail + +[restart] +command:/usr/local/opnsense/scripts/OPNsense/Fetchmail/setup.sh;/usr/local/etc/rc.d/fetchmail restart +parameters: +type:script +message:restarting Fetchmail +description:Restart Fetchmail service + +[status] +command:/usr/local/etc/rc.d/fetchmail status;exit 0 +parameters: +type:script_output +message:request Fetchmail status diff --git a/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/+TARGETS b/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/+TARGETS new file mode 100644 index 0000000000..014ce2e157 --- /dev/null +++ b/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/+TARGETS @@ -0,0 +1,2 @@ +fetchmailrc:/usr/local/etc/fetchmailrc +fetchmail:/etc/rc.conf.d/fetchmail diff --git a/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmail b/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmail new file mode 100644 index 0000000000..4a21f3d9c9 --- /dev/null +++ b/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmail @@ -0,0 +1,6 @@ +{% if helpers.exists('OPNsense.fetchmail.general.enabled') and OPNsense.fetchmail.general.enabled == '1' %} +fetchmail_var_script="/usr/local/opnsense/scripts/OPNsense/Fetchmail/setup.sh" +fetchmail_enable="YES" +{% else %} +fetchmail_enable="NO" +{% endif %} diff --git a/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc b/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc new file mode 100644 index 0000000000..3438c2fcf6 --- /dev/null +++ b/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc @@ -0,0 +1,14 @@ +{% if helpers.exists('OPNsense.fetchmail.general.enabled') and OPNsense.fetchmail.general.enabled == '1' %} + +set daemon {{ OPNsense.fetchmail.general.interval }} +set syslog + +{% if helpers.exists('OPNsense.fetchmail.mailbox.mailboxes.mailbox') %} +{% for mailbox_list in helpers.toList('OPNsense.fetchmail.mailbox.mailboxes.mailbox') %} +{% if mailbox_list.enabled == '1' %} +poll {{ mailbox_list.host }} protocol {{ mailbox_list.protocol }} username "{{ mailbox_list.user }}" password "{{ mailbox_list.password }}" is {{ mailbox_list.destinationmail }} smtphost {{ mailbox_list.destination }} {% if mailbox_list.usessl == "0" %} sslproto '' {% endif %} {% if mailbox_list.sslfingerprint|default('') != '' %} sslfingerprint "{{ mailbox_list.sslfingerprint }}" {% endif %} +{% endif %} +{% endfor %} +{% endif %} + +{% endif %} From e89c92145a16457c7b3e0ebc4a5e900cb9edcc36 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 10 Apr 2021 10:12:23 +0200 Subject: [PATCH 0515/3088] net/chrony: add diagnostics (#2220) --- net/chrony/Makefile | 3 +- net/chrony/pkg-descr | 4 ++ .../OPNsense/Chrony/Api/ServiceController.php | 48 ++++++++++++- .../app/views/OPNsense/Chrony/general.volt | 71 +++++++++++++++++-- .../conf/actions.d/actions_chrony.conf | 24 +++++++ 5 files changed, 140 insertions(+), 10 deletions(-) diff --git a/net/chrony/Makefile b/net/chrony/Makefile index a905579e2f..4bfc40a55c 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= chrony -PLUGIN_VERSION= 1.1 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= Chrony time synchronisation PLUGIN_DEPENDS= chrony PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/chrony/pkg-descr b/net/chrony/pkg-descr index 4464c2fa7a..c273e65812 100644 --- a/net/chrony/pkg-descr +++ b/net/chrony/pkg-descr @@ -4,6 +4,10 @@ better in virtual environments. Plugin Changelog ---------------- +1.2 + +* Add Diagnostics + 1.1 * Add NTS support diff --git a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/ServiceController.php b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/ServiceController.php index d441d9dc68..e3a6813908 100644 --- a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/ServiceController.php +++ b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/Api/ServiceController.php @@ -1,7 +1,7 @@ + * Copyright (C) 2020-2021 Michael Muenz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,6 +29,8 @@ namespace OPNsense\Chrony\Api; use OPNsense\Base\ApiMutableServiceControllerBase; +use OPNsense\Core\Backend; +use OPNsense\Chrony\General; class ServiceController extends ApiMutableServiceControllerBase { @@ -36,4 +38,48 @@ class ServiceController extends ApiMutableServiceControllerBase protected static $internalServiceTemplate = 'OPNsense/Chrony'; protected static $internalServiceEnabled = 'enabled'; protected static $internalServiceName = 'chrony'; + + /** + * show chrony sources + * @return array + */ + public function chronysourcesAction() + { + $backend = new Backend(); + $response = $backend->configdRun("chrony chronysources"); + return array("response" => $response); + } + + /** + * show chrony stats + * @return array + */ + public function chronysourcestatsAction() + { + $backend = new Backend(); + $response = $backend->configdRun("chrony chronysourcestats"); + return array("response" => $response); + } + + /** + * show chrony tracking + * @return array + */ + public function chronytrackingAction() + { + $backend = new Backend(); + $response = $backend->configdRun("chrony chronytracking"); + return array("response" => $response); + } + + /** + * show chrony authdata + * @return array + */ + public function chronyauthdataAction() + { + $backend = new Backend(); + $response = $backend->configdRun("chrony chronyauthdata"); + return array("response" => $response); + } } diff --git a/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt b/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt index be8b75de22..00ba994203 100644 --- a/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt +++ b/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt @@ -1,6 +1,6 @@ {# # Copyright (c) 2019 Deciso B.V. - # Copyright (c) 2020 Michael Muenz + # Copyright (c) 2020-2021 Michael Muenz # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, @@ -25,15 +25,66 @@ # POSSIBILITY OF SUCH DAMAGE. #} -
    - {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} -
    -
    - + + +
    +
    +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} +
    +
    + +
    +
    +
    +
    +
    
    +    
    +
    +
    
    +    
    +
    +
    
    +    
    +
    +
    
         
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogEditBFDNeighbor,'id':'DialogEditBFDNeighbor','label':lang._('Edit Neighbor')])}} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS index a09b88d86a..30b11bedbf 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS @@ -1,3 +1,4 @@ +bfdd.conf:/usr/local/etc/frr/bfdd.conf bgpd.conf:/usr/local/etc/frr/bgpd.conf ospfd.conf:/usr/local/etc/frr/ospfd.conf ospfd_carp.conf:/usr/local/etc/frr/ospfd_carp.conf diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bfdd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bfdd.conf new file mode 100644 index 0000000000..8b13652630 --- /dev/null +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bfdd.conf @@ -0,0 +1,29 @@ +{% if helpers.exists('OPNsense.quagga.bfd.enabled') and OPNsense.quagga.bfd.enabled == '1' %} +! +! Zebra configuration saved from vty +! 2017/03/03 20:21:04 +! +{% if helpers.exists('OPNsense.quagga.general') %} +{% if helpers.exists('OPNsense.quagga.general.enablesyslog') and OPNsense.quagga.general.enablesyslog == '1' %} +log syslog {{ OPNsense.quagga.general.sysloglevel }} +{% endif %} +{% if helpers.exists('OPNsense.quagga.general.profile') %} +frr defaults {{ OPNsense.quagga.general.profile }} +{% endif %} +{% endif %} +! +! +! +line vty +! +! +bfd +{% if helpers.exists('OPNsense.quagga.bfd.neighbors.neighbor') %} +{% for neighbor in helpers.toList('OPNsense.quagga.bfd.neighbors.neighbor') %} +{% if neighbor.enabled == '1' %} + peer {{ neighbor.address }} +{% endif %} +{% endfor %} +{% endif %} +! +{% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr index f119450b6a..2163fb73a3 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr @@ -7,6 +7,7 @@ start_precmd="ifconfig | grep 'carp: MASTER'" frr_daemons="zebra{% if helpers.exists('OPNsense.quagga.ospf.enabled') and OPNsense.quagga.ospf.enabled == '1' %} ospfd{% endif %}{% if helpers.exists('OPNsense.quagga.rip.enabled') and OPNsense.quagga.rip.enabled == '1' %} ripd{% endif %}{% +if helpers.exists('OPNsense.quagga.bfd.enabled') and OPNsense.quagga.bfd.enabled == '1' %} bfdd{% endif %}{% if helpers.exists('OPNsense.quagga.bgp.enabled') and OPNsense.quagga.bgp.enabled == '1' %} bgpd{% endif %}{% if helpers.exists('OPNsense.quagga.ospf6.enabled') and OPNsense.quagga.ospf6.enabled == '1' %} ospf6d{% endif %}{% if helpers.exists('OPNsense.quagga.ripng.enabled') and OPNsense.quagga.ripng.enabled == '1' %} ripngd{% endif %}{% From 94351ebddf78da21c14e9cf6e8656126f4a127fe Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 12 Apr 2021 08:50:05 +0200 Subject: [PATCH 0526/3088] www/nginx: cleanups and sync --- LICENSE | 1 + .../OPNsense/Nginx/Api/SettingsController.php | 6 ++---- .../Base/Constraints/NaxsiIdentifierConstraint.php | 9 +++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/LICENSE b/LICENSE index 64a02ae244..c36cfbddd5 100644 --- a/LICENSE +++ b/LICENSE @@ -19,6 +19,7 @@ Copyright (c) 2010 Jim Pingle Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça Copyright (c) 2019 Juergen Kellerer +Copyright (c) 2020 Manuel Faux Copyright (c) 2003-2004 Manuel Kasper Copyright (c) 2020 Marc Leuser Copyright (c) 2020 Martin Wasley diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php index a8e651c586..ccb2cb6d98 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php @@ -169,12 +169,10 @@ public function searchlocationAction() if ($row['enable_secrules']) { if ($row['enable_learning_mode']) { $row['waf_status'] = gettext('learning'); - } - else { + } else { $row['waf_status'] = gettext('enabled'); } - } - else { + } else { $row['waf_status'] = gettext('disabled'); } } diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php index 085b5d9f7f..2373aae529 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php @@ -60,11 +60,9 @@ public function validate(\Phalcon\Validation $validator, $attribute) // 0 can only be used solely elseif ($intval == 0 && count($vals) > 1) { $validator->appendMessage(new Message(gettext("If ID 0 is specified, no other IDs can be listed."), $attribute)); - } - elseif ($intval < 0) { + } elseif ($intval < 0) { $neg++; - } - elseif ($intval > 0) { + } elseif ($intval > 0) { $pos++; } } @@ -81,8 +79,7 @@ public function validate(\Phalcon\Validation $validator, $attribute) // Did the user try to specify multiple IDs? if (strpos($val, ',')) { $validator->appendMessage(new Message(gettext("Rules can only have a single ID."), $attribute)); - } - else { + } else { $validator->appendMessage(new Message(gettext("Rule IDs need to be numeric."), $attribute)); } } From 8beadebc55072e234bacde5c7e900bbc44422ed0 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 12 Apr 2021 08:50:33 +0200 Subject: [PATCH 0527/3088] mail/fetchmail: cleanups and sync --- README.md | 1 + .../src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php | 2 +- .../src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml | 2 +- mail/fetchmail/src/opnsense/scripts/OPNsense/Fetchmail/setup.sh | 0 4 files changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 mail/fetchmail/src/opnsense/scripts/OPNsense/Fetchmail/setup.sh diff --git a/README.md b/README.md index 80ca245301..6debfb375f 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ dns/dnscrypt-proxy -- Flexible DNS proxy supporting DNSCrypt and DoH dns/dyndns -- Dynamic DNS Support dns/rfc2136 -- RFC-2136 Support emulators/qemu-guest-agent -- QEMU Guest Agent for OPNsense (development only) +mail/fetchmail -- Remote-mail retrieval utility (development only) mail/postfix -- SMTP mail relay mail/rspamd -- Protect your network from spam misc/theme-cicada -- The cicada theme - dark grey diff --git a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php index 7c5a75d762..5ec3f1dd2b 100644 --- a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php +++ b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/General.php @@ -24,7 +24,7 @@ *ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ - + namespace OPNsense\Fetchmail; use OPNsense\Base\BaseModel; diff --git a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml index fe711b2c1a..adc2e8a4ff 100644 --- a/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml +++ b/mail/fetchmail/src/opnsense/mvc/app/models/OPNsense/Fetchmail/Mailbox.xml @@ -38,7 +38,7 @@ N /^[A-Fa-f0-9\:]$/ - + diff --git a/mail/fetchmail/src/opnsense/scripts/OPNsense/Fetchmail/setup.sh b/mail/fetchmail/src/opnsense/scripts/OPNsense/Fetchmail/setup.sh old mode 100644 new mode 100755 From f7bc50cb2b9992d1de58bed53dc8699f1b0d6711 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 12 Apr 2021 08:51:04 +0200 Subject: [PATCH 0528/3088] plugins: cleanups --- .../opnsense/service/templates/OPNsense/Netdata/netdata.conf | 2 +- .../mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml | 2 +- .../src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt | 2 +- .../opnsense/service/templates/OPNsense/Freeradius/clients.conf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf index 105254bcc2..8e2c769e37 100644 --- a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf +++ b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf @@ -11,7 +11,7 @@ [global] history = 86400 bind to = {% if ':' in OPNsense.netdata.general.listen %}[{{ OPNsense.netdata.general.listen }}]{% else %} {{ OPNsense.netdata.general.listen }}{% endif %} - + disconnect idle web clients after seconds = 3600 run as user = netdata web files owner = netdata diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml index 95a1c55426..771ad073d8 100644 --- a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml @@ -132,7 +132,7 @@ text Specifies the time how often proxy retrieves configuration data from zabbix server (in seconds). - + general.datasenderfrequency diff --git a/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt b/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt index 00ba994203..308d4c4eaf 100644 --- a/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt +++ b/net/chrony/src/opnsense/mvc/app/views/OPNsense/Chrony/general.volt @@ -99,7 +99,7 @@ function update_chronyauthdata() { setInterval(update_chronysourcestats, 5000); setInterval(update_chronytracking, 5000); setInterval(update_chronyauthdata, 5000); - + // link save button to API set action $("#saveAct").click(function(){ saveFormToEndpoint(url="/api/chrony/general/set", formid='frm_general_settings',callback_ok=function(){ diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/clients.conf b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/clients.conf index 8a7896a866..c7c2c35672 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/clients.conf +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/clients.conf @@ -8,7 +8,7 @@ client "{{ client_list.name }}" { shortname = "{{ client_list.name }}" {% if ':' in client_list.ip %} ipv6addr = {{ client_list.ip }} -{% else %} +{% else %} ipaddr = {{ client_list.ip }} {% endif %} } From cf2ca4761d79ba642d623b3462edebc3f606b3b6 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 12 Apr 2021 09:21:21 +0200 Subject: [PATCH 0529/3088] IDPS - ruleset : add copy of some rule files which are being shipped empty in et-pro telemetry. closes https://github.com/opnsense/core/issues/4914 --- .../intrusion-detection-content-et-open/Makefile | 8 ++++++++ .../intrusion-detection-content-et-open/pkg-descr | 5 +++++ .../suricata/metadata/rules/et-open-extra.xml | 14 ++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 security/intrusion-detection-content-et-open/Makefile create mode 100644 security/intrusion-detection-content-et-open/pkg-descr create mode 100644 security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml diff --git a/security/intrusion-detection-content-et-open/Makefile b/security/intrusion-detection-content-et-open/Makefile new file mode 100644 index 0000000000..31eceaaaf5 --- /dev/null +++ b/security/intrusion-detection-content-et-open/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= intrusion-detection-content-et-open +PLUGIN_VERSION= 1.0.0 +#PLUGIN_REVISION= 1 +PLUGIN_COMMENT= IDS Proofpoint ET open ruleset, duplicates some rule files which are being delivered empty in ET Pro Telemetry edition so both can be installed +PLUGIN_MAINTAINER= ad@opnsense.org +PLUGIN_WWW= https://rules.emergingthreats.net/ + +.include "../../Mk/plugins.mk" diff --git a/security/intrusion-detection-content-et-open/pkg-descr b/security/intrusion-detection-content-et-open/pkg-descr new file mode 100644 index 0000000000..74ae504353 --- /dev/null +++ b/security/intrusion-detection-content-et-open/pkg-descr @@ -0,0 +1,5 @@ +IDS Proofpoint ET open ruleset, duplicates some rule files which are being delivered empty in ET Pro Telemetry edition so both can be installed + +LICENSE: https://www.proofpoint.com/us/license + +WWW: https://www.proofpoint.com/us/blog/threat-insight diff --git a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml new file mode 100644 index 0000000000..8f4a929511 --- /dev/null +++ b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml @@ -0,0 +1,14 @@ + + + + + + + et_open.botcc.rules + et_open.ciarmy.rules + et_open.compromised.rules + et_open.drop.rules + et_open.dshield.rules + et_open.tor.rules + + From c7591a1a8450b9cce2cc66c677ec5c53ec2a9753 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 12 Apr 2021 09:26:03 +0200 Subject: [PATCH 0530/3088] security/intrusion-detection-content-et-open: shorten description --- README.md | 1 + security/intrusion-detection-content-et-open/Makefile | 2 +- security/intrusion-detection-content-et-open/pkg-descr | 4 ++-- .../scripts/suricata/metadata/rules/et-open-extra.xml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6debfb375f..c45187bd86 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ net-mgmt/zabbix5-proxy -- Zabbix Proxy enables decentralized monitoring security/acme-client -- Let's Encrypt client security/clamav -- Antivirus engine for detecting malicious threats security/etpro-telemetry -- ET Pro Telemetry Edition +security/intrusion-detection-content-et-open -- IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition security/intrusion-detection-content-et-pro -- IDS Proofpoint ET Pro ruleset (needs a valid subscription) security/intrusion-detection-content-pt-open -- IDS PT Research ruleset (only for non-commercial use) security/intrusion-detection-content-snort-vrt -- IDS Snort VRT ruleset (needs registration or subscription) diff --git a/security/intrusion-detection-content-et-open/Makefile b/security/intrusion-detection-content-et-open/Makefile index 31eceaaaf5..036bd551e5 100644 --- a/security/intrusion-detection-content-et-open/Makefile +++ b/security/intrusion-detection-content-et-open/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= intrusion-detection-content-et-open PLUGIN_VERSION= 1.0.0 #PLUGIN_REVISION= 1 -PLUGIN_COMMENT= IDS Proofpoint ET open ruleset, duplicates some rule files which are being delivered empty in ET Pro Telemetry edition so both can be installed +PLUGIN_COMMENT= IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://rules.emergingthreats.net/ diff --git a/security/intrusion-detection-content-et-open/pkg-descr b/security/intrusion-detection-content-et-open/pkg-descr index 74ae504353..7065fc3ed4 100644 --- a/security/intrusion-detection-content-et-open/pkg-descr +++ b/security/intrusion-detection-content-et-open/pkg-descr @@ -1,5 +1,5 @@ -IDS Proofpoint ET open ruleset, duplicates some rule files which are being delivered empty in ET Pro Telemetry edition so both can be installed +IDS Proofpoint ET open ruleset duplicates rule files which are being +delivered empty in ET Pro Telemetry edition so both can be installed. LICENSE: https://www.proofpoint.com/us/license - WWW: https://www.proofpoint.com/us/blog/threat-insight diff --git a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml index 8f4a929511..563b11476a 100644 --- a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml +++ b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml @@ -3,7 +3,7 @@ - + et_open-botcc.portgrouped.rules et_open.botcc.rules et_open.ciarmy.rules et_open.compromised.rules From 4ca327938e5235530c1514c96de9b45587e227da Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Sun, 11 Apr 2021 18:39:53 +0300 Subject: [PATCH 0531/3088] setup.php: minor fixes -get rid of the "PHP Warning: Use of undefined constant 'next'" message -make streams block work for single stream server in config (correctly identify the case of a single server) --- www/nginx/src/opnsense/scripts/nginx/setup.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/nginx/src/opnsense/scripts/nginx/setup.php b/www/nginx/src/opnsense/scripts/nginx/setup.php index 26942bce36..4860fbcd03 100755 --- a/www/nginx/src/opnsense/scripts/nginx/setup.php +++ b/www/nginx/src/opnsense/scripts/nginx/setup.php @@ -86,7 +86,7 @@ function find_ca($refid) // try to find the reference $cert = find_cert($http_server['certificate']); if (!isset($cert)) { - next; + continue; } $chain = []; $ca_chain = ca_chain_array($cert); @@ -121,7 +121,7 @@ function find_ca($refid) } // end http, begin streams if (isset($nginx['stream_server'])) { - if (is_array($nginx['stream_server']) && !isset($nginx['stream_server']['servername'])) { + if (is_array($nginx['stream_server']) && !isset($nginx['stream_server']['@attributes']['uuid'])) { $stream_servers = $nginx['stream_server']; } else { $stream_servers = array($nginx['stream_server']); @@ -131,7 +131,7 @@ function find_ca($refid) // try to find the reference $cert = find_cert($stream_server['certificate']); if (!isset($cert)) { - next; + continue; } $chain = []; $ca_chain = ca_chain_array($cert); @@ -184,7 +184,7 @@ function find_ca($refid) foreach (ca_chain_array($cert) as $entry) { $chain[] = base64_decode($entry['crt']); } - $hostname = explode(',', $http_server['servername'])[0]; + export_pem_file( KEY_DIRECTORY . $upstream['tls_client_certificate'] . '.pem', $cert['crt'], From 8bc1616baf3aa5b7ba676175fcfa49e6e75f2f69 Mon Sep 17 00:00:00 2001 From: Tobias <5389669+botboe@users.noreply.github.com> Date: Wed, 14 Apr 2021 11:44:03 +0200 Subject: [PATCH 0532/3088] New Plugin "RadSecProxy" (#1894) --- net/radsecproxy/Makefile | 8 + net/radsecproxy/pkg-descr | 5 + .../src/etc/inc/plugins.inc.d/radsecproxy.inc | 73 +++ net/radsecproxy/src/etc/rc.d/os-radsecproxy | 46 ++ .../RadSecProxy/Api/ClientsController.php | 67 +++ .../RadSecProxy/Api/GeneralController.php | 33 ++ .../RadSecProxy/Api/RealmsController.php | 63 +++ .../RadSecProxy/Api/RewritesController.php | 67 +++ .../RadSecProxy/Api/ServersController.php | 67 +++ .../RadSecProxy/Api/ServiceController.php | 40 ++ .../RadSecProxy/Api/TlsController.php | 67 +++ .../RadSecProxy/ClientsController.php | 36 ++ .../RadSecProxy/GeneralController.php | 34 ++ .../OPNsense/RadSecProxy/IndexController.php | 34 ++ .../OPNsense/RadSecProxy/RealmsController.php | 34 ++ .../RadSecProxy/RewritesController.php | 36 ++ .../RadSecProxy/ServersController.php | 34 ++ .../OPNsense/RadSecProxy/TlsController.php | 34 ++ .../RadSecProxy/forms/dialogClient.xml | 96 ++++ .../RadSecProxy/forms/dialogRealm.xml | 71 +++ .../RadSecProxy/forms/dialogRewrite.xml | 101 ++++ .../RadSecProxy/forms/dialogServer.xml | 102 ++++ .../OPNsense/RadSecProxy/forms/dialogTls.xml | 68 +++ .../OPNsense/RadSecProxy/forms/general.xml | 121 +++++ .../models/OPNsense/RadSecProxy/Menu/Menu.xml | 12 + .../OPNsense/RadSecProxy/RadSecProxy.php | 31 ++ .../OPNsense/RadSecProxy/RadSecProxy.xml | 514 ++++++++++++++++++ .../views/OPNsense/RadSecProxy/clients.volt | 56 ++ .../views/OPNsense/RadSecProxy/general.volt | 31 ++ .../views/OPNsense/RadSecProxy/realms.volt | 54 ++ .../views/OPNsense/RadSecProxy/rewrites.volt | 54 ++ .../views/OPNsense/RadSecProxy/servers.volt | 56 ++ .../app/views/OPNsense/RadSecProxy/tls.volt | 55 ++ .../OPNsense/RadSecProxy/generate_certs.php | 105 ++++ .../scripts/OPNsense/RadSecProxy/setup.sh | 18 + .../conf/actions.d/actions_radsecproxy.conf | 35 ++ .../templates/OPNsense/RadSecProxy/+TARGETS | 2 + .../OPNsense/RadSecProxy/radsecproxy.conf | 240 ++++++++ .../templates/OPNsense/RadSecProxy/rc.conf.d | 7 + 39 files changed, 2607 insertions(+) create mode 100644 net/radsecproxy/Makefile create mode 100644 net/radsecproxy/pkg-descr create mode 100644 net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc create mode 100755 net/radsecproxy/src/etc/rc.d/os-radsecproxy create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ClientsController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/GeneralController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/RealmsController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/RewritesController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ServersController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ServiceController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/TlsController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/ClientsController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/GeneralController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/IndexController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/RealmsController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/RewritesController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/ServersController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/TlsController.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogClient.xml create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRealm.xml create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRewrite.xml create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogServer.xml create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogTls.xml create mode 100644 net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/general.xml create mode 100644 net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml create mode 100644 net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.php create mode 100644 net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.xml create mode 100644 net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt create mode 100644 net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/general.volt create mode 100644 net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt create mode 100644 net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt create mode 100644 net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt create mode 100644 net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt create mode 100755 net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php create mode 100755 net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/setup.sh create mode 100644 net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf create mode 100644 net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/+TARGETS create mode 100644 net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf create mode 100644 net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d diff --git a/net/radsecproxy/Makefile b/net/radsecproxy/Makefile new file mode 100644 index 0000000000..c27c40120a --- /dev/null +++ b/net/radsecproxy/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= radsecproxy +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= RADIUS proxy provides both RADIUS UDP and TCP/TLS (RadSec) transport +PLUGIN_DEPENDS= radsecproxy +PLUGIN_MAINTAINER= tobias@boehnert.dev +PLUGIN_DEVEL= yes + +.include "../../Mk/plugins.mk" diff --git a/net/radsecproxy/pkg-descr b/net/radsecproxy/pkg-descr new file mode 100644 index 0000000000..ef872b8a71 --- /dev/null +++ b/net/radsecproxy/pkg-descr @@ -0,0 +1,5 @@ +A generic RADIUS proxy that in addition to usual RADIUS UDP +transport, also supports TLS (RadSec), as well as RADIUS +over TCP and DTLS. The aim is for the proxy to have +sufficient features to be flexible, while at the same time +to be small, efficient and easy to configure. diff --git a/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc b/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc new file mode 100644 index 0000000000..57e8734776 --- /dev/null +++ b/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc @@ -0,0 +1,73 @@ +general->enabled == '1') { + return true; + } + + return false; +} + +function radsecproxy_syslog() +{ + // $syslogconf = array(); + + // $syslogconf['radsecproxy'] = array( + // 'local' => '/var/log/radsecproxy.log', + // 'facility' => array('radsecproxy'), + // 'remote' => 'relayd', + // ); + + // return $syslogconf; + + $logfacilities = array(); + $logfacilities['radsecproxy'] = array( + 'facility' => array('LOG_DAEMON'), + ); + return $logfacilities; + +} + + +function radsecproxy_services() +{ + $services = array(); + + if (radsecproxy_enabled()) { + $services[] = array( + 'description' => gettext('Radius Secure Proxy'), + 'configd' => array( + 'restart' => array('radsecproxy restart'), + 'start' => array('radsecproxy start'), + 'stop' => array('radsecproxy stop'), + ), + 'name' => 'radsecproxy', + 'pidfile' => '/var/run/radsecproxy/radsecproxy.pid' + ); + } + return $services; +} diff --git a/net/radsecproxy/src/etc/rc.d/os-radsecproxy b/net/radsecproxy/src/etc/rc.d/os-radsecproxy new file mode 100755 index 0000000000..4faca1f6bd --- /dev/null +++ b/net/radsecproxy/src/etc/rc.d/os-radsecproxy @@ -0,0 +1,46 @@ +#!/bin/sh + +# PROVIDE: radsecproxy +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# radsecproxy_enable (bool): Set to NO by default. +# Set it to YES to enable radsecproxy. + +. /etc/rc.subr + +name="radsecproxy" +rcvar=radsecproxy_enable + +: ${radsecproxy_enable:="NO"} +: ${radsecproxy_user:="root"} +: ${radsecproxy_group:="wheel"} +: ${radsecproxy_pidfile:="/var/run/radsecproxy.pid"} + +user=${radsecproxy_user} +group=${radsecproxy_group} +pidfile=${radsecproxy_pidfile} +required_files=/usr/local/etc/radsecproxy.conf + +command="/usr/local/sbin/${name}" +command_args="-c /usr/local/etc/radsecproxy.conf -i ${pidfile}" + +start_precmd="radsecproxy_prestart" +stop_postcmd="radsecproxy_poststop" + +radsecproxy_prestart() +{ + mkdir -p $(dirname $pidfile) + chown ${user}:${group} $(dirname $pidfile) +} + +radsecproxy_poststop() +{ + rm -f ${pidfile} +} + +load_rc_config $name +run_rc_command "$1" diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ClientsController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ClientsController.php new file mode 100644 index 0000000000..a256a87650 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ClientsController.php @@ -0,0 +1,67 @@ +searchBase( + "clients.client", + array('enabled', 'description', 'host', 'identifier', 'type'), + "name" + ); + } + + public function setItemAction($uuid) + { + return $this->setBase("client", "clients.client", $uuid); + } + + public function addItemAction() + { + return $this->addBase("client", "clients.client"); + } + + public function getItemAction($uuid = null) + { + return $this->getBase("client", "clients.client", $uuid); + } + + public function delItemAction($uuid) + { + return $this->delBase("clients.client", $uuid); + } + + public function toggleItemAction($uuid, $enabled = null) + { + return $this->toggleBase("clients.client", $uuid, $enabled); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/GeneralController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/GeneralController.php new file mode 100644 index 0000000000..786df74ebe --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/GeneralController.php @@ -0,0 +1,33 @@ +searchBase("realms.realm", array('enabled', 'description', 'realm'), "description"); + } + + public function setItemAction($uuid) + { + return $this->setBase("realm", "realms.realm", $uuid); + } + + public function addItemAction() + { + return $this->addBase("realm", "realms.realm"); + } + + public function getItemAction($uuid = null) + { + return $this->getBase("realm", "realms.realm", $uuid); + } + + public function delItemAction($uuid) + { + return $this->delBase("realms.realm", $uuid); + } + + public function toggleItemAction($uuid, $enabled = null) + { + return $this->toggleBase("realms.realm", $uuid, $enabled); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/RewritesController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/RewritesController.php new file mode 100644 index 0000000000..c1fb95d929 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/RewritesController.php @@ -0,0 +1,67 @@ +searchBase( + "rewrites.rewrite", + array('enabled', 'name', 'description'), + "name" + ); + } + + public function setItemAction($uuid) + { + return $this->setBase("rewrite", "rewrites.rewrite", $uuid); + } + + public function addItemAction() + { + return $this->addBase("rewrite", "rewrites.rewrite"); + } + + public function getItemAction($uuid = null) + { + return $this->getBase("rewrite", "rewrites.rewrite", $uuid); + } + + public function delItemAction($uuid) + { + return $this->delBase("rewrites.rewrite", $uuid); + } + + public function toggleItemAction($uuid, $enabled = null) + { + return $this->toggleBase("rewrites.rewrite", $uuid, $enabled); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ServersController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ServersController.php new file mode 100644 index 0000000000..55394aa5e3 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ServersController.php @@ -0,0 +1,67 @@ +searchBase( + "servers.server", + array('description', 'host', 'type', 'identifier', 'tlsConfig'), + "name" + ); + } + + public function setItemAction($uuid) + { + return $this->setBase("server", "servers.server", $uuid); + } + + public function addItemAction() + { + return $this->addBase("server", "servers.server"); + } + + public function getItemAction($uuid = null) + { + return $this->getBase("server", "servers.server", $uuid); + } + + public function delItemAction($uuid) + { + return $this->delBase("servers.server", $uuid); + } + + public function toggleItemAction($uuid, $enabled = null) + { + return $this->toggleBase("servers.server", $uuid, $enabled); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ServiceController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ServiceController.php new file mode 100644 index 0000000000..2aebebd844 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/Api/ServiceController.php @@ -0,0 +1,40 @@ +searchBase( + "tlsConfigs.tlsConfig", + array('description', 'name', 'caCertificateRefId', 'proxyCertificateRefId'), + "name" + ); + } + + public function setItemAction($uuid) + { + return $this->setBase("tlsConfig", "tlsConfigs.tlsConfig", $uuid); + } + + public function addItemAction() + { + return $this->addBase("tlsConfig", "tlsConfigs.tlsConfig"); + } + + public function getItemAction($uuid = null) + { + return $this->getBase("tlsConfig", "tlsConfigs.tlsConfig", $uuid); + } + + public function delItemAction($uuid) + { + return $this->delBase("tlsConfigs.tlsConfig", $uuid); + } + + public function toggleItemAction($uuid, $enabled = null) + { + return $this->toggleBase("tlsConfigs.tlsConfig", $uuid, $enabled); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/ClientsController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/ClientsController.php new file mode 100644 index 0000000000..91e92ce299 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/ClientsController.php @@ -0,0 +1,36 @@ +view->generalForm = $this->getForm("clients"); + // pick the template to serve to our users. + $this->view->pick('OPNsense/RadSecProxy/clients'); + $this->view->formDialogClient = $this->getForm("dialogClient"); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/GeneralController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/GeneralController.php new file mode 100644 index 0000000000..5c17d3cd88 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/GeneralController.php @@ -0,0 +1,34 @@ +view->generalForm = $this->getForm("general"); + $this->view->pick('OPNsense/RadSecProxy/general'); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/IndexController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/IndexController.php new file mode 100644 index 0000000000..3596535ace --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/IndexController.php @@ -0,0 +1,34 @@ +view->basicForm = $this->getForm("basic"); + $this->view->pick('OPNsense/RadSecProxy/index'); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/RealmsController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/RealmsController.php new file mode 100644 index 0000000000..d227bbac1d --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/RealmsController.php @@ -0,0 +1,34 @@ +view->pick('OPNsense/RadSecProxy/realms'); + $this->view->formDialogRealm = $this->getForm("dialogRealm"); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/RewritesController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/RewritesController.php new file mode 100644 index 0000000000..92869405e7 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/RewritesController.php @@ -0,0 +1,36 @@ +view->generalForm = $this->getForm("clients"); + // pick the template to serve to our users. + $this->view->pick('OPNsense/RadSecProxy/rewrites'); + $this->view->formDialogRewrite = $this->getForm("dialogRewrite"); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/ServersController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/ServersController.php new file mode 100644 index 0000000000..98186c1015 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/ServersController.php @@ -0,0 +1,34 @@ +view->pick('OPNsense/RadSecProxy/servers'); + $this->view->formDialogServer = $this->getForm("dialogServer"); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/TlsController.php b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/TlsController.php new file mode 100644 index 0000000000..146157e55d --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/TlsController.php @@ -0,0 +1,34 @@ +view->pick('OPNsense/RadSecProxy/tls'); + $this->view->formDialogTls = $this->getForm("dialogTls"); + } +} diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogClient.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogClient.xml new file mode 100644 index 0000000000..127ff57686 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogClient.xml @@ -0,0 +1,96 @@ +
    + + + section_title + + + + + client.enabled + + checkbox + Allow connections from this client + + + + client.identifier + + text + Unique identifier for this client + + + + client.description + + text + Short description of this client + + + + client.host + + text + The client's IP or net + + + + client.type + + dropdown + Choose the type of client. Default Radius-clients use UDP. + + + + client.secret + + text + The shared RADIUS key with this client. This option is optional for TLS/DTLS and if omitted will default to "radsec". (Note that using a secret other than "radsec" for TLS is a violation of the standard (RFC 6614) and that the proposed standard for DTLS stipulates that the secret must be "radius/dtls".) + + + + section_title + + true + + + + client.tlsConfig + + true + dropdown + For a TLS/DTLS client you may also specify the tls option. The option value must be the name of a previously defined TLS block. If this option is not specified, the TLS block with the name defaultClient or default will be used if defined (in that order). If the specified TLS block name does not exist, or the option is not specified and none of the defaults exist, the proxy will exit with an error. + + + + client.certificateNameCheck + + true + dropdown + For a TLS/DTLS server, disable the default behaviour of matching CN or SubjectAltName against the specified hostname or IP address. + + + + client.matchCertificateAttribute + + true + text + Perform additional validation of certificate attributes (CN | SubjectAltName:URI | SubjectAltName:DNS). Currently matching of CN and SubjectAltName types URI DNS and IP is supported. + + + + client.rewriteIn + + true + dropdown + RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> + + + + client.rewriteOut + + true + dropdown + RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRealm.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRealm.xml new file mode 100644 index 0000000000..6c270fed76 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRealm.xml @@ -0,0 +1,71 @@ +
    + + + section_title + + + + + realm.enabled + + checkbox + Enable this realm + + + + realm.realm + + text + * | realm | /regex/ + + + + realm.description + + text + Short description to identify this realm and its target + + + + section_title + + + + + realm.server + + select_multiple + true + + If not configured, the proxy will deny all Access-Requests for this realm. + + + + realm.replyMessage + + text + server is configured.]]> + + + + section_title + + + + + realm.accountingServer + + select_multiple + true + + If not configured, the proxy will silently ignore all Accounting-Requests for this realm. + + + + realm.accountingResponse + + dropdown + accoutingServer is configured.]]> + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRewrite.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRewrite.xml new file mode 100644 index 0000000000..ca8ef6092b --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRewrite.xml @@ -0,0 +1,101 @@ +
    + + + rewrite.enabled + + checkbox + Use this rule + + + + rewrite.name + + text + Unique name for this rule + + + + rewrite.description + + text + Short description of this rule + + + + rewrite.addAttributes + + textbox + attribute:value, one per line
    Add an attribute to the radius message and set it to value. The attribute must be specified using the numerical attribute id. The value can either be numerical, a string, or a hex value. If the value starts with a number, it is interpreted as a 32bit unsigned integer. Use the ’ character at the start of the value to force string interpretation. When using hex value, it is recommended to also lead with ’ to avoid unintended numeric interpretation. See the CONFIGURATION SYNTAX section for further details.]]>
    +
    + + + rewrite.addVendorAttributes + + textbox + vendor:subattribute:value, one per line
    Add a vendor attribute to the radius message, specified by vendor and subattribute. Both vendor and subattribute must be specified as numerical values. The format of value is the same as for addAttribute above.]]>
    +
    + + + rewrite.supplementAttributes + + textbox + attribute:value, one per line
    Add an attribute to the radius message and set it to value, only if the attribute is not yet present on the message. The format of value is the same as for addAttribute above.]]>
    +
    + + + rewrite.supplementVendorAttributes + + textbox + vendor:subattribute:value, one per line
    Add a vendor attribute to the radius message only if the subattribute of this vendor is not yet present on the message. The format of is the same as for addVendorAttribute above.]]>
    +
    + + + rewrite.modifyAttributes + + textbox + attribute:/regex/replace/, one per line
    Modify the given attribute using the regex replace pattern. As above, attribute must be specified by a numerical value. Example usage: modifyAttribute 1:/^(.*)@local$/\1@example.com/]]>
    +
    + + + rewrite.modifyVendorAttributes + + textbox + vendor:subattribute:/regex/replace/, one per line
    Modify the given subattribute of given vendor using the regex replace pattern. Other than the added vendor, the same syntax as for ModifyAttribute applies.]]>
    +
    + + + rewrite.removeAttributes + + textbox + attribute, one per line
    Remove all attributes with the given id.]]>
    +
    + + + rewrite.removeVendorAttributes + + textbox + vendor[:subattribute], one per line
    Remove all vendor attributes that match the given vendor and subattribute. If the subattribute is omitted, all attributes with the given vendor id are removed.]]>
    +
    + + + rewrite.whitelistMode + + dropdown + WhitelistAttribute or WhitelistVendorAttribute will be removed. While whitelist mode is active, RemoveAttribute and RemoveVendorAttribute statements are ignored.]]> + + + + rewrite.whitelistAttributes + + textbox + attribute, one per line
    Do not remove attributes with the given id when WhitelistMode is on. Ignored otherwise.]]>
    +
    + + + rewrite.whitelistVendorAttributes + + textbox + vendor[:subattribute], one per line
    Do not remove vendor attributes that match the given vendor and subattribute when WhitelistMode is on. Ignored otherwise. If the subattribute is omitted, the complete vendor attribute is whitelisted. Otherwise only the specified subattribute is kept but all other subattributes are removed.]]>
    +
    + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogServer.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogServer.xml new file mode 100644 index 0000000000..ce44adcb9f --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogServer.xml @@ -0,0 +1,102 @@ +
    + + + section_title + + + + + server.identifier + + text + Unique identifier for this server + + + + server.description + + text + Short description to identify this server + + + + server.host + + text + The server's IP or hostname to connect to + + + + server.port + + text + The port (UDP/TCP) to connect to. If omitted, UDP and TCP will default to 1812 while TLS and DTLS will default to 2083. + + + + server.statusServer + + dropdown + off). If statusserver is enabled (on), the proxy will send regular status-server messages to the server to verify that it is alive. Status tracking of the server will solely depend on status-server message and ignore lost requests. This should only be enabled if the server supports it. With the option minimal status-server messages are only sent when regular requests have been lost and no other replies have been received.]]> + + + + server.type + + dropdown + Choose the type of server. Default Radius-clients use UDP. + + + + server.secret + + text + The shared RADIUS key with this server. This option is optional for TLS/DTLS and if omitted will default to "radsec". (Note that using a secret other than "radsec" for TLS is a violation of the standard (RFC 6614) and that the proposed standard for DTLS stipulates that the secret must be "radius/dtls".) + + + + server.tlsConfig + + dropdown + For a TLS/DTLS client you may also specify the tls option. The option value must be the name of a previously defined TLS block. If this option is not specified, the TLS block with the name defaultClient or default will be used if defined (in that order). If the specified TLS block name does not exist, or the option is not specified and none of the defaults exist, the proxy will exit with an error. + + + + section_title + + true + + + + server.certificateNameCheck + + true + dropdown + For a TLS/DTLS server, disable the default behaviour of matching CN or SubjectAltName against the specified hostname or IP address. + + + + server.matchCertificateAttribute + + true + text + Perform additional validation of certificate attributes (CN | SubjectAltName:URI | SubjectAltName:DNS). Currently matching of CN and SubjectAltName types URI DNS and IP is supported. Note that currently this option can only be specified once in a client block. + + + + server.rewriteIn + + true + dropdown + RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> + + + + server.rewriteOut + + true + dropdown + RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogTls.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogTls.xml new file mode 100644 index 0000000000..240d91266e --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogTls.xml @@ -0,0 +1,68 @@ +
    + + + section_title + + + + + tlsConfig.name + + text + This TLS-config's unique name + + + + tlsConfig.description + + text + Short description to identify this TLS-config + + + + tlsConfig.caCertificateRefId + + dropdown + The CA certificate file used to verify the peers certificate. + + + + tlsConfig.proxyCertificateRefId + + dropdown + The server certificate this proxy will use. The file may also contain a certificate chain. + + + + section_title + + true + + + + tlsConfig.policyOids + + true + select_multiple + + true + Require the peers certificate to adhere to the policy specified by this oid / these oids. + + + + tlsConfig.crlCheck + + true + dropdown + fetch-crl.]]> + + + + tlsConfig.cacheExpiry + + true + text + Specify how many seconds the CA and CRL information should be cached. By default, the CA and CRL are loaded at startup and cached indefinetely. This option may be set to zero to disable caching. + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/general.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/general.xml new file mode 100644 index 0000000000..eaf9611ed2 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/general.xml @@ -0,0 +1,121 @@ +
    + + + radsecproxy.general.enabled + + checkbox + + + + radsecproxy.general.logLevel + + dropdown + This option specifies the debug level. It must be set to 1, 2, 3, 4 or 5, where 1 logs only serious errors, and 5 logs everything. The default is 2 which logs errors, warnings and a few informational messages. + + + + radsecproxy.general.logFullUsername + + dropdown + This can be set to off to only log the realm in Access-Accept/Reject log messages (for privacy). + + + + radsecproxy.general.logMac + + dropdown + Static, Original, VendorHashed, VendorKeyHashed, FullyHashed or FullyKeyHashed. The default value for LogMAC is Original.]]> + + + + radsecproxy.general.loopPrevention + + dropdown + When this is enabled (on), a request will never be sent to a server named the same as the client it was received from. I.e., the names of the client block and the server block are compared. Note that this only gives limited protection against loops. It can be used as a basic option and inside server blocks where it overrides the basic setting. + + + + section_title + + true + + + + section_title + + true + Listen for the address and port for the respective protocol. Normally the proxy will listen to the standard ports if configured to handle clients with the respective protocol. The default ports are 1812 for UDP and TCP and 2083 for TLS and DTLS. On most systems it will do this for all of the system’s IP addresses (both IPv4 and IPv6). On some systems however, it may respond to only IPv4 or only IPv6. To specify an alternate port you may use a value on the form *:port where port is any valid port number. If you also want to specify a specific address you can do e.g. 192.168.1.1:1812 or [2001:db8::1]:1812. The port may be omitted if you want the default one. Note that you must use brackets around the IPv6 address. These options may be specified multiple times to listen to multiple addresses and/or ports for each protocol. + + + + radsecproxy.general.listenUdp + + text + true + + + + + radsecproxy.general.listenTcp + + text + true + + + + + radsecproxy.general.listenTls + + text + true + + + + + radsecproxy.general.listenDtls + + text + true + + + + + section_title + + true + This can be used to specify source address and/or source port that the proxy will use for connecting to clients to send messages (e.g. Access Request). The same syntax as for Listen... applies. + + + + radsecproxy.general.sourceUdp + + text + true + + + + + radsecproxy.general.sourceTcp + + text + true + + + + + radsecproxy.general.sourceTls + + text + true + + + + + radsecproxy.general.sourceDtls + + text + true + + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml new file mode 100644 index 0000000000..65b18340f0 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.php b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.php new file mode 100644 index 0000000000..31e1b506e4 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.php @@ -0,0 +1,31 @@ + + //OPNsense/radsecproxy + + RadSecProxy-Management + + 0.0.1 + + + + + 0 + Y + + + + Y + 2 + + 1 (only serious errors) + 2 (default) + 3 + 4 + 5 (log everything) + + + + + Y + off + + On + Off + + + + + Y + Original + + Static + Original + VendorHashed + VendorKeyHashed + FullyHashed + FullyKeyHashed + + + + + Y + on + + On + Off + + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + + + + + + 1 + Y + + + + Y + /^([0-9a-zA-Z_\-]){1,25}$/u + Should be a string between 1 and 25 characters whithout special characters. + + + UniqueConstraint + Identifier already in use + + + + + + N + + + + Y + Y + + + UniqueConstraint + + + + + + Y + udp + + UDP + TCP + TLS + DTLS + + + + + N + + + Must be set for UDP-clients. + SetIfConstraint + type + udp + + + Must be set for TCP-clients. + SetIfConstraint + type + tcp + + + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + tlsConfigs.tlsConfig + name + + + + + + Y + off + + On + Off + + + + + N + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + rewrites.rewrite + name + + + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + rewrites.rewrite + name + + + + + + + + + + + + Y + /^([0-9a-zA-Z_\-]){1,25}$/u + Should be a string between 1 and 25 characters whithout special characters. + + + UniqueConstraint + Identifier already in use + + + + + + N + + + + Y + Y + + + + N + + + + Y + off + + On + Off + Minimal + Auto + + + + + Y + udp + + UDP + TCP + TLS + DTLS + + + + + N + + + Must be set for UDP-servers. + SetIfConstraint + type + udp + + + Must be set for TCP-servers. + SetIfConstraint + type + tcp + + + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + tlsConfigs.tlsConfig + name + + + + + + Y + off + + On + Off + + + + + N + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + rewrites.rewrite + name + + + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + rewrites.rewrite + name + + + + + + + + + + + + Y + /^([0-9a-zA-Z_\-]){1,25}$/u + Should be a string between 1 and 25 characters whithout special characters. + default + + + UniqueConstraint + Name already in use + + + + + + N + + + + Y + Field is required + ca + + + + Y + Field is required + cert + + + + N + Y + + + + Y + off + + On + Off + + + + + N + + + + + + + + + + 1 + Y + + + + N + + + + Y + Must not be empty + + + UniqueConstraint + Must be unique + + + + + + Y + N + Y + + + OPNsense.RadSecProxy.RadSecProxy + servers.server + identifier + + + Related server not found + + + + Y + N + Y + + + OPNsense.RadSecProxy.RadSecProxy + servers.server + identifier + + + Related server not found + + + + Y + off + + On + Off + + + + + N + + + + + + + + + + 1 + Y + + + + Y + /^([0-9a-zA-Z_\-]){1,25}$/u + Should be a string between 1 and 25 characters whithout special characters. + default + + + UniqueConstraint + Name already in use + + + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + Y + off + + On + Off + + + + + N + + + + N + + + + + + diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt new file mode 100644 index 0000000000..33e7413f28 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogClient,'id':'DialogClient','label':lang._('Edit client')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/general.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/general.volt new file mode 100644 index 0000000000..1508a57b5f --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/general.volt @@ -0,0 +1,31 @@ + +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}} + +
    +
    + +
    +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt new file mode 100644 index 0000000000..974842f40e --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Realm') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogRealm,'id':'DialogRealm','label':lang._('Edit realm')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt new file mode 100644 index 0000000000..ded6289663 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogRewrite,'id':'DialogRewrite','label':lang._('Edit rewrite-rule')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt new file mode 100644 index 0000000000..0581869990 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Type') }}{{ lang._('TLS-Config') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogServer,'id':'DialogServer','label':lang._('Edit server')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt new file mode 100644 index 0000000000..3533486053 --- /dev/null +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Name') }}{{ lang._('Description') }}{{ lang._('CA-certificate') }}{{ lang._('Proxy-certificate') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogTls,'id':'DialogTls','label':lang._('Edit TLS-config')])}} diff --git a/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php b/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php new file mode 100755 index 0000000000..9414db161c --- /dev/null +++ b/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php @@ -0,0 +1,105 @@ +#!/usr/local/bin/php +object(); + +deleteFilesInFolder($outputFolder); +if (isset($configObj->OPNsense->radsecproxy->tlsConfigs)) { + foreach ($configObj->OPNsense->radsecproxy->tlsConfigs->children() as $tlsConfig) { + echo "parsing TLS-config \"" . $tlsConfig->name . "\"\n"; + + $caCertRefId = (string)$tlsConfig->caCertificateRefId; + $proxyCertRefId = (string)$tlsConfig->proxyCertificateRefId; + + if ($caCertRefId != "") { + echo "looking for CA-cert-file\n"; + foreach ($configObj->ca as $ca) { + if ($caCertRefId == (string)$ca->refid) { + echo "creating CA-cert-files from \"" . $ca->descr . "\"\n"; + writeCertFile($outputFolder . $tlsConfig->name . "_ca-cert.pem", $ca->crt); + } + } + } + + if ($proxyCertRefId != "") { + foreach ($configObj->cert as $cert) { + if ($proxyCertRefId == (string)$cert->refid) { + echo "creating proxy-cert-files from \"" . $cert->descr . "\"\n"; + writeCertFile($outputFolder . $tlsConfig->name . "_proxy-cert.pem", $cert->crt); + writeCertFile($outputFolder . $tlsConfig->name . "_proxy-key.pem", $cert->prv); + } + } + } + } +} else { + echo "no TLS-configs found\n"; +} diff --git a/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/setup.sh b/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/setup.sh new file mode 100755 index 0000000000..cd09c51f98 --- /dev/null +++ b/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/setup.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +RADSECPROXY_DIRS="/usr/local/etc/radsecproxy.d /usr/local/etc/radsecproxy.d/certs" + +for directory in ${RADSECPROXY_DIRS}; do + mkdir -p ${directory} + chown -R www:www ${directory} + chmod -R 750 ${directory} +done + + +# export required certs to filesystem +/usr/local/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php > /dev/null 2>&1 + +# remove logfile - sometimes it will stop radsecproxy from starting +#rm /var/log/radsecproxy.log + +exit 0 diff --git a/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf b/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf new file mode 100644 index 0000000000..42dfe22969 --- /dev/null +++ b/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf @@ -0,0 +1,35 @@ +[setup] +command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh; +parameters: +type:script +message:setup radsecproxy service requirements + +[start] +command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy start; +parameters: +type:script +message:starting radsecproxy + +[stop] +command:/usr/local/etc/rc.d/radsecproxy stop; +parameters: +type:script +message:stopping radsecproxy + +[restart] +command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy restart; +parameters: +type:script +message:restarting radsecproxy + +[reload] +command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy restart; +parameters: +type:script +message:reloading radsecproxy + +[status] +command:/usr/local/etc/rc.d/radsecproxy status;exit 0; +parameters: +type:script_output +message:radsecproxy status diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/+TARGETS b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/+TARGETS new file mode 100644 index 0000000000..294d4f30db --- /dev/null +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/+TARGETS @@ -0,0 +1,2 @@ +radsecproxy.conf:/usr/local/etc/radsecproxy.conf +rc.conf.d:/etc/rc.conf.d/radsecproxy diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf new file mode 100644 index 0000000000..b0563b335f --- /dev/null +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf @@ -0,0 +1,240 @@ +{% if helpers.exists('OPNsense.radsecproxy.general') and OPNsense.radsecproxy.general.enabled|default("0") == "1" %} +{% set certDir = '/usr/local/etc/radsecproxy.d/certs/' %} +# auto-generated config-file for radsecproxy +########################################### +# GENERAL +########################################### + +#PidFile /var/run/radsecproxy.pid +#LogDestination file:///var/log/radsecproxy.log +LogDestination x-syslog:///LOG_DAEMON + +{% if OPNsense.radsecproxy.general.logLevel is defined and OPNsense.radsecproxy.general.logLevel != "" %} +LogLevel {{ OPNsense.radsecproxy.general.logLevel }} +{% endif %} +{% if OPNsense.radsecproxy.general.logFullUsername is defined and OPNsense.radsecproxy.general.logFullUsername != "" %} +LogFullUsername {{ OPNsense.radsecproxy.general.logFullUsername }} +{% endif %} +{% if OPNsense.radsecproxy.general.logMac is defined and OPNsense.radsecproxy.general.logMac != "" %} +LogMac {{ OPNsense.radsecproxy.general.logMac }} +{% endif %} +{% if OPNsense.radsecproxy.general.loopPrevention is defined and OPNsense.radsecproxy.general.loopPrevention != "" %} +LoopPrevention {{ OPNsense.radsecproxy.general.loopPrevention }} +{% endif %} +{% if OPNsense.radsecproxy.general.listenUdp is defined and OPNsense.radsecproxy.general.listenUdp != "" %} +ListenUDP {{ OPNsense.radsecproxy.general.listenUdp }} +{% endif %} +{% if OPNsense.radsecproxy.general.listenTcp is defined and OPNsense.radsecproxy.general.listenTcp != "" %} +ListenTCP {{ OPNsense.radsecproxy.general.listenTcp }} +{% endif %} +{% if OPNsense.radsecproxy.general.listenTls is defined and OPNsense.radsecproxy.general.listenTls != "" %} +ListenTLS {{ OPNsense.radsecproxy.general.listenTls }} +{% endif %} +{% if OPNsense.radsecproxy.general.listenDtls is defined and OPNsense.radsecproxy.general.listenDtls != "" %} +ListenDTLS {{ OPNsense.radsecproxy.general.listenDtls }} +{% endif %} +{% if OPNsense.radsecproxy.general.sourceUdp is defined and OPNsense.radsecproxy.general.sourceUdp != "" %} +SourceUDP {{ OPNsense.radsecproxy.general.sourceUdp }} +{% endif %} +{% if OPNsense.radsecproxy.general.sourceTcp is defined and OPNsense.radsecproxy.general.sourceTcp != "" %} +SourceTCP {{ OPNsense.radsecproxy.general.sourceTcp }} +{% endif %} +{% if OPNsense.radsecproxy.general.sourceTls is defined and OPNsense.radsecproxy.general.sourceTls != "" %} +SourceTLS {{ OPNsense.radsecproxy.general.sourceTls }} +{% endif %} +{% if OPNsense.radsecproxy.general.sourceDtls is defined and OPNsense.radsecproxy.general.sourceDtls != "" %} +SourceDTLS {{ OPNsense.radsecproxy.general.sourceDtls }} +{% endif %} + +########################################### +# TLS-CONFIGS +########################################### + +{% for tlsConfig in helpers.toList('OPNsense.radsecproxy.tlsConfigs.tlsConfig') %} +# config for TLS-Config "{{ tlsConfig.description }}" +tls {{ tlsConfig.name }} { +{% if tlsConfig.caCertificateRefId is defined and tlsConfig.caCertificateRefId != "" %} + CACertificateFile {{ certDir}}{{ tlsConfig.name }}_ca-cert.pem +{% endif %} +{% if tlsConfig.proxyCertificateRefId is defined and tlsConfig.proxyCertificateRefId != "" %} + CertificateFile {{ certDir}}{{ tlsConfig.name }}_proxy-cert.pem + CertificateKeyFile {{ certDir}}{{ tlsConfig.name }}_proxy-key.pem +{% endif %} +{% if tlsConfig.policyOids is defined and tlsConfig.policyOids != "" %} +{% for policyOid in tlsConfig.policyOids.split(',') %} + PolicyOID {{ policyOid }} +{% endfor %} +{% endif %} + CRLCheck {{ tlsConfig.crlCheck }} +{% if tlsConfig.cacheExpiry is defined and tlsConfig.cacheExpiry != "" %} + CacheExpiry {{ tlsConfig.cacheExpiry }} +{% endif %} +} + +{% endfor %} + +########################################### +# REWRITE-RULES +########################################### + +{% for rewriteRule in helpers.toList('OPNsense.radsecproxy.rewrites.rewrite') %} +{% if rewriteRule.enabled is defined and rewriteRule.enabled == "1" %} + +rewrite {{ rewriteRule.name }} { +{% if rewriteRule.addAttributes is defined and rewriteRule.addAttributes != "" %} +{% for addAttribute in rewriteRule.addAttributes.split("\n") %} + AddAttribute {{ addAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.addVendorAttributes is defined and rewriteRule.addVendorAttributes != "" %} +{% for addVendorAttribute in rewriteRule.addVendorAttributes.split("\n") %} + AddVendorAttribute {{ addVendorAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.supplementAttributes is defined and rewriteRule.supplementAttributes != "" %} +{% for supplementAttribute in rewriteRule.supplementAttributes.split("\n") %} + SupplementAttribute {{ supplementAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.supplementVendorAttributes is defined and rewriteRule.supplementVendorAttributes != "" %} +{% for supplementVendorAttribute in rewriteRule.supplementVendorAttributes.split("\n") %} + SupplementVendorAttribute {{ supplementVendorAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.modifyAttributes is defined and rewriteRule.modifyAttributes != "" %} +{% for modifyAttribute in rewriteRule.modifyAttributes.split("\n") %} + ModifyAttribute {{ modifyAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.modifyVendorAttributes is defined and rewriteRule.modifyVendorAttributes != "" %} +{% for modifyVendorAttribute in rewriteRule.modifyVendorAttributes.split("\n") %} + ModifyVendorAttribute {{ modifyVendorAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.removeAttributes is defined and rewriteRule.removeAttributes != "" %} +{% for removeAttribute in rewriteRule.removeAttributes.split("\n") %} + RemoveAttribute {{ removeAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.removeVendorAttributes is defined and rewriteRule.removeVendorAttributes != "" %} +{% for removeVendorAttribute in rewriteRule.removeVendorAttributes.split("\n") %} + RemoveVendorAttribute {{ removeVendorAttribute }} +{% endfor %} +{% endif %} + WhitelistMode {{ rewriteRule.whitelistMode }} +{% if rewriteRule.whitelistAttributes is defined and rewriteRule.whitelistAttributes != "" %} +{% for whitelistAttribute in rewriteRule.whitelistAttributes.split("\n") %} + WhitelistAttribute {{ whitelistAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.whitelistVendorAttributes is defined and rewriteRule.whitelistVendorAttributes != "" %} +{% for whitelistVendorAttribute in rewriteRule.whitelistVendorAttributes.split("\n") %} + WhitelistVendorAttribute {{ whitelistVendorAttribute }} +{% endfor %} +{% endif %} +} +{% endif %} +{% endfor %} + +########################################### +# CLIENTS +########################################### + +{% for client in helpers.toList('OPNsense.radsecproxy.clients.client') %} +{% if client.enabled is defined and client.enabled == "1" %} +# config for client "{{ client.description }}" +client {{ client.identifier }} { + Host {{ client.host }} + Type {{ client.type }} +{% if client.secret is defined and client.secret != "" %} + Secret {{ client.secret }} +{% endif %} +{% if client.tlsConfig is defined and client.tlsConfig != "" %} +{% set tlsConfig = helpers.getUUID(client.tlsConfig) %} + Tls {{ tlsConfig.name }} +{% endif %} + CertificateNameCheck {{ client.certificateNameCheck }} +{% if client.matchCertificateAttribute is defined and client.matchCertificateAttribute != "" %} + matchCertificateAttribute {{ client.matchCertificateAttribute }} +{% endif %} +{% if client.rewriteIn is defined and client.rewriteIn != "" %} +{% set rewriteInRule = helpers.getUUID(client.rewriteIn) %} + RewriteIn {{ rewriteInRule.name }} +{% endif %} +{% if client.rewriteOut is defined and client.rewriteOut != "" %} +{% set rewriteOutRule = helpers.getUUID(client.rewriteOut) %} + RewriteOut {{ rewriteOutRule.name }} +{% endif %} +} + +{% else %} +# config for client "{{ client.description }}" not enabled, skipping!" + +{% endif %} +{% endfor %} + +########################################### +# SERVERS +########################################### + +{% for server in helpers.toList('OPNsense.radsecproxy.servers.server') %} +# config for server "{{ server.description }}" +server {{ server.identifier }} { + Host {{ server.host }} +{% if server.port is defined and server.port != "" %} + Port {{ server.port }} +{% endif %} + Type {{ server.type }} +{% if server.secret is defined and server.secret != "" %} + Secret {{ server.secret }} +{% endif %} +{% if server.tlsConfig is defined and server.tlsConfig != "" %} +{% set tlsConfig = helpers.getUUID(server.tlsConfig) %} + Tls {{ tlsConfig.name }} +{% endif %} + StatusServer {{ server.statusServer }} + CertificateNameCheck {{ server.certificateNameCheck }} +{% if server.matchCertificateAttribute is defined and server.matchCertificateAttribute != "" %} + matchCertificateAttribute {{ server.matchCertificateAttribute }} +{% endif %} +{% if server.rewriteIn is defined and server.rewriteIn != "" %} +{% set rewriteInRule = helpers.getUUID(server.rewriteIn) %} + RewriteIn {{ rewriteInRule.name }} +{% endif %} +{% if server.rewriteOut is defined and server.rewriteOut != "" %} +{% set rewriteOutRule = helpers.getUUID(server.rewriteOut) %} + RewriteOut {{ rewriteOutRule.name }} +{% endif %} +} + +{% endfor %} + +########################################### +# REALMS +########################################### + +{% for realm in helpers.toList('OPNsense.radsecproxy.realms.realm') %} +{% if realm.enabled is defined and realm.enabled == "1" %} +# config for realm "{{ realm.realm }}" +realm {{ realm.realm }} { +{% if realm.server is defined and realm.server != "" %} +{% for serverUuid in realm.server.split(',') %} +{% set server = helpers.getUUID(serverUuid) %} + Server {{ server.identifier }} +{% endfor %} +{% endif %} +{% if realm.replyMessage is defined and realm.replyMessage != "" %} + ReplyMessage "{{ realm.replyMessage }}" +{% endif %} +{% if realm.accountingResponse is defined and realm.accountingResponse != "" %} + AccountingResponse {{ realm.accountingResponse }} +{% endif %} +} + +{% else %} +# config for realm "{{ realm.realm }}" not enabled, skipping!" + +{% endif %} +{% endfor %} +{# END OF TEMPLATE #} +{% endif %} diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d new file mode 100644 index 0000000000..03409f3a79 --- /dev/null +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d @@ -0,0 +1,7 @@ +{% if helpers.exists('OPNsense.radsecproxy.general.enabled') and OPNsense.radsecproxy.general.enabled == '1' %} +radsecproxy_enable="YES" +{% else %} +radsecproxy_enable="NO" +{% endif %} +radsecproxy_user="root" +radsecproxy_group="wheel" From ee44f5d1e415c0d9c6347cf58c6a95f10a3a62c4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 14 Apr 2021 11:45:41 +0200 Subject: [PATCH 0533/3088] net/radsecproxy: scrub whitespaces --- LICENSE | 1 + README.md | 1 + net/radsecproxy/src/etc/rc.d/os-radsecproxy | 4 +- .../RadSecProxy/forms/dialogClient.xml | 192 +-- .../RadSecProxy/forms/dialogRealm.xml | 142 +-- .../RadSecProxy/forms/dialogRewrite.xml | 202 ++-- .../RadSecProxy/forms/dialogServer.xml | 204 ++-- .../OPNsense/RadSecProxy/forms/dialogTls.xml | 136 +-- .../OPNsense/RadSecProxy/forms/general.xml | 242 ++-- .../models/OPNsense/RadSecProxy/Menu/Menu.xml | 24 +- .../OPNsense/RadSecProxy/RadSecProxy.xml | 1028 ++++++++--------- .../views/OPNsense/RadSecProxy/clients.volt | 112 +- .../views/OPNsense/RadSecProxy/general.volt | 62 +- .../views/OPNsense/RadSecProxy/realms.volt | 108 +- .../views/OPNsense/RadSecProxy/rewrites.volt | 108 +- .../views/OPNsense/RadSecProxy/servers.volt | 112 +- .../app/views/OPNsense/RadSecProxy/tls.volt | 110 +- .../OPNsense/RadSecProxy/generate_certs.php | 2 +- .../conf/actions.d/actions_radsecproxy.conf | 70 +- .../templates/OPNsense/RadSecProxy/+TARGETS | 4 +- .../OPNsense/RadSecProxy/radsecproxy.conf | 480 ++++---- .../templates/OPNsense/RadSecProxy/rc.conf.d | 14 +- 22 files changed, 1680 insertions(+), 1678 deletions(-) diff --git a/LICENSE b/LICENSE index c36cfbddd5..c0d0614edb 100644 --- a/LICENSE +++ b/LICENSE @@ -30,6 +30,7 @@ Copyright (c) 2008 Shrew Soft Inc. Copyright (c) 2017-2019 Smart-Soft Copyright (c) 2013 Stanley P. Miller \ stan-qaz Copyright (c) 2020 Starkstromkonsument +Copyright (c) 2020 Tobias Boehnert Copyright (c) 2010 Yehuda Katz Copyright (c) 2015 YoungJoo.Kim Copyright (c) 2020 devNan0 diff --git a/README.md b/README.md index c45187bd86..0d7a3cdb0d 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ net/haproxy -- Reliable, high performance TCP/HTTP load balancer net/igmp-proxy -- IGMP-Proxy Service net/mdns-repeater -- Proxy multicast DNS between networks net/ntopng -- Traffic Analysis and Flow Collection +net/radsecproxy -- RADIUS proxy provides both RADIUS UDP and TCP/TLS (RadSec) transport (development only) net/relayd -- Relayd Load Balancer net/shadowsocks -- Secure socks5 proxy net/siproxd -- Siproxd is a proxy daemon for the SIP protocol diff --git a/net/radsecproxy/src/etc/rc.d/os-radsecproxy b/net/radsecproxy/src/etc/rc.d/os-radsecproxy index 4faca1f6bd..cb79588f7e 100755 --- a/net/radsecproxy/src/etc/rc.d/os-radsecproxy +++ b/net/radsecproxy/src/etc/rc.d/os-radsecproxy @@ -31,13 +31,13 @@ command_args="-c /usr/local/etc/radsecproxy.conf -i ${pidfile}" start_precmd="radsecproxy_prestart" stop_postcmd="radsecproxy_poststop" -radsecproxy_prestart() +radsecproxy_prestart() { mkdir -p $(dirname $pidfile) chown ${user}:${group} $(dirname $pidfile) } -radsecproxy_poststop() +radsecproxy_poststop() { rm -f ${pidfile} } diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogClient.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogClient.xml index 127ff57686..a74c90b696 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogClient.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogClient.xml @@ -1,96 +1,96 @@ -
    - - - section_title - - - - - client.enabled - - checkbox - Allow connections from this client - - - - client.identifier - - text - Unique identifier for this client - - - - client.description - - text - Short description of this client - - - - client.host - - text - The client's IP or net - - - - client.type - - dropdown - Choose the type of client. Default Radius-clients use UDP. - - - - client.secret - - text - The shared RADIUS key with this client. This option is optional for TLS/DTLS and if omitted will default to "radsec". (Note that using a secret other than "radsec" for TLS is a violation of the standard (RFC 6614) and that the proposed standard for DTLS stipulates that the secret must be "radius/dtls".) - - - - section_title - - true - - - - client.tlsConfig - - true - dropdown - For a TLS/DTLS client you may also specify the tls option. The option value must be the name of a previously defined TLS block. If this option is not specified, the TLS block with the name defaultClient or default will be used if defined (in that order). If the specified TLS block name does not exist, or the option is not specified and none of the defaults exist, the proxy will exit with an error. - - - - client.certificateNameCheck - - true - dropdown - For a TLS/DTLS server, disable the default behaviour of matching CN or SubjectAltName against the specified hostname or IP address. - - - - client.matchCertificateAttribute - - true - text - Perform additional validation of certificate attributes (CN | SubjectAltName:URI | SubjectAltName:DNS). Currently matching of CN and SubjectAltName types URI DNS and IP is supported. - - - - client.rewriteIn - - true - dropdown - RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> - - - - client.rewriteOut - - true - dropdown - RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> - - -
    +
    + + + section_title + + + + + client.enabled + + checkbox + Allow connections from this client + + + + client.identifier + + text + Unique identifier for this client + + + + client.description + + text + Short description of this client + + + + client.host + + text + The client's IP or net + + + + client.type + + dropdown + Choose the type of client. Default Radius-clients use UDP. + + + + client.secret + + text + The shared RADIUS key with this client. This option is optional for TLS/DTLS and if omitted will default to "radsec". (Note that using a secret other than "radsec" for TLS is a violation of the standard (RFC 6614) and that the proposed standard for DTLS stipulates that the secret must be "radius/dtls".) + + + + section_title + + true + + + + client.tlsConfig + + true + dropdown + For a TLS/DTLS client you may also specify the tls option. The option value must be the name of a previously defined TLS block. If this option is not specified, the TLS block with the name defaultClient or default will be used if defined (in that order). If the specified TLS block name does not exist, or the option is not specified and none of the defaults exist, the proxy will exit with an error. + + + + client.certificateNameCheck + + true + dropdown + For a TLS/DTLS server, disable the default behaviour of matching CN or SubjectAltName against the specified hostname or IP address. + + + + client.matchCertificateAttribute + + true + text + Perform additional validation of certificate attributes (CN | SubjectAltName:URI | SubjectAltName:DNS). Currently matching of CN and SubjectAltName types URI DNS and IP is supported. + + + + client.rewriteIn + + true + dropdown + RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> + + + + client.rewriteOut + + true + dropdown + RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRealm.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRealm.xml index 6c270fed76..9aa636e609 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRealm.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRealm.xml @@ -1,71 +1,71 @@ -
    - - - section_title - - - - - realm.enabled - - checkbox - Enable this realm - - - - realm.realm - - text - * | realm | /regex/ - - - - realm.description - - text - Short description to identify this realm and its target - - - - section_title - - - - - realm.server - - select_multiple - true - - If not configured, the proxy will deny all Access-Requests for this realm. - - - - realm.replyMessage - - text - server is configured.]]> - - - - section_title - - - - - realm.accountingServer - - select_multiple - true - - If not configured, the proxy will silently ignore all Accounting-Requests for this realm. - - - - realm.accountingResponse - - dropdown - accoutingServer is configured.]]> - - -
    +
    + + + section_title + + + + + realm.enabled + + checkbox + Enable this realm + + + + realm.realm + + text + * | realm | /regex/ + + + + realm.description + + text + Short description to identify this realm and its target + + + + section_title + + + + + realm.server + + select_multiple + true + + If not configured, the proxy will deny all Access-Requests for this realm. + + + + realm.replyMessage + + text + server is configured.]]> + + + + section_title + + + + + realm.accountingServer + + select_multiple + true + + If not configured, the proxy will silently ignore all Accounting-Requests for this realm. + + + + realm.accountingResponse + + dropdown + accoutingServer is configured.]]> + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRewrite.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRewrite.xml index ca8ef6092b..e4a9e57a59 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRewrite.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogRewrite.xml @@ -1,101 +1,101 @@ -
    - - - rewrite.enabled - - checkbox - Use this rule - - - - rewrite.name - - text - Unique name for this rule - - - - rewrite.description - - text - Short description of this rule - - - - rewrite.addAttributes - - textbox - attribute:value, one per line
    Add an attribute to the radius message and set it to value. The attribute must be specified using the numerical attribute id. The value can either be numerical, a string, or a hex value. If the value starts with a number, it is interpreted as a 32bit unsigned integer. Use the ’ character at the start of the value to force string interpretation. When using hex value, it is recommended to also lead with ’ to avoid unintended numeric interpretation. See the CONFIGURATION SYNTAX section for further details.]]>
    -
    - - - rewrite.addVendorAttributes - - textbox - vendor:subattribute:value, one per line
    Add a vendor attribute to the radius message, specified by vendor and subattribute. Both vendor and subattribute must be specified as numerical values. The format of value is the same as for addAttribute above.]]>
    -
    - - - rewrite.supplementAttributes - - textbox - attribute:value, one per line
    Add an attribute to the radius message and set it to value, only if the attribute is not yet present on the message. The format of value is the same as for addAttribute above.]]>
    -
    - - - rewrite.supplementVendorAttributes - - textbox - vendor:subattribute:value, one per line
    Add a vendor attribute to the radius message only if the subattribute of this vendor is not yet present on the message. The format of is the same as for addVendorAttribute above.]]>
    -
    - - - rewrite.modifyAttributes - - textbox - attribute:/regex/replace/, one per line
    Modify the given attribute using the regex replace pattern. As above, attribute must be specified by a numerical value. Example usage: modifyAttribute 1:/^(.*)@local$/\1@example.com/]]>
    -
    - - - rewrite.modifyVendorAttributes - - textbox - vendor:subattribute:/regex/replace/, one per line
    Modify the given subattribute of given vendor using the regex replace pattern. Other than the added vendor, the same syntax as for ModifyAttribute applies.]]>
    -
    - - - rewrite.removeAttributes - - textbox - attribute, one per line
    Remove all attributes with the given id.]]>
    -
    - - - rewrite.removeVendorAttributes - - textbox - vendor[:subattribute], one per line
    Remove all vendor attributes that match the given vendor and subattribute. If the subattribute is omitted, all attributes with the given vendor id are removed.]]>
    -
    - - - rewrite.whitelistMode - - dropdown - WhitelistAttribute or WhitelistVendorAttribute will be removed. While whitelist mode is active, RemoveAttribute and RemoveVendorAttribute statements are ignored.]]> - - - - rewrite.whitelistAttributes - - textbox - attribute, one per line
    Do not remove attributes with the given id when WhitelistMode is on. Ignored otherwise.]]>
    -
    - - - rewrite.whitelistVendorAttributes - - textbox - vendor[:subattribute], one per line
    Do not remove vendor attributes that match the given vendor and subattribute when WhitelistMode is on. Ignored otherwise. If the subattribute is omitted, the complete vendor attribute is whitelisted. Otherwise only the specified subattribute is kept but all other subattributes are removed.]]>
    -
    - -
    +
    + + + rewrite.enabled + + checkbox + Use this rule + + + + rewrite.name + + text + Unique name for this rule + + + + rewrite.description + + text + Short description of this rule + + + + rewrite.addAttributes + + textbox + attribute:value, one per line
    Add an attribute to the radius message and set it to value. The attribute must be specified using the numerical attribute id. The value can either be numerical, a string, or a hex value. If the value starts with a number, it is interpreted as a 32bit unsigned integer. Use the ’ character at the start of the value to force string interpretation. When using hex value, it is recommended to also lead with ’ to avoid unintended numeric interpretation. See the CONFIGURATION SYNTAX section for further details.]]>
    +
    + + + rewrite.addVendorAttributes + + textbox + vendor:subattribute:value, one per line
    Add a vendor attribute to the radius message, specified by vendor and subattribute. Both vendor and subattribute must be specified as numerical values. The format of value is the same as for addAttribute above.]]>
    +
    + + + rewrite.supplementAttributes + + textbox + attribute:value, one per line
    Add an attribute to the radius message and set it to value, only if the attribute is not yet present on the message. The format of value is the same as for addAttribute above.]]>
    +
    + + + rewrite.supplementVendorAttributes + + textbox + vendor:subattribute:value, one per line
    Add a vendor attribute to the radius message only if the subattribute of this vendor is not yet present on the message. The format of is the same as for addVendorAttribute above.]]>
    +
    + + + rewrite.modifyAttributes + + textbox + attribute:/regex/replace/, one per line
    Modify the given attribute using the regex replace pattern. As above, attribute must be specified by a numerical value. Example usage: modifyAttribute 1:/^(.*)@local$/\1@example.com/]]>
    +
    + + + rewrite.modifyVendorAttributes + + textbox + vendor:subattribute:/regex/replace/, one per line
    Modify the given subattribute of given vendor using the regex replace pattern. Other than the added vendor, the same syntax as for ModifyAttribute applies.]]>
    +
    + + + rewrite.removeAttributes + + textbox + attribute, one per line
    Remove all attributes with the given id.]]>
    +
    + + + rewrite.removeVendorAttributes + + textbox + vendor[:subattribute], one per line
    Remove all vendor attributes that match the given vendor and subattribute. If the subattribute is omitted, all attributes with the given vendor id are removed.]]>
    +
    + + + rewrite.whitelistMode + + dropdown + WhitelistAttribute or WhitelistVendorAttribute will be removed. While whitelist mode is active, RemoveAttribute and RemoveVendorAttribute statements are ignored.]]> + + + + rewrite.whitelistAttributes + + textbox + attribute, one per line
    Do not remove attributes with the given id when WhitelistMode is on. Ignored otherwise.]]>
    +
    + + + rewrite.whitelistVendorAttributes + + textbox + vendor[:subattribute], one per line
    Do not remove vendor attributes that match the given vendor and subattribute when WhitelistMode is on. Ignored otherwise. If the subattribute is omitted, the complete vendor attribute is whitelisted. Otherwise only the specified subattribute is kept but all other subattributes are removed.]]>
    +
    + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogServer.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogServer.xml index ce44adcb9f..5bd03d4316 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogServer.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogServer.xml @@ -1,102 +1,102 @@ -
    - - - section_title - - - - - server.identifier - - text - Unique identifier for this server - - - - server.description - - text - Short description to identify this server - - - - server.host - - text - The server's IP or hostname to connect to - - - - server.port - - text - The port (UDP/TCP) to connect to. If omitted, UDP and TCP will default to 1812 while TLS and DTLS will default to 2083. - - - - server.statusServer - - dropdown - off). If statusserver is enabled (on), the proxy will send regular status-server messages to the server to verify that it is alive. Status tracking of the server will solely depend on status-server message and ignore lost requests. This should only be enabled if the server supports it. With the option minimal status-server messages are only sent when regular requests have been lost and no other replies have been received.]]> - - - - server.type - - dropdown - Choose the type of server. Default Radius-clients use UDP. - - - - server.secret - - text - The shared RADIUS key with this server. This option is optional for TLS/DTLS and if omitted will default to "radsec". (Note that using a secret other than "radsec" for TLS is a violation of the standard (RFC 6614) and that the proposed standard for DTLS stipulates that the secret must be "radius/dtls".) - - - - server.tlsConfig - - dropdown - For a TLS/DTLS client you may also specify the tls option. The option value must be the name of a previously defined TLS block. If this option is not specified, the TLS block with the name defaultClient or default will be used if defined (in that order). If the specified TLS block name does not exist, or the option is not specified and none of the defaults exist, the proxy will exit with an error. - - - - section_title - - true - - - - server.certificateNameCheck - - true - dropdown - For a TLS/DTLS server, disable the default behaviour of matching CN or SubjectAltName against the specified hostname or IP address. - - - - server.matchCertificateAttribute - - true - text - Perform additional validation of certificate attributes (CN | SubjectAltName:URI | SubjectAltName:DNS). Currently matching of CN and SubjectAltName types URI DNS and IP is supported. Note that currently this option can only be specified once in a client block. - - - - server.rewriteIn - - true - dropdown - RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> - - - - server.rewriteOut - - true - dropdown - RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> - - -
    +
    + + + section_title + + + + + server.identifier + + text + Unique identifier for this server + + + + server.description + + text + Short description to identify this server + + + + server.host + + text + The server's IP or hostname to connect to + + + + server.port + + text + The port (UDP/TCP) to connect to. If omitted, UDP and TCP will default to 1812 while TLS and DTLS will default to 2083. + + + + server.statusServer + + dropdown + off). If statusserver is enabled (on), the proxy will send regular status-server messages to the server to verify that it is alive. Status tracking of the server will solely depend on status-server message and ignore lost requests. This should only be enabled if the server supports it. With the option minimal status-server messages are only sent when regular requests have been lost and no other replies have been received.]]> + + + + server.type + + dropdown + Choose the type of server. Default Radius-clients use UDP. + + + + server.secret + + text + The shared RADIUS key with this server. This option is optional for TLS/DTLS and if omitted will default to "radsec". (Note that using a secret other than "radsec" for TLS is a violation of the standard (RFC 6614) and that the proposed standard for DTLS stipulates that the secret must be "radius/dtls".) + + + + server.tlsConfig + + dropdown + For a TLS/DTLS client you may also specify the tls option. The option value must be the name of a previously defined TLS block. If this option is not specified, the TLS block with the name defaultClient or default will be used if defined (in that order). If the specified TLS block name does not exist, or the option is not specified and none of the defaults exist, the proxy will exit with an error. + + + + section_title + + true + + + + server.certificateNameCheck + + true + dropdown + For a TLS/DTLS server, disable the default behaviour of matching CN or SubjectAltName against the specified hostname or IP address. + + + + server.matchCertificateAttribute + + true + text + Perform additional validation of certificate attributes (CN | SubjectAltName:URI | SubjectAltName:DNS). Currently matching of CN and SubjectAltName types URI DNS and IP is supported. Note that currently this option can only be specified once in a client block. + + + + server.rewriteIn + + true + dropdown + RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> + + + + server.rewriteOut + + true + dropdown + RewriteIn is not configured, the rewrite blocks defaultClient or default will be applied if defined. No default blocks are applied for RewriteOut.]]> + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogTls.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogTls.xml index 240d91266e..d294c204d7 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogTls.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/dialogTls.xml @@ -1,68 +1,68 @@ -
    - - - section_title - - - - - tlsConfig.name - - text - This TLS-config's unique name - - - - tlsConfig.description - - text - Short description to identify this TLS-config - - - - tlsConfig.caCertificateRefId - - dropdown - The CA certificate file used to verify the peers certificate. - - - - tlsConfig.proxyCertificateRefId - - dropdown - The server certificate this proxy will use. The file may also contain a certificate chain. - - - - section_title - - true - - - - tlsConfig.policyOids - - true - select_multiple - - true - Require the peers certificate to adhere to the policy specified by this oid / these oids. - - - - tlsConfig.crlCheck - - true - dropdown - fetch-crl.]]> - - - - tlsConfig.cacheExpiry - - true - text - Specify how many seconds the CA and CRL information should be cached. By default, the CA and CRL are loaded at startup and cached indefinetely. This option may be set to zero to disable caching. - - -
    +
    + + + section_title + + + + + tlsConfig.name + + text + This TLS-config's unique name + + + + tlsConfig.description + + text + Short description to identify this TLS-config + + + + tlsConfig.caCertificateRefId + + dropdown + The CA certificate file used to verify the peers certificate. + + + + tlsConfig.proxyCertificateRefId + + dropdown + The server certificate this proxy will use. The file may also contain a certificate chain. + + + + section_title + + true + + + + tlsConfig.policyOids + + true + select_multiple + + true + Require the peers certificate to adhere to the policy specified by this oid / these oids. + + + + tlsConfig.crlCheck + + true + dropdown + fetch-crl.]]> + + + + tlsConfig.cacheExpiry + + true + text + Specify how many seconds the CA and CRL information should be cached. By default, the CA and CRL are loaded at startup and cached indefinetely. This option may be set to zero to disable caching. + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/general.xml b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/general.xml index eaf9611ed2..eb311b0076 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/general.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/controllers/OPNsense/RadSecProxy/forms/general.xml @@ -1,121 +1,121 @@ -
    - - - radsecproxy.general.enabled - - checkbox - - - - radsecproxy.general.logLevel - - dropdown - This option specifies the debug level. It must be set to 1, 2, 3, 4 or 5, where 1 logs only serious errors, and 5 logs everything. The default is 2 which logs errors, warnings and a few informational messages. - - - - radsecproxy.general.logFullUsername - - dropdown - This can be set to off to only log the realm in Access-Accept/Reject log messages (for privacy). - - - - radsecproxy.general.logMac - - dropdown - Static, Original, VendorHashed, VendorKeyHashed, FullyHashed or FullyKeyHashed. The default value for LogMAC is Original.]]> - - - - radsecproxy.general.loopPrevention - - dropdown - When this is enabled (on), a request will never be sent to a server named the same as the client it was received from. I.e., the names of the client block and the server block are compared. Note that this only gives limited protection against loops. It can be used as a basic option and inside server blocks where it overrides the basic setting. - - - - section_title - - true - - - - section_title - - true - Listen for the address and port for the respective protocol. Normally the proxy will listen to the standard ports if configured to handle clients with the respective protocol. The default ports are 1812 for UDP and TCP and 2083 for TLS and DTLS. On most systems it will do this for all of the system’s IP addresses (both IPv4 and IPv6). On some systems however, it may respond to only IPv4 or only IPv6. To specify an alternate port you may use a value on the form *:port where port is any valid port number. If you also want to specify a specific address you can do e.g. 192.168.1.1:1812 or [2001:db8::1]:1812. The port may be omitted if you want the default one. Note that you must use brackets around the IPv6 address. These options may be specified multiple times to listen to multiple addresses and/or ports for each protocol. - - - - radsecproxy.general.listenUdp - - text - true - - - - - radsecproxy.general.listenTcp - - text - true - - - - - radsecproxy.general.listenTls - - text - true - - - - - radsecproxy.general.listenDtls - - text - true - - - - - section_title - - true - This can be used to specify source address and/or source port that the proxy will use for connecting to clients to send messages (e.g. Access Request). The same syntax as for Listen... applies. - - - - radsecproxy.general.sourceUdp - - text - true - - - - - radsecproxy.general.sourceTcp - - text - true - - - - - radsecproxy.general.sourceTls - - text - true - - - - - radsecproxy.general.sourceDtls - - text - true - - - -
    +
    + + + radsecproxy.general.enabled + + checkbox + + + + radsecproxy.general.logLevel + + dropdown + This option specifies the debug level. It must be set to 1, 2, 3, 4 or 5, where 1 logs only serious errors, and 5 logs everything. The default is 2 which logs errors, warnings and a few informational messages. + + + + radsecproxy.general.logFullUsername + + dropdown + This can be set to off to only log the realm in Access-Accept/Reject log messages (for privacy). + + + + radsecproxy.general.logMac + + dropdown + Static, Original, VendorHashed, VendorKeyHashed, FullyHashed or FullyKeyHashed. The default value for LogMAC is Original.]]> + + + + radsecproxy.general.loopPrevention + + dropdown + When this is enabled (on), a request will never be sent to a server named the same as the client it was received from. I.e., the names of the client block and the server block are compared. Note that this only gives limited protection against loops. It can be used as a basic option and inside server blocks where it overrides the basic setting. + + + + section_title + + true + + + + section_title + + true + Listen for the address and port for the respective protocol. Normally the proxy will listen to the standard ports if configured to handle clients with the respective protocol. The default ports are 1812 for UDP and TCP and 2083 for TLS and DTLS. On most systems it will do this for all of the system’s IP addresses (both IPv4 and IPv6). On some systems however, it may respond to only IPv4 or only IPv6. To specify an alternate port you may use a value on the form *:port where port is any valid port number. If you also want to specify a specific address you can do e.g. 192.168.1.1:1812 or [2001:db8::1]:1812. The port may be omitted if you want the default one. Note that you must use brackets around the IPv6 address. These options may be specified multiple times to listen to multiple addresses and/or ports for each protocol. + + + + radsecproxy.general.listenUdp + + text + true + + + + + radsecproxy.general.listenTcp + + text + true + + + + + radsecproxy.general.listenTls + + text + true + + + + + radsecproxy.general.listenDtls + + text + true + + + + + section_title + + true + This can be used to specify source address and/or source port that the proxy will use for connecting to clients to send messages (e.g. Access Request). The same syntax as for Listen... applies. + + + + radsecproxy.general.sourceUdp + + text + true + + + + + radsecproxy.general.sourceTcp + + text + true + + + + + radsecproxy.general.sourceTls + + text + true + + + + + radsecproxy.general.sourceDtls + + text + true + + + +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml index 65b18340f0..38211fc76c 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml @@ -1,12 +1,12 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.xml b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.xml index 145fb8b59f..231a2e9ba7 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/RadSecProxy.xml @@ -1,514 +1,514 @@ - - //OPNsense/radsecproxy - - RadSecProxy-Management - - 0.0.1 - - - - - 0 - Y - - - - Y - 2 - - 1 (only serious errors) - 2 (default) - 3 - 4 - 5 (log everything) - - - - - Y - off - - On - Off - - - - - Y - Original - - Static - Original - VendorHashed - VendorKeyHashed - FullyHashed - FullyKeyHashed - - - - - Y - on - - On - Off - - - - - N - - - - N - - - - N - - - - N - - - - N - - - - N - - - - N - - - - N - - - - - - - - - 1 - Y - - - - Y - /^([0-9a-zA-Z_\-]){1,25}$/u - Should be a string between 1 and 25 characters whithout special characters. - - - UniqueConstraint - Identifier already in use - - - - - - N - - - - Y - Y - - - UniqueConstraint - - - - - - Y - udp - - UDP - TCP - TLS - DTLS - - - - - N - - - Must be set for UDP-clients. - SetIfConstraint - type - udp - - - Must be set for TCP-clients. - SetIfConstraint - type - tcp - - - - - - N - - - OPNsense.RadSecProxy.RadSecProxy - tlsConfigs.tlsConfig - name - - - - - - Y - off - - On - Off - - - - - N - - - - N - - - OPNsense.RadSecProxy.RadSecProxy - rewrites.rewrite - name - - - - - - N - - - OPNsense.RadSecProxy.RadSecProxy - rewrites.rewrite - name - - - - - - - - - - - - Y - /^([0-9a-zA-Z_\-]){1,25}$/u - Should be a string between 1 and 25 characters whithout special characters. - - - UniqueConstraint - Identifier already in use - - - - - - N - - - - Y - Y - - - - N - - - - Y - off - - On - Off - Minimal - Auto - - - - - Y - udp - - UDP - TCP - TLS - DTLS - - - - - N - - - Must be set for UDP-servers. - SetIfConstraint - type - udp - - - Must be set for TCP-servers. - SetIfConstraint - type - tcp - - - - - - N - - - OPNsense.RadSecProxy.RadSecProxy - tlsConfigs.tlsConfig - name - - - - - - Y - off - - On - Off - - - - - N - - - - N - - - OPNsense.RadSecProxy.RadSecProxy - rewrites.rewrite - name - - - - - - N - - - OPNsense.RadSecProxy.RadSecProxy - rewrites.rewrite - name - - - - - - - - - - - - Y - /^([0-9a-zA-Z_\-]){1,25}$/u - Should be a string between 1 and 25 characters whithout special characters. - default - - - UniqueConstraint - Name already in use - - - - - - N - - - - Y - Field is required - ca - - - - Y - Field is required - cert - - - - N - Y - - - - Y - off - - On - Off - - - - - N - - - - - - - - - - 1 - Y - - - - N - - - - Y - Must not be empty - - - UniqueConstraint - Must be unique - - - - - - Y - N - Y - - - OPNsense.RadSecProxy.RadSecProxy - servers.server - identifier - - - Related server not found - - - - Y - N - Y - - - OPNsense.RadSecProxy.RadSecProxy - servers.server - identifier - - - Related server not found - - - - Y - off - - On - Off - - - - - N - - - - - - - - - - 1 - Y - - - - Y - /^([0-9a-zA-Z_\-]){1,25}$/u - Should be a string between 1 and 25 characters whithout special characters. - default - - - UniqueConstraint - Name already in use - - - - - - N - - - - N - - - - N - - - - N - - - - N - - - - N - - - - N - - - - N - - - - Y - off - - On - Off - - - - - N - - - - N - - - - - - + + //OPNsense/radsecproxy + + RadSecProxy-Management + + 0.0.1 + + + + + 0 + Y + + + + Y + 2 + + 1 (only serious errors) + 2 (default) + 3 + 4 + 5 (log everything) + + + + + Y + off + + On + Off + + + + + Y + Original + + Static + Original + VendorHashed + VendorKeyHashed + FullyHashed + FullyKeyHashed + + + + + Y + on + + On + Off + + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + + + + + + 1 + Y + + + + Y + /^([0-9a-zA-Z_\-]){1,25}$/u + Should be a string between 1 and 25 characters whithout special characters. + + + UniqueConstraint + Identifier already in use + + + + + + N + + + + Y + Y + + + UniqueConstraint + + + + + + Y + udp + + UDP + TCP + TLS + DTLS + + + + + N + + + Must be set for UDP-clients. + SetIfConstraint + type + udp + + + Must be set for TCP-clients. + SetIfConstraint + type + tcp + + + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + tlsConfigs.tlsConfig + name + + + + + + Y + off + + On + Off + + + + + N + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + rewrites.rewrite + name + + + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + rewrites.rewrite + name + + + + + + + + + + + + Y + /^([0-9a-zA-Z_\-]){1,25}$/u + Should be a string between 1 and 25 characters whithout special characters. + + + UniqueConstraint + Identifier already in use + + + + + + N + + + + Y + Y + + + + N + + + + Y + off + + On + Off + Minimal + Auto + + + + + Y + udp + + UDP + TCP + TLS + DTLS + + + + + N + + + Must be set for UDP-servers. + SetIfConstraint + type + udp + + + Must be set for TCP-servers. + SetIfConstraint + type + tcp + + + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + tlsConfigs.tlsConfig + name + + + + + + Y + off + + On + Off + + + + + N + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + rewrites.rewrite + name + + + + + + N + + + OPNsense.RadSecProxy.RadSecProxy + rewrites.rewrite + name + + + + + + + + + + + + Y + /^([0-9a-zA-Z_\-]){1,25}$/u + Should be a string between 1 and 25 characters whithout special characters. + default + + + UniqueConstraint + Name already in use + + + + + + N + + + + Y + Field is required + ca + + + + Y + Field is required + cert + + + + N + Y + + + + Y + off + + On + Off + + + + + N + + + + + + + + + + 1 + Y + + + + N + + + + Y + Must not be empty + + + UniqueConstraint + Must be unique + + + + + + Y + N + Y + + + OPNsense.RadSecProxy.RadSecProxy + servers.server + identifier + + + Related server not found + + + + Y + N + Y + + + OPNsense.RadSecProxy.RadSecProxy + servers.server + identifier + + + Related server not found + + + + Y + off + + On + Off + + + + + N + + + + + + + + + + 1 + Y + + + + Y + /^([0-9a-zA-Z_\-]){1,25}$/u + Should be a string between 1 and 25 characters whithout special characters. + default + + + UniqueConstraint + Name already in use + + + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + N + + + + Y + off + + On + Off + + + + + N + + + + N + + + + + + diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt index 33e7413f28..c03c5d45b1 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt @@ -1,56 +1,56 @@ - - - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    - - -
    - -
    - -
    - -{{ partial("layout_partials/base_dialog",['fields':formDialogClient,'id':'DialogClient','label':lang._('Edit client')])}} + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogClient,'id':'DialogClient','label':lang._('Edit client')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/general.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/general.volt index 1508a57b5f..2c264100fd 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/general.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/general.volt @@ -1,31 +1,31 @@ - -
    - {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}} - -
    -
    - -
    -
    + +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}} + +
    +
    + +
    +
    diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt index 974842f40e..85453ec79d 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt @@ -1,54 +1,54 @@ - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Realm') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    - - -
    - -
    - -
    - -{{ partial("layout_partials/base_dialog",['fields':formDialogRealm,'id':'DialogRealm','label':lang._('Edit realm')])}} + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Realm') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogRealm,'id':'DialogRealm','label':lang._('Edit realm')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt index ded6289663..0da6b6612c 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt @@ -1,54 +1,54 @@ - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    - - -
    - -
    - -
    - -{{ partial("layout_partials/base_dialog",['fields':formDialogRewrite,'id':'DialogRewrite','label':lang._('Edit rewrite-rule')])}} + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogRewrite,'id':'DialogRewrite','label':lang._('Edit rewrite-rule')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt index 0581869990..b394b1e5ad 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt @@ -1,56 +1,56 @@ - - - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Type') }}{{ lang._('TLS-Config') }}{{ lang._('Commands') }}
    - - -
    - -
    - -
    - -{{ partial("layout_partials/base_dialog",['fields':formDialogServer,'id':'DialogServer','label':lang._('Edit server')])}} + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Type') }}{{ lang._('TLS-Config') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogServer,'id':'DialogServer','label':lang._('Edit server')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt index 3533486053..cc63e0c747 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt @@ -1,55 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Name') }}{{ lang._('Description') }}{{ lang._('CA-certificate') }}{{ lang._('Proxy-certificate') }}{{ lang._('Commands') }}
    - - -
    - -
    - -
    - -{{ partial("layout_partials/base_dialog",['fields':formDialogTls,'id':'DialogTls','label':lang._('Edit TLS-config')])}} + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Name') }}{{ lang._('Description') }}{{ lang._('CA-certificate') }}{{ lang._('Proxy-certificate') }}{{ lang._('Commands') }}
    + + +
    + +
    + +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogTls,'id':'DialogTls','label':lang._('Edit TLS-config')])}} diff --git a/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php b/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php index 9414db161c..d123a56e2b 100755 --- a/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php +++ b/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php @@ -57,7 +57,7 @@ function deleteFilesInFolder($pathToFolder) { echo "deleting all files in folder " . $pathToFolder . "\n"; $files = glob($pathToFolder . '/*'); - + foreach ($files as $file) { //Make sure that this is a file and not a directory. if (is_file($file)) { diff --git a/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf b/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf index 42dfe22969..79ca190462 100644 --- a/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf +++ b/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf @@ -1,35 +1,35 @@ -[setup] -command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh; -parameters: -type:script -message:setup radsecproxy service requirements - -[start] -command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy start; -parameters: -type:script -message:starting radsecproxy - -[stop] -command:/usr/local/etc/rc.d/radsecproxy stop; -parameters: -type:script -message:stopping radsecproxy - -[restart] -command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy restart; -parameters: -type:script -message:restarting radsecproxy - -[reload] -command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy restart; -parameters: -type:script -message:reloading radsecproxy - -[status] -command:/usr/local/etc/rc.d/radsecproxy status;exit 0; -parameters: -type:script_output -message:radsecproxy status +[setup] +command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh; +parameters: +type:script +message:setup radsecproxy service requirements + +[start] +command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy start; +parameters: +type:script +message:starting radsecproxy + +[stop] +command:/usr/local/etc/rc.d/radsecproxy stop; +parameters: +type:script +message:stopping radsecproxy + +[restart] +command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy restart; +parameters: +type:script +message:restarting radsecproxy + +[reload] +command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy restart; +parameters: +type:script +message:reloading radsecproxy + +[status] +command:/usr/local/etc/rc.d/radsecproxy status;exit 0; +parameters: +type:script_output +message:radsecproxy status diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/+TARGETS b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/+TARGETS index 294d4f30db..d7da8ea4c2 100644 --- a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/+TARGETS +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/+TARGETS @@ -1,2 +1,2 @@ -radsecproxy.conf:/usr/local/etc/radsecproxy.conf -rc.conf.d:/etc/rc.conf.d/radsecproxy +radsecproxy.conf:/usr/local/etc/radsecproxy.conf +rc.conf.d:/etc/rc.conf.d/radsecproxy diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf index b0563b335f..bdb62ce381 100644 --- a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf @@ -1,240 +1,240 @@ -{% if helpers.exists('OPNsense.radsecproxy.general') and OPNsense.radsecproxy.general.enabled|default("0") == "1" %} -{% set certDir = '/usr/local/etc/radsecproxy.d/certs/' %} -# auto-generated config-file for radsecproxy -########################################### -# GENERAL -########################################### - -#PidFile /var/run/radsecproxy.pid -#LogDestination file:///var/log/radsecproxy.log -LogDestination x-syslog:///LOG_DAEMON - -{% if OPNsense.radsecproxy.general.logLevel is defined and OPNsense.radsecproxy.general.logLevel != "" %} -LogLevel {{ OPNsense.radsecproxy.general.logLevel }} -{% endif %} -{% if OPNsense.radsecproxy.general.logFullUsername is defined and OPNsense.radsecproxy.general.logFullUsername != "" %} -LogFullUsername {{ OPNsense.radsecproxy.general.logFullUsername }} -{% endif %} -{% if OPNsense.radsecproxy.general.logMac is defined and OPNsense.radsecproxy.general.logMac != "" %} -LogMac {{ OPNsense.radsecproxy.general.logMac }} -{% endif %} -{% if OPNsense.radsecproxy.general.loopPrevention is defined and OPNsense.radsecproxy.general.loopPrevention != "" %} -LoopPrevention {{ OPNsense.radsecproxy.general.loopPrevention }} -{% endif %} -{% if OPNsense.radsecproxy.general.listenUdp is defined and OPNsense.radsecproxy.general.listenUdp != "" %} -ListenUDP {{ OPNsense.radsecproxy.general.listenUdp }} -{% endif %} -{% if OPNsense.radsecproxy.general.listenTcp is defined and OPNsense.radsecproxy.general.listenTcp != "" %} -ListenTCP {{ OPNsense.radsecproxy.general.listenTcp }} -{% endif %} -{% if OPNsense.radsecproxy.general.listenTls is defined and OPNsense.radsecproxy.general.listenTls != "" %} -ListenTLS {{ OPNsense.radsecproxy.general.listenTls }} -{% endif %} -{% if OPNsense.radsecproxy.general.listenDtls is defined and OPNsense.radsecproxy.general.listenDtls != "" %} -ListenDTLS {{ OPNsense.radsecproxy.general.listenDtls }} -{% endif %} -{% if OPNsense.radsecproxy.general.sourceUdp is defined and OPNsense.radsecproxy.general.sourceUdp != "" %} -SourceUDP {{ OPNsense.radsecproxy.general.sourceUdp }} -{% endif %} -{% if OPNsense.radsecproxy.general.sourceTcp is defined and OPNsense.radsecproxy.general.sourceTcp != "" %} -SourceTCP {{ OPNsense.radsecproxy.general.sourceTcp }} -{% endif %} -{% if OPNsense.radsecproxy.general.sourceTls is defined and OPNsense.radsecproxy.general.sourceTls != "" %} -SourceTLS {{ OPNsense.radsecproxy.general.sourceTls }} -{% endif %} -{% if OPNsense.radsecproxy.general.sourceDtls is defined and OPNsense.radsecproxy.general.sourceDtls != "" %} -SourceDTLS {{ OPNsense.radsecproxy.general.sourceDtls }} -{% endif %} - -########################################### -# TLS-CONFIGS -########################################### - -{% for tlsConfig in helpers.toList('OPNsense.radsecproxy.tlsConfigs.tlsConfig') %} -# config for TLS-Config "{{ tlsConfig.description }}" -tls {{ tlsConfig.name }} { -{% if tlsConfig.caCertificateRefId is defined and tlsConfig.caCertificateRefId != "" %} - CACertificateFile {{ certDir}}{{ tlsConfig.name }}_ca-cert.pem -{% endif %} -{% if tlsConfig.proxyCertificateRefId is defined and tlsConfig.proxyCertificateRefId != "" %} - CertificateFile {{ certDir}}{{ tlsConfig.name }}_proxy-cert.pem - CertificateKeyFile {{ certDir}}{{ tlsConfig.name }}_proxy-key.pem -{% endif %} -{% if tlsConfig.policyOids is defined and tlsConfig.policyOids != "" %} -{% for policyOid in tlsConfig.policyOids.split(',') %} - PolicyOID {{ policyOid }} -{% endfor %} -{% endif %} - CRLCheck {{ tlsConfig.crlCheck }} -{% if tlsConfig.cacheExpiry is defined and tlsConfig.cacheExpiry != "" %} - CacheExpiry {{ tlsConfig.cacheExpiry }} -{% endif %} -} - -{% endfor %} - -########################################### -# REWRITE-RULES -########################################### - -{% for rewriteRule in helpers.toList('OPNsense.radsecproxy.rewrites.rewrite') %} -{% if rewriteRule.enabled is defined and rewriteRule.enabled == "1" %} - -rewrite {{ rewriteRule.name }} { -{% if rewriteRule.addAttributes is defined and rewriteRule.addAttributes != "" %} -{% for addAttribute in rewriteRule.addAttributes.split("\n") %} - AddAttribute {{ addAttribute }} -{% endfor %} -{% endif %} -{% if rewriteRule.addVendorAttributes is defined and rewriteRule.addVendorAttributes != "" %} -{% for addVendorAttribute in rewriteRule.addVendorAttributes.split("\n") %} - AddVendorAttribute {{ addVendorAttribute }} -{% endfor %} -{% endif %} -{% if rewriteRule.supplementAttributes is defined and rewriteRule.supplementAttributes != "" %} -{% for supplementAttribute in rewriteRule.supplementAttributes.split("\n") %} - SupplementAttribute {{ supplementAttribute }} -{% endfor %} -{% endif %} -{% if rewriteRule.supplementVendorAttributes is defined and rewriteRule.supplementVendorAttributes != "" %} -{% for supplementVendorAttribute in rewriteRule.supplementVendorAttributes.split("\n") %} - SupplementVendorAttribute {{ supplementVendorAttribute }} -{% endfor %} -{% endif %} -{% if rewriteRule.modifyAttributes is defined and rewriteRule.modifyAttributes != "" %} -{% for modifyAttribute in rewriteRule.modifyAttributes.split("\n") %} - ModifyAttribute {{ modifyAttribute }} -{% endfor %} -{% endif %} -{% if rewriteRule.modifyVendorAttributes is defined and rewriteRule.modifyVendorAttributes != "" %} -{% for modifyVendorAttribute in rewriteRule.modifyVendorAttributes.split("\n") %} - ModifyVendorAttribute {{ modifyVendorAttribute }} -{% endfor %} -{% endif %} -{% if rewriteRule.removeAttributes is defined and rewriteRule.removeAttributes != "" %} -{% for removeAttribute in rewriteRule.removeAttributes.split("\n") %} - RemoveAttribute {{ removeAttribute }} -{% endfor %} -{% endif %} -{% if rewriteRule.removeVendorAttributes is defined and rewriteRule.removeVendorAttributes != "" %} -{% for removeVendorAttribute in rewriteRule.removeVendorAttributes.split("\n") %} - RemoveVendorAttribute {{ removeVendorAttribute }} -{% endfor %} -{% endif %} - WhitelistMode {{ rewriteRule.whitelistMode }} -{% if rewriteRule.whitelistAttributes is defined and rewriteRule.whitelistAttributes != "" %} -{% for whitelistAttribute in rewriteRule.whitelistAttributes.split("\n") %} - WhitelistAttribute {{ whitelistAttribute }} -{% endfor %} -{% endif %} -{% if rewriteRule.whitelistVendorAttributes is defined and rewriteRule.whitelistVendorAttributes != "" %} -{% for whitelistVendorAttribute in rewriteRule.whitelistVendorAttributes.split("\n") %} - WhitelistVendorAttribute {{ whitelistVendorAttribute }} -{% endfor %} -{% endif %} -} -{% endif %} -{% endfor %} - -########################################### -# CLIENTS -########################################### - -{% for client in helpers.toList('OPNsense.radsecproxy.clients.client') %} -{% if client.enabled is defined and client.enabled == "1" %} -# config for client "{{ client.description }}" -client {{ client.identifier }} { - Host {{ client.host }} - Type {{ client.type }} -{% if client.secret is defined and client.secret != "" %} - Secret {{ client.secret }} -{% endif %} -{% if client.tlsConfig is defined and client.tlsConfig != "" %} -{% set tlsConfig = helpers.getUUID(client.tlsConfig) %} - Tls {{ tlsConfig.name }} -{% endif %} - CertificateNameCheck {{ client.certificateNameCheck }} -{% if client.matchCertificateAttribute is defined and client.matchCertificateAttribute != "" %} - matchCertificateAttribute {{ client.matchCertificateAttribute }} -{% endif %} -{% if client.rewriteIn is defined and client.rewriteIn != "" %} -{% set rewriteInRule = helpers.getUUID(client.rewriteIn) %} - RewriteIn {{ rewriteInRule.name }} -{% endif %} -{% if client.rewriteOut is defined and client.rewriteOut != "" %} -{% set rewriteOutRule = helpers.getUUID(client.rewriteOut) %} - RewriteOut {{ rewriteOutRule.name }} -{% endif %} -} - -{% else %} -# config for client "{{ client.description }}" not enabled, skipping!" - -{% endif %} -{% endfor %} - -########################################### -# SERVERS -########################################### - -{% for server in helpers.toList('OPNsense.radsecproxy.servers.server') %} -# config for server "{{ server.description }}" -server {{ server.identifier }} { - Host {{ server.host }} -{% if server.port is defined and server.port != "" %} - Port {{ server.port }} -{% endif %} - Type {{ server.type }} -{% if server.secret is defined and server.secret != "" %} - Secret {{ server.secret }} -{% endif %} -{% if server.tlsConfig is defined and server.tlsConfig != "" %} -{% set tlsConfig = helpers.getUUID(server.tlsConfig) %} - Tls {{ tlsConfig.name }} -{% endif %} - StatusServer {{ server.statusServer }} - CertificateNameCheck {{ server.certificateNameCheck }} -{% if server.matchCertificateAttribute is defined and server.matchCertificateAttribute != "" %} - matchCertificateAttribute {{ server.matchCertificateAttribute }} -{% endif %} -{% if server.rewriteIn is defined and server.rewriteIn != "" %} -{% set rewriteInRule = helpers.getUUID(server.rewriteIn) %} - RewriteIn {{ rewriteInRule.name }} -{% endif %} -{% if server.rewriteOut is defined and server.rewriteOut != "" %} -{% set rewriteOutRule = helpers.getUUID(server.rewriteOut) %} - RewriteOut {{ rewriteOutRule.name }} -{% endif %} -} - -{% endfor %} - -########################################### -# REALMS -########################################### - -{% for realm in helpers.toList('OPNsense.radsecproxy.realms.realm') %} -{% if realm.enabled is defined and realm.enabled == "1" %} -# config for realm "{{ realm.realm }}" -realm {{ realm.realm }} { -{% if realm.server is defined and realm.server != "" %} -{% for serverUuid in realm.server.split(',') %} -{% set server = helpers.getUUID(serverUuid) %} - Server {{ server.identifier }} -{% endfor %} -{% endif %} -{% if realm.replyMessage is defined and realm.replyMessage != "" %} - ReplyMessage "{{ realm.replyMessage }}" -{% endif %} -{% if realm.accountingResponse is defined and realm.accountingResponse != "" %} - AccountingResponse {{ realm.accountingResponse }} -{% endif %} -} - -{% else %} -# config for realm "{{ realm.realm }}" not enabled, skipping!" - -{% endif %} -{% endfor %} -{# END OF TEMPLATE #} -{% endif %} +{% if helpers.exists('OPNsense.radsecproxy.general') and OPNsense.radsecproxy.general.enabled|default("0") == "1" %} +{% set certDir = '/usr/local/etc/radsecproxy.d/certs/' %} +# auto-generated config-file for radsecproxy +########################################### +# GENERAL +########################################### + +#PidFile /var/run/radsecproxy.pid +#LogDestination file:///var/log/radsecproxy.log +LogDestination x-syslog:///LOG_DAEMON + +{% if OPNsense.radsecproxy.general.logLevel is defined and OPNsense.radsecproxy.general.logLevel != "" %} +LogLevel {{ OPNsense.radsecproxy.general.logLevel }} +{% endif %} +{% if OPNsense.radsecproxy.general.logFullUsername is defined and OPNsense.radsecproxy.general.logFullUsername != "" %} +LogFullUsername {{ OPNsense.radsecproxy.general.logFullUsername }} +{% endif %} +{% if OPNsense.radsecproxy.general.logMac is defined and OPNsense.radsecproxy.general.logMac != "" %} +LogMac {{ OPNsense.radsecproxy.general.logMac }} +{% endif %} +{% if OPNsense.radsecproxy.general.loopPrevention is defined and OPNsense.radsecproxy.general.loopPrevention != "" %} +LoopPrevention {{ OPNsense.radsecproxy.general.loopPrevention }} +{% endif %} +{% if OPNsense.radsecproxy.general.listenUdp is defined and OPNsense.radsecproxy.general.listenUdp != "" %} +ListenUDP {{ OPNsense.radsecproxy.general.listenUdp }} +{% endif %} +{% if OPNsense.radsecproxy.general.listenTcp is defined and OPNsense.radsecproxy.general.listenTcp != "" %} +ListenTCP {{ OPNsense.radsecproxy.general.listenTcp }} +{% endif %} +{% if OPNsense.radsecproxy.general.listenTls is defined and OPNsense.radsecproxy.general.listenTls != "" %} +ListenTLS {{ OPNsense.radsecproxy.general.listenTls }} +{% endif %} +{% if OPNsense.radsecproxy.general.listenDtls is defined and OPNsense.radsecproxy.general.listenDtls != "" %} +ListenDTLS {{ OPNsense.radsecproxy.general.listenDtls }} +{% endif %} +{% if OPNsense.radsecproxy.general.sourceUdp is defined and OPNsense.radsecproxy.general.sourceUdp != "" %} +SourceUDP {{ OPNsense.radsecproxy.general.sourceUdp }} +{% endif %} +{% if OPNsense.radsecproxy.general.sourceTcp is defined and OPNsense.radsecproxy.general.sourceTcp != "" %} +SourceTCP {{ OPNsense.radsecproxy.general.sourceTcp }} +{% endif %} +{% if OPNsense.radsecproxy.general.sourceTls is defined and OPNsense.radsecproxy.general.sourceTls != "" %} +SourceTLS {{ OPNsense.radsecproxy.general.sourceTls }} +{% endif %} +{% if OPNsense.radsecproxy.general.sourceDtls is defined and OPNsense.radsecproxy.general.sourceDtls != "" %} +SourceDTLS {{ OPNsense.radsecproxy.general.sourceDtls }} +{% endif %} + +########################################### +# TLS-CONFIGS +########################################### + +{% for tlsConfig in helpers.toList('OPNsense.radsecproxy.tlsConfigs.tlsConfig') %} +# config for TLS-Config "{{ tlsConfig.description }}" +tls {{ tlsConfig.name }} { +{% if tlsConfig.caCertificateRefId is defined and tlsConfig.caCertificateRefId != "" %} + CACertificateFile {{ certDir}}{{ tlsConfig.name }}_ca-cert.pem +{% endif %} +{% if tlsConfig.proxyCertificateRefId is defined and tlsConfig.proxyCertificateRefId != "" %} + CertificateFile {{ certDir}}{{ tlsConfig.name }}_proxy-cert.pem + CertificateKeyFile {{ certDir}}{{ tlsConfig.name }}_proxy-key.pem +{% endif %} +{% if tlsConfig.policyOids is defined and tlsConfig.policyOids != "" %} +{% for policyOid in tlsConfig.policyOids.split(',') %} + PolicyOID {{ policyOid }} +{% endfor %} +{% endif %} + CRLCheck {{ tlsConfig.crlCheck }} +{% if tlsConfig.cacheExpiry is defined and tlsConfig.cacheExpiry != "" %} + CacheExpiry {{ tlsConfig.cacheExpiry }} +{% endif %} +} + +{% endfor %} + +########################################### +# REWRITE-RULES +########################################### + +{% for rewriteRule in helpers.toList('OPNsense.radsecproxy.rewrites.rewrite') %} +{% if rewriteRule.enabled is defined and rewriteRule.enabled == "1" %} + +rewrite {{ rewriteRule.name }} { +{% if rewriteRule.addAttributes is defined and rewriteRule.addAttributes != "" %} +{% for addAttribute in rewriteRule.addAttributes.split("\n") %} + AddAttribute {{ addAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.addVendorAttributes is defined and rewriteRule.addVendorAttributes != "" %} +{% for addVendorAttribute in rewriteRule.addVendorAttributes.split("\n") %} + AddVendorAttribute {{ addVendorAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.supplementAttributes is defined and rewriteRule.supplementAttributes != "" %} +{% for supplementAttribute in rewriteRule.supplementAttributes.split("\n") %} + SupplementAttribute {{ supplementAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.supplementVendorAttributes is defined and rewriteRule.supplementVendorAttributes != "" %} +{% for supplementVendorAttribute in rewriteRule.supplementVendorAttributes.split("\n") %} + SupplementVendorAttribute {{ supplementVendorAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.modifyAttributes is defined and rewriteRule.modifyAttributes != "" %} +{% for modifyAttribute in rewriteRule.modifyAttributes.split("\n") %} + ModifyAttribute {{ modifyAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.modifyVendorAttributes is defined and rewriteRule.modifyVendorAttributes != "" %} +{% for modifyVendorAttribute in rewriteRule.modifyVendorAttributes.split("\n") %} + ModifyVendorAttribute {{ modifyVendorAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.removeAttributes is defined and rewriteRule.removeAttributes != "" %} +{% for removeAttribute in rewriteRule.removeAttributes.split("\n") %} + RemoveAttribute {{ removeAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.removeVendorAttributes is defined and rewriteRule.removeVendorAttributes != "" %} +{% for removeVendorAttribute in rewriteRule.removeVendorAttributes.split("\n") %} + RemoveVendorAttribute {{ removeVendorAttribute }} +{% endfor %} +{% endif %} + WhitelistMode {{ rewriteRule.whitelistMode }} +{% if rewriteRule.whitelistAttributes is defined and rewriteRule.whitelistAttributes != "" %} +{% for whitelistAttribute in rewriteRule.whitelistAttributes.split("\n") %} + WhitelistAttribute {{ whitelistAttribute }} +{% endfor %} +{% endif %} +{% if rewriteRule.whitelistVendorAttributes is defined and rewriteRule.whitelistVendorAttributes != "" %} +{% for whitelistVendorAttribute in rewriteRule.whitelistVendorAttributes.split("\n") %} + WhitelistVendorAttribute {{ whitelistVendorAttribute }} +{% endfor %} +{% endif %} +} +{% endif %} +{% endfor %} + +########################################### +# CLIENTS +########################################### + +{% for client in helpers.toList('OPNsense.radsecproxy.clients.client') %} +{% if client.enabled is defined and client.enabled == "1" %} +# config for client "{{ client.description }}" +client {{ client.identifier }} { + Host {{ client.host }} + Type {{ client.type }} +{% if client.secret is defined and client.secret != "" %} + Secret {{ client.secret }} +{% endif %} +{% if client.tlsConfig is defined and client.tlsConfig != "" %} +{% set tlsConfig = helpers.getUUID(client.tlsConfig) %} + Tls {{ tlsConfig.name }} +{% endif %} + CertificateNameCheck {{ client.certificateNameCheck }} +{% if client.matchCertificateAttribute is defined and client.matchCertificateAttribute != "" %} + matchCertificateAttribute {{ client.matchCertificateAttribute }} +{% endif %} +{% if client.rewriteIn is defined and client.rewriteIn != "" %} +{% set rewriteInRule = helpers.getUUID(client.rewriteIn) %} + RewriteIn {{ rewriteInRule.name }} +{% endif %} +{% if client.rewriteOut is defined and client.rewriteOut != "" %} +{% set rewriteOutRule = helpers.getUUID(client.rewriteOut) %} + RewriteOut {{ rewriteOutRule.name }} +{% endif %} +} + +{% else %} +# config for client "{{ client.description }}" not enabled, skipping!" + +{% endif %} +{% endfor %} + +########################################### +# SERVERS +########################################### + +{% for server in helpers.toList('OPNsense.radsecproxy.servers.server') %} +# config for server "{{ server.description }}" +server {{ server.identifier }} { + Host {{ server.host }} +{% if server.port is defined and server.port != "" %} + Port {{ server.port }} +{% endif %} + Type {{ server.type }} +{% if server.secret is defined and server.secret != "" %} + Secret {{ server.secret }} +{% endif %} +{% if server.tlsConfig is defined and server.tlsConfig != "" %} +{% set tlsConfig = helpers.getUUID(server.tlsConfig) %} + Tls {{ tlsConfig.name }} +{% endif %} + StatusServer {{ server.statusServer }} + CertificateNameCheck {{ server.certificateNameCheck }} +{% if server.matchCertificateAttribute is defined and server.matchCertificateAttribute != "" %} + matchCertificateAttribute {{ server.matchCertificateAttribute }} +{% endif %} +{% if server.rewriteIn is defined and server.rewriteIn != "" %} +{% set rewriteInRule = helpers.getUUID(server.rewriteIn) %} + RewriteIn {{ rewriteInRule.name }} +{% endif %} +{% if server.rewriteOut is defined and server.rewriteOut != "" %} +{% set rewriteOutRule = helpers.getUUID(server.rewriteOut) %} + RewriteOut {{ rewriteOutRule.name }} +{% endif %} +} + +{% endfor %} + +########################################### +# REALMS +########################################### + +{% for realm in helpers.toList('OPNsense.radsecproxy.realms.realm') %} +{% if realm.enabled is defined and realm.enabled == "1" %} +# config for realm "{{ realm.realm }}" +realm {{ realm.realm }} { +{% if realm.server is defined and realm.server != "" %} +{% for serverUuid in realm.server.split(',') %} +{% set server = helpers.getUUID(serverUuid) %} + Server {{ server.identifier }} +{% endfor %} +{% endif %} +{% if realm.replyMessage is defined and realm.replyMessage != "" %} + ReplyMessage "{{ realm.replyMessage }}" +{% endif %} +{% if realm.accountingResponse is defined and realm.accountingResponse != "" %} + AccountingResponse {{ realm.accountingResponse }} +{% endif %} +} + +{% else %} +# config for realm "{{ realm.realm }}" not enabled, skipping!" + +{% endif %} +{% endfor %} +{# END OF TEMPLATE #} +{% endif %} diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d index 03409f3a79..35042a335c 100644 --- a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d @@ -1,7 +1,7 @@ -{% if helpers.exists('OPNsense.radsecproxy.general.enabled') and OPNsense.radsecproxy.general.enabled == '1' %} -radsecproxy_enable="YES" -{% else %} -radsecproxy_enable="NO" -{% endif %} -radsecproxy_user="root" -radsecproxy_group="wheel" +{% if helpers.exists('OPNsense.radsecproxy.general.enabled') and OPNsense.radsecproxy.general.enabled == '1' %} +radsecproxy_enable="YES" +{% else %} +radsecproxy_enable="NO" +{% endif %} +radsecproxy_user="root" +radsecproxy_group="wheel" From b41246811d7bb2b2532deeb3a901798e953f8013 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 14 Apr 2021 23:37:45 +0200 Subject: [PATCH 0534/3088] net/haproxy: fix config test when service is not enabled --- net/haproxy/pkg-descr | 3 +++ .../opnsense/service/templates/OPNsense/HAProxy/haproxy.conf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 2dbcc504d4..685819d341 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -8,6 +8,9 @@ Plugin Changelog 3.2 +Fixed: +* fix config test when HAProxy service is not enabled + Changed: * ignore incompatible ciphersuites options when LibreSSL is used (#2013) diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index d9923f7996..5cd9e07221 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -829,7 +829,7 @@ userlist {{object.name | regex_replace ("[^A-Za-z0-9]","")}} # # NOTE: HAProxy is currently DISABLED # -{%- endif -%} +{% endif %} {#- ############################### -#} {#- GLOBAL -#} From fddf85bef2c11c17f9f7a18804eda0b47e631a74 Mon Sep 17 00:00:00 2001 From: jeremiah-rs <42019310+jeremiah-rs@users.noreply.github.com> Date: Thu, 15 Apr 2021 07:25:01 -0400 Subject: [PATCH 0535/3088] Minor update to Acl.xml (#2100) Minor edit to make error message clearer. --- dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml index 6abff3a73a..474a0a0dfd 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Acl.xml @@ -13,7 +13,7 @@ Y /^(?!any$|localhost$|localnets$|none$)[0-9a-zA-Z_\-]{1,32}$/u - Should be a string between 1 and 32 characters. Allowed characters are 0-9a-zA-Z_-. Built-in ACL names must not be used: any, localhost, localnets, none. + Should be a string between 1 and 32 characters. Allowed characters are 0-9, a-z, A-Z, _ and -. Built-in ACL names must not be used: any, localhost, localnets, none. From 3a163e8c941d8e1b9d75c4f1b977e03884a50eec Mon Sep 17 00:00:00 2001 From: Ang Iongchun Date: Thu, 15 Apr 2021 19:48:10 +0800 Subject: [PATCH 0536/3088] dns/bind: enhance allow transfer (#1814) * dns/bind: allow-transfer/query for slave zones * dns/bind: global allow-transfer configuration --- .../Bind/forms/dialogEditBindDomain.xml | 24 +++++++++---------- .../OPNsense/Bind/forms/general.xml | 6 +++++ .../mvc/app/models/OPNsense/Bind/General.xml | 11 +++++++++ .../templates/OPNsense/Bind/named.conf | 7 ++++++ 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml index dfd13fd206..c5e51d4928 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml @@ -11,6 +11,18 @@ text Set the name for this zone. Both forward and reverse zones may be specified, i.e. example.com or 0.168.192.in-addr.arpa.
    + + domain.allowtransfer + + dropdown + Define an ACL where you allow which server can retrieve this zone. + + + domain.allowquery + + dropdown + Define an ACL where you allow which client are allowed to query this zone. + domain.type @@ -41,18 +53,6 @@ header - - domain.allowtransfer - - dropdown - Define an ACL where you allow which server can retrieve this zone. If this value is empty, domain transfers from everywhere are allowed. - - - domain.allowquery - - dropdown - Define an ACL where you allow which client are allowed to query this zone. - domain.ttl diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml index 1889a6a477..05ea9fb728 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml @@ -73,6 +73,12 @@ dropdown Define an ACL where you allow which clients can resolve via this service. Usually use your local LAN. + + general.allowtransfer + + dropdown + Define an ACL where you allow which server can retrieve zones. + general.dnssecvalidation diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml index 1d0dc3c7f0..455f87d3db 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml @@ -72,6 +72,17 @@ N Choose an ACL. + + + + + N + N + No diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf index 9309033bca..e6f4a53d27 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf @@ -46,6 +46,13 @@ options { {% endfor %} {% endif %} +{% if helpers.exists('OPNsense.bind.general.allowtransfer') and OPNsense.bind.general.allowtransfer != '' %} +{% for list in helpers.toList('OPNsense.bind.general.allowtransfer') %} +{% set allowtransfer = helpers.getUUID(list) %} + allow-transfer { {{ allowtransfer.name }}; }; +{% endfor %} +{% endif %} + {% if helpers.exists('OPNsense.bind.general.maxcachesize') and OPNsense.bind.general.maxcachesize != '' %} max-cache-size {{ OPNsense.bind.general.maxcachesize }}%; {% endif %} From fc45f464be9a9543c2d63fee5b99116297429cee Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 15 Apr 2021 13:50:35 +0200 Subject: [PATCH 0537/3088] dns/bind: bump version --- dns/bind/Makefile | 3 +-- dns/bind/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 1909668726..2f0d237624 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.16 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.17 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index f449017325..6cb3c94559 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -8,6 +8,11 @@ necessary for asking and answering name service questions. Plugin Changelog ================ +1.17 + +* Make "Allow Transfer" and "Allow Query" configuration available to slave zones +* Add "Allow Transfer" to General page for default/fallback + 1.16 * Fix slave zone templating From c95924d8247d439b7c5446ca8b586869474e795f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 18 Apr 2021 15:04:10 +0200 Subject: [PATCH 0538/3088] Framework: update grep --- Mk/plugins.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 01a35264c1..d1cb1e7e6d 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -284,7 +284,7 @@ lint-desc: check lint-shell: @for FILE in $$(find ${.CURDIR}/src -name "*.sh" -type f); do \ - if [ "$$(head $${FILE} | grep -c '^#!\/bin\/sh$$')" == "0" ]; then \ + if [ "$$(head $${FILE} | grep -cx '#!\/bin\/sh')" == "0" ]; then \ echo "Missing shebang in $${FILE}"; exit 1; \ fi; \ sh -n $${FILE} || exit 1; \ From 5d63a9ad995ed68845a4ff2d1cdff842fcc50331 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 19 Apr 2021 22:08:48 +0200 Subject: [PATCH 0539/3088] devel/debug: xdebug v3 configuration --- devel/debug/Makefile | 2 +- devel/debug/src/etc/php/ext-20-xdebug-settings.ini | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/devel/debug/Makefile b/devel/debug/Makefile index 13fe7f3d9b..19cdd1241b 100644 --- a/devel/debug/Makefile +++ b/devel/debug/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= debug PLUGIN_VERSION= 1.3 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Debugging Tools PLUGIN_DEPENDS= php${PLUGIN_PHP}-pear-PHP_CodeSniffer \ php${PLUGIN_PHP}-pecl-xdebug \ diff --git a/devel/debug/src/etc/php/ext-20-xdebug-settings.ini b/devel/debug/src/etc/php/ext-20-xdebug-settings.ini index 74cba733b4..30ab5e7282 100644 --- a/devel/debug/src/etc/php/ext-20-xdebug-settings.ini +++ b/devel/debug/src/etc/php/ext-20-xdebug-settings.ini @@ -1,2 +1,4 @@ -xdebug.profiler_enable_trigger = 1 +xdebug.mode = profile; +xdebug.start_with_request = trigger; xdebug.profiler_output_name = cachegrind.out.%t.%p +xdebug.profiler_output_dir = /tmp From dc937ddfd7592b098b943d594e7109cd4d101df3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 20 Apr 2021 10:33:16 +0200 Subject: [PATCH 0540/3088] devel/debug: change to version 1.4 --- devel/debug/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/devel/debug/Makefile b/devel/debug/Makefile index 19cdd1241b..f97500c858 100644 --- a/devel/debug/Makefile +++ b/devel/debug/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= debug -PLUGIN_VERSION= 1.3 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.4 PLUGIN_COMMENT= Debugging Tools PLUGIN_DEPENDS= php${PLUGIN_PHP}-pear-PHP_CodeSniffer \ php${PLUGIN_PHP}-pecl-xdebug \ From 5cde1f811bd2cab1caa7a868d4182959fe476ff4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 20 Apr 2021 10:35:08 +0200 Subject: [PATCH 0541/3088] misc/theme-rebellion: bump version --- misc/theme-rebellion/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/theme-rebellion/Makefile b/misc/theme-rebellion/Makefile index 97bd1578d4..f83bf6f1c4 100644 --- a/misc/theme-rebellion/Makefile +++ b/misc/theme-rebellion/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= theme-rebellion -PLUGIN_VERSION= 1.8.6 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.8.7 PLUGIN_COMMENT= A suitably dark theme PLUGIN_MAINTAINER= team-rebellion@queens-park.com From 6ceac562c80b029c7a52479c8b79b408778150bd Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 20 Apr 2021 10:37:55 +0200 Subject: [PATCH 0542/3088] net-mgmt/telegraf: order pkg-descr --- net-mgmt/telegraf/pkg-descr | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 2bd64b400e..fdbbce9fc1 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -7,9 +7,11 @@ metrics to a variety of other datastores, services, and message queues, including InfluxDB, Graphite, OpenTSDB, Datadog, Librato, Kafka, MQTT, NSQ, and many others. +WWW: https://www.influxdata.com/time-series-platform/telegraf/ Plugin Changelog ================ + 1.10.0 * Add intrusion detection alert input @@ -44,6 +46,3 @@ Plugin Changelog 1.7.5 * Add Graphite tag support - - -WWW: https://www.influxdata.com/time-series-platform/telegraf/ From e11930407431a19a331e90ce798cc710ba5a216f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 20 Apr 2021 10:49:59 +0200 Subject: [PATCH 0543/3088] security/maltrail: update changelog --- security/maltrail/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/security/maltrail/pkg-descr b/security/maltrail/pkg-descr index 7df4a37578..9863acea0f 100644 --- a/security/maltrail/pkg-descr +++ b/security/maltrail/pkg-descr @@ -13,6 +13,7 @@ Changelog 1.7 +* Allow sensor cron restart * Add syslog export 1.6 From 29b268413b80e935e9dfa7fd30b7cedd3597a5f9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 20 Apr 2021 10:54:55 +0200 Subject: [PATCH 0544/3088] net/wireguard: prep for new version --- net/wireguard/Makefile | 2 +- net/wireguard/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 2e0da8f81f..d47a3d3d31 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 1.5 +PLUGIN_VERSION= 1.6 PLUGIN_COMMENT= WireGuard VPN service PLUGIN_DEPENDS= wireguard-go wireguard-tools PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 44ecbcc457..10880a4279 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,11 @@ WWW: https://www.wireguard.com/ Changelog --------- +1.6 + +* Move DNS setting to advanced +* Make listen port optional + 1.5 * Allow synchronization of config From 228ea71fc8e0d2f2cd25b7fa09adae0cc2801250 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 20 Apr 2021 10:57:49 +0200 Subject: [PATCH 0545/3088] net/freeradius: update version --- net/freeradius/Makefile | 2 +- net/freeradius/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index 1b61d34a68..2c0998709f 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= freeradius -PLUGIN_VERSION= 1.9.10 +PLUGIN_VERSION= 1.9.11 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index d0d029ffd1..b7dbcee0b7 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -15,6 +15,10 @@ The server is fast, feature-rich, modular, and scalable. Plugin Changelog ================ +1.9.11 + +Add IPv6 support to client IP + 1.9.10 * Add HA config sync From 90c8a662d91369fe056393bddf30906340bb1fed Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 20 Apr 2021 11:05:40 +0200 Subject: [PATCH 0546/3088] www/nginx: update changelog --- www/nginx/Makefile | 3 +-- www/nginx/pkg-descr | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 28fcf5bbeb..fb7fab07ab 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.21 -PLUGIN_REVISION= 3 +PLUGIN_VERSION= 1.22 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index f4dc18e6a1..47c9a2a02f 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -5,9 +5,21 @@ NGINX functionality includes HTTP server, HTTP and mail reverse proxy, caching, load balancing, compression, request throttling, connection multiplexing and reuse, SSL offload and HTTP media streaming. +WWW: https://nginx.org/ + Plugin Changelog ================ +1.22 + +* Add X-Forwarded-Port and X-Forwarded-Host headers (contributed by Carlos Cesario) +* Fix wrong stream server CA filename (contributed by Ingo Theiss) +* Fix proxy_ssl_name and add hook (contributed by kulikov-a) +* Apply loadbalancing for UDP (contributed by Thomas Laubrock) +* Naxsi whitelist improvements (contributed by Manuel Faux) +* Grid view improvements (contributed by Manuel Faux) +* Minor fixes in setup.php (contributed by kulikov-a) + 1.21 * fix performance issue with autoban feature (contributed by jkellerer) @@ -164,5 +176,3 @@ Plugin Changelog * add experimental support to handle the web interface (can only be enabled via CLI) * add WAF (NAXSI) support * add Authentication support - -WWW: https://nginx.org/ From a61d7642fd6b9ea30f445b50348811dfd88a614a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 20 Apr 2021 13:13:49 +0200 Subject: [PATCH 0547/3088] dns/bind: update changelog --- dns/bind/pkg-descr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 6cb3c94559..d35ebdb90b 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -10,8 +10,8 @@ Plugin Changelog 1.17 -* Make "Allow Transfer" and "Allow Query" configuration available to slave zones -* Add "Allow Transfer" to General page for default/fallback +* Make "Allow Transfer" and "Allow Query" configuration available to slave zones (contributed by Ang Iongchun) +* Add "Allow Transfer" to General page for default/fallback (contributed by Ang Iongchun) 1.16 From 6c7b0db55b39e57be288378ca5536fe24c09ccc6 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 20 Apr 2021 17:22:32 +0200 Subject: [PATCH 0548/3088] net/firewall - phalcon 4 compatbility for https://github.com/opnsense/core/issues/4012 --- .../src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php index 3eff2d05eb..a6bf1d4a64 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -29,7 +29,7 @@ namespace OPNsense\Firewall; use OPNsense\Core\Config; -use Phalcon\Validation\Message; +use Phalcon\Messages\Message; use OPNsense\Base\BaseModel; use OPNsense\Firewall\Util; From 54583683bc4d67a88fbefe5d55d8a29e98a5079d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 21 Apr 2021 08:33:35 +0200 Subject: [PATCH 0549/3088] net/firewall: bump revision --- net/firewall/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/firewall/Makefile b/net/firewall/Makefile index 4b40f0f05c..9bb8c5ed87 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= firewall PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Firewall API supplemental package PLUGIN_MAINTAINER= ad@opnsense.org From 576164256de7fa36f336b5acac5ec3cf7fc70e24 Mon Sep 17 00:00:00 2001 From: nan0 <49376203+devNan0@users.noreply.github.com> Date: Wed, 21 Apr 2021 08:56:28 +0200 Subject: [PATCH 0550/3088] Fix leading space in freeradius logformat (#2228) --- .../src/opnsense/scripts/systemhealth/logformats/freeradius.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/freeradius/src/opnsense/scripts/systemhealth/logformats/freeradius.py b/net/freeradius/src/opnsense/scripts/systemhealth/logformats/freeradius.py index 23fc0d7398..345aa1bd5e 100755 --- a/net/freeradius/src/opnsense/scripts/systemhealth/logformats/freeradius.py +++ b/net/freeradius/src/opnsense/scripts/systemhealth/logformats/freeradius.py @@ -27,7 +27,7 @@ import re import datetime from . import BaseLogFormat -freeradius_timeformat = r'^([A-Za-z]{3}\s[A-Za-z]{3}\s\d{1,2}\s\d{2}:\d{2}:\d{2}\s\d{4}\s[:]).*' +freeradius_timeformat = r'^([A-Za-z]{3}\s[A-Za-z]{3}\s+\d{1,2}\s\d{2}:\d{2}:\d{2}\s\d{4}\s[:]).*' class FreeRADIUSLogFormat(BaseLogFormat): From 84cc6b20d26a5b40ef9789ea5f0b15c96871c897 Mon Sep 17 00:00:00 2001 From: rmrfus Date: Tue, 20 Apr 2021 23:57:42 -0700 Subject: [PATCH 0551/3088] Fix FreeDNS update in DynDNS plugin (#2263) --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 4 ++-- dns/dyndns/src/www/services_dyndns_edit.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 67c250a3a0..c47e491bc6 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -587,7 +587,7 @@ class updatedns $this->_checkStatus(0, $code); break; case 'freedns': - curl_setopt($ch, CURLOPT_URL, 'https://freedns.afraid.org/dynamic/update.php?' . $this->_dnsPass); + curl_setopt($ch, CURLOPT_URL, 'https://sync.afraid.org/u/' . $this->_dnsPass . '/'); break; case 'dnsexit': curl_setopt($ch, CURLOPT_URL, 'https://update.dnsexit.com/RemoteUpdate.sv?login=' . urlencode($this->_dnsUser) . '&password=' . $this->_dnsPass . '&host=' . $this->_dnsHost . '&myip=' . $this->_dnsIP); @@ -1329,7 +1329,7 @@ class updatedns } break; case 'freedns': - if (preg_match("/has not changed./i", $data)) { + if (preg_match("/No IP change detected.*skipping update/i", $data)) { $status = "Dynamic DNS ({$this->_dnsHost}): (Success) No Change In IP Address"; $successful_update = true; } elseif (preg_match("/Updated/i", $data)) { diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index 388cbbcbe3..2ac1766c09 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -369,6 +369,7 @@ function is_dyndns_username($uname)


    +
    From 5b2ac550c49af5c14356cdc592568e3febc2d54f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 21 Apr 2021 08:51:01 +0200 Subject: [PATCH 0552/3088] dns/dyndns: small cleanup and new version --- dns/dyndns/Makefile | 3 +- .../src/etc/inc/plugins.inc.d/dyndns.inc | 2 +- .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 123 ++++++------------ 3 files changed, 39 insertions(+), 89 deletions(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 451840d028..da4ebda94a 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= dyndns -PLUGIN_VERSION= 1.23 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.24 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index 40744ebd5c..8652456942 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -101,9 +101,9 @@ function dyndns_list() 'azurev6' => 'Azure DNS (v6)', 'citynetwork' => 'City Network', 'cloudflare' => 'Cloudflare', - 'cloudflare-v6' => 'Cloudflare (v6)', 'cloudflare-token' => 'Cloudflare API token', 'cloudflare-token-v6' => 'Cloudflare API token (v6)', + 'cloudflare-v6' => 'Cloudflare (v6)', 'custom' => 'Custom', 'custom-v6' => 'Custom (v6)', 'dhs' => 'DHS', diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index c47e491bc6..e86b66e007 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -1,57 +1,8 @@ Date: Wed, 21 Apr 2021 09:01:50 +0200 Subject: [PATCH 0553/3088] dns/dyndns: Add hetzner dns console to supported dyndns services (#2201) --- .../src/etc/inc/plugins.inc.d/dyndns.inc | 2 + .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 103 ++++++++++++++++++ 2 files changed, 105 insertions(+) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index 8652456942..e38fd0a46e 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -128,6 +128,8 @@ function dyndns_list() 'he-net' => 'HE.net', 'he-net-tunnelbroker' => 'HE.net Tunnelbroker', 'he-net-v6' => 'HE.net (v6)', + 'hetzner' => 'Hetzner DNS Console', + 'hetzner-v6' => 'Hetzner DNS Console (v6)', 'linode' => 'Linode', 'linode-v6' => 'Linode (v6)', 'loopia' => 'Loopia', diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index e86b66e007..329c6db816 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -214,6 +214,8 @@ class updatedns break; case 'cloudflare-token': case 'cloudflare-token-v6': + case 'hetzner': + case 'hetzner-v6': if (!$dnsPass) { $this->_error(4); } elseif (!$dnsHost) { @@ -244,6 +246,7 @@ class updatedns case 'regfish-v6': case 'route53-v6': case 'cloudflare-token-v6': + case 'hetzner-v6': $this->_useIPv6 = true; break; default: @@ -318,6 +321,8 @@ class updatedns case 'he-net': case 'he-net-tunnelbroker': case 'he-net-v6': + case 'hetzner': + case 'hetzner-v6': case 'hn': case 'linode': case 'linode-v6': @@ -821,6 +826,87 @@ class updatedns } } break; + case 'hetzner': + case 'hetzner-v6': + $baseUrl = 'https://dns.hetzner.com/api/v1'; + $fqdn = str_replace(' ', '', $this->_dnsHost); + $recordType = ($this->_useIPv6) ? 'AAAA' : 'A'; + $ttlData = intval($this->_dnsTTL) < 1 ? 120 : intval($this->_dnsTTL); + $hostData = array( + "value" => "{$this->_dnsIP}", + "type" => $recordType, + "name" => "", + "ttl" => $ttlData, + "zone_id" => "" + ); + + $headerAuth = array( + "Auth-API-Token: {$this->_dnsPass}", + 'Content-Type: application/json' + ); + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headerAuth); + + // Get all zone info + $zonesUrl = "$baseUrl/zones"; + curl_setopt($ch, CURLOPT_URL, $zonesUrl); + $rawoutput = curl_exec($ch); + $output = json_decode($rawoutput); + $zoneId = null; // Set default value + + + // Iterate zone objects, check if $fqdn is equal to or ends with zone name + foreach ($output->zones as $key => $zoneObj) { + + if (preg_match("/^{$zoneObj->name}$|\.{$zoneObj->name}$/", $fqdn)) { + // Found matching zone + $zoneId = $zoneObj->id; + // Get $hostName from $fqdn, set $domainName + // These are only really used for log messages. + $hostName = preg_replace("/\.?{$zoneObj->name}$/", '', $fqdn); + $domainName = $zoneObj->name; + + break; + } + } + + if ($zoneId) { // If zone ID was found get host ID + $dnsRecordsUrl = "$baseUrl/records?zone_id=$zoneId"; + curl_setopt($ch, CURLOPT_URL, $dnsRecordsUrl); + $rawoutput = curl_exec($ch); + $output = json_decode($rawoutput); + $recordId = null; + + + // Iterate zone objects, check if $hostName exist of the same type + foreach ($output->records as $key => $recordObj) { + if (preg_match("/^{$recordObj->name}$/", $hostName)) { + if ($recordObj->type == $recordType) { + // Found matching host + $recordId = $recordObj->id; + break; + } + } + } + + if ($recordId) { // If record ID was found, update record + $setRecordUrl = "$baseUrl/records/$recordId"; + curl_setopt($ch, CURLOPT_URL, $setRecordUrl); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); + } + else { + $setRecordUrl = "$baseUrl/records"; + curl_setopt($ch, CURLOPT_URL, $setRecordUrl); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); + } + + $hostData["zone_id"] = $zoneId; + $hostData["name"] = $hostName; + + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($hostData)); + } + break; case 'eurodns': curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); @@ -1396,6 +1482,23 @@ class updatedns log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}"); } break; + case 'hetzner': + case 'hetzner-v6': + $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $output = json_decode($data); + if ($output->record->value === $this->_dnsIP) { + $status = "Dynamic DNS: (Success) {$this->_dnsHost} updated to {$this->_dnsIP}"; + $successful_update = true; + } elseif ($http_code == 401) { + $status = 'Dynamic DNS: (Error) Bad authentication attempt because of a wrong API Key.'; + } elseif ($http_code == 403) { + $status = 'Dynamic DNS: (Error) Access to the resource is denied. Mainly due to a lack of permissions to access it!'; + } else { + $status = 'Dynamic DNS: (Error) "Unknown Response"'; + log_error("Dynamic DNS: HTTP Status: {$http_code} PAYLOAD: {$data}"); + $this->_debug($data); + } + break; case 'digitalocean': $output = json_decode($data); if ($output->domain_record->data === $this->_dnsIP) { From 893e57d8bbec9ba90417e13ab0d9170dd9afbe86 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 21 Apr 2021 09:09:06 +0200 Subject: [PATCH 0554/3088] dns/dyndns: style updates, remove NEVER tested --- .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 329c6db816..3eec775e8f 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -22,16 +22,12 @@ * Cloudflare - Last Tested: 16 April 2019 * Cloudflare IPv6 - Last Tested: 16 April 2019 * Cloudflare w/API token - Last Tested: 13 June 2020 - * Cloudflare w/API token v6 - Last Tested: NEVER * DHS - Last Tested: 12 July 2005 * DNS-O-Matic - Last Tested: 9 September 2010 * DNSexit - Last Tested: 20 July 2008 * DigitalOcean - Last Tested: 25 June 2019 * Duck DNS - Last Tested: 04 March 2015 - * DynDNS Custom - Last Tested: NEVER * DynDNS Dynamic - Last Tested: 12 July 2005 - * DynDNS Static - Last Tested: NEVER - * Dyns - Last Tested: NEVER * EasyDNS - Last Tested: 20 July 2008 * Eurodns - Last Tested: 25 July 2018 * FreeDNS - Last Tested: 06 March 2021 @@ -43,19 +39,18 @@ * HE.net - Last Tested: 7 July 2013 * HE.net IPv6 - Last Tested: 7 July 2013 * HE.net Tunnel - Last Tested: 28 June 2011 + * Hetzner DNS Console - Last Tested: 06 February 2021 + * Hetzner DNS Console v6 - Last Tested: 06 February 2021 * HN.org - Last Tested: 12 July 2005 * Linode - Last Tested: 25 February 2020 * Linode v6 - Last Tested: 25 February 2020 - * Loopia - Last Tested: NEVER * Namecheap - Last Tested: 31 August 2010 * No-IP - Last Tested: 20 July 2008 * ODS - Last Tested: 02 August 2005 - * OVH DynHOST - Last Tested: NEVER * Oray - Last Tested: 26 May 2017 * STRATO - Last Tested: 09 May 2017 * SelfHost - Last Tested: 26 December 2011 * StaticCling - Last Tested: 27 April 2006 - * ZoneEdit - Last Tested: NEVER * dynv6 - Last Tested: 25 June 2019 * dynv6 v6 - Last Tested: 25 June 2019 * regfish - Last Tested: 15 August 2017 @@ -832,18 +827,18 @@ class updatedns $fqdn = str_replace(' ', '', $this->_dnsHost); $recordType = ($this->_useIPv6) ? 'AAAA' : 'A'; $ttlData = intval($this->_dnsTTL) < 1 ? 120 : intval($this->_dnsTTL); - $hostData = array( + $hostData = [ "value" => "{$this->_dnsIP}", "type" => $recordType, "name" => "", "ttl" => $ttlData, - "zone_id" => "" - ); + "zone_id" => "" + ]; - $headerAuth = array( + $headerAuth = [ "Auth-API-Token: {$this->_dnsPass}", 'Content-Type: application/json' - ); + ]; curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headerAuth); @@ -855,10 +850,8 @@ class updatedns $output = json_decode($rawoutput); $zoneId = null; // Set default value - // Iterate zone objects, check if $fqdn is equal to or ends with zone name foreach ($output->zones as $key => $zoneObj) { - if (preg_match("/^{$zoneObj->name}$|\.{$zoneObj->name}$/", $fqdn)) { // Found matching zone $zoneId = $zoneObj->id; @@ -894,8 +887,7 @@ class updatedns $setRecordUrl = "$baseUrl/records/$recordId"; curl_setopt($ch, CURLOPT_URL, $setRecordUrl); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); - } - else { + } else { $setRecordUrl = "$baseUrl/records"; curl_setopt($ch, CURLOPT_URL, $setRecordUrl); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); From 8b9f9071919317cd1c126fa675ecc7b7c81a6fb0 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 21 Apr 2021 09:22:51 +0200 Subject: [PATCH 0555/3088] dns/dyndns: fix copy and paste unprotected object access The original code was intended to look up results or let them go in case of invalid returns but it was simplified to the point of not being able to check for validity in the return data. Fix this the best way we can for all three affected services. PR: https://github.com/opnsense/plugins/pull/2288 PR: https://github.com/opnsense/plugins/issues/1564 --- .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 99 ++++++++++--------- 1 file changed, 52 insertions(+), 47 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 3eec775e8f..6be420c029 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -785,16 +785,18 @@ class updatedns $output = json_decode(curl_exec($ch)); $zoneId = null; // Set default value - // Iterate zone objects, check if $fqdn is equal to or ends with zone name - foreach ($output->result as $key => $zoneObj) { - if (preg_match("/^{$zoneObj->name}$|\.{$zoneObj->name}$/", $fqdn)) { - // Found matching zone - $zoneId = $zoneObj->id; - // Get $hostName from $fqdn, set $domainName - // These are only really used for log messages. - $hostName = preg_replace("/\.?{$zoneObj->name}$/", '', $fqdn); - $domainName = $zoneObj->name; - break; + if (!empty($output->result)) { + // Iterate zone objects, check if $fqdn is equal to or ends with zone name + foreach ($output->result as $key => $zoneObj) { + if (preg_match("/^{$zoneObj->name}$|\.{$zoneObj->name}$/", $fqdn)) { + // Found matching zone + $zoneId = $zoneObj->id; + // Get $hostName from $fqdn, set $domainName + // These are only really used for log messages. + $hostName = preg_replace("/\.?{$zoneObj->name}$/", '', $fqdn); + $domainName = $zoneObj->name; + break; + } } } @@ -846,39 +848,40 @@ class updatedns // Get all zone info $zonesUrl = "$baseUrl/zones"; curl_setopt($ch, CURLOPT_URL, $zonesUrl); - $rawoutput = curl_exec($ch); - $output = json_decode($rawoutput); + $output = json_decode(curl_exec($ch)); $zoneId = null; // Set default value - // Iterate zone objects, check if $fqdn is equal to or ends with zone name - foreach ($output->zones as $key => $zoneObj) { - if (preg_match("/^{$zoneObj->name}$|\.{$zoneObj->name}$/", $fqdn)) { - // Found matching zone - $zoneId = $zoneObj->id; - // Get $hostName from $fqdn, set $domainName - // These are only really used for log messages. - $hostName = preg_replace("/\.?{$zoneObj->name}$/", '', $fqdn); - $domainName = $zoneObj->name; + if (!empty($output->zones)) { + // Iterate zone objects, check if $fqdn is equal to or ends with zone name + foreach ($output->zones as $key => $zoneObj) { + if (preg_match("/^{$zoneObj->name}$|\.{$zoneObj->name}$/", $fqdn)) { + // Found matching zone + $zoneId = $zoneObj->id; + // Get $hostName from $fqdn, set $domainName + // These are only really used for log messages. + $hostName = preg_replace("/\.?{$zoneObj->name}$/", '', $fqdn); + $domainName = $zoneObj->name; - break; + break; + } } } if ($zoneId) { // If zone ID was found get host ID $dnsRecordsUrl = "$baseUrl/records?zone_id=$zoneId"; curl_setopt($ch, CURLOPT_URL, $dnsRecordsUrl); - $rawoutput = curl_exec($ch); - $output = json_decode($rawoutput); + $output = json_decode(curl_exec($ch)); $recordId = null; - - // Iterate zone objects, check if $hostName exist of the same type - foreach ($output->records as $key => $recordObj) { - if (preg_match("/^{$recordObj->name}$/", $hostName)) { - if ($recordObj->type == $recordType) { - // Found matching host - $recordId = $recordObj->id; - break; + if (!empty($output->records)) { + // Iterate zone objects, check if $hostName exist of the same type + foreach ($output->records as $key => $recordObj) { + if (preg_match("/^{$recordObj->name}$/", $hostName)) { + if ($recordObj->type == $recordType) { + // Found matching host + $recordId = $recordObj->id; + break; + } } } } @@ -1028,13 +1031,15 @@ class updatedns $output = json_decode(curl_exec($ch)); $domainId = null; - // Find matching domain and split the hostname part from it - foreach ($output->data as $key => $domainObj) { - if (preg_match("/^{$domainObj->domain}$|\.{$domainObj->domain}$/", $fqdn)) { - $domainId = $domainObj->id; - $hostName = preg_replace("/\.?{$domainObj->domain}$/", '', $fqdn); - $domainName = $domainObj->domain; - break; + if (!empty($output->data)) { + // Find matching domain and split the hostname part from it + foreach ($output->data as $key => $domainObj) { + if (preg_match("/^{$domainObj->domain}$|\.{$domainObj->domain}$/", $fqdn)) { + $domainId = $domainObj->id; + $hostName = preg_replace("/\.?{$domainObj->domain}$/", '', $fqdn); + $domainName = $domainObj->domain; + break; + } } } @@ -1048,17 +1053,17 @@ class updatedns $output = json_decode(curl_exec($ch)); $recordId = null; - // Find matching record - foreach ($output->data as $key => $recordObj) { - if ($recordObj->type == $recordType && $recordObj->name == $hostName) { - $recordId = $recordObj->id; - break; + if (!empty($output->data)) { + // Find matching record + foreach ($output->data as $key => $recordObj) { + if ($recordObj->type == $recordType && $recordObj->name == $hostName) { + $recordId = $recordObj->id; + break; + } } } - $hostData = array( - "target" => "{$this->_dnsIP}", - ); + $hostData = [ 'target' => "{$this->_dnsIP}" ]; if ($recordId) { // Update record From 1a5508e45ea4ed73b9cbeb0eb4cef3f747c74354 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Wed, 21 Apr 2021 09:31:45 +0200 Subject: [PATCH 0556/3088] dns/dyndns: add support for deSEC.io (#2023) --- .../src/etc/inc/plugins.inc.d/dyndns.inc | 3 + .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 80 +++++++++++++++++++ dns/dyndns/src/www/services_dyndns_edit.php | 4 +- 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index e38fd0a46e..bdf846b7a9 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -106,6 +106,9 @@ function dyndns_list() 'cloudflare-v6' => 'Cloudflare (v6)', 'custom' => 'Custom', 'custom-v6' => 'Custom (v6)', + 'desec' => 'deSEC', + 'desec-v4-v6' => 'deSEC (v4+v6)', + 'desec-v6' => 'deSEC (v6)', 'dhs' => 'DHS', 'digitalocean' => 'DigitalOcean', 'dnsexit' => 'DNSexit', diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 6be420c029..0395d97aa7 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -51,6 +51,9 @@ * STRATO - Last Tested: 09 May 2017 * SelfHost - Last Tested: 26 December 2011 * StaticCling - Last Tested: 27 April 2006 + * deSEC - Last Tested: 09 September 2020 + * deSEC v6 - Last Tested: 09 September 2020 + * deSEC v4 + v6 - Last Tested: 09 September 2020 * dynv6 - Last Tested: 25 June 2019 * dynv6 v6 - Last Tested: 25 June 2019 * regfish - Last Tested: 15 August 2017 @@ -219,6 +222,15 @@ class updatedns $this->_error(9); } break; + case 'desec': + case 'desec-v4-v6': + case 'desec-v6': + if (!$dnsPass) { + $this->_error(4); + } elseif (!$dnsHost) { + $this->_error(5); + } + break; default: if (!$dnsUser) { $this->_error(3); @@ -241,6 +253,8 @@ class updatedns case 'regfish-v6': case 'route53-v6': case 'cloudflare-token-v6': + case 'desec-v4-v6': + case 'desec-v6': case 'hetzner-v6': $this->_useIPv6 = true; break; @@ -294,6 +308,9 @@ class updatedns case 'cloudflare-token-v6': case 'custom': case 'custom-v6': + case 'desec': + case 'desec-v4-v6': + case 'desec-v6': case 'dhs': case 'digitalocean': case 'gandi-livedns': @@ -1201,6 +1218,51 @@ class updatedns curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonBody); break; + case 'desec': + /* + * https://desec.readthedocs.io/en/latest/dyndns/update-api.html + * dnsHost should be the domain + * dnsPass should be the token, NOT the token id + * IPv6 is empty so deSEC API will not set this to the IPv6 of the sending interface if the connection is made via IPv6 + */ + $server = "https://update.dedyn.io/"; + $url = '?hostname=' . $this->_dnsHost . '&myipv4=' . $this->_dnsIP . '&myipv6=""'; + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsHost . ':' . $this->_dnsPass); + curl_setopt($ch, CURLOPT_URL, $server . $url); + break; + case 'desec-v4-v6': + /* + * https://desec.readthedocs.io/en/latest/dyndns/update-api.html + * dnsHost should be the domain + * dnsPass should be the token, NOT the 36-character token id (https://forum.netgate.com/post/930114) + * IPv4 is determined by deSEC API via the sending interface + */ + + // temporarily disable useIPv6 to get IPv4 Address + $this->_useIPv6 = false; + $ipv4 = $this->_checkIP(); + $this->_useIPv6 = true; + + $server = "https://update.dedyn.io/"; + $url = '?hostname=' . $this->_dnsHost . '&myipv4=' . $ipv4 . '&myipv6=' . $this->_dnsIP; + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsHost . ':' . $this->_dnsPass); + curl_setopt($ch, CURLOPT_URL, $server . $url); + break; + case 'desec-v6': + /* + * https://desec.readthedocs.io/en/latest/dyndns/update-api.html + * dnsHost should be the domain + * dnsPass should be the token, NOT the 36-character token id (https://forum.netgate.com/post/930114) + */ + $server = "https://update6.dedyn.io/"; + $url = '?hostname=' . $this->_dnsHost . '&myipv6=' . $this->_dnsIP; + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsHost . ':' . $this->_dnsPass); + curl_setopt($ch, CURLOPT_URL, $server . $url); + break; default: break; } @@ -1700,6 +1762,24 @@ class updatedns log_error("Dynamic DNS: (Error) HTTPS Status: {$http_code} PAYLOAD: {$data}"); } break; + case 'desec': + case 'desec-v4-v6': + case 'desec-v6': + $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + /* + * HTTP Code 404 should not be possible due to dnsUser == dnsHost, a wrong hostname should cause HTTP 401 Unauthorized. + */ + if ($http_code == 401) { + $status = 'Dynamic DNS: (Error) Bad authentication attempt because of a wrong Password.'; + } elseif ($http_code == 403) { + $status = 'Dynamic DNS: (Error) Access to the resource is denied. The selected hostname is not eligible for dynamic updates.'; + } elseif ($http_code == 429) { + $status = 'Dynamic DNS: (Error) Rate limit reached. Please don\'t try more than one request per minute.'; + } elseif ($http_code == 200 AND preg_match('/good/i', $data)) { + $status = 'Dynamic DNS: (Success) IP Address Updated Successfully!'; + $successful_update = true; + } + break; default: break; } diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index 2ac1766c09..0bd39d8383 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -75,7 +75,7 @@ function is_dyndns_username($uname) } $input_errors = array(); $pconfig = $_POST; - if(($pconfig['type'] == "freedns" || $pconfig['type'] == "linode" || $pconfig['type'] == "linode-v6" || $pconfig['type'] == "namecheap" || $pconfig['type'] == "cloudflare-token" || $pconfig['type'] == "cloudflare-token-v6") && $pconfig['username'] == "") { + if(($pconfig['type'] == "freedns" || $pconfig['type'] == "linode" || $pconfig['type'] == "linode-v6" || $pconfig['type'] == "namecheap" || $pconfig['type'] == "cloudflare-token" || $pconfig['type'] == "cloudflare-token-v6" || $pconfig['type'] == "desec" || $pconfig['type'] == "desec-v4-v6" || $pconfig['type'] == "desec-v6") && $pconfig['username'] == "") { $pconfig['username'] = "none"; } @@ -369,6 +369,7 @@ function is_dyndns_username($uname)


    +

    @@ -387,6 +388,7 @@ function is_dyndns_username($uname)


    +
    From 29cd3a04feca56f448d30f546eb68c79f7626895 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 21 Apr 2021 09:33:04 +0200 Subject: [PATCH 0557/3088] dns/dyndns: post-op --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 0395d97aa7..a7f45f6668 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -1238,7 +1238,7 @@ class updatedns * dnsPass should be the token, NOT the 36-character token id (https://forum.netgate.com/post/930114) * IPv4 is determined by deSEC API via the sending interface */ - + // temporarily disable useIPv6 to get IPv4 Address $this->_useIPv6 = false; $ipv4 = $this->_checkIP(); @@ -1775,7 +1775,7 @@ class updatedns $status = 'Dynamic DNS: (Error) Access to the resource is denied. The selected hostname is not eligible for dynamic updates.'; } elseif ($http_code == 429) { $status = 'Dynamic DNS: (Error) Rate limit reached. Please don\'t try more than one request per minute.'; - } elseif ($http_code == 200 AND preg_match('/good/i', $data)) { + } elseif ($http_code == 200 && preg_match('/good/i', $data)) { $status = 'Dynamic DNS: (Success) IP Address Updated Successfully!'; $successful_update = true; } From 40e058138ebdc8b5c47d176aceb9bbb15b97625c Mon Sep 17 00:00:00 2001 From: polkhigh33 <61509972+polkhigh33@users.noreply.github.com> Date: Wed, 21 Apr 2021 09:39:43 +0200 Subject: [PATCH 0558/3088] Added All-Inkl v4 and v6 DynDNS support (#1725) --- .../src/etc/inc/plugins.inc.d/dyndns.inc | 2 ++ .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index bdf846b7a9..9b2e1b0200 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -97,6 +97,8 @@ function dyndns_list() return array( '3322' => '3322', + 'all-inkl' => 'All-Inkl', + 'all-inkl-v6' => 'All-Inkl (v6)', 'azure' => 'Azure DNS', 'azurev6' => 'Azure DNS (v6)', 'citynetwork' => 'City Network', diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index a7f45f6668..6789a2dd43 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -15,6 +15,7 @@ * - _checkIP() * +----------------------------------------------------+ * 3322 - Last Tested: 26 May 2017 + * All-Inkl - Last Tested: 02 March 2020 * Amazon Route53 - Last Tested: 01 April 2012 * Amazon Route53 v6 - Last Tested: 19 November 2017 * Azure DNS - Last Tested: 16 October 2019 @@ -243,6 +244,7 @@ class updatedns } switch ($dnsService) { + case 'all-inkl-v6': case 'azurev6': case 'cloudflare-v6': case 'custom-v6': @@ -299,6 +301,8 @@ class updatedns } else { switch ($this->_dnsService) { case '3322': + case 'all-inkl': + case 'all-inkl-v6': case 'azure': case 'azurev6': case 'citynetwork': @@ -1178,6 +1182,20 @@ class updatedns curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); break; + case 'all-inkl': + case 'all-inkl-v6': + $server = "https://dyndns.kasserver.com/"; + $url = $server . '?myip=' . $this->_dnsIP; + curl_setopt($ch, CURLOPT_URL, $url ); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + // fix: All-Inkl dyndns.kasserver.com only supports v4 + $ipv4 = get_interface_ip($this->_dnsRequestIf); + if (!is_ipaddr($ipv4)) { + log_error("Dynamic DNS ({$this->_dnsHost}): (Error) Need a IPv4 address on $this->_dnsRequestIf!"); + return false; + } + curl_setopt($ch, CURLOPT_INTERFACE, $ipv4); + // fix end case 'godaddy': case 'godaddy-v6': /* Read https://developer.godaddy.com/ for API documentation */ @@ -1745,6 +1763,22 @@ class updatedns $this->_debug($data); } break; + case 'all-inkl': + case 'all-inkl-v6': + $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + if (preg_match('/good\s' . $this->_dnsIP . '/i', $data)) { + $status = "Dynamic DNS: (Success) IP Update Successfully!"; + $successful_update = true; + } elseif ($http_code == 401) { + $status = "Dynamic DNS: (Error) Authentication failed!"; + } elseif (preg_match('/bad\s\(dyndns_target_ip_syntax_incorrect\)/i', $data)) { + $status = "Dynamic DNS: (Error) IP Syntax incorrect ($this->_dnsIP)!"; + } else { + $status = "Dynamic DNS ({$this->_dnsHost}): (Unknown Response)"; + log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}"); + $this->_debug($data); + } + break; case 'godaddy': case 'godaddy-v6': /* See https://developer.godaddy.com/ for API documentation, not all codes are handled. */ From 76ab286634e891d2a95db6b510f9597f8ac485ee Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 21 Apr 2021 09:40:40 +0200 Subject: [PATCH 0559/3088] dns/dyndns: post-op --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 6789a2dd43..e6428978a0 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -1186,8 +1186,8 @@ class updatedns case 'all-inkl-v6': $server = "https://dyndns.kasserver.com/"; $url = $server . '?myip=' . $this->_dnsIP; - curl_setopt($ch, CURLOPT_URL, $url ); - curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); // fix: All-Inkl dyndns.kasserver.com only supports v4 $ipv4 = get_interface_ip($this->_dnsRequestIf); if (!is_ipaddr($ipv4)) { From 532a8fca36f8cea4ac6697f725a767f7eba99d04 Mon Sep 17 00:00:00 2001 From: Jan Koppe Date: Wed, 21 Apr 2021 09:43:12 +0200 Subject: [PATCH 0560/3088] dyndns: add helptext for digitalocean configuration (#1833) --- dns/dyndns/src/www/services_dyndns_edit.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index 0bd39d8383..d41bb37b68 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -318,6 +318,7 @@ function is_dyndns_username($uname) @@ -366,6 +367,7 @@ function is_dyndns_username($uname)


    +



    @@ -385,6 +387,7 @@ function is_dyndns_username($uname)


    +



    From 4140a8afb040c761860b8dc4c72590d14de519bf Mon Sep 17 00:00:00 2001 From: Jan Koppe Date: Wed, 21 Apr 2021 09:45:23 +0200 Subject: [PATCH 0561/3088] dyndns: add support for digitialocean v6 records (#1832) --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc | 1 + .../src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index 9b2e1b0200..09ad91469e 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -113,6 +113,7 @@ function dyndns_list() 'desec-v6' => 'deSEC (v6)', 'dhs' => 'DHS', 'digitalocean' => 'DigitalOcean', + 'digitalocean-v6' => 'DigitalOcean (v6)', 'dnsexit' => 'DNSexit', 'dnsomatic' => 'DNS-O-Matic', 'duckdns' => 'Duck DNS', diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index e6428978a0..5a33487809 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -27,6 +27,7 @@ * DNS-O-Matic - Last Tested: 9 September 2010 * DNSexit - Last Tested: 20 July 2008 * DigitalOcean - Last Tested: 25 June 2019 + * DigitalOcean v6 - Last Tested: 13 May 2020 * Duck DNS - Last Tested: 04 March 2015 * DynDNS Dynamic - Last Tested: 12 July 2005 * EasyDNS - Last Tested: 20 July 2008 @@ -248,6 +249,7 @@ class updatedns case 'azurev6': case 'cloudflare-v6': case 'custom-v6': + case 'digitalocean-v6': case 'dynv6-v6': case 'he-net-v6': case 'godaddy-v6': @@ -626,6 +628,7 @@ class updatedns curl_setopt($ch, CURLOPT_URL, $server . 'hostname=' . $this->_dnsHost); break; case 'digitalocean': + case 'digitalocean-v6': /* * dnsHost should be the root domain * dnsUser should be the record ID @@ -634,6 +637,13 @@ class updatedns $server = "https://api.digitalocean.com/v2/domains/" . $this->_dnsHost . "/records/" . $this->_dnsUser; $hostData = array("data" => "{$this->_dnsIP}"); + /* + * DigitalOcean does not offer the API via IPv6, so we need + * to force sending the request using IPv4 when updating for IPv6 + */ + curl_setopt($ch, CURLOPT_INTERFACE, $this->_dnsRequestIf); + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); @@ -1577,6 +1587,7 @@ class updatedns } break; case 'digitalocean': + case 'digitalocean-v6': $output = json_decode($data); if ($output->domain_record->data === $this->_dnsIP) { $status = "Dynamic DNS: (Success) Record ID {$this->_dnsUser} updated to {$this->_dnsIP}"; From 98548b27811ae7d847bef9640d78ed043a25f99b Mon Sep 17 00:00:00 2001 From: Victor Kislov Date: Wed, 21 Apr 2021 10:48:43 +0300 Subject: [PATCH 0562/3088] =?UTF-8?q?DynDNS=20-=20Updated=20No-Ip=20client?= =?UTF-8?q?=20code=20to=20use=20APIv2=20which=20also=20supports=20g?= =?UTF-8?q?=E2=80=A6=20(#1836)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 74 +++++++------------ 1 file changed, 25 insertions(+), 49 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 5a33487809..5f78efdd50 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -47,7 +47,7 @@ * Linode - Last Tested: 25 February 2020 * Linode v6 - Last Tested: 25 February 2020 * Namecheap - Last Tested: 31 August 2010 - * No-IP - Last Tested: 20 July 2008 + * No-IP - Last Tested: 15 May 2020 * ODS - Last Tested: 02 August 2005 * Oray - Last Tested: 26 May 2017 * STRATO - Last Tested: 09 May 2017 @@ -446,8 +446,11 @@ class updatedns break; case 'noip': case 'noip-free': - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - $server = "https://dynupdate.no-ip.com/ducupdate.php"; + curl_setopt_array($ch, [ + CURLOPT_SSL_VERIFYPEER => true, + CURLOPT_USERPWD => $this->_dnsUser.':'.$this->_dnsPass + ]); + $server = "https://dynupdate.no-ip.com/nic/update"; $port = ""; if ($this->_dnsServer) { $server = $this->_dnsServer; @@ -467,7 +470,7 @@ class updatedns } else { $iptoset = $this->_dnsIP; } - curl_setopt($ch, CURLOPT_URL, $server . $port . '?username=' . urlencode($this->_dnsUser) . '&pass=' . urlencode($this->_dnsPass) . '&hostname=' . $this->_dnsHost . '&ip=' . $iptoset); + curl_setopt($ch, CURLOPT_URL, $server . $port . '?hostname=' . $this->_dnsHost.'&myip=' . $iptoset); break; case 'easydns': curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); @@ -1323,62 +1326,35 @@ class updatedns break; case 'noip': case 'noip-free': - list($ip,$code) = explode(":", $data); + $noIpPrc = explode(' ', $data); + $code = $noIpPrc[0]; + $ip = isset($noIpPrc[1]) ? $noIpPrc[1] : 'n/a'; switch ($code) { - case 0: - $status = "Dynamic DNS ({$this->_dnsHost}): (Success) IP address is current, no update performed."; + case 'good': + $status = "Dynamic DNS ({$this->_dnsHost}): (Success) DNS hostname update successful."; $successful_update = true; break; - case 1: - $status = "Dynamic DNS ({$this->_dnsHost}): (Success) DNS hostname update successful."; + case 'nochg': + $status = "Dynamic DNS ({$this->_dnsHost}): (Success) IP address is current, no update performed."; $successful_update = true; break; - case 2: + case 'nohost': $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Hostname supplied does not exist."; break; - case 3: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Invalid Username."; - break; - case 4: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Invalid Password."; - break; - case 5: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) To many updates sent."; - break; - case 6: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Account disabled due to violation of No-IP terms of service."; - break; - case 7: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Invalid IP. IP Address submitted is improperly formatted or is a private IP address or is on a blacklist."; - break; - case 8: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Disabled / Locked Hostname."; + case 'badauth': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Invalid Username or Password."; break; - case 9: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Host updated is configured as a web redirect and no update was performed."; - break; - case 10: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Group supplied does not exist."; - break; - case 11: - $status = "Dynamic DNS ({$this->_dnsHost}): (Success) DNS group update is successful."; - $successful_update = true; - break; - case 12: - $status = "Dynamic DNS ({$this->_dnsHost}): (Success) DNS group is current, no update performed."; - $successful_update = true; - break; - case 13: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Update client support not available for supplied hostname or group."; + case 'badagent': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; break; - case 14: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Hostname supplied does not have offline settings configured."; + case '!donate': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Requested update feature only available to Enhanced subscribers."; break; - case 99: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; + case '911': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) No-IP servers currently experiencing outages. Retry no sooner than 30 minutes."; break; - case 100: - $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention."; + case 'abuse': + $status = "Dynamic DNS ({$this->_dnsHost}): (Error) Account disabled due to violation of No-IP terms of service."; break; default: $status = "Dynamic DNS ({$this->_dnsHost}): (Unknown Response)"; From ee651b0dbcef14f2c31b8e58dcd58edc0d9e09fc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 21 Apr 2021 09:51:33 +0200 Subject: [PATCH 0563/3088] dns/dyndns: post-op --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 5f78efdd50..47b4684b0c 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -448,7 +448,7 @@ class updatedns case 'noip-free': curl_setopt_array($ch, [ CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_USERPWD => $this->_dnsUser.':'.$this->_dnsPass + CURLOPT_USERPWD => $this->_dnsUser . ':' . $this->_dnsPass ]); $server = "https://dynupdate.no-ip.com/nic/update"; $port = ""; @@ -470,7 +470,7 @@ class updatedns } else { $iptoset = $this->_dnsIP; } - curl_setopt($ch, CURLOPT_URL, $server . $port . '?hostname=' . $this->_dnsHost.'&myip=' . $iptoset); + curl_setopt($ch, CURLOPT_URL, $server . $port . '?hostname=' . $this->_dnsHost . '&myip=' . $iptoset); break; case 'easydns': curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); From c86550940769517fa28efef1130c8363faba6333 Mon Sep 17 00:00:00 2001 From: Starkstromkonsument Date: Thu, 22 Apr 2021 16:27:53 +0200 Subject: [PATCH 0564/3088] net-mgmt/zabbix-proxy: add logfile and logformat to WebUI (#1937) --- net-mgmt/zabbix4-proxy/Makefile | 3 +- net-mgmt/zabbix4-proxy/pkg-descr | 4 ++ .../models/OPNsense/Zabbixproxy/ACL/ACL.xml | 2 + .../models/OPNsense/Zabbixproxy/Menu/Menu.xml | 5 +- .../systemhealth/logformats/zabbix_proxy.py | 56 +++++++++++++++++++ net-mgmt/zabbix5-proxy/pkg-descr | 1 + .../models/OPNsense/Zabbixproxy/ACL/ACL.xml | 2 + .../models/OPNsense/Zabbixproxy/Menu/Menu.xml | 5 +- .../systemhealth/logformats/zabbix_proxy.py | 56 +++++++++++++++++++ 9 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py create mode 100644 net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py diff --git a/net-mgmt/zabbix4-proxy/Makefile b/net-mgmt/zabbix4-proxy/Makefile index d9ece0f6f9..97c8cc9b66 100644 --- a/net-mgmt/zabbix4-proxy/Makefile +++ b/net-mgmt/zabbix4-proxy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= zabbix4-proxy -PLUGIN_VERSION= 1.2 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.3 PLUGIN_COMMENT= Zabbix Proxy enables decentralized monitoring PLUGIN_DEPENDS= zabbix4-proxy PLUGIN_CONFLICTS= zabbix5-proxy diff --git a/net-mgmt/zabbix4-proxy/pkg-descr b/net-mgmt/zabbix4-proxy/pkg-descr index d60b33addc..32d9a8c1aa 100644 --- a/net-mgmt/zabbix4-proxy/pkg-descr +++ b/net-mgmt/zabbix4-proxy/pkg-descr @@ -12,6 +12,10 @@ WWW: http://www.zabbix.com/ Plugin Changelog ---------------- +1.3 + +* Add logfile to WebUI (Starkstromkonsument ) + 1.2 * Allow adding multiple listen addresses diff --git a/net-mgmt/zabbix4-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml b/net-mgmt/zabbix4-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml index 6166a2c68d..77a65e8798 100644 --- a/net-mgmt/zabbix4-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml +++ b/net-mgmt/zabbix4-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml @@ -4,6 +4,8 @@ ui/zabbixproxy/* api/zabbixproxy/* + ui/diagnostics/log/core/zabbix_proxy/* + api/diagnostics/log/core/zabbix_proxy/* diff --git a/net-mgmt/zabbix4-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml b/net-mgmt/zabbix4-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml index 7b53017433..1b0ed8a101 100644 --- a/net-mgmt/zabbix4-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml +++ b/net-mgmt/zabbix4-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py b/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py new file mode 100644 index 0000000000..cc691a2ee2 --- /dev/null +++ b/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py @@ -0,0 +1,56 @@ +""" + Copyright (c) 2020 Ad Schellevis + Copyright (C) 2020 Starkstromkonsument + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import re +import datetime +from . import BaseLogFormat +zabbix_timeformat = r'(\d*):(\d{4}\d{2}\d{2}:\d{2}\d{2}\d{2})\.\d{3}\s(.*)' + + +class ZabbixLogFormat(BaseLogFormat): + def __init__(self, filename): + super(ZabbixLogFormat, self).__init__(filename) + self._priority = 100 + + def match(self, line): + return self._filename.find('zabbix_proxy') > -1 and re.match(zabbix_timeformat, line) is not None + + @staticmethod + def timestamp(line): + tmp = re.match(zabbix_timeformat, line) + grp = tmp.group(2) + return datetime.datetime.strptime(grp, "%Y%m%d:%H%M%S").isoformat() + + @staticmethod + def process_name(line): + tmp = re.match(zabbix_timeformat, line) + return tmp.group(1) + + @staticmethod + def line(line): + tmp = re.match(zabbix_timeformat, line) + return tmp.group(3) + diff --git a/net-mgmt/zabbix5-proxy/pkg-descr b/net-mgmt/zabbix5-proxy/pkg-descr index 64c6f3d22e..58238b6d67 100644 --- a/net-mgmt/zabbix5-proxy/pkg-descr +++ b/net-mgmt/zabbix5-proxy/pkg-descr @@ -21,6 +21,7 @@ Plugin Changelog 1.3 * Switch to zabbix5-proxy +* Add logfile to WebUI (Starkstromkonsument ) 1.2 diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml index 6166a2c68d..9b1dd7b5b9 100644 --- a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/ACL/ACL.xml @@ -4,6 +4,8 @@ ui/zabbixproxy/* api/zabbixproxy/* + ui/diagnostics/log/zabbix/zabbix_proxy/* + api/diagnostics/log/zabbix/zabbix_proxy/* diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml index 7b53017433..c4813378c5 100644 --- a/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml +++ b/net-mgmt/zabbix5-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/Menu/Menu.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py new file mode 100644 index 0000000000..cc691a2ee2 --- /dev/null +++ b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py @@ -0,0 +1,56 @@ +""" + Copyright (c) 2020 Ad Schellevis + Copyright (C) 2020 Starkstromkonsument + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import re +import datetime +from . import BaseLogFormat +zabbix_timeformat = r'(\d*):(\d{4}\d{2}\d{2}:\d{2}\d{2}\d{2})\.\d{3}\s(.*)' + + +class ZabbixLogFormat(BaseLogFormat): + def __init__(self, filename): + super(ZabbixLogFormat, self).__init__(filename) + self._priority = 100 + + def match(self, line): + return self._filename.find('zabbix_proxy') > -1 and re.match(zabbix_timeformat, line) is not None + + @staticmethod + def timestamp(line): + tmp = re.match(zabbix_timeformat, line) + grp = tmp.group(2) + return datetime.datetime.strptime(grp, "%Y%m%d:%H%M%S").isoformat() + + @staticmethod + def process_name(line): + tmp = re.match(zabbix_timeformat, line) + return tmp.group(1) + + @staticmethod + def line(line): + tmp = re.match(zabbix_timeformat, line) + return tmp.group(3) + From e10e1fa970ae00c0a947617f94df264ea4f7af61 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 22 Apr 2021 16:35:35 +0200 Subject: [PATCH 0565/3088] plugins: remove GitHub links as previously discussed E-mails and real names are ok. PRs welcome. --- mail/postfix/pkg-descr | 4 ++-- net-mgmt/zabbix-agent/pkg-descr | 4 ++-- net-mgmt/zabbix4-proxy/Makefile | 2 +- net-mgmt/zabbix4-proxy/pkg-descr | 2 +- .../opnsense/scripts/systemhealth/logformats/zabbix_proxy.py | 2 +- net-mgmt/zabbix5-proxy/Makefile | 4 ++-- net-mgmt/zabbix5-proxy/pkg-descr | 5 ++++- .../opnsense/scripts/systemhealth/logformats/zabbix_proxy.py | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/mail/postfix/pkg-descr b/mail/postfix/pkg-descr index 92c04b7692..f873fb8259 100644 --- a/mail/postfix/pkg-descr +++ b/mail/postfix/pkg-descr @@ -13,11 +13,11 @@ Plugin Changelog 1.17 -* Add smtpd_sasl_auth_enable to configuration (by @fhloston) +* Add smtpd_sasl_auth_enable to configuration (contributed by fhloston) 1.16 -* Add support for header_checks (Starkstromkonsument ) +* Add support for header_checks (contributed by Starkstromkonsument) 1.15 diff --git a/net-mgmt/zabbix-agent/pkg-descr b/net-mgmt/zabbix-agent/pkg-descr index 3c687fcbc7..e080b7c51c 100644 --- a/net-mgmt/zabbix-agent/pkg-descr +++ b/net-mgmt/zabbix-agent/pkg-descr @@ -14,6 +14,6 @@ Plugin Changelog 1.8 -* Add Changelog (Starkstromkonsument ) -* Fix logformat (Starkstromkonsument ) +* Add Changelog (contributed by Starkstromkonsument) +* Fix logformat (contributed by Starkstromkonsument) * Switch to Zabbix Agent 5.0 diff --git a/net-mgmt/zabbix4-proxy/Makefile b/net-mgmt/zabbix4-proxy/Makefile index 97c8cc9b66..1000368f5c 100644 --- a/net-mgmt/zabbix4-proxy/Makefile +++ b/net-mgmt/zabbix4-proxy/Makefile @@ -2,7 +2,7 @@ PLUGIN_NAME= zabbix4-proxy PLUGIN_VERSION= 1.3 PLUGIN_COMMENT= Zabbix Proxy enables decentralized monitoring PLUGIN_DEPENDS= zabbix4-proxy -PLUGIN_CONFLICTS= zabbix5-proxy +PLUGIN_CONFLICTS= zabbix5-proxy PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" diff --git a/net-mgmt/zabbix4-proxy/pkg-descr b/net-mgmt/zabbix4-proxy/pkg-descr index 32d9a8c1aa..706669f8a2 100644 --- a/net-mgmt/zabbix4-proxy/pkg-descr +++ b/net-mgmt/zabbix4-proxy/pkg-descr @@ -14,7 +14,7 @@ Plugin Changelog 1.3 -* Add logfile to WebUI (Starkstromkonsument ) +* Add log file to web GUI (contributed by Starkstromkonsument) 1.2 diff --git a/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py b/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py index cc691a2ee2..285afab39d 100644 --- a/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py +++ b/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py @@ -1,6 +1,6 @@ """ Copyright (c) 2020 Ad Schellevis - Copyright (C) 2020 Starkstromkonsument + Copyright (C) 2020 Starkstromkonsument All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/net-mgmt/zabbix5-proxy/Makefile b/net-mgmt/zabbix5-proxy/Makefile index d00e2de4ee..d01fce28e2 100644 --- a/net-mgmt/zabbix5-proxy/Makefile +++ b/net-mgmt/zabbix5-proxy/Makefile @@ -1,8 +1,8 @@ PLUGIN_NAME= zabbix5-proxy -PLUGIN_VERSION= 1.4 +PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= Zabbix Proxy enables decentralized monitoring PLUGIN_DEPENDS= zabbix5-proxy -PLUGIN_CONFLICTS= zabbix4-proxy +PLUGIN_CONFLICTS= zabbix4-proxy PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" diff --git a/net-mgmt/zabbix5-proxy/pkg-descr b/net-mgmt/zabbix5-proxy/pkg-descr index 58238b6d67..158cf60878 100644 --- a/net-mgmt/zabbix5-proxy/pkg-descr +++ b/net-mgmt/zabbix5-proxy/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.zabbix.com/ Plugin Changelog ---------------- +1.5 + +* Add log file to web GUI (contributed by Starkstromkonsument) + 1.4 * Allow setting ConfigFrequency @@ -21,7 +25,6 @@ Plugin Changelog 1.3 * Switch to zabbix5-proxy -* Add logfile to WebUI (Starkstromkonsument ) 1.2 diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py index cc691a2ee2..285afab39d 100644 --- a/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py +++ b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py @@ -1,6 +1,6 @@ """ Copyright (c) 2020 Ad Schellevis - Copyright (C) 2020 Starkstromkonsument + Copyright (C) 2020 Starkstromkonsument All rights reserved. Redistribution and use in source and binary forms, with or without From 09c28f831e4db1fd9065edfc307a8d0141cc6b6a Mon Sep 17 00:00:00 2001 From: Nicola Date: Thu, 22 Apr 2021 20:38:10 +0200 Subject: [PATCH 0566/3088] sysutils/nut: add apcupsd support (#2337) --- sysutils/nut/Makefile | 3 +-- sysutils/nut/pkg-descr | 4 ++++ .../OPNsense/Nut/forms/settings.xml | 20 +++++++++++++++++++ .../mvc/app/models/OPNsense/Nut/Nut.xml | 15 +++++++++++++- .../service/templates/OPNsense/Nut/ups.conf | 9 +++++++++ .../templates/OPNsense/Nut/upsmon.conf | 5 +++++ 6 files changed, 53 insertions(+), 3 deletions(-) diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index 52fe1c9c98..caf7bfcc96 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nut -PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= Network UPS Tools PLUGIN_DEPENDS= nut PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/sysutils/nut/pkg-descr b/sysutils/nut/pkg-descr index 2a4925c4d1..9f9fe6b37a 100644 --- a/sysutils/nut/pkg-descr +++ b/sysutils/nut/pkg-descr @@ -9,6 +9,10 @@ and management interface. Plugin Changelog ---------------- +1.8 + +* Add apcupsd-ups driver support + 1.7 * Add PowerWare bcmxcp_usb driver diff --git a/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml b/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml index 444cb42a59..919cb56463 100644 --- a/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml +++ b/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml @@ -76,6 +76,26 @@ Set extra arguments for this UPS, e.g. "port=auto".
    + + + nut.apcupsd.enable + + checkbox + Enable the APCUPSD controlled devices driver. + + + nut.apcupsd.hostname + + text + Set the hostname or ip of the remote apcupsd server. + + + nut.apcupsd.port + + text + Set the port of the remote apcupsd server (optional). + + nut.bcmxcpusb.enable diff --git a/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml b/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml index d8247f37c4..3a200bd11b 100644 --- a/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml +++ b/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml @@ -1,7 +1,7 @@ //OPNsense/Nut Network UPS Tools - 1.0.3 + 1.0.4 @@ -59,6 +59,19 @@ N + + + Y + 0 + + + Y + localhost + + + N + + Y diff --git a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf index 6204f6d256..846345cf7e 100644 --- a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf +++ b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf @@ -20,6 +20,15 @@ driver=apcsmart {% endfor %} {% endif %} {% endif %} +{% if helpers.exists('OPNsense.Nut.apcupsd.enable') and OPNsense.Nut.apcupsd.enable == '1' %} +[{{ OPNsense.Nut.general.name }}] +driver=apcupsd-ups +{% if helpers.exists('OPNsense.Nut.apcupsd.port') and OPNsense.Nut.apcupsd.port != '' %} +port={{ OPNsense.Nut.apcupsd.hostname }}:{{ OPNsense.Nut.apcupsd.port }} +{% else %} +port={{ OPNsense.Nut.apcupsd.hostname }} +{% endif %} +{% endif %} {% if helpers.exists('OPNsense.Nut.bcmxcpusb.enable') and OPNsense.Nut.bcmxcpusb.enable == '1' %} [{{ OPNsense.Nut.general.name }}] driver=bcmxcp_usb diff --git a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf index 334bc91a93..e37c424774 100644 --- a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf +++ b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf @@ -16,6 +16,11 @@ MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_pa SHUTDOWNCMD "/usr/local/etc/rc.halt" POWERDOWNFLAG /etc/killpower {% endif %} +{% if helpers.exists('OPNsense.Nut.apcupsd.enable') and OPNsense.Nut.apcupsd.enable == '1' %} +MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master +SHUTDOWNCMD "/usr/local/etc/rc.halt" +POWERDOWNFLAG /etc/killpower +{% endif %} {% if helpers.exists('OPNsense.Nut.bcmxcpusb.enable') and OPNsense.Nut.bcmxcpusb.enable == '1' %} MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master SHUTDOWNCMD "/usr/local/etc/rc.halt" From 73b0e36f12af2c2418d644d83ac432e5988d74aa Mon Sep 17 00:00:00 2001 From: Joshua Schmidlkofer Date: Fri, 23 Apr 2021 02:08:43 -0700 Subject: [PATCH 0567/3088] net-mgmt/net-snmp: Add support for agentx (#2325) --- net-mgmt/net-snmp/Makefile | 2 +- net-mgmt/net-snmp/pkg-descr | 4 ++++ .../mvc/app/controllers/OPNsense/Netsnmp/forms/general.xml | 6 ++++++ .../opnsense/mvc/app/models/OPNsense/Netsnmp/General.xml | 6 +++++- .../opnsense/service/templates/OPNsense/Netsnmp/snmpd.conf | 5 +++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile index 77c00a3b9d..133d1cf23e 100644 --- a/net-mgmt/net-snmp/Makefile +++ b/net-mgmt/net-snmp/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= net-snmp -PLUGIN_VERSION= 1.4 +PLUGIN_VERSION= 1.5 PLUGIN_REVISION= 1 PLUGIN_COMMENT= Net-SNMP is a daemon for the SNMP protocol PLUGIN_DEPENDS= net-snmp diff --git a/net-mgmt/net-snmp/pkg-descr b/net-mgmt/net-snmp/pkg-descr index c2f08d0bac..c61e6d62df 100644 --- a/net-mgmt/net-snmp/pkg-descr +++ b/net-mgmt/net-snmp/pkg-descr @@ -11,6 +11,10 @@ WWW: http://www.net-snmp.org Plugin Changelog ---------------- +1.5 + +* Add support for agentx. + 1.4 * Include installed version number in extended OID diff --git a/net-mgmt/net-snmp/src/opnsense/mvc/app/controllers/OPNsense/Netsnmp/forms/general.xml b/net-mgmt/net-snmp/src/opnsense/mvc/app/controllers/OPNsense/Netsnmp/forms/general.xml index 46df7feb72..114b0761a5 100644 --- a/net-mgmt/net-snmp/src/opnsense/mvc/app/controllers/OPNsense/Netsnmp/forms/general.xml +++ b/net-mgmt/net-snmp/src/opnsense/mvc/app/controllers/OPNsense/Netsnmp/forms/general.xml @@ -23,6 +23,12 @@ text Set the contact address to use. + + general.enableagentx + + checkbox + Enable support for AgentX Application (FRR, others). + general.l3visibility diff --git a/net-mgmt/net-snmp/src/opnsense/mvc/app/models/OPNsense/Netsnmp/General.xml b/net-mgmt/net-snmp/src/opnsense/mvc/app/models/OPNsense/Netsnmp/General.xml index fe2bbb7e1e..911568aab8 100644 --- a/net-mgmt/net-snmp/src/opnsense/mvc/app/models/OPNsense/Netsnmp/General.xml +++ b/net-mgmt/net-snmp/src/opnsense/mvc/app/models/OPNsense/Netsnmp/General.xml @@ -1,7 +1,7 @@ //OPNsense/netsnmp/general Netsnmp configuration - 1.0.3 + 1.0.4 0 @@ -27,6 +27,10 @@ 0 Y + + 0 + Y + , N diff --git a/net-mgmt/net-snmp/src/opnsense/service/templates/OPNsense/Netsnmp/snmpd.conf b/net-mgmt/net-snmp/src/opnsense/service/templates/OPNsense/Netsnmp/snmpd.conf index 1afbeaad89..a04c0a1820 100644 --- a/net-mgmt/net-snmp/src/opnsense/service/templates/OPNsense/Netsnmp/snmpd.conf +++ b/net-mgmt/net-snmp/src/opnsense/service/templates/OPNsense/Netsnmp/snmpd.conf @@ -12,6 +12,11 @@ agentAddress udp6:[{{ network }}]:161 agentAddress udp:161,udp6:[::1]:161 {% endif %} +{% if OPNsense.netsnmp.general.enableagentx == '1' %} +master agentx +agentxsocket /var/agentx/master +agentxperms 777 777 +{% endif %} {% if helpers.exists('OPNsense.netsnmp.general.community') and OPNsense.netsnmp.general.community != '' %} rocommunity {{ OPNsense.netsnmp.general.community }} From c00a5d3208c9d9d8a1006a6c1e8721b8a0ba1c87 Mon Sep 17 00:00:00 2001 From: Frank Brendel Date: Fri, 23 Apr 2021 11:16:16 +0200 Subject: [PATCH 0568/3088] net/relayd: fix typo in relayd.conf template --- net/relayd/Makefile | 2 +- .../src/opnsense/service/templates/OPNsense/Relayd/relayd.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index de76204b17..d16c606a3e 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= relayd -PLUGIN_VERSION= 2.4 +PLUGIN_VERSION= 2.5 PLUGIN_REVISION= 2 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer diff --git a/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf b/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf index 6bcc696a79..f8b6b9bbcd 100644 --- a/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf +++ b/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf @@ -106,7 +106,7 @@ disable {% set backuptablecheck = helpers.getUUID(virtualserver.backuptransport_tablecheck) if virtualserver.backuptransport_tablecheck is defined %} {% set _backuptablecheck = '' %} {% if backuptablecheck.type == 'http' and backuptablecheck.path is defined%} -{% set _backuptablecheck = 'check ' ~ backuptablecheck.type ~ 's' %} +{% set _backuptablecheck = 'check ' ~ backuptablecheck.type %} {% if backuptablecheck.ssl|default('0') == '1' %} {% set _backuptablecheck = _backuptablecheck ~ 's' %} {% endif %} From 6c738d467d4d4fc1735114528d40ffa2407d12bc Mon Sep 17 00:00:00 2001 From: Joshua Schmidlkofer Date: Fri, 23 Apr 2021 02:45:55 -0700 Subject: [PATCH 0569/3088] net/frr: Add support for agentx (#2321) --- .../mvc/app/controllers/OPNsense/Quagga/forms/general.xml | 6 ++++++ .../src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml | 4 ++++ .../opnsense/service/templates/OPNsense/Quagga/bgpd.conf | 4 ++++ net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr | 6 ++++++ .../opnsense/service/templates/OPNsense/Quagga/ospf6d.conf | 3 +++ .../opnsense/service/templates/OPNsense/Quagga/ospfd.conf | 3 +++ .../opnsense/service/templates/OPNsense/Quagga/zebra.conf | 6 ++++++ 7 files changed, 32 insertions(+) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml index 926afe40f2..fc3d304c31 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/general.xml @@ -18,6 +18,12 @@ checkbox This will activate the routing service only on the master device. + + general.enablesnmp + + checkbox + This will activate support for Net-SNMP AgentX. + general.enablesyslog diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml index de9a496bde..cc0b58304b 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/General.xml @@ -24,6 +24,10 @@ 1 Y + + 0 + Y + Y N diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index 4bd7d7ef60..bd2d0e3b32 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -241,6 +241,10 @@ route-map {{ routemap.name }} {{ routemap.action }} {{ routemap.id }} ! {% endif %} ! +{% if helpers.exists('OPNsense.quagga.bgpd.enabled') and OPNsense.quagga.general.enablesnmp == '1' %} +agentx +{% endif %} +! line vty ! {% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr index 2163fb73a3..9c8ee85256 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr @@ -17,3 +17,9 @@ start_postcmd="/usr/local/opnsense/scripts/frr/carp_event_handler" {% else %} frr_enable="NO" {% endif %} +{% if OPNsense.quagga.general.enablesnmp == '1' %} +zebra_flags="${zebra_flags} -M snmp" +bgpd_flags="${bgpd_flags} -M snmp" +ospf_flags="${ospf_flags} -M snmp" +ospf6_flags="${ospf6_flags} -M snmp" +{% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf index 603950f669..92fb578d97 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf @@ -14,6 +14,9 @@ log syslog {{ OPNsense.quagga.general.sysloglevel }} {% if helpers.exists('OPNsense.quagga.general.profile') %} frr defaults {{ OPNsense.quagga.general.profile }} {% endif %} +{% if OPNsense.quagga.general.enablesnmp == '1' %} +agentx +{% endif %} {% endif %} ! ! diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf index dda33b080a..350f4925cb 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf @@ -14,6 +14,9 @@ log syslog {{ OPNsense.quagga.general.sysloglevel }} {% if helpers.exists('OPNsense.quagga.general.profile') %} frr defaults {{ OPNsense.quagga.general.profile }} {% endif %} +{% if OPNsense.quagga.general.enablesnmp == '1' %} +agentx +{% endif %} {% endif %} ! ! diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf index 06de1506be..fbc685f72b 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/zebra.conf @@ -13,6 +13,12 @@ log syslog {{ OPNsense.quagga.general.sysloglevel }} ! ! ! +! +{% if OPNsense.quagga.general.enablesnmp == '1' %} +agentx +{% endif %} +! +! ip forwarding ipv6 forwarding ! From a4d7040d06a29a33aa3efa0bfb63a480700efb3e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 23 Apr 2021 11:48:02 +0200 Subject: [PATCH 0570/3088] net/frr: add release note --- net/frr/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index a5aa793d9e..3fb961354a 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -14,6 +14,7 @@ Plugin Changelog 1.22 * Add BFD support +* Add support for agentx (contributed by Joshua Schmidlkofer) 1.21 From 5cd954c51658dc308006483cd9f0e1e7a9fb75a5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 23 Apr 2021 11:48:16 +0200 Subject: [PATCH 0571/3088] net-mgmt/zabbix?-proxy: whitespace cleanup --- .../src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py | 1 - .../src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py | 1 - 2 files changed, 2 deletions(-) diff --git a/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py b/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py index 285afab39d..c08dbeccb1 100644 --- a/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py +++ b/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py @@ -53,4 +53,3 @@ def process_name(line): def line(line): tmp = re.match(zabbix_timeformat, line) return tmp.group(3) - diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py index 285afab39d..c08dbeccb1 100644 --- a/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py +++ b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py @@ -53,4 +53,3 @@ def process_name(line): def line(line): tmp = re.match(zabbix_timeformat, line) return tmp.group(3) - From fcd6cd9876d02937ae59f63039c27b96fa09132b Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 26 Apr 2021 08:33:49 +0200 Subject: [PATCH 0572/3088] net/chrony: add makestep to default config (#2350) --- net/chrony/Makefile | 2 +- net/chrony/pkg-descr | 4 ++++ .../opnsense/service/templates/OPNsense/Chrony/chrony.conf | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net/chrony/Makefile b/net/chrony/Makefile index 4bfc40a55c..8ca31c20bb 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= chrony -PLUGIN_VERSION= 1.2 +PLUGIN_VERSION= 1.3 PLUGIN_COMMENT= Chrony time synchronisation PLUGIN_DEPENDS= chrony PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/chrony/pkg-descr b/net/chrony/pkg-descr index c273e65812..a6283aec5f 100644 --- a/net/chrony/pkg-descr +++ b/net/chrony/pkg-descr @@ -4,6 +4,10 @@ better in virtual environments. Plugin Changelog ---------------- +1.3 + +* Add makestep to configuration + 1.2 * Add Diagnostics diff --git a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf index e800d636df..6910ea4a46 100644 --- a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf +++ b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf @@ -3,6 +3,7 @@ port {{ OPNsense.chrony.general.port }} driftfile /var/db/chrony/drift pidfile /var/run/chrony/chronyd.pid +makestep 1 3 {% if helpers.exists('OPNsense.chrony.general.ntsclient') and OPNsense.chrony.general.ntsclient == '1' %} ntsdumpdir /var/lib/chrony From 9a132c18050da5dc54f7c84a451ca2937ab46254 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 26 Apr 2021 11:19:46 +0200 Subject: [PATCH 0573/3088] emulators/qemu-guest-agent: release initial version (#2357) emulators/qemu-guest-agent: release initial version --- emulators/qemu-guest-agent/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emulators/qemu-guest-agent/Makefile b/emulators/qemu-guest-agent/Makefile index 1f9c4268f7..3e56e911f8 100644 --- a/emulators/qemu-guest-agent/Makefile +++ b/emulators/qemu-guest-agent/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= qemu-guest-agent -PLUGIN_VERSION= 0.1 -PLUGIN_DEVEL= yes +PLUGIN_VERSION= 1.0 PLUGIN_COMMENT= QEMU Guest Agent for OPNsense PLUGIN_DEPENDS= qemu-guest-agent PLUGIN_MAINTAINER= opnsense@moov.de From eacc857cdceb7bc898c62eac7fc16d5354126fdd Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 28 Apr 2021 22:08:51 +0200 Subject: [PATCH 0574/3088] net/frr: finalize BFD for BGP (#2364) --- net/frr/Makefile | 1 + .../OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml | 6 ++++++ net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml | 4 ++++ .../opnsense/service/templates/OPNsense/Quagga/bgpd.conf | 5 ++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 7aa041dd20..2b73a8a551 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.22 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml index 146dff7db0..649062d393 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml @@ -38,6 +38,12 @@ checkbox + + neighbor.bfd + + checkbox + You can enable BFD support for this neighbor. + neighbor.keepalive diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml index e1106e13e1..b657eba87e 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml @@ -74,6 +74,10 @@ 0 N + + 0 + N + N 1 diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index bd2d0e3b32..c788574537 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -28,7 +28,10 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% for neighbor in helpers.toList('OPNsense.quagga.bgp.neighbors.neighbor') %} {% if neighbor.enabled == '1' %} neighbor {{ neighbor.address }} remote-as {{ neighbor.remoteas }} -{% if 'updatesource' in neighbor and neighbor.updatesource != '' %} +{% if 'bfd' in neighbor and neighbor.bfd == '1' %} + neighbor {{ neighbor.address }} bfd +{% endif %} + {% if 'updatesource' in neighbor and neighbor.updatesource != '' %} neighbor {{ neighbor.address }} update-source {{ physical_interface(neighbor.updatesource) }} {% endif %} {% if 'multihop' in neighbor and neighbor.multihop == '1' %} From da4aa10d6fb89ca970fa23bd4eed92d4cdeb770f Mon Sep 17 00:00:00 2001 From: Kimotu Bates <45389306+Kimotu@users.noreply.github.com> Date: Wed, 28 Apr 2021 22:41:51 +0200 Subject: [PATCH 0575/3088] Fixed expected mime-type (#1807) Chrome and Firefox report CSP as application/csp-report and not application/json. This lead to HTTP 400 BAD REQUEST. No csp logs were created. With this fix, the form is csp report is processed and written to logs. --- www/nginx/src/opnsense/scripts/nginx/csp_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/nginx/src/opnsense/scripts/nginx/csp_report.php b/www/nginx/src/opnsense/scripts/nginx/csp_report.php index 303eed9858..116707a096 100755 --- a/www/nginx/src/opnsense/scripts/nginx/csp_report.php +++ b/www/nginx/src/opnsense/scripts/nginx/csp_report.php @@ -29,7 +29,7 @@ $log_file = '/var/log/nginx/csp_violations.log'; // make sure we don't have any formatting issues here -if (stristr($_SERVER['CONTENT_TYPE'], 'json') === false) { +if (stristr($_SERVER['CONTENT_TYPE'], 'csp-report') === false) { http_response_code(400); echo "This endpoint expects JSON data. Please send data using a json mime time (for example application/json)"; exit(0); From b63964117c940efe8b34244fa0c61d9791d523b4 Mon Sep 17 00:00:00 2001 From: James French Date: Sat, 1 May 2021 01:48:10 +0800 Subject: [PATCH 0576/3088] net/wireguard: Make tunneladdress an optional parameter (#2352) --- net/wireguard/Makefile | 2 +- net/wireguard/pkg-descr | 4 ++++ .../src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml | 2 +- .../templates/OPNsense/Wireguard/wireguard-server.conf | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index d47a3d3d31..097f67923a 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 1.6 +PLUGIN_VERSION= 1.7 PLUGIN_COMMENT= WireGuard VPN service PLUGIN_DEPENDS= wireguard-go wireguard-tools PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 10880a4279..a7fc930799 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,10 @@ WWW: https://www.wireguard.com/ Changelog --------- +1.7 + +* Make tunnel address (wg interface address) optional + 1.6 * Move DNS setting to advanced diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml index 6a749c3d78..7b99312233 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml @@ -43,7 +43,7 @@ , - Y + N Y diff --git a/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf b/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf index 82db761908..5e03ddb005 100644 --- a/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf +++ b/net/wireguard/src/opnsense/service/templates/OPNsense/Wireguard/wireguard-server.conf @@ -5,7 +5,9 @@ {% if server_list.enabled == '1' %} [Interface] PrivateKey = {{ server_list.privkey }} +{% if server_list.tunneladdress|default('') != '' %} Address = {{ server_list.tunneladdress }} +{% endif %} {% if server_list.port|default('') != '' %} ListenPort = {{ server_list.port }} {% endif %} From 89d9ac097c80b3db742682c847d19284b69f4cbb Mon Sep 17 00:00:00 2001 From: tiny6996 Date: Tue, 4 May 2021 13:48:13 -0500 Subject: [PATCH 0577/3088] net-mgmt/telegraf: fixed #2369 if statements in wrong spot and wrong model form (#2370) --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 4 ++++ .../src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml | 4 ++++ .../src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml | 4 ---- .../service/templates/OPNsense/Telegraf/telegraf.conf | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index fc30142acd..9aa85c02c4 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.10.0 +PLUGIN_VERSION= 1.10.1 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index fdbbce9fc1..9cacb5cf5f 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.influxdata.com/time-series-platform/telegraf/ Plugin Changelog ================ +1.10.1 + +* Fix Suricata input controller being the output section and incorrect statement + 1.10.0 * Add intrusion detection alert input diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml index bf4cd5d910..721ea4e987 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml @@ -89,5 +89,9 @@ 0 N + + 0 + N + diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index 588f3061cf..c3b090acf7 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -121,9 +121,5 @@ N - - 0 - N - diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index 09bff97eee..f553999f73 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -252,6 +252,8 @@ {% else %} dns_lookup = false {% endif %} +{% endif %} + {% if helpers.exists('OPNsense.telegraf.input.intrusion_detection_alerts') and OPNsense.telegraf.input.intrusion_detection_alerts == '1' %} [[inputs.tail]] data_format = "json" @@ -260,6 +262,5 @@ tag_keys = ["event_type","src_ip","src_port","dest_ip","dest_port"] json_string_fields = ["*"] {% endif %} -{% endif %} {% endif %} From 264e739bf675bd57a901836b599da08900a8fadc Mon Sep 17 00:00:00 2001 From: Fabian Franz BSc Date: Sun, 9 May 2021 13:43:36 +0200 Subject: [PATCH 0578/3088] www/nginx: source code migration for Phalcon 4 (#2382) --- www/nginx/Makefile | 2 +- www/nginx/pkg-descr | 4 ++++ .../OPNsense/Nginx/Api/SettingsController.php | 3 --- .../Constraints/NaxsiIdentifierConstraint.php | 4 ++-- .../Constraints/NgxBusyBufferConstraint.php | 19 +++++++------------ 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index fb7fab07ab..df5c3e49eb 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.22 +PLUGIN_VERSION= 1.23 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 47c9a2a02f..729721ed59 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -10,6 +10,10 @@ WWW: https://nginx.org/ Plugin Changelog ================ +1.23 + +* Migration for PHP Phalcon 4 (non breaking change for UI/API) + 1.22 * Add X-Forwarded-Port and X-Forwarded-Host headers (contributed by Carlos Cesario) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php index ccb2cb6d98..443946ffca 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php @@ -615,7 +615,6 @@ private function convert_ipacl_for_client($response_data) /** * @param null $uuid the uuid which should get cleared before * @throws \ReflectionException if the model was not found - * @throws \Phalcon\Validation\Exception on validation errors */ private function regenerate_hostname_map($uuid = null) { @@ -644,7 +643,6 @@ private function regenerate_hostname_map($uuid = null) /** * @param null $uuid the uuid which should get cleared before * @throws \ReflectionException if the model was not found - * @throws \Phalcon\Validation\Exception on validation errors */ private function regenerate_ipacl($uuid = null) { @@ -673,7 +671,6 @@ private function regenerate_ipacl($uuid = null) /** * @param $uuids array list of UUIDs * @param $path string the model prefix from the element to delete - * @throws \Phalcon\Validation\Exception */ private function delete_uuids($uuids, $path): void { diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php index 2373aae529..43b4abf1e0 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php @@ -28,7 +28,7 @@ namespace OPNsense\Base\Constraints; -use Phalcon\Validation\Message; +use Phalcon\Messages\Message; /** * a very specific nginx check for Naxsi rule IDs - not reusable @@ -38,7 +38,7 @@ */ class NaxsiIdentifierConstraint extends BaseConstraint { - public function validate(\Phalcon\Validation $validator, $attribute) + public function validate(\Phalcon\Validation $validator, $attribute) : bool { $node = $this->getOption('node'); if ($node) { diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php index ba7d7944f6..bbf2c5ac82 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php @@ -28,7 +28,7 @@ namespace OPNsense\Base\Constraints; -use Phalcon\Validation\Message; +use Phalcon\Messages\Message; /** * a very specific nginx check - not reusable @@ -38,7 +38,7 @@ */ class NgxBusyBufferConstraint extends BaseConstraint { - public function validate(\Phalcon\Validation $validator, $attribute) + public function validate(\Phalcon\Validation $validator, $attribute) : bool { $node = $this->getOption('node'); if ($node) { @@ -64,26 +64,22 @@ public function validate(\Phalcon\Validation $validator, $attribute) $proxy_buffer_size_int = intval((string) $proxy_buffer_size_node); } - if ( - isset($proxy_buffers_total_minus1_size) && isset($proxy_busy_buffers_size) && + if (isset($proxy_buffers_total_minus1_size) && isset($proxy_busy_buffers_size) && $proxy_buffers_total_minus1_size < $proxy_busy_buffers_size ) { $validator->appendMessage(new Message( gettext("Proxy Buffer Size must be less than the size of all Proxy Buffers minus one buffer."), - $attribute, - $this->getOption('name') + $attribute )); } // nginx: [emerg] "proxy_busy_buffers_size" must be equal to or greater than the maximum of the value of "proxy_buffer_size" and one of the "proxy_buffers" - if ( - isset($proxy_busy_buffers_size) && isset($proxy_buffers_size_int) && + if (isset($proxy_busy_buffers_size) && isset($proxy_buffers_size_int) && $proxy_busy_buffers_size < $proxy_buffers_size_int ) { $validator->appendMessage(new Message( gettext("Proxy Busy Buffers Size must be equal to or greater than the maximum of one of the Proxy Buffers."), - $attribute, - $this->getOption('name') + $attribute )); } @@ -94,8 +90,7 @@ public function validate(\Phalcon\Validation $validator, $attribute) ) { $validator->appendMessage(new Message( gettext("Proxy Busy Buffers Size must be equal to or greater than the maximum of the value of Proxy Buffer Size."), - $attribute, - $this->getOption('name') + $attribute )); } } From a4d2230f6a2e5215a8c2ee423c08781636c992bc Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 10 May 2021 22:50:35 +0200 Subject: [PATCH 0579/3088] net/haproxy: bump version, update changelog --- net/haproxy/Makefile | 2 +- net/haproxy/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 381ec9f771..0a46eb1dd2 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.2 +PLUGIN_VERSION= 3.3 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 685819d341..b445b6efae 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.3 + +Changed: +* use HAProxy socket to apply updated OCSP stapling data (in cron job) (#2351) + 3.2 Fixed: From 13f55969431c1e2020bde4f9f709609d9c805bd7 Mon Sep 17 00:00:00 2001 From: djh-live-apps <80447151+djh-live-apps@users.noreply.github.com> Date: Tue, 11 May 2021 18:03:09 +1000 Subject: [PATCH 0580/3088] security/acme-client: Added native support for Vultr DNS API (#2344) * Add native support for Vultr DNS API --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsVultr.php | 44 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 4 ++ 3 files changed, 63 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVultr.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 2bc5df97d8..b1bccf6f6d 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -972,6 +972,21 @@ text + + + header + + + + + header + + + + validation.dns_vultr_key + + text + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVultr.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVultr.php new file mode 100644 index 0000000000..2b52824a34 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsVultr.php @@ -0,0 +1,44 @@ +acme_env['VULTR_API_KEY'] = (string)$this->config->dns_vultr_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index edbcfdfcd1..6fd163f1c0 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -434,6 +434,7 @@ UnoEuro API Variomedia.de API Vscale API + Vultr API Yandex PDD API Zilore DNS API zonomi.com domain API @@ -853,6 +854,9 @@ N + + N + N From 4428246a0f78647514d28162b6636dbb334165cb Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 11 May 2021 10:04:18 +0200 Subject: [PATCH 0581/3088] security/acme-client: update changelog --- security/acme-client/pkg-descr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 0be03d6644..1df43367a0 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -10,6 +10,9 @@ Plugin Changelog 2.5 +Added: +* add native support for Vultr DNS API (#2344) + Fixed: * ensure that the auto renewal cron job is properly disabled (#2178) From 0334ceae5685cb259c9f04923a08f1d46ba5f94f Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 14 May 2021 17:26:16 +0200 Subject: [PATCH 0582/3088] net/relayd: Usability improvements (#2373) net/relayd: Usability improvements https://github.com/opnsense/plugins/issues/2232 o support enable/disable flag on backend hosts, while here perform some minor cleanups as well (use our standard classes and some style fixes) for https://github.com/opnsense/plugins/issues/2232 o lock delete action to prevent "delete selected" from ignoring most entries. (eventually it might be better to stick to ApiMutableModelControllerBase actions to simplify logiuc, but since there's all some logic incorporated in these endpoints now, let's keep it as is now and only add a lock.) o ignore backup without check in relayd.conf (prevent crash with "Template Error" when a backup without a template is provided) o extend status controller with "wait" flag to give relayd some time for collecting status (retry mechanism) o refactor status.volt use jQuery components to construct items and make sure each row contains all relevant data o extend status controller output with attached configuration data and add listen_address and port(s) for virtualservers o extend model with an easy to use "get by name" method (getObjectsByAttribute) o change api response for host properties, since we can't uniquely tell which host item belongs to the output of `relayctl show summary`, we search the ones that are most likely to match o extend status controller toggle action so it can enable/disable hosts on "add" and "remove" actions, $id's are (a list of) uuid's in that case o extend status controller to return "unconfigured" when disabled in the configuration, so we can distinct between temporary disabled (running config) and offline o status page: switch icons to fonts-awesome (standard theme) in status view o status page: add filter option in status view o status page: add bind address and port in virtual server field o status page: add host name(s) if it differs from the address, so we can search on user configurable names as well o status page: add transitions, down -> stopped, disabled -> enabled (+ service reconfigure) o status page: always show host disable button o status page: restructure translation texts o status page: add toggle to hide table column, provides some additional overview when only single tables are used in a virtual server o status page: support local presets using localStorage object, quickly traverse through different filters previously saved on the local client. sponsored by : Modirum (https://www.modirum.com/) --- net/relayd/Makefile | 4 +- .../OPNsense/Relayd/Api/ServiceController.php | 7 +- .../Relayd/Api/SettingsController.php | 86 +-- .../OPNsense/Relayd/Api/StatusController.php | 177 ++++-- .../OPNsense/Relayd/forms/host.xml | 6 + .../mvc/app/models/OPNsense/Relayd/Relayd.php | 17 + .../mvc/app/models/OPNsense/Relayd/Relayd.xml | 24 +- .../mvc/app/views/OPNsense/Relayd/index.volt | 14 +- .../mvc/app/views/OPNsense/Relayd/status.volt | 547 ++++++++++++++---- .../templates/OPNsense/Relayd/relayd.conf | 218 +++---- 10 files changed, 804 insertions(+), 296 deletions(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index d16c606a3e..c94f25e2a0 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= relayd -PLUGIN_VERSION= 2.5 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 2.6 +#PLUGIN_REVISION= 2 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/ServiceController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/ServiceController.php index d255473d48..83eda01320 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/ServiceController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/ServiceController.php @@ -2,6 +2,7 @@ /* * Copyright (C) 2018 EURO-LOG AG + * Copyright (c) 2021 Deciso B.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -98,10 +99,9 @@ public function reconfigureAction() $this->sessionClose(); $result['function'] = "reconfigure"; $result['status'] = 'failed'; - $mdlRelayd = new Relayd(); $backend = new Backend(); $status = $this->statusAction(); - if ($mdlRelayd->general->enabled->__toString() == 1) { + if (!empty((string)$this->getModel()->general->enabled)) { $result = $this->configtestAction(); if ($result['template'] == 'OK' && preg_match('/configuration OK$/', $result['result']) == 1) { if ($status['status'] != 'running') { @@ -118,8 +118,7 @@ public function reconfigureAction() } } $this->lock(1); - $mdlRelayd = new Relayd(); - if ($mdlRelayd->configClean()) { + if ($this->getModel()->configClean()) { $result['status'] = 'ok'; } return $result; diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php index 67b0ff0091..0f71cf62c6 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php @@ -2,7 +2,7 @@ /** * Copyright (C) 2018 EURO-LOG AG - * + * Copyright (c) 2021 Deciso B.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,7 +30,7 @@ namespace OPNsense\Relayd\Api; -use OPNsense\Base\ApiControllerBase; +use OPNsense\Base\ApiMutableModelControllerBase; use OPNsense\Core\Config; use OPNsense\Relayd\Relayd; use OPNsense\Base\UIModelGrid; @@ -39,25 +39,17 @@ * Class SettingsController * @package OPNsense\Relayd */ -class SettingsController extends ApiControllerBase +class SettingsController extends ApiMutableModelControllerBase { protected static $internalModelName = 'relayd'; protected static $internalModelClass = '\OPNsense\Relayd\Relayd'; - public $mdlRelayd = null; /** * list with valid model node types */ private $nodeTypes = array('general', 'host', 'tablecheck', 'table', 'protocol', 'virtualserver'); - /** - * initialize object properties - */ - public function onConstruct() - { - $this->mdlRelayd = new Relayd(); - } /** * check if changes to the relayd settings were made @@ -66,7 +58,7 @@ public function onConstruct() public function dirtyAction() { $result = array('status' => 'ok'); - $result['relayd']['dirty'] = $this->mdlRelayd->configChanged(); + $result['relayd']['dirty'] = $this->getModel()->configChanged(); return $result; } @@ -82,12 +74,12 @@ public function getAction($nodeType = null, $uuid = null) if ($this->request->isGet() && $nodeType != null) { $this->validateNodeType($nodeType); if ($nodeType == 'general') { - $node = $this->mdlRelayd->getNodeByReference($nodeType); + $node = $this->getModel()->getNodeByReference($nodeType); } else { if ($uuid != null) { - $node = $this->mdlRelayd->getNodeByReference($nodeType . '.' . $uuid); + $node = $this->getModel()->getNodeByReference($nodeType . '.' . $uuid); } else { - $node = $this->mdlRelayd->$nodeType->Add(); + $node = $this->getModel()->$nodeType->Add(); } } if ($node != null) { @@ -111,12 +103,12 @@ public function setAction($nodeType = null, $uuid = null) if ($this->request->isPost() && $this->request->hasPost('relayd') && $nodeType != null) { $this->validateNodeType($nodeType); if ($nodeType == 'general') { - $node = $this->mdlRelayd->getNodeByReference($nodeType); + $node = $this->getModel()->getNodeByReference($nodeType); } else { if ($uuid != null) { - $node = $this->mdlRelayd->getNodeByReference($nodeType . '.' . $uuid); + $node = $this->getModel()->getNodeByReference($nodeType . '.' . $uuid); } else { - $node = $this->mdlRelayd->$nodeType->Add(); + $node = $this->getModel()->$nodeType->Add(); } } if ($node != null) { @@ -207,16 +199,16 @@ public function setAction($nodeType = null, $uuid = null) } $node->setNodes($relaydInfo[$nodeType]); - $valMsgs = $this->mdlRelayd->performValidation(); + $valMsgs = $this->getModel()->performValidation(); foreach ($valMsgs as $field => $msg) { $fieldnm = str_replace($node->__reference, "relayd." . $nodeType, $msg->getField()); $result["validations"][$fieldnm] = $msg->getMessage(); } if (empty($result["validations"])) { unset($result["validations"]); - $this->mdlRelayd->serializeToConfig(); + $this->getModel()->serializeToConfig(); $cfgRelayd = Config::getInstance()->save(); - if ($this->mdlRelayd->configDirty()) { + if ($this->getModel()->configDirty()) { $result['status'] = 'ok'; } } @@ -234,13 +226,14 @@ public function setAction($nodeType = null, $uuid = null) public function delAction($nodeType = null, $uuid = null) { $result = array("result" => "failed"); + Config::getInstance()->lock(); if ($nodeType != null) { $this->validateNodeType($nodeType); if ($uuid != null) { - $node = $this->mdlRelayd->getNodeByReference($nodeType . '.' . $uuid); + $node = $this->getModel()->getNodeByReference($nodeType . '.' . $uuid); if ($node != null) { - $nodeName = $this->mdlRelayd->getNodeByReference($nodeType . '.' . $uuid . '.name')->__toString(); - if ($this->mdlRelayd->$nodeType->del($uuid) == true) { + $nodeName = $this->getModel()->getNodeByReference($nodeType . '.' . $uuid . '.name')->__toString(); + if ($this->getModel()->$nodeType->del($uuid) == true) { // delete relations switch ($nodeType) { case 'host': @@ -250,7 +243,7 @@ public function delAction($nodeType = null, $uuid = null) $uuid, 'host', $nodeName, - $this->mdlRelayd + $this->getModel() ); break; case 'tablecheck': @@ -260,7 +253,7 @@ public function delAction($nodeType = null, $uuid = null) $uuid, 'tablecheck', $nodeName, - $this->mdlRelayd + $this->getModel() ); $this->deleteRelations( 'virtualserver', @@ -268,7 +261,7 @@ public function delAction($nodeType = null, $uuid = null) $uuid, 'tablecheck', $nodeName, - $this->mdlRelayd + $this->getModel() ); break; case 'table': @@ -278,7 +271,7 @@ public function delAction($nodeType = null, $uuid = null) $uuid, 'table', $nodeName, - $this->mdlRelayd + $this->getModel() ); $this->deleteRelations( 'virtualserver', @@ -286,7 +279,7 @@ public function delAction($nodeType = null, $uuid = null) $uuid, 'table', $nodeName, - $this->mdlRelayd + $this->getModel() ); break; case 'protocol': @@ -296,13 +289,13 @@ public function delAction($nodeType = null, $uuid = null) $uuid, 'protocol', $nodeName, - $this->mdlRelayd + $this->getModel() ); break; } - $this->mdlRelayd->serializeToConfig(); + $this->getModel()->serializeToConfig(); Config::getInstance()->save(); - if ($this->mdlRelayd->configDirty()) { + if ($this->getModel()->configDirty()) { $result['status'] = 'ok'; } } @@ -312,6 +305,21 @@ public function delAction($nodeType = null, $uuid = null) return $result; } + /** + * toggle status + * @param string $nodeType node type to address + * @param string $uuid id to toggled + * @param string|null $enabled set enabled by default + * @return array status + * @throws \Phalcon\Validation\Exception when field validations fail + * @throws \ReflectionException when not bound to model + */ + public function toggleAction($nodeType, $uuid, $enabled = null) + { + $this->getModel()->configDirty(); + return $this->toggleBase($nodeType, $uuid, $enabled); + } + /** * search relayd settings * @param $nodeType @@ -322,11 +330,11 @@ public function searchAction($nodeType = null) $this->sessionClose(); if ($this->request->isPost() && $nodeType != null) { $this->validateNodeType($nodeType); - $grid = new UIModelGrid($this->mdlRelayd->$nodeType); + $grid = new UIModelGrid($this->getModel()->$nodeType); $fields = array(); switch ($nodeType) { case 'host': - $fields = array('name', 'address'); + $fields = array('enabled', 'name', 'address'); break; case 'tablecheck': $fields = array('name', 'type'); @@ -342,7 +350,7 @@ public function searchAction($nodeType = null) break; } $result = $grid->fetchBindRequest($this->request, $fields); - $result['dirty'] = $this->mdlRelayd->configChanged(); + $result['dirty'] = $this->getModel()->configChanged(); return $result; } } @@ -374,7 +382,7 @@ private function deleteRelations( $relNodeType = null, $relNodeName = null ) { - $nodes = $this->mdlRelayd->$nodeType->getNodes(); + $nodes = $this->getModel()->$nodeType->getNodes(); // get nodes with relations foreach ($nodes as $nodeUuid => $node) { // get relation uuids @@ -382,14 +390,14 @@ private function deleteRelations( // remove uuid from field if ($fieldUuid == $relUuid) { $refField = $nodeType . '.' . $nodeUuid . '.' . $nodeField; - $relNode = $this->mdlRelayd->getNodeByReference($refField); + $relNode = $this->getModel()->getNodeByReference($refField); $nodeRels = str_replace($relUuid, '', $relNode->__toString()); $nodeRels = str_replace(',,', ',', $nodeRels); $nodeRels = rtrim($nodeRels, ','); $nodeRels = ltrim($nodeRels, ','); - $this->mdlRelayd->setNodeByReference($refField, $nodeRels); + $this->getModel()->setNodeByReference($refField, $nodeRels); if ($relNode->isEmptyAndRequired()) { - $nodeName = $this->mdlRelayd->getNodeByReference("{$nodeType}.{$nodeUuid}.name")->__toString(); + $nodeName = $this->getModel()->getNodeByReference("{$nodeType}.{$nodeUuid}.name")->__toString(); throw new \Exception("Cannot delete $relNodeType '$relNodeName' from $nodeType '$nodeName'"); } } diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php index deb9a75e6a..dfd721fcb3 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php @@ -2,6 +2,7 @@ /** * Copyright (C) 2018 EURO-LOG AG + * Copyright (c) 2021 Deciso B.V. * * All rights reserved. * @@ -32,6 +33,7 @@ use OPNsense\Base\ApiControllerBase; use OPNsense\Core\Backend; +use OPNsense\Core\Config; use OPNsense\Relayd\Relayd; /** @@ -43,15 +45,32 @@ class StatusController extends ApiControllerBase /** * get relayd summary */ - public function sumAction() + public function sumAction($wait=0) { $result = array("result" => "failed"); $backend = new Backend(); + $relaydMdl = new Relayd(); + + // when $wait is set, try for max 10 seconds to receive a sensible status (wait for unknowns to resolve) + $max_tries = !empty($wait) ? 10 : 1; $output = array(); - $output = explode("\n", trim($backend->configdRun('relayd summary'))); + for ($i = 0; $i < $max_tries; $i++) { + $output = explode("\n", trim($backend->configdRun('relayd summary'))); + $unknowns = 0; + foreach ($output as $line) { + if (substr($line, -strlen("unknown")) == "unknown") { + $unknowns++; + } + } + if (!empty($output[0]) && $unknowns == 0) { + break; + } + sleep(1); + } if (empty($output[0])) { return $result; } + $output[] = "0\t****\t"; // end of data marker $result["result"] = 'ok'; $virtualServerId = 0; $virtualServerType = ''; @@ -59,40 +78,119 @@ public function sumAction() $virtualserver = array(); $rows = array(); foreach ($output as $line) { - $words = explode("\t", $line); - $id = trim($words[0]); - $type = trim($words[1]); - if ($type == 'redirect' || $type == 'relay') { + $words = array_map('trim', explode("\t", $line)); + $id = $words[0]; + $type = $words[1]; + if ($type == 'redirect' || $type == 'relay' || $type == '****') { // new virtual server id/type means new record if ( - ($id != $virtualServerId - && $virtualServerId > 0) - || ($type != $virtualServerType - && strlen($virtualServerType) > 5) + ($id != $virtualServerId && $virtualServerId > 0) || + ($type != $virtualServerType && strlen($virtualServerType) > 5) || + ($type == '****' && !empty($virtualserver)) ) { + // append backend hosts not found in the list, since relayd only supports disabled tables + // you might loose track of hosts that are disabled + if (!empty($virtualserver['tables'])) { + foreach ($virtualserver['tables'] as &$table) { + if (!empty($table['uuid'])) { + $tblnode = $relaydMdl->getNodeByReference("table.".$table['uuid']); + foreach (explode(",", (string)$tblnode->hosts) as $host_uuid) { + $found = false; + if (!empty($table['hosts'])) { + foreach ($table['hosts'] as $tblhost) { + foreach ($tblhost['properties'] as $hprops) { + if ($hprops['uuid'] == $host_uuid) { + $found = true; + } + } + } + } else { + $table['hosts'] = []; + } + if (!$found) { + $hostnode = $relaydMdl->getNodeByReference("host.".$host_uuid); + $table['hosts'][$host_uuid] = [ + "name" => (string)$hostnode->address, + "description" => (string)$hostnode->name, + "avlblty" => null, + "status" => empty((string)$hostnode->enabled) ? "disabled" : "-", + "properties" => [ + [ + "uuid" => $host_uuid, + "name" => (string)$hostnode->name, + "enabled" => (string)$hostnode->enabled + ] + ] + ]; + } + } + } + } + } $rows[] = $virtualserver; - $virtualserver = array(); + if ($type == '****') { + break; // end + } + $virtualserver = []; } $virtualServerId = $id; $virtualServerType = $type; $virtualserver['id'] = $id; $virtualserver['type'] = $type; - $virtualserver['name'] = trim($words[2]); - $virtualserver['status'] = trim($words[4]); - } - if ($type == 'table') { + $virtualserver['name'] = $words[2]; + $virtualserver['status'] = $words[4]; + $objs = $relaydMdl->getObjectsByAttribute("virtualserver", "name", $virtualserver['name']); + if (count($objs) > 0) { + $obj = $objs[0]; + $virtualserver['uuid'] = $obj->getAttribute('uuid'); + $virtualserver['listen_address'] = (string)$obj->listen_address; + $virtualserver['listen_startport'] = (string)$obj->listen_startport; + $virtualserver['listen_endport'] = (string)$obj->listen_endport; + } + } elseif ($type == 'table') { $tableId = $id; - $virtualserver['tables'][$tableId]['name'] = trim($words[2]); - $virtualserver['tables'][$tableId]['status'] = trim($words[4]); - } - if ($type == 'host') { + if (empty($virtualserver['tables'])) { + $virtualserver['tables'] = []; + } + $virtualserver['tables'][$tableId] = []; + $virtualserver['tables'][$tableId]['name'] = $words[2]; + $virtualserver['tables'][$tableId]['status'] = $words[4]; + $objs = $relaydMdl->getObjectsByAttribute("table", "name", explode(":", $words[2])[0]); + if (count($objs) > 0) { + $virtualserver['tables'][$tableId]['uuid'] = $objs[0]->getAttribute('uuid'); + } + } elseif ($type == 'host') { $hostId = trim($words[0]); - $virtualserver['tables'][$tableId]['hosts'][$hostId]['name'] = trim($words[2]); - $virtualserver['tables'][$tableId]['hosts'][$hostId]['avlblty'] = trim($words[3]); - $virtualserver['tables'][$tableId]['hosts'][$hostId]['status'] = trim($words[4]); + if (empty($virtualserver['tables'][$tableId]['hosts'])) { + $virtualserver['tables'][$tableId]['hosts'] = []; + } + $virtualserver['tables'][$tableId]['hosts'][$hostId] = ['properties' => []]; + $virtualserver['tables'][$tableId]['hosts'][$hostId]['name'] = $words[2]; + $virtualserver['tables'][$tableId]['hosts'][$hostId]['avlblty'] = $words[3]; + $status = $words[4] == 'disabled' ? 'stopped' : $words[4]; + $virtualserver['tables'][$tableId]['hosts'][$hostId]['status'] = $status; + // XXX: `relayctl show summary` name is actually the number, append name as description when found + $objs = $relaydMdl->getObjectsByAttribute("host", "address", $words[2]); + if (count($objs) > 0) { + $linked_hosts = []; + if (!empty($virtualserver['tables'][$tableId]['uuid'])) { + $tblnode = $relaydMdl->getNodeByReference("table.".$virtualserver['tables'][$tableId]['uuid']); + $linked_hosts = explode(",", (string)$tblnode->hosts); + } + // hosts aren't necessarily unique due to address matching + foreach ($objs as $obj) { + $this_uuid = $obj->getAttribute('uuid'); + if (empty($linked_hosts) || in_array($this_uuid, $linked_hosts)) { + $virtualserver['tables'][$tableId]['hosts'][$hostId]['properties'][] = [ + 'uuid' => $this_uuid, + 'name' => (string)$obj->name, + "enabled" => (string)$obj->enabled + ]; + } + } + } } } - $rows[] = $virtualserver; $result["rows"] = $rows; return $result; } @@ -102,29 +200,32 @@ public function sumAction() */ public function toggleAction($nodeType = null, $id = null, $action = null) { + $result = array("result" => "failed", "function" => "toggle"); if ($this->request->isPost()) { $this->sessionClose(); - } - $result = array("result" => "failed", "function" => "toggle"); - if ( - $nodeType != null && - ($nodeType == 'redirect' || - $nodeType == 'table' || - $nodeType == 'host') - ) { - if ( - $action != null && - ($action == 'enable' || - $action == 'disable') - ) { + $backend = new Backend(); + if (in_array($nodeType, ['redirect', 'table', 'host']) && in_array($action, ['enable', 'disable'])){ if ($id != null && $id > 0) { - $backend = new Backend(); - $result["output"] = $backend->configdRun("relayd toggle $nodeType $action $id"); + $result["output"] = $backend->configdpRun("relayd toggle",[$nodeType, $action, $id]); if (isset($result["output"])) { $result["result"] = 'ok'; } $result["output"] = trim($result["output"]); } + } elseif ($nodeType == 'host' && in_array($action, ['remove', 'add'])) { + Config::getInstance()->lock(); + $new_status = $action == "remove" ? "0" : "1"; + $relaydMdl = new Relayd(); + foreach (explode(",", $id) as $host_uuid) { + $obj = $relaydMdl->getNodeByReference("host.".$host_uuid); + if ($obj != null) { + $obj->enabled = $new_status; + } + } + $relaydMdl->serializeToConfig(); + Config::getInstance()->save(); + // invoke service controller + return (new ServiceController())->reconfigureAction(); } } return $result; diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/forms/host.xml b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/forms/host.xml index 1c6967ae03..09dcea4fac 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/forms/host.xml +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/forms/host.xml @@ -1,4 +1,10 @@
    + + relayd.host.enabled + + checkbox + Set this option to enable this destination. + relayd.host.name diff --git a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.php b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.php index e80a832e0c..0669849ed4 100644 --- a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.php +++ b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.php @@ -64,4 +64,21 @@ public function configClean() { return @unlink("/tmp/relayd.dirty"); } + + /** + * @param string $type type of object (host, table, virtualserver) + * @param string $name name of the attribute + * @param string $value value to match + * @return ArrayField[] items found + */ + public function getObjectsByAttribute($type, $name, $value) + { + $results = []; + foreach ($this->$type->iterateItems() as $item) { + if ((string)$item->$name == $value) { + $results[] = $item; + } + } + return $results; + } } diff --git a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml index a67061d672..60852198b0 100644 --- a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml +++ b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml @@ -1,6 +1,6 @@ //OPNsense/relayd - 1.0.2 + 1.0.3 Relayd settings @@ -35,10 +35,20 @@ + + 1 + Y + Y /^([0-9a-zA-Z\._\- ]){1,255}$/u Should be a string between 1 and 255 characters. Allowed characters are letters and numbers as well as underscore, minus, dot and space. + + + Host names should be unique. + UniqueConstraint + +
    Y @@ -67,6 +77,12 @@ Y /^([0-9a-zA-Z\._\- ]){1,255}$/u Should be a string between 1 and 255 characters. Allowed characters are letters and numbers as well as underscore, minus, dot and space. + + + Table names should be unique. + UniqueConstraint + + 0 @@ -134,6 +150,12 @@ Y /^([0-9a-zA-Z\._\- ]){1,255}$/u Should be a string between 1 and 255 characters. Allowed characters are letters and numbers as well as underscore, minus, dot and space. + + + Virtual server names should be unique. + UniqueConstraint + + 0 diff --git a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt index 0544e23d15..0b1ea7e48f 100644 --- a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt +++ b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt @@ -1,6 +1,7 @@ {# Copyright © 2018 by EURO-LOG AG +Copyright (c) 2021 Deciso B.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -95,13 +96,17 @@ POSSIBILITY OF SUCH DAMAGE. }); ['host', 'tablecheck', 'table', 'protocol', 'virtualserver'].forEach(function(element) { - $("#grid-" + element).UIBootgrid({ + let endpoints = { 'search': '/api/relayd/settings/search/' + element + '/', 'get': '/api/relayd/settings/get/' + element + '/', 'set': '/api/relayd/settings/set/' + element + '/', 'add': '/api/relayd/settings/set/' + element + '/', 'del': '/api/relayd/settings/del/' + element + '/' - }); + }; + if (['virtualserver', 'host', 'table'].includes(element)) { + endpoints['toggle'] = '/api/relayd/settings/toggle/' + element + '/'; + } + $("#grid-" + element).UIBootgrid(endpoints); }); // show/hide options depending on other options @@ -239,6 +244,7 @@ POSSIBILITY OF SUCH DAMAGE. + @@ -285,7 +291,7 @@ POSSIBILITY OF SUCH DAMAGE.
    {{ lang._('Enabled') }} {{ lang._('Name') }} {{ lang._('Address') }} {{ lang._('ID') }}
    - + @@ -331,7 +337,7 @@ POSSIBILITY OF SUCH DAMAGE.
    {{ lang._('Enabled') }}{{ lang._('Enabled') }} {{ lang._('Name') }} {{ lang._('ID') }} {{ lang._('Edit') }} | {{ lang._('Delete') }}
    - + diff --git a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/status.volt b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/status.volt index 0bcee42f73..c3a15c73b1 100644 --- a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/status.volt +++ b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/status.volt @@ -1,6 +1,7 @@ {# Copyright © 2018 by EURO-LOG AG +Copyright (c) 2021 Deciso B.V. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -27,128 +28,462 @@ POSSIBILITY OF SUCH DAMAGE. #} -
    -
    {{ lang._('Enabled') }}{{ lang._('Enabled') }} {{ lang._('Name') }} {{ lang._('Type') }} {{ lang._('ID') }}
    - - -
    {{ lang._('Virtual Server') }}{{ lang._('Table') }}{{ lang._('Host') }}
    -
    -
    - - - - -
    -
    - -
    -
    + + + + + +
    +
    + + {{ lang._('Presets') }} +
    +
    + +
    + + + +
    + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Virtual Server') }}{{ lang._('Table') }}{{ lang._('Host') }}
    +
    + +
    +
    +
    diff --git a/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf b/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf index f8b6b9bbcd..5f99db8955 100644 --- a/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf +++ b/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf @@ -1,6 +1,7 @@ # DO NOT EDIT THIS FILE -- OPNsense auto-generated file {% from 'OPNsense/Macros/interface.macro' import physical_interface %} +{% set all_active_tables = [] %} {% if helpers.exists('OPNsense.relayd.general') %} {% if helpers.exists('OPNsense.relayd.general.interval') %} interval {{ OPNsense.relayd.general.interval }} @@ -18,21 +19,30 @@ timeout {{ OPNsense.relayd.general.timeout }} {% if helpers.exists('OPNsense.relayd.table') %} {% for table in helpers.toList('OPNsense.relayd.table') %} -{% set name = table.name %} {% set disable = '' %} -{% set hosts = '' %} +{% set hosts = [] %} {% if table.enabled|default('1') == '0' %} {% set disable = ' disable' %} {% endif %} -table <{{ name }}>{{ disable }} { -{% for host in table.hosts.split(",") %} -{% set host = helpers.getUUID(host) %} -{% set ipTTL = " ip ttl " ~ host.ipTTL if host.ipTTL is defined %} -{% set priority = " priority " ~ host.priority if host.priority is defined %} -{% set retry = " retry " ~ host.retry if host.retry is defined %} +{% for hostid in table.hosts.split(",") %} +{% set host = helpers.getUUID(hostid) %} +{% if host.enabled|default("1") == "1" %} +{% do hosts.append(host) %} +{% endif %} +{% endfor %} +{% if hosts|length > 0 %} +table <{{ table.name }}>{{ disable }} { +{% do all_active_tables.append(table['@uuid']) %} +{% for host in hosts %} +{% set ipTTL = " ip ttl " ~ host.ipTTL if host.ipTTL is defined %} +{% set priority = " priority " ~ host.priority if host.priority is defined %} +{% set retry = " retry " ~ host.retry if host.retry is defined %} +{% if host.enabled|default("1") == "1" %} {{ host.address }}{{ ipTTL }}{{ priority }}{{ retry }} -{% endfor %} +{% endif %} +{% endfor %} } +{% endif %} {% endfor %} {% endif %} @@ -45,106 +55,110 @@ table <{{ name }}>{{ disable }} { {% endif %} {% if helpers.exists('OPNsense.relayd.virtualserver') %} -{% for virtualserver in helpers.toList('OPNsense.relayd.virtualserver') %} +{% for virtualserver in helpers.toList('OPNsense.relayd.virtualserver') %} +{% if virtualserver.transport_table in all_active_tables or virtualserver.backuptransport_table in all_active_tables %} {{ virtualserver.type }} "{{virtualserver.name}}" { -{% if virtualserver.enabled|default('1') == '0' %} +{% if virtualserver.enabled|default('1') == '0' %} disable -{% endif %} -{% set listen = "listen on " ~ virtualserver.listen_address %} -{% if virtualserver.listen_startport is defined %} -{% set listen = listen ~ " port " ~ virtualserver.listen_startport %} -{% if virtualserver.listen_endport is defined and virtualserver.type == 'redirect'%} -{% set listen = listen ~ ":" ~ virtualserver.listen_endport %} -{% endif %} -{% endif %} -{% if virtualserver.listen_interface is defined and virtualserver.type == 'redirect' %} -{% set listen = listen ~ " interface " ~ physical_interface(virtualserver.listen_interface) %} -{% endif %} +{% endif %} +{% set listen = "listen on " ~ virtualserver.listen_address %} +{% if virtualserver.listen_startport is defined %} +{% set listen = listen ~ " port " ~ virtualserver.listen_startport %} +{% if virtualserver.listen_endport is defined and virtualserver.type == 'redirect'%} +{% set listen = listen ~ ":" ~ virtualserver.listen_endport %} +{% endif %} +{% endif %} +{% if virtualserver.listen_interface is defined and virtualserver.type == 'redirect' %} +{% set listen = listen ~ " interface " ~ physical_interface(virtualserver.listen_interface) %} +{% endif %} {{ listen }} -{% set transport_type = 'forward' %} -{% if virtualserver.type == 'redirect' %} -{% set transport_type = virtualserver.transport_type %} -{% if virtualserver.transport_type == 'route' %} -{% set routing_interface = " interface " ~ virtualserver.routing_interface %} -{% endif %} -{% endif %} -{% set table = helpers.getUUID(virtualserver.transport_table) %} -{% set tablecheck = helpers.getUUID(virtualserver.transport_tablecheck) %} -{% set _tablecheck = '' %} -{% if tablecheck.type == 'http' and tablecheck.path is defined %} -{% set _tablecheck = 'check ' ~ tablecheck.type %} -{% if tablecheck.ssl|default('0') == '1' %} -{% set _tablecheck = _tablecheck ~ 's' %} -{% endif %} -{% set _tablecheck = _tablecheck ~ ' "' ~ tablecheck.path ~ '"' %} -{% if tablecheck.host is defined %} -{% set _tablecheck = _tablecheck ~ ' host ' ~ tablecheck.host %} -{% endif %} -{% if tablecheck.code is defined %} -{% set _tablecheck = _tablecheck ~ ' code ' ~ tablecheck.code %} -{% elif tablecheck.digest is defined %} -{% set _tablecheck = _tablecheck ~ ' digest "' ~ tablecheck.digest ~ '"' %} -{% else %} -{% set _tablecheck = '' %} -{% endif %} -{% elif tablecheck.type == 'script' and tablecheck.path is defined %} -{% set _tablecheck = 'check ' ~ tablecheck.type ~ ' "' ~ tablecheck.path ~ '"' %} -{% elif tablecheck.type == 'send' and tablecheck.expect is defined %} -{% set _tablecheck = 'check ' ~ tablecheck.type ~ ' "' ~ tablecheck.data ~ '" expect "' ~ tablecheck.expect ~ '"' %} -{% if tablecheck.ssl|default('0') == '1' %} -{% set _tablecheck = _tablecheck ~ ' ssl' %} -{% endif %} -{% else %} -{% set _tablecheck = 'check ' ~ tablecheck.type %} -{% endif %} -{% set port = " port " ~ virtualserver.transport_port if virtualserver.transport_port is defined %} -{% set timeout = " timeout " ~ virtualserver.transport_timeout if virtualserver.transport_timeout is defined %} -{% set interval = " interval " ~ virtualserver.transport_interval if virtualserver.transport_interval is defined %} +{% set transport_type = 'forward' %} +{% if virtualserver.type == 'redirect' %} +{% set transport_type = virtualserver.transport_type %} +{% if virtualserver.transport_type == 'route' %} +{% set routing_interface = " interface " ~ virtualserver.routing_interface %} +{% endif %} +{% endif %} +{% if virtualserver.transport_table in all_active_tables %} +{% set table = helpers.getUUID(virtualserver.transport_table) %} +{% set tablecheck = helpers.getUUID(virtualserver.transport_tablecheck) %} +{% set _tablecheck = '' %} +{% if tablecheck.type == 'http' and tablecheck.path is defined %} +{% set _tablecheck = 'check ' ~ tablecheck.type %} +{% if tablecheck.ssl|default('0') == '1' %} +{% set _tablecheck = _tablecheck ~ 's' %} +{% endif %} +{% set _tablecheck = _tablecheck ~ ' "' ~ tablecheck.path ~ '"' %} +{% if tablecheck.host is defined %} +{% set _tablecheck = _tablecheck ~ ' host ' ~ tablecheck.host %} +{% endif %} +{% if tablecheck.code is defined %} +{% set _tablecheck = _tablecheck ~ ' code ' ~ tablecheck.code %} +{% elif tablecheck.digest is defined %} +{% set _tablecheck = _tablecheck ~ ' digest "' ~ tablecheck.digest ~ '"' %} +{% else %} +{% set _tablecheck = '' %} +{% endif %} +{% elif tablecheck.type == 'script' and tablecheck.path is defined %} +{% set _tablecheck = 'check ' ~ tablecheck.type ~ ' "' ~ tablecheck.path ~ '"' %} +{% elif tablecheck.type == 'send' and tablecheck.expect is defined %} +{% set _tablecheck = 'check ' ~ tablecheck.type ~ ' "' ~ tablecheck.data ~ '" expect "' ~ tablecheck.expect ~ '"' %} +{% if tablecheck.ssl|default('0') == '1' %} +{% set _tablecheck = _tablecheck ~ ' ssl' %} +{% endif %} +{% else %} +{% set _tablecheck = 'check ' ~ tablecheck.type %} +{% endif %} +{% set port = " port " ~ virtualserver.transport_port if virtualserver.transport_port is defined %} +{% set timeout = " timeout " ~ virtualserver.transport_timeout if virtualserver.transport_timeout is defined %} +{% set interval = " interval " ~ virtualserver.transport_interval if virtualserver.transport_interval is defined %} {{ transport_type }} to <{{ table.name }}>{{ port }} mode {{ virtualserver.transport_tablemode }}{{ timeout }} {{ interval }} {{ _tablecheck }} {{ routing_interface }} -{% if virtualserver.backuptransport_table is defined and virtualserver.transport_type == 'forward' %} -{% set backuptable = helpers.getUUID(virtualserver.backuptransport_table) %} -{% set backuptablecheck = helpers.getUUID(virtualserver.backuptransport_tablecheck) if virtualserver.backuptransport_tablecheck is defined %} -{% set _backuptablecheck = '' %} -{% if backuptablecheck.type == 'http' and backuptablecheck.path is defined%} -{% set _backuptablecheck = 'check ' ~ backuptablecheck.type %} -{% if backuptablecheck.ssl|default('0') == '1' %} -{% set _backuptablecheck = _backuptablecheck ~ 's' %} -{% endif %} -{% set _backuptablecheck = _backuptablecheck ~ ' "' ~ backuptablecheck.path ~ '"' %} -{% if backuptablecheck.host is defined %} -{% set _backuptablecheck = _backuptablecheck ~ ' host ' ~ backuptablecheck.host %} -{% endif %} -{% if backuptablecheck.code is defined %} -{% set _backuptablecheck = _backuptablecheck ~ ' code ' ~ backuptablecheck.code %} -{% elif backuptablecheck.digest is defined %} -{% set _backuptablecheck = _backuptablecheck ~ ' digest "' ~ backuptablecheck.digest ~ '"' %} -{% else %} -{% set _backuptablecheck = '' %} -{% endif %} -{% elif backuptablecheck.type == 'script' and backuptablecheck.path is defined %} -{% set _backuptablecheck = 'check ' ~ backuptablecheck.type ~ ' "' ~ backuptablecheck.path ~ '"' %} -{% elif backuptablecheck.type == 'send' and backuptablecheck.expect is defined %} -{% set _backuptablecheck = 'check ' ~ backuptablecheck.type ~ ' "' ~ backuptablecheck.data ~ '" expect "' ~ backuptablecheck.expect ~ '"' %} -{% if backuptablecheck.ssl|default('0') == '1' %} -{% set _backuptablecheck = _backuptablecheck ~ ' ssl' %} -{% endif %} -{% else %} -{% set _backuptablecheck = 'check ' ~ backuptablecheck.type %} -{% endif %} -{% set backuptimeout = " timeout " ~ virtualserver.backuptransport_timeout if virtualserver.backuptransport_timeout is defined %} -{% set backupinterval = " interval " ~ virtualserver.backuptransport_interval if virtualserver.backuptransport_interval is defined %} +{% endif %} +{% set backuptablecheck = helpers.getUUID(virtualserver.backuptransport_tablecheck) if virtualserver.backuptransport_tablecheck is defined else None%} +{% if backuptablecheck and virtualserver.backuptransport_table is defined and virtualserver.backuptransport_table in all_active_tables and virtualserver.transport_type == 'forward' %} +{% set backuptable = helpers.getUUID(virtualserver.backuptransport_table) %} +{% set _backuptablecheck = '' %} +{% if backuptablecheck.type == 'http' and backuptablecheck.path is defined%} +{% set _backuptablecheck = 'check ' ~ backuptablecheck.type %} +{% if backuptablecheck.ssl|default('0') == '1' %} +{% set _backuptablecheck = _backuptablecheck ~ 's' %} +{% endif %} +{% set _backuptablecheck = _backuptablecheck ~ ' "' ~ backuptablecheck.path ~ '"' %} +{% if backuptablecheck.host is defined %} +{% set _backuptablecheck = _backuptablecheck ~ ' host ' ~ backuptablecheck.host %} +{% endif %} +{% if backuptablecheck.code is defined %} +{% set _backuptablecheck = _backuptablecheck ~ ' code ' ~ backuptablecheck.code %} +{% elif backuptablecheck.digest is defined %} +{% set _backuptablecheck = _backuptablecheck ~ ' digest "' ~ backuptablecheck.digest ~ '"' %} +{% else %} +{% set _backuptablecheck = '' %} +{% endif %} +{% elif backuptablecheck.type == 'script' and backuptablecheck.path is defined %} +{% set _backuptablecheck = 'check ' ~ backuptablecheck.type ~ ' "' ~ backuptablecheck.path ~ '"' %} +{% elif backuptablecheck.type == 'send' and backuptablecheck.expect is defined %} +{% set _backuptablecheck = 'check ' ~ backuptablecheck.type ~ ' "' ~ backuptablecheck.data ~ '" expect "' ~ backuptablecheck.expect ~ '"' %} +{% if backuptablecheck.ssl|default('0') == '1' %} +{% set _backuptablecheck = _backuptablecheck ~ ' ssl' %} +{% endif %} +{% else %} +{% set _backuptablecheck = 'check ' ~ backuptablecheck.type %} +{% endif %} +{% set backuptimeout = " timeout " ~ virtualserver.backuptransport_timeout if virtualserver.backuptransport_timeout is defined %} +{% set backupinterval = " interval " ~ virtualserver.backuptransport_interval if virtualserver.backuptransport_interval is defined %} {{ transport_type }} to <{{ backuptable.name }}>{{ port }} mode {{ virtualserver.transport_tablemode }}{{ backuptimeout }} {{ backupinterval }} {{ _backuptablecheck }} -{% endif %} -{% if virtualserver.sessiontimeout is defined %} +{% endif %} +{% if virtualserver.sessiontimeout is defined %} session timeout {{ virtualserver.sessiontimeout }} -{% endif %} -{% if virtualserver.stickyaddress|default('0') == '1' and virtualserver.type == 'redirect' %} +{% endif %} +{% if virtualserver.stickyaddress|default('0') == '1' and virtualserver.type == 'redirect' %} sticky-address -{% endif %} -{% if virtualserver.protocol is defined and virtualserver.type == 'relay' %} -{% set protocol = helpers.getUUID(virtualserver.protocol) %} +{% endif %} +{% if virtualserver.protocol is defined and virtualserver.type == 'relay' %} +{% set protocol = helpers.getUUID(virtualserver.protocol) %} protocol "{{ protocol.name }}" -{% endif %} +{% endif %} } -{% endfor %} +{% endif %} +{% endfor %} {% endif %} From b2a556f05718defea7dcece39eb7847083d15b38 Mon Sep 17 00:00:00 2001 From: jan-win1993 <47572976+jan-win1993@users.noreply.github.com> Date: Wed, 19 May 2021 12:32:51 +0200 Subject: [PATCH 0583/3088] Add puppet-agent plugin (#2358) --- sysutils/puppet-agent/Makefile | 8 ++ sysutils/puppet-agent/pkg-descr | 7 ++ .../src/etc/inc/plugins.inc.d/puppetagent.inc | 61 ++++++++++++ .../PuppetAgent/Api/ServiceController.php | 75 +++++++++++++++ .../PuppetAgent/Api/SettingsController.php | 93 +++++++++++++++++++ .../OPNsense/PuppetAgent/IndexController.php | 47 ++++++++++ .../OPNsense/PuppetAgent/forms/general.xml | 20 ++++ .../models/OPNsense/PuppetAgent/ACL/ACL.xml | 9 ++ .../models/OPNsense/PuppetAgent/Menu/Menu.xml | 5 + .../OPNsense/PuppetAgent/PuppetAgent.php | 38 ++++++++ .../OPNsense/PuppetAgent/PuppetAgent.xml | 24 +++++ .../app/views/OPNsense/PuppetAgent/index.volt | 62 +++++++++++++ .../conf/actions.d/actions_puppetagent.conf | 23 +++++ .../templates/OPNsense/PuppetAgent/+TARGETS | 2 + .../OPNsense/PuppetAgent/puppetagent.conf | 10 ++ .../templates/OPNsense/PuppetAgent/rc.conf.d | 5 + 16 files changed, 489 insertions(+) create mode 100644 sysutils/puppet-agent/Makefile create mode 100644 sysutils/puppet-agent/pkg-descr create mode 100644 sysutils/puppet-agent/src/etc/inc/plugins.inc.d/puppetagent.inc create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/Api/ServiceController.php create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/Api/SettingsController.php create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/IndexController.php create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/forms/general.xml create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/ACL/ACL.xml create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/Menu/Menu.xml create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.php create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.xml create mode 100644 sysutils/puppet-agent/src/opnsense/mvc/app/views/OPNsense/PuppetAgent/index.volt create mode 100644 sysutils/puppet-agent/src/opnsense/service/conf/actions.d/actions_puppetagent.conf create mode 100644 sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/+TARGETS create mode 100644 sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf create mode 100644 sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/rc.conf.d diff --git a/sysutils/puppet-agent/Makefile b/sysutils/puppet-agent/Makefile new file mode 100644 index 0000000000..af7209fe70 --- /dev/null +++ b/sysutils/puppet-agent/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= puppet-agent +PLUGIN_VERSION= 0.1 +PLUGIN_DEVEL= yes +PLUGIN_COMMENT= Manage Puppet Agent +PLUGIN_DEPENDS= puppet7 +PLUGIN_MAINTAINER= jan.wink93@gmail.com + +.include "../../Mk/plugins.mk" diff --git a/sysutils/puppet-agent/pkg-descr b/sysutils/puppet-agent/pkg-descr new file mode 100644 index 0000000000..ed77366165 --- /dev/null +++ b/sysutils/puppet-agent/pkg-descr @@ -0,0 +1,7 @@ +Puppet lets you centrally manage every important aspect of your system using +a cross-platform specification language that manages all the separate +elements normally aggregated in different files, like users, cron jobs, and +hosts, along with obviously discrete elements like packages, services, and +files. + +WWW: https://puppet.com/docs/puppet/latest/man/agent.html diff --git a/sysutils/puppet-agent/src/etc/inc/plugins.inc.d/puppetagent.inc b/sysutils/puppet-agent/src/etc/inc/plugins.inc.d/puppetagent.inc new file mode 100644 index 0000000000..bbeb217b07 --- /dev/null +++ b/sysutils/puppet-agent/src/etc/inc/plugins.inc.d/puppetagent.inc @@ -0,0 +1,61 @@ + gettext('Puppet Agent Service'), + 'pidfile' => '/var/run/puppet/agent.pid', + 'configd' => array( + 'restart' => array('puppetagent restart'), + 'start' => array('puppetagent start'), + 'stop' => array('puppetagent stop'), + ), + 'name' => 'puppet-agent', + ); + + return $services; +} diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/Api/ServiceController.php b/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/Api/ServiceController.php new file mode 100644 index 0000000000..58c60f552d --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/Api/ServiceController.php @@ -0,0 +1,75 @@ +request->isPost()) { + // close session for long running action + $this->sessionClose(); + + $backend = new Backend(); + // generate template + $backend->configdRun('template reload OPNsense/PuppetAgent'); + + $mdlPuppetAgent = new PuppetAgent(); + + // (res)start daemon + if ($mdlPuppetAgent->general->Enabled->__toString() == 1) { + $this->startAction(); + } + // stop Puppet Agent when disabled + else { + $this->stopAction(); + } + return array("status" => "ok"); + } + else { + return array("status" => "failed"); + } + } +} diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/Api/SettingsController.php b/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/Api/SettingsController.php new file mode 100644 index 0000000000..fcd5e88615 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/Api/SettingsController.php @@ -0,0 +1,93 @@ +request->isGet()) { + $mdlPuppetAgent = new PuppetAgent(); + $result['puppetagent'] = $mdlPuppetAgent->getNodes(); + } + return $result; + } + + /** + * update PupppetAgent settings + * @return array status + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function setAction() + { + $result = array("result" => "failed"); + if ($this->request->isPost()) { + // load model and update with provided data + $mdlPuppetAgent = new PuppetAgent(); + $mdlPuppetAgent->setNodes($this->request->getPost("puppetagent")); + + // perform validation + $valMsgs = $mdlPuppetAgent->performValidation(); + foreach ($valMsgs as $field => $msg) { + if (!array_key_exists("validations", $result)) { + $result["validations"] = array(); + } + $result["validations"]["puppetagent." . $msg->getField()] = $msg->getMessage(); + } + + // serialize model to config and save + if ($valMsgs->count() == 0) { + $mdlPuppetAgent->serializeToConfig(); + Config::getInstance()->save(); + $result["result"] = "saved"; + } + } + return $result; + } +} diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/IndexController.php b/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/IndexController.php new file mode 100644 index 0000000000..d5398024d0 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/IndexController.php @@ -0,0 +1,47 @@ +view->pick('OPNsense/PuppetAgent/index'); + // fetch form data "general" in + $this->view->generalForm = $this->getForm("general"); + } +} diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/forms/general.xml b/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/forms/general.xml new file mode 100644 index 0000000000..6713c5ec46 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/controllers/OPNsense/PuppetAgent/forms/general.xml @@ -0,0 +1,20 @@ +
    + + puppetagent.general.Enabled + + checkbox + Enable Puppet Agent + + + puppetagent.general.FQDN + + text + Change Puppet Server FQDN + + + puppetagent.general.Environment + + text + Change Puppet Agent Environment + +
    diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/ACL/ACL.xml b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/ACL/ACL.xml new file mode 100644 index 0000000000..b65ad7e656 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + Services: Puppet Agent + + ui/puppetagent/* + api/puppetagent/* + + + diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/Menu/Menu.xml b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/Menu/Menu.xml new file mode 100644 index 0000000000..e0c6f69d70 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/Menu/Menu.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.php b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.php new file mode 100644 index 0000000000..0dd518a3cd --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.php @@ -0,0 +1,38 @@ + + //OPNsense/puppetagent + + Manage Puppet Agent service + + + + + + + 0 + Y + + + Y + + + Y + /^.{1,100}$/u + Should be a string between 1 and 100 characters. + + + + diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/views/OPNsense/PuppetAgent/index.volt b/sysutils/puppet-agent/src/opnsense/mvc/app/views/OPNsense/PuppetAgent/index.volt new file mode 100644 index 0000000000..289cf4e88b --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/views/OPNsense/PuppetAgent/index.volt @@ -0,0 +1,62 @@ +{# + +OPNsense® is Copyright © 2021 Jan Winkler +OPNsense® is Copyright © 2014 – 2015 by Deciso B.V. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +#} + + + + + +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}} +
    + +
    + +
    diff --git a/sysutils/puppet-agent/src/opnsense/service/conf/actions.d/actions_puppetagent.conf b/sysutils/puppet-agent/src/opnsense/service/conf/actions.d/actions_puppetagent.conf new file mode 100644 index 0000000000..8081449535 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/service/conf/actions.d/actions_puppetagent.conf @@ -0,0 +1,23 @@ +[start] +command:/usr/local/etc/rc.d/puppet start +parameters: +type:script +message:starting puppet agent + +[stop] +command:/usr/local/etc/rc.d/puppet onestop +parameters: +type:script +message:stop puppet agent + +[restart] +command:/usr/local/etc/rc.d/puppet restart +parameters: +type:script +message:restart puppet agent + +[status] +command:/usr/local/etc/rc.d/puppet onestatus; exit 0 +parameters: +type:script_output +message:request puppet agent status diff --git a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/+TARGETS b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/+TARGETS new file mode 100644 index 0000000000..085fa8c75b --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/+TARGETS @@ -0,0 +1,2 @@ +puppetagent.conf:/usr/local/etc/puppet/puppet.conf +rc.conf.d:/etc/rc.conf.d/puppet diff --git a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf new file mode 100644 index 0000000000..1319d02e81 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf @@ -0,0 +1,10 @@ +{% if helpers.exists('OPNsense.puppetagent.general') and OPNsense.puppetagent.general.Enabled|default("0") == "1" %} +[main] +certname = {{ system.hostname|lower }}.{{ system.domain|lower }} +server = {{ OPNsense.puppetagent.general.FQDN|default("") }} +{% if helpers.exists('OPNsense.puppetagent.general') and not helpers.empty('OPNsense.puppetagent.general.Environment') %} +[agent] +environment = {{ OPNsense.puppetagent.general.Environment|default("") }} +{% endif %} +{% endif %} + diff --git a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/rc.conf.d b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/rc.conf.d new file mode 100644 index 0000000000..a36c64f16b --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/rc.conf.d @@ -0,0 +1,5 @@ +{% if helpers.exists('OPNsense.puppetagent.general') and OPNsense.puppetagent.general.Enabled|default("0") == "1" %} +puppet_enable="YES" +{% else %} +puppet_enable="NO" +{% endif %} From afab6eaf7d6e86d8a11a23b7faf3ac4fad0ccbe5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 19 May 2021 16:00:17 +0200 Subject: [PATCH 0584/3088] plugins: style, whitespace and sync --- LICENSE | 4 +++- README.md | 3 ++- .../systemhealth/logformats/zabbix_proxy.py | 0 .../systemhealth/logformats/zabbix_proxy.py | 0 .../src/etc/inc/plugins.inc.d/radsecproxy.inc | 1 - .../OPNsense/Relayd/Api/StatusController.php | 14 +++++++------- .../src/etc/inc/plugins.inc.d/puppetagent.inc | 2 +- .../OPNsense/PuppetAgent/Api/ServiceController.php | 3 +-- .../OPNsense/PuppetAgent/puppetagent.conf | 1 - .../Base/Constraints/NaxsiIdentifierConstraint.php | 2 +- .../Base/Constraints/NgxBusyBufferConstraint.php | 8 +++++--- 11 files changed, 20 insertions(+), 18 deletions(-) mode change 100644 => 100755 net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py mode change 100644 => 100755 net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py diff --git a/LICENSE b/LICENSE index c0d0614edb..33e3021840 100644 --- a/LICENSE +++ b/LICENSE @@ -5,7 +5,8 @@ Copyright (c) 2005-2006 Colin Smith Copyright (c) 2020 D. Domig Copyright (c) 2011 Dan Myers Copyright (c) 2017-2018 David Harrigan -Copyright (c) 2014-2020 Deciso B.V. +Copyright (c) 2021 David Hughes +Copyright (c) 2014-2021 Deciso B.V. Copyright (c) 2008 Donovan Schonknecht Copyright (c) 2016-2019 EURO-LOG AG Copyright (c) 2006 Eric Friesen @@ -15,6 +16,7 @@ Copyright (c) 2019 Felix Matouschek Copyright (c) 2014-2021 Franco Fichtner Copyright (c) 2016-2021 Frank Wall Copyright (c) 2016 IT-assistans Sverige AB +Copyright (c) 2021 Jan Winkler Copyright (c) 2010 Jim Pingle Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça diff --git a/README.md b/README.md index 0d7a3cdb0d..8817be2f50 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ dns/bind -- BIND domain name service dns/dnscrypt-proxy -- Flexible DNS proxy supporting DNSCrypt and DoH dns/dyndns -- Dynamic DNS Support dns/rfc2136 -- RFC-2136 Support -emulators/qemu-guest-agent -- QEMU Guest Agent for OPNsense (development only) +emulators/qemu-guest-agent -- QEMU Guest Agent for OPNsense mail/fetchmail -- Remote-mail retrieval utility (development only) mail/postfix -- SMTP mail relay mail/rspamd -- Protect your network from spam @@ -100,6 +100,7 @@ sysutils/mail-backup -- Send configuration file backup by e-mail sysutils/munin-node -- Munin monitoring agent sysutils/node_exporter -- Prometheus exporter for machine metrics sysutils/nut -- Network UPS Tools +sysutils/puppet-agent -- Manage Puppet Agent (development only) sysutils/smart -- SMART tools sysutils/virtualbox -- VirtualBox guest additions sysutils/vmware -- VMware tools diff --git a/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py b/net-mgmt/zabbix4-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py old mode 100644 new mode 100755 diff --git a/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py b/net-mgmt/zabbix5-proxy/src/opnsense/scripts/systemhealth/logformats/zabbix_proxy.py old mode 100644 new mode 100755 diff --git a/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc b/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc index 57e8734776..840749a926 100644 --- a/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc +++ b/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc @@ -49,7 +49,6 @@ function radsecproxy_syslog() 'facility' => array('LOG_DAEMON'), ); return $logfacilities; - } diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php index dfd721fcb3..8f10376439 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/StatusController.php @@ -45,7 +45,7 @@ class StatusController extends ApiControllerBase /** * get relayd summary */ - public function sumAction($wait=0) + public function sumAction($wait = 0) { $result = array("result" => "failed"); $backend = new Backend(); @@ -93,7 +93,7 @@ public function sumAction($wait=0) if (!empty($virtualserver['tables'])) { foreach ($virtualserver['tables'] as &$table) { if (!empty($table['uuid'])) { - $tblnode = $relaydMdl->getNodeByReference("table.".$table['uuid']); + $tblnode = $relaydMdl->getNodeByReference("table." . $table['uuid']); foreach (explode(",", (string)$tblnode->hosts) as $host_uuid) { $found = false; if (!empty($table['hosts'])) { @@ -108,7 +108,7 @@ public function sumAction($wait=0) $table['hosts'] = []; } if (!$found) { - $hostnode = $relaydMdl->getNodeByReference("host.".$host_uuid); + $hostnode = $relaydMdl->getNodeByReference("host." . $host_uuid); $table['hosts'][$host_uuid] = [ "name" => (string)$hostnode->address, "description" => (string)$hostnode->name, @@ -174,7 +174,7 @@ public function sumAction($wait=0) if (count($objs) > 0) { $linked_hosts = []; if (!empty($virtualserver['tables'][$tableId]['uuid'])) { - $tblnode = $relaydMdl->getNodeByReference("table.".$virtualserver['tables'][$tableId]['uuid']); + $tblnode = $relaydMdl->getNodeByReference("table." . $virtualserver['tables'][$tableId]['uuid']); $linked_hosts = explode(",", (string)$tblnode->hosts); } // hosts aren't necessarily unique due to address matching @@ -204,9 +204,9 @@ public function toggleAction($nodeType = null, $id = null, $action = null) if ($this->request->isPost()) { $this->sessionClose(); $backend = new Backend(); - if (in_array($nodeType, ['redirect', 'table', 'host']) && in_array($action, ['enable', 'disable'])){ + if (in_array($nodeType, ['redirect', 'table', 'host']) && in_array($action, ['enable', 'disable'])) { if ($id != null && $id > 0) { - $result["output"] = $backend->configdpRun("relayd toggle",[$nodeType, $action, $id]); + $result["output"] = $backend->configdpRun("relayd toggle", [$nodeType, $action, $id]); if (isset($result["output"])) { $result["result"] = 'ok'; } @@ -217,7 +217,7 @@ public function toggleAction($nodeType = null, $id = null, $action = null) $new_status = $action == "remove" ? "0" : "1"; $relaydMdl = new Relayd(); foreach (explode(",", $id) as $host_uuid) { - $obj = $relaydMdl->getNodeByReference("host.".$host_uuid); + $obj = $relaydMdl->getNodeByReference("host." . $host_uuid); if ($obj != null) { $obj->enabled = $new_status; } diff --git a/sysutils/puppet-agent/src/etc/inc/plugins.inc.d/puppetagent.inc b/sysutils/puppet-agent/src/etc/inc/plugins.inc.d/puppetagent.inc index bbeb217b07..c5dd7cc636 100644 --- a/sysutils/puppet-agent/src/etc/inc/plugins.inc.d/puppetagent.inc +++ b/sysutils/puppet-agent/src/etc/inc/plugins.inc.d/puppetagent.inc @@ -1,7 +1,7 @@ stopAction(); } return array("status" => "ok"); - } - else { + } else { return array("status" => "failed"); } } diff --git a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf index 1319d02e81..3da8f402e0 100644 --- a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf +++ b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf @@ -7,4 +7,3 @@ server = {{ OPNsense.puppetagent.general.FQDN|default("") }} environment = {{ OPNsense.puppetagent.general.Environment|default("") }} {% endif %} {% endif %} - diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php index 43b4abf1e0..b40c832dd2 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php @@ -38,7 +38,7 @@ */ class NaxsiIdentifierConstraint extends BaseConstraint { - public function validate(\Phalcon\Validation $validator, $attribute) : bool + public function validate(\Phalcon\Validation $validator, $attribute): bool { $node = $this->getOption('node'); if ($node) { diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php index bbf2c5ac82..6067ad0644 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php @@ -38,7 +38,7 @@ */ class NgxBusyBufferConstraint extends BaseConstraint { - public function validate(\Phalcon\Validation $validator, $attribute) : bool + public function validate(\Phalcon\Validation $validator, $attribute): bool { $node = $this->getOption('node'); if ($node) { @@ -64,7 +64,8 @@ public function validate(\Phalcon\Validation $validator, $attribute) : bool $proxy_buffer_size_int = intval((string) $proxy_buffer_size_node); } - if (isset($proxy_buffers_total_minus1_size) && isset($proxy_busy_buffers_size) && + if ( + isset($proxy_buffers_total_minus1_size) && isset($proxy_busy_buffers_size) && $proxy_buffers_total_minus1_size < $proxy_busy_buffers_size ) { $validator->appendMessage(new Message( @@ -74,7 +75,8 @@ public function validate(\Phalcon\Validation $validator, $attribute) : bool } // nginx: [emerg] "proxy_busy_buffers_size" must be equal to or greater than the maximum of the value of "proxy_buffer_size" and one of the "proxy_buffers" - if (isset($proxy_busy_buffers_size) && isset($proxy_buffers_size_int) && + if ( + isset($proxy_busy_buffers_size) && isset($proxy_buffers_size_int) && $proxy_busy_buffers_size < $proxy_buffers_size_int ) { $validator->appendMessage(new Message( From e933752be2bbb434b89eb2f5c60e1f216098da61 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 19 May 2021 19:59:29 +0200 Subject: [PATCH 0585/3088] security/intrusion-detection-content-et-open add emerging-inappropriate ruleset --- security/intrusion-detection-content-et-open/Makefile | 2 +- .../opnsense/scripts/suricata/metadata/rules/et-open-extra.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/security/intrusion-detection-content-et-open/Makefile b/security/intrusion-detection-content-et-open/Makefile index 036bd551e5..cb93113e2b 100644 --- a/security/intrusion-detection-content-et-open/Makefile +++ b/security/intrusion-detection-content-et-open/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= intrusion-detection-content-et-open -PLUGIN_VERSION= 1.0.0 +PLUGIN_VERSION= 1.0.1 #PLUGIN_REVISION= 1 PLUGIN_COMMENT= IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml index 563b11476a..ca6f397f64 100644 --- a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml +++ b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml @@ -10,5 +10,6 @@ et_open.drop.rules et_open.dshield.rules et_open.tor.rules + et_open.emerging-inappropriate.rules From 008da911f577ebd1345e185c6080df32863d6d15 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 20 May 2021 18:17:44 +0200 Subject: [PATCH 0586/3088] net/relayd: Usability improvements https://github.com/opnsense/plugins/issues/2232 (#2398) minor visual improvements on the status page. o reset cursor pointer on status widgets o in host column add one button spacing for better alignment o add a space between buttons and text --- .../mvc/app/views/OPNsense/Relayd/status.volt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/status.volt b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/status.volt index c3a15c73b1..0d7a422717 100644 --- a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/status.volt +++ b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/status.volt @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. * create status and start/stop buttons **/ function getControlButtons(status, id, nodeType) { - let status_btn = $(' + +

    -
    -
    - {{ lang._('Use the Issue/Renew button to let the acme client automatically issue any new certificate and renew existing certificates (only if required). If you want to only issue/renew or revoke a single certificate, use the buttons in the Commands column. This will forcefully issue/renew the certificate, even if it is not required.') }} {{ lang._('The process may take some time and thus will run in the background, you will not get any notification in the GUI. Use the log file to monitor the progress and to see error messages.') }} -

    diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt index 539fc97381..fb111608b1 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/settings.volt @@ -259,7 +259,7 @@ POSSIBILITY OF SUCH DAMAGE.

    {{ lang._("Setting up this plugin for the first time involves the following steps") }}

      -
    • {{ lang._('%sEnable%s the plugin: When enabling this plugin in the %ssettings%s, a lightweight service is started and cron jobs are added for automatic tasks.') | format('', '', '', '') }}
    • +
    • {{ lang._('%sEnable%s the plugin: When enabling this plugin on the %ssettings%s page, a lightweight service is started and a cron job is added to run periodic tasks.') | format('', '', '', '') }}
    • {{ lang._('Create an %saccount%s: An %saccount%s is required. It determines which CA will be used for all associated certificates.') | format('', '', '', '') }}
    • {{ lang._('Set up a %schallenge type%s: Choose the %schallenge type%s that works best for you and if necessary, add the credentials for your DNS provider.') | format('', '', '', '') }}
    • {{ lang._('Add %sautomations%s: This is optional, but recommended when using short-lived certificates. %sAutomations%s allow to automatically run tasks when a certificate was created or renewed.') | format('', '', '', '') }}
    • From 4d07d7481b9ce5fcbcde07a2492a9f1d7ed86ac2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 9 Aug 2021 07:55:24 +0200 Subject: [PATCH 0683/3088] README: sync --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d761ebadf..a19e04af69 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ net-mgmt/nrpe -- Execute nagios plugins net-mgmt/telegraf -- Agent for collecting metrics and data net-mgmt/zabbix-agent -- Zabbix monitoring agent net-mgmt/zabbix-proxy -- Zabbix monitoring proxy -security/acme-client -- Let's Encrypt client +security/acme-client -- ACME Client security/clamav -- Antivirus engine for detecting malicious threats security/etpro-telemetry -- ET Pro Telemetry Edition security/intrusion-detection-content-et-open -- IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition From f9019d0256453b87ee2865f6bef2cd756efca331 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 9 Aug 2021 09:53:45 +0200 Subject: [PATCH 0684/3088] mail/postfix: move to postfix35 package --- mail/postfix/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 399eb2d626..84c6f2441e 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= postfix PLUGIN_VERSION= 1.20 PLUGIN_COMMENT= SMTP mail relay -PLUGIN_DEPENDS= postfix-sasl +PLUGIN_DEPENDS= postfix35 PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" From 17efe7400f568e917118480982a834d943110829 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 9 Aug 2021 10:32:30 +0200 Subject: [PATCH 0685/3088] net/haproxy: move to haproxy22 for now --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index b17e6fb8d6..56ef721c94 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 3.4 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer -PLUGIN_DEPENDS= haproxy +PLUGIN_DEPENDS= haproxy22 PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" From ef88595e0cc60b89d24ac93a24462af44265a02b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 Aug 2021 16:30:48 +0200 Subject: [PATCH 0686/3088] Framework: removed the need for these trampoline targets --- Mk/plugins.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 03b15df427..1502ab8c66 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -101,12 +101,6 @@ PLUGIN_PKGVERSION= ${PLUGIN_VERSION}_${PLUGIN_REVISION} PLUGIN_PKGVERSION= ${PLUGIN_VERSION} .endif -name: check - @echo ${PLUGIN_PKGNAME} - -depends: check - @echo ${PLUGIN_DEPENDS} - manifest: check @echo "name: ${PLUGIN_PKGNAME}" @echo "version: \"${PLUGIN_PKGVERSION}\"" From 1001fa80406ca62f4700c2ac35626259a223f9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=BCrz?= Date: Sun, 15 Aug 2021 21:07:57 +0200 Subject: [PATCH 0687/3088] use OrderDict because csv.DictReader returns a dict after version 3.7 (#2496) * use OrderDict because csv.DictReader returns a dict after version 3.7 --- .../src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py index 391527d890..733daf113b 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py @@ -2,6 +2,7 @@ import re import csv import json +from collections import OrderedDict from io import StringIO class Cmd(): @@ -317,6 +318,7 @@ def getResultObj(self, res): reader = self.getDict(res) for row in reader: + row = OrderedDict(row) # show only server if row['svname'] in ['BACKEND', 'FRONTEND']: continue From 8c3d1e1a0fb1f79c73c51a258a37ef3d9eee09f2 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 15 Aug 2021 21:09:48 +0200 Subject: [PATCH 0688/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 56ef721c94..be6664fc86 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.4 +PLUGIN_VERSION= 3.5 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy22 PLUGIN_MAINTAINER= opnsense@moov.de From 33bb1b5e87822d7d679eea1449467c23a51a3464 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 15 Aug 2021 21:10:33 +0200 Subject: [PATCH 0689/3088] net/haproxy: update changelog --- net/haproxy/pkg-descr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 4d9a646df1..fce3447a04 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.5 + +Fixed: +* fix maintenance page not loading (#2485) + 3.4 Fixed: From ed7ea5d9918b62f4cab209fe815cf1d269bde26e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 3 Sep 2021 20:31:24 +0200 Subject: [PATCH 0690/3088] devel/debug: vim renamed again, but better removed from "debug" --- devel/debug/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/debug/Makefile b/devel/debug/Makefile index f97500c858..52d7ef7886 100644 --- a/devel/debug/Makefile +++ b/devel/debug/Makefile @@ -5,7 +5,7 @@ PLUGIN_DEPENDS= php${PLUGIN_PHP}-pear-PHP_CodeSniffer \ php${PLUGIN_PHP}-pecl-xdebug \ phpunit7-php${PLUGIN_PHP} \ py${PLUGIN_PYTHON}-pycodestyle \ - p5-File-Slurp vim-console git + p5-File-Slurp git PLUGIN_MAINTAINER= franco@opnsense.org .include "../../Mk/plugins.mk" From 57ed95797912ffadec012904429f604951b2ff1d Mon Sep 17 00:00:00 2001 From: Gavin Chappell Date: Wed, 8 Sep 2021 09:55:05 +0100 Subject: [PATCH 0691/3088] Update LE reference to ACME (#2526) --- .../OPNsense/AcmeClient/forms/dialogCertificate.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml index a78b2f0515..ead828f216 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml @@ -13,7 +13,7 @@ certificate.name text - Common Name (CN) for this certificate. + Common Name (CN) and first Alt Name (subjectAltName) for this certificate. certificate.description @@ -36,7 +36,7 @@ certificate.account - + dropdown From c943362b3dc30b551482de1e0c4c8fb7e8198eb3 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 8 Sep 2021 11:21:21 +0200 Subject: [PATCH 0692/3088] security/acme-client: update changelog --- security/acme-client/pkg-descr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index a78db9bedf..724aae3e7c 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.1 + +Changed: +* rename "LE Account" to "ACME Account" in certificate dialog (#2526) + 3.0 Added: From 9ebb22b6fc52d9d11e634ef59127171e6a993082 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 8 Sep 2021 11:21:37 +0200 Subject: [PATCH 0693/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index aa8f7cc864..465cc25781 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.0 +PLUGIN_VERSION= 3.1 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From 311eccb6388a8533e4e41d1ec298660b2a9bb5c3 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 9 Sep 2021 09:50:33 +0200 Subject: [PATCH 0694/3088] net-mgmt/telegraf: Allow Run as Root (#2520) --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 4 ++++ .../mvc/app/controllers/OPNsense/Telegraf/forms/general.xml | 4 ++-- .../src/opnsense/service/templates/OPNsense/Telegraf/telegraf | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index a7e3d647ad..71ae1610bb 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.12.0 +PLUGIN_VERSION= 1.12.1 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 0ab481d8f8..9b28b08a95 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.influxdata.com/time-series-platform/telegraf/ Plugin Changelog ================ +1.12.1 + +* Rename "Wheel Group" to "Run as Root" and set user permissions + 1.12.0 * Allow to start telegraf with wheel group permissions diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/general.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/general.xml index 95a80b7fd2..cddb34f67d 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/general.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/general.xml @@ -7,9 +7,9 @@ general.wheelgroup - + checkbox - This will start the process with wheel group permission. Please use this with care, currently only needed for Unbound and Suricata. + This will start the process with wheel group and root user permission. Please use this with care, currently only needed for Unbound and Suricata. general.interval diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf index 54ccc238f6..5e91fffa8f 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf @@ -1,5 +1,6 @@ {% if helpers.exists('OPNsense.telegraf.general.enabled') and OPNsense.telegraf.general.enabled == '1' %} {% if OPNsense.telegraf.general.wheelgroup == '1' %} +telegraf_user="root" telegraf_group="wheel" {% endif %} telegraf_var_script="/usr/local/opnsense/scripts/OPNsense/Telegraf/setup.sh" From 2e1f6fa47ea9dda0631d7caa3e027ebb923f794d Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 9 Sep 2021 09:51:51 +0200 Subject: [PATCH 0695/3088] dns/dnscrypt-proxy: rename label in templating (#2519) PR: https://forum.opnsense.org/index.php?topic=24297.0 --- .../OPNsense/Dnscryptproxy/dnscrypt-proxy.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml index f6627a3a71..dcade82dfb 100644 --- a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml +++ b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml @@ -126,21 +126,21 @@ cache = false file = '/var/log/dnscrypt-proxy/nx.log' format = 'tsv' -[whitelist] - whitelist_file = 'whitelist.txt' +[allowed_names] + allowed_names_file = 'whitelist.txt' log_file = '/var/log/dnscrypt-proxy/whitelisted.log' log_format = 'tsv' {% if helpers.exists('OPNsense.dnscryptproxy.dnsbl.enabled') and OPNsense.dnscryptproxy.dnsbl.enabled == '1' %} -[blacklist] - blacklist_file = 'blacklist.txt' +[blocked_names] + blocked_names_file = 'blacklist.txt' log_file = '/var/log/dnscrypt-proxy/blocked.log' log_format = 'tsv' {% endif %} [sources] [sources.'public-resolvers'] - urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v2/public-resolvers.md', 'https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md'] + urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md', 'https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md'] cache_file = 'public-resolvers.md' minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3' refresh_delay = 72 From 9004ee48775967d5da952a7d2daccdf13ff1b042 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 9 Sep 2021 09:53:32 +0200 Subject: [PATCH 0696/3088] net-mgmt/collectd: Add tcpconns and ipstats plugins (#2514) --- net-mgmt/collectd/Makefile | 3 +-- net-mgmt/collectd/pkg-descr | 5 +++++ .../controllers/OPNsense/Collectd/forms/general.xml | 12 ++++++++++++ .../mvc/app/models/OPNsense/Collectd/General.xml | 10 +++++++++- .../templates/OPNsense/Collectd/collectd.conf | 10 +++++++++- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/net-mgmt/collectd/Makefile b/net-mgmt/collectd/Makefile index d4a91d1854..8df6de3212 100644 --- a/net-mgmt/collectd/Makefile +++ b/net-mgmt/collectd/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= collectd -PLUGIN_VERSION= 1.3 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.4 PLUGIN_COMMENT= Collect system and application performance metrics periodically PLUGIN_DEPENDS= collectd5 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/collectd/pkg-descr b/net-mgmt/collectd/pkg-descr index a350d3e2bc..b50a748d9a 100644 --- a/net-mgmt/collectd/pkg-descr +++ b/net-mgmt/collectd/pkg-descr @@ -7,6 +7,11 @@ in RRD files. Plugin Changelog ================ +1.4 + +* Add ipstats plugin +* Add tcpconns plugin + 1.3 * Add support for CPU aggregation (contributed by @pmhausen) diff --git a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml index 6e05b7ca87..1826b8b637 100644 --- a/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml +++ b/net-mgmt/collectd/src/opnsense/mvc/app/controllers/OPNsense/Collectd/forms/general.xml @@ -191,4 +191,16 @@ checkbox The Users plugin counts the number of users currently logged into the system (SSH). + + general.p_tcpconns + + checkbox + The tcpconns plugin lists a summary of all tcp connections. + + + general.p_ipstats + + checkbox + The ipstats plugin lists multiple interface stats. + diff --git a/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml b/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml index b87d8f5ffb..ead3dcf6c9 100644 --- a/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml +++ b/net-mgmt/collectd/src/opnsense/mvc/app/models/OPNsense/Collectd/General.xml @@ -1,7 +1,7 @@ //OPNsense/collectd/general Collectd configuration - 1.0.2 + 1.0.3 0 @@ -133,5 +133,13 @@ 1 N + + 0 + N + + + 0 + N + diff --git a/net-mgmt/collectd/src/opnsense/service/templates/OPNsense/Collectd/collectd.conf b/net-mgmt/collectd/src/opnsense/service/templates/OPNsense/Collectd/collectd.conf index 15af1eae7b..52f58491ae 100644 --- a/net-mgmt/collectd/src/opnsense/service/templates/OPNsense/Collectd/collectd.conf +++ b/net-mgmt/collectd/src/opnsense/service/templates/OPNsense/Collectd/collectd.conf @@ -58,7 +58,15 @@ LoadPlugin users {% if helpers.exists('OPNsense.collectd.general.p_graphite_enable') and OPNsense.collectd.general.p_graphite_enable == '1' %} LoadPlugin write_graphite {% endif %} - +{% if helpers.exists('OPNsense.collectd.general.p_tcpconns') and OPNsense.collectd.general.p_tcpconns == '1' %} +LoadPlugin tcpconns + + AllPortsSummary true + +{% endif %} +{% if helpers.exists('OPNsense.collectd.general.p_ipstats') and OPNsense.collectd.general.p_ipstats == '1' %} +LoadPlugin ipstats +{% endif %} ############################################################################## # Plugin configuration # #----------------------------------------------------------------------------# From f934be62851bb95e7a3e0c74ef7f9fd3f2ea43b5 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 9 Sep 2021 09:54:45 +0200 Subject: [PATCH 0697/3088] net/freeradius: fix secret and allow ecdh curve selection (#2511) --- net/freeradius/Makefile | 2 +- net/freeradius/pkg-descr | 5 +++++ .../app/controllers/OPNsense/Freeradius/forms/eap.xml | 6 ++++++ .../mvc/app/models/OPNsense/Freeradius/Eap.xml | 11 ++++++++++- .../templates/OPNsense/Freeradius/clients.conf | 2 +- .../templates/OPNsense/Freeradius/mods-enabled-eap | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index b9f22ddb84..eeaa9f0809 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= freeradius -PLUGIN_VERSION= 1.9.15 +PLUGIN_VERSION= 1.9.16 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index 2ea2e9084e..f79c4cfd20 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -15,6 +15,11 @@ The server is fast, feature-rich, modular, and scalable. Plugin Changelog ================ +1.9.16 + +* Allow user to choose Elliptic Curve in EAP +* Allow client secrets starting with hash sign + 1.9.15 * Fixed validation of CIDR for client network ranges diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/eap.xml b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/eap.xml index 531cc4fde8..8747dd6aaa 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/eap.xml +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/eap.xml @@ -5,6 +5,12 @@ dropdown Set the default EAP type. + + eap.elliptic_curve + + dropdown + Set the Elliptical cryptography configuration. + eap.enable_client_cert diff --git a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml index 9ec71ef013..f4604c752f 100644 --- a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml +++ b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml @@ -1,7 +1,7 @@ //OPNsense/freeradius/eap EAP configuration - 1.0.0 + 1.9.16 md5 @@ -16,6 +16,15 @@ TTLS-GTC + + prime256v1 + Y + N + + prime256v1 + secp384r1 + + 0 Y diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/clients.conf b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/clients.conf index c7c2c35672..bac3ce8a11 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/clients.conf +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/clients.conf @@ -4,7 +4,7 @@ {% for client_list in helpers.toList('OPNsense.freeradius.client.clients.client') %} {% if client_list.enabled == '1' %} client "{{ client_list.name }}" { - secret = {{ client_list.secret }} + secret = "{{ client_list.secret }}" shortname = "{{ client_list.name }}" {% if ':' in client_list.ip %} ipv6addr = {{ client_list.ip }} diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-eap b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-eap index 980a6ed095..ff98fca0b8 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-eap +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-eap @@ -471,7 +471,7 @@ eap { # # openssl ecparam -list_curves # - ecdh_curve = "prime256v1" + ecdh_curve = "{{ OPNsense.freeradius.eap.elliptic_curve }}" # Session resumption / fast reauthentication # cache. From 3bc072ad9cc6b0789a591cc1285d7e43a70ac197 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 9 Sep 2021 09:57:15 +0200 Subject: [PATCH 0698/3088] net/chrony: Adjust chronyc timeouts (#2460) --- net/chrony/Makefile | 2 +- net/chrony/pkg-descr | 4 ++++ .../opnsense/service/conf/actions.d/actions_chrony.conf | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/net/chrony/Makefile b/net/chrony/Makefile index 8ca31c20bb..d87cafe8e9 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= chrony -PLUGIN_VERSION= 1.3 +PLUGIN_VERSION= 1.4 PLUGIN_COMMENT= Chrony time synchronisation PLUGIN_DEPENDS= chrony PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/chrony/pkg-descr b/net/chrony/pkg-descr index a6283aec5f..eb87118f74 100644 --- a/net/chrony/pkg-descr +++ b/net/chrony/pkg-descr @@ -4,6 +4,10 @@ better in virtual environments. Plugin Changelog ---------------- +1.4 + +* Adjust timeouts and retries for chronyc + 1.3 * Add makestep to configuration diff --git a/net/chrony/src/opnsense/service/conf/actions.d/actions_chrony.conf b/net/chrony/src/opnsense/service/conf/actions.d/actions_chrony.conf index 10b185b46c..cc0beb772d 100644 --- a/net/chrony/src/opnsense/service/conf/actions.d/actions_chrony.conf +++ b/net/chrony/src/opnsense/service/conf/actions.d/actions_chrony.conf @@ -23,25 +23,25 @@ type:script_output message:request chrony status [chronysources] -command:/usr/local/bin/chronyc sources +command:/usr/local/bin/chronyc -m 'timeout 100' 'retries 0' sources parameters: type:script_output message:show chrony sources [chronysourcestats] -command:/usr/local/bin/chronyc sourcestats +command:/usr/local/bin/chronyc -m 'timeout 100' 'retries 0' sourcestats parameters: type:script_output message:show chrony sourcestats [chronytracking] -command:/usr/local/bin/chronyc tracking +command:/usr/local/bin/chronyc -m 'timeout 100' 'retries 0' tracking parameters: type:script_output message:show chrony tracking [chronyauthdata] -command:/usr/local/bin/chronyc -N authdata +command:/usr/local/bin/chronyc -N -m 'timeout 100' 'retries 0' authdata parameters: type:script_output message:show chrony authdata From 0c756bbd79d6c7114e84a958e7990303d446d4c6 Mon Sep 17 00:00:00 2001 From: mr44er <46787531+mr44er@users.noreply.github.com> Date: Mon, 13 Sep 2021 21:20:56 +0200 Subject: [PATCH 0699/3088] Update fetchmailrc (#2534) --- mail/fetchmail/Makefile | 2 +- .../opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mail/fetchmail/Makefile b/mail/fetchmail/Makefile index 3dba199e8f..db47f30b41 100644 --- a/mail/fetchmail/Makefile +++ b/mail/fetchmail/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= fetchmail -PLUGIN_VERSION= 1.0 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= Remote-mail retrieval utility PLUGIN_DEPENDS= fetchmail PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc b/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc index 3438c2fcf6..891cf3772e 100644 --- a/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc +++ b/mail/fetchmail/src/opnsense/service/templates/OPNsense/Fetchmail/fetchmailrc @@ -6,7 +6,7 @@ set syslog {% if helpers.exists('OPNsense.fetchmail.mailbox.mailboxes.mailbox') %} {% for mailbox_list in helpers.toList('OPNsense.fetchmail.mailbox.mailboxes.mailbox') %} {% if mailbox_list.enabled == '1' %} -poll {{ mailbox_list.host }} protocol {{ mailbox_list.protocol }} username "{{ mailbox_list.user }}" password "{{ mailbox_list.password }}" is {{ mailbox_list.destinationmail }} smtphost {{ mailbox_list.destination }} {% if mailbox_list.usessl == "0" %} sslproto '' {% endif %} {% if mailbox_list.sslfingerprint|default('') != '' %} sslfingerprint "{{ mailbox_list.sslfingerprint }}" {% endif %} +poll {{ mailbox_list.host }} protocol {{ mailbox_list.protocol }} username "{{ mailbox_list.user }}" password "{{ mailbox_list.password }}" is {{ mailbox_list.destinationmail }} smtphost {{ mailbox_list.destination }} {% if mailbox_list.usessl == "0" %}ssl {% endif %} {% if mailbox_list.sslfingerprint|default('') != '' %} sslfingerprint "{{ mailbox_list.sslfingerprint }}" {% endif %} {% endif %} {% endfor %} {% endif %} From 55b620034b5476901113bc548a771955f074a295 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Sep 2021 14:05:38 +0200 Subject: [PATCH 0700/3088] net/upnp: replace obsolete find_interface_ip() PR: https://github.com/opnsense/core/issues/4749 --- net/upnp/Makefile | 2 +- net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/net/upnp/Makefile b/net/upnp/Makefile index 9dca9a4c47..145438e569 100644 --- a/net/upnp/Makefile +++ b/net/upnp/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= upnp PLUGIN_VERSION= 1.4 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_DEPENDS= miniupnpd PLUGIN_COMMENT= Universal Plug and Play Service PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc index 9c0caff43e..f1d23f2e70 100644 --- a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc +++ b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc @@ -148,9 +148,8 @@ function miniupnpd_configure_do($verbose = false) $if = get_real_interface($iface); /* above function returns iface if fail */ if ($if != $iface) { - $addr = find_interface_ip($if); - /* check that the interface has an ip address before adding parameters */ - if (is_ipaddr($addr)) { + list ($addr) = interfaces_primary_address($iface); + if (!empty($addr)) { $config_text .= "listening_ip={$if}\n"; if (!$ifaces_active) { $webgui_ip = $addr; From a395ee96dc93392c68acda4c4b034deaf8f19fae Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 15 Sep 2021 14:12:42 +0200 Subject: [PATCH 0701/3088] net/upnp: actually use get_interface_ip() which is backwards compatible PR: https://github.com/opnsense/core/issues/4749 --- net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc index f1d23f2e70..9547836fe8 100644 --- a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc +++ b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc @@ -148,7 +148,7 @@ function miniupnpd_configure_do($verbose = false) $if = get_real_interface($iface); /* above function returns iface if fail */ if ($if != $iface) { - list ($addr) = interfaces_primary_address($iface); + $addr = get_interface_ip($iface); if (!empty($addr)) { $config_text .= "listening_ip={$if}\n"; if (!$ifaces_active) { From 2a9624071fe7c0fcf570a5249d24321e847c2add Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 16 Sep 2021 07:36:44 +0200 Subject: [PATCH 0702/3088] net/realtek-re: add vendor driver plugin --- net/realtek-re/Makefile | 7 +++++++ net/realtek-re/pkg-descr | 7 +++++++ net/realtek-re/src/etc/rc.loader.d/50-realtek-re | 2 ++ 3 files changed, 16 insertions(+) create mode 100644 net/realtek-re/Makefile create mode 100644 net/realtek-re/pkg-descr create mode 100644 net/realtek-re/src/etc/rc.loader.d/50-realtek-re diff --git a/net/realtek-re/Makefile b/net/realtek-re/Makefile new file mode 100644 index 0000000000..c361bada31 --- /dev/null +++ b/net/realtek-re/Makefile @@ -0,0 +1,7 @@ +PLUGIN_NAME= realtek-re +PLUGIN_VERSION= 1.0 +PLUGIN_COMMENT= Realtek re(4) vendor driver +PLUGIN_MAINTAINER= franco@opnsense.org +PLUGIN_DEPENDS= realtek-re-kmod + +.include "../../Mk/plugins.mk" diff --git a/net/realtek-re/pkg-descr b/net/realtek-re/pkg-descr new file mode 100644 index 0000000000..f134d75937 --- /dev/null +++ b/net/realtek-re/pkg-descr @@ -0,0 +1,7 @@ +This is the official driver from Realtek and can be loaded instead of +the FreeBSD driver built into the GENERIC kernel if you experience +issues with it (eg. watchdog timeouts), or your card is not supported. + +Please note this driver requires a system reboot to activate. + +WWW: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software diff --git a/net/realtek-re/src/etc/rc.loader.d/50-realtek-re b/net/realtek-re/src/etc/rc.loader.d/50-realtek-re new file mode 100644 index 0000000000..59662ee7e2 --- /dev/null +++ b/net/realtek-re/src/etc/rc.loader.d/50-realtek-re @@ -0,0 +1,2 @@ +if_re_load="YES" +if_re_name="/boot/modules/if_re.ko" From fc904af8f11e7a1fb25b24dc4212a283f8300e80 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 16 Sep 2021 07:40:28 +0200 Subject: [PATCH 0703/3088] README: sync --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a19e04af69..8850cdfac8 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ net/igmp-proxy -- IGMP-Proxy Service net/mdns-repeater -- Proxy multicast DNS between networks net/ntopng -- Traffic Analysis and Flow Collection net/radsecproxy -- RADIUS proxy provides both RADIUS UDP and TCP/TLS (RadSec) transport +net/realtek-re -- Realtek re(4) vendor driver net/relayd -- Relayd Load Balancer net/shadowsocks -- Secure socks5 proxy net/siproxd -- Siproxd is a proxy daemon for the SIP protocol From e10d7e6a6689b201d6b9051238182b0c9b64e27f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 22 Sep 2021 13:31:38 +0200 Subject: [PATCH 0704/3088] mail/fetchmail: add version info --- mail/fetchmail/pkg-descr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mail/fetchmail/pkg-descr b/mail/fetchmail/pkg-descr index 8ae7146501..41d9cfd416 100644 --- a/mail/fetchmail/pkg-descr +++ b/mail/fetchmail/pkg-descr @@ -6,6 +6,10 @@ KPOP, all flavors of IMAP, ETRN, and ODMR. Plugin Changelog ================ +1.1 + +* Fix "ssl" keyword syntax (contributed by mr44er) + 1.0 * Allow fetching IMAP mailboxes From 722debb0ba2977284af30acecad29d1a19e0a44b Mon Sep 17 00:00:00 2001 From: Luca Zeug Date: Thu, 23 Sep 2021 15:37:53 +0200 Subject: [PATCH 0705/3088] dns/dyndns: add desec.io wildcard support (#2545) --- dns/dyndns/src/www/services_dyndns_edit.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index d41bb37b68..2ced127821 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -116,6 +116,9 @@ function is_dyndns_username($uname) case 'cloudflare-v6': case 'cloudflare-token': case 'cloudflare-token-v6': + case 'desec': + case 'desec-v4-v6': + case 'desec-v6': case 'eurodns': case 'godaddy': case 'godaddy-v6': From ae697392293e4a7fb3e9ed0450a559adccbab2e6 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 28 Sep 2021 17:21:07 +0200 Subject: [PATCH 0706/3088] security/acme-client: expose import feature to GUI --- security/acme-client/pkg-descr | 5 +++++ .../AcmeClient/Api/CertificatesController.php | 19 +++++++++++++++++ .../OPNsense/AcmeClient/certificates.volt | 21 +++++++++++++++++++ .../conf/actions.d/actions_acmeclient.conf | 6 ++++++ 4 files changed, 51 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 724aae3e7c..832ae46aba 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.2 + +Added: +* add button to (re-) import a certificate into the trust storage + 3.1 Changed: diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php index 5a56a56a09..e72baa6307 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php @@ -172,4 +172,23 @@ public function automationAction($uuid) } return $result; } + + /** + * (re-) import the certificate by uuid + * @param $uuid item unique id + * @return array status + */ + public function importAction($uuid) + { + $result = array("result" => "failed"); + $mdlAcme = new AcmeClient(); + if ($uuid != null) { + $node = $mdlAcme->getNodeByReference('certificates.certificate.' . $uuid); + if ($node != null) { + $backend = new Backend(); + $response = $backend->configdRun("acmeclient import ${uuid}"); + } + } + return $result; + } } diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt index 334e7914be..f74432af69 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt @@ -49,6 +49,7 @@ POSSIBILITY OF SUCH DAMAGE. revoke:'/api/acmeclient/certificates/revoke/', removekey:'/api/acmeclient/certificates/removekey/', automation:'/api/acmeclient/certificates/automation/', + import:'/api/acmeclient/certificates/import/', }; var gridopt = { @@ -62,6 +63,7 @@ POSSIBILITY OF SUCH DAMAGE. return " " + "" + "" + + "" + "" + "" + "" + @@ -397,6 +399,25 @@ POSSIBILITY OF SUCH DAMAGE. } }); + // import certificate into trust storage + grid_certificates.find(".command-import").on("click", function(e) + { + if (gridParams['import'] != undefined) { + var uuid=$(this).data("row-id"); + stdDialogConfirm('{{ lang._('Confirmation Required') }}', + '{{ lang._('(Re-) import the selected certificate into the trust storage?') }}', + '{{ lang._('Yes') }}', '{{ lang._('Cancel') }}', function() { + ajaxCall(url=gridParams['import'] + uuid, + sendData={},callback=function(data,status){ + // reload grid after sign + $("#"+gridId).bootgrid("reload"); + }); + }); + } else { + console.log("[grid] action import missing") + } + }); + }); // Hide options that are irrelevant in this context. diff --git a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf index 8f379a6da7..7af68eaa45 100644 --- a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf +++ b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf @@ -77,6 +77,12 @@ parameters:%s type:script message:running automations for a certificate +[import] +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode import --cert +parameters:%s +type:script +message:running import for a certificate + [cron-auto-renew] command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/setup.sh; /usr/sbin/daemon -f /usr/local/opnsense/scripts/OPNsense/AcmeClient/lecert.php --mode issue --all --cron parameters: From e7f9320ff223d79979a3c1481d7c9121d94417f6 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 28 Sep 2021 17:21:26 +0200 Subject: [PATCH 0707/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 465cc25781..def551fa6b 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.1 +PLUGIN_VERSION= 3.2 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From 9220a4149940cd9f020a678e2c954c6a62c0ba01 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 28 Sep 2021 18:01:14 +0200 Subject: [PATCH 0708/3088] security/acme-client: minor improvements for import feature --- .../mvc/app/views/OPNsense/AcmeClient/certificates.volt | 2 +- .../src/opnsense/scripts/OPNsense/AcmeClient/lecert.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt index f74432af69..f7eae4892d 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt @@ -405,7 +405,7 @@ POSSIBILITY OF SUCH DAMAGE. if (gridParams['import'] != undefined) { var uuid=$(this).data("row-id"); stdDialogConfirm('{{ lang._('Confirmation Required') }}', - '{{ lang._('(Re-) import the selected certificate into the trust storage?') }}', + '{{ lang._('(Re-) import the selected certificate and associated CA certificates into the trust storage?') }}', '{{ lang._('Yes') }}', '{{ lang._('Cancel') }}', function() { ajaxCall(url=gridParams['import'] + uuid, sendData={},callback=function(data,status){ diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php index 76fb546cfb..73bb87ee28 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/lecert.php @@ -171,7 +171,9 @@ function main() } } elseif ($options['mode'] === 'import' && isset($options['cert'])) { $cert = new LeCertificate($options['cert']); - $cert->import(); + // Set $skip_validation to allow import even when validation + // is currently failing. + $cert->import(true); } elseif ($options['mode'] === 'revoke' && isset($options['cert'])) { $cert = new LeCertificate($options['cert']); $cert->revoke(); From 247408e50a95cb7770bf4c91558aed9d9738dc6a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 28 Sep 2021 18:08:54 +0200 Subject: [PATCH 0709/3088] security/acme-client: fix CA association, closes #2550 --- security/acme-client/pkg-descr | 3 +++ .../mvc/app/library/OPNsense/AcmeClient/LeCertificate.php | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 832ae46aba..a7dc6c18e2 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -13,6 +13,9 @@ Plugin Changelog Added: * add button to (re-) import a certificate into the trust storage +Fixed: +* associate certificates with the correct CA when multiple CAs use the same name (#2550) + 3.1 Changed: diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index cfe13498d8..9aaf313beb 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -159,7 +159,7 @@ public function import(bool $skip_validation = false) foreach (Config::getInstance()->object()->ca as $cacrt) { $cacrt_subject = cert_get_subject($cacrt->crt, true); $cacrt_issuer = cert_get_issuer($cacrt->crt, true); - if (($ca_subject == $cacrt_subject) and ($ca_issuer == $cacrt_issuer)) { + if (($ca_subject === $cacrt_subject) and ($ca_issuer === $cacrt_issuer)) { // Use old refid instead of generating a new one $ca['refid'] = (string)$cacrt->refid; $ca_found = true; @@ -257,6 +257,12 @@ public function import(bool $skip_validation = false) // Prepare certificate for import cert_import($cert, $cert_content, $key_content); + // Overwrite caref in order to use the correct CA (GH #2550). + // This is required because cert_import() uses lookup_ca_by_subject() + // to find a matching CA. If multiple CAs are using the same name, the + // first CA wins, but it may still be the wrong CA. + $cert['caref'] = (string)$ca['refid']; + // Check if cert was found in config if ($cert_found == true) { // Update existing cert From 774374a49e261c43ff70ee6f02346177951f2b3d Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 28 Sep 2021 18:24:07 +0200 Subject: [PATCH 0710/3088] security/acme-client: fix width of commands column --- .../mvc/app/views/OPNsense/AcmeClient/certificates.volt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt index f7eae4892d..c0483969bf 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt @@ -484,7 +484,7 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Issue/Renewal Date') }} {{ lang._('Last ACME Status') }} {{ lang._('Last ACME Run') }} - {{ lang._('Commands') }} + {{ lang._('Commands') }} {{ lang._('ID') }} From 50315e830e575eee2b5473658337a265e5c97160 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Sep 2021 08:23:00 +0200 Subject: [PATCH 0711/3088] dns: bump revisions where changes exist vs. stable --- dns/dnscrypt-proxy/Makefile | 1 + dns/dyndns/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dns/dnscrypt-proxy/Makefile b/dns/dnscrypt-proxy/Makefile index 2cfd73068d..1c29346d61 100644 --- a/dns/dnscrypt-proxy/Makefile +++ b/dns/dnscrypt-proxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= dnscrypt-proxy PLUGIN_VERSION= 1.9 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Flexible DNS proxy supporting DNSCrypt and DoH PLUGIN_DEPENDS= dnscrypt-proxy2 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index b049331a4d..e503a65620 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.24 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From 6a58548140343dbcecfbf8a9e33406f93ea575d0 Mon Sep 17 00:00:00 2001 From: Frank Brendel Date: Wed, 29 Sep 2021 10:41:22 +0200 Subject: [PATCH 0712/3088] net/relayd: add ip protocol for redirections (#2391) --- net/relayd/Makefile | 2 +- .../OPNsense/Relayd/forms/virtualserver.xml | 8 ++++++++ .../mvc/app/models/OPNsense/Relayd/Relayd.xml | 19 ++++++++++++++++++- .../mvc/app/views/OPNsense/Relayd/index.volt | 2 ++ .../templates/OPNsense/Relayd/relayd.conf | 3 +++ 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index d0c095ff8e..0641c68acb 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= relayd -PLUGIN_VERSION= 2.5 +PLUGIN_VERSION= 2.6 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/forms/virtualserver.xml b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/forms/virtualserver.xml index 66636718d4..0135923ede 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/forms/virtualserver.xml +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/forms/virtualserver.xml @@ -35,6 +35,14 @@ Specify an address to listen on.]]> + + relayd.virtualserver.listen_proto + + dropdown + + + relayd.virtualserver.listen_startport diff --git a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml index 60852198b0..985f0e23de 100644 --- a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml +++ b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml @@ -1,6 +1,6 @@ //OPNsense/relayd - 1.0.3 + 1.0.4 Relayd settings @@ -175,6 +175,14 @@ lower Please specify a valid servername or IP address. + + Y + tcp + + TCP + UDP + + Y 1 @@ -296,6 +304,15 @@ Table check not found N N + + + Table check must be set. + DependConstraint + + backuptransport_table + + + roundrobin diff --git a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt index 0b1ea7e48f..71cb811011 100644 --- a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt +++ b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt @@ -117,6 +117,7 @@ POSSIBILITY OF SUCH DAMAGE. var transport_tablemode = $('#relayd\\.virtualserver\\.transport_tablemode').val(); var backuptransport_tablemode = $('#relayd\\.virtualserver\\.backuptransport_tablemode').val(); + $('tr[id="row_relayd.virtualserver.listen_proto"]').addClass('hidden'); $('tr[id="row_relayd.virtualserver.transport_type"]').addClass('hidden'); $('tr[id="row_relayd.virtualserver.routing_interface"]').addClass('hidden'); $('tr[id="row_relayd.virtualserver.stickyaddress"]').addClass('hidden'); @@ -129,6 +130,7 @@ POSSIBILITY OF SUCH DAMAGE. $('#relayd\\.virtualserver\\.backuptransport_tablemode').empty().append(''); if(servertype == 'redirect'){ + $('tr[id="row_relayd.virtualserver.listen_proto"]').removeClass('hidden'); $('tr[id="row_relayd.virtualserver.transport_type"]').removeClass('hidden'); if(transport_type == 'route'){ $('tr[id="row_relayd.virtualserver.routing_interface"]').removeClass('hidden'); diff --git a/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf b/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf index 5f99db8955..b4d3fb121e 100644 --- a/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf +++ b/net/relayd/src/opnsense/service/templates/OPNsense/Relayd/relayd.conf @@ -62,6 +62,9 @@ table <{{ table.name }}>{{ disable }} { disable {% endif %} {% set listen = "listen on " ~ virtualserver.listen_address %} +{% if virtualserver.listen_proto is defined and virtualserver.type == 'redirect' %} +{% set listen = listen ~ " " ~ virtualserver.listen_proto %} +{% endif %} {% if virtualserver.listen_startport is defined %} {% set listen = listen ~ " port " ~ virtualserver.listen_startport %} {% if virtualserver.listen_endport is defined and virtualserver.type == 'redirect'%} From 5d89d2adba525537f9eb81d67974adfcd0b0eb43 Mon Sep 17 00:00:00 2001 From: Richard Bateman Date: Wed, 6 Oct 2021 15:09:19 -0600 Subject: [PATCH 0713/3088] net/haproxy: add support for additional resolver options (#2560) * net/haproxy: add support for advanced resolver properties (#2330) --- .../OPNsense/HAProxy/forms/dialogResolver.xml | 49 +++++++++++++++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 43 ++++++++++++++++ .../templates/OPNsense/HAProxy/haproxy.conf | 21 ++++++++ 3 files changed, 113 insertions(+) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml index a604d7d6fb..d4fb81e86c 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml @@ -51,4 +51,53 @@ text + + resolver.accepted_payload_size + + text + + true + + + resolver.hold_valid + + text + + true + + + resolver.hold_obsolete + + text + + true + + + resolver.hold_refused + + text + + true + + + resolver.hold_nx + + text + + true + + + resolver.hold_timeout + + text + + true + + + resolver.hold_other + + text + + true + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 58ac8e28e4..bf8cc88950 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -2754,6 +2754,49 @@ Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N + + 512 + 0 + 8192 + Should be a number between 0 and 8192 + N + + + 10s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + + + 10s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + + + 10s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + + + 10s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + + + 10s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + + + 10s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index cfb2c1d012..7b40fbd6a2 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1080,6 +1080,27 @@ resolvers {{resolver.id}} {% if resolver.timeout_retry|default("") != "" %} timeout retry {{resolver.timeout_retry}} {% endif %} +{% if resolver.accepted_payload_size|default("") != "" %} + accepted_payload_size {{resolver.accepted_payload_size}} +{% endif %} +{% if resolver.hold_valid|default("") != "" %} + hold valid {{resolver.hold_valid}} +{% endif %} +{% if resolver.hold_obsolete|default("") != "" %} + hold obsolete {{resolver.hold_obsolete}} +{% endif %} +{% if resolver.hold_refused|default("") != "" %} + hold refused {{resolver.hold_refused}} +{% endif %} +{% if resolver.hold_nx|default("") != "" %} + hold nx {{resolver.hold_nx}} +{% endif %} +{% if resolver.hold_timeout|default("") != "" %} + hold timeout {{resolver.hold_timeout}} +{% endif %} +{% if resolver.hold_other|default("") != "" %} + hold other {{resolver.hold_other}} +{% endif %} {% else %} # Resolver (DISABLED): {{resolver.name}} From d4be1e7732697c64f80eee48c89c08448ae32b83 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 6 Oct 2021 23:11:47 +0200 Subject: [PATCH 0714/3088] net/haproxy: remove default values, refs #2560 --- .../opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index bf8cc88950..15b3ce18e9 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -2755,44 +2755,37 @@ N - 512 0 8192 Should be a number between 0 and 8192 N - 10s /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N - 10s /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N - 10s /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N - 10s /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N - 10s /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N - 10s /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N From 04fa2aa60abac0adb59f2202df1fb96fd7d951df Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 6 Oct 2021 23:13:26 +0200 Subject: [PATCH 0715/3088] net/haproxy: update changelog --- net/haproxy/pkg-descr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index fce3447a04..c4e4ba9013 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.6 + +Added: +* add support for advanced resolver properties (#2330) + 3.5 Fixed: From 0c80a6a34bbaa129afb42471f40276d6aa9189c8 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 6 Oct 2021 23:13:41 +0200 Subject: [PATCH 0716/3088] net/haproxy: bump version --- net/haproxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index be6664fc86..96f7ef0820 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.5 +PLUGIN_VERSION= 3.6 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy22 PLUGIN_MAINTAINER= opnsense@moov.de From d3457c26201c0af570e7209a36e7ccf0858b7d0b Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 6 Oct 2021 23:29:22 +0200 Subject: [PATCH 0717/3088] net/haproxy: fix label, refs #2560 --- .../app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml index d4fb81e86c..a769aead4c 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml @@ -88,7 +88,7 @@ resolver.hold_timeout - + text true From f87134f665e81be5efc389f28063ce39d58377a5 Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Thu, 7 Oct 2021 01:13:12 +0300 Subject: [PATCH 0718/3088] security/acme-client: api resetAction field name typo #2562 --- .../controllers/OPNsense/AcmeClient/Api/ServiceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ServiceController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ServiceController.php index d7de8f5f33..de54eeeea6 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ServiceController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ServiceController.php @@ -215,7 +215,7 @@ public function resetAction() } // reset account states foreach ($model->getNodeByReference('accounts.account')->iterateItems() as $account) { - $account->lastUpdate = null; + $account->statusLastUpdate = null; } // reset acme.sh data $backend = new Backend(); From f84d859924e5d2491b0d0df9b3d343fd546f3119 Mon Sep 17 00:00:00 2001 From: Matt Elek Harris Date: Wed, 6 Oct 2021 18:42:42 -0400 Subject: [PATCH 0719/3088] security/acme-client: added support for custom ACME CAs (#2529) --- .../OPNsense/AcmeClient/forms/dialogAccount.xml | 6 ++++++ .../library/OPNsense/AcmeClient/LeCommon.php | 17 ++++++++++++++++- .../models/OPNsense/AcmeClient/AcmeClient.xml | 6 ++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAccount.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAccount.xml index 33854114a7..c19bff4f86 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAccount.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAccount.xml @@ -33,6 +33,12 @@ dropdown acme.sh documentation for a list of supported CAs.]]> + + account.custom_ca + + text + + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php index d2097fe7ad..5ea7b5c7d2 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php @@ -84,6 +84,7 @@ abstract class LeCommon protected $config; # AcmeClient config object protected $debug; # Debug logging (bool) protected $ca; # ACME CA + protected $custom_ca; # Custom ACME CA URL protected $ca_compat; # ACME CA for compat with old LE CA names protected $force; # Force operation protected $model; # AcmeClient model object @@ -154,8 +155,22 @@ public function setCa(string $uuid) $acme_ca = (string)$obj->ca; $this->ca = $acme_ca; + // Extract custom ACME CA URL + $acme_custom_ca = (string)$obj->custom_ca; + $this->custom_ca = $acme_custom_ca; + // Add CA to acme arguments - $this->acme_args[] = LeUtils::execSafe('--server %s', $acme_ca); + if ($acme_ca == "custom") { + // Custom CA + if (empty($acme_custom_ca) || ($acme_custom_ca == null)) { + LeUtils::log_error("custom CA must not be empty."); + return false; + } + $this->acme_args[] = LeUtils::execSafe('--server %s', $acme_custom_ca); + } else { + // Normal CAs + $this->acme_args[] = LeUtils::execSafe('--server %s', $acme_ca); + } // Evaluate how the CA should be represented in filenames. // This is a compatibility layer. It ensures that old files that diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 47d3ba221b..0ec434d228 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -146,8 +146,14 @@ Let's Encrypt Test CA SSL.com ZeroSSL + Custom CA URL + + N + /^https?:\/\/.*[^\/]$/ + The url must be a valid ACME endpoint without a trailing slash. + N /^.{1,8192}$/u From 437d4135494d3d40106de9a07dfd35e13b5fdfde Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 7 Oct 2021 00:17:11 +0200 Subject: [PATCH 0720/3088] security/acme-client: update changelog --- security/acme-client/pkg-descr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index a7dc6c18e2..26febc7e65 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.3 + +Fixed: +* fix ACME Client reset (#2562) + 3.2 Added: From 3c5efa554516848c30ecd84f0da77c9a39d9f5d0 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 7 Oct 2021 00:17:28 +0200 Subject: [PATCH 0721/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index def551fa6b..59f807ac82 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.2 +PLUGIN_VERSION= 3.3 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From 35ae215ebe27df34f62dd493a709d6ded56eb014 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 7 Oct 2021 01:01:17 +0200 Subject: [PATCH 0722/3088] security/acme-client: hide custom CA URL field when not required, refs #2529 --- .../OPNsense/AcmeClient/forms/dialogAccount.xml | 7 ++++++- .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 2 +- .../mvc/app/views/OPNsense/AcmeClient/accounts.volt | 10 ++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAccount.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAccount.xml index c19bff4f86..0b91393082 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAccount.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAccount.xml @@ -33,9 +33,14 @@ dropdown acme.sh documentation for a list of supported CAs.]]> + + + header + + account.custom_ca - + text diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 0ec434d228..0ae3d67208 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -152,7 +152,7 @@ N /^https?:\/\/.*[^\/]$/ - The url must be a valid ACME endpoint without a trailing slash. + The URL must be a valid ACME endpoint without a trailing slash. N diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt index dfa7eb6cf1..d9e417ebde 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt @@ -317,6 +317,16 @@ POSSIBILITY OF SUCH DAMAGE. }); + // hook into on-show event for dialog to extend layout. + $('#DialogAccount').on('shown.bs.modal', function (e) { + // hide options that are irrelevant for the selected CA + $("#account\\.ca").change(function(){ + $(".ca_options").hide(); + $(".ca_options_"+$(this).val()).show(); + }); + $("#account\\.ca").change(); + }) + }); From 85997b73ebde8534d901aa3ebacc99d65a76aeb3 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 7 Oct 2021 01:02:20 +0200 Subject: [PATCH 0723/3088] security/acme-client: update changelog --- security/acme-client/pkg-descr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 26febc7e65..bf40e15c90 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -10,6 +10,9 @@ Plugin Changelog 3.3 +Added: +* add support for custom ACME CAs (#2529) + Fixed: * fix ACME Client reset (#2562) From 962a63310f60661dbf2b7a380e5f8e6e256a9712 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 7 Oct 2021 23:40:08 +0200 Subject: [PATCH 0724/3088] net/haproxy: deploy haproxy.conf if it does not exist, fixes #2474 --- net/haproxy/pkg-descr | 6 ++++++ net/haproxy/src/etc/rc.syshook.d/start/50-haproxy | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100755 net/haproxy/src/etc/rc.syshook.d/start/50-haproxy diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index c4e4ba9013..0b23647bff 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -11,6 +11,12 @@ Plugin Changelog Added: * add support for advanced resolver properties (#2330) +Fixed: +* no haproxy.conf after restoring a config backup (#2474) + +Changed: +* deploy haproxy.conf if it does not exist (#2474) + 3.5 Fixed: diff --git a/net/haproxy/src/etc/rc.syshook.d/start/50-haproxy b/net/haproxy/src/etc/rc.syshook.d/start/50-haproxy new file mode 100755 index 0000000000..09c0e0ef1f --- /dev/null +++ b/net/haproxy/src/etc/rc.syshook.d/start/50-haproxy @@ -0,0 +1,7 @@ +#!/bin/sh + +# fallback if no config file exists (i.e. after config backup restore) +if [ ! -e /usr/local/etc/haproxy.conf -a -e /usr/local/etc/haproxy.conf.staging ]; then + cp /usr/local/etc/haproxy.conf.staging /usr/local/etc/haproxy.conf + /usr/local/etc/rc.d/haproxy start +fi From 93b33f05dc9ffd717698748151350aa4dd890696 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 10 Oct 2021 22:35:26 +0200 Subject: [PATCH 0725/3088] security/acme-client: add support for Porkbun API, closes #2561 --- security/acme-client/pkg-descr | 1 + .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsPorkbun.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 9 +++- 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPorkbun.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index bf40e15c90..7479fda315 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -12,6 +12,7 @@ Plugin Changelog Added: * add support for custom ACME CAs (#2529) +* add support for Porkbun API (#2561) Fixed: * fix ACME Client reset (#2562) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 4faa6b778f..2f8e45bd45 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1338,4 +1338,19 @@ text + + + header + + + + validation.dns_porkbun_key + + text + + + validation.dns_porkbun_secret + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPorkbun.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPorkbun.php new file mode 100644 index 0000000000..872b85baf6 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsPorkbun.php @@ -0,0 +1,45 @@ +acme_env['PORKBUN_API_KEY'] = (string)$this->config->dns_porkbun_key; + $this->acme_env['PORKBUN_SECRET_API_KEY'] = (string)$this->config->dns_porkbun_secret; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 0ae3d67208..f5292f5223 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1,6 +1,6 @@ //OPNsense/AcmeClient - 3.0.0 + 3.1.0 A secure ACME Client plugin @@ -454,6 +454,7 @@ OVH, kimsufi, soyoustart and runabove API PowerDNS.com API Plesk XML API + Porkbun API SchlundTech selectel.com / selectel.ru domain API Servercow API v1 @@ -884,6 +885,12 @@ N + + N + + + N + N From dca4c6ea4cd4a3a4ac4b948fbbbb5c68d183814a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 10 Oct 2021 22:40:22 +0200 Subject: [PATCH 0726/3088] security/acme-client: change default Challenge Type from HTTP-01 to DNS-01 --- security/acme-client/pkg-descr | 3 +++ .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 7479fda315..304aa75090 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -17,6 +17,9 @@ Added: Fixed: * fix ACME Client reset (#2562) +Changed: +* change default Challenge Type from HTTP-01 to DNS-01 + 3.2 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index f5292f5223..5bac98072a 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -335,7 +335,7 @@ Y - http01 + dns01 HTTP-01 DNS-01 @@ -386,7 +386,7 @@ Y - dns_nsupdate + dns_freedns 1984Hosting API ACME DNS API From b95b508b0a4ebb2ed572f11f48190fdea89a97f1 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 10 Oct 2021 23:34:03 +0200 Subject: [PATCH 0727/3088] emulators/qemu-guest-agent: load required kernel module, fixes #2405 --- emulators/qemu-guest-agent/pkg-descr | 13 ++++++++++++- .../src/etc/rc.syshook.d/early/50-qemu-guest-agent | 9 +++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 emulators/qemu-guest-agent/src/etc/rc.syshook.d/early/50-qemu-guest-agent diff --git a/emulators/qemu-guest-agent/pkg-descr b/emulators/qemu-guest-agent/pkg-descr index 2ff6915607..12375095f5 100644 --- a/emulators/qemu-guest-agent/pkg-descr +++ b/emulators/qemu-guest-agent/pkg-descr @@ -1,5 +1,16 @@ QEMU Guest Agent for FreeBSD Port homepage https://github.com/aborche/qemu-guest-agent - WWW: http://wiki.qemu.org/Main_Page + +Plugin Changelog +================ + +1.1 + +Fixed: +* fix service startup by loading required kernel module (#2405) + +1.0 + +* Initial release diff --git a/emulators/qemu-guest-agent/src/etc/rc.syshook.d/early/50-qemu-guest-agent b/emulators/qemu-guest-agent/src/etc/rc.syshook.d/early/50-qemu-guest-agent new file mode 100755 index 0000000000..eb8cdd80b7 --- /dev/null +++ b/emulators/qemu-guest-agent/src/etc/rc.syshook.d/early/50-qemu-guest-agent @@ -0,0 +1,9 @@ +#!/bin/sh + +if kldstat -qn virtio_console.ko; then + echo "qemu-guest-agent: virtio_console already loaded." +elif kldload -q virtio_console.ko; then + echo "qemu-guest-agent: successfully loaded virtio_console." +else + echo "qemu-guest-agent: failed to load virtio_console." +fi From b928ca2f738b1e471a07c6ad5ed3f5a8e817d90a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 10 Oct 2021 23:39:29 +0200 Subject: [PATCH 0728/3088] emulators/qemu-guest-agent: bump version --- emulators/qemu-guest-agent/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emulators/qemu-guest-agent/Makefile b/emulators/qemu-guest-agent/Makefile index 3e56e911f8..ff879738bc 100644 --- a/emulators/qemu-guest-agent/Makefile +++ b/emulators/qemu-guest-agent/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= qemu-guest-agent -PLUGIN_VERSION= 1.0 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= QEMU Guest Agent for OPNsense PLUGIN_DEPENDS= qemu-guest-agent PLUGIN_MAINTAINER= opnsense@moov.de From c1fa3752bf8b072eda231f98eb263227c04df84f Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Mon, 11 Oct 2021 10:20:22 +0200 Subject: [PATCH 0729/3088] Release puppet-agent version 1.0 --- sysutils/puppet-agent/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sysutils/puppet-agent/Makefile b/sysutils/puppet-agent/Makefile index 7e1977c2a1..712b01e4fd 100644 --- a/sysutils/puppet-agent/Makefile +++ b/sysutils/puppet-agent/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= puppet-agent -PLUGIN_VERSION= 0.2 -PLUGIN_DEVEL= yes +PLUGIN_VERSION= 1.0 PLUGIN_COMMENT= Manage Puppet Agent PLUGIN_DEPENDS= puppet7 py${PLUGIN_PYTHON}-opn-cli PLUGIN_MAINTAINER= jan.wink93@gmail.com From f57a538c7f78799215362b32e0b5d26a30784f9d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 11 Oct 2021 12:24:55 +0200 Subject: [PATCH 0730/3088] Framework: use parallel lint if available via core --- Mk/plugins.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 1502ab8c66..ac715b3ecf 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -314,7 +314,12 @@ lint-exec: check .endif .endfor +LINTBIN?= ${.CURDIR}/../../../core/contrib/parallel-lint/parallel-lint + lint-php: check +.if exists(${LINTBIN}) + @if [ -d ${.CURDIR}/src ]; then ${LINTBIN} src; fi +.else @find ${.CURDIR}/src \ ! -name "*.xml" ! -name "*.xml.sample" ! -name "*.eot" \ ! -name "*.svg" ! -name "*.woff" ! -name "*.woff2" \ @@ -322,6 +327,7 @@ lint-php: check ! -name "*.scss" ! -name "*.py" ! -name "*.ttf" ! -name "*.txz" \ ! -name "*.tgz" ! -name "*.xml.dist" ! -name "*.sh" ! -name "bootstrap80.php" \ -type f -print0 | xargs -0 -n1 php -l +.endif lint: lint-desc lint-shell lint-xml lint-exec lint-php From ec9b1025649bc8dfee2b264dbf4606e820e0b95b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 11 Oct 2021 12:29:37 +0200 Subject: [PATCH 0731/3088] www/nginx: style sweep --- .../app/controllers/OPNsense/Nginx/Api/ServiceController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/ServiceController.php b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/ServiceController.php index 4588f6c6f5..cfc2459896 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/ServiceController.php +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/ServiceController.php @@ -97,7 +97,8 @@ public function vtsAction() return array(); } - protected function reconfigureForceRestart() { + protected function reconfigureForceRestart() + { return 0; } } From f2980f917851c8c6512ecd7afac6e3a981c5f707 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 11 Oct 2021 23:43:50 +0200 Subject: [PATCH 0732/3088] sysutils/puppet-agent: add log file --- sysutils/puppet-agent/pkg-descr | 12 +++++ .../models/OPNsense/PuppetAgent/Menu/Menu.xml | 5 +- .../OPNsense/PuppetAgent/PuppetAgent.xml | 5 +- .../systemhealth/logformats/puppet_agent.py | 50 +++++++++++++++++++ .../templates/OPNsense/PuppetAgent/+TARGETS | 1 + .../OPNsense/PuppetAgent/newsyslog.conf | 4 ++ .../OPNsense/PuppetAgent/puppetagent.conf | 1 + 7 files changed, 74 insertions(+), 4 deletions(-) create mode 100755 sysutils/puppet-agent/src/opnsense/scripts/systemhealth/logformats/puppet_agent.py create mode 100644 sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/newsyslog.conf diff --git a/sysutils/puppet-agent/pkg-descr b/sysutils/puppet-agent/pkg-descr index ed77366165..959369790f 100644 --- a/sysutils/puppet-agent/pkg-descr +++ b/sysutils/puppet-agent/pkg-descr @@ -5,3 +5,15 @@ hosts, along with obviously discrete elements like packages, services, and files. WWW: https://puppet.com/docs/puppet/latest/man/agent.html + +Plugin Changelog +================ + +1.0 + +Added: +* add log file + +0.1 + +* Initial release diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/Menu/Menu.xml b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/Menu/Menu.xml index e0c6f69d70..d989bfc18f 100644 --- a/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/Menu/Menu.xml +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/Menu/Menu.xml @@ -1,5 +1,8 @@ - + + + + diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.xml b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.xml index 100aeeeb0f..f706d65a59 100644 --- a/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.xml +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/models/OPNsense/PuppetAgent/PuppetAgent.xml @@ -1,8 +1,7 @@ //OPNsense/puppetagent - - Manage Puppet Agent service - + 1.0.0 + Manage Puppet Agent service diff --git a/sysutils/puppet-agent/src/opnsense/scripts/systemhealth/logformats/puppet_agent.py b/sysutils/puppet-agent/src/opnsense/scripts/systemhealth/logformats/puppet_agent.py new file mode 100755 index 0000000000..a4013e9ed8 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/scripts/systemhealth/logformats/puppet_agent.py @@ -0,0 +1,50 @@ +""" + Copyright (c) 2021 Frank Wall + Copyright (c) 2020 Ad Schellevis + Copyright (c) 2020 devNan0 + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import re +import datetime +from . import BaseLogFormat +puppet_timeformat = r'^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\s+[-+]{1}\d{4}).*' + + +class TelegrafLogFormat(BaseLogFormat): + def __init__(self, filename): + super(TelegrafLogFormat, self).__init__(filename) + self._priority = 100 + + def match(self, line): + return self._filename.find('puppet') > -1 and re.match(puppet_timeformat, line) is not None + + @staticmethod + def timestamp(line): + tmp = re.match(puppet_timeformat, line) + grp = tmp.group(1) + return datetime.datetime.strptime(grp, "%Y-%m-%d %H:%M:%S %z").isoformat() + + @staticmethod + def line(line): + return line[26:].strip() diff --git a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/+TARGETS b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/+TARGETS index 085fa8c75b..c34b302bbf 100644 --- a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/+TARGETS +++ b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/+TARGETS @@ -1,2 +1,3 @@ puppetagent.conf:/usr/local/etc/puppet/puppet.conf +newsyslog.conf:/etc/newsyslog.conf.d/puppet-agent rc.conf.d:/etc/rc.conf.d/puppet diff --git a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/newsyslog.conf b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/newsyslog.conf new file mode 100644 index 0000000000..190ea6a8f6 --- /dev/null +++ b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/newsyslog.conf @@ -0,0 +1,4 @@ +{% if helpers.exists('OPNsense.puppetagent.general') and OPNsense.puppetagent.general.Enabled|default("0") == "1" %} +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +/var/log/puppet-agent.log puppet:puppet 640 7 * @T00 JCB /var/run/puppet/agent.pid 1 +{% endif %} diff --git a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf index 3da8f402e0..c375941a97 100644 --- a/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf +++ b/sysutils/puppet-agent/src/opnsense/service/templates/OPNsense/PuppetAgent/puppetagent.conf @@ -2,6 +2,7 @@ [main] certname = {{ system.hostname|lower }}.{{ system.domain|lower }} server = {{ OPNsense.puppetagent.general.FQDN|default("") }} +logdest = /var/log/puppet-agent.log {% if helpers.exists('OPNsense.puppetagent.general') and not helpers.empty('OPNsense.puppetagent.general.Environment') %} [agent] environment = {{ OPNsense.puppetagent.general.Environment|default("") }} From b7c4afa7afb95a0637d369df9a8f3e77834106cc Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 12 Oct 2021 00:16:48 +0200 Subject: [PATCH 0733/3088] sysutils/puppet-agent: add introduction page --- sysutils/puppet-agent/pkg-descr | 1 + .../app/views/OPNsense/PuppetAgent/index.volt | 47 ++++++++++++++----- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/sysutils/puppet-agent/pkg-descr b/sysutils/puppet-agent/pkg-descr index 959369790f..64ec7afe9d 100644 --- a/sysutils/puppet-agent/pkg-descr +++ b/sysutils/puppet-agent/pkg-descr @@ -13,6 +13,7 @@ Plugin Changelog Added: * add log file +* add introduction page 0.1 diff --git a/sysutils/puppet-agent/src/opnsense/mvc/app/views/OPNsense/PuppetAgent/index.volt b/sysutils/puppet-agent/src/opnsense/mvc/app/views/OPNsense/PuppetAgent/index.volt index 10b93ddf76..7e0d533c56 100644 --- a/sysutils/puppet-agent/src/opnsense/mvc/app/views/OPNsense/PuppetAgent/index.volt +++ b/sysutils/puppet-agent/src/opnsense/mvc/app/views/OPNsense/PuppetAgent/index.volt @@ -1,5 +1,6 @@ {# +OPNsense® is Copyright © 2021 Frank Wall OPNsense® is Copyright © 2021 Jan Winkler OPNsense® is Copyright © 2014 – 2015 by Deciso B.V. All rights reserved. @@ -47,20 +48,40 @@ POSSIBILITY OF SUCH DAMAGE. }); - +
      -
      - {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}} -
      +
      +
      +

      {{ lang._('Quick Start Guide') }}

      +

      {{ lang._("Welcome to the Puppet Agent plugin! This plugin allows you to integrate OPNsense with your Puppet environment.") }}

      +

      {{ lang._("Keep in mind that you should not treat OPNsense like any other operating system. Most notably you should not modify system files or packages. Instead use the OPNsense API to make configuration changes and to manage plugins. The following tools are a good starting point when trying to automate OPNsense with Puppet:") }}

      +
        +
      • {{ lang._("%sopn-cli:%s A command line client to configure OPNsense core and plugin components through their respective APIs.") | format('', '') }}
      • +
      • {{ lang._("%spuppet/opnsense:%s A read-to-use Puppet module for automating the OPNsense firewall.") | format('', '') }}
      • +
      +

      {{ lang._("Note that these tools are not directly related to this plugin. Please report issues and missing features directly to the author.") }}

      +
      +
      + +
      + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}} + +
      +
      + +
      +
      +
      -
      -
      From 24be98dc0777350d3185ce870b6a7f489ad02e9c Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 12 Oct 2021 10:56:39 +0200 Subject: [PATCH 0734/3088] sysutils/puppet-agent: fix logformat --- .../opnsense/scripts/systemhealth/logformats/puppet_agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysutils/puppet-agent/src/opnsense/scripts/systemhealth/logformats/puppet_agent.py b/sysutils/puppet-agent/src/opnsense/scripts/systemhealth/logformats/puppet_agent.py index a4013e9ed8..7004c40d25 100755 --- a/sysutils/puppet-agent/src/opnsense/scripts/systemhealth/logformats/puppet_agent.py +++ b/sysutils/puppet-agent/src/opnsense/scripts/systemhealth/logformats/puppet_agent.py @@ -31,9 +31,9 @@ puppet_timeformat = r'^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\s+[-+]{1}\d{4}).*' -class TelegrafLogFormat(BaseLogFormat): +class PuppetLogFormat(BaseLogFormat): def __init__(self, filename): - super(TelegrafLogFormat, self).__init__(filename) + super(PuppetLogFormat, self).__init__(filename) self._priority = 100 def match(self, line): From fc773e6a1a9732513a8adb24386b63d3cf387756 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 12 Oct 2021 11:35:48 +0200 Subject: [PATCH 0735/3088] README: sync --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8850cdfac8..9bc15ce244 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ sysutils/munin-node -- Munin monitoring agent sysutils/nextcloud-backup -- Track config changes using NextCloud sysutils/node_exporter -- Prometheus exporter for machine metrics sysutils/nut -- Network UPS Tools -sysutils/puppet-agent -- Manage Puppet Agent (development only) +sysutils/puppet-agent -- Manage Puppet Agent sysutils/smart -- SMART tools sysutils/virtualbox -- VirtualBox guest additions sysutils/vmware -- VMware tools From ca805ea20df7869276327277f83ab9a373579638 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 13 Oct 2021 23:03:44 +0200 Subject: [PATCH 0736/3088] net/haproxy: add hard-stop-after to ensure proper service restart/shutdown --- net/haproxy/pkg-descr | 2 ++ .../OPNsense/HAProxy/forms/generalSettings.xml | 6 ++++++ .../opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 8 +++++++- .../service/templates/OPNsense/HAProxy/haproxy.conf | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 0b23647bff..aa184412f3 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -10,12 +10,14 @@ Plugin Changelog Added: * add support for advanced resolver properties (#2330) +* add graceful stop timeout to service settings Fixed: * no haproxy.conf after restoring a config backup (#2474) Changed: * deploy haproxy.conf if it does not exist (#2474) +* add new timeout (60s) which will terminate open connections when using graceful stop 3.5 diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml index d0efde12b2..aa3f791ff0 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalSettings.xml @@ -15,6 +15,12 @@ checkbox + + haproxy.general.hardStopAfter + + text + + haproxy.general.seamlessReload diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 15b3ce18e9..b6c025d915 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 3.1.0 + 3.2.0 the HAProxy load balancer @@ -12,6 +12,12 @@ 0 Y + + 60s + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + 0 Y diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 7b40fbd6a2..71c439df13 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -859,6 +859,9 @@ global {% endif %} {% endfor %} {% endif %} +{% if OPNsense.HAProxy.general.hardStopAfter|default('') != '' %} + hard-stop-after {{OPNsense.HAProxy.general.hardStopAfter}} +{% endif %} {% if helpers.exists('OPNsense.HAProxy.general.tuning.maxConnections') %} maxconn {{OPNsense.HAProxy.general.tuning.maxConnections}} {% endif %} From d483eeba702e52c2687a7d3464a02159194a176f Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 13 Oct 2021 23:57:38 +0200 Subject: [PATCH 0737/3088] net/haproxy: support "monitor-uri" and "monitor fail" in rules, closes #2387 --- net/haproxy/pkg-descr | 1 + .../OPNsense/HAProxy/forms/dialogAction.xml | 11 +++++++++++ .../mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 5 +++++ .../service/templates/OPNsense/HAProxy/haproxy.conf | 8 ++++++++ 4 files changed, 25 insertions(+) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index aa184412f3..3b578b24bc 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -11,6 +11,7 @@ Plugin Changelog Added: * add support for advanced resolver properties (#2330) * add graceful stop timeout to service settings +* support "monitor-uri" and "monitor fail" in rules (#2387) Fixed: * no haproxy.conf after restoring a config backup (#2474) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml index 1e86836371..f0d17e77e2 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml @@ -354,6 +354,17 @@ text + + + header + + + + action.monitor_fail_uri + + text + + header diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index b6c025d915..8521443feb 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -2068,6 +2068,7 @@ http-response header replace value http-response set-status http-response set-var + monitor fail: report failure to a monitor request tcp-request connection accept tcp-request connection reject tcp-request content accept @@ -2252,6 +2253,10 @@ /^.{1,4096}$/u N + + /^.{1,4096}$/u + N + /^.{1,4096}$/u N diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 71c439df13..15dc3f76e7 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -522,6 +522,14 @@ {% set action_enabled = '0' %} # ERROR: missing parameters {% endif %} +{% elif action_data.type == 'monitor_fail' %} +{% if action_data.monitor_fail_uri|default("") != "" %} +{% do action_options.append('monitor-uri ' ~ action_data.monitor_fail_uri ~ '\n ') %} +{% do action_options.append('monitor fail') %} +{% else %} +{% set action_enabled = '0' %} + # ERROR: missing parameters +{% endif %} {% elif action_data.type == 'tcp-request_connection_accept' %} {% do action_options.append('tcp-request connection accept') %} {% elif action_data.type == 'tcp-request_connection_reject' %} From 7a0aeeba68f092e732ca6b598fc43f52a88a8c31 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 17 Oct 2021 21:42:56 +0200 Subject: [PATCH 0738/3088] net/haproxy: allow retries to be set to "0", closes #2585 --- net/haproxy/pkg-descr | 1 + .../src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 3b578b24bc..c20f334be9 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -19,6 +19,7 @@ Fixed: Changed: * deploy haproxy.conf if it does not exist (#2474) * add new timeout (60s) which will terminate open connections when using graceful stop +* allow retries to be set to "0" (#2585) 3.5 diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 8521443feb..5f7d9db7b7 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -223,7 +223,7 @@ N - 1 + 0 100 3 Please specify a value between 1 and 100. @@ -1143,7 +1143,7 @@ N - 1 + 0 100 Please specify a value between 1 and 100. N From 0c40837f1f5b4ecc2767d7693bf6248440728c47 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 17 Oct 2021 22:15:42 +0200 Subject: [PATCH 0739/3088] net/haproxy: add new option "case-sensitive" to conditions, closes #2576 --- net/haproxy/pkg-descr | 1 + .../OPNsense/HAProxy/forms/dialogAcl.xml | 6 + .../app/models/OPNsense/HAProxy/HAProxy.xml | 4 + .../templates/OPNsense/HAProxy/haproxy.conf | 132 +++++++++++++++--- 4 files changed, 121 insertions(+), 22 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index c20f334be9..5cba9c35d3 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -12,6 +12,7 @@ Added: * add support for advanced resolver properties (#2330) * add graceful stop timeout to service settings * support "monitor-uri" and "monitor fail" in rules (#2387) +* add new option "case-sensitive" to conditions (#2576) Fixed: * no haproxy.conf after restoring a config backup (#2474) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml index 3d5bb47cd4..4643f99a87 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAcl.xml @@ -27,6 +27,12 @@ checkbox + + acl.caseSensitive + + checkbox + + header diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 5f7d9db7b7..f1b2e2f039 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1585,6 +1585,10 @@ 0 Y + + 0 + N + /^.{1,255}$/u Should be a string between 1 and 255 characters. diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 15dc3f76e7..7d11f3df99 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -83,119 +83,187 @@ {% endif %} {% elif acl_data.expression == 'hdr_beg' %} {% if acl_data.hdr_beg|default("") != "" %} -{% do acl_options.append('hdr_beg(host) -i ' ~ acl_data.hdr_beg) %} +{% do acl_options.append('hdr_beg(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.hdr_beg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr_end' %} {% if acl_data.hdr_end|default("") != "" %} -{% do acl_options.append('hdr_end(host) -i ' ~ acl_data.hdr_end) %} +{% do acl_options.append('hdr_end(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.hdr_end) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr' %} {% if acl_data.hdr|default("") != "" %} -{% do acl_options.append('hdr(host) -i ' ~ acl_data.hdr) %} +{% do acl_options.append('hdr(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.hdr) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr_reg' %} {% if acl_data.hdr_reg|default("") != "" %} -{% do acl_options.append('hdr_reg(host) -i ' ~ acl_data.hdr_reg) %} +{% do acl_options.append('hdr_reg(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.hdr_reg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'hdr_sub' %} {% if acl_data.hdr_sub|default("") != "" %} -{% do acl_options.append('hdr_sub(host) -i ' ~ acl_data.hdr_sub) %} +{% do acl_options.append('hdr_sub(host)') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append('acl_data.hdr_sub) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_beg' %} {% if acl_data.path_beg|default("") != "" %} -{% do acl_options.append('path_beg -i ' ~ acl_data.path_beg) %} +{% do acl_options.append('path_beg') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.path_beg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_end' %} {% if acl_data.path_end|default("") != "" %} -{% do acl_options.append('path_end -i ' ~ acl_data.path_end) %} +{% do acl_options.append('path_end') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.path_end) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path' %} {% if acl_data.path|default("") != "" %} -{% do acl_options.append('path -i ' ~ acl_data.path) %} +{% do acl_options.append('path') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.path) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_reg' %} {% if acl_data.path_reg|default("") != "" %} -{% do acl_options.append('path_reg -i ' ~ acl_data.path_reg) %} +{% do acl_options.append('path_reg') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.path_reg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_dir' %} {% if acl_data.path_dur|default("") != "" %} -{% do acl_options.append('path_dir -i ' ~ acl_data.path_dir) %} +{% do acl_options.append('path_dir') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.path_dir) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'path_sub' %} {% if acl_data.path_sub|default("") != "" %} -{% do acl_options.append('path_sub -i ' ~ acl_data.path_sub) %} +{% do acl_options.append('path_sub') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.path_sub) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'cust_hdr_beg' %} {% if acl_data.cust_hdr_beg|default("") != "" and acl_data.cust_hdr_beg_name|default("") != "" %} -{% do acl_options.append('hdr_beg(' ~ acl_data.cust_hdr_beg_name ~ ') -i ' ~ acl_data.cust_hdr_beg) %} +{% do acl_options.append('hdr_beg(' ~ acl_data.cust_hdr_beg_name ~ ')') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.cust_hdr_beg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'cust_hdr_end' %} {% if acl_data.cust_hdr_end|default("") != "" and acl_data.cust_hdr_end_name|default("") %} -{% do acl_options.append('hdr_end(' ~ acl_data.cust_hdr_end_name ~ ') -i ' ~ acl_data.cust_hdr_end) %} +{% do acl_options.append('hdr_end(' ~ acl_data.cust_hdr_end_name ~ ')') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.cust_hdr_end) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'cust_hdr' %} {% if acl_data.cust_hdr|default("") != "" and acl_data.cust_hdr_name|default("") != "" %} -{% do acl_options.append('hdr(' ~ acl_data.cust_hdr_name ~ ') -i ' ~ acl_data.cust_hdr) %} +{% do acl_options.append('hdr(' ~ acl_data.cust_hdr_name ~ ')') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.cust_hdr) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'cust_hdr_reg' %} {% if acl_data.cust_hdr_reg|default("") != "" and acl_data.cust_hdr_reg_name|default("") != "" %} -{% do acl_options.append('hdr_reg(' ~ acl_data.cust_hdr_reg_name ~ ') -i ' ~ acl_data.cust_hdr_reg) %} +{% do acl_options.append('hdr_reg(' ~ acl_data.cust_hdr_reg_name ~ ')') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.cust_hdr_reg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'cust_hdr_sub' %} {% if acl_data.cust_hdr_sub|default("") != "" and acl_data.cust_hdr_sub_name|default("") != "" %} -{% do acl_options.append('hdr_sub(' ~ acl_data.cust_hdr_sub_name ~ ') -i ' ~ acl_data.cust_hdr_sub) %} +{% do acl_options.append('hdr_sub(' ~ acl_data.cust_hdr_sub_name ~ ')') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.cust_hdr_sub) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'url_param' %} {% if acl_data.url_param_value|default("") != "" and acl_data.url_param|default("") != "" %} -{% do acl_options.append('url_param(' ~ acl_data.url_param ~ ') -i ' ~ acl_data.url_param_value) %} +{% do acl_options.append('url_param(' ~ acl_data.url_param ~ ')') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.url_param_value) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters @@ -281,35 +349,55 @@ {% endif %} {% elif acl_data.expression == 'ssl_sni' %} {% if acl_data.ssl_sni|default("") != "" %} -{% do acl_options.append('req.ssl_sni -i ' ~ acl_data.ssl_sni) %} +{% do acl_options.append('req.ssl_sni') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.ssl_sni) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'ssl_sni_sub' %} {% if acl_data.ssl_sni_sub|default("") != "" %} -{% do acl_options.append('req.ssl_sni -m sub -i ' ~ acl_data.ssl_sni_sub) %} +{% do acl_options.append('req.ssl_sni -m sub') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.ssl_sni_sub) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'ssl_sni_beg' %} {% if acl_data.ssl_sni_beg|default("") != "" %} -{% do acl_options.append('req.ssl_sni -m beg -i ' ~ acl_data.ssl_sni_beg) %} +{% do acl_options.append('req.ssl_sni -m beg') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.ssl_sni_beg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'ssl_sni_end' %} {% if acl_data.ssl_sni_end|default("") != "" %} -{% do acl_options.append('req.ssl_sni -m end -i ' ~ acl_data.ssl_sni_end) %} +{% do acl_options.append('req.ssl_sni -m end') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.ssl_sni_end) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters {% endif %} {% elif acl_data.expression == 'ssl_sni_reg' %} {% if acl_data.ssl_sni_reg|default("") != "" %} -{% do acl_options.append('req.ssl_sni -m reg -i ' ~ acl_data.ssl_sni_reg) %} +{% do acl_options.append('req.ssl_sni -m reg') %} +{% if acl_data.caseSensitive|default('0') == '0' %} +{% do acl_options.append('-i') %} +{% endif %} +{% do acl_options.append(acl_data.ssl_sni_reg) %} {% else %} {% set acl_enabled = '0' %} # ERROR: missing parameters From 24c5c1ef0851de639ac5f542c32efe02ec69a816 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 18 Oct 2021 10:18:57 +0200 Subject: [PATCH 0740/3088] www/nginx: setup.sh is overloaded with runtime data #2581 --- .../src/opnsense/service/conf/actions.d/actions_nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf b/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf index 8b7d4ebdcd..70bf433875 100644 --- a/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf +++ b/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf @@ -62,7 +62,7 @@ parameters: type:script_output [reload] -command:/usr/local/etc/rc.d/nginx reload +command:/usr/local/opnsense/scripts/nginx/setup.php;/usr/local/etc/rc.d/nginx reload parameters: type:script_output message:reloading nginx From 50e70f8fe67726e3ccf6422e7e86d44ee9ceedaa Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 19 Oct 2021 10:26:27 +0200 Subject: [PATCH 0741/3088] net/haproxy: adjust validation message, refs #2585 --- .../src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index f1b2e2f039..7eaa7c3dda 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -226,7 +226,7 @@ 0 100 3 - Please specify a value between 1 and 100. + Please specify a value between 0 and 100. Y @@ -1145,7 +1145,7 @@ 0 100 - Please specify a value between 1 and 100. + Please specify a value between 0 and 100. N From 72bbdc16af0213d5573f81d74b59f87cc7da8360 Mon Sep 17 00:00:00 2001 From: Jan Wiesemann Date: Tue, 19 Oct 2021 15:12:15 +0200 Subject: [PATCH 0742/3088] Added STRATO IPv6 to DynDNS (#2567) --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc | 1 + .../src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index 09ad91469e..476cc286d5 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -151,6 +151,7 @@ function dyndns_list() 'route53-v6' => 'Route 53 (v6)', 'selfhost' => 'SelfHost', 'strato' => 'STRATO', + 'strato-v6' => 'STRATO (v6)', 'zoneedit' => 'ZoneEdit', ); } diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 6eb12fe704..aeef52eef6 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -50,7 +50,8 @@ * No-IP - Last Tested: 15 May 2020 * ODS - Last Tested: 02 August 2005 * Oray - Last Tested: 26 May 2017 - * STRATO - Last Tested: 09 May 2017 + * STRATO - Last Tested: 08 October 2021 + * STRATO V6 - Last Tested: 08 October 2021 * SelfHost - Last Tested: 26 December 2011 * StaticCling - Last Tested: 27 April 2006 * deSEC - Last Tested: 09 September 2020 @@ -260,6 +261,7 @@ class updatedns case 'desec-v4-v6': case 'desec-v6': case 'hetzner-v6': + case 'strato-v6': $this->_useIPv6 = true; break; default: @@ -358,6 +360,7 @@ class updatedns case 'selfhost': case 'staticcling': case 'strato': + case 'strato-v6': case 'zoneedit': $this->_update(); if ($this->_dnsDummyUpdateDone == true) { @@ -1019,11 +1022,14 @@ class updatedns curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); break; case 'strato': + case 'strato-v6': $server = "https://dyndns.strato.com/nic/update?hostname={$this->_dnsHost}&myip={$this->_dnsIP}"; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass); curl_setopt($ch, CURLOPT_URL, $server); - curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + if ($this->_curlIpresolveV4) { + curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + } break; case '3322': $server = "http://members.3322.net/dyndns/update?hostname={$this->_dnsHost}&myip={$this->_dnsIP}"; @@ -1651,6 +1657,7 @@ class updatedns case 'ovh-dynhost': case 'selfhost': case 'strato': + case 'strato-v6': if (preg_match('/notfqdn/i', $data)) { $status = "Dynamic DNS: (Error) Not a FQDN"; } elseif (preg_match('/nochg/i', $data)) { From 13fb7d7d01ed18b974366512858ed5ee0e5d9210 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 Oct 2021 15:13:41 +0200 Subject: [PATCH 0743/3088] dns/dyndns: new changes coming up --- dns/dyndns/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index e503a65620..3226022b7e 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= dyndns -PLUGIN_VERSION= 1.24 -PLUGIN_REVISION= 3 +PLUGIN_VERSION= 1.25 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org From 35c1324a4a7f34a257dba4a6c44f1874ca73039f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 19 Oct 2021 15:14:59 +0200 Subject: [PATCH 0744/3088] www/c-icap: Fix logging due to Phalcon4 update (#2528) --- www/c-icap/Makefile | 2 +- .../src/opnsense/mvc/app/models/OPNsense/CICAP/Menu/Menu.xml | 2 +- www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/www/c-icap/Makefile b/www/c-icap/Makefile index 4d7407750a..9f1fe36abe 100644 --- a/www/c-icap/Makefile +++ b/www/c-icap/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= c-icap PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= c-icap connects the web proxy with a virus scanner PLUGIN_DEPENDS= c-icap c-icap-modules PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Menu/Menu.xml b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Menu/Menu.xml index 3def2f275a..326a689d0b 100644 --- a/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Menu/Menu.xml +++ b/www/c-icap/src/opnsense/mvc/app/models/OPNsense/CICAP/Menu/Menu.xml @@ -2,7 +2,7 @@ - + diff --git a/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh b/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh index d9bc156779..8e29386a1a 100755 --- a/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh +++ b/www/c-icap/src/opnsense/scripts/OPNsense/CICAP/setup.sh @@ -7,6 +7,8 @@ chmod 750 /var/run/c-icap mkdir -p /var/log/c-icap chown -R c_icap:c_icap /var/log/c-icap chmod 750 /var/log/c-icap +(cd /var/log && ln -s c-icap cicap) +chown -R c_icap:c_icap /var/log/cicap mkdir -p /tmp/c-icap/templates/virus_scan/en chmod -R 755 /tmp/c-icap/ From 46ca70a2249d377a74e328a00e984fc4dbeae1b7 Mon Sep 17 00:00:00 2001 From: DeepCoreSystem Date: Tue, 19 Oct 2021 15:19:32 +0200 Subject: [PATCH 0745/3088] Make regfish DynDNS work for IPv4 and IPv6 (#2531) regfish requires 2 different URIs to update, depending on the IP family. https://dyndns.regfish.de is for IPv4 and https://dyndns6.regfish.de is for IPv6. --- dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index aeef52eef6..efaa71bf07 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -1044,9 +1044,11 @@ class updatedns curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); break; case 'regfish': + $server = "https://dyndns.regfish.de/?fqdn={$this->_dnsHost}&ipv4={$this->_dnsIP}&forcehost=1&token=" . urlencode($this->_dnsUser); + curl_setopt($ch, CURLOPT_URL, $server); + break; case 'regfish-v6': - $family = $this->_useIPv6 ? 'ipv6' : 'ipv4'; - $server = "https://dyndns.regfish.de/?fqdn={$this->_dnsHost}&{$family}={$this->_dnsIP}&forcehost=1&token=" . urlencode($this->_dnsUser); + $server = "https://dyndns6.regfish.de/?fqdn={$this->_dnsHost}&ipv6={$this->_dnsIP}&forcehost=1&token=" . urlencode($this->_dnsUser); curl_setopt($ch, CURLOPT_URL, $server); break; case 'linode': From 9a7cc4dcf9599b599ce1cb206b278679e1be03b8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 Oct 2021 15:20:54 +0200 Subject: [PATCH 0746/3088] dns/dyndns: sort this case block --- .../src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index efaa71bf07..3e21cbdaef 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -248,19 +248,19 @@ class updatedns switch ($dnsService) { case 'all-inkl-v6': case 'azurev6': + case 'cloudflare-token-v6': case 'cloudflare-v6': case 'custom-v6': + case 'desec-v4-v6': + case 'desec-v6': case 'digitalocean-v6': case 'dynv6-v6': - case 'he-net-v6': case 'godaddy-v6': + case 'he-net-v6': + case 'hetzner-v6': case 'linode-v6': case 'regfish-v6': case 'route53-v6': - case 'cloudflare-token-v6': - case 'desec-v4-v6': - case 'desec-v6': - case 'hetzner-v6': case 'strato-v6': $this->_useIPv6 = true; break; From 526e2710e59fb358ab68ea639435d415476e1f34 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 Oct 2021 15:23:56 +0200 Subject: [PATCH 0747/3088] dns/dyndns: accept wildcard entry for hetzner; closes #2406 --- dns/dyndns/src/www/services_dyndns_edit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index 2ced127821..eef3911212 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -113,9 +113,9 @@ function is_dyndns_username($uname) switch ($pconfig['type']) { case 'cloudflare': - case 'cloudflare-v6': case 'cloudflare-token': case 'cloudflare-token-v6': + case 'cloudflare-v6': case 'desec': case 'desec-v4-v6': case 'desec-v6': @@ -123,6 +123,8 @@ function is_dyndns_username($uname) case 'godaddy': case 'godaddy-v6': case 'googledomains': + case 'hetzner': + case 'hetzner-v6': case 'linode': case 'linode-v6': case 'namecheap': From 302826f561b187780c770fad20e9886bdfe62f6d Mon Sep 17 00:00:00 2001 From: Martin Wasley Date: Thu, 21 Oct 2021 13:48:19 +0100 Subject: [PATCH 0748/3088] Override colour given in the vpn_ipsec.php file (#1999) Override colour given in the vpn_ipsec.php file --- .../www/themes/rebellion/assets/stylesheets/main.scss | 5 +++++ .../src/opnsense/www/themes/rebellion/build/css/main.css | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss index 92c6f2deee..f9b9179fa0 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss @@ -9264,3 +9264,8 @@ div.Tokenize ul { .image_invertible { filter: invert(1); } + +.phase1_tr td { + background-color: #282828 !important; +} + diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css index c3520c56a3..caa98b644d 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/main.css @@ -7820,3 +7820,7 @@ div.Tokenize ul.TokensContainer li.Token a.Close { .image_invertible { filter: invert(1); } + +.phase1_tr td { + background-color: #282828 !important; +} From b95b6c759199a872d63f5d74386cc3da8df38148 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 21 Oct 2021 14:52:10 +0200 Subject: [PATCH 0749/3088] misc/theme-rebellion: bump version --- misc/theme-rebellion/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/theme-rebellion/Makefile b/misc/theme-rebellion/Makefile index d50e43e6e6..b15ab9ea56 100644 --- a/misc/theme-rebellion/Makefile +++ b/misc/theme-rebellion/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= theme-rebellion -PLUGIN_VERSION= 1.8.7 +PLUGIN_VERSION= 1.8.8 PLUGIN_COMMENT= A suitably dark theme PLUGIN_MAINTAINER= team-rebellion@queens-park.com PLUGIN_NO_ABI= yes From fb050b28495f5cd270c140e0c4296cf5b0622faa Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 21 Oct 2021 14:53:21 +0200 Subject: [PATCH 0750/3088] www/nginx: remove obsolete comment --- .../controllers/OPNsense/Nginx/Api/ServiceController.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/ServiceController.php b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/ServiceController.php index cfc2459896..c8a9f280b2 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/ServiceController.php +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/ServiceController.php @@ -50,14 +50,6 @@ public function stopAction() return array('status' => 'failed'); } - - /** - * reconfigure with optional stop, generate config and start / reload - * @return array response message - * @throws \Exception when configd action fails - * @throws \ReflectionException when model can't be instantiated - */ - /** * retrieve status of service * @return array response message From 161ff20d69b5b613bae7fccd2e76a9febd52dc5e Mon Sep 17 00:00:00 2001 From: fhloston Date: Thu, 21 Oct 2021 15:28:01 +0200 Subject: [PATCH 0751/3088] add enablecarp to softether (#2172) --- .../src/etc/inc/plugins.inc.d/softether.inc | 13 ++++ .../src/etc/rc.syshook.d/carp/50-softether | 70 +++++++++++++++++++ .../OPNsense/Softether/forms/general.xml | 13 ++++ .../app/models/OPNsense/Softether/General.xml | 13 ++++ .../OPNsense/Softether/softether_server | 3 + 5 files changed, 112 insertions(+) create mode 100755 security/softether/src/etc/rc.syshook.d/carp/50-softether diff --git a/security/softether/src/etc/inc/plugins.inc.d/softether.inc b/security/softether/src/etc/inc/plugins.inc.d/softether.inc index 93a337adba..e11d8b8392 100644 --- a/security/softether/src/etc/inc/plugins.inc.d/softether.inc +++ b/security/softether/src/etc/inc/plugins.inc.d/softether.inc @@ -32,6 +32,19 @@ function softether_enabled() return (string)$model->enabled == '1'; } +function softether_carp_enabled() +{ + $model = new \OPNsense\Softether\General(); + return (string)$model->enabled == '1' && + (string)$model->enablecarp == '1'; +} + +function softether_carp_interfaces() +{ + $model = new \OPNsense\Softether\General(); + return (string)$model->carpinterfaces; +} + function softether_services() { $services = array(); diff --git a/security/softether/src/etc/rc.syshook.d/carp/50-softether b/security/softether/src/etc/rc.syshook.d/carp/50-softether new file mode 100755 index 0000000000..ca50c43ca6 --- /dev/null +++ b/security/softether/src/etc/rc.syshook.d/carp/50-softether @@ -0,0 +1,70 @@ +#!/usr/local/bin/php + + * Copyright (C) 2004 Scott Ullrich + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +require_once('config.inc'); +require_once('util.inc'); +require_once('interfaces.inc'); +require_once('plugins.inc.d/softether.inc'); + +if (softether_carp_enabled()) { + // XXX: carp enable/disable mode + $subsystem = !empty($argv[1]) ? $argv[1] : ''; + $type = !empty($argv[2]) ? $argv[2] : ''; + + if ($type != 'MASTER' && $type != 'BACKUP') { + log_error("Carp '$type' event unknown from source '{$subsystem}'"); + exit(1); + } + + if (!strstr($subsystem, '@')) { + log_error("Carp '$type' event triggered from wrong source '{$subsystem}'"); + exit(1); + } + + list ($vhid, $iface) = explode('@', $subsystem); + $friendly = convert_real_interface_to_friendly_interface_name($iface); + + if (!(strpos(softether_carp_interfaces(),$friendly) !== false)) { + exit(0); + } + + switch ($type) { + case 'MASTER': + touch('/var/run/softether/CARP_MASTER'); + shell_exec('/usr/local/etc/rc.d/softether_server start'); + break; + case 'BACKUP': + if (file_exists('/var/run/softether/CARP_MASTER')) { + unlink('/var/run/softether/CARP_MASTER'); + } + shell_exec('/usr/local/etc/rc.d/softether_server stop'); + break; + } +} diff --git a/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/forms/general.xml b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/forms/general.xml index c5a99db13f..8e738f5d41 100644 --- a/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/forms/general.xml +++ b/security/softether/src/opnsense/mvc/app/controllers/OPNsense/Softether/forms/general.xml @@ -5,4 +5,17 @@ checkbox This will activate SoftEther vpnserver process. + + general.enablecarp + + checkbox + This will activate the vpnserver service only on the master device. + + + general.carpinterfaces + + select_multiple + + Type or select interface. + diff --git a/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.xml b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.xml index 743f6585d6..05968a34c2 100644 --- a/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.xml +++ b/security/softether/src/opnsense/mvc/app/models/OPNsense/Softether/General.xml @@ -7,5 +7,18 @@ 0 Y + + 0 + Y + + + N + Y + + Y + + /^(?!0).*$/ + + diff --git a/security/softether/src/opnsense/service/templates/OPNsense/Softether/softether_server b/security/softether/src/opnsense/service/templates/OPNsense/Softether/softether_server index 72a7f30480..29fcf71906 100644 --- a/security/softether/src/opnsense/service/templates/OPNsense/Softether/softether_server +++ b/security/softether/src/opnsense/service/templates/OPNsense/Softether/softether_server @@ -1,6 +1,9 @@ {% if helpers.exists('OPNsense.softether.general.enabled') and OPNsense.softether.general.enabled == '1' %} softether_server_var_script="/usr/local/opnsense/scripts/OPNsense/Softether/setup.sh" softether_server_enable="YES" +{% if helpers.exists('OPNsense.softether.general.enablecarp') and OPNsense.softether.general.enablecarp == '1' %} +required_files="/var/run/softether/CARP_MASTER" +{% endif %} {% else %} softether_server_enable="NO" {% endif %} From 293d1708fc9aaf3f1358433006630abd7ac6a360 Mon Sep 17 00:00:00 2001 From: ruworuro Date: Thu, 21 Oct 2021 15:29:33 +0200 Subject: [PATCH 0752/3088] sysutils/nut - Add port field to netclient (#2052) --- sysutils/nut/Makefile | 2 +- .../mvc/app/controllers/OPNsense/Nut/forms/settings.xml | 6 ++++++ .../nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml | 4 ++++ .../src/opnsense/service/templates/OPNsense/Nut/upsmon.conf | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index caf7bfcc96..1e9315072c 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nut -PLUGIN_VERSION= 1.8 +PLUGIN_VERSION= 1.8.1 PLUGIN_COMMENT= Network UPS Tools PLUGIN_DEPENDS= nut PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml b/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml index 919cb56463..41d6cfe5e3 100644 --- a/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml +++ b/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml @@ -157,6 +157,12 @@ text Set the IP address of the remote NUT server. + + nut.netclient.port + + text + Set the TCP port of the remote NUT server. + nut.netclient.user diff --git a/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml b/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml index 3a200bd11b..3ee149b386 100644 --- a/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml +++ b/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml @@ -111,6 +111,10 @@ N
    + + 3493 + N + N diff --git a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf index e37c424774..da20af35da 100644 --- a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf +++ b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf @@ -7,7 +7,7 @@ SHUTDOWNCMD "/usr/local/etc/rc.halt" POWERDOWNFLAG /etc/killpower {% endif %} {% if helpers.exists('OPNsense.Nut.netclient.enable') and OPNsense.Nut.netclient.enable == '1' %} -MONITOR {{ OPNsense.Nut.general.name }}@{{ OPNsense.Nut.netclient.address }} 1 {{ OPNsense.Nut.netclient.user }} {{ OPNsense.Nut.netclient.password }} slave +MONITOR {{ OPNsense.Nut.general.name }}@{{ OPNsense.Nut.netclient.address }}{% if helpers.exists('OPNsense.Nut.netclient.port') %}:{{ OPNsense.Nut.netclient.port }}{% endif %} 1 {{ OPNsense.Nut.netclient.user }} {{ OPNsense.Nut.netclient.password }} slave SHUTDOWNCMD "/usr/local/etc/rc.halt" POWERDOWNFLAG /etc/killpower {% endif %} From 2b9edbb85b7d45341e65b2a59d39f46df90201c5 Mon Sep 17 00:00:00 2001 From: lfirewall1243 <41630758+lfirewall1243@users.noreply.github.com> Date: Thu, 21 Oct 2021 15:34:55 +0200 Subject: [PATCH 0753/3088] Update Postfix Description (#2281) --- .../mvc/app/controllers/OPNsense/Postfix/forms/general.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml index 24df5c4a1b..9a4eade64a 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml @@ -27,7 +27,7 @@ general.inet_interfaces text - The 'Listen IPs' parameter specifies the IP address to listen to. Default is to listen on all interfaces. + The 'Listen IPs' parameter specifies a comma-separated list of IP addresses to listen to. Default is to listen on all interfaces.
    general.inet_port From 2803e3bf3f0f39c1a1c7cd04ab207b445d52564d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 21 Oct 2021 15:36:38 +0200 Subject: [PATCH 0754/3088] security/softether: bump version --- security/softether/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/softether/Makefile b/security/softether/Makefile index e1e595bcc9..c595499554 100644 --- a/security/softether/Makefile +++ b/security/softether/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= softether -PLUGIN_VERSION= 0.1 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 0.2 PLUGIN_COMMENT= Cross-platform Multi-protocol VPN Program PLUGIN_DEPENDS= softether PLUGIN_MAINTAINER= m.muenz@gmail.com From a591eb0e35cfe1d67f20dcf2a4fdc205defde81b Mon Sep 17 00:00:00 2001 From: Nuno <45106055+rare-magma@users.noreply.github.com> Date: Thu, 21 Oct 2021 15:45:51 +0200 Subject: [PATCH 0755/3088] add insecure_skip_verify as an option for Influx v1 output (#2356) --- .../mvc/app/controllers/OPNsense/Telegraf/forms/output.xml | 6 ++++++ .../opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml | 4 ++++ .../service/templates/OPNsense/Telegraf/telegraf.conf | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index 89f8ee137b..8f184761be 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -35,6 +35,12 @@ text Set the password for authentication. + + output.influx_ssl_verify + + checkbox + This will skip chain and host verification. + output.influx_v2_enable diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index c3b090acf7..a64d586bbc 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -27,6 +27,10 @@ N + + 0 + N + 0 N diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index f74f878542..f9ab13f5b8 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -73,6 +73,11 @@ {% if helpers.exists('OPNsense.telegraf.output.influx_password') and OPNsense.telegraf.output.influx_password != '' %} password = "{{ OPNsense.telegraf.output.influx_password }}" {% endif %} +{% if helpers.exists('OPNsense.telegraf.output.influx_ssl_verify') and OPNsense.telegraf.output.influx_ssl_verify == '1' %} + insecure_skip_verify = true +{% else %} + insecure_skip_verify = false +{% endif %} {% endif %} {% if helpers.exists('OPNsense.telegraf.output.datadog_enable') and OPNsense.telegraf.output.datadog_enable == '1' %} From ad39a00188370e119ccdd4aa255b77e1261d0198 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 21 Oct 2021 15:49:01 +0200 Subject: [PATCH 0756/3088] add insecure_skip_verify as an option for Influx v1 output (#2356) fix naming --- .../mvc/app/controllers/OPNsense/Telegraf/forms/output.xml | 2 +- .../src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml | 4 ++-- .../service/templates/OPNsense/Telegraf/telegraf.conf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index 8f184761be..38be9076f7 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -36,7 +36,7 @@ Set the password for authentication. - output.influx_ssl_verify + output.influx_insecure_skip_verify checkbox This will skip chain and host verification. diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index a64d586bbc..e6072a3638 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -27,10 +27,10 @@ N - + 0 N - + 0 N diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index f9ab13f5b8..9d946839bb 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -73,7 +73,7 @@ {% if helpers.exists('OPNsense.telegraf.output.influx_password') and OPNsense.telegraf.output.influx_password != '' %} password = "{{ OPNsense.telegraf.output.influx_password }}" {% endif %} -{% if helpers.exists('OPNsense.telegraf.output.influx_ssl_verify') and OPNsense.telegraf.output.influx_ssl_verify == '1' %} +{% if helpers.exists('OPNsense.telegraf.output.influx_insecure_skip_verify') and OPNsense.telegraf.output.influx_insecure_skip_verify == '1' %} insecure_skip_verify = true {% else %} insecure_skip_verify = false From e762a7dd775b182dfd52e667cad2030c784bbaaa Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 21 Oct 2021 15:49:34 +0200 Subject: [PATCH 0757/3088] net-mgmt/telegraf: bump version --- net-mgmt/telegraf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index 71ae1610bb..0e31d6ae9f 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.12.1 +PLUGIN_VERSION= 1.12.2 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com From 590dcec2586df788bb9733e987c63e8facd95a58 Mon Sep 17 00:00:00 2001 From: Martin Wasley Date: Thu, 21 Oct 2021 14:50:43 +0100 Subject: [PATCH 0758/3088] UDP Broadcast relay Update (#2384) The server side data-width is too large for tablets. Reduced to give a better overall view, though this truncates data it looks better on a tablet. Bumped revision and updated pkg-descr. --- net/udpbroadcastrelay/Makefile | 2 +- net/udpbroadcastrelay/pkg-descr | 4 ++++ .../OPNsense/UDPBroadcastRelay/index.volt | 18 +++++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/net/udpbroadcastrelay/Makefile b/net/udpbroadcastrelay/Makefile index b8aa04860e..9d11bafa50 100644 --- a/net/udpbroadcastrelay/Makefile +++ b/net/udpbroadcastrelay/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= udpbroadcastrelay PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Control ubpbroadcastrelay processes PLUGIN_DEPENDS= udpbroadcastrelay PLUGIN_MAINTAINER= mjwasley@gmail.com diff --git a/net/udpbroadcastrelay/pkg-descr b/net/udpbroadcastrelay/pkg-descr index 684ef947f6..e43597ee47 100644 --- a/net/udpbroadcastrelay/pkg-descr +++ b/net/udpbroadcastrelay/pkg-descr @@ -27,3 +27,7 @@ udp_vars=" --id 1 --port 80 --dev eth0 --dev eth1" Warcraft 3 Server Discovery udp_vars=" --id 1 --port 6112 --dev eth0 --dev eth1" + +It is a requirement that generally a firewall entry will be required to allow the server responses +back to the requesting client. As it's not known what the port/address of the server is then this +entry will need to be created manually. \ No newline at end of file diff --git a/net/udpbroadcastrelay/src/opnsense/mvc/app/views/OPNsense/UDPBroadcastRelay/index.volt b/net/udpbroadcastrelay/src/opnsense/mvc/app/views/OPNsense/UDPBroadcastRelay/index.volt index f8c106948f..cd84f0720a 100644 --- a/net/udpbroadcastrelay/src/opnsense/mvc/app/views/OPNsense/UDPBroadcastRelay/index.volt +++ b/net/udpbroadcastrelay/src/opnsense/mvc/app/views/OPNsense/UDPBroadcastRelay/index.volt @@ -87,16 +87,16 @@ POSSIBILITY OF SUCH DAMAGE. - - - - - - - + + + + + + + - - + + From 5cbc2e2664a21b2071be2189bdb0158f12cd250a Mon Sep 17 00:00:00 2001 From: ryan <33b5e5@users.noreply.github.com> Date: Thu, 21 Oct 2021 06:53:22 -0700 Subject: [PATCH 0759/3088] Add option to enable/disable local query logs (#2385) --- dns/dnscrypt-proxy/pkg-descr | 4 ++++ .../controllers/OPNsense/Dnscryptproxy/forms/general.xml | 7 +++++++ .../mvc/app/models/OPNsense/Dnscryptproxy/General.xml | 6 +++++- .../templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dns/dnscrypt-proxy/pkg-descr b/dns/dnscrypt-proxy/pkg-descr index aad8c9492a..4d379c6018 100644 --- a/dns/dnscrypt-proxy/pkg-descr +++ b/dns/dnscrypt-proxy/pkg-descr @@ -5,6 +5,10 @@ such as DNSCrypt v2 and DNS-over-HTTPS. Plugin Changelog ================ +1.10 + +* Add option to enable/disable local query logs + 1.9 * Fix logging due to Phalcon4 update diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml index cda8bf0707..d9e01d5452 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml @@ -165,4 +165,11 @@ trueknown servers e.g. if you want to stick with Cisco only. You can also put your manually added servers here. Please use on your own risk.]]> + + + general.query_logs + + checkbox + This will enable/disable local logs. This includes both [query_log] and [nx_log] as described in the DNSCrypt-Proxy documentation. + diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml b/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml index 806459a5bf..e3f51b3534 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml @@ -1,7 +1,7 @@ //OPNsense/dnscryptproxy/general dnscrypt-proxy configuration - 0.1.0 + 0.1.1 0 @@ -136,5 +136,9 @@ N + + 1 + Y + diff --git a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml index dcade82dfb..48b0f609cd 100644 --- a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml +++ b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml @@ -118,6 +118,7 @@ cache_neg_max_ttl = {{ OPNsense.dnscryptproxy.general.cache_neg_max_ttl }} cache = false {% endif %} +{% if helpers.exists('OPNsense.dnscryptproxy.general.query_logs') and OPNsense.dnscryptproxy.general.query_logs == '1' %} [query_log] file = '/var/log/dnscrypt-proxy/query.log' format = 'tsv' @@ -125,6 +126,7 @@ cache = false [nx_log] file = '/var/log/dnscrypt-proxy/nx.log' format = 'tsv' +{% endif %} [allowed_names] allowed_names_file = 'whitelist.txt' From 6650d4d327f0656340732f10f01262ad4df51b8d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 21 Oct 2021 15:54:02 +0200 Subject: [PATCH 0760/3088] dns/dnscrypt-proxy: bump version --- dns/dnscrypt-proxy/Makefile | 3 +-- dns/dnscrypt-proxy/pkg-descr | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dns/dnscrypt-proxy/Makefile b/dns/dnscrypt-proxy/Makefile index 1c29346d61..26d9d6d8df 100644 --- a/dns/dnscrypt-proxy/Makefile +++ b/dns/dnscrypt-proxy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= dnscrypt-proxy -PLUGIN_VERSION= 1.9 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.10 PLUGIN_COMMENT= Flexible DNS proxy supporting DNSCrypt and DoH PLUGIN_DEPENDS= dnscrypt-proxy2 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/dnscrypt-proxy/pkg-descr b/dns/dnscrypt-proxy/pkg-descr index 4d379c6018..9e5283742c 100644 --- a/dns/dnscrypt-proxy/pkg-descr +++ b/dns/dnscrypt-proxy/pkg-descr @@ -5,7 +5,7 @@ such as DNSCrypt v2 and DNS-over-HTTPS. Plugin Changelog ================ -1.10 +1.10 * Add option to enable/disable local query logs From db291ca7ff1333cbeae04617c06cbe1f5596329e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 21 Oct 2021 15:57:05 +0200 Subject: [PATCH 0761/3088] dns/dnscrypt-proxy: xml issue in previous --- .../app/controllers/OPNsense/Dnscryptproxy/forms/general.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml index d9e01d5452..d3665bb692 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml @@ -165,8 +165,7 @@ true known servers e.g. if you want to stick with Cisco only. You can also put your manually added servers here. Please use on your own risk.]]> - - + general.query_logs checkbox From 0ac78b5f0119c37fb86f421015bfd1a0037b1fa4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 21 Oct 2021 15:59:08 +0200 Subject: [PATCH 0762/3088] plugins: style sweep --- .../opnsense/www/themes/rebellion/assets/stylesheets/main.scss | 1 - net/udpbroadcastrelay/pkg-descr | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss index f9b9179fa0..da4ca7c79c 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/main.scss @@ -9268,4 +9268,3 @@ div.Tokenize ul { .phase1_tr td { background-color: #282828 !important; } - diff --git a/net/udpbroadcastrelay/pkg-descr b/net/udpbroadcastrelay/pkg-descr index e43597ee47..bd8f32978d 100644 --- a/net/udpbroadcastrelay/pkg-descr +++ b/net/udpbroadcastrelay/pkg-descr @@ -30,4 +30,4 @@ udp_vars=" --id 1 --port 6112 --dev eth0 --dev eth1" It is a requirement that generally a firewall entry will be required to allow the server responses back to the requesting client. As it's not known what the port/address of the server is then this -entry will need to be created manually. \ No newline at end of file +entry will need to be created manually. From 4cb6dfae1de5121e13ba7378df28544150470dc2 Mon Sep 17 00:00:00 2001 From: Karlson2k Date: Thu, 21 Oct 2021 17:09:11 +0300 Subject: [PATCH 0763/3088] dns/dnscrypt-proxy: added support for 'disabled_server_names' (#2518) --- dns/dnscrypt-proxy/pkg-descr | 1 + .../controllers/OPNsense/Dnscryptproxy/forms/general.xml | 8 ++++++++ .../mvc/app/models/OPNsense/Dnscryptproxy/General.xml | 7 +++++++ .../templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/dns/dnscrypt-proxy/pkg-descr b/dns/dnscrypt-proxy/pkg-descr index 9e5283742c..e95ca7a432 100644 --- a/dns/dnscrypt-proxy/pkg-descr +++ b/dns/dnscrypt-proxy/pkg-descr @@ -8,6 +8,7 @@ Plugin Changelog 1.10 * Add option to enable/disable local query logs +* Add manual disable of specific servers 1.9 diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml index d3665bb692..9992fca0c3 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml @@ -171,4 +171,12 @@ checkbox This will enable/disable local logs. This includes both [query_log] and [nx_log] as described in the DNSCrypt-Proxy documentation. + + general.disabled_serverlist + + select_multiple + + true + + diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml b/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml index e3f51b3534..85826254e3 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml @@ -140,5 +140,12 @@ 1 Y + + /^([a-z0-9.,\-]{1,70})$/ + + N + , + Y + diff --git a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml index 48b0f609cd..2207b162b1 100644 --- a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml +++ b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml @@ -4,6 +4,10 @@ server_names = [{{ "'" + ("','".join(OPNsense.dnscryptproxy.general.serverlist.split(','))) + "'" }}] {% endif %} +{% if helpers.exists('OPNsense.dnscryptproxy.general.disabled_serverlist') and OPNsense.dnscryptproxy.general.disabled_serverlist != '' %} +disabled_server_names = ['{{OPNsense.dnscryptproxy.general.disabled_serverlist}}'] +{% endif %} + {% if helpers.exists('OPNsense.dnscryptproxy.general.listen_addresses') and OPNsense.dnscryptproxy.general.listen_addresses != '' %} listen_addresses = [{{ "'" + ("','".join(OPNsense.dnscryptproxy.general.listen_addresses.split(','))) + "'" }}] {% else %} From 700f3ef81be678fe8431dec671279c5530ced065 Mon Sep 17 00:00:00 2001 From: jamiew0w Date: Thu, 21 Oct 2021 15:29:03 +0100 Subject: [PATCH 0764/3088] net/vnstat: added yearly table to vnstat service (#2452) --- net/vnstat/Makefile | 2 +- net/vnstat/pkg-descr | 5 +++++ .../OPNsense/Vnstat/Api/ServiceController.php | 11 +++++++++++ .../mvc/app/views/OPNsense/Vnstat/general.volt | 10 ++++++++++ .../service/conf/actions.d/actions_vnstat.conf | 8 +++++++- 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile index bd8388bee2..03414717c4 100644 --- a/net/vnstat/Makefile +++ b/net/vnstat/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= vnstat -PLUGIN_VERSION= 1.2 +PLUGIN_VERSION= 1.3 PLUGIN_REVISION= 1 PLUGIN_COMMENT= vnStat is a console-based network traffic monitor PLUGIN_DEPENDS= vnstat diff --git a/net/vnstat/pkg-descr b/net/vnstat/pkg-descr index f4eea85ce5..942ef7533c 100644 --- a/net/vnstat/pkg-descr +++ b/net/vnstat/pkg-descr @@ -9,6 +9,11 @@ ensures light use of system resources. Plugin Changelog ================ +1.3 + +* Added Yearly statistics. +* Fixed typo leftover from removing weekly statistics. + 1.2 * Remove Weekly statistics, unsupported since vnStat v2 diff --git a/net/vnstat/src/opnsense/mvc/app/controllers/OPNsense/Vnstat/Api/ServiceController.php b/net/vnstat/src/opnsense/mvc/app/controllers/OPNsense/Vnstat/Api/ServiceController.php index c72a5d421d..a8fbebb7c2 100644 --- a/net/vnstat/src/opnsense/mvc/app/controllers/OPNsense/Vnstat/Api/ServiceController.php +++ b/net/vnstat/src/opnsense/mvc/app/controllers/OPNsense/Vnstat/Api/ServiceController.php @@ -78,6 +78,17 @@ public function monthlyAction() return array("response" => $response); } + /** + * list yearly statistics + * @return array + */ + public function yearlyAction() + { + $backend = new Backend(); + $response = $backend->configdRun("vnstat yearly"); + return array("response" => $response); + } + /** * remove database folder * @return array diff --git a/net/vnstat/src/opnsense/mvc/app/views/OPNsense/Vnstat/general.volt b/net/vnstat/src/opnsense/mvc/app/views/OPNsense/Vnstat/general.volt index add9b5564f..469b8ba84a 100644 --- a/net/vnstat/src/opnsense/mvc/app/views/OPNsense/Vnstat/general.volt +++ b/net/vnstat/src/opnsense/mvc/app/views/OPNsense/Vnstat/general.volt @@ -31,6 +31,7 @@
  • {{ lang._('Hourly Statistics') }}
  • {{ lang._('Daily Statistics') }}
  • {{ lang._('Monthly Statistics') }}
  • +
  • {{ lang._('Yearly Statistics') }}
  • @@ -53,6 +54,9 @@
    
         
    +
    +
    
    +    
    diff --git a/www/nginx/src/opnsense/scripts/nginx/list_logs.php b/www/nginx/src/opnsense/scripts/nginx/list_logs.php new file mode 100755 index 0000000000..c3b94e9dd9 --- /dev/null +++ b/www/nginx/src/opnsense/scripts/nginx/list_logs.php @@ -0,0 +1,106 @@ +#!/usr/local/bin/php + strlen($filename)) ? substr($file, strlen($filename) + 1, -3) : -1; + $result[$number] = array( + 'filename' => substr($file, strlen($log_prefix)), + 'date' => ($number >= 0) ? date('d/M/Y', filemtime($file) - 3600) : 'current', + 'number' => $number + ); + } + + ksort($result, SORT_NUMERIC); + $result = array_values($result); + + return $result; +} + +if ($_SERVER['argc'] < 3) { + die('{"error": "Incorrect amount of parameters given"}'); +} + +// first parameter: error|access +$mode = $_SERVER['argv'][1]; +// second parameter: uuid of server +$server = $_SERVER['argv'][2]; +$nginx = new Nginx(); + +$result = []; +// special case: the global error log +if ($server == 'global') { + $result = list_logfiles('error.log'); +} +else { + switch ($mode) { + case 'error': + case 'access': + if ($data = $nginx->getNodeByReference('http_server.' . $server)) { + $server_names = (string)$data->servername; + if (empty($server_names)) { + die('{"error": "The server entry has no server name"}'); + } + + $log_file_name = basename($server_names) . '.' . $mode . $log_suffix; + $result = list_logfiles($log_file_name); + } + else { + die('{"error": "UUID not found"}'); + } + break; + case 'streamerror': + case 'streamaccess': + if ($data = $nginx->getNodeByReference('stream_server.' . $server)) { + $mode = str_replace('stream', '', $mode); + $log_file_name = 'stream_' . $server . '.' . $mode . $log_suffix; + $result = list_logfiles($log_file_name); + } else { + die('{"error": "UUID not found"}'); + } + break; + default: + die('{"error": "action (' . $mode . ') not found"}'); + } +} + +echo json_encode($result); diff --git a/www/nginx/src/opnsense/scripts/nginx/read_log.php b/www/nginx/src/opnsense/scripts/nginx/read_log.php index 488c018efc..1ee5e40309 100755 --- a/www/nginx/src/opnsense/scripts/nginx/read_log.php +++ b/www/nginx/src/opnsense/scripts/nginx/read_log.php @@ -2,7 +2,8 @@ 0) ? max(intval($_SERVER['argv'][3]), -1) : -1; +// third parameter: current page +$page = max(intval($_SERVER['argv'][4]), 0); +// fourth parameter: lines per page +$per_page = max(intval($_SERVER['argv'][5]), 0); +// fifth parameter: filter query +$query = json_decode(base64_decode($_SERVER['argv'][6]), true); $nginx = new Nginx(); +if (!is_array($query)) { + $query = array(); +} + +if ($file_no >= 0) { + $log_suffix .= ".$file_no.gz"; +} + +$result = []; // special case: the global error log if ($server == 'global') { - $logparser = new ErrorLogParser($log_prefix . 'error.log'); - echo json_encode(empty($logparser->get_result()) ? - array('error' => 'no lines found') : - $logparser->get_result()); - exit(0); + $logparser = new ErrorLogParser($log_prefix . 'error' . $log_suffix, $page, $per_page, $query); } +else { + switch ($mode) { + case 'error': + case 'access': + if ($data = $nginx->getNodeByReference('http_server.' . $server)) { + $server_names = (string)$data->servername; + if (empty($server_names)) { + die('{"error": "The server entry has no server name"}'); + } + $log_file_name = $log_prefix . basename($server_names) . '.' . $mode . $log_suffix; + // this entry has no log file, ignore it + if (!file_exists($log_file_name)) { + break; + } + $logparser = null; -switch ($mode) { - case 'error': - case 'access': - if ($data = $nginx->getNodeByReference('http_server.' . $server)) { - $server_names = (string)$data->servername; - if (empty($server_names)) { - die('{"error": "The server entry has no server name"}'); + if ($mode == 'error') { + $logparser = new ErrorLogParser($log_file_name, $page, $per_page, $query); + } elseif ($mode == 'access') { + $logparser = new AccessLogParser($log_file_name, $page, $per_page, $query); + } } - $lines = []; - $log_file_name = $log_prefix . basename($server_names) . '.' . $mode . $log_suffix; - // this entry has no log file, ignore it - if (!file_exists($log_file_name)) { - break; + else { + die('{"error": "UUID not found"}'); } - $logparser = null; + break; + case 'streamerror': + case 'streamaccess': + if ($data = $nginx->getNodeByReference('stream_server.' . $server)) { + $mode = str_replace('stream', '', $mode); + $log_file_name = $log_prefix . 'stream_' . $server . '.' . $mode . $log_suffix; + // this entry has no log file, ignore it + if (!file_exists($log_file_name)) { + die('{"error": "file not found"}'); + } + $logparser = null; - if ($mode == 'error') { - $logparser = new ErrorLogParser($log_file_name); - } elseif ($mode == 'access') { - $logparser = new AccessLogParser($log_file_name); - } - // we cannot parse the file - something went wrong - if ($logparser == null) { - break; - } - $lines = array_merge($lines, $logparser->get_result()); - if (empty($lines)) { - $lines['error'] = 'no lines found'; - } - echo json_encode($lines); - } else { - die('{"error": "UUID not found"}'); - } - break; - case 'streamerror': - case 'streamaccess': - if ($data = $nginx->getNodeByReference('stream_server.' . $server)) { - $lines = []; - $mode = str_replace('stream', '', $mode); - $log_file_name = $log_prefix . 'stream_' . $server . '.' . $mode . $log_suffix; - // this entry has no log file, ignore it - if (!file_exists($log_file_name)) { - die('{"error": "file not found"}'); + if ($mode == 'error') { + $logparser = new ErrorLogParser($log_file_name, $page, $per_page, $query); + } elseif ($mode == 'access') { + $logparser = new StreamAccessLogParser($log_file_name, $page, $per_page, $query); + } + } else { + die('{"error": "UUID not found"}'); } - $logparser = null; + break; + default: + die('{"error": "action (' . $mode . ') not found"}'); + } +} - if ($mode == 'error') { - $logparser = new ErrorLogParser($log_file_name); - } elseif ($mode == 'access') { - $logparser = new StreamAccessLogParser($log_file_name); - } - // we cannot parse the file - something went wrong - if ($logparser == null) { - break; - } - $lines = array_merge($lines, $logparser->get_result()); - if (empty($lines)) { - $lines['error'] = 'no lines found'; - } - echo json_encode($lines); - } else { - die('{"error": "UUID not found"}'); - } - break; - default: - die('{"error": "action (' . $mode . ') not found"}'); + +// we cannot parse the file - something went wrong +if ($logparser === null) { + $result['error'] = 'cannot retrieve requested logs'; +} +else { + $result['lines'] = $logparser->get_result(); + $result['pages'] = $logparser->page_count; + $result['total'] = $logparser->total_lines; + $result['found'] = $logparser->query_lines; + $result['returned'] = count($result['lines']); + $result['query'] = json_encode($query); } + +echo json_encode($result); diff --git a/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf b/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf index 1cb7927e53..ed34d49711 100644 --- a/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf +++ b/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf @@ -28,9 +28,15 @@ type:script_output [log] command:/usr/local/opnsense/scripts/nginx/read_log.php +parameters: %s %s %s %s %s %s +type:script_output +message:querying nginx %s log for %s rotate %s (page %s of %s with filter %s) + +[listlogs] +command:/usr/local/opnsense/scripts/nginx/list_logs.php parameters: %s %s type:script_output -message:restarting nginx +message:listing nginx %s log for %s [tls_handshakes] command:cat /var/log/nginx/handshakes.json diff --git a/www/nginx/src/opnsense/www/css/nginx/logs.css b/www/nginx/src/opnsense/www/css/nginx/logs.css new file mode 100644 index 0000000000..c8bf446a04 --- /dev/null +++ b/www/nginx/src/opnsense/www/css/nginx/logs.css @@ -0,0 +1,43 @@ +/* +* Copyright (C) 2020 Manuel Faux +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +*/ + +thead.sticky-top th { + position: sticky; + top: 80px; + background-color: white; +} + +thead.sticky-top tr:first-child th { + top: 50px; +} + +tfoot.sticky-bottom th { + position: sticky; + bottom: 50px; + background-color: white; + font-weight: normal; + font-family: inherit; +} diff --git a/www/nginx/src/opnsense/www/js/nginx/dist/logviewer.min.js b/www/nginx/src/opnsense/www/js/nginx/dist/logviewer.min.js index 8bdd4e6c74..a52439ce83 100644 --- a/www/nginx/src/opnsense/www/js/nginx/dist/logviewer.min.js +++ b/www/nginx/src/opnsense/www/js/nginx/dist/logviewer.min.js @@ -1 +1 @@ -!function(e){var t={};function n(l){if(t[l])return t[l].exports;var i=t[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(l,i,function(t){return e[t]}.bind(null,i));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}([function(e,t,n){var l=n(2),i=n(4),o=/[&<>"']/g,r=RegExp(o.source);e.exports=function(e){return(e=i(e))&&r.test(e)?e.replace(o,l):e}},function(e,t,n){var l=n(6).Symbol;e.exports=l},function(e,t,n){var l=n(3)({"&":"&","<":"<",">":">",'"':""","'":"'"});e.exports=l},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var l=n(5);e.exports=function(e){return null==e?"":l(e)}},function(e,t,n){var l=n(1),i=n(9),o=n(10),r=n(11),_=1/0,a=l?l.prototype:void 0,s=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(r(t))return s?s.call(t):"";var n=t+"";return"0"==n&&1/t==-_?"-0":n}},function(e,t,n){var l=n(7),i="object"==typeof self&&self&&self.Object===Object&&self,o=l||i||Function("return this")();e.exports=o},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(8))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n\n \n\n'+(null==(__t=_.escape(name))?"":__t)+'\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj)__p+='\n\n '+(null==(__t=_.escape(name))?"":__t)+"\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='
    \n\n\n\n\n\n\n\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='\n\n\n\n\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='\n\n\n\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj){let count=0;__p+='
    {{ lang._('Enabled') }}{{ lang._('Interfaces') }}{{ lang._('Multicast Addresses') }}{{ lang._('Source Address') }}{{ lang._('Listen Port') }}{{ lang._('ID') }}{{ lang._('Description') }}{{ lang._('Enabled') }}{{ lang._('Interfaces') }}{{ lang._('Multicast Addresses') }}{{ lang._('Source Address') }}{{ lang._('Listen Port') }}{{ lang._('ID') }}{{ lang._('Description') }} {{ lang._('ID') }}{{ lang._('Use ID as TTL') }}{{ lang._('Commands') }}{{ lang._('Use ID as TTL') }}{{ lang._('Commands') }}
    '+(null==(__t=model.escape("time"))?"":__t)+''+(null==(__t=model.escape("remote_ip"))?"":__t)+''+(null==(__t=model.escape("username"))?"":__t)+''+(null==(__t=model.escape("status"))?"":__t)+''+(null==(__t=model.escape("size"))?"":__t)+''+(null==(__t=model.escape("http_referer"))?"":__t)+''+(null==(__t=model.escape("user_agent"))?"":__t)+''+(null==(__t=model.escape("forwarded_for"))?"":__t)+''+(null==(__t=model.escape("request_line"))?"":__t)+"'+(null==(__t=model.escape("time"))?"":__t)+''+(null==(__t=model.escape("remote_ip"))?"":__t)+''+(null==(__t=model.escape("status"))?"":__t)+''+(null==(__t=model.escape("bytes_sent"))?"":__t)+''+(null==(__t=model.escape("bytes_received"))?"":__t)+''+(null==(__t=model.escape("session_time"))?"":__t)+"'+(null==(__t=model.escape("date"))?"":__t)+''+(null==(__t=model.escape("time"))?"":__t)+''+(null==(__t=model.escape("severity"))?"":__t)+''+(null==(__t=model.escape("number"))?"":__t)+''+(null==(__t=model.escape("message"))?"":__t)+"
    \n \n \n ',"errors"===log_type||"stream_errors"===log_type?(count=5,__p+="\n \n \n \n \n \n "):"accesses"===log_type?(count=9,__p+="\n \n \n \n \n \n \n \n \n \n "):(count=6,__p+="\n \n \n \n \n \n \n "),__p+='\n \n \n ',"errors"===log_type||"stream_errors"===log_type?__p+='\n \n \n \n \n \n ':"accesses"===log_type?__p+='\n \n \n \n \n \n \n \n \n \n ':__p+='\n \n \n \n \n \n \n ',__p+='\n \n \n \n \n \n \n \n \n \n \n \n
    DateTimeSeverityNumberMessageTimeRemote IPUsernameStatusSizeRefererUser AgentForwarded ForRequest LineTimeRemote IPStatusBytes SentBytes ReceivedSession Time
    \n \n \n \n Entries per page:\n \n \n \n
    \n'}return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='
    \n No data available...\n
    \n';return __p}},,,,function(e,t,n){"use strict";n.r(t);const l=new Backbone.Collection([{name:"HTTP Access Logs",logType:"accesses"},{name:"HTTP Error Logs",logType:"errors"},{name:"Stream Access Logs",logType:"stream_accesses"},{name:"Stream Error Logs",logType:"stream_errors"}]);var i=Backbone.Model.extend({});var o=Backbone.Collection.extend({model:i,url:function(){return"/api/nginx/logs/"+this.logType},initialize:function(e){this.logType=e.logType}}),r=n(16),_=n.n(r);var a=Backbone.View.extend({tagName:"li",events:{"click .mainentry":"mainMenuClick","click .menuEntry":"menuEntryClick"},initialize:function(e){this.listenTo(this.collection,"sync",this.render),this.listenTo(this.collection,"update",this.render),this.logview=e.logview},render:function(){this.$el.html(""),this.renderCollection()},renderCollection:function(){this.$el.addClass("dropdown"),this.$el.html(""),this.$el.append(_()({model:this.collection,name:this.model.attributes.name}))},mainMenuClick:function(){this.collection.models[0]&&this.handleElementClick(this.collection.models[0].id)},menuEntryClick:function(e){this.handleElementClick(e.target.dataset.modelUuid)},handleElementClick:function(e){this.logview.get_log(this.model.get("logType"),e)}}),s=n(17),c=n.n(s);var u=Backbone.View.extend({tagName:"li",initialize:function(e){this.logview=e.logview,this.log_name=e.log_name,this.visible_name=e.visible_name,this.log_type=e.log_type},events:{"click .mainentry":"handleElementClick"},log_name:null,log_type:null,visible_name:null,render:function(){this.$el.html(c()({name:this.visible_name}))},handleElementClick:function(){this.logview.get_log(this.log_type,this.log_name)}});var d=Backbone.View.extend({tagName:"ul",className:"nav nav-tabs",initialize:function(e){this.listenTo(this.collection,"sync",this.render),this.listenTo(this.collection,"update",this.render),this.logview=e.logview},render:function(){this.$el.attr("role","tablist"),this.$el.html(""),this.collection.forEach(e=>this.render_one(e)),this.render_single_tabs()},render_one:function(e){const t=new o({uuid:e.get("url"),logType:e.get("logType")}),n=new a({collection:t,model:e,logview:this.logview});this.$el.append(n.$el),t.fetch()},render_single_tabs:function(){const e=new u({logview:this.logview,log_name:"global",visible_name:"Global Error Log",log_type:"errors"});e.render(),this.$el.append(e.$el)}}),p=n(18),m=n.n(p),h=n(19),f=n.n(h),b=n(20),g=n.n(b),v=n(21),y=n.n(v);var x=Backbone.Model.extend({});var w=Backbone.Collection.extend({model:x,url:function(){return`/api/nginx/logs/${this.logType}/${this.uuid}`},initialize:function(){this.logType="none",this.uuid="none"},parse:function(e){return"error"in e?[]:e},filter_collection:function(e){const t=e.keys();return this.filter(function(n){if(!n)return!1;for(let l=0;lthis.render_one(e,t))}},render_one:function(e,t){const n=new T({type:this.type,model:t});n.render(),e.append(n.$el)},get_log:function(e,t){this.collection.uuid=t,this.collection.logType=e,this.type=e,this.$el.html(""),this.filter_model.clear(),this.update()},update:function(){this.collection.fetch()},clear_and_render:function(){this.current_filtered_collection=null,this.render()},update_filter:function(e){const t=e.target;this.filter_model.set(t.name,$(t).val())},page_back:function(){this.current_page>0&&(this.current_page--,this.render())},page_forward:function(){(this.current_page+1)*this.page_entry_count"']/g,o=RegExp(r.source);e.exports=function(e){return(e=l(e))&&o.test(e)?e.replace(r,i):e}},function(e,t,n){var i=n(6).Symbol;e.exports=i},function(e,t,n){var i=n(3)({"&":"&","<":"<",">":">",'"':""","'":"'"});e.exports=i},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var i=n(5);e.exports=function(e){return null==e?"":i(e)}},function(e,t,n){var i=n(1),l=n(9),r=n(10),o=n(11),a=1/0,s=i?i.prototype:void 0,_=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(r(t))return l(t,e)+"";if(o(t))return _?_.call(t):"";var n=t+"";return"0"==n&&1/t==-a?"-0":n}},function(e,t,n){var i=n(7),l="object"==typeof self&&self&&self.Object===Object&&self,r=i||l||Function("return this")();e.exports=r},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(8))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length,l=Array(i);++n\r\n \r\n\r\n'+(null==(__t=_.escape(name))?"":__t)+'\r\n\r\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj)__p+='\n\n '+(null==(__t=_.escape(name))?"":__t)+"\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+=''+(null==(__t=model.escape("time"))?"":__t)+'\n'+(null==(__t=model.escape("remote_ip"))?"":__t)+'\n'+(null==(__t=model.escape("username"))?"":__t)+'\n'+(null==(__t=model.escape("status"))?"":__t)+'\n'+(null==(__t=model.escape("size"))?"":__t)+'\n'+(null==(__t=model.escape("http_referer"))?"":__t)+'\n'+(null==(__t=model.escape("user_agent"))?"":__t)+'\n'+(null==(__t=model.escape("forwarded_for"))?"":__t)+'\n'+(null==(__t=model.escape("request_line"))?"":__t)+"\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+=''+(null==(__t=model.escape("time"))?"":__t)+'\n'+(null==(__t=model.escape("remote_ip"))?"":__t)+'\n'+(null==(__t=model.escape("status"))?"":__t)+'\n'+(null==(__t=model.escape("bytes_sent"))?"":__t)+'\n'+(null==(__t=model.escape("bytes_received"))?"":__t)+'\n'+(null==(__t=model.escape("session_time"))?"":__t)+"\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+=''+(null==(__t=model.escape("date"))?"":__t)+'\n'+(null==(__t=model.escape("time"))?"":__t)+'\n'+(null==(__t=model.escape("severity"))?"":__t)+'\n'+(null==(__t=model.escape("number"))?"":__t)+'\n'+(null==(__t=model.escape("message"))?"":__t)+"\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj){let count=0;__p+='\r\n \r\n \r\n ',"errors"===log_type||"stream_errors"===log_type?(count=5,__p+="\r\n \r\n \r\n \r\n \r\n \r\n "):"accesses"===log_type?(count=9,__p+="\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n "):(count=6,__p+="\r\n \r\n \r\n \r\n \r\n \r\n \r\n "),__p+='\r\n \r\n \r\n ',"errors"===log_type||"stream_errors"===log_type?__p+='\r\n \r\n \r\n \r\n \r\n \r\n ':"accesses"===log_type?__p+='\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ':__p+='\r\n \r\n \r\n \r\n \r\n \r\n \r\n ',__p+='\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    DateTimeSeverityNumberMessageTimeRemote IPUsernameStatusSizeRefererUser AgentForwarded ForRequest LineTimeRemote IPStatusBytes SentBytes ReceivedSession Time
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n Page 1/0\r\n \r\n \r\n \r\n \r\n \r\n Found lines: 0/0
    \r\n'}return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='
    \n No data available...\n
    \n';return __p}},,,,function(e,t,n){"use strict";n.r(t);var i=Backbone.Model.extend({});var l=Backbone.Collection.extend({model:i,url:function(){return`/api/nginx/logs/${this.logType}`},initialize:function(e){this.logType=e.logType}}),r=Backbone.Model.extend({});var o=Backbone.Collection.extend({model:r,url:function(){return`/api/nginx/logs/${this.logType}/${this.uuid}`},initialize:function(e){this.logType=e.logType,this.uuid=e.uuid}}),a=n(16),s=n.n(a);var _=Backbone.View.extend({tagName:"li",events:{"click .mainentry":"mainMenuClick","click .menuEntry":"menuEntryClick"},initialize:function(e){this.listenTo(this.collection,"update",this.render),this.logType=e.logType,this.logview=e.logview},render:function(){this.$el.html(""),this.renderCollection()},renderCollection:function(){this.$el.addClass("dropdown"),"global"==this.model.get("id")&&(this.$el.addClass("active"),this.logview.get_log("errors","global",0)),this.$el.html(""),this.$el.append(s()({model:this.collection,id:this.model.get("id"),name:this.model.has("server_name")?this.model.get("server_name"):"Port "+this.model.get("port")}))},mainMenuClick:function(){this.collection.models[0]&&(this.handleElementClick(this.model.get("id"),this.collection.models[0].get("number")),$(`#tab_${this.model.get("id")} li`).removeClass("active"),$(`#subtab_item_${this.model.get("id")}_${this.collection.models[0].get("number")}`).parent().addClass("active"))},menuEntryClick:function(e){this.handleElementClick(e.target.dataset.modelUuid,e.target.dataset.modelFileno)},handleElementClick:function(e,t){this.logview.get_log(this.logType,e,t)}}),c=n(17),u=n.n(c);Backbone.View.extend({tagName:"li",initialize:function(e){this.logview=e.logview,this.log_name=e.log_name,this.visible_name=e.visible_name,this.log_type=e.log_type},events:{"click .mainentry":"handleElementClick"},log_name:null,log_type:null,visible_name:null,render:function(){this.$el.html(u()({name:this.visible_name}))},handleElementClick:function(){this.logview.get_log(this.log_type,this.log_name)}});var p=Backbone.View.extend({tagName:"ul",className:"nav nav-tabs",initialize:function(e){this.listenTo(this.collection,"update",this.render),this.logview=e.logview,this.logType=e.logType},render:function(){this.$el.attr("role","tablist"),this.$el.html(""),"global"==this.logType?this.render_global_error_tab():this.collection.forEach(e=>this.render_one_server(e))},render_one_server:function(e){const t=new o({uuid:e.get("id"),logType:this.logType}),n=new _({collection:t,model:e,logType:this.logType,logview:this.logview});this.$el.append(n.$el),t.fetch()},render_global_error_tab:function(){const e=new o({uuid:"global",logType:"errors"}),t=new _({collection:e,model:new Backbone.Model({server_name:"Global Error Log",id:"global"}),logType:"errors",logview:this.logview});this.$el.append(t.$el),e.fetch()}}),d=n(18),h=n.n(d),m=n(19),g=n.n(m),b=n(20),f=n.n(b),y=n(21),v=n.n(y);var x=Backbone.Model.extend({});var w=Backbone.Collection.extend({model:x,url:function(){return`/api/nginx/logs/${this.logType}/${this.uuid}/${this.fileNo}/${this.page}/${this.pageSize}/${this.create_filter()}`},initialize:function(){this.logType="none",this.uuid="none",this.fileNo=-1,this.page=0,this.pageSize=0,this.filter_model=new Backbone.Model},parse:function(e){return"error"in e?[]:(this.page_count=e.pages,this.total_entries=e.total,this.displayed_entries=e.found,e.lines)},create_filter:function(){return encodeURIComponent(JSON.stringify(this.filter_model))}}),k=n(22),j=n.n(k);const T=Backbone.View.extend({tagName:"tr",initialize:function(e){this.type=e.type},render:function(){this.$el.html(this.get_template()({model:this.model}))},get_template:function(){return"accesses"===this.type?h.a:"stream_accesses"===this.type?g.a:f.a}});const C=new(Backbone.View.extend({tagName:"div",className:"content-box tab-content",events:{"keyup .filter input":"update_filter","click #paging_first":"page_first","click #paging_back":"page_back","click #refresh":"update","click #paging_forward":"page_forward","click #paging_last":"page_last","change #entrycount":"change_entry_count"},page_entry_count:100,filter_delay:-1,initialize:function(){this.collection=new w,this.listenTo(this.collection,"sync",this.render),this.listenTo(this.collection,"update",this.render),this.listenTo(this.collection.filter_model,"change",this.render),this.type=""},render:function(){let e=this.$("tbody");e.length<1?0!==this.collection.length?(this.$el.html(v()({log_type:this.type,model:this.collection.filter_model})),e=this.$("tbody")):this.$el.html(j.a):e.html(""),0!==this.collection.length&&null==this.current_filtered_collection&&this.collection.forEach(t=>this.render_one(e,t)),this.$("#entrycountdisplay").html(this.page_entry_count),this.$("#currentpage").html(this.current_page+1),this.$("#pagecount").html(this.collection.page_count),this.$("#totalcount").html(this.collection.total_entries),this.$("#resultcount").html(this.collection.displayed_entries),this.current_page>=this.collection.page_count-1?(this.$("#paging_last").addClass("disabled"),this.$("#paging_forward").addClass("disabled")):(this.$("#paging_last").removeClass("disabled"),this.$("#paging_forward").removeClass("disabled")),this.current_page<=0?(this.$("#paging_back").addClass("disabled"),this.$("#paging_first").addClass("disabled")):(this.$("#paging_back").removeClass("disabled"),this.$("#paging_first").removeClass("disabled"))},render_one:function(e,t){const n=new T({type:this.type,model:t});n.render(),e.append(n.$el)},get_log:function(e,t,n){this.collection.uuid=t,this.collection.logType=e,this.collection.fileNo=n,this.type=e,this.current_page=0,this.$el.html(""),this.collection.filter_model.clear(),this.update()},update:function(){this.collection.page=this.current_page,this.collection.pageSize=this.page_entry_count,this.collection.fetch()},update_filter:function(e){clearTimeout(this.filter_delay);const t=e.target;this.collection.filter_model.set(t.name,$(t).val()),this.current_page=0,this.filter_delay=setTimeout(function(e){e.update()},500,this)},page_first:function(){this.current_page=0,this.update()},page_back:function(){this.current_page>0&&(this.current_page--,this.update())},page_forward:function(){this.current_page this.render_one(element)); - this.render_single_tabs(); + + if (this.logType == 'global') { + this.render_global_error_tab(); + } + else { + this.collection.forEach((element) => this.render_one_server(element)); + } }, - render_one: function(element) { - const servers = new LogCollection( + render_one_server: function(element) { + const files = new LogCollection( { - uuid: element.get('url'), - logType: element.get('logType') + uuid: element.get('id'), + logType: this.logType } ); const logList = new TabLogList({ - collection: servers, + collection: files, model: element, + logType: this.logType, logview: this.logview }); this.$el.append(logList.$el); - servers.fetch(); + files.fetch(); }, - render_single_tabs: function () { - const single_tab = new SingleTab({ - logview: this.logview, - log_name: 'global', - visible_name: 'Global Error Log', - log_type: 'errors'}); - single_tab.render(); - this.$el.append(single_tab.$el); + render_global_error_tab: function () { + const files = new LogCollection( + { + uuid: 'global', + logType: 'errors' + } + ); + const logList = new TabLogList({ + collection: files, + model: new Backbone.Model({ + server_name: 'Global Error Log', + id: 'global' + }), + logType: 'errors', + logview: this.logview + }); + this.$el.append(logList.$el); + files.fetch(); } }); diff --git a/www/nginx/src/opnsense/www/js/nginx/src/controller/LogView.js b/www/nginx/src/opnsense/www/js/nginx/src/controller/LogView.js index fe82540f8e..c0792ce47c 100644 --- a/www/nginx/src/opnsense/www/js/nginx/src/controller/LogView.js +++ b/www/nginx/src/opnsense/www/js/nginx/src/controller/LogView.js @@ -33,29 +33,30 @@ const LogView = Backbone.View.extend({ className: 'content-box tab-content', events: { "keyup .filter input": "update_filter", + "click #paging_first": "page_first", "click #paging_back": "page_back", + "click #refresh": "update", "click #paging_forward": "page_forward", + "click #paging_last": "page_last", "change #entrycount": "change_entry_count", }, page_entry_count: 100, - current_page: 0, - current_filtered_collection: null, + filter_delay: -1, initialize: function() { this.collection = new LogLinesCollection(); - this.filter_model = new Backbone.Model(); - this.listenTo(this.collection, "sync", this.clear_and_render); - this.listenTo(this.collection, "update", this.clear_and_render); - this.listenTo(this.filter_model, "change", this.clear_and_render); + this.listenTo(this.collection, "sync", this.render); + this.listenTo(this.collection, "update", this.render); + this.listenTo(this.collection.filter_model, "change", this.render); this.type = ''; }, render: function() { - let tbody = this.$el.find('tbody'); + let tbody = this.$('tbody'); if (tbody.length < 1) { if (this.collection.length !== 0) { - this.$el.html(logViewer({log_type: this.type, model: this.filter_model})); - tbody = this.$el.find('tbody'); + this.$el.html(logViewer({log_type: this.type, model: this.collection.filter_model})); + tbody = this.$('tbody'); } else { this.$el.html(noDataAvailable); } @@ -63,57 +64,104 @@ const LogView = Backbone.View.extend({ else { tbody.html(''); } + if (this.collection.length !== 0) { if (this.current_filtered_collection == null) { - this.current_filtered_collection = this.collection.filter_collection(this.filter_model); + this.collection.forEach( + (model) => this.render_one(tbody, model) + ); } - const index_begin = this.current_page * this.page_entry_count; - const index_end = index_begin + this.page_entry_count; - this.current_filtered_collection.slice(index_begin, index_end).forEach( - (model) => this.render_one(tbody, model) - ); + } + + this.$('#entrycountdisplay').html(this.page_entry_count); + this.$('#currentpage').html(this.current_page + 1); + this.$('#pagecount').html(this.collection.page_count); + this.$('#totalcount').html(this.collection.total_entries); + this.$('#resultcount').html(this.collection.displayed_entries); + + if (this.current_page >= this.collection.page_count - 1) { + this.$('#paging_last').addClass("disabled"); + this.$('#paging_forward').addClass("disabled"); + } + else { + this.$('#paging_last').removeClass("disabled"); + this.$('#paging_forward').removeClass("disabled"); + } + + if (this.current_page <= 0) { + this.$('#paging_back').addClass("disabled"); + this.$('#paging_first').addClass("disabled"); + } + else { + this.$('#paging_back').removeClass("disabled"); + this.$('#paging_first').removeClass("disabled"); } }, + render_one: function(parent_element, model) { const logline = new LogViewLine({type: this.type, model: model}); logline.render(); parent_element.append(logline.$el); }, - get_log: function(type, uuid) { + + get_log: function(type, uuid, fileNo) { this.collection.uuid = uuid; this.collection.logType = type; + this.collection.fileNo = fileNo; this.type = type; + this.current_page = 0; this.$el.html(''); - this.filter_model.clear(); + this.collection.filter_model.clear(); this.update(); }, + update: function () { + this.collection.page = this.current_page; + this.collection.pageSize = this.page_entry_count; this.collection.fetch(); }, - clear_and_render: function() { - this.current_filtered_collection = null; - this.render(); - }, + update_filter: function (event) { + clearTimeout(this.filter_delay); const element = event.target; - this.filter_model.set(element.name, $(element).val()); + this.collection.filter_model.set(element.name, $(element).val()); + this.current_page = 0; + + // Delay update to avoid multiple requests during typing + this.filter_delay = setTimeout(function(instance) { + instance.update(); + }, 500, this); }, + + page_first: function () { + this.current_page = 0; + this.update(); + }, + page_back: function () { if (this.current_page > 0) { this.current_page--; - this.render(); + this.update(); } }, + page_forward: function () { - if ((this.current_page + 1) * this.page_entry_count < this.collection.length) { + if (this.current_page < this.collection.page_count) { this.current_page++; - this.render(); + this.update(); } }, + + page_last: function () { + this.current_page = this.collection.page_count - 1; + this.update(); + }, + change_entry_count: function (event) { this.page_entry_count = event.target.value; this.current_page = 0; - this.render(); + this.update(); } }); + export default LogView; diff --git a/www/nginx/src/opnsense/www/js/nginx/src/controller/TabLogList.js b/www/nginx/src/opnsense/www/js/nginx/src/controller/TabLogList.js index 60e1d3ba28..3533df6398 100644 --- a/www/nginx/src/opnsense/www/js/nginx/src/controller/TabLogList.js +++ b/www/nginx/src/opnsense/www/js/nginx/src/controller/TabLogList.js @@ -9,8 +9,8 @@ let TabLogList = Backbone.View.extend({ }, initialize: function(data) { - this.listenTo(this.collection, "sync", this.render); this.listenTo(this.collection, "update", this.render); + this.logType = data.logType; this.logview = data.logview; }, @@ -21,21 +21,31 @@ let TabLogList = Backbone.View.extend({ renderCollection: function() { this.$el.addClass('dropdown'); + if (this.model.get('id') == "global") { + this.$el.addClass('active'); + this.logview.get_log('errors', 'global', -1); + } this.$el.html(''); this.$el.append( - TabTemplateCollection({model: this.collection, name: this.model.attributes.name}) + TabTemplateCollection({ + model: this.collection, + id: this.model.get('id'), + name: this.model.has('server_name') ? this.model.get('server_name') : "Port " + this.model.get('port') + }) ); }, mainMenuClick: function () { if (this.collection.models[0]) { - this.handleElementClick(this.collection.models[0].id); + this.handleElementClick(this.model.get('id'), this.collection.models[0].get('number')); + $(`#tab_${this.model.get('id')} li`).removeClass('active'); + $(`#subtab_item_${this.model.get('id')}_${this.collection.models[0].get('number')}`).parent().addClass('active'); } }, menuEntryClick: function (event) { - this.handleElementClick(event.target.dataset['modelUuid']); + this.handleElementClick(event.target.dataset['modelUuid'], event.target.dataset['modelFileno']); }, - handleElementClick: function (uuid) { - this.logview.get_log(this.model.get('logType'), uuid); + handleElementClick: function (uuid, fileNo) { + this.logview.get_log(this.logType, uuid, fileNo); } }); export default TabLogList; diff --git a/www/nginx/src/opnsense/www/js/nginx/src/logviewer.js b/www/nginx/src/opnsense/www/js/nginx/src/logviewer.js index dad07be5f7..0051e00e42 100644 --- a/www/nginx/src/opnsense/www/js/nginx/src/logviewer.js +++ b/www/nginx/src/opnsense/www/js/nginx/src/logviewer.js @@ -1,15 +1,33 @@ -import {defaultEndpoints} from './config'; +import LogServerCollection from './models/LogServerCollection'; import LogCategoryList from './controller/LogCategoryList'; import LogView from './controller/LogView'; +// Skeleton with header (navigation) and footer (pagination) const logview = new LogView(); - +// Get type of log to display from volt view (data-log HTML attribute) +const type = $('#logapplication').data('log'); +// Query (HTTP or stream) server list +const servers = new LogServerCollection({ + logType: type +}); +// Render tabs with server logs (one tab per server) const menu = new LogCategoryList({ - collection: defaultEndpoints, - logview: logview + collection: servers, + logview: logview, + logType: type // 'errors', 'accesses' or 'global' }); -$(document.getElementById('logapplication')) +// Place log application to volt template +$('#logapplication') .append(menu.$el) .append(logview.$el); -menu.render(); + +if (type != 'global') { + // Global error log does not require server list + servers.fetch(); +} +else { + // Update of server list triggers render() which does not + // occur for global error log + menu.render(); +} diff --git a/www/nginx/src/opnsense/www/js/nginx/src/models/LogCollection.js b/www/nginx/src/opnsense/www/js/nginx/src/models/LogCollection.js index 19febb1f38..0221235e1c 100644 --- a/www/nginx/src/opnsense/www/js/nginx/src/models/LogCollection.js +++ b/www/nginx/src/opnsense/www/js/nginx/src/models/LogCollection.js @@ -3,10 +3,11 @@ import LogFileMenuEntry from './LogFileMenuEntry'; const LogCollection = Backbone.Collection.extend({ model: LogFileMenuEntry, url: function () { - return '/api/nginx/logs/' + this.logType; + return `/api/nginx/logs/${this.logType}/${this.uuid}`; }, initialize: function (params) { this.logType = params.logType; + this.uuid = params.uuid; } }); diff --git a/www/nginx/src/opnsense/www/js/nginx/src/models/LogLinesCollection.js b/www/nginx/src/opnsense/www/js/nginx/src/models/LogLinesCollection.js index 2e3eb2921d..806f0c0775 100644 --- a/www/nginx/src/opnsense/www/js/nginx/src/models/LogLinesCollection.js +++ b/www/nginx/src/opnsense/www/js/nginx/src/models/LogLinesCollection.js @@ -3,39 +3,29 @@ import LogLine from "./LogLine"; const LogLinesCollection = Backbone.Collection.extend({ model: LogLine, url: function () { - return `/api/nginx/logs/${this.logType}/${this.uuid}`; + return `/api/nginx/logs/${this.logType}/${this.uuid}/${this.fileNo}/${this.page}/${this.pageSize}/${this.create_filter()}`; }, initialize: function () { this.logType = 'none'; this.uuid = 'none'; + this.fileNo = -1; + this.page = 0; + this.pageSize = 0; + this.filter_model = new Backbone.Model(); }, parse: function(response) { if ('error' in response) { return []; } - return response; + else { + this.page_count = response.pages; + this.total_entries = response.total; + this.displayed_entries = response.found; + return response.lines; + } }, - filter_collection: function(filter_model) { - const filter_model_keys = filter_model.keys(); - return this.filter(function (model) { - if (!model) { - return false; - } - for (let i = 0; i < filter_model_keys.length; i++) { - const property = filter_model_keys[i]; - if (typeof(filter_model.get(property)) !== "string" - || filter_model.get(property).length === 0) { - continue; - } - if (!model.has(property)) { - return false; - } - if (!model.get(property).includes(filter_model.get(property))) { - return false; - } - } - return true; - }); + create_filter: function() { + return encodeURIComponent(JSON.stringify(this.filter_model)); } }); diff --git a/www/nginx/src/opnsense/www/js/nginx/src/models/LogServerCollection.js b/www/nginx/src/opnsense/www/js/nginx/src/models/LogServerCollection.js new file mode 100644 index 0000000000..9fdfdc75b3 --- /dev/null +++ b/www/nginx/src/opnsense/www/js/nginx/src/models/LogServerCollection.js @@ -0,0 +1,13 @@ +import LogServerMenu from './LogServerMenu'; + +const LogServerCollection = Backbone.Collection.extend({ + model: LogServerMenu, + url: function () { + return `/api/nginx/logs/${this.logType}`; + }, + initialize: function (params) { + this.logType = params.logType; + } +}); + +export default LogServerCollection; diff --git a/www/nginx/src/opnsense/www/js/nginx/src/models/LogServerMenu.js b/www/nginx/src/opnsense/www/js/nginx/src/models/LogServerMenu.js new file mode 100644 index 0000000000..170a06af68 --- /dev/null +++ b/www/nginx/src/opnsense/www/js/nginx/src/models/LogServerMenu.js @@ -0,0 +1,2 @@ +export default Backbone.Model.extend({ +}); diff --git a/www/nginx/src/opnsense/www/js/nginx/src/templates/TabCollection.html b/www/nginx/src/opnsense/www/js/nginx/src/templates/TabCollection.html index ee317a10c9..d5ea04354a 100644 --- a/www/nginx/src/opnsense/www/js/nginx/src/templates/TabCollection.html +++ b/www/nginx/src/opnsense/www/js/nginx/src/templates/TabCollection.html @@ -37,15 +37,16 @@ <%= _.escape(name) %> - ]]>
    - - - security_header.xssprotection - - - dropdown - -
  • Block: The browser should block the response
  • -
  • Off: Allow Anything
  • -
  • On: The Browser decides how to handle it.
  • - ]]>
    -
    - - security_header.content_type_options - - checkbox - - - security_header.strict_transport_security_time - - text - A time in seconds in which the transport security (TLS) should be enforced. - - - security_header.strict_transport_security_include_subdomains - - checkbox - If checked, also subdomains are affected. - - - security_header.hpkp_keys - - select_multiple - - true - Mozilla Wiki. - It is not recommended to use this feature with short lived certificates.]]> - - - security_header.hpkp_report_only - - checkbox - If you only want to test it, you can check this box (policy will be deployed but not enforced). - - - security_header.hpkp_time - - text - - - security_header.hpkp_include_subdomains - - checkbox - If checked, also subdomains are affected. - - - security_header.enable_csp - - checkbox - If checked, the CSP is enabled. - - - security_header.csp_report_only - - checkbox - If checked, the CSP is not enforced (learning mode). - - - header - - - - security_header.csp_default_src_enabled - - checkbox - If checked, this part of the CSP is enabled. - - - security_header.csp_default_src_data_urls - - Data URLs are used to embed files into HTML (for example images written directly into the src attribute). - checkbox - - - security_header.csp_default_src_http_urls - - select_multiple - true - - Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. - You can use wildcards here like https://*.exmaple.com. - - - security_header.csp_default_src_inline - - checkbox - Checking this directive allows to use scripts or styles directly embedded in in the HTML content. - Examples are the script and the style tags. - - - security_header.csp_default_src_eval - - checkbox - Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. - - - security_header.csp_default_src_self - - checkbox - Allows everything from the same site (path can differ, but host, protocol and port need to be the same). - - - security_header.csp_default_src_blob - - checkbox - Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. - - - security_header.csp_default_src_mediastream - - checkbox - - - security_header.csp_default_src_filesystem - - checkbox - - - security_header.csp_default_src_none - - checkbox - If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. - - - header - - - - security_header.csp_script_src_enabled - - checkbox - If checked, this part of the CSP is enabled. - - - security_header.csp_script_src_data_urls - - Data URLs are used to embed files into HTML (for example images written directly into the src attribute). - checkbox - - - security_header.csp_script_src_http_urls - - select_multiple - true - - Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. - You can use wildcards here like https://*.exmaple.com. - - - security_header.csp_script_src_inline - - checkbox - Checking this directive allows to use scripts or styles directly embedded in in the HTML content. - Examples are the script and the style tags. - - - security_header.csp_script_src_eval - - checkbox - Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. - - - security_header.csp_script_src_self - - checkbox - Allows everything from the same site (path can differ, but host, protocol and port need to be the same). - - - security_header.csp_script_src_blob - - checkbox - Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. - - - security_header.csp_script_src_mediastream - - checkbox - - - security_header.csp_script_src_filesystem - - checkbox - - - security_header.csp_script_src_none - - checkbox - If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. - - - header - - - - security_header.csp_img_src_enabled - - checkbox - If checked, this part of the CSP is enabled. - - - security_header.csp_img_src_data_urls - - Data URLs are used to embed files into HTML (for example images written directly into the src attribute). - checkbox - - - security_header.csp_img_src_http_urls - - select_multiple - true - - Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. - You can use wildcards here like https://*.exmaple.com. - - - security_header.csp_img_src_inline - - checkbox - Checking this directive allows to use scripts or styles directly embedded in in the HTML content. - Examples are the script and the style tags. - - - security_header.csp_img_src_eval - - checkbox - Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. - - - security_header.csp_img_src_self - - checkbox - Allows everything from the same site (path can differ, but host, protocol and port need to be the same). - - - security_header.csp_img_src_blob - - checkbox - Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. - - - security_header.csp_img_src_mediastream - - checkbox - - - security_header.csp_img_src_filesystem - - checkbox - - - security_header.csp_img_src_none - - checkbox - If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. - - - header - - - - security_header.csp_style_src_enabled - - checkbox - If checked, this part of the CSP is enabled. - - - security_header.csp_style_src_data_urls - - Data URLs are used to embed files into HTML (for example images written directly into the src attribute). - checkbox - - - security_header.csp_style_src_http_urls - - select_multiple - true - - Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. - You can use wildcards here like https://*.exmaple.com. - - - security_header.csp_style_src_inline - - checkbox - Checking this directive allows to use scripts or styles directly embedded in in the HTML content. - Examples are the script and the style tags. - - - security_header.csp_style_src_eval - - checkbox - Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. - - - security_header.csp_style_src_self - - checkbox - Allows everything from the same site (path can differ, but host, protocol and port need to be the same). - - - security_header.csp_style_src_blob - - checkbox - Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. - - - security_header.csp_style_src_mediastream - - checkbox - - - security_header.csp_style_src_filesystem - - checkbox - - - security_header.csp_style_src_none - - checkbox - If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. - - - header - - - - security_header.csp_media_src_enabled - - checkbox - If checked, this part of the CSP is enabled. - - - security_header.csp_media_src_data_urls - - Data URLs are used to embed files into HTML (for example images written directly into the src attribute). - checkbox - - - security_header.csp_media_src_http_urls - - select_multiple - true - - Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. - You can use wildcards here like https://*.exmaple.com. - - - security_header.csp_media_src_inline - - checkbox - Checking this directive allows to use scripts or styles directly embedded in in the HTML content. - Examples are the script and the style tags. - - - security_header.csp_media_src_eval - - checkbox - Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. - - - security_header.csp_media_src_self - - checkbox - Allows everything from the same site (path can differ, but host, protocol and port need to be the same). - - - security_header.csp_media_src_blob - - checkbox - Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. - - - security_header.csp_media_src_mediastream - - checkbox - - - security_header.csp_media_src_filesystem - - checkbox - - - security_header.csp_media_src_none - - checkbox - If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. - - - header - - - - security_header.csp_font_src_enabled - - checkbox - If checked, this part of the CSP is enabled. - - - security_header.csp_font_src_data_urls - - Data URLs are used to embed files into HTML (for example images written directly into the src attribute). - checkbox - - - security_header.csp_font_src_http_urls - - select_multiple - true - - Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. - You can use wildcards here like https://*.exmaple.com. - - - security_header.csp_font_src_inline - - checkbox - Checking this directive allows to use scripts or styles directly embedded in in the HTML content. - Examples are the script and the style tags. - - - security_header.csp_font_src_eval - - checkbox - Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. - - - security_header.csp_font_src_self - - checkbox - Allows everything from the same site (path can differ, but host, protocol and port need to be the same). - - - security_header.csp_font_src_blob - - checkbox - Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. - - - security_header.csp_font_src_mediastream - - checkbox - - - security_header.csp_font_src_filesystem - - checkbox - - - security_header.csp_font_src_none - - checkbox - If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. - - - header - - - - security_header.csp_form_action_enabled - - checkbox - If checked, this part of the CSP is enabled. - - - security_header.csp_form_action_data_urls - - Data URLs are used to embed files into HTML (for example images written directly into the src attribute). - checkbox - - - security_header.csp_form_action_http_urls - - select_multiple - true - - Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. - You can use wildcards here like https://*.exmaple.com. - - - security_header.csp_form_action_inline - - checkbox - Checking this directive allows to use scripts or styles directly embedded in in the HTML content. - Examples are the script and the style tags. - - - security_header.csp_form_action_eval - - checkbox - Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. - - - security_header.csp_form_action_self - - checkbox - Allows everything from the same site (path can differ, but host, protocol and port need to be the same). - - - security_header.csp_form_action_blob - - checkbox - Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. - - - security_header.csp_form_action_mediastream - - checkbox - - - security_header.csp_form_action_filesystem - - checkbox - - - security_header.csp_form_action_none - - checkbox - If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. - + + + header + + + + security_header.description + + text + This is only for your reference. + + + security_header.referrer + + + dropdown + +
  • Same Origin: The header will be sent if you stay on the same server using the same protocol (no data leak)
  • +
  • No Referrer When Downgrade: Prevents sending a referrer when switching from HTTPS to HTTP
  • +
  • Origin, Strict-Origin: Always send the header but no path or query information. Strict Origin additionally suppressed the header on downgrades.
  • +
  • (Strict) Origin When Cross Origin: Full Referrer on the same origin, and like (Strict) Origin when cross domain.
  • +
  • Unsafe URL: Sends the full URL to all pages
  • + ]]>
    +
    + + security_header.xssprotection + + + dropdown + +
  • Block: The browser should block the response
  • +
  • Off: Allow Anything
  • +
  • On: The Browser decides how to handle it.
  • + ]]>
    +
    + + security_header.content_type_options + + checkbox + + + header + + + + security_header.strict_transport_security_time + + text + A time in seconds in which the transport security (TLS) should be enforced. + + + security_header.strict_transport_security_include_subdomains + + checkbox + If checked, also subdomains are affected. + + + security_header.strict_transport_security_preload + + checkbox + an HSTS preload service. By following the guidelines and successfully submitting your domain, browsers will never connect to your domain using an insecure connection. While the service is hosted by Google, all browsers have stated an intent to use (or actually started using) the preload list. However, it is not part of the HSTS specification and should not be treated as official.]]> + + + header + + + + security_header.enable_csp + + checkbox + If checked, the Content Security Policy (CSP) header is enabled. A detailed configuration is still required via the other tabs of this sheet. + + + security_header.csp_report_only + + checkbox + If checked, the CSP is not enforced (learning mode). + +
    + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_default_src_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_default_src_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_default_src_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_default_src_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_default_src_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_default_src_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_default_src_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_default_src_mediastream + + checkbox + + + security_header.csp_default_src_filesystem + + checkbox + + + security_header.csp_default_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_script_src_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_script_src_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_script_src_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_script_src_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_script_src_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_script_src_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_script_src_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_script_src_mediastream + + checkbox + + + security_header.csp_script_src_filesystem + + checkbox + + + security_header.csp_script_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_img_src_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_img_src_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_img_src_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_img_src_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_img_src_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_img_src_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_img_src_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_img_src_mediastream + + checkbox + + + security_header.csp_img_src_filesystem + + checkbox + + + security_header.csp_img_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_style_src_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_style_src_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_style_src_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_style_src_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_style_src_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_style_src_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_style_src_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_style_src_mediastream + + checkbox + + + security_header.csp_style_src_filesystem + + checkbox + + + security_header.csp_style_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_media_src_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_media_src_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_media_src_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_media_src_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_media_src_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_media_src_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_media_src_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_media_src_mediastream + + checkbox + + + security_header.csp_media_src_filesystem + + checkbox + + + security_header.csp_media_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_frame_src_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_frame_src_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_frame_src_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_frame_src_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_frame_src_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_frame_src_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_frame_src_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_frame_src_mediastream + + checkbox + + + security_header.csp_frame_src_filesystem + + checkbox + + + security_header.csp_frame_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_frame_ancestors_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_frame_ancestors_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_frame_ancestors_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_frame_ancestors_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_frame_ancestors_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_frame_ancestors_mediastream + + checkbox + + + security_header.csp_frame_ancestors_filesystem + + checkbox + + + security_header.csp_frame_ancestors_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_font_src_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_font_src_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_font_src_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_font_src_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_font_src_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_font_src_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_font_src_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_font_src_mediastream + + checkbox + + + security_header.csp_font_src_filesystem + + checkbox + + + security_header.csp_font_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_form_action_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_form_action_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_form_action_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_form_action_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_form_action_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_form_action_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_form_action_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_form_action_mediastream + + checkbox + + + security_header.csp_form_action_filesystem + + checkbox + + + security_header.csp_form_action_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index 07411f8568..ddcdcf19d5 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -1194,19 +1194,10 @@ Y 1 - - N - /[a-z0-9\+\/=]+(,[a-z0-9\+\/=]+)*/i - - - Y - - - N - - + Y - + 0 + Y @@ -1448,6 +1439,76 @@ Y 0 + + Y + 0 + + + Y + 0 + + + N + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + N + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + Y 0 diff --git a/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt b/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt index 72bd40d91f..eacb21ea14 100644 --- a/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt +++ b/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/index.volt @@ -478,6 +478,11 @@ {{ lang._('Description') }} + {{ lang._('Referrer') }} + {{ lang._('XSS Protection') }} + {{ lang._('HSTS') }} + {{ lang._('CSP') }} + {{ lang._('CSP Rules') }} {{ lang._('Commands') }} @@ -691,7 +696,7 @@ {{ partial("layout_partials/base_dialog",['fields': httprewrite,'id':'httprewritedlg', 'label':lang._('Edit URL Rewrite')]) }} {{ partial("layout_partials/base_dialog",['fields': naxsi_custom_policy,'id':'custompolicydlg', 'label':lang._('Edit WAF Policy')]) }} {{ partial("layout_partials/base_dialog",['fields': naxsi_rule,'id':'naxsiruledlg', 'label':lang._('Edit Naxsi Rule')]) }} -{{ partial("layout_partials/base_dialog",['fields': security_headers,'id':'security_headersdlg', 'label':lang._('Edit Security Headers')]) }} +{{ partial("OPNsense/Nginx/tabbed_dialog",['fields': security_headers,'id':'security_headersdlg', 'label':lang._('Edit Security Headers')]) }} {{ partial("layout_partials/base_dialog",['fields': limit_request_connection,'id':'limit_request_connectiondlg', 'label':lang._('Edit Request Connection Limit')]) }} {{ partial("layout_partials/base_dialog",['fields': limit_zone,'id':'limit_zonedlg', 'label':lang._('Edit Limit Zone')]) }} {{ partial("layout_partials/base_dialog",['fields': cache_path,'id':'cache_pathdlg', 'label':lang._('Edit Cache Path')]) }} diff --git a/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/tabbed_dialog.volt b/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/tabbed_dialog.volt new file mode 100644 index 0000000000..0d5e75e9f0 --- /dev/null +++ b/www/nginx/src/opnsense/mvc/app/views/OPNsense/Nginx/tabbed_dialog.volt @@ -0,0 +1,183 @@ +{# + # Copyright (c) 2021 Manuel Faux + # OPNsense® is Copyright © 2014-2021 by Deciso B.V. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} + +{# + # Generate input dialog, uses the following parameters (as associative array): + # + # fields : list of field type objects, see form_input_tr tag for details + # id : form id, used as unique id for this modal form. inner form to place data is called frm_[id] + # save button is identified by btn_[id]_save + # label : dialog label + #} + +{# Volt templates in php7 have issues with scope sometimes, copy input values to make them more unique #} +{% set base_dialog_id=id %} +{% set base_dialog_fields=fields %} +{% set base_dialog_label=label %} + +{# Find if there are help supported or advanced field on this page #} +{% set base_dialog_help=false %} +{% set base_dialog_advanced=false %} +{% for field in base_dialog_fields|default({})%} + {% for name,element in field %} + {% if name=='help' %} + {% set base_dialog_help=true %} + {% endif %} + {% if name=='advanced' %} + {% set base_dialog_advanced=true %} + {% endif %} + {% endfor %} + {% if base_dialog_help|default(false) and base_dialog_advanced|default(false) %} + {% break %} + {% endif %} +{% endfor %} + + + + diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/security_rule.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/security_rule.conf index 73ab27993e..f309c4cbf2 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/security_rule.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/security_rule.conf @@ -1,3 +1,4 @@ + # security rules {% if security_rule.referrer is defined %} {% do our_headers.append('Referrer-Policy') %} add_header Referrer-Policy "{{ security_rule.referrer }}" always; @@ -13,21 +14,12 @@ {% if security_rule.strict_transport_security_time is defined %} {% do our_headers.append('Strict-Transport-Security') %} add_header Strict-Transport-Security "max-age={{ security_rule.strict_transport_security_time }}{% - if security_rule.strict_transport_security_include_subdomains is defined and - security_rule.strict_transport_security_include_subdomains == '1' %}; includeSubDomains{% endif %}" always; -{% endif %} -{% if security_rule.hpkp_keys is defined and security_rule.hpkp_time is defined %} -{% do our_headers.append('Public-Key-Pins') %} -{% do our_headers.append('Public-Key-Pins-Report-Only') %} - add_header Public-Key-Pins{% if security_rule.hpkp_report_only is defined and security_rule.hpkp_report_only == '1' - %}-Report-Only{% endif %} "{% for key in security_rule.hpkp_keys.split(',') - %}pin-sha256={{ key }}; {% endfor %}max-age={{ security_rule.hpkp_time }}{% - if security_rule.hpkp_include_subdomains is defined and - security_rule.hpkp_include_subdomains == '1' %}; includeSubDomains{% endif %}" always; + if security_rule.strict_transport_security_include_subdomains|default('0') == '1' %}; includeSubDomains{% endif %}{% + if security_rule.strict_transport_security_preload|default('0') == '1' %}; preload{% endif %}" always; {% endif %} {% if security_rule.enable_csp is defined and security_rule.enable_csp == '1' %} {% set hash_csp = {} %} -{% for csp_category in ['default-src', 'script-src', 'img-src', 'style-src', 'media-src', 'font-src', 'form-action'] %} +{% for csp_category in ['default-src', 'script-src', 'img-src', 'style-src', 'media-src', 'font-src', 'frame-src', 'frame-ancestors', 'form-action'] %} {% set prefix = 'csp_' + csp_category.replace('-', '_') + '_' %} {% if security_rule[prefix + 'enabled'] == '1' %} {% set current_list = [] %} From ecd60155980709115871d6c051ca3a06c49b57a6 Mon Sep 17 00:00:00 2001 From: Alanin Date: Thu, 13 Jan 2022 09:17:21 +0100 Subject: [PATCH 0909/3088] net/freeradius: options for fallback vlan (#2566) --- net/freeradius/Makefile | 3 +-- net/freeradius/pkg-descr | 4 ++++ .../OPNsense/Freeradius/forms/general.xml | 14 +++++++++++ .../models/OPNsense/Freeradius/General.xml | 24 ++++++++++++++++++- .../templates/OPNsense/Freeradius/users | 8 +++++++ 5 files changed, 50 insertions(+), 3 deletions(-) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index 1cf9e37c6f..a98a82cb33 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= freeradius -PLUGIN_VERSION= 1.9.17 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.9.18 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index 48d2418319..d2006a9d0d 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -15,6 +15,10 @@ The server is fast, feature-rich, modular, and scalable. Plugin Changelog ================ +1.9.18 + +* Added support for fallback VLAN + 1.9.17 * Added support for Extreme networks EXOS switch Extreme-Netlogin-Extended-VLAN VSA and policy for GEN2 (contributed by Pasi Suominen) diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/general.xml b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/general.xml index 65a8795af1..c97af703e6 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/general.xml +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/general.xml @@ -11,6 +11,20 @@ checkbox This allows you to dynamically assign VLANs on your physical switch ports. + + general.fallbackvlan_enabled + + checkbox + true + This allows you to define a fallback VLAN-Group-ID. Warning: Setting this option will send an accepted RADIUS reply even if the authentication attempt fails. + + + general.fallbackvlan_id + + text + true + Define the Fallback VLAN group ID. + general.ldap_enabled diff --git a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/General.xml b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/General.xml index be78892afe..a0aa117928 100644 --- a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/General.xml +++ b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/General.xml @@ -1,7 +1,7 @@ //OPNsense/freeradius/general FreeRADIUS configuration - 1.0.1 + 1.0.2 0 @@ -11,6 +11,28 @@ 0 N + + 0 + Y + + + fallbackvlan_id.check001 + + + + + 1 + 4096 + + + You need to set a propper VLAN ID. + DependConstraint + + fallbackvlan_enabled + + + + 0 N diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users index 3d1f99e6ab..a7c46550e6 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users @@ -98,4 +98,12 @@ DEFAULT Hint == "CSLIP" DEFAULT Hint == "SLIP" Framed-Protocol = SLIP +{% if helpers.exists('OPNsense.freeradius.general.fallbackvlan_enabled') and OPNsense.freeradius.general.fallbackvlan_enabled == '1' %} + +DEFAULT Auth-Type := Accept + Tunnel-Type = VLAN, + Tunnel-Medium-Type = IEEE-802, + Tunnel-Private-Group-Id = {{ OPNsense.freeradius.general.fallbackvlan_id }}, + Framed-Protocol = PPP +{% endif %} {% endif %} From 1ab87794b318d41aa23b4b79b0952ea6ac9ebc5a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 17 Jan 2022 08:14:31 +0100 Subject: [PATCH 0910/3088] www/nginx: style sweep --- .../OPNsense/Nginx/Api/SettingsController.php | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php index 853a83291a..19d73ae696 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/Api/SettingsController.php @@ -342,11 +342,14 @@ public function sethttprewriteAction($uuid) // http security headers public function searchsecurityHeaderAction() { - $data = $this->searchBase('security_header', + $data = $this->searchBase( + 'security_header', ['description', 'referrer', 'xssprotection', 'strict_transport_security_time', 'enable_csp', 'csp_report_only', 'csp_default_src_enabled', 'csp_script_src_enabled', 'csp_img_src_enabled', 'csp_style_src_enabled', 'csp_media_src_enabled', 'csp_font_src_enabled', 'csp_frame_src_enabled', - 'csp_frame_ancestors_enabled', 'csp_form_action_enabled']); + 'csp_frame_ancestors_enabled', + 'csp_form_action_enabled'] + ); // Create "hsts" column (disabled/time) foreach ($data['rows'] as &$row) { @@ -374,15 +377,33 @@ public function searchsecurityHeaderAction() foreach ($data['rows'] as &$row) { if ($row['enable_csp']) { $enabled = []; - if ($row['csp_default_src_enabled']) $enabled[] = gettext("Default Source"); - if ($row['csp_script_src_enabled']) $enabled[] = gettext("Script Source"); - if ($row['csp_img_src_enabled']) $enabled[] = gettext("Image Source"); - if ($row['csp_style_src_enabled']) $enabled[] = gettext("Style Source"); - if ($row['csp_media_src_enabled']) $enabled[] = gettext("Media Source"); - if ($row['csp_font_src_enabled']) $enabled[] = gettext("Font Source"); - if ($row['csp_frame_src_enabled']) $enabled[] = gettext("Frame Source"); - if ($row['csp_frame_ancestors_enabled']) $enabled[] = gettext("Frame Ancestors"); - if ($row['csp_form_action_enabled']) $enabled[] = gettext("Form Action"); + if ($row['csp_default_src_enabled']) { + $enabled[] = gettext("Default Source"); + } + if ($row['csp_script_src_enabled']) { + $enabled[] = gettext("Script Source"); + } + if ($row['csp_img_src_enabled']) { + $enabled[] = gettext("Image Source"); + } + if ($row['csp_style_src_enabled']) { + $enabled[] = gettext("Style Source"); + } + if ($row['csp_media_src_enabled']) { + $enabled[] = gettext("Media Source"); + } + if ($row['csp_font_src_enabled']) { + $enabled[] = gettext("Font Source"); + } + if ($row['csp_frame_src_enabled']) { + $enabled[] = gettext("Frame Source"); + } + if ($row['csp_frame_ancestors_enabled']) { + $enabled[] = gettext("Frame Ancestors"); + } + if ($row['csp_form_action_enabled']) { + $enabled[] = gettext("Form Action"); + } if (count($enabled)) { $row['csp_details'] = implode(', ', $enabled); From b7793cdf0fc5e1d27fe46410eed84027623cf6fa Mon Sep 17 00:00:00 2001 From: Manuel Faux Date: Sun, 16 Jan 2022 17:01:13 +0100 Subject: [PATCH 0911/3088] www/nginx: model was modified in 5a61822 but version not incremented --- www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index ddcdcf19d5..c6d69989b2 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -1,6 +1,6 @@ //OPNsense/Nginx - 1.24.0 + 1.26.0 nginx web server, reverse proxy and waf From 874d2e393e29951ed57c220f9f06e49a73790a5f Mon Sep 17 00:00:00 2001 From: digitalshow Date: Mon, 17 Jan 2022 08:33:30 +0100 Subject: [PATCH 0912/3088] Add description and message to wol action (#2753) To be able to create a cronjob via the web GUI we need a description for the action. --- net/wol/src/opnsense/service/conf/actions.d/actions_wol.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wol/src/opnsense/service/conf/actions.d/actions_wol.conf b/net/wol/src/opnsense/service/conf/actions.d/actions_wol.conf index bc90627a32..696fc145d1 100644 --- a/net/wol/src/opnsense/service/conf/actions.d/actions_wol.conf +++ b/net/wol/src/opnsense/service/conf/actions.d/actions_wol.conf @@ -2,3 +2,5 @@ command:/usr/local/bin/wol -i parameters: %s %s type:script +description:Wake-On-LAN for host with broadcast IP and MAC +message:Waking up host %s %s From 6778f56508f389c79acbe6148b0a469afdf6e3f8 Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Mon, 17 Jan 2022 11:27:15 +0300 Subject: [PATCH 0913/3088] www/nginx: 1.24.0 migration fix (#2755) --- .../OPNsense/Nginx/Migrations/M1_24_0.php | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Migrations/M1_24_0.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Migrations/M1_24_0.php index 981fbd99a4..ef2817157f 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Migrations/M1_24_0.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Migrations/M1_24_0.php @@ -29,26 +29,33 @@ namespace OPNsense\Nginx\Migrations; use OPNsense\Base\BaseModelMigration; +use OPNsense\Core\Config; class M1_24_0 extends BaseModelMigration { + /** + * Listen ports to listen addresses movements + * @param Nginx $model + */ public function run($model) { - foreach ($model->getNodeByReference('http_server')->iterateItems() as $http_server) { - if ($http_server->listen_http_port != '') { - $http_server->listen_http_address = $http_server->listen_http_port . ',[::]:' . $http_server->listen_http_port; - $http_server->listen_http_port = null; - } - if ($http_server->listen_https_port != '') { - $http_server->listen_https_address = $http_server->listen_https_port . ',[::]:' . $http_server->listen_https_port; - $http_server->listen_https_port = null; - } + $cfgObj = Config::getInstance()->object(); + $ports = array(); + foreach ($cfgObj->OPNsense->Nginx->http_server as $cfg_http_server) { + $uuid = (string)$cfg_http_server->attributes()['uuid']; + $ports['http_port'] = (isset($cfg_http_server->listen_http_port) && $cfg_http_server->listen_http_port != '') ? $cfg_http_server->listen_http_port : null; + $ports['https_port'] = (isset($cfg_http_server->listen_https_port) && $cfg_http_server->listen_https_port != '') ? $cfg_http_server->listen_https_port : null; + $http_server = $model->getNodeByReference('http_server.' . $uuid); + $http_server->listen_http_address = (isset($ports['http_port'])) ? $ports['http_port'] . ',[::]:' . $ports['http_port'] : null; + $http_server->listen_https_address = (isset($ports['https_port'])) ? $ports['https_port'] . ',[::]:' . $ports['https_port'] : null; } - foreach ($model->getNodeByReference('stream_server')->iterateItems() as $server) { - if ($server->listen_port != '') { - $server->listen_address = $server->listen_port . ',[::]:' . $server->listen_port; - $server->listen_port = null; - } + foreach ($cfgObj->OPNsense->Nginx->stream_server as $cfg_stream_server) { + $uuid = (string)$cfg_stream_server->attributes()['uuid']; + $port = (isset($cfg_stream_server->listen_port) && $cfg_stream_server->listen_port != '') ? $cfg_stream_server->listen_port : null; + $server = $model->getNodeByReference('stream_server.' . $uuid); + $server->listen_address = (isset($port)) ? $port . ',[::]:' . $port : null; } + // run default migration actions + parent::run($model); } } From 6bf0c6386512a02d40453a95ed92e87b7d48bad1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 17 Jan 2022 13:57:57 +0100 Subject: [PATCH 0914/3088] dns/ddclient: ready for release --- LICENSE | 2 +- README.md | 2 +- dns/ddclient/Makefile | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 7650f46e65..e3a53b56c0 100644 --- a/LICENSE +++ b/LICENSE @@ -24,7 +24,7 @@ Copyright (c) 2010 Jim Pingle Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça Copyright (c) 2019 Juergen Kellerer -Copyright (c) 2020 Manuel Faux +Copyright (c) 2020-2021 Manuel Faux Copyright (c) 2021 Manuel Hofmann Copyright (c) 2003-2004 Manuel Kasper Copyright (c) 2020 Marc Leuser diff --git a/README.md b/README.md index 650f72b703..0dabdf1213 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ devel/debug -- Debugging Tools devel/grid_example -- A sample framework application devel/helloworld -- A sample framework application dns/bind -- BIND domain name service -dns/ddclient -- Dynamic DNS client (development only) +dns/ddclient -- Dynamic DNS client dns/dnscrypt-proxy -- Flexible DNS proxy supporting DNSCrypt and DoH dns/dyndns -- Dynamic DNS Support dns/rfc2136 -- RFC-2136 Support diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 7fed78369e..2c67781fd6 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_DEVEL= yes -PLUGIN_VERSION= 0.1 +PLUGIN_VERSION= 1.0 #PLUGIN_REVISION= 1 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client From 6ed716ea25c4ee57caaa2072ee284aa20cd80c79 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 17 Jan 2022 14:22:21 +0100 Subject: [PATCH 0915/3088] dns/dyndns - flag for removal and move shared function get_dyndns_ip() into package to isolate it further. Our new ddclient plugin replaces the old dyndns one, make sure people know it's going away so they can contribute other vendors if needed or switch to the ones that are already supported. (also related to https://github.com/opnsense/core/issues/5434) --- .../src/etc/inc/plugins.inc.d/dyndns.inc | 39 +++++++++++++++++++ .../inc/plugins.inc.d/dyndns/phpDynDNS.inc | 2 +- dns/dyndns/src/www/services_dyndns.php | 9 ++++- .../widgets/widgets/dyn_dns_status.widget.php | 13 ++++++- 4 files changed, 58 insertions(+), 5 deletions(-) diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc index 762549e53e..54f1db403d 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns.inc @@ -249,3 +249,42 @@ function dyndns_failover_interface($interface, $family = 'all') /* fall through to get real interface the hard way */ return get_real_interface($interface, $family); } + + +function get_dyndns_ip_address($int, $ipver = 4) +{ + $ip_address = $ipver == 6 ? get_interface_ipv6($int) : get_interface_ip($int); + if (empty($ip_address)) { + log_error("Aborted IPv{$ipver} detection: no address for {$int}"); + return 'down'; + } + + if ($ipver != 6 && is_private_ip($ip_address)) { + /* Chinese alternative is http://ip.3322.net/ */ + $hosttocheck = 'http://checkip.dyndns.org'; + $ip_ch = curl_init($hosttocheck); + curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ip_ch, CURLOPT_INTERFACE, $ip_address); + curl_setopt($ip_ch, CURLOPT_CONNECTTIMEOUT, 5); + curl_setopt($ip_ch, CURLOPT_TIMEOUT, 30); + curl_setopt($ip_ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + $ip_result = curl_exec($ip_ch); + if ($ip_result !== false) { + preg_match('=Current IP Address: (.*)=siU', $ip_result, $matches); + $ip_address = trim($matches[1]); + } else { + log_error('Aborted IPv4 detection: ' . curl_error($ip_ch)); + $ip_address = ''; + } + curl_close($ip_ch); + } elseif ($ipver == 6 && is_linklocal($ip_address)) { + log_error('Aborted IPv6 detection: cannot bind to link-local address'); + $ip_address = ''; + } + + if (($ipver == 6 && !is_ipaddrv6($ip_address)) || ($ipver != 6 && !is_ipaddrv4($ip_address))) { + return 'down'; + } + + return $ip_address; +} diff --git a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc index 44ceb97556..0bf6908165 100644 --- a/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc +++ b/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc @@ -2022,7 +2022,7 @@ class updatedns function _checkIP() { - $ip_address = get_dyndns_ip($this->_if, $this->_useIPv6 ? 6 : 4); + $ip_address = get_dyndns_ip_address($this->_if, $this->_useIPv6 ? 6 : 4); if (!is_ipaddr($ip_address)) { if ($this->_dnsVerboseLog) { log_error("Dynamic DNS ({$this->_dnsHost}): IP address could not be extracted"); diff --git a/dns/dyndns/src/www/services_dyndns.php b/dns/dyndns/src/www/services_dyndns.php index 30f5d259ce..a209477baa 100644 --- a/dns/dyndns/src/www/services_dyndns.php +++ b/dns/dyndns/src/www/services_dyndns.php @@ -110,6 +110,11 @@
    +
    @@ -146,14 +151,14 @@ $filename = dyndns_cache_file($dyndns, 4); $fdata = ''; if (file_exists($filename) && !empty($dyndns['enable'])) { - $ipaddr = get_dyndns_ip(dyndns_failover_interface($dyndns['interface'], 'all'), 4); + $ipaddr = get_dyndns_ip_address(dyndns_failover_interface($dyndns['interface'], 'all'), 4); $fdata = @file_get_contents($filename); } $filename_v6 = dyndns_cache_file($dyndns, 6); $fdata6 = ''; if (file_exists($filename_v6) && !empty($dyndns['enable'])) { - $ipv6addr = get_dyndns_ip(dyndns_failover_interface($dyndns['interface'], 'inet6'), 6); + $ipv6addr = get_dyndns_ip_address(dyndns_failover_interface($dyndns['interface'], 'inet6'), 6); $fdata6 = @file_get_contents($filename_v6); } diff --git a/dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php b/dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php index 7728dec222..55a59d6115 100644 --- a/dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php +++ b/dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php @@ -48,14 +48,14 @@ $filename = dyndns_cache_file($dyndns, 4); $fdata = ''; if (!empty($dyndns['enable']) && file_exists($filename)) { - $ipaddr = get_dyndns_ip(dyndns_failover_interface($dyndns['interface'], 'all'), 4); + $ipaddr = get_dyndns_ip_address(dyndns_failover_interface($dyndns['interface'], 'all'), 4); $fdata = @file_get_contents($filename); } $filename_v6 = dyndns_cache_file($dyndns, 6); $fdata6 = ''; if (!empty($dyndns['enable']) && file_exists($filename_v6)) { - $ipv6addr = get_dyndns_ip(dyndns_failover_interface($dyndns['interface'], 'inet6'), 6); + $ipv6addr = get_dyndns_ip_address(dyndns_failover_interface($dyndns['interface'], 'inet6'), 6); $fdata6 = @file_get_contents($filename_v6); } @@ -86,6 +86,15 @@ + + + From 9012be99d82c5daa9ef26a0f0077146e9d58aa30 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 17 Jan 2022 14:28:36 +0100 Subject: [PATCH 0916/3088] dns/rfc2136 - move get_dyndns_ip() to plugin to avoid further usage from core, related to https://github.com/opnsense/core/issues/5434 --- .../src/etc/inc/plugins.inc.d/rfc2136.inc | 42 ++++++++++++++++++- dns/rfc2136/src/www/services_rfc2136.php | 4 +- .../www/widgets/widgets/rfc2136.widget.php | 4 +- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc b/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc index 8663b5f250..1a568bc86a 100644 --- a/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc +++ b/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc @@ -173,7 +173,7 @@ EOD; list($cachedipv4, $cacheTimev4) = array('', ''); } if (isset($dnsupdate['usepublicip'])) { - $wanip = get_dyndns_ip($dnsupdate['interface'], 4); + $wanip = get_rfc2136_ip_address($dnsupdate['interface'], 4); } else { $wanip = get_interface_ip($dnsupdate['interface']); } @@ -200,7 +200,7 @@ EOD; list($cachedipv6, $cacheTimev6) = array('', ''); } if (isset($dnsupdate['usepublicip'])) { - $wanipv6 = get_dyndns_ip($dnsupdate['interface'], 6); + $wanipv6 = get_rfc2136_ip_address($dnsupdate['interface'], 6); } else { $wanipv6 = get_interface_ipv6($dnsupdate['interface']); } @@ -239,3 +239,41 @@ EOD; echo "done.\n"; } } + +function get_rfc2136_ip_address($int, $ipver = 4) +{ + $ip_address = $ipver == 6 ? get_interface_ipv6($int) : get_interface_ip($int); + if (empty($ip_address)) { + log_error("Aborted IPv{$ipver} detection: no address for {$int}"); + return 'down'; + } + + if ($ipver != 6 && is_private_ip($ip_address)) { + /* Chinese alternative is http://ip.3322.net/ */ + $hosttocheck = 'http://checkip.dyndns.org'; + $ip_ch = curl_init($hosttocheck); + curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ip_ch, CURLOPT_INTERFACE, $ip_address); + curl_setopt($ip_ch, CURLOPT_CONNECTTIMEOUT, 5); + curl_setopt($ip_ch, CURLOPT_TIMEOUT, 30); + curl_setopt($ip_ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); + $ip_result = curl_exec($ip_ch); + if ($ip_result !== false) { + preg_match('=Current IP Address: (.*)=siU', $ip_result, $matches); + $ip_address = trim($matches[1]); + } else { + log_error('Aborted IPv4 detection: ' . curl_error($ip_ch)); + $ip_address = ''; + } + curl_close($ip_ch); + } elseif ($ipver == 6 && is_linklocal($ip_address)) { + log_error('Aborted IPv6 detection: cannot bind to link-local address'); + $ip_address = ''; + } + + if (($ipver == 6 && !is_ipaddrv6($ip_address)) || ($ipver != 6 && !is_ipaddrv4($ip_address))) { + return 'down'; + } + + return $ip_address; +} diff --git a/dns/rfc2136/src/www/services_rfc2136.php b/dns/rfc2136/src/www/services_rfc2136.php index 16936da0a6..a7a5029bbb 100644 --- a/dns/rfc2136/src/www/services_rfc2136.php +++ b/dns/rfc2136/src/www/services_rfc2136.php @@ -146,7 +146,7 @@ if (file_exists($filename) && !empty($rfc2136['enable']) && (empty($rfc2136['recordtype']) || $rfc2136['recordtype'] == 'A')) { echo "IPv4: "; if (isset($rfc2136['usepublicip'])) { - $ipaddr = get_dyndns_ip($rfc2136['interface'], 4); + $ipaddr = get_rfc2136_ip_address($rfc2136['interface'], 4); } else { $ipaddr = get_interface_ip($rfc2136['interface']); } @@ -167,7 +167,7 @@ if (file_exists($filename6) && !empty($rfc2136['enable']) && (empty($rfc2136['recordtype']) || $rfc2136['recordtype'] == 'AAAA')) { echo "IPv6: "; if (isset($rfc2136['usepublicip'])) { - $ipaddr = get_dyndns_ip($rfc2136['interface'], 6); + $ipaddr = get_rfc2136_ip_address($rfc2136['interface'], 6); } else { $ipaddr = get_interface_ipv6($rfc2136['interface']); } diff --git a/dns/rfc2136/src/www/widgets/widgets/rfc2136.widget.php b/dns/rfc2136/src/www/widgets/widgets/rfc2136.widget.php index 3dc9a58cc0..0c2d57611b 100644 --- a/dns/rfc2136/src/www/widgets/widgets/rfc2136.widget.php +++ b/dns/rfc2136/src/www/widgets/widgets/rfc2136.widget.php @@ -49,14 +49,14 @@ $filename = rfc2136_cache_file($rfc2136, 4); $fdata = ''; if (!empty($rfc2136['enable']) && (empty($rfc2136['recordtype']) || $rfc2136['recordtype'] == 'A') && file_exists($filename)) { - $ipaddr = get_dyndns_ip($rfc2136['interface'], 4); + $ipaddr = get_rfc2136_ip_address($rfc2136['interface'], 4); $fdata = @file_get_contents($filename); } $filename_v6 = rfc2136_cache_file($rfc2136, 6); $fdata6 = ''; if (!empty($rfc2136['enable']) && (empty($rfc2136['recordtype']) || $rfc2136['recordtype'] == 'AAAA') && file_exists($filename_v6)) { - $ipv6addr = get_dyndns_ip($rfc2136['interface'], 6); + $ipv6addr = get_rfc2136_ip_address($rfc2136['interface'], 6); $fdata6 = @file_get_contents($filename_v6); } From b7295b3275d380918965970f8d0ac39ecb462daa Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 18 Jan 2022 08:04:28 +0100 Subject: [PATCH 0917/3088] dns: bump legacy plugins after function transfer --- dns/dyndns/Makefile | 2 +- dns/rfc2136/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index cd07376764..5bb7b9f3fd 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.27 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/dns/rfc2136/Makefile b/dns/rfc2136/Makefile index dc089e39b0..9a1a3618ea 100644 --- a/dns/rfc2136/Makefile +++ b/dns/rfc2136/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= rfc2136 PLUGIN_VERSION= 1.6 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= RFC-2136 Support PLUGIN_MAINTAINER= franco@opnsense.org PLUGIN_DEPENDS= bind-tools From 58880dede5c0f67f3893451d7158d241ae6afc82 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 18 Jan 2022 08:09:32 +0100 Subject: [PATCH 0918/3088] net/wol: bump after cron change --- net/wol/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wol/Makefile b/net/wol/Makefile index 818fde3268..2cb9a50e81 100644 --- a/net/wol/Makefile +++ b/net/wol/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wol PLUGIN_VERSION= 2.4 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= wol PLUGIN_COMMENT= Wake on LAN Service PLUGIN_MAINTAINER= franco@opnsense.org From f591681ff72e1460e45413d42b69e43644b20c37 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 19 Jan 2022 22:07:03 +0100 Subject: [PATCH 0919/3088] net/haproxy: upgrade to HAProxy 2.4 release series, refs #2644 --- net/haproxy/Makefile | 2 +- net/haproxy/pkg-descr | 9 +++++++++ .../OPNsense/HAProxy/forms/dialogAction.xml | 10 +++++----- .../OPNsense/HAProxy/forms/dialogBackend.xml | 10 +++++----- .../OPNsense/HAProxy/forms/dialogFrontend.xml | 6 +++--- .../OPNsense/HAProxy/forms/dialogMapfile.xml | 2 +- .../opnsense/mvc/app/views/OPNsense/HAProxy/index.volt | 10 +++++----- 7 files changed, 29 insertions(+), 20 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 1a155bad49..bcb5e4a497 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 3.9 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer -PLUGIN_DEPENDS= haproxy22 +PLUGIN_DEPENDS= haproxy24 PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index c809c34340..758d0a1029 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,14 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.10 + +WARNING: This release switches to the HAProxy 2.4 release series, +which may result in incompatible changes for some users. + +Changed: +* upgrade to HAProxy 2.4 release series (#2644) + 3.9 Added: @@ -117,6 +125,7 @@ Fixed: * prevent the deletion of items that are still referenced elsewhere (core/#1897) Changed: +* upgrade to HAProxy 2.2 release series (#2092) * change default SSL version to TLSv1.2 (ssl-min-ver) * remove weak ciphers from (default) SSL settings * remove default SSL bind options that would conflict with ssl-min-ver diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml index f0d17e77e2..c810642591 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml @@ -89,7 +89,7 @@ action.http_request_redirect text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -128,7 +128,7 @@ action.http_request_add_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -145,7 +145,7 @@ action.http_request_set_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -251,7 +251,7 @@ action.http_response_add_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -268,7 +268,7 @@ action.http_response_set_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index 31e0eda988..27a6115e2c 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -28,7 +28,7 @@ backend.algorithm dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> Choose a load balancing algorithm. @@ -42,7 +42,7 @@ backend.proxyProtocol dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> true @@ -186,7 +186,7 @@ backend.persistence_cookiemode dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> backend.persistence_cookiename @@ -208,14 +208,14 @@ backend.stickiness_pattern dropdown - HAProxy documentation for a full description.
    NOTE: Consider not using this feature in multi-process mode, it can result in random behaviours.
    ]]>
    + HAProxy documentation for a full description.
    NOTE: Consider not using this feature in multi-process mode, it can result in random behaviours.
    ]]>
    Choose a persistence type.
    backend.stickiness_dataTypes select_multiple - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> backend.stickiness_expire diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml index 682e0bb278..6d6a4cda76 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml @@ -322,14 +322,14 @@ frontend.stickiness_pattern dropdown - HAProxy documentation for further information.]]> + HAProxy documentation for further information.]]> Choose a stick-table type. frontend.stickiness_dataTypes select_multiple - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> frontend.stickiness_expire @@ -356,7 +356,7 @@ frontend.stickiness_counter_key text - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> true diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml index f571ce69c3..d988e782e4 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml @@ -15,6 +15,6 @@ mapfile.content textbox - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index ba0cf32f02..eda3e7ff1a 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -698,7 +698,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Lastly, enable HAProxy using the %sService%s settings page.') | format('', '') }}
  • {{ lang._('Please be aware that you need to %smanually%s add the required firewall rules for all configured services.') | format('', '') }}

    -

    {{ lang._('Further information is available in our %sHAProxy plugin documentation%s and of course in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '', '', '') }}

    +

    {{ lang._('Further information is available in our %sHAProxy plugin documentation%s and of course in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '', '', '') }}


    @@ -740,7 +740,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('%sConditions:%s HAProxy is capable of extracting data from requests, responses and other connection data and match it against predefined patterns. Use these powerful patterns to compose a condition that may be used in multiple Rules.') | format('', '') }}
  • {{ lang._('%sRules:%s Perform a large set of actions if one or more %sConditions%s match. These Rules may be used in %sBackend Pools%s as well as %sPublic Services%s.') | format('', '', '', '', '', '', '', '') }}
  • -

    {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    +

    {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    {{ lang._('Note that it is possible to directly add options to the HAProxy configuration by using the "option pass-through", a setting that is available for several configuration items. It allows you to implement configurations that are currently not officially supported by this plugin. It is strongly discouraged to rely on this feature. Please report missing features on our GitHub page!') | format('', '') }}


    @@ -755,7 +755,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('%sGroup:%s A optional list containing one or more users. Groups usually make it easier to manage permissions for a large number of users') | format('', '') }}
  • {{ lang._('Note that users and groups must be selected from the Backend Pool or Public Service configuration in order to be used for authentication. In addition to this users and groups may also be used in Rules/Conditions.') }}

    -

    {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    +

    {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}


    @@ -773,7 +773,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sCache:%s HAProxy's cache which was designed to perform cache on small objects (favicon, css, etc.). This is a minimalist low-maintenance cache which runs in RAM.") | format('', '', '', '') }}
  • {{ lang._("%sPeers:%s Configure a communication channel between two HAProxy instances. This will propagate entries of any data-types in stick-tables between these HAProxy instances over TCP connections in a multi-master fashion. Useful when aiming for a seamless failover in a HA setup.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}


    @@ -790,7 +790,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sResolvers:%s This feature allows in-depth configuration of how HAProxy handles name resolution and interacts with name resolvers (DNS). Each resolver configuration can be used in %sBackend Pools%s to apply individual name resolution configurations.") | format('', '', '', '') }}
  • {{ lang._("%sE-Mail Alerts:%s It is possible to send email alerts when the state of servers changes. Each configuration can be used in %sBackend Pools%s to send e-mail alerts to the configured recipient.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}


    From d5e60e9f77f3862f54fbfa9e54181107ac136110 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 19 Jan 2022 22:16:58 +0100 Subject: [PATCH 0920/3088] net/haproxy: remove deprecated option tune.chksize (#2644) --- net/haproxy/pkg-descr | 3 +++ .../controllers/OPNsense/HAProxy/forms/generalTuning.xml | 7 ------- .../opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 7 ------- .../service/templates/OPNsense/HAProxy/haproxy.conf | 3 --- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 758d0a1029..cba85b6e40 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -14,6 +14,9 @@ which may result in incompatible changes for some users. Changed: * upgrade to HAProxy 2.4 release series (#2644) +Removed: +* remove deprecated option tune.chksize (#2644) + 3.9 Added: diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml index ea55662de4..ff481bd137 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml @@ -48,13 +48,6 @@
    NOTE: It is strongly recommended not to change this from the default value, as very low values will break some services such as statistics, and values larger than default size will increase memory usage, possibly causing the system to run out of memory.
    ]]>
    true - - haproxy.general.tuning.checkBufferSize - - text - - true - haproxy.general.tuning.luaMaxMem diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index ff4e24be8a..9ef6f67485 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -109,13 +109,6 @@ Please specify a value between 1024 and 1048576. N - - 16384 - 1024 - 1048576 - Please specify a value between 1024 and 1048576. - N - 2 0 diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 71e377f182..94403c1ae0 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -975,9 +975,6 @@ global {% if OPNsense.HAProxy.general.tuning.bogusProxyEnabled|default("") == '1' %} pp2-never-send-local {% endif %} -{% if OPNsense.HAProxy.general.tuning.checkBufferSize|default("") != "" %} - tune.chksize {{OPNsense.HAProxy.general.tuning.checkBufferSize}} -{% endif %} {% if OPNsense.HAProxy.general.tuning.bufferSize|default("") != "" %} tune.bufsize {{OPNsense.HAProxy.general.tuning.bufferSize}} {% endif %} From 66d0b8682b7ddaa239a3e3d4519decb2efc7a328 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 19 Jan 2022 23:14:14 +0100 Subject: [PATCH 0921/3088] net/haproxy: disable strict-limits for safekeeping, refs #2644 --- net/haproxy/pkg-descr | 1 + .../app/controllers/OPNsense/HAProxy/forms/generalTuning.xml | 2 +- .../opnsense/service/templates/OPNsense/HAProxy/haproxy.conf | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index cba85b6e40..eacea0b890 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -13,6 +13,7 @@ which may result in incompatible changes for some users. Changed: * upgrade to HAProxy 2.4 release series (#2644) +* disable strict-limits for safekeeping (#2644) Removed: * remove deprecated option tune.chksize (#2644) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml index ff481bd137..8d93dc989b 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml @@ -27,7 +27,7 @@ haproxy.general.tuning.maxConnections text -
    NOTE: HAProxy will not be able to allocate enough memory if you set this value too high. Consider raising the settings for kern.maxfiles and kern.maxfilesperproc if you need to specify a non-default value.
    ]]>
    +
    NOTE: Consider raising the settings for kern.maxfiles and kern.maxfilesperproc in System: Settings: Tunables, otherwise HAProxy will fail to open the specified number of connections.
    ]]>
    haproxy.general.tuning.sslServerVerify diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 94403c1ae0..0c8c1ab2ea 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -958,6 +958,9 @@ global {% if OPNsense.HAProxy.general.hardStopAfter|default('') != '' %} hard-stop-after {{OPNsense.HAProxy.general.hardStopAfter}} {% endif %} +{# # Disable strict-limits because a syntax check will not reveal #} +{# # whether kern.maxfilesperproc or kern.maxfiles are too low. #} + no strict-limits {% if helpers.exists('OPNsense.HAProxy.general.tuning.maxConnections') %} maxconn {{OPNsense.HAProxy.general.tuning.maxConnections}} {% endif %} From 67946800aadf2544a8ad5ae82505c7b760f5248b Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 19 Jan 2022 23:51:48 +0100 Subject: [PATCH 0922/3088] net/haproxy: add support for DNS resolution over TCP, refs #2644 --- net/haproxy/pkg-descr | 3 +++ .../controllers/OPNsense/HAProxy/forms/dialogResolver.xml | 4 ++-- .../opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 8 ++++---- .../service/templates/OPNsense/HAProxy/haproxy.conf | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index eacea0b890..bf40d39e77 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -11,6 +11,9 @@ Plugin Changelog WARNING: This release switches to the HAProxy 2.4 release series, which may result in incompatible changes for some users. +Added: +* add support for DNS resolution over TCP (#2644) + Changed: * upgrade to HAProxy 2.4 release series (#2644) * disable strict-limits for safekeeping (#2644) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml index a769aead4c..73ca63cdce 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogResolver.xml @@ -24,7 +24,7 @@ true true - + Enter ip:port here. Finish with TAB. @@ -55,7 +55,7 @@ resolver.accepted_payload_size text - + true diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 9ef6f67485..efa38510d2 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -2796,9 +2796,9 @@ N Y Y - /^((([0-9a-zA-Z._\-\*:\[\]]+:[0-9]+(-[0-9]+)?)([,]){0,1}))*/u + /^((((udp@|tcp@)?[0-9a-zA-Z._\-\*:\[\]]+:[0-9]+(-[0-9]+)?)([,]){0,1}))*/u lower - Please provide a valid nameserver address, i.e. 127.0.0.1:53, [::1]:53 or 192.168.1.1:53. + Please provide a valid nameserver address, i.e. 127.0.0.1:53, [::1]:53 or tcp@192.168.1.1:53. 0 @@ -2825,8 +2825,8 @@ 0 - 8192 - Should be a number between 0 and 8192 + 65535 + Should be a number between 0 and 65535 N diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 0c8c1ab2ea..34862fb13f 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1174,7 +1174,8 @@ userlist stats_auth resolvers {{resolver.id}} {% if resolver.nameservers|default("") != "" %} {% for nameserver in resolver.nameservers.split(",") %} - nameserver {{nameserver}} {{nameserver}} +{# # special characters are not supported in server names #} + nameserver {{nameserver|replace('@', '_')}} {{nameserver}} {% endfor %} {% endif %} {% if resolver.parse_resolv_conf|default("") == "1" %} From daa9e3e1887f6f6660b6f9d06a54dc17eccd0264 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 20 Jan 2022 00:00:06 +0100 Subject: [PATCH 0923/3088] net/haproxy: bump plugin and model versions --- net/haproxy/Makefile | 2 +- .../src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index bcb5e4a497..56e1e159a7 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.9 +PLUGIN_VERSION= 3.10 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy24 PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index efa38510d2..e24826e1ee 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 3.5.0 + 3.6.0 the HAProxy load balancer From f2adc7799ea3080caf841a10f99f316ddfe0ac1f Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 20 Jan 2022 00:23:35 +0100 Subject: [PATCH 0924/3088] net/haproxy: fix link to tunables page --- .../app/controllers/OPNsense/HAProxy/forms/generalTuning.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml index 8d93dc989b..807087cce9 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml @@ -27,7 +27,7 @@ haproxy.general.tuning.maxConnections text -
    NOTE: Consider raising the settings for kern.maxfiles and kern.maxfilesperproc in System: Settings: Tunables, otherwise HAProxy will fail to open the specified number of connections.
    ]]>
    +
    NOTE: Consider raising the settings for kern.maxfiles and kern.maxfilesperproc in System: Settings: Tunables, otherwise HAProxy will fail to open the specified number of connections.
    ]]>
    haproxy.general.tuning.sslServerVerify From 6f7127fdc6e623469ca5edc8c595912b9b916367 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 21 Jan 2022 11:41:15 +0100 Subject: [PATCH 0925/3088] net/wireguard: Allow 100 instances (#2760) --- net/wireguard/Makefile | 2 +- net/wireguard/pkg-descr | 4 ++++ .../opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml | 5 +---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 8cd2d5c43a..22a3d57f17 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 1.9 +PLUGIN_VERSION= 1.10 PLUGIN_COMMENT= WireGuard VPN service PLUGIN_DEPENDS= wireguard-go wireguard-tools PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index e6d9ce270f..515f17dbf2 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,10 @@ WWW: https://www.wireguard.com/ Changelog --------- +1.10 + +* Remove instance limit + 1.9 * Rename interface label in filter rules (#2577) diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml index 7b99312233..64d4deb9d3 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml @@ -1,7 +1,7 @@ //OPNsense/wireguard/server Wireguard Server configuration - 0.0.2 + 0.0.3 @@ -16,9 +16,6 @@ Should be a string between 1 and 32 characters. Allowed characters are 0-9, a-z, and A-Z - 0 - 19 - Maximum number of instances reached Y From 95250aaeb605030024357b37839ee6e7752cce0a Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 21 Jan 2022 15:36:09 +0100 Subject: [PATCH 0926/3088] net/frr: Dont set empty defaults on required fields (#2761) --- net/frr/Makefile | 2 +- net/frr/pkg-descr | 4 ++++ .../src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml | 5 ++--- net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/RIP.xml | 5 ++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 1ccdf2d16b..ca8ca4dd54 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.25 +PLUGIN_VERSION= 1.26 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index f2a1fa87ea..77b799b58f 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -11,6 +11,10 @@ switching and routing, Internet access routers, and Internet peering. Plugin Changelog ================ +1.26 + +* Fix Model migration errors + 1.25 * Add "All" option to next-hop-self command (#2673) diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml index 6670a07892..46e433426d 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml @@ -1,7 +1,7 @@ //OPNsense/quagga/ospf6 OSPFv3 Routing configuration - 1.0.2 + 1.0.3 0 @@ -18,8 +18,7 @@ - - Y + N /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/RIP.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/RIP.xml index bb315566b6..f9838ca8b7 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/RIP.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/RIP.xml @@ -1,7 +1,7 @@ //OPNsense/quagga/rip RIP Routing configuration - 1.0.2 + 1.0.3 0 @@ -14,8 +14,7 @@ Y - - Y + N /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2},)*(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2})$/ From d737686eed6a35ea8ad120c4d3d91d8942c20672 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 21 Jan 2022 15:56:34 +0100 Subject: [PATCH 0927/3088] mDNS repeater: cosmetic fixes --- .../src/etc/inc/plugins.inc.d/mdnsrepeater.inc | 10 +++------- .../OPNsense/MDNSRepeater/IndexController.php | 2 +- .../mvc/app/models/OPNsense/MDNSRepeater/ACL/ACL.xml | 2 +- .../mvc/app/models/OPNsense/MDNSRepeater/Menu/Menu.xml | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc b/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc index 7cf9b86814..6990e232fb 100644 --- a/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc +++ b/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc @@ -28,12 +28,8 @@ function mdnsrepeater_enabled() { - $mdns_repeater = new \OPNsense\MDNSRepeater\MDNSRepeater(); - if ((string)$mdns_repeater->enabled == '1') { - return true; - } - - return false; + $model = new \OPNsense\MDNSRepeater\MDNSRepeater(); + return (string)$model->enabled == '1'; } function mdnsrepeater_firewall($fw) @@ -54,7 +50,7 @@ function mdnsrepeater_services() } $services[] = array( - 'description' => gettext('MDNS Repeater'), + 'description' => gettext('mDNS Repeater'), 'configd' => array( 'restart' => array('mdnsrepeater restart'), 'start' => array('mdnsrepeater start'), diff --git a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/IndexController.php b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/IndexController.php index 10fdf5234c..1830697d45 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/IndexController.php +++ b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/IndexController.php @@ -37,7 +37,7 @@ class IndexController extends \OPNsense\Base\IndexController { /** - * MDNS Repeater index page + * mDNS Repeater index page * @throws \Exception */ public function indexAction() diff --git a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/ACL/ACL.xml b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/ACL/ACL.xml index d7bef3537c..8fe0a0f3aa 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/ACL/ACL.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/ACL/ACL.xml @@ -1,6 +1,6 @@ - Services: MDNS Repeatery + Services: mDNS Repeater ui/mdnsrepeater/* api/mdnsrepeater/* diff --git a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/Menu/Menu.xml b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/Menu/Menu.xml index c3cea26cbd..6b42fa7bc7 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/Menu/Menu.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/Menu/Menu.xml @@ -1,5 +1,5 @@ - + From 7942f54a9f82b79d6a780c1c50fcb27a88629125 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 24 Jan 2022 09:22:18 +0100 Subject: [PATCH 0928/3088] dns/dyndns: fix typo --- dns/dyndns/src/www/services_dyndns.php | 2 +- dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/dyndns/src/www/services_dyndns.php b/dns/dyndns/src/www/services_dyndns.php index a209477baa..c74e85c817 100644 --- a/dns/dyndns/src/www/services_dyndns.php +++ b/dns/dyndns/src/www/services_dyndns.php @@ -112,7 +112,7 @@
    diff --git a/dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php b/dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php index 55a59d6115..03d6af5687 100644 --- a/dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php +++ b/dns/dyndns/src/www/widgets/widgets/dyn_dns_status.widget.php @@ -90,7 +90,7 @@
    From 52af627f2b18e1b1116d88d08af96c8285569642 Mon Sep 17 00:00:00 2001 From: Neozlag <50456371+Neozlag@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:15:08 +0100 Subject: [PATCH 0929/3088] Update Nextcloud.php (#2662) It seems the try in the getInternalUsername function was not placed very well, so the throw exception in the ocs_request function didn't work. --- .../mvc/app/library/OPNsense/Backup/Nextcloud.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sysutils/nextcloud-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php b/sysutils/nextcloud-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php index cca8365167..71185b1103 100644 --- a/sysutils/nextcloud-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php +++ b/sysutils/nextcloud-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php @@ -280,15 +280,14 @@ public function create_directory($url, $username, $password, $internal_username, public function getInternalUsername($url, $username, $password): string { - $xml_response = $this->ocs_request( - "$url/ocs/v1.php/cloud/user", - $username, - $password, - "GET", - "Cannot get real username" - ); - try { + $xml_response = $this->ocs_request( + "$url/ocs/v1.php/cloud/user", + $username, + $password, + "GET", + "Cannot get real username" + ); $data = $xml_response->data; if ($data == null) { return $username; // no data found, return the old username From 1e6794ca1e957fef465344af89f546f7015b5e4e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 26 Jan 2022 20:17:25 +0100 Subject: [PATCH 0930/3088] sysutils/nextcloud-backup: whitespace on previous --- .../src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysutils/nextcloud-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php b/sysutils/nextcloud-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php index 71185b1103..5adad6c43b 100644 --- a/sysutils/nextcloud-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php +++ b/sysutils/nextcloud-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Nextcloud.php @@ -287,7 +287,7 @@ public function getInternalUsername($url, $username, $password): string $password, "GET", "Cannot get real username" - ); + ); $data = $xml_response->data; if ($data == null) { return $username; // no data found, return the old username From c970a82d15dcd1a3c68d03296bebd4e8e67da40b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 28 Jan 2022 09:43:26 +0100 Subject: [PATCH 0931/3088] dns/ddclient - missing upper case in model validation for username. closes https://github.com/opnsense/plugins/issues/2773 --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index c5521211f5..df0a922974 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -69,7 +69,7 @@ N - /^([a-z0-9\-.@_:+])*$/u + /^([a-zA-Z0-9\-.@_:+])*$/u The username contains invalid characters. From 400110af010e8a2cd3ea0f01d4b3db87154bacb6 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 28 Jan 2022 13:28:35 +0100 Subject: [PATCH 0932/3088] dns/dyndns - move menu registration so ddclient and legacy dyndns are both visible when installed. --- dns/dyndns/Makefile | 2 +- .../opnsense/mvc/app/models/OPNsense/DynamicDNS/Menu/Menu.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dns/dyndns/Makefile b/dns/dyndns/Makefile index 5bb7b9f3fd..ee2bb7a736 100644 --- a/dns/dyndns/Makefile +++ b/dns/dyndns/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= dyndns PLUGIN_VERSION= 1.27 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= Dynamic DNS Support PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/dns/dyndns/src/opnsense/mvc/app/models/OPNsense/DynamicDNS/Menu/Menu.xml b/dns/dyndns/src/opnsense/mvc/app/models/OPNsense/DynamicDNS/Menu/Menu.xml index 33f6a448cd..d2a7a40f2d 100644 --- a/dns/dyndns/src/opnsense/mvc/app/models/OPNsense/DynamicDNS/Menu/Menu.xml +++ b/dns/dyndns/src/opnsense/mvc/app/models/OPNsense/DynamicDNS/Menu/Menu.xml @@ -1,7 +1,7 @@ - + - + From af2ec65aa0aeabb0d222c0c3e20eab3fc59d43a6 Mon Sep 17 00:00:00 2001 From: Alex Mi <43502191+mitzsch@users.noreply.github.com> Date: Sat, 29 Jan 2022 09:47:09 +0100 Subject: [PATCH 0933/3088] dns/ddclient - Add STRATO DynDNS functionality to the new ddclient-dyndns plugin. (#2777) --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../service/templates/OPNsense/ddclient/ddclient.conf | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index df0a922974..e6f4ea2a26 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -64,6 +64,7 @@ Noip nsupdate.info (IPv4) nsupdate.info (IPv6) + STRATO Zoneedit diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index a395865830..fc221b7822 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -54,6 +54,11 @@ server=ipv4.nsupdate.info protocol=dyndns2 ssl=yes server=ipv6.nsupdate.info +{% elif account.service == 'strato' %} +use=web +protocol=dyndns2 +ssl=yes +server=dyndns.strato.com {% else %} protocol={{account.service}} ssl=yes From 8ee15ced75b5c554c0b7f3ee70dc32f7a5f6b14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20M=C3=BCller?= Date: Sat, 29 Jan 2022 15:59:46 +0100 Subject: [PATCH 0934/3088] dns/ddclient Add Cloudflare (#2781) * Added Cloudflare as DynDNS provider * Fixed zone requirement --- .../controllers/OPNsense/DynDNS/forms/dialogAccount.xml | 7 +++++++ .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 5 +++++ .../service/templates/OPNsense/ddclient/ddclient.conf | 5 ++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml index 2ee8e7271e..9aad7678b9 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml @@ -30,6 +30,13 @@ add a DNS wildcard CNAME record that points to the configured host. + + account.zone + + text + + Zone containing the host entry. + account.hostnames diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index e6f4ea2a26..756d13c0df 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -54,6 +54,7 @@ A service type is required. Changeip + Cloudflare DynDNS.com DnsPark DslReports @@ -87,6 +88,10 @@ 0 Y + + N + N + N /^([\t\n\v\f\r 0-9a-zA-Z.,_\x{00A0}-\x{FFFF}]){1,255}$/u diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index fc221b7822..a506db3ec7 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -46,7 +46,10 @@ use=web, web=http://dynamic.zoneedit.com/checkip.html {% if helpers.exists('OPNsense.DynDNS.accounts.account') %} {% for account in helpers.toList('OPNsense.DynDNS.accounts.account') %} {% if account.enabled|default('0') == '1' %} -{% if account.service == 'nsupdatev4' %} +{% if account.service == 'cloudflare' %} +protocol=cloudflare +zone={{account.zone}} +{% elif account.service == 'nsupdatev4' %} protocol=dyndns2 ssl=yes server=ipv4.nsupdate.info From 05ca13b59f8d578e9cdb32d826d5e40a41e8feee Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 30 Jan 2022 08:20:33 +0100 Subject: [PATCH 0935/3088] net/dnscrypt-proxy: replace sed syntax which breaks in F13 (#2787) --- dns/dnscrypt-proxy/Makefile | 2 +- dns/dnscrypt-proxy/pkg-descr | 4 +++ .../scripts/OPNsense/Dnscryptproxy/dnsbl.sh | 34 +++++++++---------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/dns/dnscrypt-proxy/Makefile b/dns/dnscrypt-proxy/Makefile index 26d9d6d8df..3c7a4c9d88 100644 --- a/dns/dnscrypt-proxy/Makefile +++ b/dns/dnscrypt-proxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= dnscrypt-proxy -PLUGIN_VERSION= 1.10 +PLUGIN_VERSION= 1.11 PLUGIN_COMMENT= Flexible DNS proxy supporting DNSCrypt and DoH PLUGIN_DEPENDS= dnscrypt-proxy2 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/dnscrypt-proxy/pkg-descr b/dns/dnscrypt-proxy/pkg-descr index 540b718146..f6cdd0817c 100644 --- a/dns/dnscrypt-proxy/pkg-descr +++ b/dns/dnscrypt-proxy/pkg-descr @@ -5,6 +5,10 @@ such as DNSCrypt v2 and DNS-over-HTTPS. Plugin Changelog ================ +1.11 + +* Fix DNSBL update due to FreeBSD13 upgrade (sed syntax) + 1.10 * Add option to enable/disable local query logs diff --git a/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh b/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh index 7f6153c238..23bb785899 100755 --- a/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh +++ b/dns/dnscrypt-proxy/src/opnsense/scripts/OPNsense/Dnscryptproxy/dnsbl.sh @@ -38,119 +38,119 @@ mkdir -p ${WORKDIR} easylist() { # EasyList ${FETCH} https://justdomains.github.io/blocklists/lists/easylist-justdomains.txt -o ${WORKDIR}/easylist-raw - sed "/\.$/d" ${WORKDIR}/easylist-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/easylist + sed "/\.$/d" ${WORKDIR}/easylist-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/easylist rm ${WORKDIR}/easylist-raw } easyprivacy() { # EasyPrivacy ${FETCH} https://justdomains.github.io/blocklists/lists/easyprivacy-justdomains.txt -o ${WORKDIR}/easyprivacy-raw - sed "/\.$/d" ${WORKDIR}/easyprivacy-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/easyprivacy + sed "/\.$/d" ${WORKDIR}/easyprivacy-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/easyprivacy rm ${WORKDIR}/easyprivacy-raw } pornall() { # PornAll ${FETCH} https://raw.githubusercontent.com/chadmayfield/my-pihole-blocklists/master/lists/pi_blocklist_porn_all.list -o ${WORKDIR}/pornall-raw - sed "/\.$/d" ${WORKDIR}/pornall-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/pornall + sed "/\.$/d" ${WORKDIR}/pornall-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/pornall rm ${WORKDIR}/pornall-raw } porntop() { # PornTop1M ${FETCH} https://raw.githubusercontent.com/chadmayfield/pihole-blocklists/master/lists/pi_blocklist_porn_top1m.list -o ${WORKDIR}/porntop-raw - sed "/\.$/d" ${WORKDIR}/porntop-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/porntop + sed "/\.$/d" ${WORKDIR}/porntop-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/porntop rm ${WORKDIR}/porntop-raw } adguard() { # AdGuard ${FETCH} https://justdomains.github.io/blocklists/lists/adguarddns-justdomains.txt -o ${WORKDIR}/adguard-raw - sed "/\.$/d" ${WORKDIR}/adguard-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/adguard + sed "/\.$/d" ${WORKDIR}/adguard-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/adguard rm ${WORKDIR}/adguard-raw } nocoin() { # NoCoin ${FETCH} https://justdomains.github.io/blocklists/lists/nocoin-justdomains.txt -o ${WORKDIR}/nocoin-raw - sed "/\.$/d" ${WORKDIR}/nocoin-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/nocoin + sed "/\.$/d" ${WORKDIR}/nocoin-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/nocoin rm ${WORKDIR}/nocoin-raw } windowsspyblockerspy() { # WindowsSpyBlocker (spy) ${FETCH} https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt -o ${WORKDIR}/windowsspyblockerspy-raw - sed "/\.$/d" ${WORKDIR}/windowsspyblockerspy-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerspy + sed "/\.$/d" ${WORKDIR}/windowsspyblockerspy-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerspy rm ${WORKDIR}/windowsspyblockerspy-raw } windowsspyblockerupdate() { # WindowsSpyBlocker (update) ${FETCH} https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update.txt -o ${WORKDIR}/windowsspyblockerupdate-raw - sed "/\.$/d" ${WORKDIR}/windowsspyblockerupdate-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerupdate + sed "/\.$/d" ${WORKDIR}/windowsspyblockerupdate-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerupdate rm ${WORKDIR}/windowsspyblockerupdate-raw } windowsspyblockerextra() { # WindowsSpyBlocker (extra) ${FETCH} https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt -o ${WORKDIR}/windowsspyblockerextra-raw - sed "/\.$/d" ${WORKDIR}/windowsspyblockerextra-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerextra + sed "/\.$/d" ${WORKDIR}/windowsspyblockerextra-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerextra rm ${WORKDIR}/windowsspyblockerextra-raw } adaway() { # AdAway List ${FETCH} https://adaway.org/hosts.txt -o ${WORKDIR}/adaway-raw - sed "/\.$/d" ${WORKDIR}/adaway-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/adaway + sed "/\.$/d" ${WORKDIR}/adaway-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/adaway rm ${WORKDIR}/adaway-raw } yoyo() { # YoYo List ${FETCH} "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext" -o ${WORKDIR}/yoyo-raw - sed "/\.$/d" ${WORKDIR}/yoyo-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/yoyo + sed "/\.$/d" ${WORKDIR}/yoyo-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/yoyo rm ${WORKDIR}/yoyo-raw } stevenblack() { # StevenBlack ${FETCH} https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts -o ${WORKDIR}/stevenblack-raw - sed "/\.$/d" ${WORKDIR}/stevenblack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/stevenblack + sed "/\.$/d" ${WORKDIR}/stevenblack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/stevenblack rm ${WORKDIR}/stevenblack-raw } blocklistads() { # Blocklist.site Ads ${FETCH} https://blocklistproject.github.io/Lists/ads.txt -o ${WORKDIR}/blocklistads-raw - sed "/\.$/d" ${WORKDIR}/blocklistads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | awk '{print $2}' > ${WORKDIR}/blocklistads + sed "/\.$/d" ${WORKDIR}/blocklistads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | awk '{print $2}' > ${WORKDIR}/blocklistads rm ${WORKDIR}/blocklistads-raw } blocklistfraud() { # Blocklist.site Fraud ${FETCH} https://blocklistproject.github.io/Lists/fraud.txt -o ${WORKDIR}/blocklistfraud-raw - sed "/\.$/d" ${WORKDIR}/blocklistfraud-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" |awk '{print $2}' > ${WORKDIR}/blocklistfraud + sed "/\.$/d" ${WORKDIR}/blocklistfraud-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" |awk '{print $2}' > ${WORKDIR}/blocklistfraud rm ${WORKDIR}/blocklistfraud-raw } blocklistphishing() { # Blocklist.site Phishing ${FETCH} https://blocklistproject.github.io/Lists/phishing.txt -o ${WORKDIR}/blocklistphishing-raw - sed "/\.$/d" ${WORKDIR}/blocklistphishing-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | awk '{print $2}' > ${WORKDIR}/blocklistphishing + sed "/\.$/d" ${WORKDIR}/blocklistphishing-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | awk '{print $2}' > ${WORKDIR}/blocklistphishing rm ${WORKDIR}/blocklistphishing-raw } simplead() { # Simple Ad List ${FETCH} https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt -o ${WORKDIR}/simplead-raw - sed "/\.$/d" ${WORKDIR}/simplead-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simplead + sed "/\.$/d" ${WORKDIR}/simplead-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simplead rm ${WORKDIR}/simplead-raw } simpletrack() { # Simple Tracking List ${FETCH} https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt -o ${WORKDIR}/simpletrack-raw - sed "/\.$/d" ${WORKDIR}/simpletrack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simpletrack + sed "/\.$/d" ${WORKDIR}/simpletrack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simpletrack rm ${WORKDIR}/simpletrack-raw } From 8bdd618652efb969ec0855b2be85af0240bbc657 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 31 Jan 2022 08:36:13 +0100 Subject: [PATCH 0936/3088] plugins: style sweep --- .../app/controllers/OPNsense/Telegraf/Api/ServiceController.php | 1 - .../mvc/app/controllers/OPNsense/FtpProxy/ItemController.php | 1 - .../app/controllers/OPNsense/Relayd/Api/SettingsController.php | 1 - .../app/controllers/OPNsense/Zerotier/Api/NetworkController.php | 1 - .../app/controllers/OPNsense/Zerotier/Api/SettingsController.php | 1 - .../src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.php | 1 - .../src/opnsense/mvc/app/library/OPNsense/Backup/Git.php | 1 - .../opnsense/mvc/app/models/OPNsense/NodeExporter/General.php | 1 - 8 files changed, 8 deletions(-) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/ServiceController.php b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/ServiceController.php index 22c4800cf6..3f21c8b2a4 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/ServiceController.php +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/Api/ServiceController.php @@ -39,7 +39,6 @@ */ class ServiceController extends ApiControllerBase { - /** * start telegraf service (in background) * @return array diff --git a/net/ftp-proxy/src/opnsense/mvc/app/controllers/OPNsense/FtpProxy/ItemController.php b/net/ftp-proxy/src/opnsense/mvc/app/controllers/OPNsense/FtpProxy/ItemController.php index 679fc52da1..a9f30d596b 100644 --- a/net/ftp-proxy/src/opnsense/mvc/app/controllers/OPNsense/FtpProxy/ItemController.php +++ b/net/ftp-proxy/src/opnsense/mvc/app/controllers/OPNsense/FtpProxy/ItemController.php @@ -36,5 +36,4 @@ */ class ItemController extends \OPNsense\Base\IndexController { - } diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php index 0f71cf62c6..dd18169453 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php @@ -41,7 +41,6 @@ */ class SettingsController extends ApiMutableModelControllerBase { - protected static $internalModelName = 'relayd'; protected static $internalModelClass = '\OPNsense\Relayd\Relayd'; diff --git a/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/Api/NetworkController.php b/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/Api/NetworkController.php index 03dde0179a..c1b436118e 100644 --- a/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/Api/NetworkController.php +++ b/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/Api/NetworkController.php @@ -39,7 +39,6 @@ class NetworkController extends ApiMutableModelControllerBase { - protected static $internalModelName = 'Zerotier'; protected static $internalModelClass = '\OPNsense\Zerotier\Zerotier'; diff --git a/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/Api/SettingsController.php b/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/Api/SettingsController.php index ac37bcf878..dd1dcc4bbb 100644 --- a/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/Api/SettingsController.php +++ b/net/zerotier/src/opnsense/mvc/app/controllers/OPNsense/Zerotier/Api/SettingsController.php @@ -39,7 +39,6 @@ class SettingsController extends ApiMutableModelControllerBase { - protected static $internalModelName = 'Zerotier'; protected static $internalModelClass = '\OPNsense\Zerotier\Zerotier'; diff --git a/net/zerotier/src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.php b/net/zerotier/src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.php index a16fa8f8aa..c4067fc9de 100644 --- a/net/zerotier/src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.php +++ b/net/zerotier/src/opnsense/mvc/app/models/OPNsense/Zerotier/Zerotier.php @@ -35,5 +35,4 @@ class Zerotier extends BaseModel { - } diff --git a/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php b/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php index b9626d2119..461b813fad 100644 --- a/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php +++ b/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php @@ -40,7 +40,6 @@ */ class Git extends Base implements IBackupProvider { - /** * @inheritdoc */ diff --git a/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.php b/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.php index a049ba655d..075259cefb 100644 --- a/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.php +++ b/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.php @@ -35,5 +35,4 @@ class General extends BaseModel { - } From 4227a01fd2e7adc873a66fb4e037cb975349ceee Mon Sep 17 00:00:00 2001 From: Karlson2k Date: Mon, 31 Jan 2022 12:26:19 +0300 Subject: [PATCH 0937/3088] dns/dnscrypt-proxy: fixed "disabled_server_names" (#2788) Fixed function of "Disabled Servers List" when more than one server specified in the list. --- dns/dnscrypt-proxy/pkg-descr | 2 ++ .../templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dns/dnscrypt-proxy/pkg-descr b/dns/dnscrypt-proxy/pkg-descr index f6cdd0817c..8619615eb4 100644 --- a/dns/dnscrypt-proxy/pkg-descr +++ b/dns/dnscrypt-proxy/pkg-descr @@ -8,6 +8,8 @@ Plugin Changelog 1.11 * Fix DNSBL update due to FreeBSD13 upgrade (sed syntax) +* Fix "manual disable of specific servers" when more than one server is + specified (contributed by Evgeny Grin (karlson2k)) 1.10 diff --git a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml index 2207b162b1..96dd4718ef 100644 --- a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml +++ b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml @@ -5,7 +5,7 @@ server_names = [{{ "'" + ("','".join(OPNsense.dnscryptproxy.general.serverlist.s {% endif %} {% if helpers.exists('OPNsense.dnscryptproxy.general.disabled_serverlist') and OPNsense.dnscryptproxy.general.disabled_serverlist != '' %} -disabled_server_names = ['{{OPNsense.dnscryptproxy.general.disabled_serverlist}}'] +disabled_server_names = [{{ "'" + ("','".join(OPNsense.dnscryptproxy.general.disabled_serverlist.split(','))) + "'" }}] {% endif %} {% if helpers.exists('OPNsense.dnscryptproxy.general.listen_addresses') and OPNsense.dnscryptproxy.general.listen_addresses != '' %} From 6a7babcf20398b1fa845deff35edcda498384925 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 31 Jan 2022 10:30:49 +0100 Subject: [PATCH 0938/3088] net-mgmt/zabbix-agent: Add description to restart action (#2792) --- net-mgmt/zabbix-agent/Makefile | 2 +- net-mgmt/zabbix-agent/pkg-descr | 4 ++++ .../opnsense/service/conf/actions.d/actions_zabbixagent.conf | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net-mgmt/zabbix-agent/Makefile b/net-mgmt/zabbix-agent/Makefile index a0d556e711..7a79968563 100644 --- a/net-mgmt/zabbix-agent/Makefile +++ b/net-mgmt/zabbix-agent/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= zabbix-agent -PLUGIN_VERSION= 1.10 +PLUGIN_VERSION= 1.11 PLUGIN_COMMENT= Zabbix monitoring agent PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_VARIANTS= zabbix5 zabbix54 diff --git a/net-mgmt/zabbix-agent/pkg-descr b/net-mgmt/zabbix-agent/pkg-descr index b569787361..b1811bc200 100644 --- a/net-mgmt/zabbix-agent/pkg-descr +++ b/net-mgmt/zabbix-agent/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.zabbix.com/ Plugin Changelog ---------------- +1.11 + +* Add description to restart action to allow restart via cron + 1.10 Added: diff --git a/net-mgmt/zabbix-agent/src/opnsense/service/conf/actions.d/actions_zabbixagent.conf b/net-mgmt/zabbix-agent/src/opnsense/service/conf/actions.d/actions_zabbixagent.conf index c3b09eae3a..d95fb2da2d 100644 --- a/net-mgmt/zabbix-agent/src/opnsense/service/conf/actions.d/actions_zabbixagent.conf +++ b/net-mgmt/zabbix-agent/src/opnsense/service/conf/actions.d/actions_zabbixagent.conf @@ -14,6 +14,7 @@ message:stopping zabbix_agentd command:/usr/local/opnsense/scripts/OPNsense/ZabbixAgent/setup.sh; /usr/local/etc/rc.d/zabbix_agentd restart parameters: type:script +description:Restart Zabbix Agent message:restarting zabbix_agentd [status] From 9ff548829c34a59d79cbf4e5c6b2f0ce2b459712 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 1 Feb 2022 08:05:41 +0100 Subject: [PATCH 0939/3088] Add CARP hook for mDNS repeater. (#2762) Only run the repeater on one node. Fixes #2595. --- .../src/etc/rc.syshook.d/carp/50-mdns | 74 +++++++++++++++++++ .../OPNsense/MDNSRepeater/forms/general.xml | 30 +++++--- .../OPNsense/MDNSRepeater/MDNSRepeater.xml | 6 +- .../OPNsense/MDNSRepeater/mdnsrepeater | 3 + 4 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns diff --git a/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns b/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns new file mode 100644 index 0000000000..379f111b75 --- /dev/null +++ b/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns @@ -0,0 +1,74 @@ +#!/usr/local/bin/php + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +require_once("config.inc"); +require_once("util.inc"); +require_once('interfaces.inc'); +require_once("plugins.inc.d/mdnsrepeater.inc"); + +$mdns_repeater = new \OPNsense\MDNSRepeater\MDNSRepeater(); +$mdns_repeater_carp_enabled = + (string)$mdns_repeater->enabled == '1' && + (string)$mdns_repeater->enablecarp == '1'; + +if ($mdns_repeater_carp_enabled) { + $subsystem = !empty($argv[1]) ? $argv[1] : ''; + $type = !empty($argv[2]) ? $argv[2] : ''; + + if ($type != 'MASTER' && $type != 'BACKUP') { + log_error("Carp '$type' event unknown from source '{$subsystem}'"); + exit(1); + } + + if (!strstr($subsystem, '@')) { + log_error("Carp '$type' event triggered from wrong source '{$subsystem}'"); + exit(1); + } + + list ($vhid, $iface) = explode('@', $subsystem); + + $friendly_interface = convert_real_interface_to_friendly_interface_name($iface); + $mdns_repeater_interfaces = explode(',', $mdns_repeater->interfaces); + if (!in_array($friendly_interface, $mdns_repeater_interfaces)) { + exit(0); + } + + $backend = new \OPNsense\Core\Backend(); + + switch ($type) { + case 'MASTER': + touch('/var/run/mdns-repeater.CARP_MASTER'); + $backend->configdRun('mdnsrepeater start'); + break; + case 'BACKUP': + @unlink('/var/run/mdns-repeater.CARP_MASTER'); + $backend->configdRun('mdnsrepeater stop'); + break; + } +} diff --git a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml index e6a87140ea..d7a8bea2ca 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml @@ -1,14 +1,20 @@
    - - mdnsrepeater.enabled - - checkbox - Enable the repeater. - - - mdnsrepeater.interfaces - - select_multiple - At least two interfaces must be selected. - + + mdnsrepeater.enabled + + checkbox + Enable the repeater. + + + mdnsrepeater.enablecarp + + checkbox + This will activate the repeater service only on the master device. + + + mdnsrepeater.interfaces + + select_multiple + At least two interfaces must be selected. + diff --git a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml index 245cc6ebe8..b3affd1764 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml @@ -1,12 +1,16 @@ //OPNsense/MDNSRepeater - 1.0.0 + 1.0.1 mdns-repeater settings 0 Y + + 0 + Y + lan Y diff --git a/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater b/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater index feb71084a6..7ca779ca55 100644 --- a/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater +++ b/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater @@ -1,6 +1,9 @@ {% if helpers.exists('OPNsense.MDNSRepeater.enabled') and OPNsense.MDNSRepeater.enabled == '1' %} {% from 'OPNsense/Macros/interface.macro' import physical_interface %} mdns_repeater_enable="YES" +{% if helpers.exists('OPNsense.MDNSRepeater.enablecarp') and OPNsense.MDNSRepeater.enablecarp == '1' %} +required_files="/var/run/mdns-repeater.CARP_MASTER" +{% endif %} {% set osifnames = OPNsense.MDNSRepeater.interfaces.split(',') %} {% set interface_list=[] %} {% for i in osifnames %} From 88148b1943a91f87be9b02aea4bfa378db85032e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 1 Feb 2022 08:24:39 +0100 Subject: [PATCH 0940/3088] net/mdns-repeater: new release 1.1 --- LICENSE | 1 + net/mdns-repeater/Makefile | 3 +- net/mdns-repeater/pkg-descr | 13 ++++- .../src/etc/rc.syshook.d/carp/50-mdns | 48 +++++++++---------- 4 files changed, 37 insertions(+), 28 deletions(-) mode change 100644 => 100755 net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns diff --git a/LICENSE b/LICENSE index e3a53b56c0..401f5af5f8 100644 --- a/LICENSE +++ b/LICENSE @@ -30,6 +30,7 @@ Copyright (c) 2003-2004 Manuel Kasper Copyright (c) 2020 Marc Leuser Copyright (c) 2021 Marcel Koepfli Copyright (c) 2021 Markus Peter +Copyright (c) 2022 Markus Reiter Copyright (c) 2020 Martin Wasley Copyright (c) 2022 Marvo2011 Copyright (c) 2017-2021 Michael Muenz diff --git a/net/mdns-repeater/Makefile b/net/mdns-repeater/Makefile index 2c17394c8d..a1febb5539 100644 --- a/net/mdns-repeater/Makefile +++ b/net/mdns-repeater/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= mdns-repeater -PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= Proxy multicast DNS between networks PLUGIN_MAINTAINER= franz.fabian.94@gmail.com PLUGIN_DEPENDS= mdns-repeater diff --git a/net/mdns-repeater/pkg-descr b/net/mdns-repeater/pkg-descr index 3bcc2b3b9e..a5ed7facd2 100644 --- a/net/mdns-repeater/pkg-descr +++ b/net/mdns-repeater/pkg-descr @@ -2,6 +2,15 @@ mdns-repeater is a Multicast DNS repeater. Multicast DNS uses the 224.0.0.251 address, which is "administratively scoped" and does not leave the subnet. This program re-broadcast mDNS packets from one interface to other interfaces. +It can be used to bridge zeroconf devices to work properly across the two subnets. -It can be used to bridge zeroconf devices to work properly across the two -subnets. +Plugin Changelog +================ + +1.1 + +* CARP support (contributed by Markus Reiter) + +1.0 + +* Initial release diff --git a/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns b/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns old mode 100644 new mode 100755 index 379f111b75..07c1bb207b --- a/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns +++ b/net/mdns-repeater/src/etc/rc.syshook.d/carp/50-mdns @@ -2,30 +2,30 @@ - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (C) 2022 Markus Reiter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ require_once("config.inc"); require_once("util.inc"); From 6b0fcd0c2d5366d307fc47c85488dcc9b8a2c0bb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 1 Feb 2022 14:30:11 +0100 Subject: [PATCH 0941/3088] security: update these urls too --- .../opnsense/scripts/suricata/metadata/rules/et-open-extra.xml | 2 +- .../src/opnsense/scripts/suricata/metadata/rules/et-pro.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml index ca6f397f64..af9114aa4f 100644 --- a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml +++ b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml @@ -1,5 +1,5 @@ - + diff --git a/security/intrusion-detection-content-et-pro/src/opnsense/scripts/suricata/metadata/rules/et-pro.xml b/security/intrusion-detection-content-et-pro/src/opnsense/scripts/suricata/metadata/rules/et-pro.xml index 4accb4f376..715b749bb3 100644 --- a/security/intrusion-detection-content-et-pro/src/opnsense/scripts/suricata/metadata/rules/et-pro.xml +++ b/security/intrusion-detection-content-et-pro/src/opnsense/scripts/suricata/metadata/rules/et-pro.xml @@ -1,5 +1,5 @@ - + From a2c07f5ec45f7359a2d8fbe39605d08fada4e4d0 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 1 Feb 2022 14:31:03 +0100 Subject: [PATCH 0942/3088] Framework: switch to 22.1 --- Mk/defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/defaults.mk b/Mk/defaults.mk index b794cebfba..534214e2ff 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -57,7 +57,7 @@ VERSIONBIN= ${LOCALBASE}/sbin/opnsense-version _PLUGIN_ABI!= ${VERSIONBIN} -a PLUGIN_ABI?= ${_PLUGIN_ABI} .else -PLUGIN_ABI?= 21.7 +PLUGIN_ABI?= 22.1 .endif PHPBIN= ${LOCALBASE}/bin/php From 1415dcccc24a88b1e5e5f0cca6854cb41c867e00 Mon Sep 17 00:00:00 2001 From: Zane Chua <4265429+zanechua@users.noreply.github.com> Date: Wed, 2 Feb 2022 23:31:47 -0800 Subject: [PATCH 0943/3088] dns/bind: Implement filter-aaaa (#1722) --- .../OPNsense/Bind/forms/general.xml | 20 +++++++++++++++++++ .../mvc/app/models/OPNsense/Bind/General.xml | 13 ++++++++++++ .../templates/OPNsense/Bind/named.conf | 14 +++++++++++++ 3 files changed, 47 insertions(+) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml index da2938c356..8c15212100 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml @@ -69,6 +69,26 @@ true Set one or more hosts to send your DNS queries if the request is unknown.
    + + general.filteraaaav4 + + checkbox + This will filter AAAA records on IPv4 Clients + + + general.filteraaaav6 + + checkbox + This will filter AAAA records on IPv6 Clients + + + general.filteraaaaacl + + + select_multiple + true + Specifies a list of client addresses for which AAAA filtering is to be applied. + general.logsize diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml index 5d67e79318..edd75d1607 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml @@ -56,6 +56,19 @@ N Y + + 0 + Y + + + 0 + Y + + + , + N + Y + 5 Y diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf index abb5b57200..d0c552157a 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf @@ -193,3 +193,17 @@ logging { category lame-servers { null; }; }; {% endif %} + +{% if helpers.exists('OPNsense.bind.general.filteraaaav4') and OPNsense.bind.general.filteraaaav4 == '1' or helpers.exists('OPNsense.bind.general.filteraaaav6') and OPNsense.bind.general.filteraaaav6 == '1' %} +plugin query "/usr/local/lib/named/filter-aaaa.so" { +{% if helpers.exists('OPNsense.bind.general.filteraaaav4') and OPNsense.bind.general.filteraaaav4 == '1' %} + filter-aaaa-on-v4 yes; +{% endif %} +{% if helpers.exists('OPNsense.bind.general.filteraaaav6') and OPNsense.bind.general.filteraaaav6 == '1' %} + filter-aaaa-on-v6 yes; +{% endif %} +{% if helpers.exists('OPNsense.bind.general.filteraaaaacl') and OPNsense.bind.general.filteraaaaacl != '' %} + filter-aaaa { {{ OPNsense.bind.general.filteraaaaacl.replace(',', '; ') }}; }; +{% endif %} + }; +{% endif %} From ec080d9d068cd4476e95287d0ca8fa7cd60da8e3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 3 Feb 2022 08:34:41 +0100 Subject: [PATCH 0944/3088] dns/bind: as discussed --- dns/bind/Makefile | 2 +- dns/bind/pkg-descr | 4 ++++ .../src/opnsense/mvc/app/models/OPNsense/Bind/General.xml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 7018cf0f6e..738804e21e 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.20 +PLUGIN_VERSION= 1.21 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index ea2c307f3c..0f64290fbb 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -8,6 +8,10 @@ necessary for asking and answering name service questions. Plugin Changelog ================ +1.21 + +* Add support for filter AAAA in DNS responses when A is present (contributed by Zane Chua) + 1.20 * Allow signed zone transfers (contributed by Michael Newton) diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml index edd75d1607..d9f73fc683 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml @@ -1,7 +1,7 @@ //OPNsense/bind/general BIND configuration - 1.0.7 + 1.0.8 0 From 3e64ff9251fb9c1b332f2faf2f98385cad884192 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 3 Feb 2022 09:35:06 +0000 Subject: [PATCH 0945/3088] WIP net/frr: Add BGP password support (#2800) Add BGP password support [https://github.com/opnsense/plugins/pull/2645] Try to figure out which entries belong to FRR before removing them, so neighbour changes won't be left on the machine after apply. Flush our desired configuration into /usr/local/etc/frr/sa_policies.conf for easy reading and testing. Since we don't know if passwords have changed, we will have to drop SA's first. When this is a bit bumpy, we may also try to alter the existing SA's, this shouldn't be too hard to add later on. Co-authored-by: Michael --- net/frr/pkg-descr | 1 + .../OPNsense/Quagga/Api/BgpController.php | 2 + .../Quagga/forms/dialogEditBGPNeighbor.xml | 14 ++++ .../mvc/app/models/OPNsense/Quagga/BGP.xml | 6 ++ net/frr/src/opnsense/scripts/frr/register_sas | 68 +++++++++++++++++++ net/frr/src/opnsense/scripts/quagga/setup.sh | 3 + .../templates/OPNsense/Quagga/+TARGETS | 1 + .../templates/OPNsense/Quagga/bgpd.conf | 3 + .../OPNsense/Quagga/sa_policies.conf | 24 +++++++ 9 files changed, 122 insertions(+) create mode 100755 net/frr/src/opnsense/scripts/frr/register_sas create mode 100644 net/frr/src/opnsense/service/templates/OPNsense/Quagga/sa_policies.conf diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 77b799b58f..a8ef2122df 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -14,6 +14,7 @@ Plugin Changelog 1.26 * Fix Model migration errors +* Add BGP password authentication 1.25 diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php index 8eb6bd1296..9f505632e1 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php @@ -45,6 +45,8 @@ public function searchNeighborAction() "description", "address", "remoteas", + "password", + "localip", "updatesource", "nexthopself", "multihop", diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml index d9f7f012d5..8665c2bce2 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml @@ -22,6 +22,20 @@ text Neighbor AS. + + neighbor.password + + text + true + Set a password for BGP authentication. + + + neighbor.localip + + text + true + Set the local IP connecting to the neighbor. This is only required for BGP authentication. + neighbor.updatesource diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml index 3a052bd4eb..33dd741479 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml @@ -57,6 +57,12 @@ 1 4294967295 + + N + + + N + N diff --git a/net/frr/src/opnsense/scripts/frr/register_sas b/net/frr/src/opnsense/scripts/frr/register_sas new file mode 100755 index 0000000000..a56c07ef6a --- /dev/null +++ b/net/frr/src/opnsense/scripts/frr/register_sas @@ -0,0 +1,68 @@ +#!/usr/local/bin/python3 +""" + Copyright (c) 2022 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +import os +import subprocess +import tempfile +from configparser import ConfigParser + +if __name__ == '__main__': + frr_sad = {} + frr_sa_database = "/usr/local/etc/frr/sa_policies.conf" + # stage 1, read required FRR policies + if os.path.exists(frr_sa_database): + cnf = ConfigParser() + cnf.read(frr_sa_database) + for section in cnf.sections(): + if cnf.has_option(section, 'src') and cnf.has_option(section, 'dst'): + policy_key = "%s %s" % (cnf.get(section, 'src'), cnf.get(section, 'dst')) + frr_sad[policy_key] = {} + for prop in cnf.items(section): + frr_sad[policy_key][prop[0]] = prop[1] + + # stage 2, red current installed policies which seems to originate from FRR + registered_policies = [] + current_policy = None + for line in subprocess.run(["/sbin/setkey", "-D"], capture_output=True, text=True).stdout.split('\n'): + parts = line.strip().split() + if not line.startswith('\t') and len(parts) > 1: + current_policy = {"src": parts[0], "dst": parts[1]} + elif len(parts) > 2 and parts[0] == 'A:' and parts[1] == 'tcp-md5': + # Let's assume we're the only ones registering these types of entries + registered_policies.append(current_policy) + + # flush changes to temp file and load with setkey + temp_filename = None + with tempfile.NamedTemporaryFile(mode='wt', delete=False) as fo: + temp_filename = fo.name + for policy in registered_policies: + fo.write("delete -4 %(src)s %(dst)s tcp 0x1000;\n" % policy) + for new_policy in frr_sad: + fo.write('add -4 %(src)s %(dst)s %(protocol)s %(spi)s -A %(aalgo)s "%(key)s";\n' % frr_sad[new_policy]) + + if temp_filename: + subprocess.run(["/sbin/setkey", "-f", fo.name], capture_output=True, text=True) diff --git a/net/frr/src/opnsense/scripts/quagga/setup.sh b/net/frr/src/opnsense/scripts/quagga/setup.sh index 5cb140a6bc..f91e271fd3 100755 --- a/net/frr/src/opnsense/scripts/quagga/setup.sh +++ b/net/frr/src/opnsense/scripts/quagga/setup.sh @@ -18,3 +18,6 @@ chown -R $user:$group /var/run/frr # logfile (if used) touch /var/log/frr.log chown $user:$group /var/log/frr.log + +# register Security Associations +/usr/local/opnsense/scripts/frr/register_sas diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS index 30b11bedbf..c2e0542d6f 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS @@ -4,6 +4,7 @@ ospfd.conf:/usr/local/etc/frr/ospfd.conf ospfd_carp.conf:/usr/local/etc/frr/ospfd_carp.conf ospf6d.conf:/usr/local/etc/frr/ospf6d.conf ripd.conf:/usr/local/etc/frr/ripd.conf +sa_policies.conf:/usr/local/etc/frr/sa_policies.conf frr:/etc/rc.conf.d/frr zebra.conf:/usr/local/etc/frr/zebra.conf vtysh.conf:/usr/local/etc/frr/vtysh.conf diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index 3f43144fd2..499ffe8e1e 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -57,6 +57,9 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if 'bfd' in neighbor and neighbor.bfd == '1' %} neighbor {{ neighbor.address }} bfd {% endif %} +{% if 'password' in neighbor and neighbor.password != '' %} + neighbor {{ neighbor.address }} password {{ neighbor.password }} +{% endif %} {% if ':' not in neighbor.address and 'updatesource' in neighbor and neighbor.updatesource != '' %} neighbor {{ neighbor.address }} update-source {{ physical_interface(neighbor.updatesource) }} {% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/sa_policies.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/sa_policies.conf new file mode 100644 index 0000000000..bb1587cf3d --- /dev/null +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/sa_policies.conf @@ -0,0 +1,24 @@ +{% if helpers.exists('OPNsense.quagga.bgp.enabled') and OPNsense.quagga.bgp.enabled == '1' %} +{% if helpers.exists('OPNsense.quagga.bgp.neighbors.neighbor') %} +{% for neighbor in helpers.toList('OPNsense.quagga.bgp.neighbors.neighbor') %} +{% if neighbor.enabled == '1' and neighbor.password|default('') != '' %} +[policy_{{neighbor['@uuid']}}_in] +src={{ neighbor.address }} +dst={{ neighbor.localip }} +protocol=tcp +spi=0x1000 +aalgo=tcp-md5 +key={{ neighbor.password }} + +[policy_{{neighbor['@uuid']}}_out] +src={{ neighbor.localip }} +dst={{ neighbor.address }} +protocol=tcp +spi=0x1000 +aalgo=tcp-md5 +key={{ neighbor.password }} + +{% endif %} +{% endfor %} +{% endif %} +{% endif %} From f64f795329ac9073c921b88f0b6313d8dc85b987 Mon Sep 17 00:00:00 2001 From: Niklas Date: Thu, 3 Feb 2022 16:35:27 +0100 Subject: [PATCH 0946/3088] dns-ddclient : minor typo and indentation inconsistency (#2804) --- .../mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml index fb0f9a4285..fd56c89214 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml @@ -23,7 +23,7 @@ dropdown - How to determine the address to uswe for this host + How to determine the address to use for this host From 03e60fa604923d02fec3199f1ad81c8ee93c4af0 Mon Sep 17 00:00:00 2001 From: Netboy3 <1472804+netboy3@users.noreply.github.com> Date: Thu, 3 Feb 2022 10:58:38 -0500 Subject: [PATCH 0947/3088] dns/ddclient - Add Hurricane Electric provider (#2805) HE is using the dyndns2 protocol for both dynamic DNS and IPv6 TunnelBroker services. Add both services to the service. --- .../opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 2 ++ .../service/templates/OPNsense/ddclient/ddclient.conf | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 756d13c0df..a0b7fb887c 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -61,6 +61,8 @@ DuckDNS EasyDNS Google + HE.net + HE.net TunnelBroker NameCheap Noip nsupdate.info (IPv4) diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index a506db3ec7..b676d9e305 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -49,6 +49,14 @@ use=web, web=http://dynamic.zoneedit.com/checkip.html {% if account.service == 'cloudflare' %} protocol=cloudflare zone={{account.zone}} +{% elif account.service == 'he-net' %} +protocol=dyndns2 +ssl=yes +server=dyn.dns.he.net +{% elif account.service == 'he-net-tunnel' %} +protocol=dyndns2 +ssl=yes +server=ipv4.tunnelbroker.net {% elif account.service == 'nsupdatev4' %} protocol=dyndns2 ssl=yes From d338587fa8442c809a2409878af9c90bf67703df Mon Sep 17 00:00:00 2001 From: Niklas Date: Thu, 3 Feb 2022 17:00:59 +0100 Subject: [PATCH 0948/3088] convert list to tasks (#2803) --- .github/ISSUE_TEMPLATE/bug_report.md | 8 +++----- .github/ISSUE_TEMPLATE/feature_request.md | 8 +++----- .github/ISSUE_TEMPLATE/question.md | 5 ++--- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f54090a6b9..c06ec63b26 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,11 +10,9 @@ assignees: '' **Important notices** Before you add a new report, we ask you kindly to acknowledge the following: -[-] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md - -[-] I have searched the existing issues and I'm convinced that mine is new. - -[-] The title contains the plugin to which this issue belongs +- [ ] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md +- [ ] I have searched the existing issues, open and closed, and I'm convinced that mine is new. +- [ ] The title contains the plugin to which this issue belongs **Describe the bug** A clear and concise description of what the bug is, including last known working version (if any). diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index c96c1c7467..fe3c8fca51 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -10,11 +10,9 @@ assignees: '' **Important notices** Before you add a new report, we ask you kindly to acknowledge the following: -[-] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md - -[-] I have searched the existing issues and I'm convinced that mine is new. - -[-] When the request is meant for an existing plugin, I've added its name to the title. +- [ ] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md +- [ ] I have searched the existing issues, open and closed, and I'm convinced that mine is new. +- [ ] When the request is meant for an existing plugin, I've added its name to the title. **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 6152184ac3..b4d4daf5e5 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -13,6 +13,5 @@ Our forum is located at https://forum.opnsense.org , please consider joining dis Before you ask a new question, we ask you kindly to acknowledge the following: -[-] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md - -[-] I have searched the existing issues and I'm convinced that mine is new. +- [ ] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md +- [ ] I have searched the existing issues, open and closed, and I'm convinced that mine is new. From db7c6fabc6911c0627d390262ecdb36dd2d3b7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20M=C3=BCller?= Date: Fri, 4 Feb 2022 08:28:32 +0100 Subject: [PATCH 0949/3088] dns/ddclient fix ip6only.me typo (#2807) --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index a0b7fb887c..c80e5b046b 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -30,7 +30,7 @@ googledomains he ip4only.me - ip4only.me + ip6only.me ipify-ipv4 ipify-ipv6 loopia From 22e8be6f68846e81c64bead30c394b596d40c02a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 4 Feb 2022 08:55:15 +0100 Subject: [PATCH 0950/3088] dns/ddclient: style --- .../mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml index fd56c89214..4aca916e9f 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml @@ -22,8 +22,6 @@ ddclient.general.checkip dropdown - - How to determine the address to use for this host - + How to determine the address to use for this host From 8c1759abbc1ac32a6288ab8a57dcdbd23937914d Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 5 Feb 2022 14:52:07 +0000 Subject: [PATCH 0951/3088] dns/ddclient: Use interface as ip source + custom service (#2813) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * dns/ddclient add interface as ip source * dns/ddclient - use interface ip per account * dns/ddclient - cleanups and visual changes for https://github.com/opnsense/plugins/pull/2791 * dns/ddclient merge custom service from https://github.com/opnsense/plugins/pull/2808 Co-authored-by: Robin Müller --- .../DynDNS/Api/AccountsController.php | 15 ++- .../OPNsense/DynDNS/forms/dialogAccount.xml | 27 +++++- .../OPNsense/DynDNS/forms/settings.xml | 6 ++ .../mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 28 ++++++ .../mvc/app/views/OPNsense/DynDNS/index.volt | 53 ++++++++--- .../templates/OPNsense/ddclient/ddclient.conf | 93 ++++++++++--------- 6 files changed, 164 insertions(+), 58 deletions(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php index 55e775635a..2f6367856c 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php @@ -39,11 +39,22 @@ class AccountsController extends ApiMutableModelControllerBase public function searchItemAction() { - return $this->searchBase( + $result = $this->searchBase( "accounts.account", - ['enabled', 'service', 'description', 'username', 'hostnames'], + ['enabled', 'service', 'description', 'username', 'hostnames', 'use_interface', 'interface', 'protocol'], "description" ); + foreach ($result['rows'] as &$row) { + if ($row['use_interface'] == "0") { + $row['interface'] = ""; + } + unset($row['use_interface']); + if ($row['service'] == 'Custom') { + $row['service'] = 'Custom ('.$row['protocol'].')'; + } + unset($row['protocol']); + } + return $result; } public function setItemAction($uuid) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml index 9aad7678b9..dd0b6f0ae4 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml @@ -11,6 +11,20 @@ dropdown Select the service to use. + + account.protocol + + dropdown + Select the protocol to use. + + + + account.server + + text + DynDNS Server + + account.username @@ -27,7 +41,7 @@ account.wildcard checkbox - + add a DNS wildcard CNAME record that points to the configured host. @@ -45,6 +59,17 @@ true Hostname to update + + account.use_interface + + checkbox + Use the IP of a specified interface for the update + + + account.interface + + dropdown + account.description diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml index 4aca916e9f..756a2c4408 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml @@ -24,4 +24,10 @@ dropdown How to determine the address to use for this host + + ddclient.general.interface + + dropdown + + diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index c80e5b046b..7f01a0158e 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -40,8 +40,14 @@ nsupdate.info-ipv4 nsupdate.info-ipv6 zoneedit + Interface + + N + N + wan + @@ -69,8 +75,21 @@ nsupdate.info (IPv6) STRATO Zoneedit + Custom + + N + A protocol type is required. + + DynDns1 + DynDns2 + + + + N + N + N /^([a-zA-Z0-9\-.@_:+])*$/u @@ -94,6 +113,15 @@ N N + + 0 + Y + + + N + N + wan + N /^([\t\n\v\f\r 0-9a-zA-Z.,_\x{00A0}-\x{FFFF}]){1,255}$/u diff --git a/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt b/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt index 4355f4144d..c60d789495 100644 --- a/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt +++ b/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt @@ -54,22 +54,48 @@ POSSIBILITY OF SUCH DAMAGE. return dfObj; } }); - $('#DialogAccount').on('shown.bs.modal', function (e) { - $("#account\\.service").change(function(){ - let service = $(this).val(); - $(".optional_setting").each(function(){ - let this_item = $(this); - if (this_item.hasClass("service_"+service)) { - this_item.prop( "disabled", false ); - this_item.closest("tr").show(); - } else { - this_item.closest("tr").hide(); - this_item.prop( "disabled", true ); - } - }); + $("#account\\.service").change(function(){ + let service = $(this).val(); + $("#frm_DialogAccount .optional_setting").each(function(){ + let this_item = $(this); + if (this_item.hasClass("service_"+service)) { + this_item.prop( "disabled", false ); + this_item.closest("tr").show(); + } else { + this_item.closest("tr").hide(); + this_item.prop( "disabled", true ); + } }); + }); + $("#account\\.use_interface").change(function(){ + if ($(this).is(':checked')) { + $("#account\\.interface").prop( "disabled", false ); + $("#account\\.interface").closest("tr").show(); + } else { + $("#account\\.interface").closest("tr").hide(); + $("#account\\.interface").prop( "disabled", true ); + } + $('#account\\.interface').selectpicker('refresh'); + }); + $('#DialogAccount').on('shown.bs.modal', function (e) { $("#account\\.service").change(); + $("#account\\.use_interface").change(); + }); + + $("#ddclient\\.general\\.checkip").change(function(){ + let checkip = $(this).val(); + $("#frm_settings .optional_setting").each(function(){ + let this_item = $(this); + if (this_item.hasClass("checkip_"+checkip)) { + this_item.prop( "disabled", false ); + this_item.closest("tr").show(); + } else { + this_item.closest("tr").hide(); + this_item.prop( "disabled", true ); + } + }); }); + $("#ddclient\\.general\\.checkip").change(); }); @@ -88,6 +114,7 @@ POSSIBILITY OF SUCH DAMAGE.
    + diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index b676d9e305..5aa00ca1c3 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -1,3 +1,4 @@ +{% from 'OPNsense/Macros/interface.macro' import physical_interface %} daemon={{OPNsense.DynDNS.general.daemon_delay|default('300')}} syslog=yes # log update msgs to syslog pid=/var/run/ddclient.pid # record PID in file. @@ -8,79 +9,87 @@ verbose=yes # # setup how we expect to retrieve an IP address # -{% if not helpers.empty('OPNsense.DynDNS.general.checkip') and OPNsense.DynDNS.general.checkip.startswith('web_') %} -{% set checkip = OPNsense.DynDNS.general.checkip.lstrip('web_') %} -{% if checkip == 'dyndns' %} +{% if not helpers.empty('OPNsense.DynDNS.general.checkip') %} +{% set checkip = OPNsense.DynDNS.general.checkip %} +{% if checkip == 'if' and OPNsense.DynDNS.general.interface|default('') != '' %} +use=if, if={{physical_interface(OPNsense.DynDNS.general.interface)}} +{% elif checkip == 'web_dyndns' %} use=web, web=http://checkip.dyndns.org/, web-skip="Current IP Address:" -{% elif checkip == 'freedns' %} +{% elif checkip == 'web_freedns' %} use=web, web=https://freedns.afraid.org/dynamic/check.php -{% elif checkip == 'googledomains' %} +{% elif checkip == 'web_googledomains' %} use=web, web=https://domains.google.com/checkip -{% elif checkip == 'he' %} +{% elif checkip == 'web_he' %} use=web, web=http://checkip.dns.he.net/ -{% elif checkip == 'ip4only.me' %} +{% elif checkip == 'web_ip4only.me' %} use=web, web=http://ip4only.me/api/ -{% elif checkip == 'ip6only.me' %} +{% elif checkip == 'web_ip6only.me' %} use=web, web=http://ip6only.me/api/ -{% elif checkip == 'ipify-ipv4' %} +{% elif checkip == 'web_ipify-ipv4' %} use=web, web=https://api.ipify.org/ -{% elif checkip == 'ipify-ipv6' %} +{% elif checkip == 'web_ipify-ipv6' %} use=web, web=https://api6.ipify.org/ -{% elif checkip == 'loopia' %} +{% elif checkip == 'web_loopia' %} use=web, web=http://dns.loopia.se/checkip/checkip.php, web-skip="Current IP Address:" -{% elif checkip == 'myonlineportal' %} +{% elif checkip == 'web_myonlineportal' %} use=web, web=https://myonlineportal.net/checkip -{% elif checkip == 'noip-ipv4' %} +{% elif checkip == 'web_noip-ipv4' %} use=web, web=http://ip1.dynupdate.no-ip.com/ -{% elif checkip == 'noip-ipv6' %} +{% elif checkip == 'web_noip-ipv6' %} use=web, web=http://ip1.dynupdate6.no-ip.com/ -{% elif checkip == 'nsupdate.info-ipv4' %} +{% elif checkip == 'web_nsupdate.info-ipv4' %} use=web, web=https://ipv4.nsupdate.info/myip -{% elif checkip == 'nsupdate.info-ipv6' %} +{% elif checkip == 'web_nsupdate.info-ipv6' %} use=web, web=https://ipv6.nsupdate.info/myip -{% elif checkip == 'zoneedit' %} +{% elif checkip == 'web_zoneedit' %} use=web, web=http://dynamic.zoneedit.com/checkip.html -{% endif %} +{% endif %} {% endif %} {% if helpers.exists('OPNsense.DynDNS.accounts.account') %} {% for account in helpers.toList('OPNsense.DynDNS.accounts.account') %} {% if account.enabled|default('0') == '1' %} -{% if account.service == 'cloudflare' %} -protocol=cloudflare -zone={{account.zone}} +{% if account.use_interface|default('0') == '1' %} +use=if, if={{physical_interface(account.interface)}}, \ +{% endif %} +{% if account.service == 'custom' %} +protocol={{account.protocol}}, \ +ssl=yes, \ +server={{account.server}}, \ +{% elif account.service == 'cloudflare' %} +protocol=cloudflare, \ +zone={{account.zone}}, \ {% elif account.service == 'he-net' %} -protocol=dyndns2 -ssl=yes -server=dyn.dns.he.net +protocol=dyndns2, \ +ssl=yes, \ +server=dyn.dns.he.net, \ {% elif account.service == 'he-net-tunnel' %} -protocol=dyndns2 -ssl=yes -server=ipv4.tunnelbroker.net +protocol=dyndns2, \ +ssl=yes, \ +server=ipv4.tunnelbroker.net, \ {% elif account.service == 'nsupdatev4' %} -protocol=dyndns2 -ssl=yes -server=ipv4.nsupdate.info +protocol=dyndns2, \ +ssl=yes, \ +server=ipv4.nsupdate.info, \ {% elif account.service == 'nsupdatev6' %} -protocol=dyndns2 -ssl=yes -server=ipv6.nsupdate.info +protocol=dyndns2, \ +ssl=yes, \ +server=ipv6.nsupdate.info, \ {% elif account.service == 'strato' %} -use=web -protocol=dyndns2 -ssl=yes -server=dyndns.strato.com +protocol=dyndns2, \ +ssl=yes, \ +server=dyndns.strato.com, \ {% else %} -protocol={{account.service}} -ssl=yes +protocol={{account.service}}, \ +ssl=yes, \ {% endif %} {% if account.wildcard|default('0') == '1' %} -wildcard=yes +wildcard=yes, \ {% endif %} {% if account.username %} -login={{account.username}} +login={{account.username}}, \ {% endif %} -password={{account.password}} +password={{account.password}} \ {{account.hostnames}} {% endif %} From bd375036de7d1ef7fe7c375b55a72251cefd64af Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 5 Feb 2022 15:54:53 +0100 Subject: [PATCH 0952/3088] dns/ddclient - make sure there's a new version number before we're ready to release --- dns/ddclient/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 2c67781fd6..d0f2042782 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.0 +PLUGIN_VERSION= 1.1 #PLUGIN_REVISION= 1 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client From 12e7dd89b18dc83b8602f48aeadde6ce031a018c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20M=C3=BCller?= Date: Tue, 8 Feb 2022 17:07:45 +0100 Subject: [PATCH 0953/3088] dsn/ddclient option to force ssl (#2823) * dsn/ddclient option to force ssl * dns/ddclient default ssl --- .../app/controllers/OPNsense/DynDNS/forms/settings.xml | 7 +++++++ .../opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 6 +++++- .../service/templates/OPNsense/ddclient/ddclient.conf | 10 +++------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml index 756a2c4408..0a54f0a61b 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml @@ -12,6 +12,13 @@ true Enable verbose logging + + ddclient.general.force_ssl + + checkbox + true + Force update using HTTPS + ddclient.general.daemon_delay diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 7f01a0158e..36c102011d 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -1,6 +1,6 @@ //OPNsense/DynDNS - 1.0.0 + 1.1.0 Dynamic DNS client @@ -14,6 +14,10 @@ 0 Y + + 1 + Y + 300 Y diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 5aa00ca1c3..354c5917b4 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -2,6 +2,9 @@ daemon={{OPNsense.DynDNS.general.daemon_delay|default('300')}} syslog=yes # log update msgs to syslog pid=/var/run/ddclient.pid # record PID in file. +{% if not helpers.empty('OPNsense.DynDNS.general.force_ssl') %} +ssl=yes +{% endif %} {% if not helpers.empty('OPNsense.DynDNS.general.verbose') %} verbose=yes {% endif %} @@ -54,34 +57,27 @@ use=if, if={{physical_interface(account.interface)}}, \ {% endif %} {% if account.service == 'custom' %} protocol={{account.protocol}}, \ -ssl=yes, \ server={{account.server}}, \ {% elif account.service == 'cloudflare' %} protocol=cloudflare, \ zone={{account.zone}}, \ {% elif account.service == 'he-net' %} protocol=dyndns2, \ -ssl=yes, \ server=dyn.dns.he.net, \ {% elif account.service == 'he-net-tunnel' %} protocol=dyndns2, \ -ssl=yes, \ server=ipv4.tunnelbroker.net, \ {% elif account.service == 'nsupdatev4' %} protocol=dyndns2, \ -ssl=yes, \ server=ipv4.nsupdate.info, \ {% elif account.service == 'nsupdatev6' %} protocol=dyndns2, \ -ssl=yes, \ server=ipv6.nsupdate.info, \ {% elif account.service == 'strato' %} protocol=dyndns2, \ -ssl=yes, \ server=dyndns.strato.com, \ {% else %} protocol={{account.service}}, \ -ssl=yes, \ {% endif %} {% if account.wildcard|default('0') == '1' %} wildcard=yes, \ From a4ba4d9bc03cf19ca6ff648136c545424c86a25c Mon Sep 17 00:00:00 2001 From: lfirewall1243 <41630758+lfirewall1243@users.noreply.github.com> Date: Tue, 8 Feb 2022 18:37:02 +0100 Subject: [PATCH 0954/3088] make multimap Whitelist work (#2822) --- mail/rspamd/Makefile | 2 +- mail/rspamd/pkg-descr | 5 +++++ .../opnsense/service/templates/OPNsense/Rspamd/multimap.conf | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile index 01016fdafc..c1f1f8994b 100644 --- a/mail/rspamd/Makefile +++ b/mail/rspamd/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= rspamd -PLUGIN_VERSION= 1.11 +PLUGIN_VERSION= 1.12 PLUGIN_COMMENT= Protect your network from spam PLUGIN_DEPENDS= rspamd PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/mail/rspamd/pkg-descr b/mail/rspamd/pkg-descr index 183897120d..944931b608 100644 --- a/mail/rspamd/pkg-descr +++ b/mail/rspamd/pkg-descr @@ -5,6 +5,11 @@ lua. Plugin Changelog ---------------- +1.12 + +* Adjusting the multimap setting to make the multimap whitelist work + + 1.11 * Fix Milter Protocol by binding to Unix Sockets diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/multimap.conf b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/multimap.conf index f357673dc1..7875d94872 100644 --- a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/multimap.conf +++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/multimap.conf @@ -8,13 +8,13 @@ extension_blacklist { filter = "extension"; map = "/${LOCAL_CONFDIR}/local.d/bad_file_extensions.map"; symbol = "FILENAME_BLACKLISTED"; - action = "reject"; + score 1000; } WHITELIST_SENDER_DOMAIN { type = "from"; filter = "email:domain"; map = "/${LOCAL_CONFDIR}/local.d/whitelist_sender_domains.map"; - score = -50.0 + score = -1000 } {% endif %} From d40c3f833146f53e0db251615676f66e74c5fa76 Mon Sep 17 00:00:00 2001 From: Rene Schuster Date: Thu, 10 Feb 2022 08:51:00 +0100 Subject: [PATCH 0955/3088] dns/ddclient add dns-o-matic (#2829) --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 36c102011d..6ddd20cc32 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -65,6 +65,7 @@ Changeip Cloudflare + DNS-O-Matic DynDNS.com DnsPark DslReports diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 354c5917b4..151bd52665 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -61,6 +61,9 @@ server={{account.server}}, \ {% elif account.service == 'cloudflare' %} protocol=cloudflare, \ zone={{account.zone}}, \ +{% elif account.service == 'dns-o-matic' %} +protocol=dyndns2, \ +server=updates.dnsomatic.com, \ {% elif account.service == 'he-net' %} protocol=dyndns2, \ server=dyn.dns.he.net, \ From 18428e1f5cf54f4e7e00612d38b8f07952cd3f90 Mon Sep 17 00:00:00 2001 From: Rene Schuster Date: Thu, 10 Feb 2022 08:53:30 +0100 Subject: [PATCH 0956/3088] dns/ddclient add inwx (#2828) --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 6ddd20cc32..00cfbef2d2 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -74,6 +74,7 @@ Google HE.net HE.net TunnelBroker + INWX NameCheap Noip nsupdate.info (IPv4) diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 151bd52665..753ad9ddfd 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -70,6 +70,9 @@ server=dyn.dns.he.net, \ {% elif account.service == 'he-net-tunnel' %} protocol=dyndns2, \ server=ipv4.tunnelbroker.net, \ +{% elif account.service == 'inwx' %} +protocol=dyndns2, \ +server=dyndns.inwx.com, \ {% elif account.service == 'nsupdatev4' %} protocol=dyndns2, \ server=ipv4.nsupdate.info, \ From b1636198a6629bb433d0a97806bc46936fbe0044 Mon Sep 17 00:00:00 2001 From: Rene Schuster Date: Thu, 10 Feb 2022 08:54:03 +0100 Subject: [PATCH 0957/3088] dns/ddclient add spdyn (#2827) --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 00cfbef2d2..a11711fdcb 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -79,6 +79,7 @@ Noip nsupdate.info (IPv4) nsupdate.info (IPv6) + spDYN STRATO Zoneedit Custom diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 753ad9ddfd..d4c6b0ecf1 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -79,6 +79,9 @@ server=ipv4.nsupdate.info, \ {% elif account.service == 'nsupdatev6' %} protocol=dyndns2, \ server=ipv6.nsupdate.info, \ +{% elif account.service == 'spdyn' %} +protocol=dyndns2, \ +server=update.spdyn.de, \ {% elif account.service == 'strato' %} protocol=dyndns2, \ server=dyndns.strato.com, \ From cb54991aca3b0d9e91aafcb8080610d6d88a05ea Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 15 Feb 2022 08:22:56 +0100 Subject: [PATCH 0958/3088] LICENSE: sync --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 401f5af5f8..750286c49a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2020 Ad Schellevis +Copyright (c) 2015-2022 Ad Schellevis Copyright (c) 2021 Alexander Noack Copyright (c) 2021 Andreas Stuerz Copyright (c) 2021 Axelrtgs From 6620212d7fbe43d482ceeced000c344d4719efc5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 15 Feb 2022 08:24:11 +0100 Subject: [PATCH 0959/3088] dns/dnscrypt-proxy: do not break line --- dns/dnscrypt-proxy/pkg-descr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dns/dnscrypt-proxy/pkg-descr b/dns/dnscrypt-proxy/pkg-descr index 8619615eb4..cbe2d972b9 100644 --- a/dns/dnscrypt-proxy/pkg-descr +++ b/dns/dnscrypt-proxy/pkg-descr @@ -8,8 +8,7 @@ Plugin Changelog 1.11 * Fix DNSBL update due to FreeBSD13 upgrade (sed syntax) -* Fix "manual disable of specific servers" when more than one server is - specified (contributed by Evgeny Grin (karlson2k)) +* Fix "manual disable of specific servers" when more than one server is specified (contributed by Evgeny Grin (karlson2k)) 1.10 From 0cd0919f3b8bcc2a7602b317ebf50de61be49e2d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 15 Feb 2022 08:29:36 +0100 Subject: [PATCH 0960/3088] net/frr: fix notes and version --- net/frr/Makefile | 2 +- net/frr/pkg-descr | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index ca8ca4dd54..026281f058 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.26 +PLUGIN_VERSION= 1.27 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index a8ef2122df..be8a211623 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -11,10 +11,13 @@ switching and routing, Internet access routers, and Internet peering. Plugin Changelog ================ +1.27 + +* Add BGP password authentication + 1.26 * Fix Model migration errors -* Add BGP password authentication 1.25 From 8924d3b010f9bf60d41daf6c4f1983248b4b6496 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 15 Feb 2022 08:33:03 +0100 Subject: [PATCH 0961/3088] sysutils/nextcloud-backup: adjust version --- sysutils/nextcloud-backup/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sysutils/nextcloud-backup/Makefile b/sysutils/nextcloud-backup/Makefile index dd29cd1013..146dce479f 100644 --- a/sysutils/nextcloud-backup/Makefile +++ b/sysutils/nextcloud-backup/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= nextcloud-backup PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Track config changes using NextCloud PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From bc37630cdf36987d1c636bbf6e3e04e9a3da2022 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 15 Feb 2022 08:50:53 +0100 Subject: [PATCH 0962/3088] dns/ddclient: update pkg-descr --- dns/ddclient/pkg-descr | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 0aed7a9f65..9453dcf2e0 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -1 +1,22 @@ -Support for numerous Dynamic DNS services using ddclient +ddclient is a Perl client used to update dynamic DNS entries for +accounts on many dynamic DNS services. + +WWW: https://github.com/ddclient/ddclient + +Plugin Changelog +================ + +1.1 + +* Add spdyn, inwx and dns-o-matic (contributed by Rene Schuster) +* Add Hurricane Electric provider (contributed by Netboy3) +* Add option to force SSL, on by default (contributed by Robin Mueller) +* Add Cloudflare and custom service (contributed by Robin Mueller) +* Add STRATO provider (contributed by Alex Mi) +* Add use interface as IP source +* Fix ip6only.me (contributed by Robin Mueller) +* Fix uppercase use in usernames + +1.0 + +* Initial release From 18225b7a4ae52753258deaa1f59399f2545d7fd6 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Feb 2022 10:00:21 +0100 Subject: [PATCH 0963/3088] net/freeradius: Allow LDAP in inner-tunnel (#2626) --- net/freeradius/Makefile | 2 +- net/freeradius/pkg-descr | 4 ++++ .../controllers/OPNsense/Freeradius/forms/ldap.xml | 6 ++++++ .../mvc/app/models/OPNsense/Freeradius/Ldap.xml | 6 +++++- .../OPNsense/Freeradius/sites-enabled-inner-tunnel | 11 +++++++++++ 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index a98a82cb33..ec54c2893c 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= freeradius -PLUGIN_VERSION= 1.9.18 +PLUGIN_VERSION= 1.9.19 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index d2006a9d0d..9e2092f874 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -15,6 +15,10 @@ The server is fast, feature-rich, modular, and scalable. Plugin Changelog ================ +1.9.19 + +* Allow to use LDAP in inner-tunnel (needed for LDAP authentication within 802.1X) + 1.9.18 * Added support for fallback VLAN diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/ldap.xml b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/ldap.xml index 38fa2a6508..29cb57c693 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/ldap.xml +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/ldap.xml @@ -1,4 +1,10 @@
    + + ldap.innertunnel + + checkbox + This enables LDAP authentication in inner-tunnel configuration. This is needed for protocols requiring encrypted authentication like 802.1X. + ldap.protocol diff --git a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Ldap.xml b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Ldap.xml index 3797eb5e5d..53b4f55b53 100644 --- a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Ldap.xml +++ b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Ldap.xml @@ -1,8 +1,12 @@ //OPNsense/freeradius/ldap LDAP configuration - 1.0.0 + 1.0.1 + + 0 + Y + LDAPS Y diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel index 55f9879907..a7fb955358 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel @@ -155,7 +155,16 @@ authorize { # # The ldap module reads passwords from the LDAP database. +{% if helpers.exists('OPNsense.freeradius.ldap.innertunnel') and OPNsense.freeradius.general.ldap.innertunnel == '1' %} + ldap + if ((ok || updated) && User-Password) { + update control { + Auth-Type := ldap + } + } +{% else %} -ldap +{% endif %} # # Enforce daily limits on time spent logged in. @@ -242,9 +251,11 @@ authenticate { # authentication server, and knows what to do with authentication. # LDAP servers do not. # +{% if helpers.exists('OPNsense.freeradius.ldap.innertunnel') and OPNsense.freeradius.general.ldap.innertunnel == '1' %} # Auth-Type LDAP { # ldap # } +{% endif %} # # Allow EAP authentication. From acabf8281319b6502030f6bbe1acd4f53e785412 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 Feb 2022 21:15:29 +0100 Subject: [PATCH 0964/3088] Update sites-enabled-inner-tunnel (#2835) --- .../OPNsense/Freeradius/sites-enabled-inner-tunnel | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel index a7fb955358..838a6a3746 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel @@ -252,9 +252,9 @@ authenticate { # LDAP servers do not. # {% if helpers.exists('OPNsense.freeradius.ldap.innertunnel') and OPNsense.freeradius.general.ldap.innertunnel == '1' %} -# Auth-Type LDAP { -# ldap -# } + Auth-Type LDAP { + ldap + } {% endif %} # From 9caf5b7267af70eecc9cdfc54c7e8c7576775e38 Mon Sep 17 00:00:00 2001 From: Rene Schuster Date: Wed, 16 Feb 2022 11:48:30 +0100 Subject: [PATCH 0965/3088] dns/ddclient add dynu (#2838) --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index a11711fdcb..f375be73b0 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -70,6 +70,7 @@ DnsPark DslReports DuckDNS + Dynu EasyDNS Google HE.net diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index d4c6b0ecf1..f6aa2dac64 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -64,6 +64,9 @@ zone={{account.zone}}, \ {% elif account.service == 'dns-o-matic' %} protocol=dyndns2, \ server=updates.dnsomatic.com, \ +{% elif account.service == 'dynu' %} +protocol=dyndns2, \ +server=api.dynu.com, \ {% elif account.service == 'he-net' %} protocol=dyndns2, \ server=dyn.dns.he.net, \ From 73b1443e18868b4292bc3b8b492bf9c7f2bb2d0e Mon Sep 17 00:00:00 2001 From: Rene Schuster Date: Wed, 16 Feb 2022 20:28:55 +0100 Subject: [PATCH 0966/3088] dns/ddclient add FreeDNS (#2837) * dns/ddclient add FreeDNS Co-authored-by: Ad Schellevis --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index f375be73b0..5483207244 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -72,6 +72,7 @@ DuckDNS Dynu EasyDNS + FreeDNS Google HE.net HE.net TunnelBroker diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index f6aa2dac64..d5b999fd20 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -64,6 +64,9 @@ zone={{account.zone}}, \ {% elif account.service == 'dns-o-matic' %} protocol=dyndns2, \ server=updates.dnsomatic.com, \ +{% elif account.service == 'freedns' %} +protocol=freedns, \ +server=freedns.afraid.org, \ {% elif account.service == 'dynu' %} protocol=dyndns2, \ server=api.dynu.com, \ From a07e93d85f69fdc7829e30c2ada93f9aa3bf9b69 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 18 Feb 2022 09:27:54 +0100 Subject: [PATCH 0967/3088] dns/ddclient: next iteration --- dns/ddclient/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index d0f2042782..f622a5768d 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.1 -#PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.2 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org From c526550c15bf1ad8efbaef819ed1b98daf71d286 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 18 Feb 2022 09:37:16 +0100 Subject: [PATCH 0968/3088] dns/ddclient: style sweep --- .../app/controllers/OPNsense/DynDNS/Api/AccountsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php index 2f6367856c..f02e7c039f 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php @@ -50,7 +50,7 @@ public function searchItemAction() } unset($row['use_interface']); if ($row['service'] == 'Custom') { - $row['service'] = 'Custom ('.$row['protocol'].')'; + $row['service'] = 'Custom (' . $row['protocol'] . ')'; } unset($row['protocol']); } From 510d55c006ac44964a6b0be94c59b07090fb5a59 Mon Sep 17 00:00:00 2001 From: "Johnny S. Lee" <6614805+johnnyslee@users.noreply.github.com> Date: Mon, 21 Feb 2022 15:55:21 +0800 Subject: [PATCH 0969/3088] security/stunnel: Fix connect format for IPv6 addresses (#2852) The current code generates conf line: ``` connect = [::1]:53 ``` will end up producing the following: ``` Error resolving "[::1]": Neither nodename nor servname known (EAI_NONAME) ``` stunnel(8) states that an address parameter of an option may be either: > ... > A colon-separated pair of IP address (either IPv4, IPv6, or domain name) and port number. > ... which means there should not be special treatment on IPv6 addresses. --- .../opnsense/service/templates/OPNsense/Stunnel/stunnel.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf index 8c3ee5ecca..0d6590d383 100644 --- a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf +++ b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf @@ -18,7 +18,7 @@ logId = unique ; ************************************************************************** [{{service['@uuid']}}] accept = {% if service.accept_address %}{{service.accept_address}}:{% endif %}{{service.accept_port}} -connect = {% if service.connect_address.find(":") > -1 %}[{{service.connect_address}}]{% else %}{{service.connect_address}}{% endif %}:{{service.connect_port}} +connect = {{service.connect_address}}:{{service.connect_port}} {% if service.protocol %} protocol = {{service.protocol}} {% endif %} From 1c701ed5b92112f2b7228b80878026215eae733b Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 21 Feb 2022 15:11:12 +0100 Subject: [PATCH 0970/3088] dns/bind: fix sed usage with FBSD13 (#2857) --- dns/bind/Makefile | 2 +- dns/bind/pkg-descr | 4 ++ .../opnsense/scripts/OPNsense/Bind/dnsbl.sh | 48 +++++++++---------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 738804e21e..f810d13b74 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.21 +PLUGIN_VERSION= 1.22 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 0f64290fbb..465c763340 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -8,6 +8,10 @@ necessary for asking and answering name service questions. Plugin Changelog ================ +1.22 + +* Fix DNS Blacklist download + 1.21 * Add support for filter AAAA in DNS responses when A is present (contributed by Zane Chua) diff --git a/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh b/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh index aac1ad92ee..9324b6b2a3 100755 --- a/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh +++ b/dns/bind/src/opnsense/scripts/OPNsense/Bind/dnsbl.sh @@ -38,70 +38,70 @@ mkdir -p ${WORKDIR} easylist() { # EasyList ${FETCH} https://justdomains.github.io/blocklists/lists/easylist-justdomains.txt -o ${WORKDIR}/easylist-raw - sed "/\.$/d" ${WORKDIR}/easylist-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/easylist + sed "/\.$/d" ${WORKDIR}/easylist-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/easylist rm ${WORKDIR}/easylist-raw } easyprivacy() { # EasyPrivacy ${FETCH} https://justdomains.github.io/blocklists/lists/easyprivacy-justdomains.txt -o ${WORKDIR}/easyprivacy-raw - sed "/\.$/d" ${WORKDIR}/easyprivacy-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/easyprivacy + sed "/\.$/d" ${WORKDIR}/easyprivacy-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/easyprivacy rm ${WORKDIR}/easyprivacy-raw } pornall() { # PornAll ${FETCH} https://raw.githubusercontent.com/chadmayfield/my-pihole-blocklists/master/lists/pi_blocklist_porn_all.list -o ${WORKDIR}/pornall-raw - sed "/\.$/d" ${WORKDIR}/pornall-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/pornall + sed "/\.$/d" ${WORKDIR}/pornall-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/pornall rm ${WORKDIR}/pornall-raw } porntop() { # PornTop1M ${FETCH} https://raw.githubusercontent.com/chadmayfield/pihole-blocklists/master/lists/pi_blocklist_porn_top1m.list -o ${WORKDIR}/porntop-raw - sed "/\.$/d" ${WORKDIR}/porntop-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/porntop + sed "/\.$/d" ${WORKDIR}/porntop-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/porntop rm ${WORKDIR}/porntop-raw } emdlist() { # EMD ${FETCH} https://hosts-file.net/emd.txt -o ${WORKDIR}/emdlist-raw - sed "/\.$/d" ${WORKDIR}/emdlist-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/emdlist + sed "/\.$/d" ${WORKDIR}/emdlist-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/emdlist rm ${WORKDIR}/emdlist-raw } adguard() { # AdGuard ${FETCH} https://justdomains.github.io/blocklists/lists/adguarddns-justdomains.txt -o ${WORKDIR}/adguard-raw - sed "/\.$/d" ${WORKDIR}/adguard-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/adguard + sed "/\.$/d" ${WORKDIR}/adguard-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/adguard rm ${WORKDIR}/adguard-raw } nocoin() { # NoCoin ${FETCH} https://justdomains.github.io/blocklists/lists/nocoin-justdomains.txt -o ${WORKDIR}/nocoin-raw - sed "/\.$/d" ${WORKDIR}/nocoin-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/nocoin + sed "/\.$/d" ${WORKDIR}/nocoin-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/nocoin rm ${WORKDIR}/nocoin-raw } rwtracker() { # RansomWare Tracker abuse.ch ${FETCH} https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt -o ${WORKDIR}/rwtracker-raw - sed "/\.$/d" ${WORKDIR}/rwtracker-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/rwtracker + sed "/\.$/d" ${WORKDIR}/rwtracker-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/rwtracker rm ${WORKDIR}/rwtracker-raw } mwdomains() { # MalwareDomains ${FETCH} http://malwaredomains.lehigh.edu/files/justdomains -o ${WORKDIR}/malwaredomains-raw - sed "/\.$/d" ${WORKDIR}/malwaredomains-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/malwaredomains + sed "/\.$/d" ${WORKDIR}/malwaredomains-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/malwaredomains rm ${WORKDIR}/malwaredomains-raw } windowsspyblockerspy() { # WindowsSpyBlocker (spy) ${FETCH} https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt -o ${WORKDIR}/windowsspyblockerspy-raw - sed "/\.$/d" ${WORKDIR}/windowsspyblockerspy-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerspy + sed "/\.$/d" ${WORKDIR}/windowsspyblockerspy-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerspy rm ${WORKDIR}/windowsspyblockerspy-raw } @@ -115,98 +115,98 @@ windowsspyblockerupdate() { windowsspyblockerextra() { # WindowsSpyBlocker (extra) ${FETCH} https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt -o ${WORKDIR}/windowsspyblockerextra-raw - sed "/\.$/d" ${WORKDIR}/windowsspyblockerextra-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerextra + sed "/\.$/d" ${WORKDIR}/windowsspyblockerextra-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/windowsspyblockerextra rm ${WORKDIR}/windowsspyblockerextra-raw } cameleon() { # Cameleon List ${FETCH} http://sysctl.org/cameleon/hosts -o ${WORKDIR}/cameleon-raw - sed "/\.$/d" ${WORKDIR}/cameleon-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/cameleon + sed "/\.$/d" ${WORKDIR}/cameleon-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/cameleon rm ${WORKDIR}/cameleon-raw } adaway() { # AdAway List ${FETCH} https://adaway.org/hosts.txt -o ${WORKDIR}/adaway-raw - sed "/\.$/d" ${WORKDIR}/adaway-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/adaway + sed "/\.$/d" ${WORKDIR}/adaway-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/adaway rm ${WORKDIR}/adaway-raw } yoyo() { # YoYo List ${FETCH} "http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext" -o ${WORKDIR}/yoyo-raw - sed "/\.$/d" ${WORKDIR}/yoyo-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/yoyo + sed "/\.$/d" ${WORKDIR}/yoyo-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/yoyo rm ${WORKDIR}/yoyo-raw } stevenblack() { # StevenBlack ${FETCH} https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts -o ${WORKDIR}/stevenblack-raw - sed "/\.$/d" ${WORKDIR}/stevenblack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/stevenblack + sed "/\.$/d" ${WORKDIR}/stevenblack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/stevenblack rm ${WORKDIR}/stevenblack-raw } blocklistads() { # Blocklist.site Ads ${FETCH} https://blocklistproject.github.io/Lists/ads.txt -o ${WORKDIR}/blocklistads-raw - sed "/\.$/d" ${WORKDIR}/blocklistads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistads + sed "/\.$/d" ${WORKDIR}/blocklistads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistads rm ${WORKDIR}/blocklistads-raw } blocklistfraud() { # Blocklist.site Fraud ${FETCH} https://blocklistproject.github.io/Lists/fraud.txt -o ${WORKDIR}/blocklistfraud-raw - sed "/\.$/d" ${WORKDIR}/blocklistfraud-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistfraud + sed "/\.$/d" ${WORKDIR}/blocklistfraud-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistfraud rm ${WORKDIR}/blocklistfraud-raw } blocklistphishing() { # Blocklist.site Phishing ${FETCH} https://blocklistproject.github.io/Lists/phishing.txt -o ${WORKDIR}/blocklistphishing-raw - sed "/\.$/d" ${WORKDIR}/blocklistphishing-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistphishing + sed "/\.$/d" ${WORKDIR}/blocklistphishing-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/127\.0\.0\.1/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" > ${WORKDIR}/blocklistphishing rm ${WORKDIR}/blocklistphishing-raw } hphosts-ads() { # hphosts-ads ${FETCH} https://hosts-file.net/ad_servers.txt -o ${WORKDIR}/hphosts-ads-raw - sed "/\.$/d" ${WORKDIR}/hphosts-ads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-ads + sed "/\.$/d" ${WORKDIR}/hphosts-ads-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-ads rm ${WORKDIR}/hphosts-ads-raw } hphosts-fsa() { # hphosts-fsa ${FETCH} https://hosts-file.net/fsa.txt -o ${WORKDIR}/hphosts-fsa-raw - sed "/\.$/d" ${WORKDIR}/hphosts-fsa-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-fsa + sed "/\.$/d" ${WORKDIR}/hphosts-fsa-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-fsa rm ${WORKDIR}/hphosts-fsa-raw } hphosts-psh() { # hphosts-psh ${FETCH} https://hosts-file.net/psh.txt -o ${WORKDIR}/hphosts-psh-raw - sed "/\.$/d" ${WORKDIR}/hphosts-psh-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-psh + sed "/\.$/d" ${WORKDIR}/hphosts-psh-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-psh rm ${WORKDIR}/hphosts-psh-raw } hphosts-pup() { # hphosts-pup ${FETCH} https://hosts-file.net/pup.txt -o ${WORKDIR}/hphosts-pup-raw - sed "/\.$/d" ${WORKDIR}/hphosts-pup-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-pup + sed "/\.$/d" ${WORKDIR}/hphosts-pup-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" | sed "/localhost/d" | sed "/255\.255\.255\.255/d" | sed "/\:\:1/d" | sed "/fe80\:\:1/d" | sed "/ff00\:\:/d" | sed "/ff02\:\:/d" | sed "/0\.0\.0\.0 0\.0\.0\.0/d" | tr -d '\r' | awk 'BEGIN{FS=OFS=" ";}{print $2;}' > ${WORKDIR}/hphosts-pup rm ${WORKDIR}/hphosts-pup-raw } simplead() { # Simple Ad List ${FETCH} https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt -o ${WORKDIR}/simplead-raw - sed "/\.$/d" ${WORKDIR}/simplead-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simplead + sed "/\.$/d" ${WORKDIR}/simplead-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simplead rm ${WORKDIR}/simplead-raw } simpletrack() { # Simple Tracking List ${FETCH} https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt -o ${WORKDIR}/simpletrack-raw - sed "/\.$/d" ${WORKDIR}/simpletrack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^\s*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simpletrack + sed "/\.$/d" ${WORKDIR}/simpletrack-raw | sed "/^#/d" | sed "/\_/d" | sed "/^[[:space:]]*$/d" | sed "/\.\./d" | sed "s/^\.//g" > ${WORKDIR}/simpletrack rm ${WORKDIR}/simpletrack-raw } From 1407b4be48154743b55030b11ce5dcc993149246 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 1 Mar 2022 09:58:39 +0100 Subject: [PATCH 0971/3088] dns/ddclient - allow root zones and wildcards. closes https://github.com/opnsense/plugins/issues/2849 --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 5483207244..87cad2655c 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -111,6 +111,9 @@ Y N + Y + Y + Y Y , From 6a6882e051ec8d5374c1f8e2f31550874b46ec4d Mon Sep 17 00:00:00 2001 From: Rene Schuster Date: Wed, 23 Feb 2022 09:16:48 +0100 Subject: [PATCH 0972/3088] dns/ddclient add DNS Made Easy --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 2 ++ 2 files changed, 3 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 87cad2655c..e99da62469 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -65,6 +65,7 @@ Changeip Cloudflare + DNS Made Easy DNS-O-Matic DynDNS.com DnsPark diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index d5b999fd20..fe8dbf2f0e 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -61,6 +61,8 @@ server={{account.server}}, \ {% elif account.service == 'cloudflare' %} protocol=cloudflare, \ zone={{account.zone}}, \ +{% elif account.service == 'dnsmadeeasy' %} +protocol=dnsmadeeasy, \ {% elif account.service == 'dns-o-matic' %} protocol=dyndns2, \ server=updates.dnsomatic.com, \ From 5cc6f76eab4a66515600f7376c5bcf8f0eaad70f Mon Sep 17 00:00:00 2001 From: Johan Lilja Date: Tue, 1 Mar 2022 10:04:01 +0100 Subject: [PATCH 0973/3088] dns/ddclient add Loopia (#2858) --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index e99da62469..9b559cc664 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -78,6 +78,7 @@ HE.net HE.net TunnelBroker INWX + Loopia NameCheap Noip nsupdate.info (IPv4) diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index fe8dbf2f0e..a09ef011b7 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -81,6 +81,9 @@ server=ipv4.tunnelbroker.net, \ {% elif account.service == 'inwx' %} protocol=dyndns2, \ server=dyndns.inwx.com, \ +{% elif account.service == 'loopia' %} +protocol=dyndns2, \ +server=dyndns.loopia.se, \ {% elif account.service == 'nsupdatev4' %} protocol=dyndns2, \ server=ipv4.nsupdate.info, \ From 8c253fee031aec0ab65bdf7b674ab894c1f6c991 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 1 Mar 2022 10:04:56 +0100 Subject: [PATCH 0974/3088] security/stunnel: bump version --- security/stunnel/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index 6ddef16665..87786dae30 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= stunnel -PLUGIN_VERSION= 1.0.3 +PLUGIN_VERSION= 1.0.4 PLUGIN_COMMENT= Stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel From 698d8164342f207ea4e964bdb524526de40bb333 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 1 Mar 2022 10:11:20 +0100 Subject: [PATCH 0975/3088] dns/ddclient: changelog updates --- dns/ddclient/pkg-descr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 9453dcf2e0..545d537f46 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,12 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.2 + +* Add Loopia (contributed by Johan Lilja) +* Add DNS Made Easy, FreeDNS and Dynu (contributed by Rene Schuster) +* Add root zone and wildcard support + 1.1 * Add spdyn, inwx and dns-o-matic (contributed by Rene Schuster) From b0fcd8230534b015bf24b346f3b1693b3ba82333 Mon Sep 17 00:00:00 2001 From: c-goes Date: Mon, 7 Mar 2022 11:40:12 +0100 Subject: [PATCH 0976/3088] net/freeradius: Fix template for sites-enabled-inner-tunnel (#2881) --- .../templates/OPNsense/Freeradius/sites-enabled-inner-tunnel | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel index 838a6a3746..3665e1ffa5 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/sites-enabled-inner-tunnel @@ -155,7 +155,7 @@ authorize { # # The ldap module reads passwords from the LDAP database. -{% if helpers.exists('OPNsense.freeradius.ldap.innertunnel') and OPNsense.freeradius.general.ldap.innertunnel == '1' %} +{% if helpers.exists('OPNsense.freeradius.ldap.innertunnel') and OPNsense.freeradius.ldap.innertunnel == '1' %} ldap if ((ok || updated) && User-Password) { update control { @@ -251,7 +251,7 @@ authenticate { # authentication server, and knows what to do with authentication. # LDAP servers do not. # -{% if helpers.exists('OPNsense.freeradius.ldap.innertunnel') and OPNsense.freeradius.general.ldap.innertunnel == '1' %} +{% if helpers.exists('OPNsense.freeradius.ldap.innertunnel') and OPNsense.freeradius.ldap.innertunnel == '1' %} Auth-Type LDAP { ldap } From d408dbb6487f6316ec38e868d59fea00320323a8 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 13 Mar 2022 17:38:28 +0100 Subject: [PATCH 0977/3088] dns/ddclient - move checkip properties from general settings to account and implement interface selection using curl. closes https://github.com/opnsense/plugins/issues/2863 o adds migration taking previous use_interface toggle into account o embed fetch address into new script /usr/local/opnsense/scripts/ddclient/checkip o guess protocol as the result can't contain two addresses anyway (service determines protocol) o add OVH, provided by @toxic0berliner --- dns/ddclient/Makefile | 2 +- dns/ddclient/pkg-descr | 5 ++ .../DynDNS/Api/AccountsController.php | 4 - .../OPNsense/DynDNS/forms/dialogAccount.xml | 14 +++- .../OPNsense/DynDNS/forms/settings.xml | 19 ----- .../mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 64 +++++++------- .../OPNsense/DynDNS/Migrations/M1_2_0.php | 70 ++++++++++++++++ .../mvc/app/views/OPNsense/DynDNS/index.volt | 12 +-- .../src/opnsense/scripts/ddclient/checkip | 84 +++++++++++++++++++ .../templates/OPNsense/ddclient/ddclient.conf | 53 +++--------- 10 files changed, 209 insertions(+), 118 deletions(-) create mode 100644 dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/Migrations/M1_2_0.php create mode 100755 dns/ddclient/src/opnsense/scripts/ddclient/checkip diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index f622a5768d..d4f5a19148 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.2 +PLUGIN_VERSION= 1.3 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 545d537f46..0fedfce731 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,11 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.3 + +* Add checkip settings per account using selected source interface when provided +* Add OVH DynHost to the DynDNS providers + 1.2 * Add Loopia (contributed by Johan Lilja) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php index f02e7c039f..08c21b694c 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php @@ -45,10 +45,6 @@ public function searchItemAction() "description" ); foreach ($result['rows'] as &$row) { - if ($row['use_interface'] == "0") { - $row['interface'] = ""; - } - unset($row['use_interface']); if ($row['service'] == 'Custom') { $row['service'] = 'Custom (' . $row['protocol'] . ')'; } diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml index dd0b6f0ae4..020d202166 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml @@ -60,14 +60,20 @@ Hostname to update - account.use_interface - + account.checkip + + dropdown + How to determine the address to use for this host + + + account.force_ssl + checkbox - Use the IP of a specified interface for the update + Force update using HTTPS account.interface - + dropdown diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml index 0a54f0a61b..9d67554115 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml @@ -12,29 +12,10 @@ true Enable verbose logging - - ddclient.general.force_ssl - - checkbox - true - Force update using HTTPS - ddclient.general.daemon_delay text Interval in seconds to check for address changes - - ddclient.general.checkip - - dropdown - How to determine the address to use for this host - - - ddclient.general.interface - - dropdown - - diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 9b559cc664..eb367952fe 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -1,6 +1,6 @@ //OPNsense/DynDNS - 1.1.0 + 1.2.0 Dynamic DNS client @@ -14,44 +14,12 @@ 0 Y - - 1 - Y - 300 Y 1 86400 - - Y - web_dyndns - An IP service type is required. - - dyndns - freedns - googledomains - he - ip4only.me - ip6only.me - ipify-ipv4 - ipify-ipv6 - loopia - myonlineportal - noip-ipv4 - noip-ipv6 - nsupdate.info-ipv4 - nsupdate.info-ipv6 - zoneedit - Interface - - - - N - N - wan - @@ -86,6 +54,7 @@ spDYN STRATO Zoneedit + OVH DynHost Custom
    @@ -127,10 +96,33 @@ N N - - 0 + + Y + web_dyndns + An IP service type is required. + + dyndns + freedns + googledomains + he + ip4only.me + ip6only.me + ipify-ipv4 + ipify-ipv6 + loopia + myonlineportal + noip-ipv4 + noip-ipv6 + nsupdate.info-ipv4 + nsupdate.info-ipv6 + zoneedit + Interface + + + + 1 Y - + N N diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/Migrations/M1_2_0.php b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/Migrations/M1_2_0.php new file mode 100644 index 0000000000..339c9c98d2 --- /dev/null +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/Migrations/M1_2_0.php @@ -0,0 +1,70 @@ +object(); + + if (empty($config->OPNsense->DynDNS)) { + return; + } + + // migration will move these settings, extract datapoints from raw config + $checkip = (string)$config->OPNsense->DynDNS->general->checkip; + $interface = $checkip == "if" ? (string)$config->OPNsense->DynDNS->general->interface : ""; + $force_ssl = (string)$config->OPNsense->DynDNS->general->force_ssl; + $pre_account = []; + if (!empty($config->OPNsense->DynDNS->accounts->account)) { + foreach ($config->OPNsense->DynDNS->accounts->account as $account) { + $pre_account[(string)$account->attributes()['uuid']] = [ + "checkip" => !empty($account->use_interface) ? "if" : $checkip, + "interface" => !empty($account->use_interface) ? (string)$account->interface : $interface + ]; + } + } + + // update accounts + foreach ($model->accounts->account->iterateItems() as $account) { + $uuid = $account->getAttributes()['uuid']; + $account->checkip = $pre_account[$uuid]['checkip']; + $account->interface = $pre_account[$uuid]['interface']; + $account->force_ssl = $force_ssl; + } + } +} diff --git a/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt b/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt index c60d789495..d8f64ad272 100644 --- a/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt +++ b/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt @@ -67,19 +67,8 @@ POSSIBILITY OF SUCH DAMAGE. } }); }); - $("#account\\.use_interface").change(function(){ - if ($(this).is(':checked')) { - $("#account\\.interface").prop( "disabled", false ); - $("#account\\.interface").closest("tr").show(); - } else { - $("#account\\.interface").closest("tr").hide(); - $("#account\\.interface").prop( "disabled", true ); - } - $('#account\\.interface').selectpicker('refresh'); - }); $('#DialogAccount').on('shown.bs.modal', function (e) { $("#account\\.service").change(); - $("#account\\.use_interface").change(); }); $("#ddclient\\.general\\.checkip").change(function(){ @@ -113,6 +102,7 @@ POSSIBILITY OF SUCH DAMAGE.
    + diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/checkip b/dns/ddclient/src/opnsense/scripts/ddclient/checkip new file mode 100755 index 0000000000..af6d07f05d --- /dev/null +++ b/dns/ddclient/src/opnsense/scripts/ddclient/checkip @@ -0,0 +1,84 @@ +#!/usr/local/bin/python3 + +""" + Copyright (c) 2022 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import argparse +import subprocess +import re +import ipaddress + +service_list = { + 'dyndns': '%s://checkip.dyndns.org/', + 'freedns': '%s://freedns.afraid.org/dynamic/check.php', + 'googledomains': '%s://domains.google.com/checkip', + 'he': '%s://checkip.dns.he.net/', + 'ip4only.me': '%s://ip4only.me/api/', + 'ip6only.me': '%s://ip6only.me/api/', + 'ipify-ipv4': '%s://api.ipify.org/', + 'ipify-ipv6': '%s://api6.ipify.org/', + 'loopia': '%s://dns.loopia.se/checkip/checkip.php', + 'myonlineportal': '%s://myonlineportal.net/checkip', + 'noip-ipv4': '%s://ip1.dynupdate.no-ip.com/', + 'noip-ipv6': '%s://ip1.dynupdate6.no-ip.com/', + 'nsupdate.info-ipv4': '%s://ipv4.nsupdate.info/myip', + 'nsupdate.info-ipv6': '%s://ipv6.nsupdate.info/myip', + 'zoneedit': '%s://dynamic.zoneedit.com/checkip.html' +} + + +def extract_address(txt): + """ Extract first IPv4 or IPv6 address from provided string + :param txt: text blob + :return: str + """ + for regexp in [r'[^a-fA-F0-9\:]', r'[^F0-9\.]']: + for line in re.sub(regexp, ' ', txt).split(): + if line.count('.') == 3 or line.count(':') > 4: + try: + ipaddress.ip_address(line) + return line + except ValueError: + pass + +if __name__ == '__main__': + # handle parameters + parser = argparse.ArgumentParser() + parser.add_argument('-s', '--service', help='service name', choices=service_list.keys(), required=True) + parser.add_argument('-i', '--interface', help='interface', type=str, default='') + parser.add_argument('-t', '--tls', help='enforce tls', choices=['0', '1'], default='0') + inputargs = parser.parse_args() + + # use curl to fetch data, so we can optionally use "--interface" + params = ['/usr/local/bin/curl'] + if inputargs.interface.strip() != "": + params.append("--interface") + params.append(inputargs.interface) + + proto = 'http' if inputargs.tls == "0" else 'https' + params.append(service_list[inputargs.service] % proto) + + result = subprocess.run(params, capture_output=True, text=True).stdout + print (extract_address(result)) diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index a09ef011b7..71d3f19728 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -2,58 +2,22 @@ daemon={{OPNsense.DynDNS.general.daemon_delay|default('300')}} syslog=yes # log update msgs to syslog pid=/var/run/ddclient.pid # record PID in file. -{% if not helpers.empty('OPNsense.DynDNS.general.force_ssl') %} -ssl=yes -{% endif %} {% if not helpers.empty('OPNsense.DynDNS.general.verbose') %} verbose=yes {% endif %} -# -# setup how we expect to retrieve an IP address -# -{% if not helpers.empty('OPNsense.DynDNS.general.checkip') %} -{% set checkip = OPNsense.DynDNS.general.checkip %} -{% if checkip == 'if' and OPNsense.DynDNS.general.interface|default('') != '' %} -use=if, if={{physical_interface(OPNsense.DynDNS.general.interface)}} -{% elif checkip == 'web_dyndns' %} -use=web, web=http://checkip.dyndns.org/, web-skip="Current IP Address:" -{% elif checkip == 'web_freedns' %} -use=web, web=https://freedns.afraid.org/dynamic/check.php -{% elif checkip == 'web_googledomains' %} -use=web, web=https://domains.google.com/checkip -{% elif checkip == 'web_he' %} -use=web, web=http://checkip.dns.he.net/ -{% elif checkip == 'web_ip4only.me' %} -use=web, web=http://ip4only.me/api/ -{% elif checkip == 'web_ip6only.me' %} -use=web, web=http://ip6only.me/api/ -{% elif checkip == 'web_ipify-ipv4' %} -use=web, web=https://api.ipify.org/ -{% elif checkip == 'web_ipify-ipv6' %} -use=web, web=https://api6.ipify.org/ -{% elif checkip == 'web_loopia' %} -use=web, web=http://dns.loopia.se/checkip/checkip.php, web-skip="Current IP Address:" -{% elif checkip == 'web_myonlineportal' %} -use=web, web=https://myonlineportal.net/checkip -{% elif checkip == 'web_noip-ipv4' %} -use=web, web=http://ip1.dynupdate.no-ip.com/ -{% elif checkip == 'web_noip-ipv6' %} -use=web, web=http://ip1.dynupdate6.no-ip.com/ -{% elif checkip == 'web_nsupdate.info-ipv4' %} -use=web, web=https://ipv4.nsupdate.info/myip -{% elif checkip == 'web_nsupdate.info-ipv6' %} -use=web, web=https://ipv6.nsupdate.info/myip -{% elif checkip == 'web_zoneedit' %} -use=web, web=http://dynamic.zoneedit.com/checkip.html -{% endif %} -{% endif %} {% if helpers.exists('OPNsense.DynDNS.accounts.account') %} {% for account in helpers.toList('OPNsense.DynDNS.accounts.account') %} {% if account.enabled|default('0') == '1' %} -{% if account.use_interface|default('0') == '1' %} +{% if account.checkip == 'if' %} use=if, if={{physical_interface(account.interface)}}, \ +{% elif account.checkip.startswith('web_') %} +{% if account.interface %} +use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -i {{physical_interface(account.interface)}} -t {{account.force_ssl}} -s {{account.checkip[4:]}}", +{% else %} +use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -t {{account.force_ssl}} -s {{account.checkip[4:]}}", +{% endif %} {% endif %} {% if account.service == 'custom' %} protocol={{account.protocol}}, \ @@ -96,6 +60,9 @@ server=update.spdyn.de, \ {% elif account.service == 'strato' %} protocol=dyndns2, \ server=dyndns.strato.com, \ +{% elif account.service == 'ovh' %} +protocol=dyndns2, \ +server=www.ovh.com, \ {% else %} protocol={{account.service}}, \ {% endif %} From ff9a7211aa55d3930d0b1ad6ea2bc9b4574a5a88 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 16 Mar 2022 08:10:38 +0100 Subject: [PATCH 0978/3088] net/freeradius: bump after fix --- net/freeradius/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index ec54c2893c..9758324361 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= freeradius PLUGIN_VERSION= 1.9.19 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com From 9351dec807c72669c216f1cd108d6d67affe67b8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 16 Mar 2022 08:11:52 +0100 Subject: [PATCH 0979/3088] dns/ddclient: complete release notes --- dns/ddclient/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 0fedfce731..ea6c82a0d4 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -9,7 +9,7 @@ Plugin Changelog 1.3 * Add checkip settings per account using selected source interface when provided -* Add OVH DynHost to the DynDNS providers +* Add OVH DynHost to the DynDNS providers (contributed by toxic0berliner) 1.2 From a5fee43df97469293598311ddbc3c0a9fdcb680d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= <34602360+opnsenseuser@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:10:38 +0100 Subject: [PATCH 0980/3088] Themes Cicada/Vicuna - color fix (#2840) * dropdown >> warning >> multiselect color fix --- misc/theme-cicada/Makefile | 4 ++-- .../themes/cicada/assets/stylesheets/main.scss | 15 ++++++++++----- .../opnsense/www/themes/cicada/build/css/main.css | 14 +++++++++----- misc/theme-vicuna/Makefile | 4 ++-- .../themes/vicuna/assets/stylesheets/main.scss | 13 +++++++++---- .../opnsense/www/themes/vicuna/build/css/main.css | 12 ++++++++---- 6 files changed, 40 insertions(+), 22 deletions(-) diff --git a/misc/theme-cicada/Makefile b/misc/theme-cicada/Makefile index f2a49f3d47..28029063c3 100644 --- a/misc/theme-cicada/Makefile +++ b/misc/theme-cicada/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= theme-cicada -PLUGIN_VERSION= 1.28 -PLUGIN_COMMENT= The cicada theme - dark grey +PLUGIN_VERSION= 1.29 +PLUGIN_COMMENT= The cicada theme - dark grey onyx PLUGIN_MAINTAINER= rene@team-rebellion.net PLUGIN_NO_ABI= yes diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss index bd810ace9d..87ccc9c4cb 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss @@ -7189,12 +7189,13 @@ a.label { } .label-info { - background-color: #B0CDDB; + background-color: #292929; + border: 1px solid #191919; &[href] { &:hover, &:focus { - background-color: #8db7cb; - border-color: #323232; + background-color: #292929; + border: 1px solid #191919; } } } @@ -8810,9 +8811,13 @@ button.close { font-size: 14px; font-weight: normal; line-height: 18px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; + background-color: #2a2a2a; + border-bottom: 1px solid #191919; border-radius: 5px 5px 0 0; + + > a:hover { + text-decoration: none; + } } .popover-content { diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css index 41b44822a9..db0add871f 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css @@ -4240,10 +4240,11 @@ a.label:hover, a.label:focus { .label-info { - background-color: #B0CDDB; } + background-color: #292929; + border: 1px solid #191919; } .label-info[href]:hover, .label-info[href]:focus { - background-color: #8db7cb; - border-color: #323232; } + background-color: #292929; + border: 1px solid #191919; } .label-warning { @@ -5243,9 +5244,12 @@ button.close { font-size: 14px; font-weight: normal; line-height: 18px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; + background-color: #2a2a2a; + border-bottom: 1px solid #191919; border-radius: 5px 5px 0 0; } + +.popover-title > a:hover { + text-decoration: none; } .popover-content { padding: 9px 14px; } diff --git a/misc/theme-vicuna/Makefile b/misc/theme-vicuna/Makefile index 58d940a985..65a1f27a3e 100644 --- a/misc/theme-vicuna/Makefile +++ b/misc/theme-vicuna/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= theme-vicuna -PLUGIN_VERSION= 1.4 -PLUGIN_COMMENT= The vicuna theme - dark anthrazit +PLUGIN_VERSION= 1.41 +PLUGIN_COMMENT= The vicuna theme - blue sapphire PLUGIN_MAINTAINER= rene@team-rebellion.net PLUGIN_NO_ABI= yes diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss index 0ef531fdf7..10204d6e8b 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/main.scss @@ -7291,12 +7291,13 @@ a.label { } .label-info { - background-color: #B0CDDB; + background-color: #21303a; + border: 1px solid #191919; &[href] { &:hover, &:focus { background-color: #8db7cb; - border-color: #191919; + border: 1px solid #191919; } } } @@ -8915,9 +8916,13 @@ button.close { font-size: 14px; font-weight: normal; line-height: 18px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; + background-color: #19252d; + border-bottom: 1px solid #181919; border-radius: 5px 5px 0 0; + + > a:hover { + text-decoration: none; + } } .popover-content { diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css index 5fc68c4414..523d5749d9 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/main.css @@ -4217,10 +4217,11 @@ a.label:hover, a.label:focus { .label-info { - background-color: #B0CDDB; } + background-color: #21303a; + border: 1px solid #191919; } .label-info[href]:hover, .label-info[href]:focus { background-color: #8db7cb; - border-color: #191919; } + border: 1px solid #191919; } .label-warning { @@ -5221,10 +5222,13 @@ button.close { font-size: 14px; font-weight: normal; line-height: 18px; - background-color: #f7f7f7; - border-bottom: 1px solid #ebebeb; + background-color: #19252d; + border-bottom: 1px solid #181919; border-radius: 5px 5px 0 0; } +.popover-title > a:hover { + text-decoration: none; } + .popover-content { padding: 9px 14px; } From 09d2b21b09b42a5ab15fd39b1a783f8887f59785 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 18 Mar 2022 13:50:22 +0100 Subject: [PATCH 0981/3088] dns/ddclient - missing ssl=yes phrase, closes https://github.com/opnsense/plugins/issues/2894 --- .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 71d3f19728..08b5eb16e5 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -72,6 +72,9 @@ wildcard=yes, \ {% if account.username %} login={{account.username}}, \ {% endif %} +{% if account.force_ssl|default('0') == '1' %} +ssl=yes, \ +{% endif %} password={{account.password}} \ {{account.hostnames}} From abc8b4a832a298e8dd607628be0cc70fc44078c1 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 18 Mar 2022 15:29:12 +0100 Subject: [PATCH 0982/3088] Revert "dns/ddclient - missing ssl=yes phrase, closes https://github.com/opnsense/plugins/issues/2894" This reverts commit 09d2b21b09b42a5ab15fd39b1a783f8887f59785. --- .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 08b5eb16e5..71d3f19728 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -72,9 +72,6 @@ wildcard=yes, \ {% if account.username %} login={{account.username}}, \ {% endif %} -{% if account.force_ssl|default('0') == '1' %} -ssl=yes, \ -{% endif %} password={{account.password}} \ {{account.hostnames}} From 4fcedf7201800e45d1ab60a24ab2755c9ac3ac68 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 18 Mar 2022 18:13:58 +0100 Subject: [PATCH 0983/3088] dns/ddclient: ssl=yes is only supported on a global level, since we moved the checkbos to account, the enforcement broke. This commit will explain the account vs global settin and adjusts the template to set ssl=yes on a global level. closes https://github.com/opnsense/plugins/issues/2894 --- dns/ddclient/Makefile | 1 + .../OPNsense/DynDNS/forms/dialogAccount.xml | 3 +- .../templates/OPNsense/ddclient/ddclient.conf | 73 +++++++++++-------- 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index d4f5a19148..f058a437ef 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.3 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml index 020d202166..22a8fa8cab 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml @@ -69,7 +69,8 @@ account.force_ssl checkbox - Force update using HTTPS + Force update using HTTPS, please note setting this option will enforce https updates on all accounts + as ddclient only supports SSL=yes on a global level (check check ip service may still use HTTP on other services) account.interface diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 71d3f19728..dfdd9c0e82 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -5,76 +5,87 @@ pid=/var/run/ddclient.pid # record PID in file. {% if not helpers.empty('OPNsense.DynDNS.general.verbose') %} verbose=yes {% endif %} - - +{% set accounts = [] %} +{% set force_ssl = [] %} {% if helpers.exists('OPNsense.DynDNS.accounts.account') %} {% for account in helpers.toList('OPNsense.DynDNS.accounts.account') %} {% if account.enabled|default('0') == '1' %} -{% if account.checkip == 'if' %} +{% do accounts.append(account) %} +{% if account.force_ssl|default('0') == '1' %} +{% do force_ssl.append(1) %} +{% endif %} +{% endif %} +{% endfor %} +{% endif %} +{% if force_ssl %} +ssl=yes +{% endif %} + + +{% for account in accounts %} +{% if account.checkip == 'if' %} use=if, if={{physical_interface(account.interface)}}, \ -{% elif account.checkip.startswith('web_') %} -{% if account.interface %} +{% elif account.checkip.startswith('web_') %} +{% if account.interface %} use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -i {{physical_interface(account.interface)}} -t {{account.force_ssl}} -s {{account.checkip[4:]}}", -{% else %} +{% else %} use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -t {{account.force_ssl}} -s {{account.checkip[4:]}}", -{% endif %} {% endif %} -{% if account.service == 'custom' %} +{% endif %} +{% if account.service == 'custom' %} protocol={{account.protocol}}, \ server={{account.server}}, \ -{% elif account.service == 'cloudflare' %} +{% elif account.service == 'cloudflare' %} protocol=cloudflare, \ zone={{account.zone}}, \ -{% elif account.service == 'dnsmadeeasy' %} +{% elif account.service == 'dnsmadeeasy' %} protocol=dnsmadeeasy, \ -{% elif account.service == 'dns-o-matic' %} +{% elif account.service == 'dns-o-matic' %} protocol=dyndns2, \ server=updates.dnsomatic.com, \ -{% elif account.service == 'freedns' %} +{% elif account.service == 'freedns' %} protocol=freedns, \ server=freedns.afraid.org, \ -{% elif account.service == 'dynu' %} +{% elif account.service == 'dynu' %} protocol=dyndns2, \ server=api.dynu.com, \ -{% elif account.service == 'he-net' %} +{% elif account.service == 'he-net' %} protocol=dyndns2, \ server=dyn.dns.he.net, \ -{% elif account.service == 'he-net-tunnel' %} +{% elif account.service == 'he-net-tunnel' %} protocol=dyndns2, \ server=ipv4.tunnelbroker.net, \ -{% elif account.service == 'inwx' %} +{% elif account.service == 'inwx' %} protocol=dyndns2, \ server=dyndns.inwx.com, \ -{% elif account.service == 'loopia' %} +{% elif account.service == 'loopia' %} protocol=dyndns2, \ server=dyndns.loopia.se, \ -{% elif account.service == 'nsupdatev4' %} +{% elif account.service == 'nsupdatev4' %} protocol=dyndns2, \ server=ipv4.nsupdate.info, \ -{% elif account.service == 'nsupdatev6' %} +{% elif account.service == 'nsupdatev6' %} protocol=dyndns2, \ server=ipv6.nsupdate.info, \ -{% elif account.service == 'spdyn' %} +{% elif account.service == 'spdyn' %} protocol=dyndns2, \ server=update.spdyn.de, \ -{% elif account.service == 'strato' %} +{% elif account.service == 'strato' %} protocol=dyndns2, \ server=dyndns.strato.com, \ -{% elif account.service == 'ovh' %} +{% elif account.service == 'ovh' %} protocol=dyndns2, \ server=www.ovh.com, \ -{% else %} +{% else %} protocol={{account.service}}, \ -{% endif %} -{% if account.wildcard|default('0') == '1' %} +{% endif %} +{% if account.wildcard|default('0') == '1' %} wildcard=yes, \ -{% endif %} -{% if account.username %} +{% endif %} +{% if account.username %} login={{account.username}}, \ -{% endif %} +{% endif %} password={{account.password}} \ {{account.hostnames}} -{% endif %} -{% endfor %} -{% endif %} +{% endfor %} From fb1dedb9ee4b3edad9c02b9c1ed175150f96044d Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 18 Mar 2022 18:36:17 +0100 Subject: [PATCH 0984/3088] dns/ddclient: typo in previous. ref https://github.com/opnsense/plugins/issues/2894#issuecomment-1072638007 --- .../mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml index 22a8fa8cab..bb7e48fd41 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml @@ -70,7 +70,7 @@ checkbox Force update using HTTPS, please note setting this option will enforce https updates on all accounts - as ddclient only supports SSL=yes on a global level (check check ip service may still use HTTP on other services) + as ddclient only supports SSL=yes on a global level (the check ip service may still use HTTP on other services) account.interface From 4345a497d2629ac7b15f9e6ece7c702f7af6aeb5 Mon Sep 17 00:00:00 2001 From: Juergen Kellerer Date: Sat, 19 Mar 2022 14:46:59 +0100 Subject: [PATCH 0985/3088] acme-client: ACMEDNS_UPDATE_URL to ACMEDNS_BASE_URL --- .../AcmeClient/forms/dialogValidation.xml | 6 +-- .../AcmeClient/LeValidation/DnsAcmedns.php | 2 +- .../models/OPNsense/AcmeClient/AcmeClient.xml | 6 ++- .../OPNsense/AcmeClient/Migrations/M3_3_0.php | 52 +++++++++++++++++++ 4 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index c057c209b3..1eef3dfb5e 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1187,10 +1187,10 @@ text - validation.dns_acmedns_updateurl - + validation.dns_acmedns_baseurl + text - Specify the custom ACME DNS Update URL, i.e. https://auth.acme-dns.io/update (optional) + Specify the custom ACME DNS URL, i.e. https://auth.acme-dns.io:443 (optional) diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmedns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmedns.php index 4ccefe4e3e..029b24e8c8 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmedns.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsAcmedns.php @@ -42,6 +42,6 @@ public function prepare() $this->acme_env['ACMEDNS_USERNAME'] = (string)$this->config->dns_acmedns_user; $this->acme_env['ACMEDNS_PASSWORD'] = (string)$this->config->dns_acmedns_password; $this->acme_env['ACMEDNS_SUBDOMAIN'] = (string)$this->config->dns_acmedns_subdomain; - $this->acme_env['ACMEDNS_UPDATE_URL'] = (string)$this->config->dns_acmedns_updateurl; + $this->acme_env['ACMEDNS_BASE_URL'] = (string)$this->config->dns_acmedns_baseurl; } } diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 53b71855d4..a74cfc6b45 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1,6 +1,6 @@ //OPNsense/AcmeClient - 3.2.0 + 3.3.0 A secure ACME Client plugin @@ -978,9 +978,13 @@ N + N + + N + N diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php new file mode 100644 index 0000000000..fc6cf2e41b --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php @@ -0,0 +1,52 @@ +getNodeByReference('validations.validation')->iterateItems() as $validation) { + $updateUrl = trim(strval($validation->dns_acmedns_updateurl ?? '')); + $baseUrl = trim(strval($validation->dns_acmedns_baseurl ?? '')); + + if (!empty($updateUrl) && empty($baseUrl)) { + // Translate "https://auth.acme-dns.io/update" to "https://auth.acme-dns.io" + $baseUrl = preg_replace('/\/update$/', '', $updateUrl); + $validation->dns_acmedns_baseurl = $baseUrl; + $validation->dns_acmedns_updateurl = null; + } + } + } +} From d2798e2000d5c13ba5b70d5ccefe0403ae46ac07 Mon Sep 17 00:00:00 2001 From: "Dr. Uwe Meyer-Gruhl" <17402664+meyergru@users.noreply.github.com> Date: Sun, 20 Mar 2022 11:11:08 +0100 Subject: [PATCH 0986/3088] dns/ddclient - add option to allow IPv6 updates (issue 2895) (#2897) --- dns/ddclient/pkg-descr | 4 ++++ .../mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml | 7 +++++++ .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 6 +++++- .../service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index ea6c82a0d4..f5f875ddd5 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,10 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.4 + +* Add advanced general setting to allow updates via IPv6 + 1.3 * Add checkip settings per account using selected source interface when provided diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml index 9d67554115..c524918d59 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/settings.xml @@ -12,6 +12,13 @@ true Enable verbose logging + + ddclient.general.allowipv6 + + checkbox + true + Allow IPv6 for updates + ddclient.general.daemon_delay diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index eb367952fe..5f7bea18bb 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -1,6 +1,6 @@ //OPNsense/DynDNS - 1.2.0 + 1.4.0 Dynamic DNS client @@ -14,6 +14,10 @@ 0 Y + + 0 + Y + 300 Y diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index dfdd9c0e82..ecf43bc489 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -5,6 +5,9 @@ pid=/var/run/ddclient.pid # record PID in file. {% if not helpers.empty('OPNsense.DynDNS.general.verbose') %} verbose=yes {% endif %} +{% if not helpers.empty('OPNsense.DynDNS.general.allowipv6') %} +ipv6=yes +{% endif %} {% set accounts = [] %} {% set force_ssl = [] %} {% if helpers.exists('OPNsense.DynDNS.accounts.account') %} From 8de7489732cee28a26ccda0dd6f5aafed9bb9242 Mon Sep 17 00:00:00 2001 From: MeganerdNL Date: Wed, 23 Mar 2022 12:59:45 +0100 Subject: [PATCH 0987/3088] security/acme-client: Add support for Transip DNS API (#2871) --- .../AcmeClient/forms/dialogValidation.xml | 16 ++++++ .../AcmeClient/LeValidation/DnsTransip.php | 51 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 3 files changed, 74 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsTransip.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index c057c209b3..50ac7760df 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1060,6 +1060,22 @@ password + + + header + + + + validation.dns_transip_username + + text + Your TransIP username. + + validation.dns_transip_key + + text + Requires the whole key file in a format that is compatible with TransIP. + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsTransip.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsTransip.php new file mode 100644 index 0000000000..5811202e5d --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsTransip.php @@ -0,0 +1,51 @@ +cert_id); + $secret_key_filename = "${configdir}/secret.key"; + $secret_key_data = (string)$this->config->dns_transip_key . "\n"; + file_put_contents($secret_key_filename, $secret_key_data); + + // Add env variables + $this->acme_env['TRANSIP_Username'] = (string)$this->config->dns_transip_username; + $this->acme_env['TRANSIP_Key_File'] = $secret_key_filename; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 53b71855d4..5c17d14200 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -488,6 +488,7 @@ selectel.com / selectel.ru domain API Selfhost API Servercow API v1 + Transip API UnoEuro API Variomedia.de API Vscale API @@ -942,6 +943,12 @@ N + + N + + + N + N From 26da65acf1648f9af69fa39c2ee358914f69816a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 23 Mar 2022 15:14:29 +0100 Subject: [PATCH 0988/3088] dns/ddclient: change version for release and update changelog --- dns/ddclient/Makefile | 3 +-- dns/ddclient/pkg-descr | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index f058a437ef..487f0af551 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.3 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.4 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index f5f875ddd5..9bc3469572 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -9,6 +9,7 @@ Plugin Changelog 1.4 * Add advanced general setting to allow updates via IPv6 +* Enforce SSL on global level with account setting 1.3 From 28d310b18a4f903e5e2fcc6ee110cc7ea9fc5ab5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 23 Mar 2022 15:18:20 +0100 Subject: [PATCH 0989/3088] misc/theme-cicada: whitespace sweep --- .../src/opnsense/www/themes/cicada/build/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css index db0add871f..cb62c354f5 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css @@ -5247,7 +5247,7 @@ button.close { background-color: #2a2a2a; border-bottom: 1px solid #191919; border-radius: 5px 5px 0 0; } - + .popover-title > a:hover { text-decoration: none; } From 06b6af9a8b4800013fcc415afd18784330a6ff1d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 23 Mar 2022 15:19:37 +0100 Subject: [PATCH 0990/3088] security/acme-client: need revision bump on current changes 22.1.4 is going out tomorrow without this but for accounting purposes the devel version should get a revision bump. --- security/acme-client/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 72043e1637..eee4abebd4 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= acme-client PLUGIN_VERSION= 3.8 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From 6faf4b287b17708a661efe33ff0561b9a6c91b6f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 24 Mar 2022 12:31:05 +0100 Subject: [PATCH 0991/3088] plugins: sync --- LICENSE | 3 ++- README.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 750286c49a..eeb835ed94 100644 --- a/LICENSE +++ b/LICENSE @@ -8,7 +8,7 @@ Copyright (c) 2020 D. Domig Copyright (c) 2011 Dan Myers Copyright (c) 2017-2018 David Harrigan Copyright (c) 2021 David Hughes -Copyright (c) 2014-2021 Deciso B.V. +Copyright (c) 2014-2022 Deciso B.V. Copyright (c) 2008 Donovan Schonknecht Copyright (c) 2016-2019 EURO-LOG AG Copyright (c) 2006 Eric Friesen @@ -42,6 +42,7 @@ Copyright (c) 2017-2019 Smart-Soft Copyright (c) 2013 Stanley P. Miller \ stan-qaz Copyright (c) 2020 Starkstromkonsument Copyright (c) 2020 Tobias Boehnert +Copyright (c) 2022 Wouter Deurholt Copyright (c) 2010 Yehuda Katz Copyright (c) 2015 YoungJoo.Kim Copyright (c) 2020 devNan0 diff --git a/README.md b/README.md index 0dabdf1213..095e89d2f5 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,10 @@ emulators/qemu-guest-agent -- QEMU Guest Agent for OPNsense ftp/tftp -- TFTP server mail/postfix -- SMTP mail relay mail/rspamd -- Protect your network from spam -misc/theme-cicada -- The cicada theme - dark grey +misc/theme-cicada -- The cicada theme - dark grey onyx misc/theme-rebellion -- A suitably dark theme misc/theme-tukan -- The tukan theme - blue/white -misc/theme-vicuna -- The vicuna theme - dark anthrazit +misc/theme-vicuna -- The vicuna theme - blue sapphire net/chrony -- Chrony time synchronisation net/firewall -- Firewall API supplemental package net/freeradius -- RADIUS Authentication, Authorization and Accounting Server From 872225a9bcab21d78a6ce08e80cf15c9368ae61d Mon Sep 17 00:00:00 2001 From: FreddleSpl0it <75116288+FreddleSpl0it@users.noreply.github.com> Date: Fri, 25 Mar 2022 08:47:28 +0100 Subject: [PATCH 0992/3088] dns/ddclient add servercow (#2911) --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 5f7bea18bb..944bc435e4 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -55,6 +55,7 @@ Noip nsupdate.info (IPv4) nsupdate.info (IPv6) + Servercow spDYN STRATO Zoneedit diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index ecf43bc489..1d9dbb54d2 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -70,6 +70,9 @@ server=ipv4.nsupdate.info, \ {% elif account.service == 'nsupdatev6' %} protocol=dyndns2, \ server=ipv6.nsupdate.info, \ +{% elif account.service == 'servercow' %} +protocol=dyndns2, \ +server=dyndns.servercow.de, \ {% elif account.service == 'spdyn' %} protocol=dyndns2, \ server=update.spdyn.de, \ From a45a8fb04463b43631011b034fcdbd506f614e26 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 23 Mar 2022 13:14:14 +0100 Subject: [PATCH 0993/3088] security/acme-client: fix copyright, refs #2898 --- .../mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php index fc6cf2e41b..16c2164bb6 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M3_3_0.php @@ -1,7 +1,7 @@ Date: Wed, 23 Mar 2022 13:22:35 +0100 Subject: [PATCH 0994/3088] security/acme-clent: preserve sort order of automations, closes #2833 --- .../controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml | 1 + .../opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml index ead828f216..d8f0bfd3c6 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogCertificate.xml @@ -84,6 +84,7 @@ select_multiple true + true Choose the automations that should be run after certificate creation and renewal. Basically every application requires a quick restart to reload the updated certificate. If you don't configure an automation, the in-memory certificate may expire and cause security warnings and other issues. diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index cf8c7fd096..7d195f02e4 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -270,6 +270,7 @@ Related automation not found + Y Y N From 38e5a610e7f6d4e1057529b3cb3f25b3b3e51bad Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 23 Mar 2022 13:26:34 +0100 Subject: [PATCH 0995/3088] security/acme-client: bump version --- security/acme-client/Makefile | 3 +-- security/acme-client/pkg-descr | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index eee4abebd4..00d852986b 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.8 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 3.9 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index b5025b594c..9305b77522 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,15 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.9 + +Added: +* add support for Transip DNS API ( #2871) +* execution order of automations can be changed (#2833) + +Fixed: +* fix the use of a self hosted ACME-DNS service (#2898) + 3.8 NOTE: Support for the cPanel and Selfhost API is not functional. It requires From ccb2d6cf9bad34bfaafc9e84816a427fc4d3c7d3 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 23 Mar 2022 13:45:12 +0100 Subject: [PATCH 0996/3088] security/acme-client: fix missing closing tag, refs #2871 --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 5b14a4c23b..7ee42f5740 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -303,7 +303,7 @@ password - + header @@ -1069,12 +1069,13 @@ validation.dns_transip_username text - Your TransIP username. + Your TransIP username. + validation.dns_transip_key text - Requires the whole key file in a format that is compatible with TransIP. + Requires the whole key file in a format that is compatible with TransIP. From 4664a4c72f5cefce2b4efdf4b380b40f63a7d1d0 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 29 Mar 2022 09:24:56 +0200 Subject: [PATCH 0997/3088] net/chrony: add fallbackpeer and no cert check (#2774) --- net/chrony/Makefile | 2 +- net/chrony/pkg-descr | 5 +++++ .../controllers/OPNsense/Chrony/forms/general.xml | 12 ++++++++++++ .../mvc/app/models/OPNsense/Chrony/General.xml | 9 ++++++++- .../service/templates/OPNsense/Chrony/chrony.conf | 9 +++++++++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/net/chrony/Makefile b/net/chrony/Makefile index d87cafe8e9..05ef39bac5 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= chrony -PLUGIN_VERSION= 1.4 +PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= Chrony time synchronisation PLUGIN_DEPENDS= chrony PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/chrony/pkg-descr b/net/chrony/pkg-descr index eb87118f74..f38222784a 100644 --- a/net/chrony/pkg-descr +++ b/net/chrony/pkg-descr @@ -4,6 +4,11 @@ better in virtual environments. Plugin Changelog ---------------- +1.5 + +* Allow adding a fallback NTP when using NTS +* Add option for nocerttimecheck if system starts with wrong time and only NTS allowed + 1.4 * Adjust timeouts and retries for chronyc diff --git a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml index 691a2b3b91..3b6b358ffb 100644 --- a/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml +++ b/net/chrony/src/opnsense/mvc/app/controllers/OPNsense/Chrony/forms/general.xml @@ -17,6 +17,12 @@ checkbox Enable NTS in client mode. This will add another layer of security for peers when OPNsense is the client. Every server in Peers has to support NTS. + + general.ntsnocert + + checkbox + If you run NTS mode you can enable this option in order to ignore wrong time in certificates for the first check. This helps if your system starts with wrong time. + general.peers @@ -25,6 +31,12 @@ true Set as many NTP peers you need. + + general.fallbackpeers + + text + Set fallback peer if you use NTS and your system starts with wrong time. Best to only use this for internal trusted peers. + general.allowednetworks diff --git a/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml index 969b9fc178..c74a00cc4c 100644 --- a/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml +++ b/net/chrony/src/opnsense/mvc/app/models/OPNsense/Chrony/General.xml @@ -1,7 +1,7 @@ //OPNsense/chrony/general Chrony configuration - 0.0.1 + 0.0.2 0 @@ -15,12 +15,19 @@ 0 Y + + 0 + Y + 0.opnsense.pool.ntp.org Y , Y + + N + N , diff --git a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf index 6910ea4a46..91cc28792c 100644 --- a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf +++ b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf @@ -11,6 +11,10 @@ ntstrustedcerts /etc/ssl/cert.pem nosystemcert {% endif %} +{% if helpers.exists('OPNsense.chrony.general.ntsnocert') and OPNsense.chrony.general.ntsnocert == '1' %} +nocerttimecheck 1 +{% endif %} + {% if not helpers.empty('OPNsense.chrony.general.peers') %} {% for peer in OPNsense.chrony.general.peers.split(',') %} server {{ peer }} iburst {% if helpers.exists('OPNsense.chrony.general.ntsclient') and OPNsense.chrony.general.ntsclient == '1' %}nts{% endif %} @@ -18,6 +22,11 @@ server {{ peer }} iburst {% if helpers.exists('OPNsense.chrony.general.ntsclient {% endfor %} {% endif %} +{% if helpers.exists('OPNsense.chrony.general.fallbackpeers') and OPNsense.chrony.general.fallbackpeers != '' %} +authselectmode mix +server {{ OPNsense.chrony.general.fallbackpeers }} +{% endif %} + {% if not helpers.empty('OPNsense.chrony.general.allowednetworks') %} {% for network in OPNsense.chrony.general.allowednetworks.split(',') %} allow {{ network }} From 3dda341ba60f2793e3b038a624acf1e7efcb05d6 Mon Sep 17 00:00:00 2001 From: Juergen Kellerer Date: Sun, 20 Mar 2022 00:09:58 +0100 Subject: [PATCH 0998/3088] acme-client: New Action "Remote SSH" Also fixed PHP warnings (errors in 8.1) --- .../AcmeClient/Api/ActionsController.php | 26 ++ .../AcmeClient/forms/dialogAction.xml | 43 +++ .../LeAutomation/ConfigdRemoteSsh.php | 45 +++ .../library/OPNsense/AcmeClient/Process.php | 56 ++- .../library/OPNsense/AcmeClient/SSHKeys.php | 6 +- .../OPNsense/AcmeClient/SftpClient.php | 2 +- .../OPNsense/AcmeClient/SftpUploader.php | 14 +- .../app/library/OPNsense/AcmeClient/Utils.php | 170 +++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 38 ++ .../views/OPNsense/AcmeClient/actions.volt | 31 +- .../OPNsense/AcmeClient/run_remote_ssh.php | 355 ++++++++++++++++++ .../OPNsense/AcmeClient/upload_sftp.php | 155 ++------ .../conf/actions.d/actions_acmeclient.conf | 18 + 13 files changed, 791 insertions(+), 168 deletions(-) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/ConfigdRemoteSsh.php create mode 100755 security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php index 2634c404d5..441eb6fb01 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php @@ -101,6 +101,32 @@ public function sftpTestConnectionAction() return ["status" => "unavailable"]; } + public function sshGetIdentityAction() + { + $result = ["status" => "unavailable"]; + + if ($response = $this->callBackend(["show-remote-ssh-identity"], ["remote_ssh_identity_type", "remote_ssh_host"])) { + $result["status"] = "ok"; + $result["identity"] = $response; + } + + return $result; + } + + public function sshTestConnectionAction() + { + if ( + $response = $this->callBackend( + ["test-remote-ssh-connection"], + ["remote_ssh_host", "remote_ssh_host_key", "remote_ssh_port", "remote_ssh_user", "remote_ssh_identity_type"] + ) + ) { + return $response; + } + + return ["status" => "unavailable"]; + } + private function callBackend(array $command, array $arguments = []) { if ($this->request->isPost()) { diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml index b46f455196..d3ecd46644 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml @@ -142,6 +142,49 @@ Leave blank to use default "{{name}}/fullchain.pem". true + + + header + + + + action.remote_ssh_host + + text + IP address or hostname of the SSH server. + + + action.remote_ssh_port + + text + SSH server port. Leave blank to use default "22". + true + + + action.remote_ssh_key + + text + SSH server host key, formatted as in 'known_hosts'. + Leave blank to auto accept host key on first connect (not as secure as specifying it). + + + action.remote_ssh_user + + text + The username to login to the SSH server. + + + action.remote_ssh_identity_type + + dropdown + The type of identify to present to the SSH server for authorization. Select 'none' to use default "ECDSA". + + + action.remote_ssh_command + + text + The command to execute on the SSH server. + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/ConfigdRemoteSsh.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/ConfigdRemoteSsh.php new file mode 100644 index 0000000000..e924e2cc28 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/ConfigdRemoteSsh.php @@ -0,0 +1,45 @@ +config->id; + $this->command = $command; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/Process.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/Process.php index 24c9667078..59ed4808ff 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/Process.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/Process.php @@ -115,21 +115,49 @@ public function __destruct() } } - public function get($timeout = 5, $max_length = 8192, $ending = PHP_EOL) + private $linesBuffer = []; + + private function nextBufferedLine() { - $readables = array_filter($this->outputs, function ($stream) { - return is_resource($stream) && !feof($stream); - }); - - $micros = intval(($timeout - floor($timeout)) * 1000000); - $can_read = !empty($readables) && stream_select($readables, $w = [], $e = [], $timeout, $micros); - $stream = array_reduce(($can_read ? $readables : []), function ($a, $b) { - return is_resource($a) && !feof($a) ? $a : $b; - }, null); - - return is_resource($stream) - ? stream_get_line($stream, $max_length, $ending) - : false; + return empty($this->linesBuffer) + ? false + : array_shift($this->linesBuffer); + } + + /** + * Returns one line from stdout or stdin as it gets available. May return 'false' when no line became available + * within the specified $timeout or when another stream events occurred that returned no new content. + * @param $timeout float timeout in seconds + * @param $max_length int max length of a single line + * @return false|string One line of stdout/err (merged) or false when no new line exists. + */ + public function get($timeout = 5, $max_length = 64 * 1024) + { + if (($line = $this->nextBufferedLine()) !== false) { + return $line; + } + + $readables = array_filter($this->outputs, fn($stream) => is_resource($stream) && !feof($stream)); + $micros = intval(($timeout - floor($timeout)) * 1000000) + 100; + $timeout = floor($timeout); + $__ = null; + + $can_read = !empty($readables) + && stream_select($readables, $__, $__, $timeout, $micros) !== false; + + if ($can_read) { + foreach ($readables as $stream) { + $content = fread($stream, $max_length); + if ($content !== false) { + array_push($this->linesBuffer, ...preg_split('/\r\n|\n|\r/', $content)); + if (empty($this->linesBuffer[-1])) { + array_pop($this->linesBuffer); // remove trailing empty newline + } + } + } + } + + return $this->nextBufferedLine(); } public function put($data, $append = PHP_EOL) diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SSHKeys.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SSHKeys.php index 39c905bdda..3d91cef69d 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SSHKeys.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SSHKeys.php @@ -122,7 +122,7 @@ public function trustHost(string $host, $host_key = "", $port = self::DEFAULT_PO // Check our current known_host file - $addKeyInfo = function (array &$key_list) { + $addKeyInfo = function (array $key_list) { foreach ($key_list as &$item) { $item["key_info"] = self::getHostKeyInfo($item["host_key"]); } @@ -182,7 +182,7 @@ public function trustHost(string $host, $host_key = "", $port = self::DEFAULT_PO if ( empty($remote_host_keys) && $query_error - && $query_error["connection_refused"] + && ($query_error["connection_refused"] ?? false) && !$host_key && self::ALTERNATE_DEFAULT_KEY_TYPE != self::DEFAULT_KEY_TYPE ) { @@ -451,7 +451,7 @@ public function getIdentity(string $identity_type = self::DEFAULT_IDENTITY_TYPE, { Utils::requireThat(in_array($identity_type, self::IDENTITY_TYPES), "Identity type '$identity_type' unknown."); - list($key_type, $key_size) = explode('_', $identity_type, 2); + list($key_type, $key_size) = explode('_', "{$identity_type}_", 2); if (!$key_size && self::DEFAULT_IDENTITY_KEY_BITS[$key_type] > 0) { $key_size = self::DEFAULT_IDENTITY_KEY_BITS[$key_type]; } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SftpClient.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SftpClient.php index f9d2a00021..064b134033 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SftpClient.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SftpClient.php @@ -173,7 +173,7 @@ public function close() $this->process = null; - if ($this->failed_status && $this->failed_status["connection_closed"]) { + if ($this->failed_status && ($this->failed_status["connection_closed"] ?? false)) { $this->clearError(); } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SftpUploader.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SftpUploader.php index bf6a466e32..3534958802 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SftpUploader.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/SftpUploader.php @@ -236,9 +236,9 @@ public function upload(): int // Preparing upload $username = $connection["user"]; $remote_filename = basename((empty($file["target"]) ? $local_file : $file["target"])); - $remote_file = $remote_files[$remote_filename] ?: ["type" => "-", "owner" => $username]; + $remote_file = $remote_files[$remote_filename] ?? ["type" => "-", "owner" => $username]; $remote_is_file = $remote_file["type"] === "-"; - $remote_is_readonly = preg_match('/^[^wW]+$/', $remote_file["permissions"] ?: ""); + $remote_is_readonly = preg_match('/^[^wW]+$/', $remote_file["permissions"] ?? ""); // Check if a folder/socket/symlink, etc is in the way if (!$remote_is_file) { @@ -246,10 +246,10 @@ public function upload(): int return self::UPLOAD_ERROR_NO_OVERWRITE; } - $chgrp = $file["group"] ?: ""; + $chgrp = $file["group"] ?? ""; $chgrp = preg_match('/^\d+$/', $chgrp) ? (string)$chgrp : false; - $chmod = $file["mode"] ?: ""; + $chmod = $file["mode"] ?? ""; $chmod = preg_match('/^0\d{3}$/', $chmod) ? (string)$chmod : false; @@ -347,7 +347,7 @@ private function isFileOwnedByConnection(array $remote_file, array $connection): Utils::log()->error("Failed uploading test file to detect ownership. Next uploads may fail as well.", $error); } else { // Get owner of the test file - $file_info = $this->sftp->ls()[$remote_test_file] ?: ["owner" => -1]; + $file_info = $this->sftp->ls()[$remote_test_file] ?? ["owner" => -1]; // Cleanup $this->sftp->rm($remote_test_file); $this->sftp->clearError(); @@ -370,7 +370,7 @@ private function deleteSourceIfRequested($file) if ( isset($this->pending_files[$file]) && is_array($existing = $this->pending_files[$file]) - && $existing["delete_source"] === true + && ($existing["delete_source"] ?? false) === true ) { unlink($existing["source"]); } @@ -408,7 +408,7 @@ private function temporaryFile($delete_all = false) } $index = $this->temporary_files_index; - if ($index <= 0 || !is_array($shared_temporary_files[$index])) { + if ($index <= 0 || !is_array($shared_temporary_files[$index] ?? null)) { $index = $this->temporary_files_index = ++$shared_temporary_files_index_sequence; $shared_temporary_files[$index] = []; } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/Utils.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/Utils.php index f16d4082f1..b5842d58f2 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/Utils.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/Utils.php @@ -142,4 +142,174 @@ public static function resolvePath(string $file, string $base = ".") return DIRECTORY_SEPARATOR . join(DIRECTORY_SEPARATOR, $path); } + + /** + * @return string the path where acme.sh config is stored or null if not available. + */ + public static function configPath(): string + { + static $paths = [ + '/var/etc/acme-client', + __DIR__ + ]; + foreach ($paths as $path) { + if (is_dir($path)) { + return $path; + } + } + return self::requireThat(false, "No config path"); + } + + /** + * @param string $automation_id the automation numeric id or UUID. + * @return mixed|null the automation action when found. + */ + public static function getAutomationActionById($automation_id) + { + $config = \OPNsense\Core\Config::getInstance()->object(); + $client = $config->OPNsense->AcmeClient; + + foreach ($client->actions->children() as $action) { + if ( + $automation_id === (string)$action->attributes()["uuid"] + || $automation_id === (string)$action->id + ) { + return $action; + } + } + + return null; + } + + /** + * Print CLI help. + * @see Utils::runCLIMain + * @param string $about about text + * @param string $examples examples text + * @param array $commands the commands + * @return void + */ + public static function printCLIHelp($about, $examples, $commands = []) + { + static $options = [ + "-h, --help Print commandline help", + "--log Enable log to stdout (instead of syslog)", + "--automation-id Read options from the action specified by id or uuid", + "--no-error Always exit with 0 (original exit codes are still logged)", + ]; + + echo $about . PHP_EOL + . "Usage: " . basename($GLOBALS["argv"][0]) . " [options] [--command=]COMMAND" . PHP_EOL + . PHP_EOL . join(PHP_EOL, $options) . PHP_EOL; + + foreach ($commands as $name => $cmd) { + echo PHP_EOL . "COMMAND \"$name\" {$cmd["description"]}" . PHP_EOL . "Options:" . PHP_EOL; + foreach ($cmd["options"] as $option) { + $option = preg_replace(['/^([^:]+)$/', '/(.+)::$/', '/(.+):$/'], ['[$1]', '[$1=value]', '$1=value'], "--$option"); + echo " $option" . PHP_EOL; + } + } + + echo PHP_EOL . "Examples:" . PHP_EOL + . preg_replace('/\r\n|\n|\r/', PHP_EOL, $examples) + . PHP_EOL . PHP_EOL; + } + + /** + * Helper that implements `main();` for a CLI application following the command design. + * + * `$commands` follows the format: + * ```php + * [ + * "command-name" => [ + * "description" => "...", + * "options" => ["arg1::", "arg2::", "arg3::"], + * "implementation" => "commandImplementationFunction", + * "default" => true | false, + * ], + * ] + * ``` + * + * @param callable $help method that display's CLI help. + * @param callable $optionsByActionId method that returns CLI args (assoc array) from an automation action id. + * @param array $commands the list of commands that the CLI application can execute. + * @param int $exit_success exit code for success + * @param int $exit_unknown_command exit code for no matching command + * @return void + */ + public static function runCLIMain(callable $help, callable $optionsByActionId, $commands = [], $exit_success = 0, $exit_unknown_command = 255) + { + global $argv; + $command = self::getSelectedCLICommand($commands); + $options = ["help", "log", "no-error"]; + + $has_automation_id = preg_match('/--automation-id=\S+/', join(" ", $argv)); + if ($has_automation_id) { + $options = array_merge($options, ["automation-id:", "certificates::"]); + } else { + $options = array_merge($options, $command["options"]); + } + + $index = 0; + if ($options = getopt("h", $options, $index)) { + if (isset($options["h"]) || isset($options["help"])) { + $help(); + } else { + if (isset($options["log"])) { + self::log(true)->info("Logging to stdout enabled"); + } + + $options = array_filter($options, function ($value) { + return !is_string($value) + || (!empty($value = trim($value)) && $value !== "__default_value"); + }); + + if (isset($options["automation-id"])) { + if (is_array($config = $optionsByActionId($options["automation-id"]))) { + $options = array_merge($config, $options); + } else { + self::log()->error("No usable config found for automation-id {$options["automation-id"]}"); + exit(1); + } + } + + if (is_callable($runner = $command["implementation"])) { + $code = $runner($options); + + if ($code != $exit_success) { + self::log()->error("Command execution failed, exit code $code. Last input was: " . json_encode($options, JSON_UNESCAPED_SLASHES)); + } + + exit(isset($options["no-error"]) ? $exit_success : $code); + } else { + exit($exit_unknown_command); + } + } + } else { + if (count($argv) < 2) { + $help(); + } else { + $cmd = join(" ", $argv); + self::log()->error("Parsing of '$cmd' failed at argument '{$argv[$index]}'"); + } + exit(1); + } + } + + private static function getSelectedCLICommand($commands = []) + { + $default = null; + $command = null; + $parsed_args = getopt("", ["command::"]); + foreach ($commands as $name => $cmd) { + if (in_array($name, $GLOBALS["argv"]) || ($parsed_args["command"] ?? "") === $name) { + $command = $cmd; + } + if (($cmd["default"] ?? false) === true) { + $default = $cmd; + } + } + + return $command ?? $default; + } } diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 7d195f02e4..8a9c50de41 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1113,6 +1113,7 @@ Restart Nginx (OPNsense plugin) Upload certificate to Highwinds CDN Upload certificate via SFTP + Remote Command via SSH Upload certificate to FRITZ!Box router Upload certificate to Synology DSM Update local Unifi keystore @@ -1205,6 +1206,43 @@ Should be a string between 1 and 255 characters. Characters are limited to [a-z], [0-9] and [{}@./-_%] and the string must neither begin nor end with '/'. + + N + /^.{1,255}$/u + Should be a string between 1 and 255 characters. + + + N + + /^.+?\s(?:[a-z0-9+\/]{4})*(?:[a-z0-9+\/]{2}==|[a-z0-9+\/]{3}=)?(?:\s.+?)?$/i + Should be a valid public SSH host key (see "known_hosts"). + + + N + 1 + 49151 + 22 + Should be a valid port number between 1 and 49151. + + + N + /^.{1,128}$/u + Should be a string between 1 and 128 characters. + + + N + + ECDSA + RSA + ed25519 + + + + N + /^.{1,1024}$/u + Should be a shell command between 1 and 1024 characters. + diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt index 7f258eafeb..9474a0613b 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt @@ -92,17 +92,21 @@ POSSIBILITY OF SUCH DAMAGE. .hide(); } - // SFTP - Identity show button - (function ($identityType) { + // SFTP/SSH - Identity show button + [ + {selector: '#action\\.sftp_identity_type', group: "configd_upload_sftp", action: "sftpGetIdentity"}, + {selector: '#action\\.remote_ssh_identity_type', group: "configd_remote_ssh", action: "sshGetIdentity"}, + ].forEach(function(config) { + var $identityType = $(config.selector); var identityDiv = makeStatusDiv($identityType); - makeButton("{{ lang._('Show Identity') }}", "configd_upload_sftp", "btn-info") + makeButton("{{ lang._('Show Identity') }}", config.group, "btn-info") .click(function () { identityDiv.hide(); var button = $(this); button.prop('disabled', true).find(".fa-spinner").show(); - ajaxCall("/api/acmeclient/actions/sftpGetIdentity", getFormData("DialogAction").action, function (data, status) { + ajaxCall("/api/acmeclient/actions/" + config.action, getFormData("DialogAction").action, function (data, status) { button.prop('disabled', false).find(".fa-spinner").hide(); if (status === "success" && data.status === "ok") { @@ -117,10 +121,15 @@ POSSIBILITY OF SUCH DAMAGE. $identityType.change(function() { identityDiv.hide(); }); - })($('#action\\.sftp_identity_type')); + }); + + // SFTP/SSH - Connection test button + [ + {selector: '#action\\.sftp_user', group: "configd_upload_sftp", action: "sftpTestConnection", success: "{{ lang._('Connection and upload test succeeded.') }}"}, + {selector: '#action\\.remote_ssh_user', group: "configd_remote_ssh", action: "sshTestConnection", success: "{{ lang._('Connection test succeeded.') }}"}, + ].forEach(function(config) { + var $user = $(config.selector); - // SFTP - Connection test button - (function ($user) { var statusDiv = makeStatusDiv($user, 'alert-success').html( '
    ' + '
    ' @@ -145,13 +154,13 @@ POSSIBILITY OF SUCH DAMAGE. {msg: "{{ lang._('Test failed, see details.') }}"}, ]; - makeButton("{{ lang._('Test Connection') }}", "configd_upload_sftp") + makeButton("{{ lang._('Test Connection') }}", config.group) .click(function () { statusDiv.hide(); var button = $(this); button.prop('disabled', true).find(".fa-spinner").show(); - ajaxCall("/api/acmeclient/actions/sftpTestConnection", getFormData("DialogAction").action, function (data, status) { + ajaxCall("/api/acmeclient/actions/" + config.action, getFormData("DialogAction").action, function (data, status) { button.prop('disabled', false).find(".fa-spinner").hide(); var message = "", @@ -161,7 +170,7 @@ POSSIBILITY OF SUCH DAMAGE. if (status === "success") { if (data.success === true) { statusClass = "alert-success"; - message = "{{ lang._('Connection and upload test succeeded.') }}" + message = config.success } else { detail = JSON.stringify(data, null, ' ').replace(/\\"/g, "'"); @@ -188,7 +197,7 @@ POSSIBILITY OF SUCH DAMAGE. statusDiv.removeClass("alert-success alert-warning").addClass(statusClass).show(); }); }); - })($('#action\\.sftp_user')); + }); // Eagerly hiding method tables to avoid contents popping up when opening the dialog for the first time. $(".method_table").hide(); diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php new file mode 100755 index 0000000000..3f045347bd --- /dev/null +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php @@ -0,0 +1,355 @@ +#!/usr/local/bin/php + [ + "description" => "runs the a command on the specified target host", + "options" => [ + "host::", "port::", "host-key::", "user::", "identity-type::", "run::"], + "implementation" => "commandRunRemote", + "default" => true, + ], + + "test-connection" => [ + "description" => "connects to the host and returns results as JSON", + "options" => ["host:", "port::", "host-key::", "user:", "identity-type::"], + "implementation" => "commandTestConnection", + ], + + "show-identity" => [ + "description" => "prints the ssh client identity (publickey)", + "options" => ["identity-type::", "source-ip::", "host::", "unrestricted"], + "implementation" => "commandShowIdentity", + ], +]; + +const EXAMPLES = <<getIdentity($identity_type)) && is_readable($id_file)) { + if ( + !isset($options["unrestricted"]) + && ($restrictions = SSHKeys::getIdentityRestrictions($host, $source_ip, "")) + ) { + echo "$restrictions "; + } + + echo file_get_contents($id_file); + return EXITCODE_SUCCESS; + } else { + Utils::log()->error("Failed getting identity. See log output for details."); + } + return EXITCODE_ERROR; +} + +function commandTestConnection(array &$options): int +{ + $result = ["actions" => ["connecting"], "success" => false]; + + $options["run"] = CONNECTION_TEST_COMMAND; + $lines = runRemoteCommand($options, $error); + + if (!$error) { + $result["actions"][] = "connected"; + if (($result["success"] = in_array(CONNECTION_TEST_RESULT, $lines))) { + $result["actions"][] = "echo-tested"; + } + } else { + $result = array_merge($result, ($error ?: [])); + } + + echo json_encode($result, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL; + + return $result["success"] ? EXITCODE_SUCCESS : EXITCODE_ERROR; +} + +function commandRunRemote(array &$options): int +{ + if (empty($options["run"])) { + Utils::log()->error("SSH: Command is empty, nothing to do."); + return EXITCODE_ERROR; + } + + $lines = runRemoteCommand($options, $error); + if (!$error) { + $host = $options["host"] . (($port = ($options["port"] ?? false)) ? ":$port" : ""); + Utils::log()->info("SSH [$host]> {$options["run"]}:" . PHP_EOL . join(PHP_EOL, $lines)); + return EXITCODE_SUCCESS; + } + + return EXITCODE_ERROR; +} + +function runRemoteCommand(array $options, &$error): ?array +{ + static $expected_errors = [ + ["host_not_resolved", /* -> */ '/.*not resolve.*/i'], + ["host_not_trusted", /* -> */ '/.*IDENTIFICATION HAS CHANGED.*/i'], + ["connection_refused", /* -> */ '/.*connection refused.*/i'], + ["connection_closed", /* -> */ '/.*connection closed.*/i'], + ["network_timeout", /* -> */ '/.*timed out.*/i'], + ["network_unreachable", /* -> */ '/.*network.+unreachable.*/i'], + ["permission_denied", /* -> */ '/.*permission denied.*/i'], + ["failure", /* -> */ '/.*(error|failure|you must supply).*/i'], + ]; + + $ssh_keys = new SSHKeys(configPath()); + + $identity_type = trim(($options["identity-type"] ?? "")); + $host = trim(($options["host"] ?? "")); + $host_key = ($options["host-key"] ?? ""); + $port = $options["port"] ?? 22; + $username = $options["user"] ?? false; + $command = $options["run"] ?? ""; + + list($ok, $cmd) = buildSSHArguments($ssh_keys, $host, $username, $identity_type, $host_key, $port); + if ($ok) { + if (empty($command)) { + $error = ["no_command" => true]; + } else { + $cmd[] = $command; + } + } else { + $error = $cmd; + $error["connect_failed"] = true; + return null; + } + + $result = []; + $exit_code = null; + $expected_error = null; + + if ($process = Process::open($cmd)) { + $process->closeInput(); + + $lines = 0; + $start = time(); + $mustClose = fn($lines) => (time() - $start) > CONNECTION_EXECUTE_TIMEOUT || $lines > 10000; + + while ($process->isRunning() && !$mustClose($lines)) { + for (; ($line = $process->get()) !== false && !$mustClose($lines); $lines++) { + if (!$expected_error) { + foreach ($expected_errors as $ee) { + if (preg_match($ee[1], $line)) { + if ($ee[0] !== "connection_closed") { + $expected_error = [$ee[0] => true, "error" => trim($line)]; + } + break; + } + } + } + $result[] = $line; + } + } + $exit_code = $process->close(); + $ok = $exit_code === 0; + } else { + $ok = false; + } + + if (!$ok) { + $cl = join(" ", array_map(fn($v) => escapeshellarg($v), $cmd)); + $error = array_merge(($expected_error ?? []), [ + "result" => $result, + "exit_code" => $exit_code + ]); + $error["connect_failed"] = $exit_code == 255; + Utils::log()->error("SSH failed with '$exit_code': $cl", $error); + } + + return $result; +} + +function buildSSHArguments(SSHKeys $ssh_keys, $host, $username, $identity_type = "", $host_key = "", $port = SSHKeys::DEFAULT_PORT): array +{ + if (empty(trim($host)) || empty(trim($username))) { + Utils::log()->error("Failed connecting to '$host'. Hostname or username is missing."); + return [false, ["invalid_parameters" => true]]; + } + + if (empty($identity_type)) { + $identity_type = SSHKeys::DEFAULT_IDENTITY_TYPE; + } + + $trust = $ssh_keys->trustHost($host, $host_key, $port); + if ($trust["ok"] !== true) { + Utils::log()->error("Failed establishing trust in '$host'; Cause: {$trust["error"]}"); + unset($trust["ok"]); + return [false, array_merge($trust, ["host_not_trusted" => true])]; + } else { + $host = $trust["host"]; + } + + // Building ssh command. + $cmd = [ + "ssh", + "-p", $port, + "-oUser=$username", + "-oUserKnownHostsFile={$ssh_keys->knownHostsFile()}", + ]; + + // Handle client side identity + $identity = $ssh_keys->getIdentity($identity_type, true); + if (is_file($identity) && is_readable($identity)) { + array_push( + $cmd, + "-i", + $identity, + "-oPreferredAuthentications=publickey" + ); + } else { + Utils::log()->error("Failed adding client identity ($identity). Connect will likely fail."); + } + + // Adding the host + $cmd[] = "$host"; + + return [true, $cmd]; +} + +function help() +{ + Utils::printCLIHelp(ABOUT, EXAMPLES, COMMANDS); +} + +function getOptionsById($automation_id) +{ + Utils::log()->info("Reading options from automation: $automation_id"); + + if (is_object($action = Utils::getAutomationActionById($automation_id))) { + if ($action->enabled && "configd_remote_ssh" === (string)$action->type) { + return [ + "host" => trim((string)$action->remote_ssh_host), + "host-key" => trim((string)$action->remote_ssh_host_key), + "port" => trim((string)$action->remote_ssh_port), + "identity-type" => trim((string)$action->remote_ssh_identity_type), + "user" => trim((string)$action->remote_ssh_user), + "run" => trim((string)$action->remote_ssh_command), + ]; + } else { + Utils::log()->error("Ignoring disabled or invalid automation '$automation_id'"); + } + } else { + Utils::log()->error("No upload automation found with uuid = '$automation_id'"); + } + + return false; +} + +function configPath(): string +{ + if (($path = Utils::configPath())) { + return $path . DIRECTORY_SEPARATOR . "sftp-config"; // shared with sftp to have the same identities + } + die("Failed detecting config path"); +} + +function requireThat($expression, $message) +{ + try { + Utils::requireThat($message, $message); + } catch (\AssertionError $e) { + exit(EXITCODE_ERROR); + } + return $expression; +} + +// Running the main script +Utils::runCLIMain( + "help", + "getOptionsById", + COMMANDS, + EXITCODE_SUCCESS, + EXITCODE_ERROR_UNKNOWN_COMMAND +); diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php index c3cbd385ef..5a11b3d60b 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php @@ -86,13 +86,6 @@ ], ]; -const STATIC_OPTIONS = <<getIdentity($identity_type)) && is_readable($id_file)) { @@ -190,7 +183,7 @@ function commandTestConnection(array &$options): int $uploader = new SftpUploader($sftp); - $chgrp = $options["chgrp"] ?: false; + $chgrp = ($options["chgrp"] ?? "") ?: false; $chmod = isset($options["chmod"]) ? ($options["chmod"] ?: DEFAULT_CERT_MODE) : false; $filename = $uploader->addContent("upload-test", "", 0, $chmod, $chgrp); @@ -275,7 +268,7 @@ function uploadCertificatesToHost(array $options): int $sftp = connectWithServer($options, $error); if ($sftp === null) { Utils::log()->error("Aborting after connect failure."); - return $error["connect_failed"] + return ($error["connect_failed"] ?? false) ? EXITCODE_ERROR : EXITCODE_ERROR_NO_PERMISSION; } @@ -321,10 +314,10 @@ function uploadCertificatesToHost(array $options): int function connectWithServer(array $options, &$error): ?SftpClient { - $identity_type = trim(($options["identity-type"] ?: SSHKeys::DEFAULT_IDENTITY_TYPE)); - $host = trim(($options["host"] ?: "")); - $host_key = ($options["host-key"] ?: ""); - $port = $options["port"] ?: 22; + $identity_type = trim(($options["identity-type"] ?? "")) ?: SSHKeys::DEFAULT_IDENTITY_TYPE; + $host = trim(($options["host"] ?? "")); + $host_key = ($options["host-key"] ?? ""); + $port = $options["port"] ?? 22; $username = $options["user"]; $sftp = new SftpClient(configPath(), $identity_type); @@ -336,7 +329,7 @@ function connectWithServer(array $options, &$error): ?SftpClient } // Apply start path (if one was specified, defaults to home dir) - if (($remote_path = $options["remote-path"])) { + if (!empty($remote_path = ($options["remote-path"] ?? ""))) { if ($err = $sftp->cd($remote_path)->lastError()) { $error = $err; $error["change_home_dir_failed"] = true; @@ -350,55 +343,7 @@ function connectWithServer(array $options, &$error): ?SftpClient function help() { - echo ABOUT . PHP_EOL - . "Usage: " . basename($GLOBALS["argv"][0]) . " [options] [--command=]COMMAND" . PHP_EOL - . PHP_EOL . STATIC_OPTIONS . PHP_EOL; - - foreach (COMMANDS as $name => $cmd) { - echo PHP_EOL . "COMMAND \"$name\" {$cmd["description"]}" . PHP_EOL . "Options:" . PHP_EOL; - foreach ($cmd["options"] as $option) { - $option = preg_replace(['/^([^:]+)$/', '/(.+)::$/', '/(.+):$/'], ['[$1]', '[$1=value]', '$1=value'], "--$option"); - echo " $option" . PHP_EOL; - } - } - - echo PHP_EOL . "Examples:" . PHP_EOL - . str_replace('/\r\n|\n|\r/g', PHP_EOL, EXAMPLES) - . PHP_EOL . PHP_EOL; -} - -function getCommand() -{ - $default = null; - $command = null; - $parsed_args = getopt("", ["command::"]); - foreach (COMMANDS as $name => $cmd) { - if (in_array($name, $GLOBALS["argv"]) || $parsed_args["command"] === $name) { - $command = $cmd; - } - if ($cmd["default"] === true) { - $default = $cmd; - } - } - - return $command ?: $default; -} - -function getActionById($automation_id) -{ - $config = OPNsense\Core\Config::getInstance()->object(); - $client = $config->OPNsense->AcmeClient; - - foreach ($client->actions->children() as $action) { - if ( - $automation_id === (string)$action->attributes()["uuid"] - || $automation_id === (string)$action->id - ) { - return $action; - } - } - - return null; + Utils::printCLIHelp(ABOUT, EXAMPLES, COMMANDS); } function getOptionsById($automation_id, $silent = false) @@ -407,7 +352,7 @@ function getOptionsById($automation_id, $silent = false) Utils::log()->info("Reading options from automation: $automation_id"); } - if (is_object($action = getActionById($automation_id))) { + if (is_object($action = Utils::getAutomationActionById($automation_id))) { if ($action->enabled && "configd_upload_sftp" === (string)$action->type) { return [ "host" => trim((string)$action->sftp_host), @@ -439,7 +384,7 @@ function addFilesToUpload(array $options, SftpUploader &$uploader) { $chmod = isset($options["chmod"]) ? ($options["chmod"] ?: DEFAULT_CERT_MODE) : false; $chmod_key = isset($options["chmod-key"]) ? ($options["chmod-key"] ?: DEFAULT_KEY_MODE) : false; - $chgrp = $options["chgrp"] ?: false; + $chgrp = ($options["chgrp"] ?? "") ?: false; if (isset($options["certificates"])) { $cert_ids = preg_split('/[,;\s]+/', $options["certificates"] ?: "", 0, PREG_SPLIT_NO_EMPTY); @@ -571,7 +516,7 @@ function findCertificates(array $certificate_ids_or_names, $load_content = true) return $result; } -function exportCertificates(array $cert_refids) +function exportCertificates(array $cert_refids): array { $result = []; $config = OPNsense\Core\Config::getInstance()->object(); @@ -597,72 +542,12 @@ function exportCertificates(array $cert_refids) function configPath(): string { - static $paths = [ - '/var/etc/acme-client', - __DIR__ - ]; - foreach ($paths as $path) { - if (is_dir($path)) { - return $path . DIRECTORY_SEPARATOR . 'sftp-config'; - } + if (($path = Utils::configPath())) { + return $path . DIRECTORY_SEPARATOR . "sftp-config"; } die("Failed detecting config path"); } -function main() -{ - global $argv; - $command = getCommand(); - $options = ["help", "log", "no-error"]; - - $has_automation_id = preg_match('/--automation-id=\S+/', join(" ", $argv)); - if ($has_automation_id) { - $options = array_merge($options, ["automation-id:", "certificates::"]); - } else { - $options = array_merge($options, $command["options"]); - } - - $index = 0; - if ($options = getopt("h", $options, $index)) { - if (isset($options["h"]) || isset($options["help"])) { - help(); - } else { - if (isset($options["log"])) { - Utils::log(true)->info("Logging to stdout enabled"); - } - - $options = array_filter($options, function ($value) { - return !is_string($value) - || (!empty($value = trim($value)) && $value !== "__default_value"); - }); - - if (isset($options["automation-id"])) { - $options = array_merge(getOptionsById($options["automation-id"]), $options); - } - - if (is_callable($runner = $command["implementation"])) { - $code = $runner($options); - - if ($code != EXITCODE_SUCCESS) { - Utils::log()->error("Command execution failed, exit code $code. Last input was: " . json_encode($options, JSON_UNESCAPED_SLASHES)); - } - - exit(isset($options["no-error"]) ? EXITCODE_SUCCESS : $code); - } else { - exit(EXITCODE_ERROR_UNKNOWN_COMMAND); - } - } - } else { - if (count($argv) < 2) { - help(); - } else { - $cmd = join(" ", $argv); - Utils::log()->error("Parsing of '$cmd' failed at argument '{$argv[$index]}'"); - } - exit(1); - } -} - function requireThat($expression, $message) { try { @@ -674,4 +559,10 @@ function requireThat($expression, $message) } // Running the main script -main(); +Utils::runCLIMain( + "help", + "getOptionsById", + COMMANDS, + EXITCODE_SUCCESS, + EXITCODE_ERROR_UNKNOWN_COMMAND +); diff --git a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf index 7af68eaa45..4faf4b6873 100644 --- a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf +++ b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf @@ -120,6 +120,24 @@ parameters:--identity-type=%s --host=%s show-identity type:script_output message:prints the public key used to connect to sftp server +[run-remote-ssh-command] +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php +parameters:--automation-id=%s +type:script +message:running a command on the ssh server + +[test-remote-ssh-connection] +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php +parameters:--host=%s --host-key=%s --port=%s --user=%s --identity-type=%s --no-error test-connection +type:script_output +message:testing connection to ssh server + +[show-remote-ssh-identity] +command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php +parameters:--identity-type=%s --host=%s show-identity +type:script_output +message:prints the public key used to connect to ssh server + [reset-acme-client] command:/usr/bin/find /var/etc/acme-client/home /var/etc/acme-client/configs /var/etc/acme-client/certs /var/etc/acme-client/keys /var/etc/acme-client/accounts -type f -delete parameters: From 86a5d03de1a2c7671fd1742907cd24221d31a59b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 4 Apr 2022 09:58:38 +0200 Subject: [PATCH 0999/3088] dns/ddclient - add service control, xmlrpc registration and syslog target --- .../src/etc/inc/plugins.inc.d/ddclient.inc | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc diff --git a/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc b/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc new file mode 100644 index 0000000000..b5d0959100 --- /dev/null +++ b/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc @@ -0,0 +1,68 @@ +general->enabled == '1') { + $services[] = [ + 'description' => gettext('ddclient'), + 'configd' => [ + 'restart' => array('ddclient restart'), + 'start' => array('ddclient start'), + 'stop' => array('ddclient stop'), + ], + 'name' => 'ddclient', + 'pidfile' => '/var/run/ddclient.pid', + ]; + } + return $services; +} + +function ddclient_xmlrpc_sync() +{ + $result = array(); + $result[] = array( + 'description' => gettext('ddclient'), + 'section' => 'OPNsense.DynDNS', + 'id' => 'ddclient', + 'services' => ['ddclient'], + ); + return $result; +} + +function ddclient_syslog() +{ + $logfacilities = array(); + $logfacilities['ddclient'] = array( + 'facility' => ['ddclient'] + ); + return $logfacilities; +} From f3c4efb8fff7e1959ed1383a9f1a0c2fa61c0766 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Apr 2022 20:06:40 +0200 Subject: [PATCH 1000/3088] LICENSE: sync --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index eeb835ed94..b0c9debb93 100644 --- a/LICENSE +++ b/LICENSE @@ -23,7 +23,7 @@ Copyright (c) 2021 Jan Winkler Copyright (c) 2010 Jim Pingle Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça -Copyright (c) 2019 Juergen Kellerer +Copyright (c) 2019-2022 Juergen Kellerer Copyright (c) 2020-2021 Manuel Faux Copyright (c) 2021 Manuel Hofmann Copyright (c) 2003-2004 Manuel Kasper From ef9c13ac4336ee8c53444f23b00400350e5089f2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Apr 2022 20:07:12 +0200 Subject: [PATCH 1001/3088] dns/ddclient: bump version --- dns/ddclient/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 487f0af551..f3fe1c2413 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.4 +PLUGIN_VERSION= 1.5 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org From 0d4c3ae41080655ddbd69296068f6c4472b3c822 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Apr 2022 20:12:01 +0200 Subject: [PATCH 1002/3088] net/chrony: whitespace sweep --- .../src/opnsense/service/templates/OPNsense/Chrony/chrony.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf index 91cc28792c..2c717494c4 100644 --- a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf +++ b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chrony.conf @@ -24,7 +24,7 @@ server {{ peer }} iburst {% if helpers.exists('OPNsense.chrony.general.ntsclient {% if helpers.exists('OPNsense.chrony.general.fallbackpeers') and OPNsense.chrony.general.fallbackpeers != '' %} authselectmode mix -server {{ OPNsense.chrony.general.fallbackpeers }} +server {{ OPNsense.chrony.general.fallbackpeers }} {% endif %} {% if not helpers.empty('OPNsense.chrony.general.allowednetworks') %} From 3d76b9e6d6860deea9b4a52b77b55e1678991449 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 6 Apr 2022 08:19:03 +0200 Subject: [PATCH 1003/3088] dns/ddclient: changelog update --- dns/ddclient/pkg-descr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 9bc3469572..7c31315947 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,11 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.5 + +* Add service control, XMLRPC registration and syslog target +* Add Servercow support (contributed by FreddleSpl0it) + 1.4 * Add advanced general setting to allow updates via IPv6 From ec93f0e36eefe107b984d48345c681dc58a099cc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 6 Apr 2022 10:16:01 +0200 Subject: [PATCH 1004/3088] sysutils/boot-delay: obsoletion note --- sysutils/boot-delay/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sysutils/boot-delay/Makefile b/sysutils/boot-delay/Makefile index 38582b59c0..4928a05305 100644 --- a/sysutils/boot-delay/Makefile +++ b/sysutils/boot-delay/Makefile @@ -3,5 +3,6 @@ PLUGIN_VERSION= 1.0 PLUGIN_REVISION= 1 PLUGIN_COMMENT= Apply a persistent 10 second boot delay PLUGIN_MAINTAINER= franco@opnsense.org +PLUGIN_OBSOLETE= Use System: Tunables: name "kern.cam.boot_delay" value "10000" .include "../../Mk/plugins.mk" From 58ec526297a586b068ad3233c2c9c46f5fe81b93 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 6 Apr 2022 10:20:03 +0200 Subject: [PATCH 1005/3088] sysutils/boot-delay: fix obsolete message --- sysutils/boot-delay/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysutils/boot-delay/Makefile b/sysutils/boot-delay/Makefile index 4928a05305..e2af016999 100644 --- a/sysutils/boot-delay/Makefile +++ b/sysutils/boot-delay/Makefile @@ -3,6 +3,6 @@ PLUGIN_VERSION= 1.0 PLUGIN_REVISION= 1 PLUGIN_COMMENT= Apply a persistent 10 second boot delay PLUGIN_MAINTAINER= franco@opnsense.org -PLUGIN_OBSOLETE= Use System: Tunables: name "kern.cam.boot_delay" value "10000" +PLUGIN_OBSOLETE= Use System / Settings / Tunables: name "kern.cam.boot_delay" value "10000" .include "../../Mk/plugins.mk" From 8d45144ad4662387e2bca30cd4a2f42ade4e0c6b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 21 Apr 2022 11:33:59 +0200 Subject: [PATCH 1006/3088] FRR: OSPF ipv6 influence interface cost via carp (#2929) add event handler for ospf6 carp demotion including required interface fields (carp_depend_on and cost_demoted). while here polish some small usability issues, knowing: o Interface networktype and interfacename should be single dropdown boxes o diagnostics / bgp - fix search in grid, should only use a formatter for presentation purposes. o carp_frr_ospf6 rc.carp_service_status.d event handler o add "CARP demote" to model, form and template o bugfix previous, missing IFS= (internal field seperator) o missing ospf6d in log event handler --- net/frr/pkg-descr | 7 ++ .../rc.carp_service_status.d/carp_frr_ospf6 | 25 ++++ .../Quagga/forms/dialogEditOSPF6Interface.xml | 16 ++- .../OPNsense/Quagga/forms/ospf6.xml | 10 ++ .../mvc/app/models/OPNsense/Quagga/OSPF6.xml | 15 +++ .../views/OPNsense/Quagga/diagnosticsbgp.volt | 2 - .../opnsense/scripts/frr/lib/events/ospf6d.py | 107 ++++++++++++++++++ .../opnsense/scripts/frr/lib/events/ospfd.py | 2 - .../templates/OPNsense/Quagga/+TARGETS | 1 + .../service/templates/OPNsense/Quagga/frr | 5 +- .../OPNsense/Quagga/ospf6d_carp.conf | 13 +++ .../OPNsense/Quagga/syslog-ng-frr-events.conf | 3 +- 12 files changed, 198 insertions(+), 8 deletions(-) create mode 100755 net/frr/src/etc/rc.carp_service_status.d/carp_frr_ospf6 create mode 100644 net/frr/src/opnsense/scripts/frr/lib/events/ospf6d.py create mode 100644 net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d_carp.conf diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index be8a211623..ff023d8304 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -11,6 +11,13 @@ switching and routing, Internet access routers, and Internet peering. Plugin Changelog ================ +1.28 + +* OSPF6 Interface change networktype and interfacename to dropdown in stead of multi select +* Diagnostics / BGP - fix search in grid, should only use a formatter for presentation purposes. +* Add ospf6 carp demotion event handler + + 1.27 * Add BGP password authentication diff --git a/net/frr/src/etc/rc.carp_service_status.d/carp_frr_ospf6 b/net/frr/src/etc/rc.carp_service_status.d/carp_frr_ospf6 new file mode 100755 index 0000000000..218699f558 --- /dev/null +++ b/net/frr/src/etc/rc.carp_service_status.d/carp_frr_ospf6 @@ -0,0 +1,25 @@ +#!/bin/sh +if [ -f /etc/rc.conf.d/frr ]; then + . /etc/rc.conf.d/frr +fi + +if [ "$frr_enable" == "YES" ] && (`echo "$frr_daemons" | /usr/bin/grep -F -q -w "ospf6d"`) && + (`echo "$frr_carp_demote" | /usr/bin/grep -F -q -w "ospf6d"`) ; then + # OSPF enabled + OSPF_NEIGHBOR=`echo "show ipv6 ospf6 neighbor" | /usr/local/bin/vtysh 2>&1` IFS= + if [ "$?" -eq 0 ]; then + # running, check if we can find any neighbors + IFS= + neighbors_count=`echo $OSPF_NEIGHBOR | grep "Full/" | wc -l` + unset IFS + if [ "$neighbors_count" -eq 0 ]; then + # no neighbors in state Full/* found + exit 2 + else + exit 0 + fi + else + # not running + exit 1 + fi +fi diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPF6Interface.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPF6Interface.xml index 5455751673..2ddc6d8160 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPF6Interface.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditOSPF6Interface.xml @@ -7,7 +7,7 @@ interface.interfacename - select_multiple + dropdown Select an interface where this settings apply to. @@ -26,6 +26,18 @@ text + + interface.cost_demoted + + text + + + interface.carp_depend_on + + dropdown + The carp VHID to depend on, when this virtual address is not in master state, + the interface cost will be set to the demoted cost (specified above). + interface.hellointerval @@ -54,6 +66,6 @@ interface.networktype - select_multiple + dropdown diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf6.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf6.xml index 7f61394570..43bfb1b116 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf6.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf6.xml @@ -5,6 +5,16 @@ checkbox This will activate the OSPFv3 service if routing protocols are enabled in "General". + + ospf6.carp_demote + + checkbox + + Register CARP status monitor, when no neighbors are found, consider this node less attractive. + This feature needs syslog enabled using "Debugging" logging to catch all relevant status events. + This option is not compatible with "Enable CARP Failover". + + ospf6.redistribute diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml index 46e433426d..b6a9b1b65e 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml @@ -7,6 +7,10 @@ 0 Y + + 0 + Y + N Y @@ -52,6 +56,17 @@ 4294967295 Cost must be between 0 and 4294967295. + + 65535 + 1 + N + 65535 + Cost must be between 1 and 65535. + + + carp + N + 0 diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt index 60c7d72f17..b0e196ce02 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsbgp.volt @@ -101,7 +101,6 @@ $(document).ready(function() { content = _.template($('#routestpl').html())(data['response']); $('#routing').html(content); $('#routing table').bootgrid({ - converters: dataconverters, formatters: dataformatters }); }); @@ -110,7 +109,6 @@ $(document).ready(function() { content = _.template($('#routestpl').html())(data['response']); $('#routing6').html(content); $('#routing6 table').bootgrid({ - converters: dataconverters, formatters: dataformatters }); }); diff --git a/net/frr/src/opnsense/scripts/frr/lib/events/ospf6d.py b/net/frr/src/opnsense/scripts/frr/lib/events/ospf6d.py new file mode 100644 index 0000000000..42d86c9d9d --- /dev/null +++ b/net/frr/src/opnsense/scripts/frr/lib/events/ospf6d.py @@ -0,0 +1,107 @@ +""" + Copyright (c) 2022 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +import os +import syslog +from configparser import ConfigParser +from ..base import BaseEventHandler + + +class Ospf6dEventHandler(BaseEventHandler): + _config = '/usr/local/etc/frr/ospf6d_carp.conf' + + @property + def should_run(self): + return self.vtysh.is_running('ospf6d') + + def _read_config(self): + result = dict() + if os.path.isfile(self._config): + cnf = ConfigParser() + cnf.read(self._config) + not_empty = lambda x, y: cnf.has_option(x, y) and cnf.get(x, y) != '' and cnf.get(x, y) != '0' + for section in cnf.sections(): + if not_empty(section, 'interface') and not_empty(section, 'interface') \ + and not_empty(section, 'demoted_cost') and not_empty(section, 'carp_depend_on'): + default_cost = cnf.getint(section, 'default_cost') if not_empty(section, 'default_cost') else None + result[cnf.get(section, 'interface')] = { + 'demoted_cost': cnf.getint(section, 'demoted_cost'), + 'carp_depend_on': cnf.get(section, 'carp_depend_on'), + 'default_cost': default_cost, + } + + return result + + def execute(self): + if os.path.isfile(self._config): + # parse ospf6 interface data, keep structure similar to what ospf offers when using json output + ospf_interfaces = { + 'interfaces': {} + } + this_interface = None + for line in self.vtysh.execute('show ipv6 ospf6 interface', translate=None).decode().split('\n'): + if len(line) > 0 and line[0] != ' ': + this_interface = line.split()[0] + ospf_interfaces['interfaces'][this_interface] = {} + elif this_interface is not None: + if line.find('Area ID') > 0 and line.split()[-1].isdigit(): + # Area ID X.X.X.X, Cost XXXX + ospf_interfaces['interfaces'][this_interface]['cost'] = int(line.split()[-1]) + + config_interfaces = self._read_config() + for intf in config_interfaces: + if 'interfaces' in ospf_interfaces and intf in ospf_interfaces['interfaces']: + ospf_intf_cost = ospf_interfaces['interfaces'][intf]['cost'] + is_intf_master = self.ifstatus.address_status(config_interfaces[intf]['carp_depend_on']) == 'master' + is_ospf_dem = ospf_intf_cost == config_interfaces[intf]['demoted_cost'] + if is_intf_master and is_ospf_dem: + # promote ospf6 interface + conf_cost = config_interfaces[intf]['default_cost'] + if conf_cost is None: + syslog.syslog( + syslog.LOG_NOTICE, 'ospf6d promote interface %s (no default cost configured).' % intf + ) + self.vtysh.execute( + ['interface %s' % intf, 'no ipv6 ospf6 cost'], translate=None, configure=True + ) + elif conf_cost != ospf_intf_cost: + syslog.syslog( + syslog.LOG_NOTICE, 'ospf6d promote interface %s (cost %d).' % (intf, conf_cost) + ) + self.vtysh.execute( + ['interface %s' % intf, 'ipv6 ospf6 cost %d' % conf_cost], + translate=None, configure=True + ) + elif not is_intf_master and not is_ospf_dem: + # demote ospf6 interface + conf_cost = config_interfaces[intf]['demoted_cost'] + syslog.syslog( + syslog.LOG_NOTICE, 'ospf6d demote interface %s (cost %d).' % (intf, conf_cost) + ) + self.vtysh.execute( + ['interface %s' % intf, 'ipv6 ospf6 cost %d' % conf_cost], + translate=None, configure=True + ) diff --git a/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py b/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py index d692747088..7eabadb9b7 100755 --- a/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py +++ b/net/frr/src/opnsense/scripts/frr/lib/events/ospfd.py @@ -59,8 +59,6 @@ def execute(self): if os.path.isfile(self._config): ospf_interfaces = self.vtysh.execute('show ip ospf interface json') config_interfaces = self._read_config() - cnf = ConfigParser() - cnf.read(self._config) for intf in config_interfaces: if 'interfaces' in ospf_interfaces and intf in ospf_interfaces['interfaces']: ospf_intf_cost = ospf_interfaces['interfaces'][intf]['cost'] diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS index c2e0542d6f..ea22bda2da 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS @@ -3,6 +3,7 @@ bgpd.conf:/usr/local/etc/frr/bgpd.conf ospfd.conf:/usr/local/etc/frr/ospfd.conf ospfd_carp.conf:/usr/local/etc/frr/ospfd_carp.conf ospf6d.conf:/usr/local/etc/frr/ospf6d.conf +ospf6d_carp.conf:/usr/local/etc/frr/ospf6d_carp.conf ripd.conf:/usr/local/etc/frr/ripd.conf sa_policies.conf:/usr/local/etc/frr/sa_policies.conf frr:/etc/rc.conf.d/frr diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr index 9c8ee85256..2b0b291664 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr @@ -12,7 +12,10 @@ if helpers.exists('OPNsense.quagga.bgp.enabled') and OPNsense.quagga.bgp.enabled if helpers.exists('OPNsense.quagga.ospf6.enabled') and OPNsense.quagga.ospf6.enabled == '1' %} ospf6d{% endif %}{% if helpers.exists('OPNsense.quagga.ripng.enabled') and OPNsense.quagga.ripng.enabled == '1' %} ripngd{% endif %}{% if helpers.exists('OPNsense.quagga.isis.enabled') and OPNsense.quagga.isis.enabled == '1' %} isisd{% endif %}" -frr_carp_demote="{% if not helpers.empty('OPNsense.quagga.ospf.carp_demote') %} ospfd{% endif %}" +frr_carp_demote="{% + if not helpers.empty('OPNsense.quagga.ospf.carp_demote') %} ospfd{% endif %}{% + if not helpers.empty('OPNsense.quagga.ospf6.carp_demote') %} ospf6d{% endif +%}" start_postcmd="/usr/local/opnsense/scripts/frr/carp_event_handler" {% else %} frr_enable="NO" diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d_carp.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d_carp.conf new file mode 100644 index 0000000000..af3400036f --- /dev/null +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d_carp.conf @@ -0,0 +1,13 @@ +{% from 'OPNsense/Macros/interface.macro' import physical_interface %} +{% if helpers.exists('OPNsense.quagga.ospf6.interfaces.interface') %} +{% for interface in helpers.toList('OPNsense.quagga.ospf6.interfaces.interface') %} +{% if interface.enabled == '1' %} +[{{ interface['@uuid'] }}] +enabled={{interface.enabled|default('0')}} +interface={{physical_interface(interface.interfacename)}} +default_cost={{interface.cost|default('')}} +demoted_cost={{interface.cost_demoted|default('')}} +carp_depend_on={{interface.carp_depend_on|default('')}} +{% endif %} +{% endfor %} +{% endif %} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/syslog-ng-frr-events.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/syslog-ng-frr-events.conf index 9644313b81..309d47627c 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/syslog-ng-frr-events.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/syslog-ng-frr-events.conf @@ -6,7 +6,8 @@ destination d_frr_event { }; filter f_frr_ospf { - program("ospfd") and ( + (program("ospfd") or program("ospf6d")) + and ( ( level("info") or level("notice") ) or ( From 00f5664c5673ec1a3d3d4eb72932da45aae64f5b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 21 Apr 2022 11:59:22 +0200 Subject: [PATCH 1007/3088] net/frr: small cleanups --- net/frr/pkg-descr | 7 ++----- net/frr/src/opnsense/scripts/frr/lib/events/ospf6d.py | 0 2 files changed, 2 insertions(+), 5 deletions(-) mode change 100644 => 100755 net/frr/src/opnsense/scripts/frr/lib/events/ospf6d.py diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index ff023d8304..9fcb50b973 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -7,6 +7,7 @@ makes it applicable to a wide variety of use cases including connecting hosts/VMs/containers to the network, advertising network services, LAN switching and routing, Internet access routers, and Internet peering. +WWW: https://frrouting.org/ Plugin Changelog ================ @@ -14,10 +15,9 @@ Plugin Changelog 1.28 * OSPF6 Interface change networktype and interfacename to dropdown in stead of multi select -* Diagnostics / BGP - fix search in grid, should only use a formatter for presentation purposes. +* Diagnostics / BGP - fix search in grid, should only use a formatter for presentation purposes * Add ospf6 carp demotion event handler - 1.27 * Add BGP password authentication @@ -131,6 +131,3 @@ Plugin Changelog 1.8 * Add area range in OSPF config - - -WWW: https://frrouting.org/ diff --git a/net/frr/src/opnsense/scripts/frr/lib/events/ospf6d.py b/net/frr/src/opnsense/scripts/frr/lib/events/ospf6d.py old mode 100644 new mode 100755 From abfa21fb63c7f69923f5d3530a901d4374ed98ea Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Fri, 22 Apr 2022 06:43:22 -0600 Subject: [PATCH 1008/3088] avoid errors with repeated primary servers and keys (#2874) --- .../OPNsense/Bind/forms/dialogEditBindDomain.xml | 10 ++++++++-- .../mvc/app/models/OPNsense/Bind/Domain.xml | 4 ++++ .../mvc/app/views/OPNsense/Bind/general.volt | 4 ++-- .../service/templates/OPNsense/Bind/named.conf | 14 ++++++++------ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml index eed6958bb0..c7ccbfbb76 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml @@ -46,13 +46,19 @@ domain.transferkeyalgo dropdown - Set the authentication algorithm for the TSIG key. + Set the authentication algorithm for the TSIG key used to transfer domain data from the master server. + + + domain.transferkeyname + + text + The name of the TSIG key, which must match the value on the master server. domain.transferkey text - The TSIG key used to transfer domain data from the master server. + The base64-encoded TSIG key. domain.allownotifyslave diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml index 2ddbcf003b..c33f41c975 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Domain.xml @@ -33,6 +33,10 @@ HMAC-MD5 + + N + + N diff --git a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt index 47a7053502..13e9fb12a6 100644 --- a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt +++ b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt @@ -277,9 +277,9 @@ $( document ).ready(function() { $('#domain\\.transferkeyalgo').on('change', function(e) { if (e.target.selectedIndex === 0) { - $('#domain\\.transferkey').val('').attr('readonly', true); + $('#domain\\.transferkey,#domain\\.transferkeyname').val('').attr('readonly', true); } else { - $('#domain\\.transferkey').attr('readonly', false); + $('#domain\\.transferkey,#domain\\.transferkeyname').attr('readonly', false); } }); diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf index d0c552157a..94fd79aac8 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf @@ -131,6 +131,7 @@ zone "rpzbing" { type master; file "/usr/local/etc/namedb/master/bing.db"; notif {% endif %} {% if helpers.exists('OPNsense.bind.domain.domains.domain') %} +{% set usedkeys = [] %} {% for domain in helpers.toList('OPNsense.bind.domain.domains.domain') %} {% if domain.enabled == '1' %} {% set allow_transfer = helpers.getUUID(domain.allowtransfer) %} @@ -138,7 +139,11 @@ zone "rpzbing" { type master; file "/usr/local/etc/namedb/master/bing.db"; notif zone "{{ domain.domainname }}" { type {{ domain.type }}; {% if domain.type == 'slave' %} +{% if domain.transferkey is defined %} + masters { {{ domain.masterip.replace(',', ' key "' ~ domain.transferkeyname ~ '"; ') }} key "{{ domain.transferkeyname }}"; }; +{% else %} masters { {{ domain.masterip.replace(',', '; ') }}; }; +{% endif %} {% if domain.allownotifyslave is defined %} allow-notify { {{ domain.allownotifyslave.replace(',', '; ') }}; }; {% endif %} @@ -153,15 +158,12 @@ zone "{{ domain.domainname }}" { allow-query { {{ allow_query.name }}; }; {% endif %} }; -{% if domain.type == 'slave' and domain.transferkey is defined %} -{% set key_name = 'tsig-transferkey-' ~ domain.domainname.replace('.', '-') %} -key "{{ key_name }}" { +{% if domain.type == 'slave' and domain.transferkey is defined and not(domain.transferkeyname in usedkeys) %} +{% do usedkeys.append(domain.transferkeyname) %} +key "{{ domain.transferkeyname }}" { algorithm "{{ domain.transferkeyalgo }}"; secret "{{ domain.transferkey }}"; }; -server {{ domain.masterip }} { - keys { "{{ key_name }}" }; -}; {% endif %} {% endif %} {% endfor %} From 1417b85d96390461c84d84fa65e1ca5c1124e5ca Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 22 Apr 2022 14:45:23 +0200 Subject: [PATCH 1009/3088] dns/bind: bump --- dns/bind/Makefile | 2 +- dns/bind/pkg-descr | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index f810d13b74..292e24d28d 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.22 +PLUGIN_VERSION= 1.23 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 465c763340..c9e9d6e907 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -4,10 +4,15 @@ one computer can find another computer on the basis of its name. The BIND software distribution contains all of the software necessary for asking and answering name service questions. +WWW: https://www.isc.org Plugin Changelog ================ +1.23 + +* Avoid errors with repeated primary servers and keys (contributed by Michael Newton) + 1.22 * Fix DNS Blacklist download @@ -116,6 +121,3 @@ Plugin Changelog 1.0 * Initial release - - -WWW: https://www.isc.org From 45030fabf47f4a96df5434b4d06be56de0a0da7b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 22 Apr 2022 19:17:28 +0200 Subject: [PATCH 1010/3088] security/stunnel - with the deprecation of __items on our model fields make sure non of our plugins uses the old magic property. Traversing __items is actually the same as usnig iterateItems(), which should be a valid replacement. ref https://github.com/opnsense/core/commit/fc8890851a87d3041b820d801e6a386b88ee244b cc @swhite2 --- security/stunnel/Makefile | 1 + security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc | 2 +- .../app/controllers/OPNsense/Stunnel/Api/ServicesController.php | 2 +- .../stunnel/src/opnsense/scripts/stunnel/generate_certs.php | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index 87786dae30..d3215d7941 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= stunnel PLUGIN_VERSION= 1.0.4 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel diff --git a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc index 374e2ab1a2..ad0a37973a 100644 --- a/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc +++ b/security/stunnel/src/etc/inc/plugins.inc.d/stunnel.inc @@ -70,7 +70,7 @@ function stunnel_refresh_crls() { $stunnel = new OPNsense\Stunnel\Stunnel(); $configObj = OPNsense\Core\Config::getInstance()->object(); - foreach ($stunnel->services->service->__items as $service) { + foreach ($stunnel->services->service->iterateItems() as $service) { if (!empty((string)$service->enabled) && !empty((string)$service->enableCRL)) { foreach (explode(",", (string)$service->cacert) as $cacert) { $this_ca = null; diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php index edad2be838..0083aec567 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php @@ -39,7 +39,7 @@ protected function save() { // hook service enable status on enabled tunnels $this->getModel()->general->enabled = "0"; - foreach ($this->getModel()->services->service->__items as $service) { + foreach ($this->getModel()->services->service->iterateItems() as $service) { if ((string)$service->enabled == "1") { $this->getModel()->general->enabled = "1"; break; diff --git a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php index b1166611ec..908e7dd70d 100755 --- a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php +++ b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php @@ -37,7 +37,7 @@ $stunnel = new Stunnel(); $configObj = Config::getInstance()->object(); $all_certs = []; -foreach ($stunnel->services->service->__items as $service) { +foreach ($stunnel->services->service->iterateItems() as $service) { if (!empty((string)$service->enabled)) { $this_uuid = $service->getAttributes()['uuid']; $srv_certid = (string)$service->servercert; From c7fea104edc0767b4be1e2b36a04bbb5ed484e4b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 23 Apr 2022 00:13:35 +0200 Subject: [PATCH 1011/3088] net / frr - Routing: Diagnostics: OSPF - asbrRouter is an optional field, safeguard before usage. --- .../opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt index 80cf75ff06..1aa5e08576 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnosticsospf.volt @@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
    - + From fd30e06017dd1e682a5d64966b92c37a0bc367a3 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 27 Apr 2022 13:00:46 +0200 Subject: [PATCH 1012/3088] net/relayd - add listen address and port (range) to Virtual Server tab. closes https://github.com/opnsense/plugins/issues/2959 (#2960) --- .../Relayd/Api/SettingsController.php | 10 +++---- .../mvc/app/views/OPNsense/Relayd/index.volt | 27 ++++++++++++++++++- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php index dd18169453..c47153d922 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php @@ -333,19 +333,19 @@ public function searchAction($nodeType = null) $fields = array(); switch ($nodeType) { case 'host': - $fields = array('enabled', 'name', 'address'); + $fields = ['enabled', 'name', 'address']; break; case 'tablecheck': - $fields = array('name', 'type'); + $fields = ['name', 'type']; break; case 'table': - $fields = array('enabled', 'name'); + $fields = ['enabled', 'name']; break; case 'protocol': - $fields = array('name', 'type'); + $fields = ['name', 'type']; break; case 'virtualserver': - $fields = array('enabled', 'name', 'type'); + $fields = ['enabled', 'name', 'type', 'listen_address', 'listen_startport', 'listen_endport']; break; } $result = $grid->fetchBindRequest($this->request, $fields); diff --git a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt index 71cb811011..8c96a0ec31 100644 --- a/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt +++ b/net/relayd/src/opnsense/mvc/app/views/OPNsense/Relayd/index.volt @@ -101,7 +101,30 @@ POSSIBILITY OF SUCH DAMAGE. 'get': '/api/relayd/settings/get/' + element + '/', 'set': '/api/relayd/settings/set/' + element + '/', 'add': '/api/relayd/settings/set/' + element + '/', - 'del': '/api/relayd/settings/del/' + element + '/' + 'del': '/api/relayd/settings/del/' + element + '/', + options: { + formatters: { + 'listen_port': function (column, row) { + if (row.listen_endport) { + return row.listen_startport + ":" + row.listen_endport; + } else { + return row.listen_startport; + } + }, + 'commands': function (column, row) { + return ' ' + + '' + + ''; + }, + 'rowtoggle': function (column, row) { + if (parseInt(row[column.id], 2) === 1) { + return ''; + } else { + return ''; + } + }, + } + } }; if (['virtualserver', 'host', 'table'].includes(element)) { endpoints['toggle'] = '/api/relayd/settings/toggle/' + element + '/'; @@ -342,6 +365,8 @@ POSSIBILITY OF SUCH DAMAGE. + + From cf917d94fd63924465d7b9c05955e80a62be6e1e Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 26 Apr 2022 20:40:08 +0200 Subject: [PATCH 1013/3088] net/relayd - upgrade version --- net/relayd/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index e995794309..29e7ac472f 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= relayd -PLUGIN_VERSION= 2.6 -PLIGIN_REVISION= 1 +PLUGIN_VERSION= 2.7 +#PLUGIN_REVISION= 1 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com From fd4fc038e176e83ba128efe1cfc30476d027aad1 Mon Sep 17 00:00:00 2001 From: clanto007 <44651109+clanto007@users.noreply.github.com> Date: Wed, 27 Apr 2022 20:43:13 +0200 Subject: [PATCH 1014/3088] Add Enable Remote Commands to Zabbix Proxy (#2948) --- net-mgmt/zabbix-proxy/Makefile | 2 +- net-mgmt/zabbix-proxy/pkg-descr | 4 ++++ .../app/controllers/OPNsense/Zabbixproxy/forms/general.xml | 6 ++++++ .../mvc/app/models/OPNsense/Zabbixproxy/General.xml | 4 ++++ .../templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in | 5 +++++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/net-mgmt/zabbix-proxy/Makefile b/net-mgmt/zabbix-proxy/Makefile index 06492f992d..0ee78e70ba 100644 --- a/net-mgmt/zabbix-proxy/Makefile +++ b/net-mgmt/zabbix-proxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= zabbix-proxy -PLUGIN_VERSION= 1.7 +PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= Zabbix monitoring proxy PLUGIN_MAINTAINER= m.muenz@gmail.com PLUGIN_VARIANTS= zabbix5 zabbix54 zabbix4 diff --git a/net-mgmt/zabbix-proxy/pkg-descr b/net-mgmt/zabbix-proxy/pkg-descr index dadafe0660..8182875fee 100644 --- a/net-mgmt/zabbix-proxy/pkg-descr +++ b/net-mgmt/zabbix-proxy/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.zabbix.com/ Plugin Changelog ---------------- +1.8 + +* Add EnableRemoteCommands (#2948) + 1.7 * Add StatsIP field to allow retrieving statistics (#2697) diff --git a/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml b/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml index 8124eaa217..168f981c3c 100644 --- a/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml +++ b/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml @@ -11,6 +11,12 @@ checkbox Active (default) or passive mode, only switch to passive if you know what you are doing. + + general.remotecommands + + checkbox + Enable Remote Commands on Proxy. + general.server diff --git a/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml b/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml index 6602576a22..ab55fb06cc 100644 --- a/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml +++ b/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml @@ -11,6 +11,10 @@ 0 Y + + 0 + Y + N diff --git a/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in b/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in index 9eace261bf..3ee03b5dc1 100644 --- a/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in +++ b/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in @@ -5,6 +5,11 @@ ProxyMode=1 {% else %} ProxyMode=0 {% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.remotecommands') and OPNsense.zabbixproxy.general.remotecommands == '1' %} +EnableRemoteCommands=1 +{% else %} +EnableRemoteCommands=0 +{% endif %} {% if helpers.exists('OPNsense.zabbixproxy.general.server') and OPNsense.zabbixproxy.general.server != '' %} Server={{ OPNsense.zabbixproxy.general.server }} {% endif %} From 85f40b884a5a6123e764f97fd7619cc66a078b70 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 29 Apr 2022 10:54:36 +0200 Subject: [PATCH 1015/3088] net/frr: (BGP) according to the FRR documentation and the ui validations, match is optional (https://docs.frrouting.org/en/latest/routemap.html#term-Matching-Conditions). Likely fixes https://github.com/opnsense/plugins/issues/2955 (#2965) --- .../src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index 499ffe8e1e..de3d7b4c24 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -183,7 +183,7 @@ route-map {{ routemap.name }} {{ routemap.action }} {{ routemap.id }} {% endif %} {% endfor %} {% endif %} -{% if routemap.set|default("") != '' and routemap.match|default("") != '' %} +{% if routemap.set|default("") != '' %} set {{ routemap.set }} {% endif %} {% if routemap.match2|default("") != "" %} From 574c6cb5da2c05e81f75b3e3cb0df7aa5ffa9a84 Mon Sep 17 00:00:00 2001 From: Rafael Mundel Date: Sun, 1 May 2022 11:13:03 -0400 Subject: [PATCH 1016/3088] Add Zabbix Agent 6.0 (#2963) --- net-mgmt/zabbix-agent/Makefile | 5 ++++- net-mgmt/zabbix-agent/pkg-descr | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net-mgmt/zabbix-agent/Makefile b/net-mgmt/zabbix-agent/Makefile index 7a79968563..1c5f92398b 100644 --- a/net-mgmt/zabbix-agent/Makefile +++ b/net-mgmt/zabbix-agent/Makefile @@ -2,7 +2,10 @@ PLUGIN_NAME= zabbix-agent PLUGIN_VERSION= 1.11 PLUGIN_COMMENT= Zabbix monitoring agent PLUGIN_MAINTAINER= opnsense@moov.de -PLUGIN_VARIANTS= zabbix5 zabbix54 +PLUGIN_VARIANTS= zabbix6 zabbix5 zabbix54 + +zabbix6_NAME= zabbix6-agent +zabbix6_DEPENDS= zabbix6-agent zabbix5_NAME= zabbix-agent zabbix5_DEPENDS= zabbix5-agent diff --git a/net-mgmt/zabbix-agent/pkg-descr b/net-mgmt/zabbix-agent/pkg-descr index b1811bc200..17e3d3d485 100644 --- a/net-mgmt/zabbix-agent/pkg-descr +++ b/net-mgmt/zabbix-agent/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.zabbix.com/ Plugin Changelog ---------------- +1.12 + +* Plugin variant for Zabbix Agent 6.0 + 1.11 * Add description to restart action to allow restart via cron From 8ae502d2b07d497ce68bf2707a7111d81d87c915 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 1 May 2022 17:20:07 +0200 Subject: [PATCH 1017/3088] net-mgmt/zabbix-agent: adjust changelog style --- net-mgmt/zabbix-agent/pkg-descr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net-mgmt/zabbix-agent/pkg-descr b/net-mgmt/zabbix-agent/pkg-descr index 17e3d3d485..64217f1956 100644 --- a/net-mgmt/zabbix-agent/pkg-descr +++ b/net-mgmt/zabbix-agent/pkg-descr @@ -14,10 +14,12 @@ Plugin Changelog 1.12 +Added: * Plugin variant for Zabbix Agent 6.0 1.11 +Added: * Add description to restart action to allow restart via cron 1.10 From ee04e1a5da8f12540997d127f0f30b6f4bb5a9f0 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 1 May 2022 17:25:00 +0200 Subject: [PATCH 1018/3088] net-mgmt/zabbix-agent: bump version --- net-mgmt/zabbix-agent/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-mgmt/zabbix-agent/Makefile b/net-mgmt/zabbix-agent/Makefile index 1c5f92398b..a4ad113088 100644 --- a/net-mgmt/zabbix-agent/Makefile +++ b/net-mgmt/zabbix-agent/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= zabbix-agent -PLUGIN_VERSION= 1.11 +PLUGIN_VERSION= 1.12 PLUGIN_COMMENT= Zabbix monitoring agent PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_VARIANTS= zabbix6 zabbix5 zabbix54 From ab4d078c907b0194687868c657fe97b769f0301d Mon Sep 17 00:00:00 2001 From: MeganerdNL Date: Sun, 1 May 2022 17:31:59 +0200 Subject: [PATCH 1019/3088] security/acme-client: Correct TransIP API (#2932) * Correct TransIP API, fixes #2924 API key field type of Transip corrected from "text" to "textbox". It was not working with "text" due to linebreaks. Furthernore added a note that 300s sleep time is recommended. --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 7ee42f5740..b9e1e755cc 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1065,6 +1065,9 @@ header + + + header validation.dns_transip_username @@ -1074,7 +1077,7 @@ validation.dns_transip_key - text + textbox Requires the whole key file in a format that is compatible with TransIP. From 3b5e8e50df9f0c3d76d1ce2431b8ec15a1046484 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 1 May 2022 17:39:36 +0200 Subject: [PATCH 1020/3088] security/acme-client: fix missing closing tag, refs #2932 --- .../controllers/OPNsense/AcmeClient/forms/dialogValidation.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index b9e1e755cc..93a6b7e4bf 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1068,6 +1068,7 @@ header + validation.dns_transip_username From 66bd98798bc14ed030a3b2d8e7acd6f9adefde05 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 1 May 2022 17:40:56 +0200 Subject: [PATCH 1021/3088] security/acme-client: update changelog --- security/acme-client/pkg-descr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 9305b77522..eebd4286a5 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.10 + +Fixed: +* unable to configure key in TransIP API (#2924) + 3.9 Added: From 6ea9913cb815e4637a65d5b4fc88223636d35a00 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 1 May 2022 17:41:12 +0200 Subject: [PATCH 1022/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 00d852986b..5dd108a98a 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.9 +PLUGIN_VERSION= 3.10 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From b4ef39efa550e352dbb3ec36e05b17caebe9b8ac Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 1 May 2022 18:06:22 +0200 Subject: [PATCH 1023/3088] security/acme-client: update changelog --- security/acme-client/pkg-descr | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index eebd4286a5..6cd62b0b1e 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -10,6 +10,9 @@ Plugin Changelog 3.10 +Added: +* new automation: run remote commands via SSH (#2757) + Fixed: * unable to configure key in TransIP API (#2924) From 3d2144223206b8a5edfcf22b0aa50dd2bbdc991b Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 6 May 2022 12:13:42 +0200 Subject: [PATCH 1024/3088] net/frr: allow prefix-lists up to 10000 (#2972) --- net/frr/Makefile | 2 +- net/frr/pkg-descr | 1 + .../OPNsense/Quagga/forms/dialogEditBGPPrefixLists.xml | 2 +- net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 026281f058..98526d16f7 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.27 +PLUGIN_VERSION= 1.28 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr7 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 9fcb50b973..5219eed253 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -17,6 +17,7 @@ Plugin Changelog * OSPF6 Interface change networktype and interfacename to dropdown in stead of multi select * Diagnostics / BGP - fix search in grid, should only use a formatter for presentation purposes * Add ospf6 carp demotion event handler +* Allow BGP prefix-list number up to 10000 instead of 99 1.27 diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPPrefixLists.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPPrefixLists.xml index 276e4e5d45..da50945980 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPPrefixLists.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPPrefixLists.xml @@ -27,7 +27,7 @@ prefixlist.seqnumber text - The ACL sequence number (10-99) + The ACL sequence number (10-10000) prefixlist.action diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml index 33dd741479..0f37813cbe 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml @@ -240,7 +240,7 @@ Y 10 - 99 + 10000 From 32e4f8fe807178737b213763fd749a090ba7236a Mon Sep 17 00:00:00 2001 From: schreibubi Date: Mon, 9 May 2022 12:05:57 +0530 Subject: [PATCH 1025/3088] dns/dnscrypt-proxy: Support specifying relays for anonymous DNS (#2548) --- dns/dnscrypt-proxy/pkg-descr | 4 ++++ .../OPNsense/Dnscryptproxy/forms/general.xml | 8 ++++++++ .../models/OPNsense/Dnscryptproxy/General.xml | 3 +++ .../OPNsense/Dnscryptproxy/dnscrypt-proxy.toml | 18 ++++++++++++++++++ 4 files changed, 33 insertions(+) diff --git a/dns/dnscrypt-proxy/pkg-descr b/dns/dnscrypt-proxy/pkg-descr index cbe2d972b9..0be7fb48eb 100644 --- a/dns/dnscrypt-proxy/pkg-descr +++ b/dns/dnscrypt-proxy/pkg-descr @@ -5,6 +5,10 @@ such as DNSCrypt v2 and DNS-over-HTTPS. Plugin Changelog ================ +1.12 + +* Support specifying relays for anonymous DNS + 1.11 * Fix DNSBL update due to FreeBSD13 upgrade (sed syntax) diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml index 41d4d57d26..9243e23726 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/controllers/OPNsense/Dnscryptproxy/forms/general.xml @@ -179,4 +179,12 @@ true + + general.relaylist + + select_multiple + + true + relays. Will be used for relaying to all configured servers.]]> + diff --git a/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml b/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml index 85826254e3..3d47b93fd4 100644 --- a/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml +++ b/dns/dnscrypt-proxy/src/opnsense/mvc/app/models/OPNsense/Dnscryptproxy/General.xml @@ -147,5 +147,8 @@ , Y + + N + diff --git a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml index 96dd4718ef..61260c00e3 100644 --- a/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml +++ b/dns/dnscrypt-proxy/src/opnsense/service/templates/OPNsense/Dnscryptproxy/dnscrypt-proxy.toml @@ -152,6 +152,24 @@ cache = false refresh_delay = 72 prefix = '' + ## Anonymized DNS relays + + [sources.'relays'] + urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/relays.md', 'https://download.dnscrypt.info/resolvers-list/v3/relays.md', 'https://ipv6.download.dnscrypt.info/resolvers-list/v3/relays.md', 'https://download.dnscrypt.net/resolvers-list/v3/relays.md'] + cache_file = 'relays.md' + minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3' + refresh_delay = 72 + prefix = '' + +[anonymized_dns] + +{% if helpers.exists('OPNsense.dnscryptproxy.general.relaylist') and OPNsense.dnscryptproxy.general.relaylist != '' %} + routes = [ + { server_name='*', via=[{{ "'" + ("','".join(OPNsense.dnscryptproxy.general.relaylist.split(','))) + "'" }}] } + ] +{% endif %} + + [static] {% if helpers.exists('OPNsense.dnscryptproxy.server.servers.server') %} {% for server_list in helpers.toList('OPNsense.dnscryptproxy.server.servers.server') %} From aeaf368781f9b412918e5a9544304b512fe685c8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 9 May 2022 08:36:18 +0200 Subject: [PATCH 1026/3088] dns/dnscrypt-proxy: bump previous --- dns/dnscrypt-proxy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/dnscrypt-proxy/Makefile b/dns/dnscrypt-proxy/Makefile index 3c7a4c9d88..0641d52d1a 100644 --- a/dns/dnscrypt-proxy/Makefile +++ b/dns/dnscrypt-proxy/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= dnscrypt-proxy -PLUGIN_VERSION= 1.11 +PLUGIN_VERSION= 1.12 PLUGIN_COMMENT= Flexible DNS proxy supporting DNSCrypt and DoH PLUGIN_DEPENDS= dnscrypt-proxy2 PLUGIN_MAINTAINER= m.muenz@gmail.com From e51caa73480025b19d40409fdeee88c72ca7fd87 Mon Sep 17 00:00:00 2001 From: Rafael Mundel Date: Mon, 9 May 2022 02:47:04 -0400 Subject: [PATCH 1027/3088] Zabbix Proxy 6.0 (#2964) --- net-mgmt/zabbix-proxy/Makefile | 5 ++++- net-mgmt/zabbix-proxy/pkg-descr | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net-mgmt/zabbix-proxy/Makefile b/net-mgmt/zabbix-proxy/Makefile index 0ee78e70ba..e23333467c 100644 --- a/net-mgmt/zabbix-proxy/Makefile +++ b/net-mgmt/zabbix-proxy/Makefile @@ -2,7 +2,10 @@ PLUGIN_NAME= zabbix-proxy PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= Zabbix monitoring proxy PLUGIN_MAINTAINER= m.muenz@gmail.com -PLUGIN_VARIANTS= zabbix5 zabbix54 zabbix4 +PLUGIN_VARIANTS= zabbix6 zabbix5 zabbix54 zabbix4 + +zabbix6_NAME= zabbix6-proxy +zabbix6_DEPENDS= zabbix6-proxy zabbix5_NAME= zabbix5-proxy zabbix5_DEPENDS= zabbix5-proxy diff --git a/net-mgmt/zabbix-proxy/pkg-descr b/net-mgmt/zabbix-proxy/pkg-descr index 8182875fee..4c491f7ce4 100644 --- a/net-mgmt/zabbix-proxy/pkg-descr +++ b/net-mgmt/zabbix-proxy/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.zabbix.com/ Plugin Changelog ---------------- +1.9 + +* Add plugin variant for Zabbix Proxy 6.0 + 1.8 * Add EnableRemoteCommands (#2948) From 05c646de09659ef6a982ca20e802a9d5f83b1701 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 9 May 2022 08:52:08 +0200 Subject: [PATCH 1028/3088] net-mgmt/zabbix-proxy: belongs to version 1.8 --- net-mgmt/zabbix-proxy/pkg-descr | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net-mgmt/zabbix-proxy/pkg-descr b/net-mgmt/zabbix-proxy/pkg-descr index 4c491f7ce4..af6d7f8695 100644 --- a/net-mgmt/zabbix-proxy/pkg-descr +++ b/net-mgmt/zabbix-proxy/pkg-descr @@ -12,13 +12,10 @@ WWW: https://www.zabbix.com/ Plugin Changelog ---------------- -1.9 - -* Add plugin variant for Zabbix Proxy 6.0 - 1.8 * Add EnableRemoteCommands (#2948) +* Add plugin variant for Zabbix Proxy 6.0 1.7 From 8f158306c99cce6e200612845de72371124c3e8b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 9 May 2022 13:38:39 +0200 Subject: [PATCH 1029/3088] www/web/proxy-useracl: plugin receives no maintenance --- www/web-proxy-useracl/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/www/web-proxy-useracl/Makefile b/www/web-proxy-useracl/Makefile index a2374138c9..7620cecc0f 100644 --- a/www/web-proxy-useracl/Makefile +++ b/www/web-proxy-useracl/Makefile @@ -2,6 +2,7 @@ PLUGIN_NAME= web-proxy-useracl PLUGIN_VERSION= 1.1 PLUGIN_REVISION= 2 PLUGIN_COMMENT= Group and user ACL for the web proxy +PLUGIN_OBSOLETE= No changes since 2018 PLUGIN_MAINTAINER= kekek2@ya.ru PLUGIN_WWW= https://smart-soft.ru From ffcd201992021eceebd232ebeb1b73611126321f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 May 2022 09:59:20 +0200 Subject: [PATCH 1030/3088] Framework: mark obsolete plugins in list --- Makefile | 3 ++- README.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 76fc96735e..d01440b965 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,8 @@ PLUGIN_DIRS+= ${_${CATEGORY}} list: .for PLUGIN_DIR in ${PLUGIN_DIRS} @echo ${PLUGIN_DIR} -- $$(${MAKE} -C ${PLUGIN_DIR} -v PLUGIN_COMMENT) \ - $$(if [ -n "$$(${MAKE} -C ${PLUGIN_DIR} -v PLUGIN_DEVEL _PLUGIN_DEVEL=)" ]; then echo "(development only)"; fi) + $$(if [ -n "$$(${MAKE} -C ${PLUGIN_DIR} -v PLUGIN_DEVEL _PLUGIN_DEVEL=)" ]; then echo "(development only)"; fi) \ + $$(if [ -n "$$(${MAKE} -C ${PLUGIN_DIR} -v PLUGIN_OBSOLETE)" ]; then echo "(pending removal)"; fi) .endfor # shared targets that are sane to run from the root directory diff --git a/README.md b/README.md index 095e89d2f5..09a0db513b 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ security/tinc -- Tinc VPN security/tor -- The Onion Router sysutils/api-backup -- Provide the functionality to download the config.xml sysutils/apuled -- PC Engine APU LED control (development only) -sysutils/boot-delay -- Apply a persistent 10 second boot delay +sysutils/boot-delay -- Apply a persistent 10 second boot delay (pending removal) sysutils/dmidecode -- Display hardware information on the dashboard sysutils/git-backup -- Track config changes using git sysutils/hw-probe -- Collect hardware diagnostics @@ -112,7 +112,7 @@ www/c-icap -- c-icap connects the web proxy with a virus scanner www/cache -- Webserver cache www/nginx -- Nginx HTTP server and reverse proxy www/web-proxy-sso -- Kerberos authentication module -www/web-proxy-useracl -- Group and user ACL for the web proxy +www/web-proxy-useracl -- Group and user ACL for the web proxy (pending removal) ``` A brief description of how to use the plugins repository From ce4469f458926917af4bb3cb40c254f1d6425d84 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Tue, 10 May 2022 11:59:42 +0200 Subject: [PATCH 1031/3088] new plugin: security/crowdsec (#2945) This is a plugin we developed to provide configuration and a basic UI for the crowdsec IDS and IPS. It depends on a couple of binaries recently added to ports.conf Adding machines (servers, other firewalls) and advanced configuration are not managed by the UI but available from the command line. --- security/crowdsec/+POST_DEINSTALL.post | 50 ++ security/crowdsec/+POST_INSTALL.post | 11 + security/crowdsec/+PRE_DEINSTALL.pre | 8 + security/crowdsec/LICENSE | 21 + security/crowdsec/Makefile | 10 + security/crowdsec/pkg-descr | 49 ++ .../crowdsec/src/etc/cron.d/oscrowdsec.cron | 9 + .../src/etc/crowdsec/acquis.d/opnsense.yaml | 15 + .../src/etc/inc/plugins.inc.d/crowdsec.inc | 95 ++++ security/crowdsec/src/etc/rc.d/oscrowdsec | 104 +++++ .../src/etc/rc.syshook.d/start/50-crowdsec | 6 + .../CrowdSec/Api/AlertsController.php | 33 ++ .../CrowdSec/Api/BouncersController.php | 33 ++ .../CrowdSec/Api/CollectionsController.php | 33 ++ .../CrowdSec/Api/DecisionsController.php | 53 +++ .../CrowdSec/Api/GeneralController.php | 17 + .../CrowdSec/Api/MachinesController.php | 33 ++ .../CrowdSec/Api/ParsersController.php | 33 ++ .../CrowdSec/Api/PostoverflowsController.php | 33 ++ .../CrowdSec/Api/ScenariosController.php | 33 ++ .../CrowdSec/Api/ServiceController.php | 78 ++++ .../CrowdSec/Api/VersionController.php | 28 ++ .../OPNsense/CrowdSec/GeneralController.php | 19 + .../OPNsense/CrowdSec/OverviewController.php | 18 + .../OPNsense/CrowdSec/forms/general.xml | 95 ++++ .../app/models/OPNsense/CrowdSec/ACL/ACL.xml | 9 + .../app/models/OPNsense/CrowdSec/General.php | 12 + .../app/models/OPNsense/CrowdSec/General.xml | 56 +++ .../models/OPNsense/CrowdSec/Menu/Menu.xml | 8 + .../app/views/OPNsense/CrowdSec/general.volt | 142 ++++++ .../app/views/OPNsense/CrowdSec/overview.volt | 249 ++++++++++ .../scripts/OPNsense/CrowdSec/hub-upgrade.sh | 18 + .../scripts/OPNsense/CrowdSec/reconfigure.py | 94 ++++ .../scripts/OPNsense/CrowdSec/reconfigure.sh | 33 ++ .../conf/actions.d/actions_crowdsec.conf | 94 ++++ .../templates/OPNsense/CrowdSec/+TARGETS | 4 + .../OPNsense/CrowdSec/crowdsec.rc.conf.d | 11 + .../CrowdSec/crowdsec_firewall.rc.conf.d | 11 + .../OPNsense/CrowdSec/oscrowdsec.rc.conf.d | 1 + .../templates/OPNsense/CrowdSec/settings.json | 5 + .../src/opnsense/www/js/CrowdSec/crowdsec.js | 426 ++++++++++++++++++ 41 files changed, 2090 insertions(+) create mode 100755 security/crowdsec/+POST_DEINSTALL.post create mode 100755 security/crowdsec/+POST_INSTALL.post create mode 100755 security/crowdsec/+PRE_DEINSTALL.pre create mode 100644 security/crowdsec/LICENSE create mode 100644 security/crowdsec/Makefile create mode 100644 security/crowdsec/pkg-descr create mode 100644 security/crowdsec/src/etc/cron.d/oscrowdsec.cron create mode 100644 security/crowdsec/src/etc/crowdsec/acquis.d/opnsense.yaml create mode 100644 security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc create mode 100755 security/crowdsec/src/etc/rc.d/oscrowdsec create mode 100755 security/crowdsec/src/etc/rc.syshook.d/start/50-crowdsec create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/AlertsController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/BouncersController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/CollectionsController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/DecisionsController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/GeneralController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/MachinesController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ParsersController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/PostoverflowsController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ScenariosController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ServiceController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/VersionController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/GeneralController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/OverviewController.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/forms/general.xml create mode 100644 security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/ACL/ACL.xml create mode 100644 security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.php create mode 100644 security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.xml create mode 100644 security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/Menu/Menu.xml create mode 100644 security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt create mode 100644 security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/overview.volt create mode 100755 security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh create mode 100755 security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py create mode 100755 security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh create mode 100644 security/crowdsec/src/opnsense/service/conf/actions.d/actions_crowdsec.conf create mode 100644 security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/+TARGETS create mode 100644 security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec.rc.conf.d create mode 100644 security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec_firewall.rc.conf.d create mode 100644 security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/oscrowdsec.rc.conf.d create mode 100644 security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/settings.json create mode 100644 security/crowdsec/src/opnsense/www/js/CrowdSec/crowdsec.js diff --git a/security/crowdsec/+POST_DEINSTALL.post b/security/crowdsec/+POST_DEINSTALL.post new file mode 100755 index 0000000000..536a325294 --- /dev/null +++ b/security/crowdsec/+POST_DEINSTALL.post @@ -0,0 +1,50 @@ +#!/bin/sh + +# Removing the plugin from the web interface will autoremove the dependencies +# too, and here we have to delete the files in rc.conf.d (because they are +# generated from templates when the configuration is saved, and the package +# system did not keep track of them). + +# But.. If the plugin is removed from the command line (which does not happen +# outside of testing conditions), the crowdsec and bouncer services will not be +# removed. However, since we deleted the files that enabled these services, +# they will be disabled at the next reboot. + +rm -f /etc/rc.conf.d/crowdsec \ + /etc/rc.conf.d/crowdsec_firewall \ + /etc/rc.conf.d/oscrowdsec + + +# Remove aliases and with them, the rules. We don't have plugin files +# anymore so we do that on the fly. + +/usr/local/bin/php <<'EOT' +aliases->alias->iterateItems() as $index => $alias) { + if (strval($alias->name) == $name) { + if ($model->aliases->alias->del($index)) { + $model->serializeToConfig(); + Config::getInstance()->save(); + } + } + } +} + +removeAlias('crowdsec_blacklists'); +removeAlias('crowdsec6_blacklists'); +EOT + + +# apply the configuration changes to the packet filter +configctl filter reload diff --git a/security/crowdsec/+POST_INSTALL.post b/security/crowdsec/+POST_INSTALL.post new file mode 100755 index 0000000000..6a64974496 --- /dev/null +++ b/security/crowdsec/+POST_INSTALL.post @@ -0,0 +1,11 @@ +#!/bin/sh + +# the configuration file used in reconfigure (i.e. settings.json) may eventually +# have credentials, so we create a directory to contain it -- the directory +# permissions will be copied to the file while generating the jinja template. + +# shellcheck disable=SC2174 +mkdir -p -m 0700 /usr/local/etc/crowdsec/opnsense + +configctl crowdsec reconfigure + diff --git a/security/crowdsec/+PRE_DEINSTALL.pre b/security/crowdsec/+PRE_DEINSTALL.pre new file mode 100755 index 0000000000..9f7107ef01 --- /dev/null +++ b/security/crowdsec/+PRE_DEINSTALL.pre @@ -0,0 +1,8 @@ +#!/bin/sh + +# need to temporarily stop the bouncer to remove all the rules +service crowdsec_firewall stop >/dev/null 2>&1 | : + +# the rest of the cleanup is done in the post-deinstall script, otherwise +# the plugin recreates the objects during "filter reload". + diff --git a/security/crowdsec/LICENSE b/security/crowdsec/LICENSE new file mode 100644 index 0000000000..92d86fc27c --- /dev/null +++ b/security/crowdsec/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2021 Crowdsec + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/security/crowdsec/Makefile b/security/crowdsec/Makefile new file mode 100644 index 0000000000..fb0653f197 --- /dev/null +++ b/security/crowdsec/Makefile @@ -0,0 +1,10 @@ +PLUGIN_NAME= crowdsec +PLUGIN_VERSION= 0.2 +PLUGIN_DEVEL= yes +#PLUGIN_REVISION= 1 +PLUGIN_DEPENDS= crowdsec +PLUGIN_COMMENT= Lightweight and collaborative security engine +PLUGIN_MAINTAINER= marco@crowdsec.net +PLUGIN_WWW= https://crowdsec.net/ + +.include "../../Mk/plugins.mk" diff --git a/security/crowdsec/pkg-descr b/security/crowdsec/pkg-descr new file mode 100644 index 0000000000..2cd4f07c10 --- /dev/null +++ b/security/crowdsec/pkg-descr @@ -0,0 +1,49 @@ +Crowdsec is an open-source, lightweight software, detecting peers with +aggressive behaviors to prevent them from accessing your systems. Its user +friendly design and assistance offers a low technical barrier of entry and +nevertheless a high security gain. + +WWW: https://crowdsec.net/ + +Plugin Changelog +================ + +0.2 + +* first published release +* added options `lapi_enabled`, `crowdsec_firewall_verbose` +* removed options `crowdsec_flags`, `crowdsec_firewall_flags` +* changed default for `agent_enabled`, `firewall_bouncer_enabled` to 1 + +0.1 + +* fixed packet tags with ipv6 +* custom `crowdsec_flags`, `crosdsec_firewall_flags` + +0.0.9 + +* fixed the javascript, 0.0.8 had a syntax error +* new option: rules_tag +* new option: lapi_manual_configuration +* ipv4/ipv6 validation with regexp + +0.0.8 + +* crowdsec update 1.3.2 +* configurable `rules_log` and LAPI address/port + +0.0.7 + +* automated removal of Alias objects when the plugin is uninstalled + +0.0.6 + +* crowdsec update 1.3.1.r1 +* bouncer update to 0.0.23.r1 +* automated creation of Alias and Rule objects + +0.0.5 + +* fixed an issue that prevented the bouncer from banning IPs on opnsense +* fixed support for notification plugins + diff --git a/security/crowdsec/src/etc/cron.d/oscrowdsec.cron b/security/crowdsec/src/etc/cron.d/oscrowdsec.cron new file mode 100644 index 0000000000..2ec072c402 --- /dev/null +++ b/security/crowdsec/src/etc/cron.d/oscrowdsec.cron @@ -0,0 +1,9 @@ +# DO NOT EDIT THIS FILE -- OPNsense auto-generated file +# +# User-defined crontab files can be loaded via /etc/cron.d +# or /usr/local/etc/cron.d and follow the same format as +# /etc/crontab, see the crontab(5) manual page. +SHELL=/bin/sh +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin +#minute hour mday month wday who command +0 1,13 * * * root /usr/local/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh diff --git a/security/crowdsec/src/etc/crowdsec/acquis.d/opnsense.yaml b/security/crowdsec/src/etc/crowdsec/acquis.d/opnsense.yaml new file mode 100644 index 0000000000..905be22566 --- /dev/null +++ b/security/crowdsec/src/etc/crowdsec/acquis.d/opnsense.yaml @@ -0,0 +1,15 @@ +# +# Before 22.1, OPNsense used circular logs under /var/log/*.log that +# can still be around. They are old, in binary format and are not needed by crowdsec. +# +# For this reason we don't scan /var/log/*.log, but some plugins can write +# their (plaintext) logs in that location, in such case add their pathnames too. +# + +filenames: + # ssh + - /var/log/audit/*.log + # web admin + - /var/log/lighttpd/*.log +labels: + type: syslog diff --git a/security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc b/security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc new file mode 100644 index 0000000000..a1e2eb6b07 --- /dev/null +++ b/security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc @@ -0,0 +1,95 @@ + + +use OPNsense\Core\Config; +use OPNsense\Firewall\Alias; +use OPNsense\Firewall\Plugin; + +function add_alias_if_not_exist($name, $description, $proto) { + $model = new Alias(); + + if ($model->getByName($name) != null) { + return; + } + + $new_alias = $model->aliases->alias->Add(); + $new_alias->name = $name; + $new_alias->description = $description; + $new_alias->proto = $proto; + $new_alias->type = 'external'; + $model->serializeToConfig(); + Config::getInstance()->save(); +} + +function crowdsec_firewall(Plugin $fw) +{ + global $config; + + $general = $config['OPNsense']['crowdsec']['general']; + + $bouncer_enabled = isset($general['firewall_bouncer_enabled']) && $general['firewall_bouncer_enabled']; + + if (!$bouncer_enabled) { + return; + } + + $rules_log_enabled = isset($general['rules_log']) && $general['rules_log']; + + $rules_tag = ""; + if (isset($general['rules_tag'])) { + $rules_tag = $general['rules_tag']; + }; + + add_alias_if_not_exist('crowdsec_blacklists', 'CrowdSec (IPv4)', 'IPv4'); + + // https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php + + $fw->registerFilterRule( + 1, /* priority */ + array( + 'ipprotocol' => 'inet', + 'descr' => 'CrowdSec (IPv4)', + 'from' => '$crowdsec_blacklists', # $ to reference an alias + 'type' => 'block', + 'log' => $rules_log_enabled, + 'tag' => $rules_tag, + 'label' => 'blocked by crowdsec', + 'quick' => true + ), + null + ); + + add_alias_if_not_exist('crowdsec6_blacklists', 'CrowdSec (IPv6)', 'IPv6'); + + $fw->registerFilterRule( + 1, /* priority */ + array( + 'ipprotocol' => 'inet6', + 'descr' => 'CrowdSec (IPv6)', + 'from' => '$crowdsec6_blacklists', # $ to reference an alias + 'type' => 'block', + 'log' => $rules_log_enabled, + 'tag' => $rules_tag, + 'label' => 'blocked by crowdsec', + 'quick' => true + ), + null + ); +} + +function crowdsec_services() +{ + $services[] = array( + 'description' => 'CrowdSec', + 'configd' => array( + 'restart' => array('crowdsec restart'), + 'start' => array('crowdsec start'), + 'stop' => array('crowdsec stop'), + ), + 'name' => 'crowdsec' + ); + + return $services; +} diff --git a/security/crowdsec/src/etc/rc.d/oscrowdsec b/security/crowdsec/src/etc/rc.d/oscrowdsec new file mode 100755 index 0000000000..a64dc0d38b --- /dev/null +++ b/security/crowdsec/src/etc/rc.d/oscrowdsec @@ -0,0 +1,104 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: oscrowdsec +# REQUIRE: NETWORKING syslogd +# BEFORE: DAEMON +# KEYWORD: shutdown + +. /etc/rc.subr + +name="oscrowdsec" +rcvar="oscrowdsec_enable" + +load_rc_config $name + +: ${oscrowdsec_enable="NO"} + + +oscrowdsec_start () { + # + # Start, or stop the services according to the plugin's configuration. + # When starting -> error if the services are already running + # When stopping -> no error + # + + if service crowdsec enabled; then + service crowdsec start + else + service crowdsec stop || : + fi + + if service crowdsec_firewall enabled; then + service crowdsec_firewall start + else + service crowdsec_firewall stop || : + fi + +# XXX should complain if they were not stopped? +# service crowdsec status +# if [ $? -eq 0 ]; then +# debug "oscrowdsec_start: crowdsec is still running" +# return 0 +# fi +} + +oscrowdsec_stop () { + # Always stop the services, enabled or not, running or not. No errors. + + service crowdsec stop || : + service crowdsec_firewall stop || : + + # XXX should complain if they were running and have not been stopped? +} + +oscrowdsec_restart () { + oscrowdsec_stop || : + oscrowdsec_start +} + +oscrowdsec_status () { + # return error if at least one program is not running + ret=0 + + if service crowdsec status; then + ret=$? + fi + + if service crowdsec_firewall status; then + if [ $ret -eq 0 ]; then + ret=$? + fi + fi + return $ret +} + +oscrowdsec_reload () { + # Here we take it easy. the bouncer does not even support reload + oscrowdsec_restart +} + +case $1 in + start) + oscrowdsec_start + exit $? + ;; + stop) + oscrowdsec_stop + exit $? + ;; + restart) + oscrowdsec_restart + exit $? + ;; + status) + oscrowdsec_status + exit $? + ;; + reload) + oscrowdsec_reload + exit $? + ;; +esac diff --git a/security/crowdsec/src/etc/rc.syshook.d/start/50-crowdsec b/security/crowdsec/src/etc/rc.syshook.d/start/50-crowdsec new file mode 100755 index 0000000000..58359695ff --- /dev/null +++ b/security/crowdsec/src/etc/rc.syshook.d/start/50-crowdsec @@ -0,0 +1,6 @@ +#!/bin/sh + +# https://docs.opnsense.org/development/backend/autorun.html + +/usr/local/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh + diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/AlertsController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/AlertsController.php new file mode 100644 index 0000000000..6aff27e81e --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/AlertsController.php @@ -0,0 +1,33 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class AlertsController extends ApiControllerBase +{ + /** + * retrieve list of alerts + * @return array of alerts + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + $bckresult = json_decode(trim($backend->configdRun("crowdsec alerts-list")), true); + if ($bckresult !== null) { + // only return valid json type responses + return $bckresult; + } + return array("message" => "unable to list alerts"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/BouncersController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/BouncersController.php new file mode 100644 index 0000000000..94de1a8772 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/BouncersController.php @@ -0,0 +1,33 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class BouncersController extends ApiControllerBase +{ + /** + * retrieve list of bouncers + * @return array of bouncers + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + $bckresult = json_decode(trim($backend->configdRun("crowdsec bouncers-list")), true); + if ($bckresult !== null) { + // only return valid json type responses + return $bckresult; + } + return array("message" => "unable to list bouncers"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/CollectionsController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/CollectionsController.php new file mode 100644 index 0000000000..62c63afa6b --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/CollectionsController.php @@ -0,0 +1,33 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class CollectionsController extends ApiControllerBase +{ + /** + * retrieve list of collections + * @return array of collections + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + $bckresult = json_decode(trim($backend->configdRun("crowdsec collections-list")), true); + if ($bckresult !== null) { + // only return valid json type responses + return $bckresult; + } + return array("message" => "unable to list collections"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/DecisionsController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/DecisionsController.php new file mode 100644 index 0000000000..7421e74e4b --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/DecisionsController.php @@ -0,0 +1,53 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class DecisionsController extends ApiControllerBase +{ + /** + * retrieve list of decisions + * @return array of decisions + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + $bckresult = json_decode(trim($backend->configdRun("crowdsec decisions-list")), true); + if ($bckresult !== null) { + // only return valid json type responses + return $bckresult; + } + return array("message" => "unable to list decisions"); + } + + public function deleteAction($decision_id) + { + if ($this->request->isDelete()) { + $backend = new Backend(); + $bckresult = $backend->configdRun("crowdsec decisions-delete ${decision_id}"); + if ($bckresult !== null) { + // why does the action return \n\n for empty output? + if (trim($bckresult) === '') { + return array("message" => "OK"); + } + // TODO handle error + return array("message" => $bckresult); + } + return array("message" => "OK"); + } else { + $this->response->setStatusCode(405, "Method Not Allowed"); + $this->response->setHeader("Allow", "DELETE"); + } + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/GeneralController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/GeneralController.php new file mode 100644 index 0000000000..038e491818 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/GeneralController.php @@ -0,0 +1,17 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +/** + * @package OPNsense\CrowdSec + */ +class GeneralController extends ApiMutableModelControllerBase +{ + protected static $internalModelName = 'general'; + protected static $internalModelClass = '\OPNsense\CrowdSec\General'; +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/MachinesController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/MachinesController.php new file mode 100644 index 0000000000..617e43bf41 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/MachinesController.php @@ -0,0 +1,33 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class MachinesController extends ApiControllerBase +{ + /** + * retrieve list of registered machines + * @return array of machines + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + $bckresult = json_decode(trim($backend->configdRun("crowdsec machines-list")), true); + if ($bckresult !== null) { + // only return valid json type responses + return $bckresult; + } + return array("message" => "unable to list machines"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ParsersController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ParsersController.php new file mode 100644 index 0000000000..6dfcfcdb80 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ParsersController.php @@ -0,0 +1,33 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class ParsersController extends ApiControllerBase +{ + /** + * retrieve list of registered parsers + * @return array of parsers + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + $bckresult = json_decode(trim($backend->configdRun("crowdsec parsers-list")), true); + if ($bckresult !== null) { + // only return valid json type responses + return $bckresult; + } + return array("message" => "unable to list parsers"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/PostoverflowsController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/PostoverflowsController.php new file mode 100644 index 0000000000..a52fc928c0 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/PostoverflowsController.php @@ -0,0 +1,33 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class PostoverflowsController extends ApiControllerBase +{ + /** + * retrieve list of registered postoverflows + * @return array of postoverflows + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + $bckresult = json_decode(trim($backend->configdRun("crowdsec postoverflows-list")), true); + if ($bckresult !== null) { + // only return valid json type responses + return $bckresult; + } + return array("message" => "unable to list postoverflows"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ScenariosController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ScenariosController.php new file mode 100644 index 0000000000..5daa6b82b0 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ScenariosController.php @@ -0,0 +1,33 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class ScenariosController extends ApiControllerBase +{ + /** + * retrieve list of registered scenarios + * @return array of scenarios + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + $bckresult = json_decode(trim($backend->configdRun("crowdsec scenarios-list")), true); + if ($bckresult !== null) { + // only return valid json type responses + return $bckresult; + } + return array("message" => "unable to list scenarios"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ServiceController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ServiceController.php new file mode 100644 index 0000000000..dae2711c78 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/ServiceController.php @@ -0,0 +1,78 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\Core\Backend; + +/** + * Class ServiceController + * @package OPNsense\CrowdSec + */ +class ServiceController extends ApiControllerBase +{ + /** + * reconfigure CrowdSec + */ + public function reloadAction() + { + $status = "failed"; + if ($this->request->isPost()) { + $backend = new Backend(); + $bckresult = trim($backend->configdRun('template reload OPNsense/CrowdSec')); + if ($bckresult == "OK") { + $bckresult = trim($backend->configdRun('crowdsec reconfigure')); + if ($bckresult == "OK") { + $status = "ok"; + } + } + } + return array("status" => $status); + } + + /** + * retrieve status of crowdsec + * @return array + * @throws \Exception + */ + public function statusAction() + { + $backend = new Backend(); + $response = $backend->configdRun("crowdsec crowdsec-status"); + + $status = "unkown"; + if (strpos($response, "not running") > 0) { + $status = "stopped"; + } elseif (strpos($response, "is running") > 0) { + $status = "running"; + } + + $response = $backend->configdRun("crowdsec crowdsec-firewall-status"); + + $firewall_status = "unknown"; + if (strpos($response, "not running") > 0) { + $firewall_status = "stopped"; + } elseif (strpos($response, "is running") > 0) { + $firewall_status = "running"; + } + + return array( + "crowdsec-status" => $status, + "crowdsec-firewall-status" => $firewall_status, + ); + } + + /** + * return debug information + * @return array + */ + public function debugAction() + { + $backend = new Backend(); + $response = $backend->configdRun("crowdsec debug"); + return array("message" => $response); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/VersionController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/VersionController.php new file mode 100644 index 0000000000..d236c26f87 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/Api/VersionController.php @@ -0,0 +1,28 @@ + + +namespace OPNsense\CrowdSec\Api; + +use OPNsense\Base\ApiControllerBase; +use OPNsense\CrowdSec\CrowdSec; +use OPNsense\Core\Backend; + +/** + * @package OPNsense\CrowdSec + */ +class VersionController extends ApiControllerBase +{ + /** + * retrieve version description + * @return version description + * @throws \OPNsense\Base\ModelException + * @throws \ReflectionException + */ + public function getAction() + { + $backend = new Backend(); + return $backend->configdRun("crowdsec version"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/GeneralController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/GeneralController.php new file mode 100644 index 0000000000..115ca686cb --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/GeneralController.php @@ -0,0 +1,19 @@ + + +namespace OPNsense\CrowdSec; + +/** + * Class GeneralController + * @package OPNsense\CrowdSec + */ +class GeneralController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->pick('OPNsense/CrowdSec/general'); + $this->view->generalForm = $this->getForm("general"); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/OverviewController.php b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/OverviewController.php new file mode 100644 index 0000000000..6dbd461d52 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/OverviewController.php @@ -0,0 +1,18 @@ + + +namespace OPNsense\CrowdSec; + +/** + * Class OverviewController + * @package OPNsense\CrowdSec + */ +class OverviewController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->pick('OPNsense/CrowdSec/overview'); + } +} diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/forms/general.xml b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/forms/general.xml new file mode 100644 index 0000000000..596c3b3e92 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/forms/general.xml @@ -0,0 +1,95 @@ +
    + + + + general.agent_enabled + + checkbox + Enable/disable the CrowdSec agent. Keep this enabled to detect + attacks and receive alerts from the CrowSec central service. + + + + + general.lapi_enabled + + checkbox + Enable/disable the CrowdSec Local API. Keep this enabled unless you + connect to a LAPI on another machine + + + + + general.firewall_bouncer_enabled + + checkbox + Enable/disable the firewall bouncer. Keep this enabled to block + packets from the attacking IP addresses. + + + + + general.lapi_manual_configuration + + checkbox + Avoid overwriting LAPI settings for config.yaml, + local_api_credentials.yaml, crowdsec-firewall-bouncer.yaml. The next + two configuration options (lapi_listen_address, lapi_listen_port) will + be ignored. Allows unsupported configurations like linking together + multiple opnsense instances or connecting to an existing crowdsec + multi-server setup. + + + + + general.lapi_listen_address + + text + Where to listen for LAPI connections: IP address. The default value + is 127.0.0.1. You can change it to a LAN address to connect from other + agents/machines and bouncers. + + This is written in /usr/local/etc/crowdsec/config.yaml, + local_api_credentials.yaml and bouncers/crowdsec-firewall-bouncer.yaml. + To enable TLS, add the certificate information to config.yaml and change + http to https in the other two files. Comments in YAML will not be + preserved. + + + + + general.lapi_listen_port + + text + Where to listen for LAPI connections: port. The default value is + 8080, but you can change it to avoid conflicts with existing + services. + + + + + general.rules_log + + checkbox + Enable log collection for CrowdSec's block rules. + + + + + general.rules_tag + + text + Add a tag to packets that are dropped by CrowdSec rules for + diagnostic purposes. + + + + + general.crowdsec_firewall_verbose + + checkbox + Verbose /var/log/crowdsec/crowdsec-firewall-bouncer.log. Enable this + for debugging. + + + diff --git a/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/ACL/ACL.xml b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/ACL/ACL.xml new file mode 100644 index 0000000000..54840d23f9 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + CrowdSec + + ui/crowdsec/* + api/crowdsec/* + + + diff --git a/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.php b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.php new file mode 100644 index 0000000000..3307e8ba60 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.php @@ -0,0 +1,12 @@ + + +namespace OPNsense\CrowdSec; + +use OPNsense\Base\BaseModel; + +class General extends BaseModel +{ +} diff --git a/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.xml b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.xml new file mode 100644 index 0000000000..16d3b3632d --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.xml @@ -0,0 +1,56 @@ + + //OPNsense/crowdsec/general + CrowdSec general configuration + 0.2 + + + + 1 + Y + + + + 1 + Y + + + + 1 + Y + + + + 0 + Y + + + + 127.0.0.1 + Y + ((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$)) + + + + 8080 + Y + N + N + + + + 0 + Y + + + + + N + + + + 0 + Y + + + + diff --git a/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/Menu/Menu.xml b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/Menu/Menu.xml new file mode 100644 index 0000000000..c50b8cd43d --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/Menu/Menu.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt new file mode 100644 index 0000000000..e6753a4bf3 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt @@ -0,0 +1,142 @@ +{# SPDX-License-Identifier: MIT #} +{# SPDX-FileCopyrightText: © 2021 CrowdSec #} + + + + + + + + +
    +
    +

    This plugin installs a CrowdSec agent/LAPI + node, and a Firewall Bouncer.

    + +

    Out of the box, by enabling them in the "Settings" tab, they can protect the OPNsense server + by receiving thousands of IP addresses of active attackers, which are immediately banned at the + firewall level. In addition, the logs of the ssh service and OPNsense administration interface are + analyzed for possible brute-force attacks; any such scenario triggers a ban and is reported to the + CrowdSec Central API + (meaning timestamp, scenario, attacking IP).

    + +

    Other attack behaviors can be recognized on the OPNsense server and its plugins, or + any other agent + connected to the same LAPI node. Other types of remediation are possible (ex. captcha test for scraping attempts).

    + +

    Please refer to the tutorials to explore + the possibilities.

    + +

    A few remarks:

    + +
      +
    • + If your OPNsense is <22.1, you must check "Disable circular logs" in the Settings menu for the + ssh and web-auth parsers to work. If you upgrade to 22.1, it will be done automatically. + See acquis.d/opnsense.yaml +
    • +
    • + At the moment, the CrowdSec package for OPNsense is fully functional on the + command line but its web interface is limited; you can only list the installed objects and revoke + decisions. For anything else + you need the shell. +
    • +
    • + Do not enable/start the agent and bouncer services with sysrc or /etc/rc.conf + like you would on vanilla freebsd, the plugin takes care of that. +
    • +
    • + The parsers, scenarios and all objects from the CrowdSec Hub + are periodically upgraded. The + crowdsecurity/freebsd and + crowdsecurity/opnsense + collections are installed by default. +
    • +
    + + + + +
    + +
    + +
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_GeneralSettings'])}} +
    + +
    + +
    +
    +
    + diff --git a/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/overview.volt b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/overview.volt new file mode 100644 index 0000000000..87987c30a5 --- /dev/null +++ b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/overview.volt @@ -0,0 +1,249 @@ +{# SPDX-License-Identifier: MIT #} +{# SPDX-FileCopyrightText: © 2021 CrowdSec #} + + + + + + + + +
    + Service status: crowdsec ... - firewall bouncer ... +
    + + + +
    + +
    +
    + +
    {{ lang._('Enabled') }} {{ lang._('Service') }} {{ lang._('Username') }}{{ lang._('Interface') }} {{ lang._('Description') }} {{ lang._('Commands') }}
    {{ lang._('ID') }} {{ lang._('Enabled') }} {{ lang._('Service') }}{{ lang._('Hostnames') }} {{ lang._('Username') }} {{ lang._('Interface') }} {{ lang._('Description') }}
    {{ lang._('ASBR') }}<%= checkmark(asbrRouter == "injectingExternalRoutingInformation") %><%= checkmark(typeof asbrRouter != 'undefined' && asbrRouter == "injectingExternalRoutingInformation") %>
    {{ lang._('Router ID') }}{{ lang._('Enabled') }} {{ lang._('Name') }} {{ lang._('Type') }}{{ lang._('Adress') }}{{ lang._('Port') }} {{ lang._('ID') }} {{ lang._('Edit') }} | {{ lang._('Delete') }}
    + + + + + + + + + + + + + + + +
    NameIP AddressLast UpdateValidated?Version
    +
    + +
    + + + + + + + + + + + + + + + + + +
    NameIP AddressValidLast API PullTypeVersion
    +
    + +
    + + + + + + + + + + + + + + + +
    NameStatusVersionLocal Path
    +
    + +
    + + + + + + + + + + + + + + + + +
    NameStatusVersionPathDescription
    +
    + +
    + + + + + + + + + + + + + + + + +
    NameStatusVersionLocal PathDescription
    +
    + +
    + + + + + + + + + + + + + + + + +
    NameStatusVersionLocal PathDescription
    +
    + +
    + + + + + + + + + + + + + + + + + + +
    IDValueReasonCountryASDecisionsCreated At
    +
    + +
    + Note: the decisions coming from the CAPI (signals collected by the CrowdSec users) do not appear here. + To show them, use cscli decisions list -a in a shell. + + + + + + + + + + + + + + + + + + + + + + +
    IDSourceScope:ValueReasonActionCountryASEventsExpirationAlert ID
    +
    + +
    +
    +        
    +
    + + + + +
    diff --git a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh new file mode 100755 index 0000000000..1c00e7a1bd --- /dev/null +++ b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ ! -e "/usr/local/etc/crowdsec/collections/opnsense.yaml" ]; then + /usr/local/bin/cscli --error collections install crowdsecurity/opnsense +fi + +/usr/local/bin/cscli --error hub update \ + && /usr/local/bin/cscli --error hub upgrade + +if service crowdsec enabled; then + # have to check status explicitly because "restart" can set $? = 0 even when failing + if ! service crowdsec status >/dev/null 2>&1; then + service crowdsec start >/dev/null 2>&1 || : + else + service crowdsec restart >/dev/null 2>&1 || : + fi +fi + diff --git a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py new file mode 100755 index 0000000000..6f012249b4 --- /dev/null +++ b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 + +import logging +import json +import urllib.parse +import yaml + +logging.basicConfig(level=logging.INFO) + + +def load_config(filename): + with open(filename) as fin: + return yaml.safe_load(fin) + + +# only save if some value has changed +def save_config(filename, new_config): + old_config = load_config(filename) + if old_config != new_config: + with open(filename, 'w') as fout: + yaml.dump(new_config, fout) + + +def get_netloc(settings): + # defaults if config has not been saved yet + listen_address = settings.get('lapi_listen_address', '127.0.0.1') + listen_port = settings.get('lapi_listen_port', '8080') + return '{}:{}'.format(listen_address, listen_port) + + +def get_new_url(old_url, settings): + old_tuple = urllib.parse.urlsplit(old_url) + new_tuple = old_tuple._replace(netloc=get_netloc(settings)) + new_url = urllib.parse.urlunsplit(new_tuple) + # client lapi requires a trailing slash for the path part + # and no, query and fragment don't make much sense + if not new_tuple.query and not new_tuple.fragment and not new_url.endswith('/'): + new_url += '/' + return new_url + + +def configure_agent(settings): + config_path = '/usr/local/etc/crowdsec/config.yaml' + config = load_config(config_path) + + config['common']['log_dir'] = '/var/log/crowdsec' + config['crowdsec_service']['acquisition_dir'] = '/usr/local/etc/crowdsec/acquis.d/' + + if not int(settings.get('lapi_manual_configuration', '0')): + config['api']['server']['listen_uri'] = get_netloc(settings) + + save_config(config_path, config) + + +def configure_lapi_credentials(settings): + config_path = '/usr/local/etc/crowdsec/local_api_credentials.yaml' + config = load_config(config_path) + + if not int(settings.get('lapi_manual_configuration', '0')): + config['url'] = get_new_url(config['url'], settings) + + save_config(config_path, config) + + +def configure_bouncer(settings): + config_path = '/usr/local/etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml' + config = load_config(config_path) + + config['log_dir'] = '/var/log/crowdsec' + config['blacklists_ipv4'] = 'crowdsec_blacklists' + config['blacklists_ipv6'] = 'crowdsec6_blacklists' + config['pf'] = {'anchor_name': ''} + + if not int(settings.get('lapi_manual_configuration', '0')): + config['api_url'] = get_new_url(config['api_url'], settings) + + save_config(config_path, config) + + +def main(): + try: + with open('/usr/local/etc/crowdsec/opnsense/settings.json') as f: + settings = json.load(f) + except FileNotFoundError: + logging.info("settings.json not found, won't change crowdsec config") + return + + configure_agent(settings) + configure_lapi_credentials(settings) + configure_bouncer(settings) + + +if __name__ == '__main__': + main() diff --git a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh new file mode 100755 index 0000000000..c6d0c2c2c5 --- /dev/null +++ b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# This script is run +# - when the plugin is installed (by +POST_INSTALL.post) +# - when saving the "settings" form (which calls /api/crowdsec/service/reload) +# - by hand, running "configctl crowdsec reconfigure" + +set -e + +# apply configuration options specific to opnsense +/usr/local/opnsense/scripts/OPNsense/CrowdSec/reconfigure.py + +# enable pf anchor here - the tables and rules will be created by the bouncer +/usr/local/sbin/configctl filter reload >/dev/null + +# the hub is upgraded by cron too +/usr/local/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh + +# crowdsec was already restarted by hub-upgrade.sh +if service crowdsec_firewall enabled; then + # have to check status explicitly because "restart" can set $? = 0 even when failing + if ! service crowdsec_firewall status >/dev/null 2>&1; then + service crowdsec_firewall start >/dev/null 2>&1 || : + else + service crowdsec_firewall restart >/dev/null 2>&1 || : + fi +fi + +# left from v0.0.8 +rm -f /usr/local/etc/crowdsec/opnsense-settings.json + +echo "OK" + diff --git a/security/crowdsec/src/opnsense/service/conf/actions.d/actions_crowdsec.conf b/security/crowdsec/src/opnsense/service/conf/actions.d/actions_crowdsec.conf new file mode 100644 index 0000000000..e0e0f62932 --- /dev/null +++ b/security/crowdsec/src/opnsense/service/conf/actions.d/actions_crowdsec.conf @@ -0,0 +1,94 @@ + +# https://docs.opnsense.org/development/backend/configd.html + +[start] +command:/usr/local/etc/rc.d/oscrowdsec start +type: script +message: starting crowdsec services + +[stop] +command:/usr/local/etc/rc.d/oscrowdsec stop +type: script +message: stopping crowdsec services + +[status] +command:/usr/local/etc/rc.d/oscrowdsec status; exit 0 +type: script_output +message: oscrowdsec status + +[restart] +command:/usr/local/etc/rc.d/oscrowdsec restart +type: script +message: stopping crowdsec services + +[reload] +command:/usr/local/etc/rc.d/oscrowdsec reload +type: script +message: reload crowdsec configuration + +[crowdsec-status] +command:/usr/local/etc/rc.d/crowdsec status;exit 0 +type:script_output +message: request crowdsec status + +[crowdsec-firewall-status] +command:/usr/local/etc/rc.d/crowdsec_firewall status;exit 0 +type:script_output +message: request crowdsec_firewall status + +[alerts-list] +command:/usr/local/bin/cscli alerts list -l 0 -o json | sed 's/^null$/\[\]/' +type:script_output +message:crowdsec alerts list + +[bouncers-list] +command:/usr/local/bin/cscli bouncers list -o json | sed 's/^null$/\[\]/' +type:script_output +message:crowdsec bouncers list + +[collections-list] +command:/usr/local/bin/cscli collections list -o json +type:script_output +message:crowdsec collections list + +[decisions-list] +command:/usr/local/bin/cscli decisions list -l 0 -o json | sed 's/^null$/\[\]/' +type:script_output +message:crowdsec decisions list + +[decisions-delete] +command:/usr/local/bin/cscli --error decisions delete 2>&1 +parameters:--id %s +type:script_output +message:crowdsec decisions delete + +[machines-list] +command:/usr/local/bin/cscli machines list -o json | sed 's/^null$/\[\]/' +type:script_output +message:crowdsec machines list + +[parsers-list] +command:/usr/local/bin/cscli parsers list -o json +type:script_output +message:crowdsec parsers list + +[postoverflows-list] +command:/usr/local/bin/cscli postoverflows list -o json +type:script_output +message:crowdsec postoverflows list + +[scenarios-list] +command:/usr/local/bin/cscli scenarios list -o json +type:script_output +message:crowdsec scenarios list + +[version] +command:/usr/local/bin/cscli version 2>&1 +type:script_output +message:crowdsec version + +[reconfigure] +command:/usr/local/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh +type:script_output +message:crowdsec reconfigure + diff --git a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/+TARGETS b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/+TARGETS new file mode 100644 index 0000000000..c2ebc92240 --- /dev/null +++ b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/+TARGETS @@ -0,0 +1,4 @@ +oscrowdsec.rc.conf.d:/etc/rc.conf.d/oscrowdsec +crowdsec.rc.conf.d:/etc/rc.conf.d/crowdsec +crowdsec_firewall.rc.conf.d:/etc/rc.conf.d/crowdsec_firewall +settings.json:/usr/local/etc/crowdsec/opnsense/settings.json diff --git a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec.rc.conf.d b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec.rc.conf.d new file mode 100644 index 0000000000..77eebf92fa --- /dev/null +++ b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec.rc.conf.d @@ -0,0 +1,11 @@ +# DO NOT EDIT THIS FILE -- OPNsense auto-generated file +{% if helpers.exists('OPNsense.crowdsec.general.agent_enabled') and OPNsense.crowdsec.general.agent_enabled|default("1") == "1" %} +crowdsec_enable="YES" +{% else %} +crowdsec_enable="NO" +{% endif %} +{% if helpers.exists('OPNsense.crowdsec.general.lapi_enabled') and OPNsense.crowdsec.general.lapi_enabled|default("1") == "1" %} +crowdsec_flags="" +{% else %} +crowdsec_flags="-no-api" +{% endif %} diff --git a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec_firewall.rc.conf.d b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec_firewall.rc.conf.d new file mode 100644 index 0000000000..61bae583b4 --- /dev/null +++ b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/crowdsec_firewall.rc.conf.d @@ -0,0 +1,11 @@ +# DO NOT EDIT THIS FILE -- OPNsense auto-generated file +{% if helpers.exists('OPNsense.crowdsec.general.firewall_bouncer_enabled') and OPNsense.crowdsec.general.firewall_bouncer_enabled|default("1") == "1" %} +crowdsec_firewall_enable="YES" +{% else %} +crowdsec_firewall_enable="NO" +{% endif %} +{% if helpers.exists('OPNsense.crowdsec.general.crowdsec_firewall_verbose') and OPNsense.crowdsec.general.crowdsec_firewall_verbose|default("0") == "1" %} +crowdsec_firewall_flags="-v" +{% else %} +crowdsec_firewall_flags="" +{% endif %} diff --git a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/oscrowdsec.rc.conf.d b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/oscrowdsec.rc.conf.d new file mode 100644 index 0000000000..dd3cec08ea --- /dev/null +++ b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/oscrowdsec.rc.conf.d @@ -0,0 +1 @@ +oscrowdsec_enable="YES" diff --git a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/settings.json b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/settings.json new file mode 100644 index 0000000000..0c3ed00b09 --- /dev/null +++ b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/settings.json @@ -0,0 +1,5 @@ +{% if helpers.exists('OPNsense.crowdsec.general') -%} + {{ OPNsense.crowdsec.general | tojson }} +{%- endif %} + + diff --git a/security/crowdsec/src/opnsense/www/js/CrowdSec/crowdsec.js b/security/crowdsec/src/opnsense/www/js/CrowdSec/crowdsec.js new file mode 100644 index 0000000000..39eaacd43b --- /dev/null +++ b/security/crowdsec/src/opnsense/www/js/CrowdSec/crowdsec.js @@ -0,0 +1,426 @@ +/*global moment, $ */ +/*exported CrowdSec */ +/*eslint no-undef: "error"*/ +/*eslint semi: "error"*/ + +var CrowdSec = (function() { + 'use strict'; + + var _refresh_template = ''; + + var _dataFormatters = { + yesno: function(column, row) { + return _yesno2html(row[column.id]); + }, + + delete: function(column, row) { + var val = row.id; + if (isNaN(val)) { + return ''; + } + return ''; + }, + + duration: function(column, row) { + var duration = row[column.id]; + if (!duration) { + return 'n/a'; + } + return $('
    ').attr({ + 'data-toggle': 'tooltip', + 'data-placement': 'left', + 'title': duration + }).text(_humanizeDuration(duration)).prop('outerHTML'); + }, + + datetime: function(column, row) { + var dt = row[column.id]; + var parsed = moment(dt); + if (!dt) { + return ''; + } + if (!parsed.isValid()) { + console.error("Cannot parse timestamp: %s", dt); + return '???'; + } + return $('
    ').attr({ + 'data-toggle': 'tooltip', + 'data-placement': 'left', + 'title': parsed.format() + }).text(_humanizeDate(dt)).prop('outerHTML'); + }, + }; + + function _parseDuration(duration) { + var re = /(-?)(?:(?:(\d+)h)?(\d+)m)?(\d+).\d+(m?)s/m; + var matches = duration.match(re); + var seconds = 0; + + if (!matches.length) { + throw new Error("Unable to parse the following duration: " + duration + "."); + } + if (typeof matches[2] !== "undefined") { + seconds += parseInt(matches[2], 10) * 3600; // hours + } + if (typeof matches[3] !== "undefined") { + seconds += parseInt(matches[3], 10) * 60; // minutes + } + if (typeof matches[4] !== "undefined") { + seconds += parseInt(matches[4], 10); // seconds + } + if ("m" === parseInt(matches[5], 10)) { + // units in milliseconds + seconds *= 0.001; + } + if ("-" === parseInt(matches[1], 10)) { + // negative + seconds = -seconds; + } + return seconds; + } + + function _updateFreshness(selector, timestamp) { + var $freshness = $(selector).find('.actionBar .freshness'); + if (timestamp) { + $freshness.data('refresh_timestamp', timestamp); + } else { + timestamp = $freshness.data('refresh_timestamp'); + } + var howlong_human = '???'; + if (timestamp) { + var howlong_ms = moment() - moment(timestamp); + howlong_human = moment.duration(howlong_ms).humanize(); + } + $freshness.text(howlong_human + ' ago'); + } + + function _addFreshness(selector) { + // this creates one timer per tab + var freshness_template = 'Last refresh: '; + $(selector).find('.actionBar').prepend(freshness_template); + setInterval(function() { + _updateFreshness(selector); + }, 5000); + } + + function _humanizeDate(text) { + return moment(text).fromNow(); + } + + function _humanizeDuration(text) { + return moment.duration(_parseDuration(text), 'seconds').humanize(); + } + + function _yesno2html(val) { + if (val) { + return ''; + } else { + return ''; + } + } + + function _decisionsByType(decisions) { + var dectypes = {}; + if (!decisions) { + return ''; + } + decisions.map(function(decision) { + // TODO ignore negative expiration? + dectypes[decision.type] = dectypes[decision.type] ? (dectypes[decision.type]+1) : 1; + }); + var ret = ''; + for (var type in dectypes) { + if (ret !== '') { + ret += ' '; + } + ret += (type + ':' + dectypes[type]); + } + return ret; + } + + function _initService() { + $.ajax({ + url: '/api/crowdsec/service/status', + cache: false + }).done(function(data) { + // TODO handle errors + var crowdsec_status = data['crowdsec-status']; + if (crowdsec_status === 'unknown') { + crowdsec_status = 'Unknown'; + } else { + crowdsec_status = _yesno2html(crowdsec_status === 'running'); + } + $('#crowdsec-status').html(crowdsec_status); + + var crowdsec_firewall_status = data['crowdsec-firewall-status']; + if (crowdsec_firewall_status === 'unknown') { + crowdsec_firewall_status = 'Unknown'; + } else { + crowdsec_firewall_status = _yesno2html(crowdsec_firewall_status === 'running'); + } + $('#crowdsec-firewall-status').html(crowdsec_firewall_status); + }); + } + + function _initDebug() { + $.ajax({ + url: '/api/crowdsec/service/debug', + cache: false + }).done(function(data) { + $('#debug pre').text(data.message); + }); + } + + function _initTab(selector, url, dataCallback) { + var $tab = $(selector); + if ($tab.find('table.bootgrid-table').length) { + return; + } + $tab.find('table'). + on("initialized.rs.jquery.bootgrid", function() { + $(_refresh_template).on('click', function() { + _refreshTab(selector, url, dataCallback); + }).insertBefore($tab.find('.actionBar .actions .dropdown:first')); + _addFreshness(selector); + _refreshTab(selector, url, dataCallback); + }). + bootgrid({ + caseSensitive: false, + formatters: _dataFormatters + }); + } + + function _refreshTab(selector, url, dataCallback) { + $.ajax({ + url: url, + cache: false + }).done(dataCallback); + _updateFreshness(selector, moment()); + } + + function _initMachines() { + var url = '/api/crowdsec/machines/get'; + var dataCallback = function(data) { + var rows = []; + data.map(function(row) { + rows.push({ + name: row.machineId, + ip_address: row.ipAddress || ' ', + last_update: row.updated_at || ' ', + validated: row.isValidated, + version: row.version || ' ' + }); + }); + $('#machines table').bootgrid('clear').bootgrid('append', rows); + }; + _initTab('#machines', url, dataCallback); + } + + function _initCollections() { + var url = '/api/crowdsec/collections/get'; + var dataCallback = function(data) { + var rows = []; + data.collections.map(function(row) { + rows.push({ + name: row.name, + status: row.status, + local_version: row.local_version || ' ', + local_path: row.local_path || ' ' + }); + }); + $('#collections table').bootgrid('clear').bootgrid('append', rows); + }; + _initTab('#collections', url, dataCallback); + } + + function _initScenarios() { + var url = '/api/crowdsec/scenarios/get'; + var dataCallback = function(data) { + var rows = []; + data.scenarios.map(function(row) { + rows.push({ + name: row.name, + status: row.status, + local_version: row.local_version || ' ', + local_path: row.local_path || ' ', + description: row.description || ' ' + }); + }); + $('#scenarios table').bootgrid('clear').bootgrid('append', rows); + }; + _initTab('#scenarios', url, dataCallback); + } + + function _initParsers() { + var url = '/api/crowdsec/parsers/get'; + var dataCallback = function(data) { + var rows = []; + data.parsers.map(function(row) { + rows.push({ + name: row.name, + status: row.status, + local_version: row.local_version || ' ', + local_path: row.local_path || ' ', + description: row.description || ' ' + }); + }); + $('#parsers table').bootgrid('clear').bootgrid('append', rows); + }; + _initTab('#parsers ', url, dataCallback); + } + + function _initPostoverflows() { + var url = '/api/crowdsec/postoverflows/get'; + var dataCallback = function(data) { + var rows = []; + data.postoverflows.map(function(row) { + rows.push({ + name: row.name, + status: row.status, + local_version: row.local_version || ' ', + local_path: row.local_path || ' ', + description: row.description || ' ' + }); + }); + $('#postoverflows table').bootgrid('clear').bootgrid('append', rows); + }; + _initTab('#postoverflows ', url, dataCallback); + } + + function _initBouncers() { + var url = '/api/crowdsec/bouncers/get'; + var dataCallback = function(data) { + var rows = []; + data.map(function(row) { + // TODO - remove || ' ' later, it was fixed for 1.3.3 + rows.push({ + name: row.name, + ip_address: row.ip_address || ' ', + valid: row.revoked ? false : true, + last_pull: row.last_pull, + type: row.type || ' ', + version: row.version || ' ' + }); + }); + $('#bouncers table').bootgrid('clear').bootgrid('append', rows); + }; + _initTab('#bouncers ', url, dataCallback); + } + + function _initAlerts() { + var url = '/api/crowdsec/alerts/get'; + var dataCallback = function(data) { + var rows = []; + data.map(function(row) { + rows.push({ + id: row.id, + value: row.source.scope + (row.source.value?(':'+row.source.value):''), + reason: row.scenario || ' ', + country: row.source.cn || ' ', + as: row.source.as_name || ' ', + decisions: _decisionsByType(row.decisions) || ' ', + created_at: row.created_at + }); + }); + $('#alerts table').bootgrid('clear').bootgrid('append', rows); + }; + _initTab('#alerts ', url, dataCallback); + } + + function _initDecisions() { + var url = '/api/crowdsec/decisions/get'; + var dataCallback = function(data) { + var rows = []; + data.map(function(row) { + row.decisions.map(function(decision) { + // ignore deleted decisions + if (decision.duration.startsWith('-')) { + return; + } + rows.push({ + // search will break on empty values when using .append(). so we use spaces + delete: '', + id: decision.id, + source: decision.origin || ' ', + scope_value: decision.scope + (decision.value?(':'+decision.value):''), + reason: decision.scenario || ' ', + action: decision.type || ' ', + country: row.source.cn || ' ', + as: row.source.as_name || ' ', + events_count: row.events_count, + // XXX pre-parse duration to seconds, and integer type, for sorting + expiration: decision.duration || ' ', + alert_id: row.id || ' ' + }); + }); + }); + $('#decisions table').bootgrid('clear').bootgrid('append', rows); + }; + _initTab('#decisions ', url, dataCallback); + } + + function deleteDecision(decisionId) { + var $modal = $('#delete-decision-modal'); + $modal.find('.modal-title').text('Delete decision #' + decisionId); + $modal.find('.modal-body').text('Are you sure?'); + $modal.find('#delete-decision-confirm').on('click', function() { + $.ajax({ + // XXX handle errors + url: '/api/crowdsec/decisions/delete/' + decisionId, + type: 'DELETE', + success: function(result) { + if (result && result.message === 'OK') { + $('#decisions table').bootgrid('remove', [decisionId]); + $modal.modal('hide'); + } + } + }); + }); + $modal.modal('show'); + } + + function init() { + _initService(); + + $('#machines_tab').on('click', _initMachines); + $('#collections_tab').on('click', _initCollections); + $('#scenarios_tab').on('click', _initScenarios); + $('#parsers_tab').on('click', _initParsers); + $('#postoverflows_tab').on('click', _initPostoverflows); + $('#bouncers_tab').on('click', _initBouncers); + $('#alerts_tab').on('click', _initAlerts); + $('#decisions_tab').on('click', _initDecisions); + + $('[data-toggle="tooltip"]').tooltip(); + + if (window.location.hash) { + // activate a tab from the hash, if it exists + $(window.location.hash+'_tab').click(); + } else { + // otherwise, machines + $('#machines_tab').click(); + } + + $(window).on('hashchange', function(e) { + $(window.location.hash+'_tab').click(); + }); + + if (new URLSearchParams(window.location.search).has('debug')) { + $('#debug_tab').show().on('click', _initDebug); + } + + // navigation + if(window.location.hash != "") { + $('a[href="' + window.location.hash + '"]').click() + } + $('.nav-tabs a').on('shown.bs.tab', function (e) { + history.pushState(null, null, e.target.hash); + }); + } + + return { + deleteDecision: deleteDecision, + init: init + }; + +}()); From b3e996c5e1962a8222296357dab9e6feb7adafe3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 May 2022 12:29:56 +0200 Subject: [PATCH 1032/3088] README: sync --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 09a0db513b..3660856d6e 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ net-mgmt/zabbix-agent -- Zabbix monitoring agent net-mgmt/zabbix-proxy -- Zabbix monitoring proxy security/acme-client -- ACME Client security/clamav -- Antivirus engine for detecting malicious threats +security/crowdsec -- Lightweight and collaborative security engine (development only) security/etpro-telemetry -- ET Pro Telemetry Edition security/intrusion-detection-content-et-open -- IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition security/intrusion-detection-content-et-pro -- IDS Proofpoint ET Pro ruleset (needs a valid subscription) From ff20cded1e655b0cb9ba3089b48bbd263b85f421 Mon Sep 17 00:00:00 2001 From: Murat Date: Tue, 10 May 2022 23:30:09 -0700 Subject: [PATCH 1033/3088] os-sunnyvalley: Update Product name to reflect the new name: Zenarmor (#2978) * os-sunnyvalley: Update Product name to reflect the new name: Zenarmor * os-sunnyvalley: Update Product name to reflect the new name: Zenarmor Co-authored-by: mb --- vendor/sunnyvalley/Makefile | 4 ++-- vendor/sunnyvalley/pkg-descr | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vendor/sunnyvalley/Makefile b/vendor/sunnyvalley/Makefile index 6d082409e3..39e7251030 100644 --- a/vendor/sunnyvalley/Makefile +++ b/vendor/sunnyvalley/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= sunnyvalley PLUGIN_VERSION= 1.2 -PLUGIN_REVISION= 1 -PLUGIN_COMMENT= Vendor repository for Sensei (Next Generation Firewall Extensions) +PLUGIN_REVISION= 2 +PLUGIN_COMMENT= Vendor Repository for Zenarmor (a.k.a Sensei, Next Generation Firewall Extensions) PLUGIN_MAINTAINER= opensource@sunnyvalley.io PLUGIN_WWW= https://www.sunnyvalley.io PLUGIN_DEPENDS= ${PLUGIN_FLAVOUR:tl} diff --git a/vendor/sunnyvalley/pkg-descr b/vendor/sunnyvalley/pkg-descr index 6f3b0fa84d..743f576974 100644 --- a/vendor/sunnyvalley/pkg-descr +++ b/vendor/sunnyvalley/pkg-descr @@ -1,15 +1,15 @@ -This plugin adds a proprietary repository to install Sensei, a plugin -for OPNsense, complementing the firewall with state of the art +This plugin adds a proprietary repository to install Zenarmor (previously Sensei), +a plugin for OPNsense, complementing the firewall with state of the art next generation firewall features. You will need to install os-sensei plugin after installing this repo plugin. -Sensei features: +Zenarmor for OPNsense features: * Application Control * Advanced Network Analytics +* Auto-blocking based on Real-time Cloud Threat Intelligence * All-ports Full TLS Inspection -* Cloud Threat Intelligence * Web Security & Web Filtering * User based filtering * Policy based filtering From 4dd4e1ebfdaa230ff781f134a7ec01ab25350e64 Mon Sep 17 00:00:00 2001 From: Stephan de Wit Date: Wed, 11 May 2022 10:41:16 +0200 Subject: [PATCH 1034/3088] nginx: make validation fit into phalcon compat layer --- .../OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php | 2 +- .../OPNsense/Base/Constraints/NgxBusyBufferConstraint.php | 2 +- .../Base/Constraints/NgxUniqueDefaultServerConstraint.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php index b40c832dd2..fc2c38234d 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NaxsiIdentifierConstraint.php @@ -38,7 +38,7 @@ */ class NaxsiIdentifierConstraint extends BaseConstraint { - public function validate(\Phalcon\Validation $validator, $attribute): bool + public function validate($validator, $attribute): bool { $node = $this->getOption('node'); if ($node) { diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php index 6067ad0644..00d0469017 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxBusyBufferConstraint.php @@ -38,7 +38,7 @@ */ class NgxBusyBufferConstraint extends BaseConstraint { - public function validate(\Phalcon\Validation $validator, $attribute): bool + public function validate($validator, $attribute): bool { $node = $this->getOption('node'); if ($node) { diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxUniqueDefaultServerConstraint.php b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxUniqueDefaultServerConstraint.php index 9534251250..3526b907d0 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxUniqueDefaultServerConstraint.php +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Base/Constraints/NgxUniqueDefaultServerConstraint.php @@ -39,7 +39,7 @@ */ class NgxUniqueDefaultServerConstraint extends BaseConstraint { - public function validate(\Phalcon\Validation $validator, $attribute): bool + public function validate($validator, $attribute): bool { $node = $this->getOption('node'); if ($node) { From 433ec8e0f27b19920200d72db6e6e713d1bc44de Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 11 May 2022 10:48:53 +0200 Subject: [PATCH 1035/3088] www/nginx: bump revision --- www/nginx/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 1343b145a0..84532fec15 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= nginx PLUGIN_VERSION= 1.26 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From db3fb848d9ab1527b607c788db48270acbc71f20 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 11 May 2022 12:07:59 +0200 Subject: [PATCH 1036/3088] plugins: style sweep --- .../scripts/OPNsense/AcmeClient/run_remote_ssh.php | 10 +++++----- security/crowdsec/+POST_INSTALL.post | 1 - security/crowdsec/+PRE_DEINSTALL.pre | 1 - security/crowdsec/pkg-descr | 1 - .../crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc | 5 +++-- .../crowdsec/src/etc/rc.syshook.d/start/50-crowdsec | 1 - .../mvc/app/views/OPNsense/CrowdSec/general.volt | 5 ++--- .../opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh | 1 - .../opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh | 1 - .../service/conf/actions.d/actions_crowdsec.conf | 1 - .../service/templates/OPNsense/CrowdSec/settings.json | 2 -- security/stunnel/Makefile | 2 +- vendor/sunnyvalley/pkg-descr | 2 +- www/web-proxy-useracl/Makefile | 2 +- 14 files changed, 13 insertions(+), 22 deletions(-) diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php index 3f045347bd..9a16b8689a 100755 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php +++ b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/run_remote_ssh.php @@ -29,17 +29,17 @@ const ABOUT = <</dev/null 2>&1 | : # the rest of the cleanup is done in the post-deinstall script, otherwise # the plugin recreates the objects during "filter reload". - diff --git a/security/crowdsec/pkg-descr b/security/crowdsec/pkg-descr index 2cd4f07c10..cc35c3abe3 100644 --- a/security/crowdsec/pkg-descr +++ b/security/crowdsec/pkg-descr @@ -46,4 +46,3 @@ Plugin Changelog * fixed an issue that prevented the bouncer from banning IPs on opnsense * fixed support for notification plugins - diff --git a/security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc b/security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc index a1e2eb6b07..79348aaf76 100644 --- a/security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc +++ b/security/crowdsec/src/etc/inc/plugins.inc.d/crowdsec.inc @@ -7,7 +7,8 @@ use OPNsense\Core\Config; use OPNsense\Firewall\Alias; use OPNsense\Firewall\Plugin; -function add_alias_if_not_exist($name, $description, $proto) { +function add_alias_if_not_exist($name, $description, $proto) +{ $model = new Alias(); if ($model->getByName($name) != null) { @@ -40,7 +41,7 @@ function crowdsec_firewall(Plugin $fw) $rules_tag = ""; if (isset($general['rules_tag'])) { $rules_tag = $general['rules_tag']; - }; + } add_alias_if_not_exist('crowdsec_blacklists', 'CrowdSec (IPv4)', 'IPv4'); diff --git a/security/crowdsec/src/etc/rc.syshook.d/start/50-crowdsec b/security/crowdsec/src/etc/rc.syshook.d/start/50-crowdsec index 58359695ff..35922bb443 100755 --- a/security/crowdsec/src/etc/rc.syshook.d/start/50-crowdsec +++ b/security/crowdsec/src/etc/rc.syshook.d/start/50-crowdsec @@ -3,4 +3,3 @@ # https://docs.opnsense.org/development/backend/autorun.html /usr/local/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh - diff --git a/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt index e6753a4bf3..4952bfb18c 100644 --- a/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt +++ b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt @@ -59,7 +59,7 @@ CrowdSec Central API (meaning timestamp, scenario, attacking IP).

    -

    Other attack behaviors can be recognized on the OPNsense server and its plugins, or +

    Other attack behaviors can be recognized on the OPNsense server and its plugins, or any other agent connected to the same LAPI node. Other types of remediation are possible (ex. captcha test for scraping attempts).

    @@ -87,7 +87,7 @@
  • The parsers, scenarios and all objects from the CrowdSec Hub are periodically upgraded. The - crowdsecurity/freebsd and + crowdsecurity/freebsd and crowdsecurity/opnsense collections are installed by default.
  • @@ -139,4 +139,3 @@
    - diff --git a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh index 1c00e7a1bd..b57e86bb10 100755 --- a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh +++ b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh @@ -15,4 +15,3 @@ if service crowdsec enabled; then service crowdsec restart >/dev/null 2>&1 || : fi fi - diff --git a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh index c6d0c2c2c5..1c339cc01f 100755 --- a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh +++ b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh @@ -30,4 +30,3 @@ fi rm -f /usr/local/etc/crowdsec/opnsense-settings.json echo "OK" - diff --git a/security/crowdsec/src/opnsense/service/conf/actions.d/actions_crowdsec.conf b/security/crowdsec/src/opnsense/service/conf/actions.d/actions_crowdsec.conf index e0e0f62932..de9c3f6fda 100644 --- a/security/crowdsec/src/opnsense/service/conf/actions.d/actions_crowdsec.conf +++ b/security/crowdsec/src/opnsense/service/conf/actions.d/actions_crowdsec.conf @@ -91,4 +91,3 @@ message:crowdsec version command:/usr/local/opnsense/scripts/OPNsense/CrowdSec/reconfigure.sh type:script_output message:crowdsec reconfigure - diff --git a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/settings.json b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/settings.json index 0c3ed00b09..5b3e0c90e8 100644 --- a/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/settings.json +++ b/security/crowdsec/src/opnsense/service/templates/OPNsense/CrowdSec/settings.json @@ -1,5 +1,3 @@ {% if helpers.exists('OPNsense.crowdsec.general') -%} {{ OPNsense.crowdsec.general | tojson }} {%- endif %} - - diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index d3215d7941..f0a6ca8a24 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= stunnel PLUGIN_VERSION= 1.0.4 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel diff --git a/vendor/sunnyvalley/pkg-descr b/vendor/sunnyvalley/pkg-descr index 743f576974..18686981a6 100644 --- a/vendor/sunnyvalley/pkg-descr +++ b/vendor/sunnyvalley/pkg-descr @@ -1,4 +1,4 @@ -This plugin adds a proprietary repository to install Zenarmor (previously Sensei), +This plugin adds a proprietary repository to install Zenarmor (previously Sensei), a plugin for OPNsense, complementing the firewall with state of the art next generation firewall features. diff --git a/www/web-proxy-useracl/Makefile b/www/web-proxy-useracl/Makefile index 7620cecc0f..fd340b0d19 100644 --- a/www/web-proxy-useracl/Makefile +++ b/www/web-proxy-useracl/Makefile @@ -2,7 +2,7 @@ PLUGIN_NAME= web-proxy-useracl PLUGIN_VERSION= 1.1 PLUGIN_REVISION= 2 PLUGIN_COMMENT= Group and user ACL for the web proxy -PLUGIN_OBSOLETE= No changes since 2018 +PLUGIN_OBSOLETE= No changes since 2018 PLUGIN_MAINTAINER= kekek2@ya.ru PLUGIN_WWW= https://smart-soft.ru From 4495a8396769587ff090bcc4b351a031e3b19a3d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 11 May 2022 12:08:31 +0200 Subject: [PATCH 1037/3088] Framework: moved to .pkg extension --- Mk/plugins.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index ac715b3ecf..591598d678 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -272,7 +272,7 @@ upgrade: upgrade-check package ${PKG} delete -fy ${NAME}; \ fi .endfor - @${PKG} add ${PKGDIR}/*.txz + @${PKG} add ${PKGDIR}/*.pkg mount: check mount_unionfs ${.CURDIR}/src ${DESTDIR}${LOCALBASE} From f31a35b31a3bd62cc1c6877c27729fa20d1741da Mon Sep 17 00:00:00 2001 From: "Dr. Uwe Meyer-Gruhl" <17402664+meyergru@users.noreply.github.com> Date: Thu, 12 May 2022 10:42:10 +0200 Subject: [PATCH 1038/3088] os-wireguard: add script to enable cron renewal of DNS for stale connections (#2956) --- net/wireguard/Makefile | 2 +- net/wireguard/pkg-descr | 4 ++ .../scripts/OPNsense/Wireguard/resolve-dns.sh | 49 +++++++++++++++++++ .../conf/actions.d/actions_wireguard.conf | 7 +++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.sh diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 22a3d57f17..3e37bd759c 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 1.10 +PLUGIN_VERSION= 1.11 PLUGIN_COMMENT= WireGuard VPN service PLUGIN_DEPENDS= wireguard-go wireguard-tools PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 515f17dbf2..643516c387 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,10 @@ WWW: https://www.wireguard.com/ Changelog --------- +1.11 + +* Add script for renewal of Wireguard DNS-based entries for stale connections + 1.10 * Remove instance limit diff --git a/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.sh b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.sh new file mode 100644 index 0000000000..365344f143 --- /dev/null +++ b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.sh @@ -0,0 +1,49 @@ +#!/usr/local/bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2015-2020 Jason A. Donenfeld . All Rights Reserved. + +set -e +shopt -s nocasematch +shopt -s extglob +export LC_ALL=C + +for CONFIG_FILE in /usr/local/etc/wireguard/*.conf +do + +[[ $CONFIG_FILE =~ /?([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]] +INTERFACE="${BASH_REMATCH[1]}" + +process_peer() { + [[ $PEER_SECTION -ne 1 || -z $PUBLIC_KEY || -z $ENDPOINT ]] && return 0 + [[ $(wg show "$INTERFACE" latest-handshakes) =~ ${PUBLIC_KEY//+/\\+}\ ([0-9]+) ] +] || return 0 + (( ($EPOCHSECONDS - ${BASH_REMATCH[1]}) > 135 )) || return 0 + wg set "$INTERFACE" peer "$PUBLIC_KEY" endpoint "$ENDPOINT" + reset_peer_section +} + +reset_peer_section() { + PEER_SECTION=0 + PUBLIC_KEY="" + ENDPOINT="" +} + +reset_peer_section +while read -r line || [[ -n $line ]]; do + stripped="${line%%\#*}" + key="${stripped%%=*}"; key="${key##*([[:space:]])}"; key="${key%%*([[:space:]])}" + value="${stripped#*=}"; value="${value##*([[:space:]])}"; value="${value%%*([[:spa +ce:]])}" + [[ $key == "["* ]] && { process_peer; reset_peer_section; } + [[ $key == "[Peer]" ]] && PEER_SECTION=1 + if [[ $PEER_SECTION -eq 1 ]]; then + case "$key" in + PublicKey) PUBLIC_KEY="$value"; continue ;; + Endpoint) ENDPOINT="$value"; continue ;; + esac + fi +done < "$CONFIG_FILE" +process_peer + +done diff --git a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf index 3257da26d0..84fa90580c 100644 --- a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf +++ b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf @@ -23,6 +23,13 @@ type:script message:Restarting WireGuard description: Restart WireGuard +[renew] +command:/usr/local/opnsense/scripts/OPNsense/Wireguard/resolve-dns.sh +parameters: +type:script +message:Renew DNS for Wireguard +description:Renew DNS for Wireguard on stale connections + [genkey] command:/usr/local/opnsense/scripts/OPNsense/Wireguard/genkey.sh parameters: %s From 10aee293e8e942a47ade5298fcd2804c8ad7fb2b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 12 May 2022 10:47:07 +0200 Subject: [PATCH 1039/3088] net/wireguard: fix lint issues 755 is actually required here, .bash suffix to not break POSIX shell lint. --- .../OPNsense/Wireguard/{resolve-dns.sh => resolve-dns.bash} | 0 .../src/opnsense/service/conf/actions.d/actions_wireguard.conf | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/{resolve-dns.sh => resolve-dns.bash} (100%) mode change 100644 => 100755 diff --git a/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.sh b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash old mode 100644 new mode 100755 similarity index 100% rename from net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.sh rename to net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash diff --git a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf index 84fa90580c..c132c16b8f 100644 --- a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf +++ b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf @@ -24,7 +24,7 @@ message:Restarting WireGuard description: Restart WireGuard [renew] -command:/usr/local/opnsense/scripts/OPNsense/Wireguard/resolve-dns.sh +command:/usr/local/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash parameters: type:script message:Renew DNS for Wireguard From 8a4cd2b7c374d10ad9e46f6d2f1ac27c1f415ba4 Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Thu, 12 May 2022 17:02:16 +0300 Subject: [PATCH 1040/3088] nginx: add headers_more support (#2845) --- .../mvc/app/controllers/OPNsense/Nginx/forms/settings.xml | 6 ++++++ .../src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml | 3 +++ .../opnsense/service/templates/OPNsense/Nginx/nginx.conf | 3 +++ 3 files changed, 12 insertions(+) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/settings.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/settings.xml index 98cbd71d6c..08a0a8716a 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/settings.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/settings.xml @@ -53,6 +53,12 @@ text true + + nginx.http.headers_more_enable + + checkbox + Enhanced version of the standard headers module. Allows to add, set, or clear any output or input header. + diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index c6d69989b2..03852a9dae 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -47,6 +47,9 @@ N 1 + + N + diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/nginx.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/nginx.conf index 0be1a6a941..a140d361de 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/nginx.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/nginx.conf @@ -5,6 +5,9 @@ load_module /usr/local/libexec/nginx/ngx_mail_module.so; load_module /usr/local/libexec/nginx/ngx_http_brotli_filter_module.so; load_module /usr/local/libexec/nginx/ngx_http_brotli_static_module.so; load_module /usr/local/libexec/nginx/ngx_http_js_module.so; +{% if OPNsense.Nginx.http.headers_more_enable is defined and OPNsense.Nginx.http.headers_more_enable == '1' %} +load_module /usr/local/libexec/nginx/ngx_http_headers_more_filter_module.so; +{% endif %} user www staff; worker_processes {{ OPNsense.Nginx.http.workerprocesses }}; From 3bcfab38f6ea265bf23b5b01eccc4e82f75fbb4e Mon Sep 17 00:00:00 2001 From: Starkstromkonsument Date: Thu, 12 May 2022 16:03:09 +0200 Subject: [PATCH 1041/3088] mail/postfix: Switch table format of header_checks from regexp_table to pcre_table (#2825) --- mail/postfix/Makefile | 2 +- mail/postfix/pkg-descr | 4 ++++ .../src/opnsense/service/templates/OPNsense/Postfix/main.cf | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index ba8f9944ec..be67c238dc 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= postfix -PLUGIN_VERSION= 1.21 +PLUGIN_VERSION= 1.22 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix35 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/pkg-descr b/mail/postfix/pkg-descr index 0fd8e0ccab..b45544ba64 100644 --- a/mail/postfix/pkg-descr +++ b/mail/postfix/pkg-descr @@ -6,6 +6,10 @@ is completely different. Plugin Changelog ================ +1.22 + +* Switch table format of header_checks from regexp_table to pcre_table (contributed by Starkstromkonsument) + 1.21 * Add static link to root certficiates diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf index 3dcc6292b8..c4de83da01 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf @@ -35,8 +35,8 @@ virtual_alias_maps = hash:/usr/local/etc/postfix/virtual sender_bcc_maps = hash:/usr/local/etc/postfix/senderbcc recipient_bcc_maps = hash:/usr/local/etc/postfix/recipientbcc sender_canonical_maps = regexp:/usr/local/etc/postfix/sendercanonical -header_checks = regexp:/usr/local/etc/postfix/header_checks_receiving -smtp_header_checks = regexp:/usr/local/etc/postfix/header_checks_delivering +header_checks = pcre:/usr/local/etc/postfix/header_checks_receiving +smtp_header_checks = pcre:/usr/local/etc/postfix/header_checks_delivering smtp_tls_CAfile = /etc/ssl/cert.pem ########################## # END SYSTEM DEFAULTS From e3aadd390cbcb3441eac7e2fdc6b7098cb2c1454 Mon Sep 17 00:00:00 2001 From: MeganerdNL Date: Thu, 12 May 2022 20:10:30 +0200 Subject: [PATCH 1042/3088] Add missing validation.dns_transip_username From c253ba6ddd9375a5d3c8af573d976d6bea9d4b86 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 13 May 2022 10:30:26 +0200 Subject: [PATCH 1043/3088] net/vnstat: vnstat is console-based, but the plugin is not --- net/vnstat/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile index 445106e949..d5d2224237 100644 --- a/net/vnstat/Makefile +++ b/net/vnstat/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= vnstat PLUGIN_VERSION= 1.3 -PLUGIN_COMMENT= vnStat is a console-based network traffic monitor +PLUGIN_COMMENT= Network traffic monitor PLUGIN_DEPENDS= vnstat PLUGIN_MAINTAINER= m.muenz@gmail.com From 89b122e475a7aab93a966a66226ed2fd34a33bc0 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 13 May 2022 10:31:26 +0200 Subject: [PATCH 1044/3088] README: sync --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3660856d6e..9b78a2e005 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ net/siproxd -- Siproxd is a proxy daemon for the SIP protocol net/tayga -- Tayga NAT64 net/udpbroadcastrelay -- Control ubpbroadcastrelay processes net/upnp -- Universal Plug and Play Service -net/vnstat -- vnStat is a console-based network traffic monitor +net/vnstat -- Network traffic monitor net/wireguard -- WireGuard VPN service net/wol -- Wake on LAN Service net/zerotier -- Virtual Networks That Just Work @@ -108,7 +108,7 @@ sysutils/smart -- SMART tools sysutils/virtualbox -- VirtualBox guest additions sysutils/vmware -- VMware tools sysutils/xen -- Xen guest utilities -vendor/sunnyvalley -- Vendor repository for Sensei (Next Generation Firewall Extensions) +vendor/sunnyvalley -- Vendor Repository for Zenarmor (a.k.a Sensei, Next Generation Firewall Extensions) www/c-icap -- c-icap connects the web proxy with a virus scanner www/cache -- Webserver cache www/nginx -- Nginx HTTP server and reverse proxy From 8f8714c769e1dcf6b0f6cf46967b95fd64f244d3 Mon Sep 17 00:00:00 2001 From: Malware Utkonos Date: Fri, 13 May 2022 14:07:19 -0400 Subject: [PATCH 1045/3088] Trim whitespace around public and private keys in config. (#2982) --- .../OPNsense/Wireguard/Api/ServerController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServerController.php b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServerController.php index a492e93802..78e653c9e7 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServerController.php +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServerController.php @@ -59,8 +59,8 @@ public function addServerAction($uuid = null) $backend = new Backend(); $keyspriv = $backend->configdpRun("wireguard genkey", 'private'); $keyspub = $backend->configdpRun("wireguard genkey", 'public'); - $node->privkey = $keyspriv; - $node->pubkey = $keyspub; + $node->privkey = trim($keyspriv); + $node->pubkey = trim($keyspub); } return $this->validateAndSave($node, 'server'); } @@ -84,8 +84,8 @@ public function setServerAction($uuid = null) $backend = new Backend(); $keyspriv = $backend->configdpRun("wireguard genkey", 'private'); $keyspub = $backend->configdpRun("wireguard genkey", 'public'); - $node->privkey = $keyspriv; - $node->pubkey = $keyspub; + $node->privkey = trim($keyspriv); + $node->pubkey = trim($keyspub); } return $this->validateAndSave($node, 'server'); } From b6f550e0dfc36378cce9659ab368209fd072066b Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 14 May 2022 12:46:50 +0200 Subject: [PATCH 1046/3088] Update resolve-dns.bash (#2984) --- .../opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash index 365344f143..881ef276f7 100755 --- a/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash +++ b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash @@ -16,8 +16,7 @@ INTERFACE="${BASH_REMATCH[1]}" process_peer() { [[ $PEER_SECTION -ne 1 || -z $PUBLIC_KEY || -z $ENDPOINT ]] && return 0 - [[ $(wg show "$INTERFACE" latest-handshakes) =~ ${PUBLIC_KEY//+/\\+}\ ([0-9]+) ] -] || return 0 + [[ $(wg show "$INTERFACE" latest-handshakes) =~ ${PUBLIC_KEY//+/\\+}\ ([0-9]+) ]] || return 0 (( ($EPOCHSECONDS - ${BASH_REMATCH[1]}) > 135 )) || return 0 wg set "$INTERFACE" peer "$PUBLIC_KEY" endpoint "$ENDPOINT" reset_peer_section @@ -33,8 +32,7 @@ reset_peer_section while read -r line || [[ -n $line ]]; do stripped="${line%%\#*}" key="${stripped%%=*}"; key="${key##*([[:space:]])}"; key="${key%%*([[:space:]])}" - value="${stripped#*=}"; value="${value##*([[:space:]])}"; value="${value%%*([[:spa -ce:]])}" + value="${stripped#*=}"; value="${value##*([[:space:]])}"; value="${value%%*([[:space:]])}" [[ $key == "["* ]] && { process_peer; reset_peer_section; } [[ $key == "[Peer]" ]] && PEER_SECTION=1 if [[ $PEER_SECTION -eq 1 ]]; then From 576e202b39225445ae3ac0de8811f9caeb7ae188 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 16 May 2022 09:23:10 +0200 Subject: [PATCH 1047/3088] net/wireguard: update changelog --- net/wireguard/pkg-descr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 643516c387..d5787c5ffb 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -18,7 +18,8 @@ Changelog 1.11 -* Add script for renewal of Wireguard DNS-based entries for stale connections +* Add script for renewal of Wireguard DNS-based entries for stale connections (#2956) +* Trim whitespace around new public and private keys in config (#2982) 1.10 From 6cc49824549d199d0815b5e91dcd2cf677509929 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 16 May 2022 09:25:15 +0200 Subject: [PATCH 1048/3088] www/nginx: update changelog --- www/nginx/Makefile | 3 +-- www/nginx/pkg-descr | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 84532fec15..038d7a4536 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.26 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.27 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 77df4834a5..120f8ba95b 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -10,10 +10,14 @@ WWW: https://nginx.org/ Plugin Changelog ================ +1.27 + +* add headers_more support (contributed by kulikov-a) + 1.26 * Enhancement of security headers (contributed by Manuel Faux) - Add Frame-Ancestors, add "preload", removed deprecated HPKP +* Add Frame-Ancestors, add "preload", removed deprecated HPKP * Performance enhancements for log display * Fixed display of vts and logs for non-default styles From 579adb0ea9f752682b6aab920dff5bd6123e4783 Mon Sep 17 00:00:00 2001 From: Budiman Jojo Date: Mon, 16 May 2022 16:59:19 +0700 Subject: [PATCH 1049/3088] net/wireguard: fix newlines and typos (#2983) --- .../OPNsense/Wireguard/resolve-dns.bash | 30 +++++++++---------- .../conf/actions.d/actions_wireguard.conf | 4 +-- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash index 881ef276f7..b7faf881ad 100755 --- a/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash +++ b/net/wireguard/src/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash @@ -8,40 +8,38 @@ shopt -s nocasematch shopt -s extglob export LC_ALL=C -for CONFIG_FILE in /usr/local/etc/wireguard/*.conf -do +for CONFIG_FILE in /usr/local/etc/wireguard/*.conf; do -[[ $CONFIG_FILE =~ /?([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]] -INTERFACE="${BASH_REMATCH[1]}" + [[ $CONFIG_FILE =~ /?([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]] + INTERFACE="${BASH_REMATCH[1]}" -process_peer() { + process_peer() { [[ $PEER_SECTION -ne 1 || -z $PUBLIC_KEY || -z $ENDPOINT ]] && return 0 - [[ $(wg show "$INTERFACE" latest-handshakes) =~ ${PUBLIC_KEY//+/\\+}\ ([0-9]+) ]] || return 0 + [[ $(wg show "$INTERFACE" latest-handshakes) =~ ${PUBLIC_KEY//+/\\+}\ ([0-9]+) ]] || return 0 (( ($EPOCHSECONDS - ${BASH_REMATCH[1]}) > 135 )) || return 0 wg set "$INTERFACE" peer "$PUBLIC_KEY" endpoint "$ENDPOINT" reset_peer_section -} + } -reset_peer_section() { + reset_peer_section() { PEER_SECTION=0 PUBLIC_KEY="" ENDPOINT="" -} + } -reset_peer_section -while read -r line || [[ -n $line ]]; do + reset_peer_section + while read -r line || [[ -n $line ]]; do stripped="${line%%\#*}" key="${stripped%%=*}"; key="${key##*([[:space:]])}"; key="${key%%*([[:space:]])}" value="${stripped#*=}"; value="${value##*([[:space:]])}"; value="${value%%*([[:space:]])}" [[ $key == "["* ]] && { process_peer; reset_peer_section; } [[ $key == "[Peer]" ]] && PEER_SECTION=1 if [[ $PEER_SECTION -eq 1 ]]; then - case "$key" in + case "$key" in PublicKey) PUBLIC_KEY="$value"; continue ;; Endpoint) ENDPOINT="$value"; continue ;; - esac + esac fi -done < "$CONFIG_FILE" -process_peer - + done < "$CONFIG_FILE" + process_peer done diff --git a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf index c132c16b8f..ac9d353e8a 100644 --- a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf +++ b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf @@ -27,8 +27,8 @@ description: Restart WireGuard command:/usr/local/opnsense/scripts/OPNsense/Wireguard/resolve-dns.bash parameters: type:script -message:Renew DNS for Wireguard -description:Renew DNS for Wireguard on stale connections +message:Renew DNS for WireGuard +description:Renew DNS for WireGuard on stale connections [genkey] command:/usr/local/opnsense/scripts/OPNsense/Wireguard/genkey.sh From 8c48df65b2fc0a38f5dc69bbc335eeb07fc7d3c2 Mon Sep 17 00:00:00 2001 From: Fabio Castagnino Date: Mon, 7 Mar 2022 18:08:00 +0100 Subject: [PATCH 1050/3088] add support for custom configuration --- .../opnsense/service/templates/OPNsense/Nginx/streams.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf index f19d6a6cd5..bada862439 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf @@ -83,6 +83,8 @@ ssl_prefer_server_ciphers on; {% endif %} + include {{ server['@uuid'] }}_pre/*.conf; + {% if server.route_field == 'upstream' %} {% if server.upstream is defined %} {% set upstream = helpers.getUUID(server.upstream) %} @@ -105,6 +107,8 @@ {% endfor %} {% endif%} + include {{ server['@uuid'] }}_post/*.conf; + } {% endfor %} {% endif %} From 051ff70b0068ebe0fe46bad27ffbaabdf61164c6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 May 2022 15:37:36 +0200 Subject: [PATCH 1051/3088] www/nginx: update package description --- www/nginx/pkg-descr | 1 + .../src/opnsense/service/templates/OPNsense/Nginx/streams.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 120f8ba95b..16d6c5655d 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -12,6 +12,7 @@ Plugin Changelog 1.27 +* add support for custom configuration in stream server (contributed by Fabio Castagnino) * add headers_more support (contributed by kulikov-a) 1.26 diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf index bada862439..a9c265e49e 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf @@ -84,7 +84,7 @@ {% endif %} include {{ server['@uuid'] }}_pre/*.conf; - + {% if server.route_field == 'upstream' %} {% if server.upstream is defined %} {% set upstream = helpers.getUUID(server.upstream) %} From 0ca50060cbee0991b55886c3db2495db672edbee Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 18 May 2022 11:12:23 +0200 Subject: [PATCH 1052/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- security/acme-client/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 5dd108a98a..e43cc7d263 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.10 +PLUGIN_VERSION= 3.11 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 6cd62b0b1e..2ca43dc00d 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.11 + +Fixed: +* Add missing + Allow connecting to websockets. You can use wildcards here like wss://*.exmaple.com. + + + security_header.csp_connect_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + + + + header + + Content Security Policy: Enable on the General tab needs to be enabled to activate this header.]]> + + + security_header.csp_worker_src_enabled + + checkbox + If checked, this part of the CSP is enabled. + + + security_header.csp_worker_src_data_urls + + Data URLs are used to embed files into HTML (for example images written directly into the src attribute). + checkbox + + + security_header.csp_worker_src_http_urls + + select_multiple + true + + Allow loading files over HTTP(S) allows downloading of content over other domains or CDNs. + You can use wildcards here like https://*.exmaple.com. + + + security_header.csp_worker_src_inline + + checkbox + Checking this directive allows to use scripts or styles directly embedded in in the HTML content. + Examples are the script and the style tags. + + + security_header.csp_worker_src_eval + + checkbox + Checking this box allows functions like eval or createFunction in JS, or style attributes for CSS. + + + security_header.csp_worker_src_self + + checkbox + Allows everything from the same site (path can differ, but host, protocol and port need to be the same). + + + security_header.csp_worker_src_blob + + checkbox + Allows to use blobs as a data source. This usually is content, which is somehow generated in JavaScript. + + + security_header.csp_worker_src_filesystem + + checkbox + + + security_header.csp_worker_src_none + + checkbox + If this checkbox is checked, all other settings for this directive are ignored and everything will be forbidden. + + header diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index 03852a9dae..f77f691b92 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -1,6 +1,6 @@ //OPNsense/Nginx - 1.26.0 + 1.28.0 nginx web server, reverse proxy and waf @@ -1512,6 +1512,52 @@ Y 0 + + Y + 0 + + + N + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + N + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + + + Y + 0 + Y 0 diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/security_rule.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/security_rule.conf index f309c4cbf2..0a46c83a18 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/security_rule.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/security_rule.conf @@ -19,7 +19,7 @@ {% endif %} {% if security_rule.enable_csp is defined and security_rule.enable_csp == '1' %} {% set hash_csp = {} %} -{% for csp_category in ['default-src', 'script-src', 'img-src', 'style-src', 'media-src', 'font-src', 'frame-src', 'frame-ancestors', 'form-action'] %} +{% for csp_category in ['default-src', 'script-src', 'img-src', 'style-src', 'media-src', 'font-src', 'frame-src', 'frame-ancestors', 'form-action', 'connect-src', 'worker-src'] %} {% set prefix = 'csp_' + csp_category.replace('-', '_') + '_' %} {% if security_rule[prefix + 'enabled'] == '1' %} {% set current_list = [] %} From f0dc836495a0378108d10639cb9d70b3f35caa2d Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Thu, 26 May 2022 11:27:51 +0200 Subject: [PATCH 1056/3088] www/nginx: add support proxy_responses directive in streams --- www/nginx/pkg-descr | 1 + .../controllers/OPNsense/Nginx/forms/streamserver.xml | 9 ++++++++- .../src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml | 4 ++++ .../service/templates/OPNsense/Nginx/streams.conf | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index ec8555ac5b..b1aa7bc3ad 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -13,6 +13,7 @@ Plugin Changelog 1.28 * add support for connect-src and worker-src in content security policy +* add support for proxy_responses property in streams 1.27 diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/streamserver.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/streamserver.xml index a76c22e977..b988ecbc49 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/streamserver.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/streamserver.xml @@ -26,7 +26,7 @@ If you enable the proxy protocol, a downstream proxy can send the client IP and port before the real traffic is set. - httpserver.trusted_proxies + streamserver.trusted_proxies true @@ -34,6 +34,13 @@ true Enter a list of IP addresses or CIDR networks which are allowed to override the source IP address using the specified header. + + streamserver.proxy_responses + + text + true + Due to the nature of UDP, nginx cannot know, when the communication ends and this helps as it tells nginx the number of datagrams the communication is expected to last on server side and it is expected to be closed afterwards. If you enter 0, it is expected, that the server never responds to a datagram. If nginx gets a datagram, it will still get forwarded to the client. Setting this option might be useful in (mostly) unidirectional communication as well. + streamserver.certificate diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index f77f691b92..48d2e18bf0 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -1059,6 +1059,10 @@ N N + + N + 0 + diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf index a9c265e49e..25c6c2ce27 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf @@ -101,6 +101,9 @@ proxy_pass $hostmap{{ server.sni_upstream_map.replace('-','') }}; {% endif %} proxy_protocol {% if server.proxy_protocol == '1' %}on{% else %}off{% endif %}; +{% if server.proxy_responses is defined and server.proxy_responses != '' %} + proxy_responses {{ server.proxy_responses }}; +{% endif%} {% if server.trusted_proxies is defined and server.trusted_proxies != '' %} {% for trusted_proxy in server.trusted_proxies.split(',') %} set_real_ip_from {{ trusted_proxy }}; From 1f56aa14331542bb8d74218e75315128bf156f01 Mon Sep 17 00:00:00 2001 From: Fabian Franz Date: Thu, 26 May 2022 11:29:34 +0200 Subject: [PATCH 1057/3088] www/nginx: add support proxy_responses directive in streams --- www/nginx/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index b1aa7bc3ad..697dfaafe4 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -14,6 +14,7 @@ Plugin Changelog * add support for connect-src and worker-src in content security policy * add support for proxy_responses property in streams +* bugfix: trusted proxies field is now correctly named which makes it usable 1.27 From 4723896915e324d4f9d9b2d133058b0b7af1359b Mon Sep 17 00:00:00 2001 From: Neozlag <50456371+Neozlag@users.noreply.github.com> Date: Wed, 1 Jun 2022 10:52:46 +0200 Subject: [PATCH 1058/3088] dns/ddclient - add gandi support (#2997) * add gandi support for ddclient --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 944bc435e4..003426fc8f 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -47,6 +47,7 @@ EasyDNS FreeDNS Google + Gandi.net HE.net HE.net TunnelBroker INWX diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 1d9dbb54d2..27d26193d7 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -52,6 +52,9 @@ server=freedns.afraid.org, \ {% elif account.service == 'dynu' %} protocol=dyndns2, \ server=api.dynu.com, \ +{% elif account.service == 'gandi' %} +protocol=gandi +zone={{account.zone}}, \ {% elif account.service == 'he-net' %} protocol=dyndns2, \ server=dyn.dns.he.net, \ From 3bcbadaf1c84465915d35fb40b21aa187edb7593 Mon Sep 17 00:00:00 2001 From: Nicola Date: Thu, 2 Jun 2022 09:29:37 +0200 Subject: [PATCH 1059/3088] sysutils/apcupsd: new plugin (#2799) This is a plugin to configure the apcupsd service, it includes a widget for the dashboard Originally started by @Gibbon99 and @mrzaz (please mention their contribution too), repo here: https://github.com/Gibbon99/apcupsd and my fork: https://github.com/xbb/apcupsd where you can see the full changelog/commit list Forum thread: https://forum.opnsense.org/index.php?topic=21487.0 --- sysutils/apcupsd/Makefile | 8 + sysutils/apcupsd/pkg-descr | 21 ++ .../src/etc/inc/plugins.inc.d/apcupsd.inc | 77 ++++ .../Apcupsd/Api/ServiceController.php | 151 ++++++++ .../Apcupsd/Api/SettingsController.php | 41 ++ .../OPNsense/Apcupsd/IndexController.php | 48 +++ .../OPNsense/Apcupsd/StatusController.php | 47 +++ .../OPNsense/Apcupsd/forms/general.xml | 183 +++++++++ .../app/models/OPNsense/Apcupsd/ACL/ACL.xml | 9 + .../app/models/OPNsense/Apcupsd/Apcupsd.php | 39 ++ .../app/models/OPNsense/Apcupsd/Apcupsd.xml | 159 ++++++++ .../app/models/OPNsense/Apcupsd/Menu/Menu.xml | 8 + .../mvc/app/views/OPNsense/Apcupsd/index.volt | 74 ++++ .../app/views/OPNsense/Apcupsd/status.volt | 42 +++ .../conf/actions.d/actions_apcupsd.conf | 29 ++ .../templates/OPNsense/Apcupsd/+TARGETS | 2 + .../templates/OPNsense/Apcupsd/apcupsd | 23 ++ .../templates/OPNsense/Apcupsd/apcupsd.conf | 356 ++++++++++++++++++ .../src/www/widgets/include/apcupsd.inc | 4 + .../www/widgets/widgets/apcupsd.widget.php | 219 +++++++++++ 20 files changed, 1540 insertions(+) create mode 100644 sysutils/apcupsd/Makefile create mode 100644 sysutils/apcupsd/pkg-descr create mode 100644 sysutils/apcupsd/src/etc/inc/plugins.inc.d/apcupsd.inc create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/ServiceController.php create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/SettingsController.php create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/IndexController.php create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/StatusController.php create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/forms/general.xml create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/ACL/ACL.xml create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.php create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.xml create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Menu/Menu.xml create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/views/OPNsense/Apcupsd/index.volt create mode 100644 sysutils/apcupsd/src/opnsense/mvc/app/views/OPNsense/Apcupsd/status.volt create mode 100644 sysutils/apcupsd/src/opnsense/service/conf/actions.d/actions_apcupsd.conf create mode 100644 sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/+TARGETS create mode 100644 sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/apcupsd create mode 100644 sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/apcupsd.conf create mode 100644 sysutils/apcupsd/src/www/widgets/include/apcupsd.inc create mode 100644 sysutils/apcupsd/src/www/widgets/widgets/apcupsd.widget.php diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile new file mode 100644 index 0000000000..1b08a99071 --- /dev/null +++ b/sysutils/apcupsd/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= apcupsd +PLUGIN_DEVEL= yes +PLUGIN_VERSION= 0.1 +PLUGIN_DEPENDS= apcupsd +PLUGIN_COMMENT= APCUPSD - APC UPS daemon +PLUGIN_MAINTAINER= xbb@xbblabs.com + +.include "../../Mk/plugins.mk" diff --git a/sysutils/apcupsd/pkg-descr b/sysutils/apcupsd/pkg-descr new file mode 100644 index 0000000000..28f097d83a --- /dev/null +++ b/sysutils/apcupsd/pkg-descr @@ -0,0 +1,21 @@ +Apcupsd, short for APC UPS daemon, can be used for controlling all APC UPS models. +It can monitor and log the current power and battery status, perform automatic +shutdown, and can run in network mode in order to power down other hosts on a LAN. + +This plugin allows you to configure an APC UPS for use with OPNsense using the +Apcupsd project. The setup page allows you to set the most common options for +connecting your UPS to your OPNsense router and a status page for the UPS +status. It also includes support to act as an APC Netserver. + +WWW: http://www.apcupsd.org/ + +Plugin Changelog +================ + +1.0 + +Initial release + +* Apcupsd service control and configuration +* UPS status page +* Dashboard widget diff --git a/sysutils/apcupsd/src/etc/inc/plugins.inc.d/apcupsd.inc b/sysutils/apcupsd/src/etc/inc/plugins.inc.d/apcupsd.inc new file mode 100644 index 0000000000..94a2640164 --- /dev/null +++ b/sysutils/apcupsd/src/etc/inc/plugins.inc.d/apcupsd.inc @@ -0,0 +1,77 @@ + gettext('APC UPS Daemon'), + 'configd' => array( + 'restart' => array('apcupsd restart'), + 'start' => array('apcupsd start'), + 'stop' => array('apcupsd stop'), + ), + 'name' => 'apcupsd', + 'pidfile' => '/var/run/apcupsd.pid' + ); + } + return $services; +} + +/** + * sync configuration via xmlrpc + * @return array + */ +function apcupsd_xmlrpc_sync() +{ + $result = array(); + + $result[] = array( + 'description' => gettext('APC UPS Daemon'), + 'section' => 'OPNsense.apcupsd', + 'id' => 'apcupsd', + 'services' => ["apcupsd"], + ); + + return $result; +} diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/ServiceController.php b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/ServiceController.php new file mode 100644 index 0000000000..ea6380e965 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/ServiceController.php @@ -0,0 +1,151 @@ +getUpsStatusOutput(); + $result['status'] = null; + if (!$result['error']) { + $result['status'] = $this->parseUpsStatus($result['output']); + } + return $result; + } + + private function parseUpsStatus($statusOutput) + { + $status = array(); + foreach (explode("\n", $statusOutput) as $line) { + $kv = array_map('trim', explode(':', $line, 2)); + $key = $kv[0]; + $value = isset($kv[1]) ? $kv[1] : null; + $norm = $value; + if (empty($key)) { + continue; + } + if ($value === 'N/A') { + $norm = null; + } elseif (in_array($key, self::$dateTimeFields, true)) { + $norm = $this->tryParseDateTime($value); + } elseif (in_array($key, self::$dateFields, true)) { + $norm = $this->tryParseDate($value); + } elseif (preg_match('/^((?:[0-9]*[.])?[0-9]+)(?:\s+\w+)?$/i', $value, $matches)) { + $norm = floatval($matches[1]); + } + $status[$key] = array( + 'value' => $value, + 'norm' => $norm + ); + } + return $status; + } + + private function tryParseDateTime($dateTimeString) { + $formats = [ + 'Y-m-d H:i:s P', // 2021-12-27 17:51:42 +0100 + 'D M d H:i:s T Y' // Sat Sep 16 17:13:00 CEST 2000 + ]; + foreach ($formats as $format) { + $dt = DateTime::createFromFormat($format, $dateTimeString); + if ($dt) { + return $dt->format(DateTimeInterface::RFC3339); + } + } + return $dateTimeString; + } + + private function tryParseDate($dateString) { + $formats = [ + 'Y-m-d', // 2021-12-27 + 'm/d/y', // 12/27/21 + ]; + foreach ($formats as $format) { + $dt = DateTime::createFromFormat($format, $dateString); + if ($dt) { + return $dt->format('Y-m-d'); + } + } + return $dateString; + } + + private function getUpsStatusOutput() + { + $output = $error = null; + + if ($this->isEnabled()) { + $backend = new Backend(); + $output = trim($backend->configdRun('apcupsd upsstatus')); + if (empty($output)) { + $error = 'Error: empty output from apcaccess'; + } + } else { + $error = 'Error: apcupsd is disabled'; + } + + return array( + 'error' => $error, + 'output' => $output + ); + } + + private function isEnabled() + { + return $this->getModel()->general->Enabled == '1'; + } +} diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/SettingsController.php b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/SettingsController.php new file mode 100644 index 0000000000..a0132319e8 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/SettingsController.php @@ -0,0 +1,41 @@ +view->pick('OPNsense/Apcupsd/index'); + $this->view->generalForm = $this->getForm("general"); + } +} diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/StatusController.php b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/StatusController.php new file mode 100644 index 0000000000..7930cca276 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/StatusController.php @@ -0,0 +1,47 @@ +view->pick('OPNsense/Apcupsd/status'); + } +} diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/forms/general.xml b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/forms/general.xml new file mode 100644 index 0000000000..0aa561920a --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/forms/general.xml @@ -0,0 +1,183 @@ +
    + + apcupsd.general.Enabled + + checkbox + Enable the APC UPS service. + + + apcupsd.general.UPSName + + text + + Specify a name for the UPS for log files, status reports etc., + between 1 and 99 characters in length. + + Name of the UPS for log files, status reports etc. + + + apcupsd.general.UPSCable + + dropdown + Select the type of cable connecting the UPS to the server. + + + apcupsd.general.UPSType + + dropdown + Select the type of UPS in use. You may also need to specify the UPS device below. + + + apcupsd.general.Device + + text + + + usb: leave blank for auto-detection
    + apcsmart or dumb: /dev/tty** (serial connection)
    + net: host:port (remote apcupsd network information server)
    + snmp: host:port:vendor:community
    + pcnet: ipaddr:username:passphrase (SmartSlot card) + ]]> +
    + Path or address, leave blank for USB +
    + + apcupsd.general.Polltime + + text + + + A low setting will improve the daemon's responsiveness to certain events at the cost of higher CPU + utilisation.
    + The default of 60 is appropriate for most situations. + ]]> +
    +
    + + apcupsd.general.BatteryLevel + + text + Apcupsd will shutdown the system during a power failure when the remaining battery charge falls below the + specified percentage. (Default is 5). + + + apcupsd.general.Minutes + + text + + Apcupsd will shutdown the system during a power failure when the remaining runtime on batteries as + internally calculated by the UPS falls below the specified minutes. (Default is 3) + + + + apcupsd.general.Timeout + + text + + + For a Smart-UPS, this should normally be set to zero so that the shutdown time will be determined by the + battery level or remaining runtime.
    + It is also useful for testing apcupsd because you can force a rapid shutdown by setting a small value + (eg. 60) and turning off the power to the UPS. + ]]> +
    +
    + + apcupsd.general.OnBatteryDelay + + text + + The number of seconds from when a power failure is detected until apcupsd reacts with an onbattery event. + (Default is 6). + + true + + + apcupsd.general.Annoy + + text + Time in seconds between annoying users to signoff prior to system shutdown. 0 disables. + true + + + apcupsd.general.AnnoyDelay + + text + Initial delay after power failure before warning users to get off the system. + true + + + apcupsd.general.KillDelay + + text + + + After the specified time, apcupsd will attempt to put the UPS into hibernate mode and kill the power to + the computer.
    + This is for use on operating systems where apcupsd cannot regain control after a shutdown (eg. FreeBSD) + to issue an apcupsd --killpower command.
    + Setting the delay to 0 disables it. + ]]> +
    + true +
    + + apcupsd.general.Netserver + + checkbox + Enables the network information server which is required to obtain the current status information + from the local or remote UPS. + true + + + apcupsd.general.NetserverAddress + + text + 127.0.0.1 is the default + + + Default address is 127.0.0.1 which means only local machine connections are accepted. + ]]> + + true + + + apcupsd.general.NetserverPort + + text + Network port used to send status and event data over the network. + Port 3551 is the default as registered with the IANA. + true + + + apcupsd.general.UPSClass + + dropdown + Normally standalone unless you share an UPS using an APC ShareUPS card. + true + + + apcupsd.general.UPSMode + + dropdown + Normally disable unless you share an UPS using an APC ShareUPS card. + true + + + apcupsd.general.NoLogon + + dropdown + The condition which determines when users are prevented from logging in during a power failure. + true + +
    diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/ACL/ACL.xml b/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/ACL/ACL.xml new file mode 100644 index 0000000000..a911bfa876 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/ACL/ACL.xml @@ -0,0 +1,9 @@ + + + Services: Apcupsd System Monitoring page + + ui/apcupsd/* + api/apcupsd/* + + + diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.php b/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.php new file mode 100644 index 0000000000..98e12f8a36 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.php @@ -0,0 +1,39 @@ + + //OPNsense/apcupsd + 0.0.2 + APC UPS configuration + + + + 0 + Y + + + N + /^([0-9a-zA-Z._\- ]){1,99}$/ + + The name should be 1 to 99 characters and contain only alphanumeric characters, + dashes, underscores, dot or space. + + + + smart + Y + + + + + + + + + + + + + + + + + + + + + + + + apcsmart + Y + + apcsmart + usb + net + snmp + netsnmp + dumb + pcnet + modbus + + + + N + + + Y + 60 + 1 + 86400 + Polltime must be between 1 and 86400. + + + 1 + Y + + + 127.0.0.1 + Y + + + 3551 + Y + + + 6 + Y + 0 + 60 + On battery delay must be between 1 and 60. + + + 5 + Y + 1 + 99 + Battery level must be between 1 and 99 percent. + + + 3 + Y + 1 + 60 + Remaining battery minutes must be between 1 and 60 minutes. + + + 0 + Y + 0 + 360 + Timeout must be between 1 and 360 seconds. + + + 300 + Y + 10 + 360 + Annoy time must be between 10 and 360 seconds. + + + 60 + Y + 10 + 360 + Annoy delay time must be between 10 and 360 seconds. + + + 0 + Y + 0 + 360 + Kill delay time must be between 0 and 360 seconds. + + + standalone + Y + + standalone + shareslave + sharemaster + + + + disable + Y + + disable + share + + + + disable + Y + + disable + timeout + percent + minutes + always + + + + + diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Menu/Menu.xml b/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Menu/Menu.xml new file mode 100644 index 0000000000..557d3f8ab5 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Menu/Menu.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/views/OPNsense/Apcupsd/index.volt b/sysutils/apcupsd/src/opnsense/mvc/app/views/OPNsense/Apcupsd/index.volt new file mode 100644 index 0000000000..ddda5a92ae --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/views/OPNsense/Apcupsd/index.volt @@ -0,0 +1,74 @@ +{# + # Copyright (C) 2021 Dan Lundqvist + # Copyright (C) 2021 David Berry + # Copyright (C) 2021 Nicola Pellegrini + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} +
    + {{ partial('layout_partials/base_form',['fields':generalForm,'id':'frm_GeneralSettings','apply_btn_id':'saveAct'])}} +
    + diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/views/OPNsense/Apcupsd/status.volt b/sysutils/apcupsd/src/opnsense/mvc/app/views/OPNsense/Apcupsd/status.volt new file mode 100644 index 0000000000..951f112a78 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/mvc/app/views/OPNsense/Apcupsd/status.volt @@ -0,0 +1,42 @@ +{# + # Copyright (C) 2021 Dan Lundqvist + # Copyright (C) 2021 David Berry + # Copyright (C) 2021 Nicola Pellegrini + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} +
    No status
    + diff --git a/sysutils/apcupsd/src/opnsense/service/conf/actions.d/actions_apcupsd.conf b/sysutils/apcupsd/src/opnsense/service/conf/actions.d/actions_apcupsd.conf new file mode 100644 index 0000000000..03896d5e33 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/service/conf/actions.d/actions_apcupsd.conf @@ -0,0 +1,29 @@ +[start] +command:/usr/local/etc/rc.d/apcupsd start +parameters: +type:script +message:starting apcupsd + +[stop] +command:/usr/local/etc/rc.d/apcupsd stop +parameters: +type:script +message:stopping apcupsd + +[restart] +command:/usr/local/etc/rc.d/apcupsd restart +parameters: +type:script +message:restarting apcupsd + +[status] +command:/usr/local/etc/rc.d/apcupsd status;exit 0 +parameters: +type:script_output +message:requesting apcupsd status + +[upsstatus] +command:/usr/local/sbin/apcaccess +parameters: +type:script_output +message:requesting UPS Status diff --git a/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/+TARGETS b/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/+TARGETS new file mode 100644 index 0000000000..3ad405f594 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/+TARGETS @@ -0,0 +1,2 @@ +apcupsd:/etc/rc.conf.d/apcupsd +apcupsd.conf:/usr/local/etc/apcupsd/apcupsd.conf diff --git a/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/apcupsd b/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/apcupsd new file mode 100644 index 0000000000..cc639badf7 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/apcupsd @@ -0,0 +1,23 @@ +{% if helpers.exists('OPNsense.apcupsd.general.Enabled') and OPNsense.apcupsd.general.Enabled == "1" %} +apcupsd_enable="YES" +{% else %} +apcupsd_enable="NO" +{% endif %} + +# Hook to post start/restart commands waiting for the pid file for max 3 seconds +# this prevents the status command to erroneously report the service as stopped +# since apcupsd detaches before the pid file creation + +start_postcmd="${name}_post_start_restart" +restart_postcmd="${name}_post_start_restart" + +apcupsd_post_start_restart() +{ + if [ -n "$pidfile" ]; then + i=0 + while [ ! -f "$pidfile" ] && [ "$i" -le 5 ]; do + i=$(( i + 1 )) + sleep 0.5 + done + fi +} diff --git a/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/apcupsd.conf b/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/apcupsd.conf new file mode 100644 index 0000000000..730587a3a4 --- /dev/null +++ b/sysutils/apcupsd/src/opnsense/service/templates/OPNsense/Apcupsd/apcupsd.conf @@ -0,0 +1,356 @@ +## apcupsd.conf v1.1 ## +# +# for apcupsd release 3.14.14 (31 May 2016) - freebsd + +############################################################## +# +# This file is auto-generated - any changes made will be lost +# +############################################################# + +# "apcupsd" POSIX config file + +# +# Note that the apcupsd daemon must be restarted in order for changes to +# this configuration file to become active. +# + +# +# ========= General configuration parameters ============ +# + +# UPSNAME xxx +# Use this to give your UPS a name in log files and such. This +# is particulary useful if you have multiple UPSes. This does not +# set the EEPROM. It should be 8 characters or less. +{% if not helpers.empty('OPNsense.apcupsd.general.UPSName') %} +UPSNAME {{ OPNsense.apcupsd.general.UPSName }} +{% endif %} + +# UPSCABLE +# Defines the type of cable connecting the UPS to your computer. +# +# Possible generic choices for are: +# simple, smart, ether, usb +# +# Or a specific cable model number may be used: +# 940-0119A, 940-0127A, 940-0128A, 940-0020B, +# 940-0020C, 940-0023A, 940-0024B, 940-0024C, +# 940-1524C, 940-0024G, 940-0095A, 940-0095B, +# 940-0095C, 940-0625A, M-04-02-2000 +# +UPSCABLE {{ OPNsense.apcupsd.general.UPSCable }} + +# To get apcupsd to work, in addition to defining the cable +# above, you must also define a UPSTYPE, which corresponds to +# the type of UPS you have (see the Description for more details). +# You must also specify a DEVICE, sometimes referred to as a port. +# For USB UPSes, please leave the DEVICE directive blank. For +# other UPS types, you must specify an appropriate port or address. +# +# UPSTYPE DEVICE Description +# apcsmart /dev/tty** Newer serial character device, appropriate for +# SmartUPS models using a serial cable (not USB). +# +# usb Most new UPSes are USB. A blank DEVICE +# setting enables autodetection, which is +# the best choice for most installations. +# +# net hostname:port Network link to a master apcupsd through apcupsd's +# Network Information Server. This is used if the +# UPS powering your computer is connected to a +# different computer for monitoring. +# +# snmp hostname:port:vendor:community +# SNMP network link to an SNMP-enabled UPS device. +# Hostname is the ip address or hostname of the UPS +# on the network. Vendor can be can be "APC" or +# "APC_NOTRAP". "APC_NOTRAP" will disable SNMP trap +# catching; you usually want "APC". Port is usually +# 161. Community is usually "private". +# +# netsnmp hostname:port:vendor:community +# OBSOLETE +# Same as SNMP above but requires use of the +# net-snmp library. Unless you have a specific need +# for this old driver, you should use 'snmp' instead. +# +# dumb /dev/tty** Old serial character device for use with +# simple-signaling UPSes. +# +# pcnet ipaddr:username:passphrase:port +# PowerChute Network Shutdown protocol which can be +# used as an alternative to SNMP with the AP9617 +# family of smart slot cards. ipaddr is the IP +# address of the UPS management card. username and +# passphrase are the credentials for which the card +# has been configured. port is the port number on +# which to listen for messages from the UPS, normally +# 3052. If this parameter is empty or missing, the +# default of 3052 will be used. +# +# modbus /dev/tty** Serial device for use with newest SmartUPS models +# supporting the MODBUS protocol. +# modbus Leave the DEVICE setting blank for MODBUS over USB +# or set to the serial number of the UPS to ensure +# that apcupsd binds to that particular unit +# (helpful if you have more than one USB UPS). +# +UPSTYPE {{ OPNsense.apcupsd.general.UPSType|default("apcsmart") }} +DEVICE {{ OPNsense.apcupsd.general.Device }} + +# POLLTIME +# Interval (in seconds) at which apcupsd polls the UPS for status. This +# setting applies both to directly-attached UPSes (UPSTYPE apcsmart, usb, +# dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting +# will improve apcupsd's responsiveness to certain events at the cost of +# higher CPU utilization. The default of 60 is appropriate for most +# situations. +POLLTIME {{ OPNsense.apcupsd.general.Polltime|default("60") }} + +# LOCKFILE +# Path for device lock file. This is the directory into which the lock file +# will be written. The directory must already exist; apcupsd will not create +# it. The actual name of the lock file is computed from DEVICE. +# Not used on Win32. +LOCKFILE /var/spool/lock + +# SCRIPTDIR +# Directory in which apccontrol and event scripts are located. +SCRIPTDIR /usr/local/etc/apcupsd + +# PWRFAILDIR +# Directory in which to write the powerfail flag file. This file +# is created when apcupsd initiates a system shutdown and is +# checked in the OS halt scripts to determine if a killpower +# (turning off UPS output power) is required. +PWRFAILDIR /var/run + +# NOLOGINDIR +# Directory in which to write the nologin file. The existence +# of this flag file tells the OS to disallow new logins. +NOLOGINDIR /var/run + + +# +# ======== Configuration parameters used during power failures ========== +# + +# The ONBATTERYDELAY is the time in seconds from when a power failure +# is detected until we react to it with an onbattery event. +# +# This means that, apccontrol will be called with the powerout argument +# immediately when a power failure is detected. However, the +# onbattery argument is passed to apccontrol only after the +# ONBATTERYDELAY time. If you don't want to be annoyed by short +# powerfailures, make sure that apccontrol powerout does nothing +# i.e. comment out the wall. +ONBATTERYDELAY {{ OPNsense.apcupsd.general.OnBatteryDelay|default("6") }} + +# +# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so +# the first that occurs will cause the initation of a shutdown. +# + +# If during a power failure, the remaining battery percentage +# (as reported by the UPS) is below or equal to BATTERYLEVEL, +# apcupsd will initiate a system shutdown. +BATTERYLEVEL {{ OPNsense.apcupsd.general.BatteryLevel|default("5") }} + +# If during a power failure, the remaining runtime in minutes +# (as calculated internally by the UPS) is below or equal to MINUTES, +# apcupsd, will initiate a system shutdown. +MINUTES {{ OPNsense.apcupsd.general.Minutes|default("3") }} + +# If during a power failure, the UPS has run on batteries for TIMEOUT +# many seconds or longer, apcupsd will initiate a system shutdown. +# A value of 0 disables this timer. +# +# Note, if you have a Smart UPS, you will most likely want to disable +# this timer by setting it to zero. That way, you UPS will continue +# on batteries until either the % charge remaing drops to or below BATTERYLEVEL, +# or the remaining battery runtime drops to or below MINUTES. Of course, +# if you are testing, setting this to 60 causes a quick system shutdown +# if you pull the power plug. +# If you have an older dumb UPS, you will want to set this to less than +# the time you know you can run on batteries. +TIMEOUT {{ OPNsense.apcupsd.general.Timeout|default("0") }} + +# Time in seconds between annoying users to signoff prior to +# system shutdown. 0 disables. +ANNOY {{ OPNsense.apcupsd.general.Annoy|default("300") }} + +# Initial delay after power failure before warning users to get +# off the system. +ANNOYDELAY {{ OPNsense.apcupsd.general.AnnoyDelay|default("60") }} + +# The condition which determines when users are prevented from +# logging in during a power failure. +# NOLOGON [ disable | timeout | percent | minutes | always ] +NOLOGON {{ OPNsense.apcupsd.general.NoLogon|default("disable") }} + +# If KILLDELAY is non-zero, apcupsd will continue running after a +# shutdown has been requested, and after the specified time in +# seconds attempt to kill the power. This is for use on systems +# where apcupsd cannot regain control after a shutdown. +# KILLDELAY 0 disables +KILLDELAY {{ OPNsense.apcupsd.general.KillDelay|default("0") }} + +# +# ==== Configuration statements for Network Information Server ==== +# + +# NETSERVER [ on | off ] on enables, off disables the network +# information server. If netstatus is on, a network information +# server process will be started for serving the STATUS and +# EVENT data over the network (used by CGI programs). +{% if helpers.exists('OPNsense.apcupsd.general.Netserver') and OPNsense.apcupsd.general.Netserver == "1" %} +NETSERVER on +{% else %} +NETSERVER off +{% endif %} + +# NISIP +# IP address on which NIS server will listen for incoming connections. +# This is useful if your server is multi-homed (has more than one +# network interface and IP address). Default value is 0.0.0.0 which +# means any incoming request will be serviced. Alternatively, you can +# configure this setting to any specific IP address of your server and +# NIS will listen for connections only on that interface. Use the +# loopback address (127.0.0.1) to accept connections only from the +# local machine. +NISIP {{ OPNsense.apcupsd.general.NetserverAddress|default("127.0.0.1") }} + +# NISPORT default is 3551 as registered with the IANA +# port to use for sending STATUS and EVENTS data over the network. +# It is not used unless NETSERVER is on. If you change this port, +# you will need to change the corresponding value in the cgi directory +# and rebuild the cgi programs. +NISPORT {{ OPNsense.apcupsd.general.NetserverPort|default("3551") }} + +# If you want the last few EVENTS to be available over the network +# by the network information server, you must define an EVENTSFILE. +EVENTSFILE /var/log/apcupsd.events + +# EVENTSFILEMAX +# By default, the size of the EVENTSFILE will be not be allowed to exceed +# 10 kilobytes. When the file grows beyond this limit, older EVENTS will +# be removed from the beginning of the file (first in first out). The +# parameter EVENTSFILEMAX can be set to a different kilobyte value, or set +# to zero to allow the EVENTSFILE to grow without limit. +EVENTSFILEMAX 10 + +# +# ========== Configuration statements used if sharing ============= +# a UPS with more than one machine + +# +# Remaining items are for ShareUPS (APC expansion card) ONLY +# + +# UPSCLASS [ standalone | shareslave | sharemaster ] +# Normally standalone unless you share an UPS using an APC ShareUPS +# card. +UPSCLASS {{ OPNsense.apcupsd.general.UPSClass|default("standalone") }} + +# UPSMODE [ disable | share ] +# Normally disable unless you share an UPS using an APC ShareUPS card. +UPSMODE {{ OPNsense.apcupsd.general.UPSMode|default("disable") }} + +# +# ===== Configuration statements to control apcupsd system logging ======== +# + +# Time interval in seconds between writing the STATUS file; 0 disables +STATTIME 0 + +# Location of STATUS file (written to only if STATTIME is non-zero) +STATFILE /var/log/apcupsd.status + +# LOGSTATS [ on | off ] on enables, off disables +# Note! This generates a lot of output, so if +# you turn this on, be sure that the +# file defined in syslog.conf for LOG_NOTICE is a named pipe. +# You probably do not want this on. +LOGSTATS off + +# Time interval in seconds between writing the DATA records to +# the log file. 0 disables. +DATATIME 0 + +# FACILITY defines the logging facility (class) for logging to syslog. +# If not specified, it defaults to "daemon". This is useful +# if you want to separate the data logged by apcupsd from other +# programs. +#FACILITY DAEMON + +# +# ========== Configuration statements used in updating the UPS EPROM ========= +# + +# +# These statements are used only by apctest when choosing "Set EEPROM with conf +# file values" from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD. +# + +# UPS name, max 8 characters +#UPSNAME UPS_IDEN + +# Battery date - 8 characters +#BATTDATE mm/dd/yy + +# Sensitivity to line voltage quality (H cause faster transfer to batteries) +# SENSITIVITY H M L (default = H) +#SENSITIVITY H + +# UPS delay after power return (seconds) +# WAKEUP 000 060 180 300 (default = 0) +#WAKEUP 60 + +# UPS Grace period after request to power off (seconds) +# SLEEP 020 180 300 600 (default = 20) +#SLEEP 180 + +# Low line voltage causing transfer to batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 106 103 100 097 +# M 177 172 168 182 +# A 092 090 088 086 +# I 208 204 200 196 (default = 0 => not valid) +#LOTRANSFER 208 + +# High line voltage causing transfer to batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 127 130 133 136 +# M 229 234 239 224 +# A 108 110 112 114 +# I 253 257 261 265 (default = 0 => not valid) +#HITRANSFER 253 + +# Battery charge needed to restore power +# RETURNCHARGE 00 15 50 90 (default = 15) +#RETURNCHARGE 15 + +# Alarm delay +# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never +# BEEPSTATE 0 T L N (default = 0) +#BEEPSTATE T + +# Low battery warning delay in minutes +# LOWBATT 02 05 07 10 (default = 02) +#LOWBATT 2 + +# UPS Output voltage when running on batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 115 +# M 208 +# A 100 +# I 230 240 220 225 (default = 0 => not valid) +#OUTPUTVOLTS 230 + +# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on +# SELFTEST 336 168 ON OFF (default = 336) +#SELFTEST 336 diff --git a/sysutils/apcupsd/src/www/widgets/include/apcupsd.inc b/sysutils/apcupsd/src/www/widgets/include/apcupsd.inc new file mode 100644 index 0000000000..26fb46664e --- /dev/null +++ b/sysutils/apcupsd/src/www/widgets/include/apcupsd.inc @@ -0,0 +1,4 @@ + + + + + + + +
    + + From fbc31e1b9f7a4061fc9eae87271ddf36925406b9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 2 Jun 2022 09:32:10 +0200 Subject: [PATCH 1060/3088] sysutils/apcupsd: update via automated scripts --- LICENSE | 3 +++ README.md | 1 + .../controllers/OPNsense/Apcupsd/Api/ServiceController.php | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index b0c9debb93..60ca98df55 100644 --- a/LICENSE +++ b/LICENSE @@ -5,7 +5,9 @@ Copyright (c) 2021 Axelrtgs Copyright (c) 2019 Cloudfence - Julio Camargo (JCC) Copyright (c) 2005-2006 Colin Smith Copyright (c) 2020 D. Domig +Copyright (c) 2021 Dan Lundqvist Copyright (c) 2011 Dan Myers +Copyright (c) 2021 David Berry Copyright (c) 2017-2018 David Harrigan Copyright (c) 2021 David Hughes Copyright (c) 2014-2022 Deciso B.V. @@ -34,6 +36,7 @@ Copyright (c) 2022 Markus Reiter Copyright (c) 2020 Martin Wasley Copyright (c) 2022 Marvo2011 Copyright (c) 2017-2021 Michael Muenz +Copyright (c) 2021 Nicola Pellegrini Copyright (c) 2021 Nim G Copyright (c) 2004-2012 Scott Ullrich Copyright (c) 2010 Seth Mos diff --git a/README.md b/README.md index 9b78a2e005..f2d58028c8 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ security/softether -- Cross-platform Multi-protocol VPN Program (development onl security/stunnel -- Stunnel TLS proxy security/tinc -- Tinc VPN security/tor -- The Onion Router +sysutils/apcupsd -- APCUPSD - APC UPS daemon (development only) sysutils/api-backup -- Provide the functionality to download the config.xml sysutils/apuled -- PC Engine APU LED control (development only) sysutils/boot-delay -- Apply a persistent 10 second boot delay (pending removal) diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/ServiceController.php b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/ServiceController.php index ea6380e965..ad653efdba 100644 --- a/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/ServiceController.php +++ b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/Api/ServiceController.php @@ -96,7 +96,8 @@ private function parseUpsStatus($statusOutput) return $status; } - private function tryParseDateTime($dateTimeString) { + private function tryParseDateTime($dateTimeString) + { $formats = [ 'Y-m-d H:i:s P', // 2021-12-27 17:51:42 +0100 'D M d H:i:s T Y' // Sat Sep 16 17:13:00 CEST 2000 @@ -110,7 +111,8 @@ private function tryParseDateTime($dateTimeString) { return $dateTimeString; } - private function tryParseDate($dateString) { + private function tryParseDate($dateString) + { $formats = [ 'Y-m-d', // 2021-12-27 'm/d/y', // 12/27/21 From 739553989c9cdeef75647a33e76ffbc8e99bbde2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 2 Jun 2022 09:37:43 +0200 Subject: [PATCH 1061/3088] dns/ddclient: prep for next update --- dns/ddclient/Makefile | 2 +- dns/ddclient/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index f3fe1c2413..f1cbd72ccd 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.5 +PLUGIN_VERSION= 1.6 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 7c31315947..91dba346b2 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,10 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.6 + +* Add Gandi support (contributed by Neozlag) + 1.5 * Add service control, XMLRPC registration and syslog target From 3370683d1e377f0c511bb5f8a73e610d3b25ca49 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 3 Jun 2022 19:19:19 +0200 Subject: [PATCH 1062/3088] net/frr - BGP weight option and bug fix for disable-connected-check option (#2993) * net/frr add bgp weight attribute and move disable-connected-check to the correct place. it looked like "community lists" missed a toggle action, added that as well. --- .../controllers/OPNsense/Quagga/Api/BgpController.php | 5 +++++ .../OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml | 7 +++++++ .../src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml | 6 ++++++ .../opnsense/service/templates/OPNsense/Quagga/bgpd.conf | 9 ++++++--- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php index 9f505632e1..79de7caf46 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php @@ -197,6 +197,11 @@ public function setRoutemapAction($uuid) return $this->setBase('routemap', 'routemaps.routemap', $uuid); } + public function toggleCommunitylistAction($uuid) + { + return $this->toggleBase('communitylists.communitylist', $uuid); + } + public function toggleNeighborAction($uuid) { return $this->toggleBase('neighbors.neighbor', $uuid); diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml index 1af5adf4a3..19f13cca10 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml @@ -29,6 +29,13 @@ true Set a password for BGP authentication.
    + + neighbor.weight + + text + true + Specify a default weight value for the neighbor’s routes. + neighbor.localip diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml index f22fe8cd22..db890d0544 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml @@ -60,6 +60,12 @@ N + + + N + 0 + 65535 + N diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index b7f585aff0..a5fb926d4e 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -60,6 +60,12 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if 'password' in neighbor and neighbor.password != '' %} neighbor {{ neighbor.address }} password {{ neighbor.password }} {% endif %} +{% if 'weight' in neighbor and neighbor.weight != '' %} + neighbor {{ neighbor.address }} weight {{ neighbor.weight }} +{% endif %} +{% if 'disable_connected_check' in neighbor and neighbor.disable_connected_check == '1' %} + neighbor {{ neighbor.address }} disable-connected-check +{% endif %} {% if ':' not in neighbor.address and 'updatesource' in neighbor and neighbor.updatesource != '' %} neighbor {{ neighbor.address }} update-source {{ physical_interface(neighbor.updatesource) }} {% endif %} @@ -106,9 +112,6 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if 'asoverride' in neighbor and neighbor.asoverride == '1' %} neighbor {{ neighbor.address }} as-override {% endif %} -{% if 'disable_connected_check' in neighbor and neighbor.disable_connected_check == '1' %} - neighbor {{ neighbor.address }} disable-connected-check -{% endif %} {% if neighbor.linkedPrefixlistIn|default("") != "" %} {% for prefixlist in neighbor.linkedPrefixlistIn.split(",") %} {% set prefixlist2_data = helpers.getUUID(prefixlist) %} From bce044f538db7b67893eafce6f25e6545afce6eb Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 6 Jun 2022 13:45:31 +0200 Subject: [PATCH 1063/3088] dns / ddclient - Add current ip address and updated timestamp to search api and grid --- dns/ddclient/Makefile | 2 +- dns/ddclient/pkg-descr | 4 + .../DynDNS/Api/AccountsController.php | 5 +- .../mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 2 +- .../DynDNS/FieldTypes/AccountField.php | 81 +++++++++++++++++++ .../mvc/app/views/OPNsense/DynDNS/index.volt | 2 + .../src/opnsense/scripts/ddclient/stats | 53 ++++++++++++ .../conf/actions.d/actions_ddclient.conf | 5 ++ 8 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php create mode 100755 dns/ddclient/src/opnsense/scripts/ddclient/stats diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index f1cbd72ccd..1c97be904b 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.6 +PLUGIN_VERSION= 1.7 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 91dba346b2..0464eccabb 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,10 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.7 + +* Add current ip address and updated timestamp to search api and grid + 1.6 * Add Gandi support (contributed by Neozlag) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php index 08c21b694c..97c7f40607 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/AccountsController.php @@ -41,7 +41,10 @@ public function searchItemAction() { $result = $this->searchBase( "accounts.account", - ['enabled', 'service', 'description', 'username', 'hostnames', 'use_interface', 'interface', 'protocol'], + [ + 'enabled', 'service', 'description', 'username', 'hostnames', 'use_interface', + 'interface', 'protocol', 'current_ip', 'current_mtime' + ], "description" ); foreach ($result['rows'] as &$row) { diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 003426fc8f..c28271bbe6 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -26,7 +26,7 @@ - + 1 Y diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php new file mode 100644 index 0000000000..24d856e99e --- /dev/null +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php @@ -0,0 +1,81 @@ +setInternalIsVirtual(); + $current_mtime = new TextField(); + $current_mtime->setInternalIsVirtual(); + + if (!empty((string)$node->hostnames)) { + foreach (explode(",", (string)$node->hostnames) as $hostname) { + if (!empty((self::$current_stats[$hostname]))) { + $stats = self::$current_stats[$hostname]; + $current_ip->setValue($stats['ip']); + $current_mtime->setValue(date('c', $stats['mtime'])); + break; + } + } + } + $node->addChildNode('current_ip', $current_ip); + $node->addChildNode('current_mtime', $current_mtime); + } + + protected function actionPostLoadingEvent() + { + if (self::$current_stats === null) { + self::$current_stats = []; + $stats = json_decode((new Backend())->configdRun('ddclient statistics'), true); + if (!empty($stats) && !empty($stats['hosts'])) { + self::$current_stats = $stats['hosts']; + } + } + foreach ($this->internalChildnodes as $node) { + if (!$node->getInternalIsVirtual()) { + $this->addStatsFields($node); + } + } + return parent::actionPostLoadingEvent(); + } +} diff --git a/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt b/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt index d8f64ad272..baaefe65d4 100644 --- a/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt +++ b/dns/ddclient/src/opnsense/mvc/app/views/OPNsense/DynDNS/index.volt @@ -105,6 +105,8 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Hostnames') }} {{ lang._('Username') }} {{ lang._('Interface') }} + {{ lang._('Current IP') }} + {{ lang._('Updated') }} {{ lang._('Description') }} {{ lang._('Commands') }} diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/stats b/dns/ddclient/src/opnsense/scripts/ddclient/stats new file mode 100755 index 0000000000..891e3ea876 --- /dev/null +++ b/dns/ddclient/src/opnsense/scripts/ddclient/stats @@ -0,0 +1,53 @@ +#!/usr/local/bin/python3 + +""" + Copyright (c) 2022 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" + +import os +import json + +filename = "/var/tmp/ddclient.cache" + +result = {"hosts": {}} +if os.path.isfile(filename): + with open(filename, "r") as fhandle: + for idx, row in enumerate(fhandle): + if idx == 0: + result['version'] = row.strip('#\n ') + elif idx == 1: + tmp = row.split('(')[-1].split(')')[0] + if tmp.isdigit(): + result['updated'] = int(tmp) + elif tmp.startswith('#') is False: + record = {} + for pair in row.split(','): + parts = pair.split('=') + if len(parts) == 2: + record[parts[0]] = parts[1] + if 'host' in record: + result['hosts'][record['host']] = record + +print(json.dumps(result)) diff --git a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf index 5ceb8a7872..d59aaf852d 100644 --- a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf +++ b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf @@ -23,3 +23,8 @@ description:Restart ddclient service command:/usr/local/etc/rc.d/ddclient reload type:script message:reload ddclient configuration + +[statistics] +command:/usr/local/opnsense/scripts/ddclient/stats +type:script_output +message:get ddclient statistics From 4273f2ff1704c54ccaefe94bfe3e773b5475b422 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 8 Jun 2022 11:43:08 +0200 Subject: [PATCH 1064/3088] devel/debug: appease xdebug warning --- devel/debug/Makefile | 2 +- devel/debug/src/etc/php/ext-20-xdebug-settings.ini | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devel/debug/Makefile b/devel/debug/Makefile index 52d7ef7886..febb5db935 100644 --- a/devel/debug/Makefile +++ b/devel/debug/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= debug -PLUGIN_VERSION= 1.4 +PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= Debugging Tools PLUGIN_DEPENDS= php${PLUGIN_PHP}-pear-PHP_CodeSniffer \ php${PLUGIN_PHP}-pecl-xdebug \ diff --git a/devel/debug/src/etc/php/ext-20-xdebug-settings.ini b/devel/debug/src/etc/php/ext-20-xdebug-settings.ini index 30ab5e7282..7821833984 100644 --- a/devel/debug/src/etc/php/ext-20-xdebug-settings.ini +++ b/devel/debug/src/etc/php/ext-20-xdebug-settings.ini @@ -1,4 +1,4 @@ xdebug.mode = profile; -xdebug.start_with_request = trigger; +xdebug.output_dir = /tmp xdebug.profiler_output_name = cachegrind.out.%t.%p -xdebug.profiler_output_dir = /tmp +xdebug.start_with_request = trigger; From 216ecc2c5c58c7b1d974f4f5ef9d00c65230e0f1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 9 Jun 2022 15:32:31 +0200 Subject: [PATCH 1065/3088] net/frr: document latest change, no version bump --- net/frr/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 340c620761..6b2d8bd829 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -14,7 +14,7 @@ Plugin Changelog 1.29 -* Add disable-connected-check option +* Add disable-connected-check option and BGP weight option 1.28 From 285dcd88c3a99f1d38c4f7ad1d8a4546daa08170 Mon Sep 17 00:00:00 2001 From: corentin Date: Mon, 20 Jun 2022 14:56:23 +0200 Subject: [PATCH 1066/3088] read Filter property instead of FilterRule --- .../opnsense/mvc/app/models/OPNsense/Firewall/Filter.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php index a6bf1d4a64..ed631c16aa 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -113,12 +113,12 @@ public function rollback($revision) { $filename = Config::getInstance()->getBackupFilename($revision); if ($filename) { - // fiddle with the dom, copy OPNsense->Firewall->FilterRule from backup to current config + // fiddle with the dom, copy OPNsense->Firewall->Filter from backup to current config $sourcexml = simplexml_load_file($filename); - if ($sourcexml->OPNsense->Firewall->FilterRule) { - $sourcedom = dom_import_simplexml($sourcexml->OPNsense->Firewall->FilterRule); + if ($sourcexml->OPNsense->Firewall->Filter) { + $sourcedom = dom_import_simplexml($sourcexml->OPNsense->Firewall->Filter); $targetxml = Config::getInstance()->object(); - $targetdom = dom_import_simplexml($targetxml->OPNsense->Firewall->FilterRule); + $targetdom = dom_import_simplexml($targetxml->OPNsense->Firewall->Filter); $node = $targetdom->ownerDocument->importNode($sourcedom, true); $targetdom->parentNode->replaceChild($node, $targetdom); Config::getInstance()->save(); From 339993680de4453962d21546a181550bd1cc0f0f Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 24 Jun 2022 20:11:31 +0200 Subject: [PATCH 1067/3088] dns/ddclient - validate statistics before usage to prevent missing fields, for now let's assume mtime is always filled, ip apparantly isn't. ref https://forum.opnsense.org/index.php?topic=28835.msg140355 --- dns/ddclient/Makefile | 1 + .../mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 1c97be904b..a6ffcf4f3b 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.7 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php index 24d856e99e..b11bcaf7c0 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php @@ -50,7 +50,7 @@ private function addStatsFields($node) if (!empty((string)$node->hostnames)) { foreach (explode(",", (string)$node->hostnames) as $hostname) { - if (!empty((self::$current_stats[$hostname]))) { + if (!empty((self::$current_stats[$hostname]) && !empty(self::$current_stats[$hostname]['ip']))) { $stats = self::$current_stats[$hostname]; $current_ip->setValue($stats['ip']); $current_mtime->setValue(date('c', $stats['mtime'])); From a357676b926ba9db66bd72c246e9e78bbfaebfaa Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Sat, 25 Jun 2022 11:42:14 +0300 Subject: [PATCH 1068/3088] njs0.7.1 compat. (#3016) --- www/nginx/src/opnsense/scripts/nginx/ngx_functions.js | 2 ++ .../src/opnsense/service/templates/OPNsense/Nginx/http.conf | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js b/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js index 5f17d76ee9..3acd7d9dbc 100755 --- a/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js @@ -47,3 +47,5 @@ function check_intercept(r) { } return tls_result.status; } + +export default { check_intercept }; diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf index 13e5659a99..735bab34d2 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf @@ -21,8 +21,8 @@ log_format anonymized ':: - $remote_user [$time_local] "$request" ' #tcp_nopush on; # https intercept detection -js_include /usr/local/opnsense/scripts/nginx/ngx_functions.js; -js_set $tls_intercepted check_intercept; +js_import /usr/local/opnsense/scripts/nginx/ngx_functions.js; +js_set $tls_intercepted ngx_functions.check_intercept; # 200M should be big enough for file servers etc. client_max_body_size 200M; From d83e7d398f1b63fe6330a39358ef701c94422104 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 28 Jun 2022 07:30:53 +0200 Subject: [PATCH 1069/3088] www/nginx: bump revision after fix --- www/nginx/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index ecfd00ffea..3ddb8eabb7 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= nginx PLUGIN_VERSION= 1.28 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From 946583e47fe6b890d216f897741845c9ca4a77f5 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 28 Jun 2022 19:38:29 +0200 Subject: [PATCH 1070/3088] dns/ddclient - validate statistics before usage to prevent missing fields [2], typo in previous fix. closes https://github.com/opnsense/plugins/issues/3019 --- .../mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php index b11bcaf7c0..54d3ed624e 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/FieldTypes/AccountField.php @@ -50,7 +50,7 @@ private function addStatsFields($node) if (!empty((string)$node->hostnames)) { foreach (explode(",", (string)$node->hostnames) as $hostname) { - if (!empty((self::$current_stats[$hostname]) && !empty(self::$current_stats[$hostname]['ip']))) { + if (!empty(self::$current_stats[$hostname]) && !empty(self::$current_stats[$hostname]['ip'])) { $stats = self::$current_stats[$hostname]; $current_ip->setValue($stats['ip']); $current_mtime->setValue(date('c', $stats['mtime'])); From 277e06db45cb4f8ed76c471c7d4d268e6df724c8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 28 Jun 2022 20:48:14 +0200 Subject: [PATCH 1071/3088] dns/ddclient: bump revision --- dns/ddclient/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index a6ffcf4f3b..43b4e3003e 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org From 8e7ec17828f3519524e2810f6264d7ffca1c002e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Jun 2022 10:09:47 +0200 Subject: [PATCH 1072/3088] dns/ddclient: update for force addition Could be added to GUI, but needs testing first. --- dns/ddclient/Makefile | 3 +-- dns/ddclient/pkg-descr | 5 +++++ .../conf/actions.d/actions_ddclient.conf | 20 ++++++++++++++++--- .../templates/OPNsense/ddclient/ddclient.conf | 1 - .../templates/OPNsense/ddclient/rc.conf.d | 1 + 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 43b4e3003e..2c0b66f552 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.8 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 0464eccabb..ff56d64fd1 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,11 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.8 + +* Add a force action (also available via cron) +* Fix expected permission on ddclient.conf + 1.7 * Add current ip address and updated timestamp to search api and grid diff --git a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf index d59aaf852d..99e5b6b386 100644 --- a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf +++ b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf @@ -1,5 +1,7 @@ [start] -command:/usr/local/etc/rc.d/ddclient start +command: + chmod 600 /usr/local/etc/ddclient.conf; + /usr/local/etc/rc.d/ddclient start type:script message:starting ddclient @@ -14,16 +16,28 @@ type:script_output message:get ddclient status [restart] -command:/usr/local/etc/rc.d/ddclient restart +command: + chmod 600 /usr/local/etc/ddclient.conf; + /usr/local/etc/rc.d/ddclient restart type:script message:restarting ddclient description:Restart ddclient service [reload] -command:/usr/local/etc/rc.d/ddclient reload +command: + chmod 600 /usr/local/etc/ddclient.conf; + /usr/local/etc/rc.d/ddclient reload type:script message:reload ddclient configuration +[force] +command: + chmod 600 /usr/local/etc/ddclient.conf; + /usr/local/sbin/ddclient -force +type:script +message:forcing ddclient update +desciption:Force ddclient update + [statistics] command:/usr/local/opnsense/scripts/ddclient/stats type:script_output diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 27d26193d7..8a6b263eb3 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -1,5 +1,4 @@ {% from 'OPNsense/Macros/interface.macro' import physical_interface %} -daemon={{OPNsense.DynDNS.general.daemon_delay|default('300')}} syslog=yes # log update msgs to syslog pid=/var/run/ddclient.pid # record PID in file. {% if not helpers.empty('OPNsense.DynDNS.general.verbose') %} diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d index c89c76bd53..f4c7697564 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d @@ -1,5 +1,6 @@ {% if not helpers.empty('OPNsense.DynDNS.general.enabled') %} ddclient_enable="YES" +ddclient_flags="-daemon {{OPNsense.DynDNS.general.daemon_delay|default('300')}}" {% else %} ddclient_enable="NO" {% endif %} From 30523766e8a63fe847a45a58e7c127838859a468 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Jun 2022 12:49:03 +0200 Subject: [PATCH 1073/3088] dns/ddclient: reload does not exist, status/stop/restart unreliable The rc.d file needs to be changed in FreeBSD but for now work around this in the easiest way possible. --- .../service/conf/actions.d/actions_ddclient.conf | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf index 99e5b6b386..8e5e6c59c6 100644 --- a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf +++ b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf @@ -6,30 +6,24 @@ type:script message:starting ddclient [stop] -command:/usr/local/etc/rc.d/ddclient stop +command:pkill -F /var/run/ddclient.pid 2> /dev/null; exit 0 type:script message:stopping ddclient [status] -command:/usr/local/etc/rc.d/ddclient status; exit 0 +command:pgrep -qF /var/run/ddclient.pid && echo "ddclient is running" || echo "ddclient is not running" type:script_output message:get ddclient status [restart] command: chmod 600 /usr/local/etc/ddclient.conf; + pkill -F /var/run/ddclient.pid 2> /dev/null; /usr/local/etc/rc.d/ddclient restart type:script message:restarting ddclient description:Restart ddclient service -[reload] -command: - chmod 600 /usr/local/etc/ddclient.conf; - /usr/local/etc/rc.d/ddclient reload -type:script -message:reload ddclient configuration - [force] command: chmod 600 /usr/local/etc/ddclient.conf; From ff9c5e2edc0b428c41203525dce381fa4b39b134 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Jun 2022 12:49:03 +0200 Subject: [PATCH 1074/3088] dns/ddclient: stop trying to reload --- .../controllers/OPNsense/DynDNS/Api/ServiceController.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/ServiceController.php b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/ServiceController.php index a2fd9644c5..1804fb3d82 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/ServiceController.php +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/Api/ServiceController.php @@ -41,9 +41,4 @@ class ServiceController extends ApiMutableServiceControllerBase protected static $internalServiceEnabled = 'general.enabled'; protected static $internalServiceTemplate = 'OPNsense/ddclient'; protected static $internalServiceName = 'ddclient'; - - protected function reconfigureForceRestart() - { - return 0; - } } From fc2c08b029e6625be9ba12229093a7c674308ab3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Jun 2022 13:01:22 +0200 Subject: [PATCH 1075/3088] dns/dyndns: limit lookup time to 10 seconds E.g. https doesn't work with checkip and would hang forever. --- dns/ddclient/src/opnsense/scripts/ddclient/checkip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/checkip b/dns/ddclient/src/opnsense/scripts/ddclient/checkip index af6d07f05d..f68ec76b8d 100755 --- a/dns/ddclient/src/opnsense/scripts/ddclient/checkip +++ b/dns/ddclient/src/opnsense/scripts/ddclient/checkip @@ -72,7 +72,7 @@ if __name__ == '__main__': inputargs = parser.parse_args() # use curl to fetch data, so we can optionally use "--interface" - params = ['/usr/local/bin/curl'] + params = ['/usr/local/bin/curl', '-m', '10'] if inputargs.interface.strip() != "": params.append("--interface") params.append(inputargs.interface) From 8f062c3a86871279f4ec201c78e3b94cb9353237 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Jun 2022 13:06:54 +0200 Subject: [PATCH 1076/3088] dns/ddclient: document changes --- dns/ddclient/pkg-descr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index ff56d64fd1..c6548b9399 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -10,6 +10,8 @@ Plugin Changelog * Add a force action (also available via cron) * Fix expected permission on ddclient.conf +* Make service status and stop more reliable +* Time out checkip script after 10 seconds 1.7 From 99c4dbd474aa4ca59ae423cf2f4b42d77d8ec3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Wed, 29 Jun 2022 14:22:54 +0200 Subject: [PATCH 1077/3088] net-mgmt/telegraf: Allow to specify ping count (#2374) Telegraf by default sends one ICMP packet, to make use of fields like `standard_deviation_ms` or `average_response_ms` we need more than one value. --- .../controllers/OPNsense/Telegraf/forms/input.xml | 12 ++++++++++++ .../mvc/app/models/OPNsense/Telegraf/Input.xml | 6 ++++++ .../templates/OPNsense/Telegraf/telegraf.conf | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml index 7f318d9c2b..9cd77699fc 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml @@ -91,6 +91,12 @@ checkbox Ping Hosts using IPv4 and measure the metrics. + + input.ping_count + + text + Number of ping packets to send per interval. Corresponds to the "-c" option of the ping command. + input.ping_hosts @@ -105,6 +111,12 @@ checkbox Ping Hosts using IPv6 and measure the metrics. + + input.ping6_count + + text + Number of ping packets to send per interval. Corresponds to the "-c" option of the ping command. + input.ping6_hosts diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml index 3e4f6e85d0..0c7b08334a 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml @@ -63,6 +63,9 @@ 0 N + + N + N @@ -70,6 +73,9 @@ 0 N + + N + N diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index 51050038f9..7314590c7b 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -234,6 +234,9 @@ {% if helpers.exists('OPNsense.telegraf.input.ping_hosts') and OPNsense.telegraf.input.ping_hosts != '' %} urls = [{{ "'" + ("','".join(OPNsense.telegraf.input.ping_hosts.split(','))) + "'" }}] {% endif %} +{% if helpers.exists('OPNsense.telegraf.input.ping_count') and OPNsense.telegraf.input.ping_count != '' %} + count = {{ OPNsense.telegraf.input.ping_count }} +{% endif %} {% endif %} {% if helpers.exists('OPNsense.telegraf.input.ping6') and OPNsense.telegraf.input.ping6 == '1' %} @@ -243,6 +246,9 @@ {% if helpers.exists('OPNsense.telegraf.input.ping6_hosts') and OPNsense.telegraf.input.ping6_hosts != '' %} urls = [{{ "'" + ("','".join(OPNsense.telegraf.input.ping6_hosts.split(','))) + "'" }}] {% endif %} +{% if helpers.exists('OPNsense.telegraf.input.ping6_count') and OPNsense.telegraf.input.ping6_count != '' %} + count = {{ OPNsense.telegraf.input.ping6_count }} +{% endif %} {% endif %} {% if helpers.exists('OPNsense.telegraf.input.haproxy') and OPNsense.telegraf.input.haproxy == '1' %} From 22e89aaf76f82487ee192a11024bf920017e9453 Mon Sep 17 00:00:00 2001 From: windgmbh <49904312+windgmbh@users.noreply.github.com> Date: Wed, 29 Jun 2022 14:28:20 +0200 Subject: [PATCH 1078/3088] mail/postfix: Opportunistic DANE SMTP client security level (#2418) --- mail/postfix/Makefile | 2 +- mail/postfix/pkg-descr | 4 ++++ .../app/controllers/OPNsense/Postfix/forms/general.xml | 8 +++++++- .../opnsense/mvc/app/models/OPNsense/Postfix/General.xml | 3 ++- .../opnsense/service/templates/OPNsense/Postfix/main.cf | 3 +++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index be67c238dc..41188395ee 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= postfix -PLUGIN_VERSION= 1.22 +PLUGIN_VERSION= 1.23 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix35 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/pkg-descr b/mail/postfix/pkg-descr index b45544ba64..518b619e94 100644 --- a/mail/postfix/pkg-descr +++ b/mail/postfix/pkg-descr @@ -6,6 +6,10 @@ is completely different. Plugin Changelog ================ +1.23 + +* Add support for Opportunistic DANE as SMTP client security level + 1.22 * Switch table format of header_checks from regexp_table to pcre_table (contributed by Starkstromkonsument) diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml index 9a4eade64a..272a044679 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml @@ -123,7 +123,13 @@ general.smtpclient_security dropdown - Choose "none" to disable TLS for sending mail. Set encrypt to enforce TLS security, please do not use this for Internet wide communication as not every server supports TLS yet. Default is "may" which will use TLS when offered. + +
  • 'none' will disable TLS for sending mail.
  • +
  • 'may' will use TLS when offered (Opportunistic TLS)
  • +
  • 'encrypt' will enforce TLS on all connections. Please do not use this for Internet wide communication as not every server supports TLS yet.
  • +
  • 'dane' will enforce TLS if a TLSA-Record is published (Opportunistic DANE, RFC 7672). DNSSEC-capable resolver is required.
  • + ]]>
    general.relayhost diff --git a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml index 4be05625e7..5a7c0c41ac 100644 --- a/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml +++ b/mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml @@ -1,7 +1,7 @@ //OPNsense/postfix/general Postfix configuration - 1.2.6 + 1.2.7 0 @@ -98,6 +98,7 @@ none may encrypt + dane diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf index c4de83da01..66ccd2b115 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf @@ -89,6 +89,9 @@ smtp_tls_wrappermode = yes {% endif %} {% if helpers.exists('OPNsense.postfix.general.smtpclient_security') and OPNsense.postfix.general.smtpclient_security != '' %} +{% if OPNsense.postfix.general.smtpclient_security == 'dane' %} +smtp_dns_support_level = dnssec +{% endif %} smtp_tls_security_level = {{ OPNsense.postfix.general.smtpclient_security }} smtp_tls_loglevel = 1 {% endif %} From b20cbd6c04ff41aabf55d7f62f5db4470e669997 Mon Sep 17 00:00:00 2001 From: Nuno <45106055+rare-magma@users.noreply.github.com> Date: Wed, 29 Jun 2022 14:36:11 +0200 Subject: [PATCH 1079/3088] net-mgmt/telegraf: Add internet speed input plugin (#2638) * add internet_speed input plugin * add internet_speed input interval --- .../OPNsense/Telegraf/forms/input.xml | 18 ++++++++++++++++++ .../mvc/app/models/OPNsense/Telegraf/Input.xml | 12 ++++++++++++ .../templates/OPNsense/Telegraf/telegraf.conf | 10 ++++++++++ 3 files changed, 40 insertions(+) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml index 9cd77699fc..d33e5e2731 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/input.xml @@ -49,6 +49,24 @@ checkbox Read metrics about disk IO by device. + + input.internet_speed + + checkbox + Enable the collection of data about the internet speed on the system. + + + input.internet_speed_file + + checkbox + Enable the file download speed test. + + + input.internet_speed_interval + + text + Default internet speed test interval in seconds. + input.mem diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml index 0c7b08334a..f85b74a24f 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml @@ -35,6 +35,18 @@ 1 N + + 0 + N + + + 0 + N + + + 360 + N + 1 N diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index 7314590c7b..699fbcc9a2 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -204,6 +204,16 @@ [[inputs.diskio]] {% endif %} +{% if helpers.exists('OPNsense.telegraf.input.internet_speed') and OPNsense.telegraf.input.internet_speed == '1' %} +[[inputs.internet_speed]] +{% if helpers.exists('OPNsense.telegraf.input.internet_speed_file') and OPNsense.telegraf.input.internet_speed_file == '1' %} + enable_file_download = true +{% endif %} +{% if helpers.exists('OPNsense.telegraf.input.internet_speed_interval') and OPNsense.telegraf.input.internet_speed_interval != '' %} + interval = "{{ OPNsense.telegraf.input.internet_speed_interval }}s" +{% endif %} +{% endif %} + {% if helpers.exists('OPNsense.telegraf.input.mem') and OPNsense.telegraf.input.mem == '1' %} [[inputs.mem]] {% endif %} From 40b4fb4f14a8e8bc2659aeddfdd23d3d63bb0ccb Mon Sep 17 00:00:00 2001 From: Maurice Walker Date: Wed, 29 Jun 2022 15:16:17 +0200 Subject: [PATCH 1080/3088] net/tayga: add custom IPv6 routing feature (#2313) * Convert TAYGA virtual interface to interface group Allows nat64 interface assignment (required for adding custom routes). * Add nat64 interface to tayga interface group Required because TAYGA virtual interface was converted to interface group in c350c81e49a89b9d57d3a86355907910b589a098. * Add TAYGA configuration item to disable IPv6 route * Add TAYGA GUI option to disable IPv6 prefix route Required for adding custom routes. * Add variable for disabling TAYGA IPv6 route Required for adding custom routes. * Add IPv6 route disable switch to TAYGA rc.d Required for adding custom routes. * Update TAYGA plugin to version 1.2 New feature: Custom IPv6 Routing * Update TAYGA plugin to version 1.2 New feature: Custom IPv6 Routing * Configure routes after TAYGA start Required for custom routes. --- net/tayga/Makefile | 3 +-- net/tayga/pkg-descr | 4 ++++ net/tayga/src/etc/inc/plugins.inc.d/tayga.inc | 4 ++-- net/tayga/src/etc/rc.d/opnsense-tayga | 5 ++++- .../app/controllers/OPNsense/Tayga/forms/general.xml | 6 ++++++ .../mvc/app/models/OPNsense/Tayga/General.xml | 6 +++++- .../service/conf/actions.d/actions_tayga.conf | 11 +++++++++-- .../opnsense/service/templates/OPNsense/Tayga/tayga | 5 +++++ 8 files changed, 36 insertions(+), 8 deletions(-) diff --git a/net/tayga/Makefile b/net/tayga/Makefile index e350d4580b..78cffb74a4 100644 --- a/net/tayga/Makefile +++ b/net/tayga/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= tayga -PLUGIN_VERSION= 1.1 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= Tayga NAT64 PLUGIN_DEPENDS= tayga PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/tayga/pkg-descr b/net/tayga/pkg-descr index 0ba5d319c5..4ff06aba27 100644 --- a/net/tayga/pkg-descr +++ b/net/tayga/pkg-descr @@ -7,6 +7,10 @@ networks where dedicated NAT64 hardware would be overkill. Plugin Changelog ================ +1.2 + +* Custom IPv6 routing option + 1.1 * Register Tayga virtual interface diff --git a/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc b/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc index e273043341..8efe00f868 100644 --- a/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc +++ b/net/tayga/src/etc/inc/plugins.inc.d/tayga.inc @@ -70,9 +70,9 @@ function tayga_interfaces() return $interfaces; } $oic = array('enable' => true); - $oic['if'] = 'nat64'; + $oic['if'] = 'tayga'; $oic['descr'] = 'Tayga'; - $oic['type'] = 'none'; + $oic['type'] = 'group'; $oic['virtual'] = true; $oic['networks'] = array(); $interfaces['tayga'] = $oic; diff --git a/net/tayga/src/etc/rc.d/opnsense-tayga b/net/tayga/src/etc/rc.d/opnsense-tayga index d86a7dca3e..d911e8a692 100755 --- a/net/tayga/src/etc/rc.d/opnsense-tayga +++ b/net/tayga/src/etc/rc.d/opnsense-tayga @@ -29,8 +29,11 @@ tayga_start() sleep 1 ifconfig nat64 inet ${tayga_v4destination}/32 ${tayga_v4address} ifconfig nat64 inet6 ${tayga_v6destination}/128 - route -6 add ${tayga_v6prefix} -interface nat64 + ifconfig nat64 group tayga route -4 add ${tayga_v4pool} -interface nat64 + if [ "$tayga_v6routedisabled" != "YES" ]; then + route -6 add ${tayga_v6prefix} -interface nat64 + fi } tayga_stop() diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml index 14a6c52724..db60e2fc7e 100644 --- a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/general.xml @@ -41,4 +41,10 @@ text IPv6 hosts which send traffic through Tayga will be dynamically assigned an IPv4 address from this pool. Can be any size, but each IPv6 host requires one address. + + general.v6routedisabled + + checkbox + This is an advanced setting for selective routing scenarios. It will prevent installing the route which routes the IPv6 Prefix to Tayga. This requires assigning and locking the nat64 interface, enabling dynamic gateway policy, configuring a dynamic IPv6 gateway and adding custom routes. + diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml index 63680a3dbb..3b8931b41a 100644 --- a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml @@ -1,7 +1,7 @@ //OPNsense/tayga/general Tayga configuration - 0.0.4 + 1.2.0 0 @@ -30,5 +30,9 @@ 192.168.255.0/24 Y + + 0 + Y + diff --git a/net/tayga/src/opnsense/service/conf/actions.d/actions_tayga.conf b/net/tayga/src/opnsense/service/conf/actions.d/actions_tayga.conf index 5d4cf502ac..9b114dff97 100644 --- a/net/tayga/src/opnsense/service/conf/actions.d/actions_tayga.conf +++ b/net/tayga/src/opnsense/service/conf/actions.d/actions_tayga.conf @@ -5,13 +5,20 @@ type:script_output message:stopping tayga [start] -command:/usr/local/opnsense/scripts/OPNsense/Tayga/setup.sh; /usr/local/etc/rc.d/opnsense-tayga start +command: + /usr/local/opnsense/scripts/OPNsense/Tayga/setup.sh; + /usr/local/etc/rc.d/opnsense-tayga start; + /usr/local/etc/rc.routing_configure parameters: type:script_output message:starting tayga [restart] -command:/usr/local/etc/rc.d/opnsense-tayga stop; /usr/local/opnsense/scripts/OPNsense/Tayga/setup.sh; /usr/local/etc/rc.d/opnsense-tayga start +command: + /usr/local/etc/rc.d/opnsense-tayga stop; + /usr/local/opnsense/scripts/OPNsense/Tayga/setup.sh; + /usr/local/etc/rc.d/opnsense-tayga start; + /usr/local/etc/rc.routing_configure parameters: type:script_output message:restarting tayga diff --git a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga index c84c7881d7..93cae0d9e1 100644 --- a/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga +++ b/net/tayga/src/opnsense/service/templates/OPNsense/Tayga/tayga @@ -7,6 +7,11 @@ tayga_v4pool={{ OPNsense.tayga.general.v4pool }} tayga_v6prefix={{ OPNsense.tayga.general.v6prefix }} tayga_v6address={{ OPNsense.tayga.general.v6address }} tayga_v6destination={{ OPNsense.tayga.general.v6destination }} +{% if helpers.exists('OPNsense.tayga.general.v6routedisabled') and OPNsense.tayga.general.v6routedisabled == '1' %} +tayga_v6routedisabled="YES" +{% else %} +tayga_v6routedisabled="NO" +{% endif %} {% else %} tayga_enable="NO" {% endif %} From 2cc80901f8564cac86fb18304677985f5dc81279 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Jun 2022 15:37:27 +0200 Subject: [PATCH 1081/3088] mail/postfix: style sweep --- .../mvc/app/controllers/OPNsense/Postfix/forms/general.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml index 272a044679..35982885fa 100644 --- a/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml +++ b/mail/postfix/src/opnsense/mvc/app/controllers/OPNsense/Postfix/forms/general.xml @@ -123,12 +123,12 @@ general.smtpclient_security dropdown -
  • 'none' will disable TLS for sending mail.
  • 'may' will use TLS when offered (Opportunistic TLS)
  • 'encrypt' will enforce TLS on all connections. Please do not use this for Internet wide communication as not every server supports TLS yet.
  • -
  • 'dane' will enforce TLS if a TLSA-Record is published (Opportunistic DANE, RFC 7672). DNSSEC-capable resolver is required.
  • +
  • 'dane' will enforce TLS if a TLSA-Record is published (Opportunistic DANE, RFC 7672). DNSSEC-capable resolver is required.
  • ]]>
    From 799578e9426f72965f519403aa085611d42efa76 Mon Sep 17 00:00:00 2001 From: "Mr. Johnson" <50166184+psychogun@users.noreply.github.com> Date: Wed, 29 Jun 2022 21:48:54 +0200 Subject: [PATCH 1082/3088] Enables basic HTTP Authentication agains Elasticsearch (#2703) --- .../controllers/OPNsense/Telegraf/forms/output.xml | 12 ++++++++++++ .../mvc/app/models/OPNsense/Telegraf/Output.xml | 6 ++++++ .../templates/OPNsense/Telegraf/telegraf.conf | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index 0b1c1a6e4e..b627fa1e6b 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -143,6 +143,18 @@ text Set the URL where metrics shoud be sent to. + + output.elastic_username + + text + Optional HTTP basic authentication details for Elasticsearch. + + + output.elastic_password + + text + Optional HTTP basic authentication details for Elasticsearch. + output.elastic_timeout diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index 7e7bdb8055..404bd8ddf0 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -70,6 +70,12 @@ N + + N + + + N + 5 N diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index 699fbcc9a2..619f0f6d63 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -127,6 +127,12 @@ {% if helpers.exists('OPNsense.telegraf.output.elastic_url') and OPNsense.telegraf.output.elastic_url != '' %} urls = ["{{ OPNsense.telegraf.output.elastic_url }}"] {% endif %} +{% if helpers.exists('OPNsense.telegraf.output.elastic_username') and OPNsense.telegraf.output.elastic_username != '' %} +{% if helpers.exists('OPNsense.telegraf.output.elastic_password') and OPNsense.telegraf.output.elastic_password != '' %} + username = "{{ OPNsense.telegraf.output.elastic_username }}" + password = "{{ OPNsense.telegraf.output.elastic_password }}" +{% endif %} +{% endif %} {% if helpers.exists('OPNsense.telegraf.output.elastic_timeout') and OPNsense.telegraf.output.elastic_timeout != '' %} timeout = "{{ OPNsense.telegraf.output.elastic_timeout }}s" {% endif %} From 5ae5abc543b2359b1faa7aa6b6e822444db9a8cd Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Jul 2022 11:24:50 +0200 Subject: [PATCH 1083/3088] dns/ddclient: clarify release notes --- dns/ddclient/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index c6548b9399..81cf7d70a2 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -8,7 +8,7 @@ Plugin Changelog 1.8 -* Add a force action (also available via cron) +* Add a force action available via cron * Fix expected permission on ddclient.conf * Make service status and stop more reliable * Time out checkip script after 10 seconds From 16c91077afb01bf17336b6b28f36c1704e7707f0 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Jul 2022 11:32:13 +0200 Subject: [PATCH 1084/3088] net-mgmt/telegraf: package next version --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index c99b624efc..a0f9033a43 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.12.4 +PLUGIN_VERSION= 1.12.5 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index b7919dd38a..39bc8d6084 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -12,6 +12,12 @@ WWW: https://www.influxdata.com/time-series-platform/telegraf/ Plugin Changelog ================ +1.12.5 + +* Add support for basic HTTP Authentication agains Elasticsearch (contributed by psychogun) +* Add internet speed input plugin (contributed by rare-magma) +* Allow to specify ping count (Kacper Michajlow) + 1.12.4 * Add 5 second timeout to unbound input From ffa4e71576d4eb1bf7e507e1368382f0107d9848 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Jul 2022 12:27:48 +0200 Subject: [PATCH 1085/3088] net/firewall: bump version for change --- net/firewall/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/firewall/Makefile b/net/firewall/Makefile index 44daa1d075..6e344f2545 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= firewall -PLUGIN_VERSION= 1.1 +PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= Firewall API supplemental package PLUGIN_MAINTAINER= ad@opnsense.org From 2c5636875531aa573da9928c0d42c5355a0c9ebb Mon Sep 17 00:00:00 2001 From: Nicola Date: Mon, 4 Jul 2022 12:47:04 +0200 Subject: [PATCH 1086/3088] sysutils/apcupsd: change minimum value for battery level and minutes settings (#3022) --- .../app/controllers/OPNsense/Apcupsd/forms/general.xml | 8 +++++--- .../mvc/app/models/OPNsense/Apcupsd/Apcupsd.xml | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/forms/general.xml b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/forms/general.xml index 0aa561920a..7fd4ff0ec7 100644 --- a/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/forms/general.xml +++ b/sysutils/apcupsd/src/opnsense/mvc/app/controllers/OPNsense/Apcupsd/forms/general.xml @@ -62,8 +62,10 @@ apcupsd.general.BatteryLevel text - Apcupsd will shutdown the system during a power failure when the remaining battery charge falls below the - specified percentage. (Default is 5). + + Apcupsd will shutdown the system during a power failure when the remaining battery charge falls below the + specified percentage. Set to -1 to disable. (Default is 5). + apcupsd.general.Minutes @@ -71,7 +73,7 @@ text Apcupsd will shutdown the system during a power failure when the remaining runtime on batteries as - internally calculated by the UPS falls below the specified minutes. (Default is 3) + internally calculated by the UPS falls below the specified minutes. Set to -1 to disable. (Default is 3) diff --git a/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.xml b/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.xml index cf344164f0..4d1ad8f541 100644 --- a/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.xml +++ b/sysutils/apcupsd/src/opnsense/mvc/app/models/OPNsense/Apcupsd/Apcupsd.xml @@ -87,23 +87,23 @@ 5 Y - 1 + -1 99 - Battery level must be between 1 and 99 percent. + Battery level must be between -1 and 99 percent. 3 Y - 1 + -1 60 - Remaining battery minutes must be between 1 and 60 minutes. + Remaining battery minutes must be between -1 and 60 minutes. 0 Y 0 360 - Timeout must be between 1 and 360 seconds. + Timeout must be between 0 and 360 seconds. 300 From a2afc161b5a47215b185b2572728a955795394dc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Jul 2022 12:48:25 +0200 Subject: [PATCH 1087/3088] sysutils/apcupsd: small mods --- sysutils/apcupsd/Makefile | 2 +- sysutils/apcupsd/pkg-descr | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile index 1b08a99071..4cabb532c0 100644 --- a/sysutils/apcupsd/Makefile +++ b/sysutils/apcupsd/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= apcupsd PLUGIN_DEVEL= yes -PLUGIN_VERSION= 0.1 +PLUGIN_VERSION= 0.2 PLUGIN_DEPENDS= apcupsd PLUGIN_COMMENT= APCUPSD - APC UPS daemon PLUGIN_MAINTAINER= xbb@xbblabs.com diff --git a/sysutils/apcupsd/pkg-descr b/sysutils/apcupsd/pkg-descr index 28f097d83a..f7613b200c 100644 --- a/sysutils/apcupsd/pkg-descr +++ b/sysutils/apcupsd/pkg-descr @@ -12,9 +12,7 @@ WWW: http://www.apcupsd.org/ Plugin Changelog ================ -1.0 - -Initial release +1.0 (initial release) * Apcupsd service control and configuration * UPS status page From d162124a4f07f54a61b5786e9c79917267d5cc26 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 4 Jul 2022 14:36:27 +0200 Subject: [PATCH 1088/3088] Squashed commit of the following: commit e873aa41591442e16ec0581fa8b6e8696a1821ff Author: Ad Schellevis Date: Mon Jul 4 14:23:32 2022 +0200 security/stunnel: Add option to chain intermediate CAs (https://github.com/opnsense/plugins/pull/2854), better explain impact and add move to advanced commit 1e86212ad759a10ae3c229d709a5718ab79208d5 Author: Johnny S. Lee <6614805+johnnyslee@users.noreply.github.com> Date: Mon Feb 21 09:52:26 2022 +0800 security/stunnel: Allow GUI usage of restart action For example, we can now select "Restart Stunnel" from `Service/ACME-Client/Automations>Run-Command>System-or-Plugin-Command` in GUI. commit 005af925b1e4c96022953757297c5a0782a81825 Author: Johnny S. Lee <6614805+johnnyslee@users.noreply.github.com> Date: Mon Feb 21 09:45:28 2022 +0800 security/stunnel: Add option to chain intermediate CAs Add an option, defaults disabled, to chain intermediate CAs which is required when using ACME cert. --- security/stunnel/Makefile | 3 +-- .../OPNsense/Stunnel/forms/dialogService.xml | 11 +++++++++++ .../mvc/app/models/OPNsense/Stunnel/Stunnel.xml | 6 +++++- .../src/opnsense/scripts/stunnel/generate_certs.php | 13 +++++++++++-- .../service/conf/actions.d/actions_stunnel.conf | 1 + 5 files changed, 29 insertions(+), 5 deletions(-) diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index f0a6ca8a24..c27c8c3266 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= stunnel -PLUGIN_VERSION= 1.0.4 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.0.5 PLUGIN_COMMENT= Stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml index 2b7f7bb649..dc8008bd93 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml @@ -41,6 +41,17 @@ dropdown + + service.chainIntermediateCAs + + checkbox + true + + service.cacert diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml index 13e2f02fd6..d81c05a6a3 100644 --- a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml +++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml @@ -1,6 +1,6 @@ //OPNsense/Stunnel - 1.0.3 + 1.0.4 Stunnel TLS encryption proxy @@ -81,6 +81,10 @@ cert Please select a valid certificate from the list + + 0 + Y + N /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u diff --git a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php index 908e7dd70d..7d1d8bdb45 100755 --- a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php +++ b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php @@ -28,6 +28,8 @@ */ require_once('plugins.inc'); +require_once('config.inc'); +require_once('certs.inc'); require_once("legacy_bindings.inc"); use OPNsense\Stunnel\Stunnel; @@ -43,8 +45,15 @@ $srv_certid = (string)$service->servercert; foreach ($configObj->cert as $cert) { if ($srv_certid == (string)$cert->refid) { - $all_certs["{$base_path}/{$this_uuid}.crt"] = - base64_decode((string)$cert->crt) . "\n" . base64_decode((string)$cert->prv); + $all_certs["{$base_path}/{$this_uuid}.crt"] = base64_decode((string)$cert->crt); + if (!empty((string)$service->chainIntermediateCAs)) { + $certArr = (array)$cert; + $chain = ca_chain($certArr); + if (!empty($chain)) { + $all_certs["{$base_path}/{$this_uuid}.crt"] .= $chain; + } + } + $all_certs["{$base_path}/{$this_uuid}.crt"] .= "\n" . base64_decode((string)$cert->prv); } } if (!empty((string)$service->cacert)) { diff --git a/security/stunnel/src/opnsense/service/conf/actions.d/actions_stunnel.conf b/security/stunnel/src/opnsense/service/conf/actions.d/actions_stunnel.conf index 2ab897d8d6..e869be423b 100644 --- a/security/stunnel/src/opnsense/service/conf/actions.d/actions_stunnel.conf +++ b/security/stunnel/src/opnsense/service/conf/actions.d/actions_stunnel.conf @@ -32,6 +32,7 @@ command: parameters: type:script message:stunnel service restart +description:Restart Stunnel [status] command:/usr/local/etc/rc.d/stunnel status; /usr/local/etc/rc.d/identd_stunnel onestatus; exit 0 From 06a8d618fb16995a149b9cf75bf53ff679f40643 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 4 Jul 2022 15:02:48 +0200 Subject: [PATCH 1089/3088] security/stunnel: newline for sanity in previous --- .../stunnel/src/opnsense/scripts/stunnel/generate_certs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php index 7d1d8bdb45..a28ac69196 100755 --- a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php +++ b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php @@ -50,7 +50,7 @@ $certArr = (array)$cert; $chain = ca_chain($certArr); if (!empty($chain)) { - $all_certs["{$base_path}/{$this_uuid}.crt"] .= $chain; + $all_certs["{$base_path}/{$this_uuid}.crt"] .= "\n" . $chain; } } $all_certs["{$base_path}/{$this_uuid}.crt"] .= "\n" . base64_decode((string)$cert->prv); From 6ee383dffcc09f6c193784a5f8ad7eabe4137c92 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 4 Jul 2022 16:54:45 +0200 Subject: [PATCH 1090/3088] security/stunnel: remove optional setting chainIntermediateCAs and ship chain by default. ref https://github.com/opnsense/plugins/pull/2854 While working on the documentation I noticed my previous comment was wrong, which also invalidates the need for an optional setting. When it comes to the "CAfile" setting, the chain shouldn't be provided, for the listener (the server cert) it shouldn't matter at all if you ship the chain since it's not part of the authentication. This commits simplifies https://github.com/opnsense/plugins/pull/2854 by removing the option. The current documentation online doesn't need any modifications for this. --- .../OPNsense/Stunnel/forms/dialogService.xml | 11 ----------- .../mvc/app/models/OPNsense/Stunnel/Stunnel.xml | 6 +----- .../src/opnsense/scripts/stunnel/generate_certs.php | 10 ++++------ 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml index dc8008bd93..2b7f7bb649 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml @@ -41,17 +41,6 @@ dropdown - - service.chainIntermediateCAs - - checkbox - true - - service.cacert diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml index d81c05a6a3..13e2f02fd6 100644 --- a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml +++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml @@ -1,6 +1,6 @@ //OPNsense/Stunnel - 1.0.4 + 1.0.3 Stunnel TLS encryption proxy @@ -81,10 +81,6 @@ cert Please select a valid certificate from the list - - 0 - Y - N /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u diff --git a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php index a28ac69196..4aeb667e4d 100755 --- a/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php +++ b/security/stunnel/src/opnsense/scripts/stunnel/generate_certs.php @@ -46,12 +46,10 @@ foreach ($configObj->cert as $cert) { if ($srv_certid == (string)$cert->refid) { $all_certs["{$base_path}/{$this_uuid}.crt"] = base64_decode((string)$cert->crt); - if (!empty((string)$service->chainIntermediateCAs)) { - $certArr = (array)$cert; - $chain = ca_chain($certArr); - if (!empty($chain)) { - $all_certs["{$base_path}/{$this_uuid}.crt"] .= "\n" . $chain; - } + $certArr = (array)$cert; + $chain = ca_chain($certArr); + if (!empty($chain)) { + $all_certs["{$base_path}/{$this_uuid}.crt"] .= "\n" . $chain; } $all_certs["{$base_path}/{$this_uuid}.crt"] .= "\n" . base64_decode((string)$cert->prv); } From ec1aad4c6954dfad9379972aa5dbbcdf49c7c754 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 7 Jul 2022 08:13:38 +0200 Subject: [PATCH 1091/3088] security/stunnel: improve pkg-descr a little --- security/stunnel/pkg-descr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/security/stunnel/pkg-descr b/security/stunnel/pkg-descr index c25f04950c..b3f0ac87a6 100644 --- a/security/stunnel/pkg-descr +++ b/security/stunnel/pkg-descr @@ -1,2 +1,4 @@ -Stunnel is a proxy designed to add TLS encryption functionality to existing clients and servers without any changes in the programs' code. -(https://www.stunnel.org/) +Stunnel is a proxy designed to add TLS encryption functionality to +existing clients and servers without any changes in the programs' code. + +WWW: https://www.stunnel.org/ From b31bcb92106470b3ac08bb998a7fcb2ec09df0fa Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 11 Jul 2022 15:06:37 +0200 Subject: [PATCH 1092/3088] sysutils/apcupsd: release on master as well --- README.md | 2 +- sysutils/apcupsd/Makefile | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f2d58028c8..f3ad155d9a 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ security/softether -- Cross-platform Multi-protocol VPN Program (development onl security/stunnel -- Stunnel TLS proxy security/tinc -- Tinc VPN security/tor -- The Onion Router -sysutils/apcupsd -- APCUPSD - APC UPS daemon (development only) +sysutils/apcupsd -- APCUPSD - APC UPS daemon sysutils/api-backup -- Provide the functionality to download the config.xml sysutils/apuled -- PC Engine APU LED control (development only) sysutils/boot-delay -- Apply a persistent 10 second boot delay (pending removal) diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile index 4cabb532c0..f4c4662a07 100644 --- a/sysutils/apcupsd/Makefile +++ b/sysutils/apcupsd/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= apcupsd -PLUGIN_DEVEL= yes -PLUGIN_VERSION= 0.2 +PLUGIN_VERSION= 1.0 PLUGIN_DEPENDS= apcupsd PLUGIN_COMMENT= APCUPSD - APC UPS daemon PLUGIN_MAINTAINER= xbb@xbblabs.com From fb70f2ef999952d3926a222e55279c7ee3c7f72e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 11 Jul 2022 15:08:03 +0200 Subject: [PATCH 1093/3088] sysutils/boot-delay: remove obsolete --- README.md | 1 - sysutils/boot-delay/Makefile | 8 -------- sysutils/boot-delay/pkg-descr | 4 ---- sysutils/boot-delay/src/etc/rc.loader.d/50-boot-delay | 1 - 4 files changed, 14 deletions(-) delete mode 100644 sysutils/boot-delay/Makefile delete mode 100644 sysutils/boot-delay/pkg-descr delete mode 100644 sysutils/boot-delay/src/etc/rc.loader.d/50-boot-delay diff --git a/README.md b/README.md index f3ad155d9a..e9400dc477 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,6 @@ security/tor -- The Onion Router sysutils/apcupsd -- APCUPSD - APC UPS daemon sysutils/api-backup -- Provide the functionality to download the config.xml sysutils/apuled -- PC Engine APU LED control (development only) -sysutils/boot-delay -- Apply a persistent 10 second boot delay (pending removal) sysutils/dmidecode -- Display hardware information on the dashboard sysutils/git-backup -- Track config changes using git sysutils/hw-probe -- Collect hardware diagnostics diff --git a/sysutils/boot-delay/Makefile b/sysutils/boot-delay/Makefile deleted file mode 100644 index e2af016999..0000000000 --- a/sysutils/boot-delay/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -PLUGIN_NAME= boot-delay -PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 -PLUGIN_COMMENT= Apply a persistent 10 second boot delay -PLUGIN_MAINTAINER= franco@opnsense.org -PLUGIN_OBSOLETE= Use System / Settings / Tunables: name "kern.cam.boot_delay" value "10000" - -.include "../../Mk/plugins.mk" diff --git a/sysutils/boot-delay/pkg-descr b/sysutils/boot-delay/pkg-descr deleted file mode 100644 index 498604f4df..0000000000 --- a/sysutils/boot-delay/pkg-descr +++ /dev/null @@ -1,4 +0,0 @@ -This plugin simply adds 10 seconds to the bootup process in order to -wait for e.g. USB drivers / devices to become ready. The behaviour -matches the initial installer media behaviour, which is normally -removed after the first successful boot. diff --git a/sysutils/boot-delay/src/etc/rc.loader.d/50-boot-delay b/sysutils/boot-delay/src/etc/rc.loader.d/50-boot-delay deleted file mode 100644 index cdf2a41964..0000000000 --- a/sysutils/boot-delay/src/etc/rc.loader.d/50-boot-delay +++ /dev/null @@ -1 +0,0 @@ -kern.cam.boot_delay="10000" From 2f27420aeb863adf5ad992e6874da80d6c401eeb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 11 Jul 2022 15:10:01 +0200 Subject: [PATCH 1094/3088] www/web-proxy-useracl: remove obsolete --- README.md | 1 - www/web-proxy-useracl/+POST_DEINSTALL.post | 6 - www/web-proxy-useracl/+POST_INSTALL.post | 4 - www/web-proxy-useracl/Makefile | 9 - www/web-proxy-useracl/pkg-descr | 1 - .../etc/inc/plugins.inc.d/proxy_useracl.inc | 61 --- .../ProxyUserACL/Api/SettingsController.php | 363 ------------------ .../OPNsense/ProxyUserACL/IndexController.php | 41 -- .../OPNsense/ProxyUserACL/forms/dialogACL.xml | 44 --- .../OPNsense/ProxyUserACL/Menu/Menu.xml | 7 - .../OPNsense/ProxyUserACL/ProxyUserACL.php | 37 -- .../OPNsense/ProxyUserACL/ProxyUserACL.xml | 44 --- .../views/OPNsense/ProxyUserACL/index.volt | 155 -------- .../scripts/OPNsense/ProxyUserACL/reload.php | 45 --- .../conf/actions.d/actions_proxyuseracl.conf | 5 - .../templates/OPNsense/ProxyUserACL/+TARGETS | 1 - .../OPNsense/ProxyUserACL/ProxyUserACL.conf | 92 ----- 17 files changed, 916 deletions(-) delete mode 100644 www/web-proxy-useracl/+POST_DEINSTALL.post delete mode 100644 www/web-proxy-useracl/+POST_INSTALL.post delete mode 100644 www/web-proxy-useracl/Makefile delete mode 100644 www/web-proxy-useracl/pkg-descr delete mode 100644 www/web-proxy-useracl/src/etc/inc/plugins.inc.d/proxy_useracl.inc delete mode 100644 www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/Api/SettingsController.php delete mode 100644 www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/IndexController.php delete mode 100644 www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/forms/dialogACL.xml delete mode 100644 www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/Menu/Menu.xml delete mode 100644 www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/ProxyUserACL.php delete mode 100644 www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/ProxyUserACL.xml delete mode 100644 www/web-proxy-useracl/src/opnsense/mvc/app/views/OPNsense/ProxyUserACL/index.volt delete mode 100755 www/web-proxy-useracl/src/opnsense/scripts/OPNsense/ProxyUserACL/reload.php delete mode 100644 www/web-proxy-useracl/src/opnsense/service/conf/actions.d/actions_proxyuseracl.conf delete mode 100644 www/web-proxy-useracl/src/opnsense/service/templates/OPNsense/ProxyUserACL/+TARGETS delete mode 100644 www/web-proxy-useracl/src/opnsense/service/templates/OPNsense/ProxyUserACL/ProxyUserACL.conf diff --git a/README.md b/README.md index e9400dc477..5739985842 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,6 @@ www/c-icap -- c-icap connects the web proxy with a virus scanner www/cache -- Webserver cache www/nginx -- Nginx HTTP server and reverse proxy www/web-proxy-sso -- Kerberos authentication module -www/web-proxy-useracl -- Group and user ACL for the web proxy (pending removal) ``` A brief description of how to use the plugins repository diff --git a/www/web-proxy-useracl/+POST_DEINSTALL.post b/www/web-proxy-useracl/+POST_DEINSTALL.post deleted file mode 100644 index f1d28cf1e8..0000000000 --- a/www/web-proxy-useracl/+POST_DEINSTALL.post +++ /dev/null @@ -1,6 +0,0 @@ -rm -f /usr/local/etc/squid/pre-auth/ProxyUserACL.conf -rm -f /usr/local/etc/squid/groupACL_*.txt -rm -f /usr/local/etc/squid/userACL_*.txt -if [ -f /var/run/squid/squid.pid ]; then - service squid reload -fi diff --git a/www/web-proxy-useracl/+POST_INSTALL.post b/www/web-proxy-useracl/+POST_INSTALL.post deleted file mode 100644 index 06c3c6c223..0000000000 --- a/www/web-proxy-useracl/+POST_INSTALL.post +++ /dev/null @@ -1,4 +0,0 @@ -/usr/local/opnsense/scripts/OPNsense/ProxyUserACL/reload.php -if [ -f /var/run/squid/squid.pid ]; then - service squid reload -fi diff --git a/www/web-proxy-useracl/Makefile b/www/web-proxy-useracl/Makefile deleted file mode 100644 index fd340b0d19..0000000000 --- a/www/web-proxy-useracl/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -PLUGIN_NAME= web-proxy-useracl -PLUGIN_VERSION= 1.1 -PLUGIN_REVISION= 2 -PLUGIN_COMMENT= Group and user ACL for the web proxy -PLUGIN_OBSOLETE= No changes since 2018 -PLUGIN_MAINTAINER= kekek2@ya.ru -PLUGIN_WWW= https://smart-soft.ru - -.include "../../Mk/plugins.mk" diff --git a/www/web-proxy-useracl/pkg-descr b/www/web-proxy-useracl/pkg-descr deleted file mode 100644 index 11c11d7937..0000000000 --- a/www/web-proxy-useracl/pkg-descr +++ /dev/null @@ -1 +0,0 @@ -Allow users and group-based policies in the web proxy. diff --git a/www/web-proxy-useracl/src/etc/inc/plugins.inc.d/proxy_useracl.inc b/www/web-proxy-useracl/src/etc/inc/plugins.inc.d/proxy_useracl.inc deleted file mode 100644 index e8ef1faf98..0000000000 --- a/www/web-proxy-useracl/src/etc/inc/plugins.inc.d/proxy_useracl.inc +++ /dev/null @@ -1,61 +0,0 @@ - ['proxy_useracl_squid_hook:2'], - ]; -} - -function proxy_useracl_squid_hook($verbose, $action) -{ - if (!in_array($action, ['restart', 'reload', 'start', 'stop'])) { - exit; - } - - $res = configd_run('template reload OPNsense/ProxyUserACL'); - if ($verbose) { - printf("template reload OPNsense/ProxyUserACL: %s\n", trim($res)); - } - $res = configd_run('proxyuseracl reload'); - if ($verbose) { - printf("proxyuseracl reload: %s\n", trim($res)); - } -} - -function proxy_useracl_xmlrpc_sync() -{ - $result = array(); - $result['id'] = 'proxyuseracl'; - $result['section'] = 'OPNsense.ProxyUserACL'; - $result['description'] = gettext('Group & User Squid ACL'); - return array($result); -} diff --git a/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/Api/SettingsController.php b/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/Api/SettingsController.php deleted file mode 100644 index c788e8dca3..0000000000 --- a/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/Api/SettingsController.php +++ /dev/null @@ -1,363 +0,0 @@ -sessionClose(); - $mdlProxyUserACL = $this->getModel(); - $grid = new UIModelGrid($mdlProxyUserACL->general->ACLs->ACL); - return $grid->fetchBindRequest( - $this->request, - array('Group', 'Name', 'Domains', 'Black', 'Priority', 'uuid'), - 'Priority' - ); - } - - /** - * - * add ACL - * @return array - */ - public function addACLAction() - { - $result = array("result" => "failed"); - if ($this->request->isPost() && $this->request->hasPost("ACL")) { - $result = array("result" => "failed", "validations" => array()); - $mdlProxyUserACL = $this->getModel(); - $post = $this->request->getPost("ACL"); - $post["Hex"] = $this->strToHex($post["Name"]); - - $count = count($mdlProxyUserACL->general->ACLs->ACL->getNodes()); - if ($post["Priority"] > $count) { - $post["Priority"] = $count; - } - foreach ($mdlProxyUserACL->general->ACLs->ACL->sortedBy("Priority", true) as $acl) { - $key = $acl->getAttributes()["uuid"]; - $priority = (string)$mdlProxyUserACL->general->ACLs->ACL->{$key}->Priority; - if ($priority < $post["Priority"]) { - break; - } - $mdlProxyUserACL->general->ACLs->ACL->{$key}->Priority = (string)($priority + 1); - } - $node = $mdlProxyUserACL->general->ACLs->ACL->Add(); - $node->setNodes($post); - $find = $this->checkName($post["Name"], $post["Group"]); - if ($find !== true) { - $result["validations"]["ACL.Name"] = $find; - } - $valMsgs = $mdlProxyUserACL->performValidation(); - - foreach ($valMsgs as $field => $msg) { - $fieldnm = str_replace($node->__reference, "ACL", $msg->getField()); - $result["validations"][$fieldnm] = $msg->getMessage(); - } - - if (count($result['validations']) <= 0) { - // save config if validated correctly - $mdlProxyUserACL->serializeToConfig(); - Config::getInstance()->save(); - return array("result" => "saved"); - } - return $result; - } - return $result; - } - - /** - * - * get ACL - * @return array - */ - public function getACLAction($uuid = null) - { - $mdlProxyUserACL = $this->getModel(); - if ($uuid == null) { - // generate new node, but don't save to disc - $node = $mdlProxyUserACL->general->ACLs->ACL->add(); - return array("ACL" => $node->getNodes()); - } - - $node = $mdlProxyUserACL->getNodeByReference('general.ACLs.ACL.' . $uuid); - if ($node != null) { - return array("ACL" => $node->getNodes()); - } - - return array(); - } - - /** - * - * set ACL - * @return array - */ - public function setACLAction($uuid) - { - $result = array("result" => "failed"); - if ($this->request->isPost() && $this->request->hasPost("ACL")) { - $mdlProxyUserACL = $this->getModel(); - if ($uuid != null) { - $node = $mdlProxyUserACL->getNodeByReference('general.ACLs.ACL.' . $uuid); - if ($node != null) { - $result = array("result" => "failed", "validations" => array()); - $ACLInfo = $this->request->getPost("ACL"); - $ACLInfo["Hex"] = $this->strToHex($ACLInfo["Name"]); - $old_priority = (string)$node->Priority; - $new_priority = $ACLInfo["Priority"]; - - if ($new_priority < $old_priority) { - if ($new_priority < 0) { - $new_priority = 0; - } - - foreach ($mdlProxyUserACL->general->ACLs->ACL->sortedBy("Priority", true) as $acl) { - $key = $acl->getAttributes()["uuid"]; - $priority = (string)$mdlProxyUserACL->general->ACLs->ACL->{$key}->Priority; - if ($priority < $new_priority) { - break; - } - if ($priority >= $old_priority) { - continue; - } - $mdlProxyUserACL->general->ACLs->ACL->{$key}->Priority = (string)($priority + 1); - } - } elseif (($new_priority > $old_priority)) { - $count = count($mdlProxyUserACL->general->ACLs->ACL->getNodes()); - if ($new_priority >= $count) { - $new_priority = $count - 1; - $ACLInfo["Priority"] = $new_priority; - } - foreach ($mdlProxyUserACL->general->ACLs->ACL->sortedBy("Priority") as $acl) { - $key = $acl->getAttributes()["uuid"]; - $priority = (string)$mdlProxyUserACL->general->ACLs->ACL->{$key}->Priority; - if ($priority > $new_priority) { - break; - } - if ($priority <= $old_priority) { - continue; - } - $mdlProxyUserACL->general->ACLs->ACL->{$key}->Priority = (string)($priority - 1); - } - } - $node->setNodes($ACLInfo); - $find = $this->checkName($ACLInfo["Name"], $ACLInfo["Group"]); - if ($find !== true) { - $result["validations"]["ACL.Name"] = $find; - } - $valMsgs = $mdlProxyUserACL->performValidation(); - foreach ($valMsgs as $field => $msg) { - $fieldnm = str_replace($node->__reference, "ACL", $msg->getField()); - $result["validations"][$fieldnm] = $msg->getMessage(); - } - - if (count($result['validations']) > 0) { - return $result; - } - - // save config if validated correctly - $mdlProxyUserACL->serializeToConfig(); - Config::getInstance()->save(); - return array("result" => "saved"); - } - } - } - return $result; - } - - /** - * - * del ACL - * @return array - */ - public function delACLAction($uuid) - { - $result = array("result" => "failed"); - if ($this->request->isPost() && $uuid != null) { - $mdlProxyUserACL = $this->getModel(); - if ($mdlProxyUserACL->general->ACLs->ACL->del($uuid)) { - // if item is removed, serialize to config and save - $this->repackPriority(); - $mdlProxyUserACL->serializeToConfig(); - Config::getInstance()->save(); - $result['result'] = 'deleted'; - } else { - $result['result'] = 'not found'; - } - } - - return $result; - } - - /** - * - * Change ACL priority - * @param $uuid item unique id - * @return array - */ - public function updownACLAction($uuid) - { - $result = array("result" => "failed"); - if ($this->request->isPost() && $uuid != null && $this->request->hasPost("command")) { - $mdlProxyUserACL = $this->getModel(); - $count = $this->repackPriority(); - $nodes = $mdlProxyUserACL->general->ACLs->ACL->getNodes(); - $acl = $nodes[$uuid]; - $priority = $acl["Priority"]; - switch ($this->request->getPost("command")) { - case "up": - $new_priority = $priority - 1; - if ($new_priority < 0) { - return array("result" => "success"); - } - break; - - case "down": - $new_priority = $priority + 1; - if ($new_priority >= $count) { - return array("result" => "success"); - } - break; - - default: - return array("result" => "failed"); - } - foreach ($nodes as $key => $node) { - if ($node["Priority"] == $new_priority) { - $mdlProxyUserACL->general->ACLs->ACL->{$key}->Priority = (string)$priority; - $mdlProxyUserACL->general->ACLs->ACL->{$uuid}->Priority = (string)$new_priority; - $mdlProxyUserACL->serializeToConfig(); - Config::getInstance()->save(); - return array('result' => 'success'); - } - } - } - return $result; - } - - private function checkName($user, $search) - { - $authFactory = new AuthenticationFactory(); - $servers = $authFactory->listServers(); - - foreach (explode(',', (new Proxy())->forward->authentication->method) as $method) { - if ($method == "") { - return gettext("No authentication method selected"); - } - $server = $servers[$method]; - switch ($server["type"]) { - case "ldap": - if (!isset($server["ldap_binddn"])) { - return gettext("LDAP user name is not specified"); - } - - if (!isset($server["ldap_bindpw"])) { - return gettext("LDAP user password is not specified"); - } - - $ldapBindURL = strstr($server['ldap_urltype'], "Standard") ? "ldap://" : "ldaps://"; - $ldapBindURL .= strpos($server['host'], "::") !== false ? "[{$server['host']}]" : $server['host']; - $ldapBindURL .= !empty($server['ldap_port']) ? ":{$server['ldap_port']}" : ""; - $ldap_auth_server = $authFactory->get($server["name"]); - if ( - $ldap_auth_server->connect( - $ldapBindURL, - $server["ldap_binddn"], - $server["ldap_bindpw"] - ) == false - ) { - return gettext("Error connecting to LDAP server"); - } - - try { - $users = $ldap_auth_server->searchUsers($user, $server["ldap_attr_user"]); - } catch (\Exception $e) { - break; - } - if ($users !== false && count($users) > 0) { - return true; - } - break; - - case "local": - foreach (Config::getInstance()->object()->system->{"$search"} as $item) { - if ($user == (string)$item->name) { - return true; - } - } - break; - - default: - break; - } - } - return sprintf(gettext('The %s %s does not exist'), $search, $user); - } - - private function repackPriority() - { - $mdlProxyUserACL = $this->getModel(); - $count = 0; - foreach ($mdlProxyUserACL->general->ACLs->ACL->sortedBy("Priority") as $node) { - $key = $node->getAttributes()["uuid"]; - $mdlProxyUserACL->general->ACLs->ACL->{$key}->Priority = (string)$count++; - } - return $count; - } - - private function strToHex($string) - { - $hex = ''; - for ($i = 0; $i < strlen($string); $i++) { - $hex .= dechex(ord($string[$i])); - } - return $hex; - } -} diff --git a/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/IndexController.php b/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/IndexController.php deleted file mode 100644 index 46d1e0005d..0000000000 --- a/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/IndexController.php +++ /dev/null @@ -1,41 +0,0 @@ -view->pick('OPNsense/ProxyUserACL/index'); - $this->view->formDialogACL = $this->getForm("dialogACL"); - } -} diff --git a/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/forms/dialogACL.xml b/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/forms/dialogACL.xml deleted file mode 100644 index ac8aca7aff..0000000000 --- a/www/web-proxy-useracl/src/opnsense/mvc/app/controllers/OPNsense/ProxyUserACL/forms/dialogACL.xml +++ /dev/null @@ -1,44 +0,0 @@ -
    - - ACL.Name - - text - Enter a name of user/group. Group name is case sensitive. - - - ACL.Priority - - text - Rule priority - - - ACL.Group - - dropdown - Group or User ACL - - - ACL.Black - - dropdown - Black or White list - - - ACL.Domains - - select_multiple - - true - - You may use a regular expression, use a comma or press Enter for new item.
    -
    - Examples:
    - mydomain.com -> matches on *.mydomain.com
    - ^https?:\/\/([a-zA-Z]+)\.mydomain\. -> matches on http(s)://textONLY.mydomain.*
    - \.gif$ -> matches on \*.gif but not on \*.gif\test
    - \[0-9]+\.gif$ -> matches on \123.gif but not on \test.gif
    -
    -
    TIP: You can also paste a comma separated list into this field.
    ]]>
    - Regular expressions are allowed. -
    -
    diff --git a/www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/Menu/Menu.xml b/www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/Menu/Menu.xml deleted file mode 100644 index 395d8c5031..0000000000 --- a/www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/Menu/Menu.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/ProxyUserACL.php b/www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/ProxyUserACL.php deleted file mode 100644 index 9474512a87..0000000000 --- a/www/web-proxy-useracl/src/opnsense/mvc/app/models/OPNsense/ProxyUserACL/ProxyUserACL.php +++ /dev/null @@ -1,37 +0,0 @@ - - //OPNsense/ProxyUserACL - 1.0.0 - - Group and User ACL settings - - - - - - - Y - - - Y - - - N - - - Y - Black - - Black - White - - - - 0 - Y - - - Y - group - - Group - User - - - - - - -
    diff --git a/www/web-proxy-useracl/src/opnsense/mvc/app/views/OPNsense/ProxyUserACL/index.volt b/www/web-proxy-useracl/src/opnsense/mvc/app/views/OPNsense/ProxyUserACL/index.volt deleted file mode 100644 index e8cd10d716..0000000000 --- a/www/web-proxy-useracl/src/opnsense/mvc/app/views/OPNsense/ProxyUserACL/index.volt +++ /dev/null @@ -1,155 +0,0 @@ -{# -Copyright (C) 2017 Smart-Soft - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -#} - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('Number') }}{{ lang._('Group') }}{{ lang._('Black') }}{{ lang._('Name') }}{{ lang._('Domains') }}{{ lang._('Priority') }}{{ lang._('Commands') }}
    - - -
    -
    -
    - - -{{ partial("layout_partials/base_dialog",['fields':formDialogACL,'id':'DialogACL','label':lang._('Edit user/group white and black lists')]) }} diff --git a/www/web-proxy-useracl/src/opnsense/scripts/OPNsense/ProxyUserACL/reload.php b/www/web-proxy-useracl/src/opnsense/scripts/OPNsense/ProxyUserACL/reload.php deleted file mode 100755 index 753ed937db..0000000000 --- a/www/web-proxy-useracl/src/opnsense/scripts/OPNsense/ProxyUserACL/reload.php +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env php -object()->system->domain); - -array_map('unlink', glob("/usr/local/etc/squid/ACL_useracl_*.txt")); -foreach ($mdlProxyUserACL->getNodeByReference('general.ACLs.ACL')->getNodes() as $acl) { - file_put_contents("/usr/local/etc/squid/ACL_useracl_" . - $acl["Priority"] . ".txt", $acl["Name"] . "\n" . - ($acl["Group"]["user"]["selected"] == "1" ? $acl["Name"] . "@" . $domain . "\n" : "")); -} diff --git a/www/web-proxy-useracl/src/opnsense/service/conf/actions.d/actions_proxyuseracl.conf b/www/web-proxy-useracl/src/opnsense/service/conf/actions.d/actions_proxyuseracl.conf deleted file mode 100644 index 2cddc83b89..0000000000 --- a/www/web-proxy-useracl/src/opnsense/service/conf/actions.d/actions_proxyuseracl.conf +++ /dev/null @@ -1,5 +0,0 @@ -[reload] -command:/usr/local/opnsense/scripts/OPNsense/ProxyUserACL/reload.php -parameters: -type:script -message:reload web proxy user acl diff --git a/www/web-proxy-useracl/src/opnsense/service/templates/OPNsense/ProxyUserACL/+TARGETS b/www/web-proxy-useracl/src/opnsense/service/templates/OPNsense/ProxyUserACL/+TARGETS deleted file mode 100644 index 65d5f705db..0000000000 --- a/www/web-proxy-useracl/src/opnsense/service/templates/OPNsense/ProxyUserACL/+TARGETS +++ /dev/null @@ -1 +0,0 @@ -ProxyUserACL.conf:/usr/local/etc/squid/auth/ProxyUserACL.conf diff --git a/www/web-proxy-useracl/src/opnsense/service/templates/OPNsense/ProxyUserACL/ProxyUserACL.conf b/www/web-proxy-useracl/src/opnsense/service/templates/OPNsense/ProxyUserACL/ProxyUserACL.conf deleted file mode 100644 index a5c48fe0a7..0000000000 --- a/www/web-proxy-useracl/src/opnsense/service/templates/OPNsense/ProxyUserACL/ProxyUserACL.conf +++ /dev/null @@ -1,92 +0,0 @@ -{% set ldap = [] %} -{% set local = [] %} -{% if helpers.exists('OPNsense.proxy.forward.authentication.method') and OPNsense.proxy.forward.authentication.method != '' %} -{% for method in OPNsense.proxy.forward.authentication.method.split(",") %} -{% if method == "Local Database" %} -{% if local.append("1") %} -{% endif %} -{% else %} -{% for server in helpers.toList('system.authserver') %} -{% if server.type == 'ldap' and server.name == method %} -{% if ldap.append(server) %} -{% endif %} -{% endif %} -{% endfor %} -{% endif %} -{% endfor %} -{% endif %} - -{% if helpers.exists('OPNsense.ProxyUserACL.general.ACLs.ACL') %} -{% for ACL in helpers.toList('OPNsense.ProxyUserACL.general.ACLs.ACL') %} -{% if ACL.Group == "group" %} -{% if ldap|length == 1 %} -{% if helpers.exists('OPNsense.ProxySSO.EnableSSO') and OPNsense.ProxySSO.EnableSSO == '1' %} -external_acl_type ext_group_ldap_{{ ACL.Priority}} ttl=300 negative_ttl=60 %LOGIN /usr/local/libexec/squid/ext_kerberos_ldap_group_acl -a -t {{ ACL.Hex }} -D {{ system.domain|upper }} -acl group_ldap_{{ACL.Priority}} external ext_group_ldap_{{ ACL.Priority }} -{% else %} -{% for authcn in ldap[0].ldap_authcn.split(";") %} -{% if ldap[0].ldap_attr_user == 'cn' %} -external_acl_type ext_ldap_{{ ACL.Priority }}_{{ loop.index }} ttl=300 negative_ttl=60 %LOGIN /usr/local/libexec/squid/ext_ldap_group_acl -R -b "{{ldap[0].ldap_basedn}}" -f "(&(cn=%a)(memberUid=%u))" -D "{{ldap[0].ldap_binddn}}" -w "{{ldap[0].ldap_bindpw}}" -p "{{ldap[0].ldap_port}}" "{{ldap[0].host}}" -{% else %} -external_acl_type ext_ldap_{{ ACL.Priority }}_{{ loop.index }} ttl=300 negative_ttl=60 %LOGIN /usr/local/libexec/squid/ext_ldap_group_acl -R -b "{{ldap[0].ldap_basedn}}" -f "(&({{ldap[0].ldap_attr_user}}=%u)(memberOf=cn=%a,{{authcn}}))" -D "{{ldap[0].ldap_binddn}}" -w "{{ldap[0].ldap_bindpw}}" -p "{{ldap[0].ldap_port}}" "{{ldap[0].host}}" -{% endif %} -acl group_ldap_{{ACL.Priority}}_{{ loop.index }} external ext_ldap_{{ ACL.Priority }}_{{ loop.index }} "/usr/local/etc/squid/ACL_useracl_{{ ACL.Priority }}.txt" -{% endfor %} -{% endif %} -{% endif %} -{% if local|length == 1 %} -external_acl_type ext_group_local_{{ ACL.Priority }} ttl=300 negative_ttl=60 %LOGIN /usr/local/libexec/squid/ext_unix_group_acl -p -acl group_local_{{ACL.Priority}} external ext_group_local_{{ ACL.Priority }} "/usr/local/etc/squid/ACL_useracl_{{ ACL.Priority }}.txt" -{% endif %} -{% else %} -acl user_{{ACL.Priority}} proxy_auth "/usr/local/etc/squid/ACL_useracl_{{ ACL.Priority }}.txt" -{% endif %} -{% if ldap|length == 1 or local|length == 1 %} -{% for element in ACL.Domains.split(",") %} -{% if '^' in element or '\\' in element or '$' in element or '[' in element %} -acl domains_{{ACL.Priority}} url_regex {{element|encode_idna}} -{% else %} -acl domains_{{ACL.Priority}} url_regex {{element|encode_idna|replace(".","\.")}} -{% endif %} -{% endfor %} -{% endif %} -{% endfor %} -{% endif %} - -{% if helpers.exists('OPNsense.ProxyUserACL.general.ACLs.ACL') and (ldap|length == 1 or local|length == 1) %} -{% for priority in range(0,helpers.toList('OPNsense.ProxyUserACL.general.ACLs.ACL')|length) %} -{% for ACL in helpers.toList('OPNsense.ProxyUserACL.general.ACLs.ACL') %} -{% if ACL.Priority == priority|string %} -{% if ACL.Group == "group" %} -{% if ldap|length == 1 %} -{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} -adaptation_access response_mod {{ACL.Black}} group_ldap_{{ACL.Priority}} domains_{{ACL.Priority}} -adaptation_access request_mod {{ACL.Black}} group_ldap_{{ACL.Priority}} domains_{{ACL.Priority}} -{% endif %} -{% if helpers.exists('OPNsense.ProxySSO.EnableSSO') and OPNsense.ProxySSO.EnableSSO == '1' %} -http_access {{ACL.Black}} group_ldap_{{ACL.Priority}} domains_{{ACL.Priority}} -{% else %} -{% for authcn in ldap[0].ldap_authcn.split(";") %} -http_access {{ACL.Black}} group_ldap_{{ACL.Priority}}_{{ loop.index }} domains_{{ACL.Priority}} -{% endfor %} -{% endif %} -{% endif %} -{% if local|length == 1 %} -{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} -adaptation_access response_mod {{ACL.Black}} group_local_{{ACL.Priority}} domains_{{ACL.Priority}} -adaptation_access request_mod {{ACL.Black}} group_local_{{ACL.Priority}} domains_{{ACL.Priority}} -{% endif %} -http_access {{ACL.Black}} group_local_{{ACL.Priority}} domains_{{ACL.Priority}} -{% endif %} -{% else %} -{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} -adaptation_access response_mod {{ACL.Black}} user_{{ACL.Priority}} domains_{{ACL.Priority}} -adaptation_access request_mod {{ACL.Black}} user_{{ACL.Priority}} domains_{{ACL.Priority}} -{% endif %} -http_access {{ACL.Black}} user_{{ACL.Priority}} domains_{{ACL.Priority}} -{% endif %} -{% break %} -{% endif %} -{% endfor %} -{% endfor %} -{% endif %} From 307b8d995a905fad3b9c49a9a9a9d4b414dc100e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 13 Jul 2022 10:53:12 +0200 Subject: [PATCH 1095/3088] plugins: switch to 22.7 --- Mk/defaults.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 534214e2ff..372a645f89 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -57,7 +57,7 @@ VERSIONBIN= ${LOCALBASE}/sbin/opnsense-version _PLUGIN_ABI!= ${VERSIONBIN} -a PLUGIN_ABI?= ${_PLUGIN_ABI} .else -PLUGIN_ABI?= 22.1 +PLUGIN_ABI?= 22.7 .endif PHPBIN= ${LOCALBASE}/bin/php From a427756cf2092a30d67d9d843a45bc8420848088 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Wed, 13 Jul 2022 15:20:24 +0200 Subject: [PATCH 1096/3088] security/crowdsec: v1.0 (#3030) --- security/crowdsec/+POST_INSTALL.post | 7 --- security/crowdsec/+POST_INSTALL.pre | 10 ++++ security/crowdsec/Makefile | 4 +- security/crowdsec/pkg-descr | 5 ++ security/crowdsec/src/etc/rc.d/oscrowdsec | 39 ++++++------- .../OPNsense/CrowdSec/forms/general.xml | 2 +- .../app/models/OPNsense/CrowdSec/General.xml | 2 +- .../app/views/OPNsense/CrowdSec/general.volt | 56 +++++++++++++++++-- .../scripts/OPNsense/CrowdSec/hub-upgrade.sh | 9 ++- 9 files changed, 90 insertions(+), 44 deletions(-) create mode 100755 security/crowdsec/+POST_INSTALL.pre diff --git a/security/crowdsec/+POST_INSTALL.post b/security/crowdsec/+POST_INSTALL.post index 0c4a006aa4..4c5abec40a 100755 --- a/security/crowdsec/+POST_INSTALL.post +++ b/security/crowdsec/+POST_INSTALL.post @@ -1,10 +1,3 @@ #!/bin/sh -# the configuration file used in reconfigure (i.e. settings.json) may eventually -# have credentials, so we create a directory to contain it -- the directory -# permissions will be copied to the file while generating the jinja template. - -# shellcheck disable=SC2174 -mkdir -p -m 0700 /usr/local/etc/crowdsec/opnsense - configctl crowdsec reconfigure diff --git a/security/crowdsec/+POST_INSTALL.pre b/security/crowdsec/+POST_INSTALL.pre new file mode 100755 index 0000000000..e43e481438 --- /dev/null +++ b/security/crowdsec/+POST_INSTALL.pre @@ -0,0 +1,10 @@ +#!/bin/sh + +# The configuration file used in reconfigure (i.e. settings.json) may eventually +# have credentials, so we need to restrict its permissions. We do so by pre-creating +# the directory, and the template package will use its permissions while creating the file. +# If we do that in setup.sh, the file already exists with bad permissions. + +# shellcheck disable=SC2174 +mkdir -p -m 0700 /usr/local/etc/crowdsec/opnsense + diff --git a/security/crowdsec/Makefile b/security/crowdsec/Makefile index fb0653f197..20e019df1b 100644 --- a/security/crowdsec/Makefile +++ b/security/crowdsec/Makefile @@ -1,7 +1,5 @@ PLUGIN_NAME= crowdsec -PLUGIN_VERSION= 0.2 -PLUGIN_DEVEL= yes -#PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.0 PLUGIN_DEPENDS= crowdsec PLUGIN_COMMENT= Lightweight and collaborative security engine PLUGIN_MAINTAINER= marco@crowdsec.net diff --git a/security/crowdsec/pkg-descr b/security/crowdsec/pkg-descr index cc35c3abe3..e7b571f603 100644 --- a/security/crowdsec/pkg-descr +++ b/security/crowdsec/pkg-descr @@ -8,6 +8,11 @@ WWW: https://crowdsec.net/ Plugin Changelog ================ +1.0 + +* first non-devel release +* changed service restart to reload on hub update; fixed "service oscrowdsec status" + 0.2 * first published release diff --git a/security/crowdsec/src/etc/rc.d/oscrowdsec b/security/crowdsec/src/etc/rc.d/oscrowdsec index a64dc0d38b..04a7e8c7b3 100755 --- a/security/crowdsec/src/etc/rc.d/oscrowdsec +++ b/security/crowdsec/src/etc/rc.d/oscrowdsec @@ -8,6 +8,7 @@ # BEFORE: DAEMON # KEYWORD: shutdown +# shellcheck disable=SC1091 . /etc/rc.subr name="oscrowdsec" @@ -15,7 +16,7 @@ rcvar="oscrowdsec_enable" load_rc_config $name -: ${oscrowdsec_enable="NO"} +: "${oscrowdsec_enable="NO"}" oscrowdsec_start () { @@ -36,13 +37,6 @@ oscrowdsec_start () { else service crowdsec_firewall stop || : fi - -# XXX should complain if they were not stopped? -# service crowdsec status -# if [ $? -eq 0 ]; then -# debug "oscrowdsec_start: crowdsec is still running" -# return 0 -# fi } oscrowdsec_stop () { @@ -50,8 +44,6 @@ oscrowdsec_stop () { service crowdsec stop || : service crowdsec_firewall stop || : - - # XXX should complain if they were running and have not been stopped? } oscrowdsec_restart () { @@ -61,23 +53,28 @@ oscrowdsec_restart () { oscrowdsec_status () { # return error if at least one program is not running - ret=0 + service crowdsec status + ret=$? - if service crowdsec status; then - ret=$? - fi - - if service crowdsec_firewall status; then - if [ $ret -eq 0 ]; then - ret=$? - fi + if ! service crowdsec_firewall status; then + ret=1 fi return $ret } oscrowdsec_reload () { - # Here we take it easy. the bouncer does not even support reload - oscrowdsec_restart + if service crowdsec enabled; then + if service crowdsec status >/dev/null 2>&1; then + service crowdsec reload + else + service crowdsec restart + fi + fi + + if service crowdsec_firewall enabled; then + # the bouncer does not support reload + service crowdsec_firewall restart + fi } case $1 in diff --git a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/forms/general.xml b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/forms/general.xml index 596c3b3e92..f154c544ad 100644 --- a/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/forms/general.xml +++ b/security/crowdsec/src/opnsense/mvc/app/controllers/OPNsense/CrowdSec/forms/general.xml @@ -15,7 +15,7 @@ checkbox Enable/disable the CrowdSec Local API. Keep this enabled unless you - connect to a LAPI on another machine + connect to a LAPI on another machine.
    diff --git a/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.xml b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.xml index 16d3b3632d..d71245d0d5 100644 --- a/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.xml +++ b/security/crowdsec/src/opnsense/mvc/app/models/OPNsense/CrowdSec/General.xml @@ -1,7 +1,7 @@ //OPNsense/crowdsec/general CrowdSec general configuration - 0.2 + 1.0 diff --git a/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt index 4952bfb18c..3a91e9adee 100644 --- a/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt +++ b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt @@ -49,6 +49,8 @@
    +

    Introduction

    +

    This plugin installs a CrowdSec agent/LAPI node, and a Firewall Bouncer.

    @@ -63,9 +65,16 @@ any other agent connected to the same LAPI node. Other types of remediation are possible (ex. captcha test for scraping attempts).

    + We recommend you to register to the Console. This helps you manage your instances, + and us to have better overall metrics. +

    Please refer to the tutorials to explore the possibilities.

    +

    For the latest plugin documentation, including how to use it with an external LAPI, see Install + CrowdSec (OPNsense)

    +

    A few remarks:

      @@ -85,8 +94,7 @@ like you would on vanilla freebsd, the plugin takes care of that.
    • - The parsers, scenarios and all objects from the CrowdSec Hub - are periodically upgraded. The + The parsers, scenarios and all plugins from the Hub are periodically upgraded. The crowdsecurity/freebsd and crowdsecurity/opnsense collections are installed by default. @@ -94,10 +102,7 @@
    +

    Installation

    + +

    + On the Settings tab, you can expose CrowdSec to the LAN for other servers by changing `LAPI listen address`. + Otherwise, leave the defualt value. +

    + +

    + Select the first three checkboxes: IDS, LAPI and IPS. Click Apply. If you need to restart, you can do so + from the System > Diagnostics > Services page. +

    + +

    Test the plugin

    + +

    + A quick way to test that everything is working correctly is to + execute the following command. +

    + +

    + Your ssh session should freeze and you should be kicked out from + the firewall. You will not be able to connect to it (from the same + IP address) for two minutes. +

    + +

    + It might be a good idea to have a secondary IP from which you can + connect, should anything go wrong. +

    + +
    [root@OPNsense ~]# cscli decisions add -t ban -d 2m -i 
    + +

    + This is a more secure way to test than attempting to brute-force + yourself: the default ban period is 4 hours, and Crowdsec reads the + logs from the beginning, so it could ban you even if you failed ssh + login 10 times in 30 seconds two hours before installing it. +

    +
    GitHub diff --git a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh index b57e86bb10..7b14772a9b 100755 --- a/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh +++ b/security/crowdsec/src/opnsense/scripts/OPNsense/CrowdSec/hub-upgrade.sh @@ -1,17 +1,16 @@ #!/bin/sh +/usr/local/bin/cscli --error hub update \ + && /usr/local/bin/cscli --error hub upgrade + if [ ! -e "/usr/local/etc/crowdsec/collections/opnsense.yaml" ]; then /usr/local/bin/cscli --error collections install crowdsecurity/opnsense fi -/usr/local/bin/cscli --error hub update \ - && /usr/local/bin/cscli --error hub upgrade - if service crowdsec enabled; then - # have to check status explicitly because "restart" can set $? = 0 even when failing if ! service crowdsec status >/dev/null 2>&1; then service crowdsec start >/dev/null 2>&1 || : else - service crowdsec restart >/dev/null 2>&1 || : + service crowdsec reload >/dev/null 2>&1 || : fi fi From 31a7d5d5b3a1a375d42b6f29579b7087f9191417 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 13 Jul 2022 15:31:59 +0200 Subject: [PATCH 1097/3088] security/crowdsec: style and sync --- README.md | 2 +- security/crowdsec/+POST_INSTALL.pre | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 5739985842..2efc92f751 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ net-mgmt/zabbix-agent -- Zabbix monitoring agent net-mgmt/zabbix-proxy -- Zabbix monitoring proxy security/acme-client -- ACME Client security/clamav -- Antivirus engine for detecting malicious threats -security/crowdsec -- Lightweight and collaborative security engine (development only) +security/crowdsec -- Lightweight and collaborative security engine security/etpro-telemetry -- ET Pro Telemetry Edition security/intrusion-detection-content-et-open -- IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition security/intrusion-detection-content-et-pro -- IDS Proofpoint ET Pro ruleset (needs a valid subscription) diff --git a/security/crowdsec/+POST_INSTALL.pre b/security/crowdsec/+POST_INSTALL.pre index e43e481438..e5733ae4a3 100755 --- a/security/crowdsec/+POST_INSTALL.pre +++ b/security/crowdsec/+POST_INSTALL.pre @@ -7,4 +7,3 @@ # shellcheck disable=SC2174 mkdir -p -m 0700 /usr/local/etc/crowdsec/opnsense - From 835f72cc23dfcf0b35bd0c3ffa48817076a6e11d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Jul 2022 08:22:28 +0200 Subject: [PATCH 1098/3088] mail/postfix: fix missing dh parameter file on 22.7 --- mail/postfix/Makefile | 1 + .../data/OPNsense/Postfix/dh-parameters.2048.rfc7919 | 8 ++++++++ .../opnsense/service/templates/OPNsense/Postfix/main.cf | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 mail/postfix/src/opnsense/data/OPNsense/Postfix/dh-parameters.2048.rfc7919 diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 41188395ee..d583c2f043 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= postfix PLUGIN_VERSION= 1.23 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= SMTP mail relay PLUGIN_DEPENDS= postfix35 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/mail/postfix/src/opnsense/data/OPNsense/Postfix/dh-parameters.2048.rfc7919 b/mail/postfix/src/opnsense/data/OPNsense/Postfix/dh-parameters.2048.rfc7919 new file mode 100644 index 0000000000..9b182b7201 --- /dev/null +++ b/mail/postfix/src/opnsense/data/OPNsense/Postfix/dh-parameters.2048.rfc7919 @@ -0,0 +1,8 @@ +-----BEGIN DH PARAMETERS----- +MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz ++8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a +87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 +YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi +7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD +ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg== +-----END DH PARAMETERS----- diff --git a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf index 66ccd2b115..7ad6a1c279 100644 --- a/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf +++ b/mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf @@ -127,11 +127,11 @@ smtpd_tls_CAfile = /etc/ssl/cert.pem smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1, !TLSv1.2 {% elif OPNsense.postfix.general.tls_server_compatibility == 'intermediate' %} smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -smtpd_tls_dh1024_param_file = /usr/local/etc/dh-parameters.2048 +smtpd_tls_dh1024_param_file = /usr/local/opnsense/data/OPNsense/Postfix/dh-parameters.2048.rfc7919 smtpd_tls_mandatory_ciphers = medium {% elif OPNsense.postfix.general.tls_server_compatibility == 'old' %} smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3 -smtpd_tls_dh1024_param_file = /usr/local/etc/dh-parameters.2048 +smtpd_tls_dh1024_param_file = /usr/local/opnsense/data/OPNsense/Postfix/dh-parameters.2048.rfc7919 smtpd_tls_mandatory_ciphers = low {% endif %} smtpd_tls_protocols = $smtpd_tls_mandatory_protocols From abf01bff99e019b31792cf3489372f07e0c33653 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Jul 2022 08:29:00 +0200 Subject: [PATCH 1099/3088] www/nginx: include missing dh parameter file on 22.7 --- www/nginx/Makefile | 2 +- .../data/OPNsense/Nginx/dh-parameters.4096.rfc7919 | 13 +++++++++++++ .../service/templates/OPNsense/Nginx/http.conf | 2 +- .../service/templates/OPNsense/Nginx/streams.conf | 2 +- .../service/templates/OPNsense/Nginx/webgui.conf | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 www/nginx/src/opnsense/data/OPNsense/Nginx/dh-parameters.4096.rfc7919 diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 3ddb8eabb7..14fe6e55ea 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= nginx PLUGIN_VERSION= 1.28 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/src/opnsense/data/OPNsense/Nginx/dh-parameters.4096.rfc7919 b/www/nginx/src/opnsense/data/OPNsense/Nginx/dh-parameters.4096.rfc7919 new file mode 100644 index 0000000000..3cf0fcbc01 --- /dev/null +++ b/www/nginx/src/opnsense/data/OPNsense/Nginx/dh-parameters.4096.rfc7919 @@ -0,0 +1,13 @@ +-----BEGIN DH PARAMETERS----- +MIICCAKCAgEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz ++8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a +87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 +YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi +7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD +ssbzSibBsu/6iGtCOGEfz9zeNVs7ZRkDW7w09N75nAI4YbRvydbmyQd62R0mkff3 +7lmMsPrBhtkcrv4TCYUTknC0EwyTvEN5RPT9RFLi103TZPLiHnH1S/9croKrnJ32 +nuhtK8UiNjoNq8Uhl5sN6todv5pC1cRITgq80Gv6U93vPBsg7j/VnXwl5B0rZp4e +8W5vUsMWTfT7eTDp5OWIV7asfV9C1p9tGHdjzx1VA0AEh/VbpX4xzHpxNciG77Qx +iu1qHgEtnmgyqQdgCpGBMMRtx3j5ca0AOAkpmaMzy4t6Gh25PXFAADwqTs6p+Y0K +zAqCkc3OyX3Pjsm1Wn+IpGtNtahR9EGC4caKAH5eZV9q//////////8CAQI= +-----END DH PARAMETERS----- diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf index 735bab34d2..4b4e0886bc 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf @@ -111,7 +111,7 @@ server { ssl_certificate_key /usr/local/etc/nginx/key/{{ single_servername }}.key; ssl_certificate /usr/local/etc/nginx/key/{{ single_servername }}.pem; ssl_protocols {{ server.tls_protocols.replace(',', ' ') }}; - ssl_dhparam /usr/local/etc/dh-parameters.4096; + ssl_dhparam /usr/local/opnsense/data/OPNsense/Nginx/dh-parameters.4096.rfc7919; {% if server.tls_ciphers is defined and server.tls_ciphers != '' %} ssl_ciphers {{ server.tls_ciphers }}; {% endif %} diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf index 25c6c2ce27..3076099bc3 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf @@ -75,7 +75,7 @@ ssl_certificate_key /usr/local/etc/nginx/key/{{ server['@uuid'] }}.key; ssl_certificate /usr/local/etc/nginx/key/{{ server['@uuid'] }}.pem; ssl_protocols TLSv1.2 TLSv1.3; - ssl_dhparam /usr/local/etc/dh-parameters.4096; + ssl_dhparam /usr/local/opnsense/data/OPNsense/Nginx/dh-parameters.4096.rfc7919; ssl_ciphers 'ECDHE-ECDSA-CAMELLIA256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CAMELLIA256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-CAMELLIA128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-CAMELLIA128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-CAMELLIA256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-CAMELLIA256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-CAMELLIA128-SHA256:ECDHE-RSA-AES128-SHA256'; ssl_session_timeout 1d; ssl_session_cache shared:sslcache{{ server['@uuid'].replace('-','') }}:50m; diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/webgui.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/webgui.conf index 0990b5393c..3288fe4069 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/webgui.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/webgui.conf @@ -11,7 +11,7 @@ server { listen 80 default_server; # if redirect is enabled listen {% if system.webgui.port is defined and system.webgui.port != '' %}{{ system.webgui.port }}{% else %}443{% endif %} ssl http2 default_server; ## TLS configuration - ssl_dhparam /usr/local/etc/dh-parameters.4096; + ssl_dhparam /usr/local/opnsense/data/OPNsense/Nginx/dh-parameters.4096.rfc7919; ssl_ecdh_curve secp384r1; ssl_certificate /var/etc/cert.pem; ssl_certificate_key /var/etc/cert.pem; From 19c614ee00a39dcbe0b313bab6a91b621838d7b9 Mon Sep 17 00:00:00 2001 From: Gavin Chappell <2798739+g-a-c@users.noreply.github.com> Date: Fri, 15 Jul 2022 21:31:29 +0100 Subject: [PATCH 1100/3088] Re-order function parameters due to PHP8 deprecation notice This changes the parameters for four functions in HAProxy.php. The ACME Client appears to call these functions with positional rather than named params so also switch the order of the parameters in these function calls in --- .../app/models/OPNsense/HAProxy/HAProxy.php | 28 +++++++++---------- .../AcmeClient/Api/SettingsController.php | 10 +++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php index 1028b45b36..f4c18dc4d2 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php @@ -138,19 +138,19 @@ public function getByAclID($uuid) /** * create a new ACL * @param string $name - * @param string $description * @param string $expression + * @param string $description * @param string $negate * @param hash $parameters * @return string */ - public function newAcl($name, $description = "", $expression, $negate = "0", $parameters = array()) + public function newAcl($name, $expression, $description = "", $negate = "0", $parameters = array()) { $acl = $this->acls->acl->Add(); $uuid = $acl->getAttributes()['uuid']; $acl->name = $name; - $acl->description = $description; $acl->expression = $expression; + $acl->description = $description; $acl->negate = $negate; foreach ($parameters as $key => $value) { $acl->$key = $value; @@ -161,11 +161,11 @@ public function newAcl($name, $description = "", $expression, $negate = "0", $pa /** * create a new action * @param string $name - * @param string $description * @param string $testType + * @param string $type + * @param string $description * @param string $linkedAcls * @param string $operator - * @param string $type * @param string $useBackend * @param string $useServer * @param string $actionName @@ -173,16 +173,16 @@ public function newAcl($name, $description = "", $expression, $negate = "0", $pa * @param string $actionValue * @return string */ - public function newAction($name, $description = "", $testType, $linkedAcls = "", $operator = "and", $type, $parameters = array()) + public function newAction($name, $testType, $type, $description = "", $linkedAcls = "", $operator = "and", $parameters = array()) { $action = $this->actions->action->Add(); $uuid = $action->getAttributes()['uuid']; $action->name = $name; - $action->description = $description; $action->testType = $testType; + $action->type = $type; + $action->description = $description; $action->linkedAcls = $linkedAcls; $action->operator = $operator; - $action->type = $type; foreach ($parameters as $key => $value) { $action->$key = $value; } @@ -192,24 +192,24 @@ public function newAction($name, $description = "", $testType, $linkedAcls = "", /** * create a new server * @param string $name - * @param string $description * @param string $address * @param string $port * @param string $mode + * @param string $description * @param string $ssl * @param string $sslVerify * @param string $weight * @return string */ - public function newServer($name, $description = "", $address, $port, $mode, $ssl = "0", $sslVerify = "1", $weight = "") + public function newServer($name, $address, $port, $mode, $description = "", $ssl = "0", $sslVerify = "1", $weight = "") { $srv = $this->servers->server->Add(); $uuid = $srv->getAttributes()['uuid']; $srv->name = $name; - $srv->description = $description; $srv->address = $address; $srv->port = $port; $srv->mode = $mode; + $srv->description = $description; $srv->ssl = $ssl; $srv->sslVerify = $sslVerify; $srv->weight = $weight; @@ -220,22 +220,22 @@ public function newServer($name, $description = "", $address, $port, $mode, $ssl * create a new backend * @param string $enabled * @param string $name - * @param string $description * @param string $mode * @param string $algorithm + * @param string $description * @param string $linkedServers * @param string $linkedActions * @return string */ - public function newBackend($enabled = "0", $name, $description = "", $mode, $algorithm, $linkedServers = "", $linkedActions = "") + public function newBackend($enabled = "0", $name, $mode, $algorithm, $description = "", $linkedServers = "", $linkedActions = "") { $backend = $this->backends->backend->Add(); $uuid = $backend->getAttributes()['uuid']; $backend->enabled = $enabled; $backend->name = $name; - $backend->description = $description; $backend->mode = $mode; $backend->algorithm = $algorithm; + $backend->description = $description; $backend->linkedServers = $linkedServers; $backend->linkedActions = $linkedActions; return $uuid; diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php index c8bef98053..ece257456a 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php @@ -263,8 +263,8 @@ public function fetchHAProxyIntegrationAction() // Add a new HAProxy ACL $acl_uuid = $mdlHAProxy->newAcl( "find_acme_challenge", - "Added by ACME Client plugin", "path_beg", + "Added by ACME Client plugin", "0", array("path_beg" => "/.well-known/acme-challenge/") ); @@ -273,9 +273,9 @@ public function fetchHAProxyIntegrationAction() $backend_uuid = $mdlHAProxy->newBackend( "1", "acme_challenge_backend", - "Added by ACME Client plugin", "http", "source", + "Added by ACME Client plugin", "", "" ); @@ -283,11 +283,11 @@ public function fetchHAProxyIntegrationAction() // Add a new HAProxy action $action_uuid = $mdlHAProxy->newAction( "redirect_acme_challenges", - "Added by ACME Client plugin", "if", + "use_backend", + "Added by ACME Client plugin", "", "and", - "use_backend", // Use the new backend uuid in field "useBackend" array("use_backend" => $backend_uuid) ); @@ -298,10 +298,10 @@ public function fetchHAProxyIntegrationAction() // Add a new HAProxy server $server_uuid = $mdlHAProxy->newServer( "acme_challenge_host", - "Added by ACME Client plugin", "127.0.0.1", $acme_port, "active", + "Added by ACME Client plugin", "0", "0", "" From ad0905e5751d367c09d50d8101837170a57f1299 Mon Sep 17 00:00:00 2001 From: Gavin Chappell <2798739+g-a-c@users.noreply.github.com> Date: Fri, 15 Jul 2022 21:52:43 +0100 Subject: [PATCH 1101/3088] missed one function --- .../opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php | 6 +++--- .../OPNsense/AcmeClient/Api/SettingsController.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php index f4c18dc4d2..5218c256e6 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.php @@ -218,23 +218,23 @@ public function newServer($name, $address, $port, $mode, $description = "", $ssl /** * create a new backend - * @param string $enabled * @param string $name * @param string $mode * @param string $algorithm + * @param string $enabled * @param string $description * @param string $linkedServers * @param string $linkedActions * @return string */ - public function newBackend($enabled = "0", $name, $mode, $algorithm, $description = "", $linkedServers = "", $linkedActions = "") + public function newBackend($name, $mode, $algorithm, $enabled = "0", $description = "", $linkedServers = "", $linkedActions = "") { $backend = $this->backends->backend->Add(); $uuid = $backend->getAttributes()['uuid']; - $backend->enabled = $enabled; $backend->name = $name; $backend->mode = $mode; $backend->algorithm = $algorithm; + $backend->enabled = $enabled; $backend->description = $description; $backend->linkedServers = $linkedServers; $backend->linkedActions = $linkedActions; diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php index ece257456a..d91f9cfd3f 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php @@ -271,10 +271,10 @@ public function fetchHAProxyIntegrationAction() // Add a new HAProxy backend $backend_uuid = $mdlHAProxy->newBackend( - "1", "acme_challenge_backend", "http", "source", + "1", "Added by ACME Client plugin", "", "" From 0be58a3abbad1ea1518a8b810cd6261b7bf5d878 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 20 Jul 2022 12:40:17 +0200 Subject: [PATCH 1102/3088] devel/debug: try our luck here with version 9 --- devel/debug/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/debug/Makefile b/devel/debug/Makefile index febb5db935..ddbc36c4b5 100644 --- a/devel/debug/Makefile +++ b/devel/debug/Makefile @@ -3,7 +3,7 @@ PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= Debugging Tools PLUGIN_DEPENDS= php${PLUGIN_PHP}-pear-PHP_CodeSniffer \ php${PLUGIN_PHP}-pecl-xdebug \ - phpunit7-php${PLUGIN_PHP} \ + phpunit9-php${PLUGIN_PHP} \ py${PLUGIN_PYTHON}-pycodestyle \ p5-File-Slurp git PLUGIN_MAINTAINER= franco@opnsense.org From d27499dbccfc3fdb07bfbd8510cc6ab96a946960 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 27 Jul 2022 08:57:27 +0200 Subject: [PATCH 1103/3088] net/freeradius: Remove TTLS-GTC from default eap type (#3052) --- net/freeradius/Makefile | 3 +-- net/freeradius/pkg-descr | 4 ++++ .../src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index 9758324361..7b07c95672 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= freeradius -PLUGIN_VERSION= 1.9.19 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.9.20 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index 9e2092f874..48342d041a 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -15,6 +15,10 @@ The server is fast, feature-rich, modular, and scalable. Plugin Changelog ================ +1.9.20 + +* Remove TTLS-GTC from Default EAP Type (#2421) + 1.9.19 * Allow to use LDAP in inner-tunnel (needed for LDAP authentication within 802.1X) diff --git a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml index 6ff7fece79..c44c58ed39 100644 --- a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml +++ b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/Eap.xml @@ -13,7 +13,6 @@ PEAP TLS TTLS - TTLS-GTC From 4025ed6571e2879173c3782854b3bb20a66e1966 Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Tue, 26 Jul 2022 17:17:39 +0200 Subject: [PATCH 1104/3088] acme-client: Add Active24 challenge type --- .../AcmeClient/forms/dialogValidation.xml | 10 +++++ .../AcmeClient/LeValidation/DnsActive24.php | 44 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 4 ++ 3 files changed, 58 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsActive24.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 3fc1b06600..f1cb926658 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -130,6 +130,16 @@ text The time in seconds to wait for all the TXT records to take effect after adding them to the DNS API. Defaults to 120 seconds. + + + header + + + + validation.dns_active24_token + + text + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsActive24.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsActive24.php new file mode 100644 index 0000000000..4b26d1bcf6 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsActive24.php @@ -0,0 +1,44 @@ +acme_env['ACTIVE24_Token'] = (string)$this->config->dns_active24_token; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 8a9c50de41..b442a838d1 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -419,6 +419,7 @@ 1984Hosting API ACME DNS API Acmeproxy API + Active24 API Alwaysdata.com API aliyun.com API All-Inkl.com domain API @@ -507,6 +508,9 @@ Please specify a value between 1 and 84600. Y + + N + N From 472aace9396b045ac3f3b8ed2c6ddd5d2ce4ca42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikolaj=20Brinch=20J=C3=B8rgensen?= Date: Wed, 27 Jul 2022 14:54:15 +0200 Subject: [PATCH 1105/3088] Added Simply.com (used to be UnoEuro). There is an open PR in acme.sh DEV branch #3978, that fixes dns for simply, since they removed support for the old UnoEuro REST API (V1) in favour of V2 that uses Basic Auth. (#2888) security/acme-client: Add Simply.com DNS API --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsSimply.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 3 files changed, 67 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index f1cb926658..ee96f90006 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1107,6 +1107,21 @@ text + + + header + + + + validation.dns_simply_api_key + + text + + + validation.dns_simply_account_name + + text + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php new file mode 100644 index 0000000000..547926092d --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php @@ -0,0 +1,45 @@ +acme_env['SIMPLY_ApiKey'] = (string)$this->config->dns_simply_api_key; + $this->acme_env['SIMPLY_AccountName'] = (string)$this->config->dns_simply_account_name; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index b442a838d1..4b01dfa582 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -490,6 +490,7 @@ selectel.com / selectel.ru domain API Selfhost API Servercow API v1 + Simply.com API Transip API UnoEuro API Variomedia.de API @@ -948,6 +949,12 @@ N + + N + + + N + N From 5119e66a0fd9aba5b3e82f8b0d509aec55932902 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 27 Jul 2022 14:55:59 +0200 Subject: [PATCH 1106/3088] security/acme-client: fix copyright information, refs #2888 --- .../app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php index 547926092d..f6b5476a9b 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsSimply.php @@ -1,7 +1,7 @@ Date: Wed, 27 Jul 2022 15:04:57 +0200 Subject: [PATCH 1107/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- security/acme-client/pkg-descr | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index e43cc7d263..86944b5d69 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.11 +PLUGIN_VERSION= 3.12 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 2ca43dc00d..5fd3b9223c 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,15 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.12 + +Added: +* Add Simply.com DNS API (#2888) +* Add Active24 challenge type (#3049) + +Fixed: +* Re-order function parameters due to PHP8 deprecation notice (#3043) + 3.11 Fixed: From 6d5604e4060eb59dc906747ccc60c1ad39d4758c Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 27 Jul 2022 15:52:59 +0200 Subject: [PATCH 1108/3088] security/acme-client: add support for Cloudflare Zone ID, closes #2973 --- security/acme-client/pkg-descr | 1 + .../OPNsense/AcmeClient/forms/dialogValidation.xml | 6 ++++++ .../app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php | 4 ++++ .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 3 +++ 4 files changed, 14 insertions(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 5fd3b9223c..40cb4205c0 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -13,6 +13,7 @@ Plugin Changelog Added: * Add Simply.com DNS API (#2888) * Add Active24 challenge type (#3049) +* Add support for Zone ID in Cloudflare challenge type (#2973) Fixed: * Re-order function parameters due to PHP8 deprecation notice (#3043) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index ee96f90006..0d6d449c55 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -263,6 +263,12 @@ password The token needs "Read" access to Zone.Zone and "Edit" access to Zone.DNS across all zones from an account. + + validation.dns_cf_zone_id + + text + Note that specifying a Zone ID will limit this configuration to a single domain. + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php index 3f6f735e01..107a09f6eb 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsCf.php @@ -45,5 +45,9 @@ public function prepare() // Restricted API token (recommended) $this->acme_env['CF_Token'] = (string)$this->config->dns_cf_token; $this->acme_env['CF_Account_ID'] = (string)$this->config->dns_cf_account_id; + // Optional Zone ID + if (!empty((string)$this->config->dns_cf_zone_id)) { + $this->acme_env['CF_Zone_ID'] = (string)$this->config->dns_cf_zone_id; + } } } diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 4b01dfa582..19e5cd911f 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -560,6 +560,9 @@ N + + N + N From b773bfec8773cffb15b5859e240ae91b591f7803 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 27 Jul 2022 16:05:22 +0200 Subject: [PATCH 1109/3088] security/acme-client: simplyfi DNS service names There is simply no point in repeating the 'API' word over and over again for every DNS service. --- security/acme-client/pkg-descr | 3 + .../models/OPNsense/AcmeClient/AcmeClient.xml | 274 +++++++++--------- 2 files changed, 140 insertions(+), 137 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 40cb4205c0..80eefd1933 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -18,6 +18,9 @@ Added: Fixed: * Re-order function parameters due to PHP8 deprecation notice (#3043) +Changed: +* simplyfi DNS service names + 3.11 Fixed: diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 19e5cd911f..c5c7c4a979 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -416,90 +416,90 @@ Y dns_freedns - 1984Hosting API - ACME DNS API - Acmeproxy API - Active24 API - Alwaysdata.com API - aliyun.com API - All-Inkl.com domain API - ArvanCloud API - AutoDNS (InterNetX) API + 1984Hosting + ACME DNS + Acmeproxy + Active24 + Alwaysdata.com + aliyun.com + All-Inkl.com + ArvanCloud + AutoDNS (InterNetX) AWS Route 53 - Azure DNS API - ClouDNS API - CloudFlare.com API - CloudXNS.com API - Core-Networks API - cPanel API - cyon.ch API - DDNSS API - deSEC.io API - DigitalOcean API - DirectAdmin API - DNSimple API - Domeneshop API - DNSMadeEasy.com API - DNSPod.cn API - Domain-Offensive LetsEncrypt API - Domain-Offensive Resellerinterface/Domainrobot API - DreamHost DNS API - DuckDNS API - Dyn Managed DNS API - Dynu API - dynv6 HTTP API + Azure DNS + ClouDNS + CloudFlare.com + CloudXNS.com + Core-Networks + cPanel + cyon.ch + DDNSS + deSEC.io + DigitalOcean + DirectAdmin + DNSimple + Domeneshop + DNSMadeEasy.com + DNSPod.cn + Domain-Offensive LetsEncrypt + Domain-Offensive Resellerinterface/Domainrobot + DreamHost + DuckDNS + Dyn Managed + Dynu + dynv6 EUserv - FreeDNS API - Gandi LiveDNS API - GoDaddy.com API - Google Cloud DNS API + FreeDNS + Gandi LiveDNS + GoDaddy.com + Google Cloud DNS GratisDNS.dk - Hetzner DNS API - hexonet.com DNS API - hosting.de API + Hetzner + hexonet.com + hosting.de Hurricane Electric - Infoblox API - Infomaniak API - INWX XMLRPC API - IONOS domain API - ISPConfig 3.1+ API - Joker API - KingHost DNS API - Knot (knsupdate) DNS API - LeaseWeb API - lexicon DNS API - Linode API (v3 / Deprecated) - Linode API (v4) - Loopia API - LuaDNS.com API - MailinaBox API - Name.com API - Namecheap API - Namesilo.com API - Nederhost API - netcup DNS API - Njalla API - NS1.com API + Infoblox + Infomaniak + INWX XMLRPC + IONOS domain + ISPConfig 3.1+ + Joker + KingHost + Knot (knsupdate) + LeaseWeb + lexicon + Linode (v3 / Deprecated) + Linode (v4) + Loopia + LuaDNS.com + MailinaBox + Name.com + Namecheap + Namesilo.com + Nederhost + netcup + Njalla + NS1.com nsupdate (RFC 2136) OPNsense BIND Plugin - OVH, kimsufi, soyoustart and runabove API - PowerDNS.com API - Plesk XML API - Porkbun API + OVH, kimsufi, soyoustart and runabove + PowerDNS.com + Plesk + Porkbun SchlundTech - selectel.com / selectel.ru domain API - Selfhost API - Servercow API v1 - Simply.com API - Transip API - UnoEuro API - Variomedia.de API - Vscale API - Vultr API - Yandex PDD API - Zilore DNS API - Zone.eu API - zonomi.com domain API + selectel.com / selectel.ru + Selfhost + Servercow + Simply.com + Transip + UnoEuro + Variomedia.de + Vscale + Vultr + Yandex PDD + Zilore + Zone.eu + zonomi.com @@ -725,67 +725,67 @@ N cloudflare - Aliyun.com API - AuroraDNS API + Aliyun.com + AuroraDNS Auto API - Azure DNS API - CloudFlare API - ClouDNS API - CloudXNS API - ConoHa API - Constellix API - DigitalOcean API - Dinahosting API - DirectAdmin API - DNSimple API - DnsMadeEasy API - DNSPark API - DNSPod API - Dreamhost API - EasyDNS API - Easyname API - ExoScale API - Gandi API - Gehirn API - Glesys API - GoDaddy API - Google Cloud DNS API - GratisDNS API - Hurricane Electric DNS API - Hetzner API - Hover API - Infoblox API - Internet.bs API - INWX API - Linode API - Linode v4 API - Localzone API - LuaDNS API - Memset API - Namecheap API - Namesilo API - Netcup API - NFSN API - NS1 API - OnApp API - Online API - OVH API - Plesk API - PointHQ API - PowerDNS API - Rackspace API - Rage4 API - Route 53 API - SafeDNS API - SakuraCloud API - Softlayer API - Subreg API - Transip API - Vultr API - Yandex API - Zeit API - Zilore API - Zonomi API + Azure + CloudFlare + ClouDNS + CloudXNS + ConoHa + Constellix + DigitalOcean + Dinahosting + DirectAdmin + DNSimple + DnsMadeEasy + DNSPark + DNSPod + Dreamhost + EasyDNS + Easyname + ExoScale + Gandi + Gehirn + Glesys + GoDaddy + Google Cloud + GratisDNS + Hurricane Electric + Hetzner + Hover + Infoblox + Internet.bs + INWX + Linode (v3 / Deprecated) + Linode (v4) + Localzone + LuaDNS + Memset + Namecheap + Namesilo + Netcup + NFSN + NS1 + OnApp + Online + OVH + Plesk + PointHQ + PowerDNS + Rackspace + Rage4 + Route 53 + SafeDNS + SakuraCloud + Softlayer + Subreg + Transip + Vultr + Yandex + Zeit + Zilore + Zonomi From f7a9483bc1b0c5cc38f8cd3162c83be925ab6501 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 27 Jul 2022 16:51:27 +0200 Subject: [PATCH 1110/3088] security/acme-client: support uploading certificate to Vault, closes #2796 --- security/acme-client/pkg-descr | 7 +-- .../AcmeClient/forms/dialogAction.xml | 23 +++++++++ .../AcmeClient/LeAutomation/AcmeVault.php | 51 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 15 ++++++ 4 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 80eefd1933..63960dbe01 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -11,9 +11,10 @@ Plugin Changelog 3.12 Added: -* Add Simply.com DNS API (#2888) -* Add Active24 challenge type (#3049) -* Add support for Zone ID in Cloudflare challenge type (#2973) +* add Simply.com DNS API (#2888) +* add Active24 challenge type (#3049) +* add support for Zone ID in Cloudflare challenge type (#2973) +* new automation: upload certificate to Vault (#2796) Fixed: * Re-order function parameters due to PHP8 deprecation notice (#3043) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml index d3ecd46644..45544272c1 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml @@ -274,4 +274,27 @@ text Path to the Unifi keystore file in the local filesystem, i.e. /usr/local/share/java/unifi/data/keystore. + + + header + + + + action.acme_vault_url + + text + URL of the Vault, i.e. http://vault.example.com:8200. + + + action.acme_vault_prefix + + text + This specifies the prefix path in Vault. + + + action.acme_vault_kvv2 + + checkbox + If checked version 2 of the kv store will be used, otherwise version 1. + diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php new file mode 100644 index 0000000000..3eab03d75d --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php @@ -0,0 +1,51 @@ +acme_env['VAULT_ADDR'] = (string)$this->config->acme_vault_url; + if (!empty((string)$this->config->acme_vault_prefix)) { + $this->acme_env['VAULT_PREFIX'] = (string)$this->config->acme_vault_prefix; + } + if ((string)$this->config->acme_vault_kvv2 == 1) { + $this->acme_env['VAULT_KV_V2'] = 1; + } + $this->acme_args[] = '--deploy-hook vault'; + return true; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index c5c7c4a979..b1fef123b4 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1129,6 +1129,7 @@ Upload certificate via SFTP Remote Command via SSH Upload certificate to FRITZ!Box router + Upload certificate to HashiCorp Vault Upload certificate to Synology DSM Update local Unifi keystore System or Plugin Command @@ -1325,6 +1326,20 @@ /usr/local/share/java/unifi/data/keystore N + + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + + + acme + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + + + 1 + From 461787e0a6382f7ed533912e2ef9ade9e36b9242 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 27 Jul 2022 16:59:05 +0200 Subject: [PATCH 1111/3088] security/acme-client: relax port number restriction, closes #3005 --- security/acme-client/pkg-descr | 1 + .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 63960dbe01..8dab891226 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -21,6 +21,7 @@ Fixed: Changed: * simplyfi DNS service names +* relax port number restriction in SSH/SFTP automations (#3005) 3.11 diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index b1fef123b4..9ed293b83f 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1160,9 +1160,9 @@ N 1 - 49151 + 65535 22 - Should be a valid port number between 1 and 49151. + Should be a valid port number between 1 and 65535. N @@ -1236,9 +1236,9 @@ N 1 - 49151 + 65535 22 - Should be a valid port number between 1 and 49151. + Should be a valid port number between 1 and 65535. N From 692cc8d3e783552f9ad942d38d06cde866d91707 Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Wed, 27 Jul 2022 22:49:28 +0300 Subject: [PATCH 1112/3088] www/nginx: tls fingerprints rfc8701 compat. (#3018) * typo * rfc8701 * rfc8701 * includes * version bump * ignore SCSVs (rfc5746 and rfc7507) * add http_post hook so we can add maps if needed * Update pkg-descr --- www/nginx/Makefile | 3 +- www/nginx/pkg-descr | 7 +++++ .../opnsense/scripts/nginx/ngx_functions.js | 26 +++++++++++++---- .../src/opnsense/scripts/nginx/setup.php | 2 +- .../scripts/nginx/tls_ua_fingerprint.php | 28 +++++++++++++------ .../templates/OPNsense/Nginx/http.conf | 2 ++ 6 files changed, 52 insertions(+), 16 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 14fe6e55ea..1f80edd56b 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.28 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.29 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 697dfaafe4..e623b03e42 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -10,6 +10,13 @@ WWW: https://nginx.org/ Plugin Changelog ================ +1.29 + +* fixed a typo in the trusted tls fingerprints db creation part of setup.php +* rfc5746, rfc7507 and rfc8701 are taken into account on compiling and comparing tls fingerprints +* the reason for scoring the connection as intercepted is added to the X-TLS-Client-Intercepted header. check backend settings if using this feature +* http_post hook added to be able to map global variables + 1.28 * add support for connect-src and worker-src in content security policy diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js b/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js index 3acd7d9dbc..bdfdbbbcb7 100755 --- a/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js @@ -1,13 +1,17 @@ var fs = require('fs'); var tls_fingerprints = JSON.parse(fs.readFileSync('/usr/local/etc/nginx/tls_fingerprints.json')); +// ignore GREASE cipher suite values when compiling a browser fingerprint (see rfc8701) +const GREASE = ["0x0a0a", "0x1a1a", "0x2a2a", "0x3a3a", "0x4a4a", "0x5a5a", "0x6a6a", "0x7a7a", "0x8a8a", "0x9a9a", "0xaaaa", "0xbaba", "0xcaca", "0xdada", "0xeaea", "0xfafa"]; +// ignore SCSV cipher suite values when compiling a browser fingerprint (see rfc5746 and rfc7507) +const SCSV = ["TLS_EMPTY_RENEGOTIATION_INFO_SCSV", "TLS_FALLBACK_SCSV"]; function check_cipher_array(r, browser_ciphers, fingerprint_ciphers, result) { - if (result.status == 'Intercepted') { + if (result.status.includes('Intercepted')) { return; } if (browser_ciphers.length > fingerprint_ciphers.length) { - // the proxy supports more cipers than the browser -> intercepted - result.status = "Intercepted"; + // the proxy supports more ciphers than the browser -> intercepted + result.status = "Intercepted; Reason=\"excess suite\""; return; } var browser_cipher; @@ -18,9 +22,9 @@ function check_cipher_array(r, browser_ciphers, fingerprint_ciphers, result) { browser_cipher = browser_ciphers[browser_cipher_index]; current_index = fingerprint_ciphers.indexOf(browser_cipher); if (current_index === -1 || current_index <= last_index) { - // a cipher has been found, which is not supported by the browser + // a cipher has been found, which is not supported by the browser or order of preference changed // such a connection is definitly intercepted - result.status = "Intercepted"; + result.status = "Intercepted; Reason=\"excess suite or wrong order\""; return; } last_index = current_index; @@ -36,11 +40,23 @@ function check_intercept(r) { var ua = r.headersIn['User-Agent']; if (ua in tls_fingerprints) { var fp = tls_fingerprints[ua]; + fp.ciphers = fp.ciphers.filter( function( el ) { + return ((GREASE.indexOf( el ) < 0) && (SCSV.indexOf( el ) < 0)); + } ); + fp.curves = fp.curves.filter( function( el ) { + return GREASE.indexOf( el ) < 0; + } ); var browser_ciphers = r.variables.ssl_ciphers.split(':'); + browser_ciphers = browser_ciphers.filter( function( el ) { + return ((GREASE.indexOf( el ) < 0) && (SCSV.indexOf( el ) < 0)); + } ); check_cipher_array(r, browser_ciphers, fp.ciphers, tls_result); if (r.variables.ssl_curves != '') { var browser_curves = r.variables.ssl_curves.split(':'); + browser_curves = browser_curves.filter( function( el ) { + return GREASE.indexOf( el ) < 0; + } ); check_cipher_array(r, browser_curves, fp.curves, tls_result); } } diff --git a/www/nginx/src/opnsense/scripts/nginx/setup.php b/www/nginx/src/opnsense/scripts/nginx/setup.php index 849b482572..ce440df371 100755 --- a/www/nginx/src/opnsense/scripts/nginx/setup.php +++ b/www/nginx/src/opnsense/scripts/nginx/setup.php @@ -304,7 +304,7 @@ function find_ca($refid) if ((string)$tls_fingerprint->trusted == '1') { $ciphers = explode(':', (string)$tls_fingerprint->ciphers); if (!empty((string)$tls_fingerprint->curves)) { - $curves = explode(':', (string)$tls_fingerprint->ciphers); + $curves = explode(':', (string)$tls_fingerprint->curves); } else { $curves = array(); } diff --git a/www/nginx/src/opnsense/scripts/nginx/tls_ua_fingerprint.php b/www/nginx/src/opnsense/scripts/nginx/tls_ua_fingerprint.php index 7ba8f1b16d..89fd7148e6 100755 --- a/www/nginx/src/opnsense/scripts/nginx/tls_ua_fingerprint.php +++ b/www/nginx/src/opnsense/scripts/nginx/tls_ua_fingerprint.php @@ -31,13 +31,25 @@ function parse_line($line) { + // ignore GREASE cipher suite values when compiling a browser fingerprint (see rfc8701) + $GREASE = array("0x0a0a", "0x1a1a", "0x2a2a", "0x3a3a", "0x4a4a", "0x5a5a", "0x6a6a", "0x7a7a", "0x8a8a", "0x9a9a", "0xaaaa", "0xbaba", "0xcaca", "0xdada", "0xeaea", "0xfafa"); + // ignore SCSV cipher suite values when compiling a browser fingerprint (see rfc5746 and rfc7507) + $SCSV = array("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", "TLS_FALLBACK_SCSV"); $tmp = explode('"', trim($line)); - return array( + $fp = array( 'ua' => $tmp[1], 'ciphers' => $tmp[3], 'curves' => $tmp[5] == '-' ? '' : $tmp[5], 'count' => 1 ); + // exclude GREASE and SCSV suits from fingerprint + $fp_ciphers = explode(':', $fp['ciphers']); + $fp_ciphers = array_diff($fp_ciphers, $GREASE, $SCSV); + $fp['ciphers'] = implode(':', $fp_ciphers); + $fp_curves = explode(':', $fp['curves']); + $fp_curves = array_diff($fp_curves, $GREASE); + $fp['curves'] = implode(':', $fp_curves); + return $fp; } function filter_ua($key) { @@ -61,13 +73,13 @@ function filter_ua($key) $handle = @fopen($tls_logfile, 'r'); if ($handle) { while (($buffer = fgets($handle)) !== false) { - $md5line = md5($buffer); - if (array_key_exists($md5line, $fingerprints)) { - $fingerprints[$md5line]['count']++; - } else { - $parsed_line = parse_line($buffer); - if ($parsed_line['ciphers'] != '-') { - $fingerprints[$md5line] = $parsed_line; + $parsed_line = parse_line($buffer); + if ($parsed_line['ciphers'] != '-') { + $md5fp = md5($parsed_line['ua'] . $parsed_line['ciphers'] . $parsed_line['curves']); + if (array_key_exists($md5fp, $fingerprints)) { + $fingerprints[$md5fp]['count']++; + } else { + $fingerprints[$md5fp] = $parsed_line; } } } diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf index 4b4e0886bc..b7655a0542 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf @@ -52,6 +52,8 @@ map $http_upgrade $connection_upgrade { '' close; } +include http_post/*.conf; + # TODO add when core is ready for allowing nginx to serve the web interface # include nginx_web.conf; From ca778bc0d915407526cb99a200ea7d6a6d3ecd6e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 28 Jul 2022 09:03:14 +0200 Subject: [PATCH 1113/3088] LICENSE: sync --- LICENSE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 60ca98df55..412acf3ee1 100644 --- a/LICENSE +++ b/LICENSE @@ -21,7 +21,7 @@ Copyright (c) 2014-2021 Franco Fichtner Copyright (c) 2016-2021 Frank Wall Copyright (c) 2021 Github-jjw Copyright (c) 2016 IT-assistans Sverige AB -Copyright (c) 2021 Jan Winkler +Copyright (c) 2021-2022 Jan Winkler Copyright (c) 2010 Jim Pingle Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça @@ -37,6 +37,7 @@ Copyright (c) 2020 Martin Wasley Copyright (c) 2022 Marvo2011 Copyright (c) 2017-2021 Michael Muenz Copyright (c) 2021 Nicola Pellegrini +Copyright (c) 2022 Nikolaj Brinch Jørgensen Copyright (c) 2021 Nim G Copyright (c) 2004-2012 Scott Ullrich Copyright (c) 2010 Seth Mos From db2e4bcb0610143f6cfa413c86c0c92f80dd3db0 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 29 Jul 2022 19:46:11 +0200 Subject: [PATCH 1114/3088] sysutils/git-backup - reference defined git. (https://github.com/opnsense/plugins/issues/2994) --- .../src/opnsense/mvc/app/library/OPNsense/Backup/Git.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php b/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php index 461b813fad..ebd43a9876 100644 --- a/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php +++ b/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php @@ -159,10 +159,10 @@ public function backup() } else { $url = substr($url, 0, $pos + 2) . urlencode((string)$mdl->user) . "@" . substr($url, $pos + 2); } - exec("cd {$targetdir} && git remote remove origin"); - exec("cd {$targetdir} && git remote add origin " . escapeshellarg($url)); + exec("cd {$targetdir} && {$git} remote remove origin"); + exec("cd {$targetdir} && {$git} remote add origin " . escapeshellarg($url)); $pushtxt = shell_exec( - "(cd {$targetdir} && git push origin " . escapeshellarg("master:{$mdl->branch}") . + "(cd {$targetdir} && {$git} push origin " . escapeshellarg("master:{$mdl->branch}") . " && echo '__exit_ok__') 2>&1" ); if (strpos($pushtxt, '__exit_ok__')) { From cc0605386cc4ceacb9b178852acfd19a40a8fb74 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 1 Aug 2022 07:58:27 +0200 Subject: [PATCH 1115/3088] www/nginx: PHP compat PR: https://www.reddit.com/r/opnsense/comments/wa6xil/comment/iifo8oe/?context=3 --- www/nginx/src/opnsense/scripts/nginx/setup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/nginx/src/opnsense/scripts/nginx/setup.php b/www/nginx/src/opnsense/scripts/nginx/setup.php index ce440df371..d54aae63d9 100755 --- a/www/nginx/src/opnsense/scripts/nginx/setup.php +++ b/www/nginx/src/opnsense/scripts/nginx/setup.php @@ -228,7 +228,7 @@ function find_ca($refid) foreach ($users as $user) { $user_node = $nginx->getNodeByReference("credential." . $user); $username = (string)$user_node->username; - $password = crypt((string)$user_node->password); + $password = crypt((string)$user_node->password, '$6$'); fwrite($file, $username . ':' . $password . "\n"); } } finally { From e90663d0c334396272611e92b4c6c9c653bf46ab Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 1 Aug 2022 08:00:20 +0200 Subject: [PATCH 1116/3088] www/nginx: also add release note --- www/nginx/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index e623b03e42..6983b189f8 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -16,6 +16,7 @@ Plugin Changelog * rfc5746, rfc7507 and rfc8701 are taken into account on compiling and comparing tls fingerprints * the reason for scoring the connection as intercepted is added to the X-TLS-Client-Intercepted header. check backend settings if using this feature * http_post hook added to be able to map global variables +* PHP 8 compatibility for crypt() call 1.28 From 9f89264b38a7c1f46ff5fca7e130981469cab265 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 1 Aug 2022 08:08:50 +0200 Subject: [PATCH 1117/3088] net/haproxy: bump revision for fix --- net/haproxy/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 56e1e159a7..cf23f5c8f8 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 3.10 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy24 PLUGIN_MAINTAINER= opnsense@moov.de From 5456249102403124223fd0c086e3dc764068d67b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 1 Aug 2022 09:06:06 +0200 Subject: [PATCH 1118/3088] dns/dyndns: duplicated string in translation --- dns/dyndns/src/www/services_dyndns_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/dyndns/src/www/services_dyndns_edit.php b/dns/dyndns/src/www/services_dyndns_edit.php index 9eac454d85..3b5d12cb6d 100644 --- a/dns/dyndns/src/www/services_dyndns_edit.php +++ b/dns/dyndns/src/www/services_dyndns_edit.php @@ -444,7 +444,7 @@ function is_dyndns_username($uname)

    - +

    From 64d3e7fa8108328e19df1423d2ad15a8d74f6c4b Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 1 Aug 2022 09:27:19 +0200 Subject: [PATCH 1119/3088] security/maltrail: remove MFS for /var/log/ (#3039) --- security/maltrail/Makefile | 2 +- security/maltrail/pkg-descr | 4 ++++ .../service/templates/OPNsense/Maltrail/maltrailsensor | 1 - .../service/templates/OPNsense/Maltrail/maltrailserver | 1 - 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/security/maltrail/Makefile b/security/maltrail/Makefile index 04126919b3..ba46250906 100644 --- a/security/maltrail/Makefile +++ b/security/maltrail/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= maltrail -PLUGIN_VERSION= 1.8 +PLUGIN_VERSION= 1.9 PLUGIN_COMMENT= Malicious traffic detection system PLUGIN_DEPENDS= maltrail PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/maltrail/pkg-descr b/security/maltrail/pkg-descr index 0bb1e62876..ffaec161d9 100644 --- a/security/maltrail/pkg-descr +++ b/security/maltrail/pkg-descr @@ -11,6 +11,10 @@ WWW: https://github.com/stamparm/maltrail Changelog --------- +1.9 + +* Remove MFS support for /var/log/ + 1.8 * Add firewall alias "BlocklistMaltrail" that points to the built-in ip block list diff --git a/security/maltrail/src/opnsense/service/templates/OPNsense/Maltrail/maltrailsensor b/security/maltrail/src/opnsense/service/templates/OPNsense/Maltrail/maltrailsensor index 0f1dc4832f..6c3ffe4bb3 100644 --- a/security/maltrail/src/opnsense/service/templates/OPNsense/Maltrail/maltrailsensor +++ b/security/maltrail/src/opnsense/service/templates/OPNsense/Maltrail/maltrailsensor @@ -4,4 +4,3 @@ maltrailsensor_enable="YES" {% else %} maltrailsensor_enable="NO" {% endif %} -maltrailsensor_var_mfs="/var/log/maltrail" diff --git a/security/maltrail/src/opnsense/service/templates/OPNsense/Maltrail/maltrailserver b/security/maltrail/src/opnsense/service/templates/OPNsense/Maltrail/maltrailserver index 12095bdd28..d62c5c9978 100644 --- a/security/maltrail/src/opnsense/service/templates/OPNsense/Maltrail/maltrailserver +++ b/security/maltrail/src/opnsense/service/templates/OPNsense/Maltrail/maltrailserver @@ -4,4 +4,3 @@ maltrailserver_enable="YES" {% else %} maltrailserver_enable="NO" {% endif %} -maltrailserver_var_mfs="/var/log/maltrail" From 1a4473098b2f1a93e416e03ee6975c3fe63a4948 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 1 Aug 2022 09:27:38 +0200 Subject: [PATCH 1120/3088] net-mgmt/netdata: Remove MFS support for /var/log (#3040) --- net-mgmt/netdata/Makefile | 2 +- net-mgmt/netdata/pkg-descr | 4 ++++ .../src/opnsense/service/templates/OPNsense/Netdata/netdata | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net-mgmt/netdata/Makefile b/net-mgmt/netdata/Makefile index cb657ff660..d3001748f5 100644 --- a/net-mgmt/netdata/Makefile +++ b/net-mgmt/netdata/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= netdata -PLUGIN_VERSION= 1.1 +PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= Real-time performance monitoring PLUGIN_DEPENDS= netdata PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/netdata/pkg-descr b/net-mgmt/netdata/pkg-descr index 3fc3732e14..03ea456d49 100644 --- a/net-mgmt/netdata/pkg-descr +++ b/net-mgmt/netdata/pkg-descr @@ -12,6 +12,10 @@ WWW: https://github.com/netdata/netdata Plugin Changelog ================ +1.2 + +* Remove MFS support for /var/log + 1.1 * Allow listening to IPv6 address diff --git a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata index 5a3766600a..ba325b6f9f 100644 --- a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata +++ b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata @@ -4,4 +4,4 @@ netdata_enable="YES" {% else %} netdata_enable="NO" {% endif %} -netdata_var_mfs="/var/cache/netdata /var/db/netdata /var/log/netdata" +netdata_var_mfs="/var/cache/netdata /var/db/netdata" From 6604664d9007fefecb91e802416a0832fcb82782 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 1 Aug 2022 09:27:54 +0200 Subject: [PATCH 1121/3088] sysutils/munin-node: Remove MFS support for /var/log (#3041) --- sysutils/munin-node/Makefile | 3 +-- sysutils/munin-node/pkg-descr | 7 +++++++ .../service/templates/OPNsense/Muninnode/munin_node | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile index 95702e163b..0248c76819 100644 --- a/sysutils/munin-node/Makefile +++ b/sysutils/munin-node/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= munin-node -PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= Munin monitoring agent PLUGIN_DEPENDS= munin-node PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/sysutils/munin-node/pkg-descr b/sysutils/munin-node/pkg-descr index 1ac945582d..c5b0937925 100644 --- a/sysutils/munin-node/pkg-descr +++ b/sysutils/munin-node/pkg-descr @@ -11,3 +11,10 @@ of creating own "plugins" (graphs). This is the node part. It is used on all machines Munin shall watch. WWW: http://munin-monitoring.org/ + +Plugin Changelog +---------------- + +1.1 + +* Remove MFS support for /var/log diff --git a/sysutils/munin-node/src/opnsense/service/templates/OPNsense/Muninnode/munin_node b/sysutils/munin-node/src/opnsense/service/templates/OPNsense/Muninnode/munin_node index ffcc9469ab..893b0f3d8c 100644 --- a/sysutils/munin-node/src/opnsense/service/templates/OPNsense/Muninnode/munin_node +++ b/sysutils/munin-node/src/opnsense/service/templates/OPNsense/Muninnode/munin_node @@ -4,4 +4,4 @@ munin_node_enable="YES" {% else %} munin_node_enable="NO" {% endif %} -munin_node_var_mfs="/var/cache/munin_node /var/db/munin_node /var/log/munin_node" +munin_node_var_mfs="/var/cache/munin_node /var/db/munin_node" From 4c74529f613a28b06f784ed34925e3fefd82d326 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 1 Aug 2022 09:29:17 +0200 Subject: [PATCH 1122/3088] plugins: remove obsolete _var_mfs; closes #3002 --- .../src/opnsense/service/templates/OPNsense/Netdata/netdata | 1 - .../src/opnsense/service/templates/OPNsense/Chrony/chronyd | 1 - net/ntopng/src/opnsense/service/templates/OPNsense/Ntopng/ntopng | 1 - net/vnstat/src/opnsense/service/templates/OPNsense/Vnstat/vnstat | 1 - .../src/opnsense/service/templates/OPNsense/zerotier/zerotier | 1 - .../src/opnsense/service/templates/OPNsense/AcmeClient/rc.conf.d | 1 - .../src/opnsense/service/templates/OPNsense/ClamAV/clamav_clamd | 1 - .../src/opnsense/service/templates/OPNsense/Muninnode/munin_node | 1 - 8 files changed, 8 deletions(-) diff --git a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata index ba325b6f9f..18cbcf68c4 100644 --- a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata +++ b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata @@ -4,4 +4,3 @@ netdata_enable="YES" {% else %} netdata_enable="NO" {% endif %} -netdata_var_mfs="/var/cache/netdata /var/db/netdata" diff --git a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chronyd b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chronyd index 2faa5b55bc..49fffb820e 100644 --- a/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chronyd +++ b/net/chrony/src/opnsense/service/templates/OPNsense/Chrony/chronyd @@ -4,4 +4,3 @@ chronyd_enable="YES" {% else %} chronyd_enable="NO" {% endif %} -chronyd_var_mfs="/var/db/chronyd /var/run/chronyd" diff --git a/net/ntopng/src/opnsense/service/templates/OPNsense/Ntopng/ntopng b/net/ntopng/src/opnsense/service/templates/OPNsense/Ntopng/ntopng index d1077ce1cf..84d4a2dbf2 100644 --- a/net/ntopng/src/opnsense/service/templates/OPNsense/Ntopng/ntopng +++ b/net/ntopng/src/opnsense/service/templates/OPNsense/Ntopng/ntopng @@ -5,4 +5,3 @@ ntopng_flags="/usr/local/etc/ntopng.conf" {% else %} ntopng_enable="NO" {% endif %} -ntopng_var_mfs="/var/db/ntopng" diff --git a/net/vnstat/src/opnsense/service/templates/OPNsense/Vnstat/vnstat b/net/vnstat/src/opnsense/service/templates/OPNsense/Vnstat/vnstat index 923be6d5eb..c04a95f782 100644 --- a/net/vnstat/src/opnsense/service/templates/OPNsense/Vnstat/vnstat +++ b/net/vnstat/src/opnsense/service/templates/OPNsense/Vnstat/vnstat @@ -12,4 +12,3 @@ vnstat_additional_ifaces="{{ interfaces|join(' ') }}" {% else %} vnstat_enable="NO" {% endif %} -vnstat_var_mfs="/var/lib/vnstat" diff --git a/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/zerotier b/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/zerotier index 78740ebaaf..b7faa41054 100644 --- a/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/zerotier +++ b/net/zerotier/src/opnsense/service/templates/OPNsense/zerotier/zerotier @@ -6,4 +6,3 @@ zerotier_enable="YES" {% else %} zerotier_enable="NO" {% endif %} -zerotier_var_mfs="/var/db/zerotier-one" diff --git a/security/acme-client/src/opnsense/service/templates/OPNsense/AcmeClient/rc.conf.d b/security/acme-client/src/opnsense/service/templates/OPNsense/AcmeClient/rc.conf.d index 41ca3359a6..b43c75151c 100644 --- a/security/acme-client/src/opnsense/service/templates/OPNsense/AcmeClient/rc.conf.d +++ b/security/acme-client/src/opnsense/service/templates/OPNsense/AcmeClient/rc.conf.d @@ -6,4 +6,3 @@ acme_http_challenge_var_script="/usr/local/opnsense/scripts/OPNsense/AcmeClient/ {% else %} acme_http_challenge_enable=NO {% endif %} -acme_http_challenge_var_mfs="/var/etc/acme-client" diff --git a/security/clamav/src/opnsense/service/templates/OPNsense/ClamAV/clamav_clamd b/security/clamav/src/opnsense/service/templates/OPNsense/ClamAV/clamav_clamd index 271642d42e..f46fa24a25 100644 --- a/security/clamav/src/opnsense/service/templates/OPNsense/ClamAV/clamav_clamd +++ b/security/clamav/src/opnsense/service/templates/OPNsense/ClamAV/clamav_clamd @@ -4,4 +4,3 @@ clamav_clamd_enable="YES" {% else %} clamav_clamd_enable="NO" {% endif %} -clamav_clamd_var_mfs="/var/db/clamav" diff --git a/sysutils/munin-node/src/opnsense/service/templates/OPNsense/Muninnode/munin_node b/sysutils/munin-node/src/opnsense/service/templates/OPNsense/Muninnode/munin_node index 893b0f3d8c..6c9fc82aa4 100644 --- a/sysutils/munin-node/src/opnsense/service/templates/OPNsense/Muninnode/munin_node +++ b/sysutils/munin-node/src/opnsense/service/templates/OPNsense/Muninnode/munin_node @@ -4,4 +4,3 @@ munin_node_enable="YES" {% else %} munin_node_enable="NO" {% endif %} -munin_node_var_mfs="/var/cache/munin_node /var/db/munin_node" From c2184c76a4dda10bd3699eb4054da5454f0e0edd Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 2 Aug 2022 08:34:59 +0200 Subject: [PATCH 1123/3088] www/nginx: move to password_hash() as suggested by @dabo-devconsole; closes #3063 --- www/nginx/pkg-descr | 2 +- www/nginx/src/opnsense/scripts/nginx/setup.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 6983b189f8..9b18e85d6d 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -16,7 +16,7 @@ Plugin Changelog * rfc5746, rfc7507 and rfc8701 are taken into account on compiling and comparing tls fingerprints * the reason for scoring the connection as intercepted is added to the X-TLS-Client-Intercepted header. check backend settings if using this feature * http_post hook added to be able to map global variables -* PHP 8 compatibility for crypt() call +* PHP 8 compatibility: change crypt() to password_hash() 1.28 diff --git a/www/nginx/src/opnsense/scripts/nginx/setup.php b/www/nginx/src/opnsense/scripts/nginx/setup.php index d54aae63d9..7442501047 100755 --- a/www/nginx/src/opnsense/scripts/nginx/setup.php +++ b/www/nginx/src/opnsense/scripts/nginx/setup.php @@ -228,7 +228,7 @@ function find_ca($refid) foreach ($users as $user) { $user_node = $nginx->getNodeByReference("credential." . $user); $username = (string)$user_node->username; - $password = crypt((string)$user_node->password, '$6$'); + $password = password_hash((string)$user_node->password, PASSWORD_DEFAULT); fwrite($file, $username . ':' . $password . "\n"); } } finally { From 64f0ca4390c4e9a8b1bf163c2b722ffc10dd1d66 Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Wed, 3 Aug 2022 15:49:20 +0200 Subject: [PATCH 1124/3088] Add udr challenge type --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsUdr.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 3 files changed, 67 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsUdr.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 0d6d449c55..0d5997740c 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1098,6 +1098,21 @@ textbox Requires the whole key file in a format that is compatible with TransIP. + + + header + + + + validation.dns_udr_user + + text + + + validation.dns_udr_password + + password + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsUdr.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsUdr.php new file mode 100644 index 0000000000..0fb39e8717 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsUdr.php @@ -0,0 +1,45 @@ +acme_env['UDR_USER'] = (string)$this->config->dns_udr_user; + $this->acme_env['UDR_PASS'] = (string)$this->config->dns_udr_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 9ed293b83f..8796d1a5ee 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -492,6 +492,7 @@ Servercow Simply.com Transip + united-domains Reselling UnoEuro Variomedia.de Vscale @@ -964,6 +965,12 @@ N + + N + + + N + N From 684715cac90267e42ad56ab149d21f2669a1c229 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 3 Aug 2022 18:16:05 +0200 Subject: [PATCH 1125/3088] security/acme-client: update changelog, refs 3066 --- security/acme-client/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 8dab891226..6384141a6b 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -13,6 +13,7 @@ Plugin Changelog Added: * add Simply.com DNS API (#2888) * add Active24 challenge type (#3049) +* add united-domains Reselling challenge type (#3066) * add support for Zone ID in Cloudflare challenge type (#2973) * new automation: upload certificate to Vault (#2796) From 39cd031eecec1996d6ff76131dfdf702fdbfbd5a Mon Sep 17 00:00:00 2001 From: Hobby-Student <6012744+Hobby-Student@users.noreply.github.com> Date: Thu, 4 Aug 2022 22:59:10 +0200 Subject: [PATCH 1126/3088] update ACME Client KAS by all-inkl.com --- .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 8796d1a5ee..1c747e49bb 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1073,9 +1073,10 @@ N - sha1 + plain - SHA1 + plain + SHA1 (deprecated in December 2022) From a0863f88a83635454134b2811e634bcaacfe0a08 Mon Sep 17 00:00:00 2001 From: Hobby-Student <6012744+Hobby-Student@users.noreply.github.com> Date: Fri, 5 Aug 2022 09:37:16 +0200 Subject: [PATCH 1127/3088] classify KAS authdata as password --- .../controllers/OPNsense/AcmeClient/forms/dialogValidation.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 0d5997740c..696354ec19 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1395,7 +1395,7 @@ validation.dns_kas_authdata - text + password validation.dns_kas_authtype From 8dd163fd48e9897acd1ea6ec4cdc0accff2be2a6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Aug 2022 10:52:32 +0200 Subject: [PATCH 1128/3088] net/relayd: phpunit 9 fix --- .../mvc/tests/app/compound/OPNsense/Relayd/RelaydTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/relayd/src/opnsense/mvc/tests/app/compound/OPNsense/Relayd/RelaydTest.php b/net/relayd/src/opnsense/mvc/tests/app/compound/OPNsense/Relayd/RelaydTest.php index 86cca27199..8df0b737a4 100644 --- a/net/relayd/src/opnsense/mvc/tests/app/compound/OPNsense/Relayd/RelaydTest.php +++ b/net/relayd/src/opnsense/mvc/tests/app/compound/OPNsense/Relayd/RelaydTest.php @@ -40,7 +40,7 @@ class RelaydTest extends \PHPUnit\Framework\TestCase // holds the SettingsController object protected static $setRelayd; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$setRelayd = new \OPNsense\Relayd\Api\SettingsController(); } From 6d864893ee840fb68f0b13dfe7900e1a5a6dbacf Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 8 Aug 2022 10:59:48 +0200 Subject: [PATCH 1129/3088] plugins: sync --- LICENSE | 2 +- .../app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 412acf3ee1..336483a1a8 100644 --- a/LICENSE +++ b/LICENSE @@ -18,7 +18,7 @@ Copyright (c) 2008-2010 Ermal Luçi Copyright (c) 2017-2020 Fabian Franz Copyright (c) 2019 Felix Matouschek Copyright (c) 2014-2021 Franco Fichtner -Copyright (c) 2016-2021 Frank Wall +Copyright (c) 2016-2022 Frank Wall Copyright (c) 2021 Github-jjw Copyright (c) 2016 IT-assistans Sverige AB Copyright (c) 2021-2022 Jan Winkler diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php index 3eab03d75d..7242b58f66 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeVault.php @@ -31,7 +31,7 @@ use OPNsense\AcmeClient\LeAutomationInterface; /** - * Run acme.sh deploy hook vault + * Run acme.sh deploy hook vault * @package OPNsense\AcmeClient */ class AcmeVault extends Base implements LeAutomationInterface From ce1995a5852037ea9b342cde8099ebd659b3fa52 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 8 Aug 2022 11:03:53 +0200 Subject: [PATCH 1130/3088] sysutils/git-backup: bump --- sysutils/git-backup/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysutils/git-backup/Makefile b/sysutils/git-backup/Makefile index da33116f5d..7e83b27164 100644 --- a/sysutils/git-backup/Makefile +++ b/sysutils/git-backup/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= git-backup PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Track config changes using git PLUGIN_DEPENDS= git PLUGIN_MAINTAINER= ad@opnsense.org From 74d625633bba00495969984190cf59be9b3666dd Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Mon, 8 Aug 2022 11:46:06 +0200 Subject: [PATCH 1131/3088] acme-client: Add Mythic Beasts API for challenge types --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../LeValidation/DnsMythicbeasts.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 3 files changed, 67 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicbeasts.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 0d5997740c..c92b00098f 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -818,6 +818,21 @@ text MailinaBox Server FQDN + + + header + + + + validation.dns_mythic_beasts_key + + text + + + validation.dns_mythic_beasts_secret + + text + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicbeasts.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicbeasts.php new file mode 100644 index 0000000000..dc1a4d7053 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicbeasts.php @@ -0,0 +1,45 @@ +acme_env['MB_AK'] = (string)$this->config->dns_mythic_beasts_key; + $this->acme_env['MB_AS'] = (string)$this->config->dns_mythic_beasts_secret; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 8796d1a5ee..6cbe74fe80 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -473,6 +473,7 @@ Loopia LuaDNS.com MailinaBox + Mythic Beasts Name.com Namecheap Namesilo.com @@ -832,6 +833,12 @@ N + + N + + + N + N From 733f91870fed8ca397279eaac5a7303d4dc50108 Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Tue, 9 Aug 2022 12:26:43 +0200 Subject: [PATCH 1132/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- security/acme-client/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 86944b5d69..ad0e59696e 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.12 +PLUGIN_VERSION= 3.13 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 6384141a6b..6ce18d780f 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.13 + +Added: +* add Mythic Beasts DNS API (#2998) + 3.12 Added: From 1aa3646820a32be84b1cabd0fb945de9e3883deb Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Tue, 9 Aug 2022 12:41:48 +0200 Subject: [PATCH 1133/3088] acme-client: Adjust file and class name for Mythic Beasts challenge types --- .../LeValidation/{DnsMythicbeasts.php => DnsMythicBeasts.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/{DnsMythicbeasts.php => DnsMythicBeasts.php} (96%) diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicbeasts.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicBeasts.php similarity index 96% rename from security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicbeasts.php rename to security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicBeasts.php index dc1a4d7053..f61b4fa687 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicbeasts.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsMythicBeasts.php @@ -35,7 +35,7 @@ * Mythic Beasts API * @package OPNsense\AcmeClient */ -class DnsMythicbeasts extends Base implements LeValidationInterface +class DnsMythicBeasts extends Base implements LeValidationInterface { public function prepare() { From 996c01166d3ae26a25d3a2abf6fa812792908248 Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Tue, 9 Aug 2022 11:34:22 +0200 Subject: [PATCH 1134/3088] net/haproxy: add 2 new cache parameters, closes #2908 --- .../OPNsense/HAProxy/forms/generalCache.xml | 12 ++++++++++++ .../mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 10 ++++++++++ .../service/templates/OPNsense/HAProxy/haproxy.conf | 8 ++++++++ 3 files changed, 30 insertions(+) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalCache.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalCache.xml index d9fd948b39..b38486734b 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalCache.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalCache.xml @@ -27,4 +27,16 @@ text + + haproxy.general.cache.processVary + + checkbox + + + + haproxy.general.cache.maxSecondaryEntries + + text + + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index e24826e1ee..cb38652471 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -402,6 +402,16 @@ N Please specify a value between 1 and 2146435072. + + 0 + N + + + 10 + 1 + N + Please specify a positive integer value. + diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 34862fb13f..be90eff14a 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1062,6 +1062,14 @@ cache opnsense-haproxy-cache {% if OPNsense.HAProxy.general.cache.maxObjectSize|default("") != "" %} max-object-size {{OPNsense.HAProxy.general.cache.maxObjectSize}} {% endif %} +{% if OPNsense.HAProxy.general.cache.processVary|default("") == "1" %} + process-vary on + {% if OPNsense.HAProxy.general.cache.maxSecondaryEntries|default("") != "" %} + max-secondary-entries {{OPNsense.HAProxy.general.cache.maxSecondaryEntries}} + {% endif %} +{% else %} + process-vary off +{% endif %} {%- endif -%} {# ############################### #} From 48abe360bbfb729e9531596c57a77af7d5a32067 Mon Sep 17 00:00:00 2001 From: Jan Winkler Date: Tue, 9 Aug 2022 15:21:23 +0200 Subject: [PATCH 1135/3088] net/haproxy: bump version --- net/haproxy/Makefile | 3 +-- net/haproxy/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index cf23f5c8f8..d5690280ef 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.10 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 3.11 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy24 PLUGIN_MAINTAINER= opnsense@moov.de diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index bf40d39e77..d33a113b13 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,11 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +3.11 + +Added: +* add support for cache parameter (#2908) + 3.10 WARNING: This release switches to the HAProxy 2.4 release series, From e2611c0b9f9fd0435a059ed1ad062e223b5f7bb4 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 10 Aug 2022 21:03:40 +0200 Subject: [PATCH 1136/3088] net/haproxy: bump model version --- .../src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index cb38652471..f6baa5c870 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 3.6.0 + 3.7.0 the HAProxy load balancer From 4546aeb47d62010ea4f8d3e4204b26285be864fe Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 12 Aug 2022 22:25:40 +0200 Subject: [PATCH 1137/3088] sysutils/git-backup: switch to passwordarea, closes #3070 --- sysutils/git-backup/Makefile | 2 +- .../src/opnsense/mvc/app/library/OPNsense/Backup/Git.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysutils/git-backup/Makefile b/sysutils/git-backup/Makefile index 7e83b27164..38c14397b9 100644 --- a/sysutils/git-backup/Makefile +++ b/sysutils/git-backup/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= git-backup PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= Track config changes using git PLUGIN_DEPENDS= git PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php b/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php index ebd43a9876..f402ae3bee 100644 --- a/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php +++ b/sysutils/git-backup/src/opnsense/mvc/app/library/OPNsense/Backup/Git.php @@ -68,7 +68,7 @@ public function getConfigurationFields() ], [ "name" => "privkey", - "type" => "textarea", + "type" => "passwordarea", "label" => gettext("SSH private key"), "help" => gettext("When provided, ssh based authentication will be used."), "value" => null From 2fceec58354937388cc47a7139481fd377a105d7 Mon Sep 17 00:00:00 2001 From: "Patrick M. Hausen" Date: Sun, 14 Aug 2022 16:20:50 +0200 Subject: [PATCH 1138/3088] dns/bind - use separate tables for master and slave domains --- dns/bind/Makefile | 2 +- dns/bind/pkg-descr | 4 + .../OPNsense/Bind/Api/DomainController.php | 27 +++- .../OPNsense/Bind/GeneralController.php | 3 +- ...ain.xml => dialogEditBindMasterDomain.xml} | 0 .../Bind/forms/dialogEditBindSlaveDomain.xml | 54 ++++++++ .../mvc/app/views/OPNsense/Bind/general.volt | 128 +++++++++++++----- 7 files changed, 173 insertions(+), 45 deletions(-) rename dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/{dialogEditBindDomain.xml => dialogEditBindMasterDomain.xml} (100%) create mode 100644 dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 292e24d28d..4631ccc036 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.23 +PLUGIN_VERSION= 1.24 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind916 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index c9e9d6e907..57a8283f3c 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -9,6 +9,10 @@ WWW: https://www.isc.org Plugin Changelog ================ +1.24 + +* Separate tables for master and slave zones in UI (contributed by Patrick M. Hausen and Manuel Faux) + 1.23 * Avoid errors with repeated primary servers and keys (contributed by Michael Newton) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php index df278dc53f..7dc5ef6b1a 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/DomainController.php @@ -39,12 +39,20 @@ class DomainController extends ApiMutableModelControllerBase protected static $internalModelName = 'domain'; protected static $internalModelClass = '\OPNsense\Bind\Domain'; - public function searchDomainAction() + public function searchMasterDomainAction() { - return $this->searchBase('domains.domain', array( - "enabled", "type", "masterip", "domainname", "allowtransfer", "allowquery", "ttl", - "refresh", "retry", "expire", "negative", "mailadmin", "dnsserver" - )); + return $this->searchBase('domains.domain', + [ "enabled", "type", "domainname", "ttl", "refresh", "retry", "expire", "negative" ], + "domainname", function($record){return $record->type->getNodeData()["master"]["selected"] === 1;} + ); + } + + public function searchSlaveDomainAction() + { + return $this->searchBase('domains.domain', + [ "enabled", "type", "domainname", "masterip" ], + "domainname", function($record){return $record->type->getNodeData()["slave"]["selected"] === 1;} + ); } public function getDomainAction($uuid = null) @@ -53,9 +61,14 @@ public function getDomainAction($uuid = null) return $this->getBase('domain', 'domains.domain', $uuid); } - public function addDomainAction($uuid = null) + public function addMasterDomainAction($uuid = null) + { + return $this->addBase('domain', 'domains.domain', ['type' => 'master']); + } + + public function addSlaveDomainAction($uuid = null) { - return $this->addBase('domain', 'domains.domain'); + return $this->addBase('domain', 'domains.domain', ['type' => 'slave']); } public function delDomainAction($uuid) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php index 3f0b046b82..132322f190 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/GeneralController.php @@ -35,7 +35,8 @@ public function indexAction() $this->view->generalForm = $this->getForm("general"); $this->view->dnsblForm = $this->getForm("dnsbl"); $this->view->formDialogEditBindAcl = $this->getForm("dialogEditBindAcl"); - $this->view->formDialogEditBindDomain = $this->getForm("dialogEditBindDomain"); + $this->view->formDialogEditBindMasterDomain = $this->getForm("dialogEditBindMasterDomain"); + $this->view->formDialogEditBindSlaveDomain = $this->getForm("dialogEditBindSlaveDomain"); $this->view->formDialogEditBindRecord = $this->getForm("dialogEditBindRecord"); $this->view->pick('OPNsense/Bind/general'); } diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindMasterDomain.xml similarity index 100% rename from dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml rename to dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindMasterDomain.xml diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml new file mode 100644 index 0000000000..52eac8fcb6 --- /dev/null +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindSlaveDomain.xml @@ -0,0 +1,54 @@ +
    + + domain.enabled + + checkbox + This will enable or disable this zone. + + + domain.domainname + + text + Set the name for this zone. Both forward and reverse zones may be specified, i.e. example.com or 0.168.192.in-addr.arpa. + + + domain.allowtransfer + + dropdown + Define an ACL where you allow which server can retrieve this zone. + + + domain.allowquery + + dropdown + Define an ACL where you allow which client are allowed to query this zone. + + + domain.masterip + + + select_multiple + true + Set the IP address of master server when using slave mode. + + + domain.transferkeyalgo + + dropdown + Set the authentication algorithm for the TSIG key. + + + domain.transferkey + + text + The TSIG key used to transfer domain data from the master server. + + + domain.allownotifyslave + + + select_multiple + true + A list of allowed IP addresses to receive notifies from. + +
    diff --git a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt index 13e9fb12a6..3eb6b8f0cb 100644 --- a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt +++ b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt @@ -32,7 +32,8 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('General') }}
  • {{ lang._('DNSBL') }}
  • {{ lang._('ACLs') }}
  • -
  • {{ lang._('Zones') }}
  • +
  • {{ lang._('Master Zones') }}
  • +
  • {{ lang._('Slave Zones') }}
  • @@ -83,11 +84,11 @@ POSSIBILITY OF SUCH DAMAGE.

    -
    -
    @@ -740,7 +740,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('%sConditions:%s HAProxy is capable of extracting data from requests, responses and other connection data and match it against predefined patterns. Use these powerful patterns to compose a condition that may be used in multiple Rules.') | format('', '') }}
  • {{ lang._('%sRules:%s Perform a large set of actions if one or more %sConditions%s match. These Rules may be used in %sBackend Pools%s as well as %sPublic Services%s.') | format('', '', '', '', '', '', '', '') }}
  • -

    {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    +

    {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    {{ lang._('Note that it is possible to directly add options to the HAProxy configuration by using the "option pass-through", a setting that is available for several configuration items. It allows you to implement configurations that are currently not officially supported by this plugin. It is strongly discouraged to rely on this feature. Please report missing features on our GitHub page!') | format('', '') }}


    @@ -755,7 +755,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('%sGroup:%s A optional list containing one or more users. Groups usually make it easier to manage permissions for a large number of users') | format('', '') }}
  • {{ lang._('Note that users and groups must be selected from the Backend Pool or Public Service configuration in order to be used for authentication. In addition to this users and groups may also be used in Rules/Conditions.') }}

    -

    {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    +

    {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}


    @@ -773,7 +773,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sCache:%s HAProxy's cache which was designed to perform cache on small objects (favicon, css, etc.). This is a minimalist low-maintenance cache which runs in RAM.") | format('', '', '', '') }}
  • {{ lang._("%sPeers:%s Configure a communication channel between two HAProxy instances. This will propagate entries of any data-types in stick-tables between these HAProxy instances over TCP connections in a multi-master fashion. Useful when aiming for a seamless failover in a HA setup.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}


    @@ -790,7 +790,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sResolvers:%s This feature allows in-depth configuration of how HAProxy handles name resolution and interacts with name resolvers (DNS). Each resolver configuration can be used in %sBackend Pools%s to apply individual name resolution configurations.") | format('', '', '', '') }}
  • {{ lang._("%sE-Mail Alerts:%s It is possible to send email alerts when the state of servers changes. Each configuration can be used in %sBackend Pools%s to send e-mail alerts to the configured recipient.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}


    From c7d77ce9bf54597162016ba45f633d991b45b459 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 21 Oct 2022 15:50:06 +0200 Subject: [PATCH 1237/3088] net/haproxy: migrate to NAME_setup use, refs 4e01cb2333acd997b01e6a10a9c447b1ccf520dc NAME_setup is mostly being used during system startup. However, there are still cases where setup.sh is manually called to ensure that certain operations like syntax check are working properly. --- .../OPNsense/HAProxy/Api/ServiceController.php | 2 -- .../opnsense/service/conf/actions.d/actions_haproxy.conf | 8 +------- .../opnsense/service/templates/OPNsense/HAProxy/rc.conf.d | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ServiceController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ServiceController.php index 524597aef0..0632cef861 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ServiceController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ServiceController.php @@ -56,8 +56,6 @@ public function configtestAction() $backend = new Backend(); // first generate template based on current configuration $backend->configdRun('template reload OPNsense/HAProxy'); - // now export all the required files (or syntax check will fail) - $backend->configdRun("haproxy setup"); // finally run the syntax check $response = $backend->configdRun("haproxy configtest"); return array("result" => $response); diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index a9f3c5b25b..9ca6d13dd7 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -1,9 +1,3 @@ -[setup] -command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh -parameters: -type:script_output -message:setup haproxy service requirements - [start] command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh deploy; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh start parameters: @@ -31,7 +25,7 @@ description:Reload HAProxy service message:reloading haproxy [configtest] -command:/usr/local/sbin/haproxy -c -f /usr/local/etc/haproxy.conf.staging 2>&1 || exit 0 +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/sbin/haproxy -c -f /usr/local/etc/haproxy.conf.staging 2>&1 || exit 0 parameters: type:script_output message:testing haproxy configuration diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d index fdb9bcf37e..2e20906703 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d @@ -1,6 +1,6 @@ {% if helpers.exists('OPNsense.HAProxy.general.enabled') and OPNsense.HAProxy.general.enabled|default("0") == "1" %} haproxy_enable=YES -#haproxy_setup="/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh" +haproxy_setup="/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh" haproxy_pidfile="/var/run/haproxy.pid" haproxy_config="/usr/local/etc/haproxy.conf" {% if helpers.exists('OPNsense.HAProxy.general.storeOcsp') and OPNsense.HAProxy.general.storeOcsp|default("0") == "1" %} From c3b6d586e90235cf9afb04c5879259c61251027e Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 21 Oct 2022 17:25:56 +0200 Subject: [PATCH 1238/3088] security/acme-client: remove saved deploy hook from acme.sh config files, fixes #3120 --- security/acme-client/pkg-descr | 4 ++- .../OPNsense/AcmeClient/LeAutomation/Base.php | 27 +++++++++++++++++++ .../library/OPNsense/AcmeClient/LeCommon.php | 3 +++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index a4e9781b0d..1e45db84a3 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -18,9 +18,11 @@ Added: Fixed: * fix Selfhost DNS API (#3122) +* fix invalid cert state due to deploy error (#3120) Changed: -* change default DNS sleep time to 0 (3079) +* change default DNS sleep time to 0 (#3079) +* remove saved deploy hook from acme.sh config files (#3120) 3.13 diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php index 1f11081fa7..4f79aa4712 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php @@ -150,6 +150,33 @@ public function runAcme() return false; } + // acme.sh records the last used deploy hook and would automatically + // use it on the next run. This information must be removed from the + // configuration file. Otherwise it would be impossible to disable + // or remove a deploy hook from the GUI. + foreach (glob(self::ACME_HOME_DIR . '/*/*.conf') as $filename) { + // Skip openssl config files. + if (preg_match('/.*.csr.conf/i', $filename)) { + continue; + } + + // Read contents from file. + $contents = file_get_contents($filename); + + // Check if deploy hook string can be found. + if (strpos($contents, self::ACME_DEPLOY_HOOK_STRING) !== false) { + // Replace the whole line with an empty string. + $contents = preg_replace('(' . self::ACME_DEPLOY_HOOK_STRING . '.*)', '', $contents); + + // Write changes to the file. + if (!file_put_contents($filename, $contents)) { + LeUtils::log_error('clearing recorded deploy hook from acme.sh failed (' . $filename . ')'); + } else { + LeUtils::log_debug('cleared recorded deploy deploy hook from acme.sh (' . $filename . ')', $this->debug); + } + } + } + // Check result if ($result) { LeUtils::log_error('running acme.sh deploy hook failed (' . $this->getType() . ')'); diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php index 631fab0c4f..bf278b7aae 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCommon.php @@ -59,6 +59,9 @@ abstract class LeCommon public const ACME_KEY_DIR = '/var/etc/acme-client/keys/%s/'; public const ACME_KEY_FILE = '/var/etc/acme-client/keys/%s/private.key'; + // acme.sh internals + public const ACME_DEPLOY_HOOK_STRING = 'Le_DeployHook='; + // Runtime parameters for acme.sh protected $acme_args = array(); # command line arguments to be passed to acme.sh protected $acme_env = array(); # environment variables to be used when running acme.sh From b76cdc037197d9d532ea4b4f75064e8af86f13ea Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 21 Oct 2022 17:59:38 +0200 Subject: [PATCH 1239/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index ad0e59696e..ba4fa52e1c 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.13 +PLUGIN_VERSION= 3.14 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon From 57e21ae339f4b19b6c0075643dacf02bbcdc07a9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 21 Oct 2022 18:00:13 +0200 Subject: [PATCH 1240/3088] net/haproxy: bump version --- net/haproxy/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 0c4fd723e9..084dfc5a47 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 3.11 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 3.12 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy24 PLUGIN_MAINTAINER= opnsense@moov.de From 6525ca5f94a9d71336d7c4e7e8f20878d46a44d1 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 22 Oct 2022 01:18:33 +0200 Subject: [PATCH 1241/3088] net/haproxy: add support for Prometheus exporter, closes #2764 --- net/haproxy/pkg-descr | 1 + .../OPNsense/HAProxy/forms/dialogFrontend.xml | 14 +++++++++ .../OPNsense/HAProxy/forms/generalStats.xml | 27 ++++++++++++++++- .../app/models/OPNsense/HAProxy/HAProxy.xml | 30 ++++++++++++++++++- .../templates/OPNsense/HAProxy/haproxy.conf | 19 ++++++++++-- 5 files changed, 86 insertions(+), 5 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 37b084e82b..2bb68861ab 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -10,6 +10,7 @@ Plugin Changelog Added: * add support for req.ssl_hello_type (#2311) +* add support for Prometheus exporter (#2764) Fixed: * fix unix sockets in chrooted environment (#3093) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml index a028a16f17..9f6fb5801e 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml @@ -211,6 +211,20 @@ checkbox
    + + frontend.prometheus_enabled + + checkbox + + true + + + frontend.prometheus_path + + text + + true + header diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalStats.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalStats.xml index 6832e1e173..ad63e778ef 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalStats.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalStats.xml @@ -5,7 +5,7 @@ haproxy.general.stats.enabled - + checkbox @@ -57,4 +57,29 @@
    NOTE: The syntax will not be checked, use at your own risk!
    ]]>
    true + + + header + + + haproxy.general.stats.prometheus_enabled + + checkbox + + + + haproxy.general.stats.prometheus_bind + + select_multiple + + true + + Enter address:port here. Finish with TAB. + + + haproxy.general.stats.prometheus_path + + text + + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 3be9a91e11..8a81ffce31 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1,6 +1,6 @@ //OPNsense/HAProxy - 3.7.0 + 3.8.0 the HAProxy load balancer @@ -376,6 +376,24 @@ N + + 0 + N + + + *:8404 + N + Y + /^((([0-9a-zA-Z._\-\*:\[\]]+:+[0-9]+(-[0-9]+)?|unix@[0-9a-z_\-]+)([,]){0,1}))*/u + lower + Please provide a valid listen address, i.e. 10.0.0.1:8404 or haproxy.example.com:8404. + + + /metrics + N + /^.{1,2048}$/u + Should be a string between 1 and 2048 characters. + @@ -777,6 +795,16 @@ 0 Y + + 0 + N + + + /metrics + N + /^.{1,2048}$/u + Should be a string between 1 and 2048 characters. + Y http-keep-alive diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index c6f0ff8dde..d7d910beb4 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1411,6 +1411,9 @@ frontend {{frontend.name}} {% endif %} {% if frontend.forwardFor == '1' and frontend.mode == 'http' %} option forwardfor +{% endif %} +{% if frontend.prometheus_enabled == '1' and frontend.mode == 'http' and frontend.prometheus_path|default("") != "" %} + http-request use-service prometheus-exporter if { path {{frontend.prometheus_path}} } {% endif %} # tuning options {% if frontend.tuning_maxConnections is defined %} @@ -1916,7 +1919,7 @@ peers {{peers_name}} {# STATISTICS #} {# ############################### #} -{%- if helpers.exists('OPNsense.HAProxy.general.stats') and OPNsense.HAProxy.general.stats.enabled|default("") == "1" %} +{% if helpers.exists('OPNsense.HAProxy.general.stats') and OPNsense.HAProxy.general.stats.enabled|default("") == "1" %} {# # enable local stats #} listen local_statistics bind 127.0.0.1:{{OPNsense.HAProxy.general.stats.port}} @@ -1931,7 +1934,7 @@ listen local_statistics {% endfor %} {% endif %} -{# # remote stats are optional #} +{# # remote stats are optional #} {% if OPNsense.HAProxy.general.stats.remoteEnabled|default("") == "1" %} {% if OPNsense.HAProxy.general.stats.remoteBind|default("") != "" %} listen remote_statistics @@ -1957,8 +1960,18 @@ listen remote_statistics # ERROR: remote statistics disabled, because no listen address was specified {% endif %} {% else %} -# statistics are DISABLED +# remote statistics are DISABLED {% endif %} +{% else %} +# statistics are DISABLED +{% endif %} +{% if helpers.exists('OPNsense.HAProxy.general.stats') and OPNsense.HAProxy.general.stats.prometheus_enabled|default("") == "1" %} +{# # enable prometheus exporter #} +frontend prometheus_exporter + bind {{OPNsense.HAProxy.general.stats.prometheus_bind}} + mode http + http-request use-service prometheus-exporter if { path {{OPNsense.HAProxy.general.stats.prometheus_path}} } {% endif %} + {%- endif -%} From 542958352ba0aafade6dfa2a6f0d71ec5a7f3e1f Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 23 Oct 2022 01:36:36 +0200 Subject: [PATCH 1242/3088] net/haproxy: add support for FastCGI applications, closes #2769 --- net/haproxy/pkg-descr | 2 + .../HAProxy/Api/SettingsController.php | 27 ++++- .../OPNsense/HAProxy/IndexController.php | 3 +- .../OPNsense/HAProxy/forms/dialogAction.xml | 22 ++++ .../OPNsense/HAProxy/forms/dialogBackend.xml | 6 + .../OPNsense/HAProxy/forms/dialogFcgi.xml | 77 +++++++++++++ .../OPNsense/HAProxy/forms/dialogServer.xml | 7 ++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 108 ++++++++++++++++++ .../app/models/OPNsense/HAProxy/Menu/Menu.xml | 1 + .../mvc/app/views/OPNsense/HAProxy/index.volt | 40 +++++++ .../templates/OPNsense/HAProxy/haproxy.conf | 80 ++++++++++++- 11 files changed, 369 insertions(+), 4 deletions(-) create mode 100644 net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFcgi.xml diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 2bb68861ab..d675ec264e 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -11,6 +11,8 @@ Plugin Changelog Added: * add support for req.ssl_hello_type (#2311) * add support for Prometheus exporter (#2764) +* add support for FastCGI applications (#2769) +* add server option to override the multiplexer protocol Fixed: * fix unix sockets in chrooted environment (#3093) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php index 44ccd006c2..4e0006f398 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/SettingsController.php @@ -1,7 +1,7 @@ searchBase('luas.lua', array('enabled', 'name', 'description'), 'name'); } + public function getFcgiAction($uuid = null) + { + return $this->getBase('fcgi', 'fcgis.fcgi', $uuid); + } + + public function setFcgiAction($uuid) + { + return $this->setBase('fcgi', 'fcgis.fcgi', $uuid); + } + + public function addFcgiAction() + { + return $this->addBase('fcgi', 'fcgis.fcgi'); + } + + public function delFcgiAction($uuid) + { + return $this->delBase('fcgis.fcgi', $uuid); + } + + public function searchFcgisAction() + { + return $this->searchBase('fcgis.fcgi', array('name', 'description'), 'name'); + } + public function getErrorfileAction($uuid = null) { return $this->getBase('errorfile', 'errorfiles.errorfile', $uuid); diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php index 8e2b52f65b..791f6bfe67 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/IndexController.php @@ -1,7 +1,7 @@ view->formDialogBackend = $this->getForm("dialogBackend"); $this->view->formDialogCpu = $this->getForm("dialogCpu"); $this->view->formDialogErrorfile = $this->getForm("dialogErrorfile"); + $this->view->formDialogFcgi = $this->getForm("dialogFcgi"); $this->view->formDialogFrontend = $this->getForm("dialogFrontend"); $this->view->formDialogGroup = $this->getForm("dialogGroup"); $this->view->formDialogHealthcheck = $this->getForm("dialogHealthcheck"); diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml index f0a663f161..7a499dab84 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml @@ -448,4 +448,26 @@ dropdown + + + header + + + + action.fcgi_pass_header + + text + + + + + header + + + + action.fcgi_set_param + + text + Custom Log format rules. With this directive, it is possible to overwrite the value of default FastCGI parameters.]]> + diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index cd1aec54ea..7615ceb09b 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -54,6 +54,12 @@ Type server name or choose from list. + + backend.linkedFcgi + + dropdown + + backend.linkedResolver diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFcgi.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFcgi.xml new file mode 100644 index 0000000000..ffaec1d91a --- /dev/null +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFcgi.xml @@ -0,0 +1,77 @@ +
    + + fcgi.enabled + + checkbox + Enable this FastCGI application. + + + fcgi.name + + text + Name to identify this FastCGI application. + + + fcgi.description + + text + Description for this FastCGI application. + + + fcgi.docroot + + text + + + + fcgi.index + + text + + + + fcgi.path_info + + text + HAProxy's documentation for further details and examples.]]> + + + fcgi.log_stderr + + checkbox + + + + fcgi.keep_conn + + checkbox + + + + fcgi.get_values + + checkbox + + + + fcgi.mpxs_conns + + checkbox + + + + fcgi.max_reqs + + text + + + + fcgi.linkedActions + + select_multiple + + true + + Choose rules. + +
    diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml index 53190b12cd..99db8ffab0 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml @@ -95,6 +95,13 @@ dropdown
    + + server.multiplexer_protocol + + dropdown + + true + server.resolvePrefer diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 8a81ffce31..8289391d5c 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -911,6 +911,18 @@ Y N + + + + + Related fcgi item not found + N + N + Host not found - Y + Y Y @@ -108,7 +105,7 @@ Should be a string between 1 and 255 characters. Allowed characters are letters and numbers as well as underscore, minus, dot and space. - icmp + icmp Y ICMP @@ -158,11 +155,11 @@ - 0 + 0 Y - relay + relay Y Relay @@ -177,7 +174,7 @@ Y - tcp + tcp TCP UDP @@ -197,14 +194,14 @@ N - N + N /^(?!0).*$/ /^((?!dhcp).)*$/ - forward + forward Y Forward @@ -213,7 +210,7 @@ N - N + N /^(?!0).*$/ /^((?!dhcp).)*$/ @@ -228,7 +225,7 @@
    Table not found - N + N Y @@ -248,7 +245,6 @@ The timeout must be greater than 0 - roundrobin N Hash @@ -268,7 +264,7 @@ Table check not found - N + N Y @@ -280,7 +276,7 @@ Table not found - N + N N @@ -302,7 +298,7 @@ Table check not found - N + N N @@ -315,7 +311,6 @@ - roundrobin N Hash @@ -327,16 +322,12 @@ - 600 N 1 2147483647 The timeout must be a number between 1 and 2147483647. - - 0 - N - + Protocol not found - N + N N - --> + @@ -357,7 +348,7 @@ Should be a string between 1 and 255 characters. Allowed characters are letters and numbers as well as underscore, minus, dot and space. - tcp + tcp Y TCP From d3397d99cfc8c381673636fd59f61c431941a19c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 1 Sep 2023 08:39:53 +0200 Subject: [PATCH 1555/3088] net/firewall: update model --- .../app/models/OPNsense/Firewall/Filter.xml | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index 87855d7d1e..65262b536f 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -9,7 +9,7 @@ - 1 + 1 Y @@ -17,11 +17,11 @@ 99999 provide a valid sequence for sorting Y - 1 + 1 Y - pass + pass Pass Block @@ -29,18 +29,17 @@ - 1 + 1 Y N - Y - lan + Y Y Y - in + in In Out @@ -48,7 +47,7 @@ Y - inet + inet IPv4 IPv6 @@ -56,15 +55,15 @@ Y - any + any - any + any Y - 0 + 0 Y @@ -76,11 +75,11 @@ - any + any Y - 0 + 0 Y @@ -98,7 +97,7 @@ Specify a valid gateway from the list matching the networks ip protocol. - 0 + 0 Y @@ -111,11 +110,11 @@ - 1 + 1 Y - 0 + 0 Y @@ -123,16 +122,16 @@ 99999 provide a valid sequence for sorting Y - 1 + 1 Y - lan + lan Y Y - inet + inet IPv4 IPv6 @@ -140,14 +139,14 @@ Y - any + any - any + any Y - 0 + 0 Y @@ -158,11 +157,11 @@ Please specify a valid portnumber, name, alias or range - any + any Y - 0 + 0 Y @@ -173,7 +172,7 @@ Please specify a valid portnumber, name, alias or range - wanip + wanip Y @@ -182,7 +181,7 @@ Y - 0 + 0 Y From 13fd1434fc55606a28f5d7d0393e677fdcf2cb6f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 1 Sep 2023 08:40:38 +0200 Subject: [PATCH 1556/3088] security/stunnel: update model --- .../app/models/OPNsense/Stunnel/Stunnel.xml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml index 13e2f02fd6..47970192db 100644 --- a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml +++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml @@ -7,22 +7,22 @@ - 1 + 1 Y - 0 + 0 Y - 0 + 0 Y - 1 + 1 Y @@ -34,7 +34,7 @@ Y N - 127.0.0.1 + 127.0.0.1 Y @@ -55,22 +55,22 @@ N - Y + Y ca Please select a valid certificate from the list - 0 + 0 Y - 0 + 0 Y - TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,DHE-RSA-AES128-GCM-SHA256,DHE-RSA-AES256-GCM-SHA384 + TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,DHE-RSA-AES128-GCM-SHA256,DHE-RSA-AES256-GCM-SHA384 Y - Y + Y stunnel ssl ciphers /tmp/stunnel_ciphers_list.json 360 From e5ff7461631b551ff82262523c09b881f496df34 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 1 Sep 2023 08:41:38 +0200 Subject: [PATCH 1557/3088] sysutils/git-backup: update model --- .../opnsense/mvc/app/models/OPNsense/Backup/GitSettings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysutils/git-backup/src/opnsense/mvc/app/models/OPNsense/Backup/GitSettings.xml b/sysutils/git-backup/src/opnsense/mvc/app/models/OPNsense/Backup/GitSettings.xml index 52c88d582a..7c18337709 100644 --- a/sysutils/git-backup/src/opnsense/mvc/app/models/OPNsense/Backup/GitSettings.xml +++ b/sysutils/git-backup/src/opnsense/mvc/app/models/OPNsense/Backup/GitSettings.xml @@ -4,7 +4,7 @@ OPNsense Git Backup Settings - 0 + 0 Y @@ -30,7 +30,7 @@ - master + master Y From 8e07bd6471be3f83ec81058a0c430ad48f10df53 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 1 Sep 2023 08:42:48 +0200 Subject: [PATCH 1558/3088] security/tinc: update model --- .../mvc/app/models/OPNsense/Tinc/Tinc.xml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml index f2da9989db..b2021db4d2 100644 --- a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml +++ b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml @@ -29,7 +29,7 @@ Y - 655 + 655 1 65535 Port number must be between 1...65535 @@ -55,13 +55,13 @@ Y - 5 + 5 1 65535 Ping timeout must be between 1...65535 - 0 + 0 Y @@ -75,11 +75,11 @@ N tinc list ciphers /tmp/tinc_current_cipher_options.index - aes-256-cbc + aes-256-cbc Y - router + router router switch @@ -91,16 +91,16 @@ - 1 + 1 Y - 1 + 1 Y Y - ip + ip [0] start/stop, serious errors [1] +all connections @@ -133,7 +133,7 @@ Y - 655 + 655 1 65535 Port number must be between 1...65535 @@ -167,10 +167,10 @@ N tinc list ciphers /tmp/tinc_current_cipher_options.index - aes-256-cbc + aes-256-cbc - 1 + 1 Y @@ -179,7 +179,7 @@ - 1 + 1 Y From 9693020709a8484ce3f06c8f3090de959dedf126 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 1 Sep 2023 09:00:01 +0200 Subject: [PATCH 1559/3088] dns/ddclient: update model --- .../mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 28b16314e1..aeeaa90744 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -7,26 +7,26 @@ - 1 + 1 Y - 0 + 0 Y - 0 + 0 Y - 300 + 300 Y 1 86400 Y - ddclient + ddclient A backend is required. ddclient @@ -37,7 +37,7 @@ - 1 + 1 Y @@ -125,7 +125,7 @@ , - 0 + 0 Y @@ -134,7 +134,7 @@ Y - web_dyndns + web_dyndns An IP service type is required. dyndns @@ -162,24 +162,23 @@ - 10 + 10 Y 10 60 - 1 + 1 Y - 300 + 300 Y 1 604800 N - N An interface is required for the selected check method From e59563b55ad8b14f2f1f2a11178b4984c64d0e83 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 1 Sep 2023 09:00:19 +0200 Subject: [PATCH 1560/3088] Framework: one more --- Mk/plugins.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index d0f02b06e6..893a96a54d 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -331,6 +331,9 @@ lint-model: (xmllint $${MODEL} --xpath '//*[@type and not(@type="ArrayField") and BlankDesc and Multiple="Y"]' 2> /dev/null | grep '^<' || true) | while read LINE; do \ echo "$${MODEL}: $${LINE} blank description not applicable on multiple field"; \ done; \ + (xmllint $${MODEL} --xpath '//*[@type and not(@type="ArrayField") and Multiple="N"]' 2> /dev/null | grep '^<' || true) | while read LINE; do \ + echo "$${MODEL}: $${LINE} Multiple=N is the default"; \ + done; \ (xmllint $${MODEL} --xpath '//*[@type and not(@type="ArrayField") and OptionValues[default[not(@value)] or multiple[not(@value)] or required[not(@value)]]]' 2> /dev/null | grep '^<' || true) | while read LINE; do \ echo "$${MODEL}: $${LINE} option element default/multiple/required without value attribute"; \ done; \ From 3b08ddfc45ffefa9cb003cbdf9299910eea98f78 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 1 Sep 2023 09:00:35 +0200 Subject: [PATCH 1561/3088] net/relayd: update model again --- .../src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml index 9ee612cbe2..2e17e27dca 100644 --- a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml +++ b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml @@ -194,7 +194,6 @@ N - N /^(?!0).*$/ /^((?!dhcp).)*$/ @@ -210,7 +209,6 @@ N - N /^(?!0).*$/ /^((?!dhcp).)*$/ @@ -225,7 +223,6 @@ Table not found - N Y @@ -264,7 +261,6 @@ Table check not found - N Y @@ -276,7 +272,6 @@ Table not found - N N @@ -298,7 +293,6 @@ Table check not found - N N @@ -337,7 +331,6 @@ Protocol not found - N N From 37ea19d9130ffcf1ed462b52d729c23d3237fd52 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 1 Sep 2023 09:00:49 +0200 Subject: [PATCH 1562/3088] security/tinc: update model again --- .../tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml index b2021db4d2..0d33dc7259 100644 --- a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml +++ b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml @@ -72,7 +72,6 @@ Y - N tinc list ciphers /tmp/tinc_current_cipher_options.index aes-256-cbc @@ -164,7 +163,6 @@ Y - N tinc list ciphers /tmp/tinc_current_cipher_options.index aes-256-cbc From 61333a74d8a68b2c0e10a62ef38389d3016d085c Mon Sep 17 00:00:00 2001 From: Jesse Date: Sat, 2 Sep 2023 10:01:58 +0200 Subject: [PATCH 1563/3088] dns/ddclient - add "get" protocol in custom service type (#3523) --------- Co-authored-by: Franco Fichtner --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.php | 2 +- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 2 ++ .../src/opnsense/scripts/ddclient/lib/account/dyndns2.py | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.php b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.php index b0b4970803..9432b50620 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.php +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.php @@ -56,7 +56,7 @@ public function performValidation($validateFullModel = false) continue; } $srv = (string)$node->server; - if ((string)$node->protocol == 'post') { + if (in_array((string)$node->protocol, ['get', 'post', 'put'])) { if (empty($srv) || filter_var($srv, FILTER_VALIDATE_URL) === false) { $messages->appendMessage( new Message( diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index aeeaa90744..62f707d38a 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -95,7 +95,9 @@ DynDNS 1 DynDNS 2 + Custom GET Custom POST + Custom PUT diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py index dfd2ae2aa2..34d5feeb37 100755 --- a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py +++ b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py @@ -67,11 +67,12 @@ def match(account): def execute(self): if super().execute(): protocol = self.settings.get('protocol', None) - if protocol == 'post': + if protocol in [ 'get', 'post', 'put' ]: url = self.settings.get('server') url = url.replace('__MYIP__', self.current_address) url = url.replace('__HOSTNAME__', self.settings.get('hostnames')) - req = requests.post( + req = requests.request( + method=protocol, url=url, headers={'User-Agent': 'OPNsense-dyndns'}, auth=HTTPBasicAuth(self.settings.get('username'), self.settings.get('password')) From 7e42d0b5542c1b1b54cb304e740b8f865b300d23 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 3 Sep 2023 11:22:02 +0200 Subject: [PATCH 1564/3088] net/wireguard - refactor dashboard widget, use shared service diagnostics endpoint (/api/wireguard/service/show), mark old one for deprecation in 24.1 and fix latest-handshake presentation in diagnostics screen. --- .../Wireguard/Api/GeneralController.php | 3 + .../Wireguard/Api/ServiceController.php | 3 + .../Wireguard/DiagnosticsController.php | 7 ++ .../views/OPNsense/Wireguard/diagnostics.volt | 12 +- .../src/www/widgets/include/wireguard.inc | 2 +- .../www/widgets/widgets/wireguard.widget.php | 107 +++++++----------- 6 files changed, 65 insertions(+), 69 deletions(-) diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php index 1aca5548df..e02afcadf2 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/GeneralController.php @@ -40,6 +40,9 @@ class GeneralController extends ApiMutableModelControllerBase protected static $internalModelClass = '\OPNsense\Wireguard\General'; protected static $internalModelName = 'general'; + /** + * XXX: remove in 24.1 unused + */ public function getStatusAction() { // get wireguard configuration diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServiceController.php b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServiceController.php index 68b81dd6a8..1812f83fbe 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServiceController.php +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServiceController.php @@ -103,11 +103,13 @@ public function showAction() $payload = json_decode((new Backend())->configdRun("wireguard show") ?? '', true); $records = !empty($payload) && !empty($payload['records']) ? $payload['records'] : []; $key_descriptions = []; + $ifnames = []; foreach ((new Client())->clients->client->iterateItems() as $key => $client) { $key_descriptions[(string)$client->pubkey] = (string)$client->name; } foreach ((new Server())->servers->server->iterateItems() as $key => $server) { $key_descriptions[(string)$server->pubkey] = (string)$server->name; + $ifnames[(string)$server->interface] = (string)$server->name; } foreach ($records as &$record) { if (!empty($record['public-key']) && !empty($key_descriptions[$record['public-key']])) { @@ -115,6 +117,7 @@ public function showAction() } else { $record['name'] = ''; } + $record['ifname'] = $ifnames[$record['if']]; } $filter_funct = null; $types = $this->request->get('type'); diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/DiagnosticsController.php b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/DiagnosticsController.php index 852ea92acb..37f723f535 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/DiagnosticsController.php +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/DiagnosticsController.php @@ -30,6 +30,13 @@ class DiagnosticsController extends \OPNsense\Base\IndexController { + protected function templateJSIncludes() + { + $result = parent::templateJSIncludes(); + $result[] = '/ui/js/moment-with-locales.min.js'; + return $result; + } + public function indexAction() { $this->view->pick('OPNsense/Wireguard/diagnostics'); diff --git a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt index d44af57530..dc97ad14a5 100644 --- a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt +++ b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt @@ -27,7 +27,7 @@ From a477a672a582ef57f6bad65c82f1064c334dbfbe Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 3 Sep 2023 19:52:23 +0200 Subject: [PATCH 1565/3088] net/frr - add default-information originate option for OSPFv3. closes https://github.com/opnsense/plugins/issues/3519 --- net/frr/Makefile | 1 + .../OPNsense/Quagga/forms/ospf6.xml | 21 ++++++++++++++++++ .../mvc/app/models/OPNsense/Quagga/OSPF6.xml | 16 +++++++++++++- .../mvc/app/views/OPNsense/Quagga/ospf6.volt | 22 +++++++++++-------- .../templates/OPNsense/Quagga/ospf6d.conf | 4 ++++ 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 93dd07444c..b6afb6b3fc 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.35 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr8 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf6.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf6.xml index 43bfb1b116..598f8eda8c 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf6.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf6.xml @@ -28,4 +28,25 @@ text Router ID as IPv4 Address + + ospf6.originate + + checkbox + This will send the information that we have a default gateway. + + + + ospf6.originatealways + + checkbox + This will send the information that we have a default gateway, regardless of if it is available. + + + + ospf6.originatemetric + + text + This let you manipulate the metric when advertising default gateway. + + diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml index 47da7c5d09..177e571550 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml @@ -1,7 +1,7 @@ //OPNsense/quagga/ospf6 OSPFv3 Routing configuration - 1.0.3 + 1.0.4 0 @@ -25,6 +25,20 @@ N /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ + + 0 + Y + + + 0 + Y + + + N + 0 + 16777214 + Must be a number between 0 and 16777214. + diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/ospf6.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/ospf6.volt index e2a8ed98e4..6052ccd59b 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/ospf6.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/ospf6.volt @@ -1,6 +1,6 @@ {# -OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. +OPNsense® is Copyright © 2014 – 2023 by Deciso B.V. This file is Copyright © 2017 by Fabian Franz This file is Copyright © 2017 by Michael Muenz All rights reserved. @@ -64,7 +64,6 @@ POSSIBILITY OF SUCH DAMAGE. - @@ -76,10 +75,6 @@ POSSIBILITY OF SUCH DAMAGE. diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf index 8aabfb7bce..b7e0a52e30 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospf6d.conf @@ -48,6 +48,10 @@ router ospf6 {% if helpers.exists('OPNsense.quagga.ospf6.routerid') and OPNsense.quagga.ospf6.routerid != '' %} ospf6 router-id {{ OPNsense.quagga.ospf6.routerid }} {% endif %} +{% if not helpers.empty('OPNsense.quagga.ospf6.originate') %} + default-information originate{% if not helpers.empty('OPNsense.quagga.ospf6.originatealways') %} always {% endif %}{% if OPNsense.quagga.ospf6.originatemetric|default('') != '' %} metric {{ OPNsense.quagga.ospf6.originatemetric }}{% endif %} + +{% endif %} {% if helpers.exists('OPNsense.quagga.ospf6.redistribute') and OPNsense.quagga.ospf6.redistribute != '' %} {% for line in OPNsense.quagga.ospf6.redistribute.split(',') %} redistribute {{ line }} From e3284aef64a58ca4e3507ed98d876a467fde55b5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 5 Sep 2023 07:47:28 +0200 Subject: [PATCH 1566/3088] net/wireguard: style sweep --- .../src/opnsense/scripts/Wireguard/wg-service-control.php | 5 ++--- net/wireguard/src/www/widgets/include/wireguard.inc | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index f6777a02cf..6ba6eaab57 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -94,7 +94,7 @@ function wg_start($server, $fhandle) // flush checksum to ease change detection fseek($fhandle, 0); ftruncate($fhandle, 0); - fwrite($fhandle, @md5_file($server->cnfFilename) . "|". wg_reconfigure_hash($server)); + fwrite($fhandle, @md5_file($server->cnfFilename) . "|" . wg_reconfigure_hash($server)); syslog(LOG_NOTICE, "Wireguard interface {$server->name} ({$server->interface}) started"); } @@ -144,7 +144,6 @@ function get_stat_hash($fhandle) 'file' => $parts[0] ?? '', 'interface' => $parts[1] ?? '' ]; - } $opts = getopt('ah', [], $optind); @@ -192,7 +191,7 @@ function get_stat_hash($fhandle) // Fluent reloading not supported for this instance, make sure the user is informed syslog( LOG_NOTICE, - "Wireguard interface {$node->name} ({$node->interface}) ". + "Wireguard interface {$node->name} ({$node->interface}) " . "can not reconfigure without stopping it first." ); wg_stop($node); diff --git a/net/wireguard/src/www/widgets/include/wireguard.inc b/net/wireguard/src/www/widgets/include/wireguard.inc index 517182bc2e..f1bae7fe46 100644 --- a/net/wireguard/src/www/widgets/include/wireguard.inc +++ b/net/wireguard/src/www/widgets/include/wireguard.inc @@ -1,4 +1,4 @@ Date: Thu, 31 Aug 2023 08:03:44 +0200 Subject: [PATCH 1567/3088] net/wireguard: hook up 'newwanip' and 'vpn' facilities #3565 --- net/wireguard/Makefile | 3 +- .../src/etc/inc/plugins.inc.d/wireguard.inc | 34 +++++++++++++++++++ .../src/etc/rc.syshook.d/start/50-wireguard | 2 -- 3 files changed, 35 insertions(+), 4 deletions(-) delete mode 100755 net/wireguard/src/etc/rc.syshook.d/start/50-wireguard diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index e597f4f976..4092c7e067 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 2.0 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 2.1 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc index aed2673825..4474b40894 100644 --- a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc @@ -102,3 +102,37 @@ function wireguard_devices() { return [['pattern' => '^wg', 'volatile' => true]]; } + +function wireguard_configure() +{ + return [ + 'newwanip' => ['wireguard_renew:2'], + 'vpn' => ['wireguard_configure_do:2'], + ]; +} + +function wireguard_configure_do($verbose = false, $unused = '') +{ + if (!wireguard_enabled()) { + return; + } + + service_log('Configuring WireGuard VPN...', $verbose); + + configd_run('wireguard configure'); + + service_log("done.\n", $verbose); +} + +function wireguard_renew($verbose = false, $unused = '') +{ + if (!wireguard_enabled()) { + return; + } + + service_log('Renewing WireGuard VPN...', $verbose); + + configd_run('wireguard renew'); + + service_log("done.\n", $verbose); +} diff --git a/net/wireguard/src/etc/rc.syshook.d/start/50-wireguard b/net/wireguard/src/etc/rc.syshook.d/start/50-wireguard deleted file mode 100755 index 826ba71cd8..0000000000 --- a/net/wireguard/src/etc/rc.syshook.d/start/50-wireguard +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -configctl -dq wireguard configure From 57ebc7510f3c3bcc38ffbc5e3a90f18adb12c206 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 6 Sep 2023 08:27:17 +0200 Subject: [PATCH 1568/3088] plugins: strip $FreeBSD$ since gone in src.git --- dns/ddclient/src/etc/rc.d/ddclient_opn | 2 -- .../opnsense/service/templates/OPNsense/Netdata/netdata.conf | 2 -- net/ftp-proxy/src/etc/rc.d/os-ftp-proxy | 3 --- net/relayd/src/etc/rc.d/os-relayd | 3 --- net/shadowsocks/src/etc/rc.d/opnsense-ss-local | 5 +---- net/tayga/src/etc/rc.d/opnsense-tayga | 3 --- net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay | 3 --- security/acme-client/src/etc/rc.d/acme_http_challenge | 2 -- security/crowdsec/src/etc/rc.d/oscrowdsec | 3 --- security/maltrail/src/etc/rc.d/opnsense-maltrailsensor | 3 --- security/maltrail/src/etc/rc.d/opnsense-maltrailserver | 3 --- security/openconnect/src/etc/rc.d/opnsense-openconnect | 3 --- security/stunnel/src/etc/rc.d/identd_stunnel | 3 --- security/tinc/src/etc/rc.d/opnsense-tincd | 3 --- 14 files changed, 1 insertion(+), 40 deletions(-) diff --git a/dns/ddclient/src/etc/rc.d/ddclient_opn b/dns/ddclient/src/etc/rc.d/ddclient_opn index 15c12b8a84..791fbcb682 100755 --- a/dns/ddclient/src/etc/rc.d/ddclient_opn +++ b/dns/ddclient/src/etc/rc.d/ddclient_opn @@ -1,7 +1,5 @@ #!/bin/sh # -# $FreeBSD$ -# # PROVIDE: ddclient_py # REQUIRE: SERVERS # KEYWORD: shutdown diff --git a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf index 8e2c769e37..98b5d52a14 100644 --- a/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf +++ b/net-mgmt/netdata/src/opnsense/service/templates/OPNsense/Netdata/netdata.conf @@ -1,6 +1,4 @@ {% if helpers.exists('OPNsense.netdata.general.enabled') and OPNsense.netdata.general.enabled == '1' %} -# $FreeBSD$ - # netdata configuration # # You can uncomment and change any of the options below. diff --git a/net/ftp-proxy/src/etc/rc.d/os-ftp-proxy b/net/ftp-proxy/src/etc/rc.d/os-ftp-proxy index 76c45ddc8b..b462b6cade 100755 --- a/net/ftp-proxy/src/etc/rc.d/os-ftp-proxy +++ b/net/ftp-proxy/src/etc/rc.d/os-ftp-proxy @@ -1,8 +1,5 @@ #!/bin/sh # -# $FreeBSD$ -# - # PROVIDE: os-ftp-proxy # REQUIRE: DAEMON pf # KEYWORD: shutdown diff --git a/net/relayd/src/etc/rc.d/os-relayd b/net/relayd/src/etc/rc.d/os-relayd index 04dade24f7..2bab72bcb9 100755 --- a/net/relayd/src/etc/rc.d/os-relayd +++ b/net/relayd/src/etc/rc.d/os-relayd @@ -1,8 +1,5 @@ #!/bin/sh # -# $FreeBSD$ -# - # PROVIDE: os-relayd # REQUIRE: NETWORKING syslogd # BEFORE: DAEMON diff --git a/net/shadowsocks/src/etc/rc.d/opnsense-ss-local b/net/shadowsocks/src/etc/rc.d/opnsense-ss-local index c68761d69a..f968c7c701 100755 --- a/net/shadowsocks/src/etc/rc.d/opnsense-ss-local +++ b/net/shadowsocks/src/etc/rc.d/opnsense-ss-local @@ -1,6 +1,5 @@ #!/bin/sh -# $FreeBSD$ - +# # PROVIDE: ss-local # REQUIRE: LOGIN cleanvar # KEYWORD: shutdown @@ -11,13 +10,11 @@ # ss_local_config (path): Shadowsocks config file. # Defaults to "/usr/local/etc/shadowsocks-libev/local.json" - . /etc/rc.subr name="ss_local" rcvar=ss_local_enable - load_rc_config $name : ${ss_local_enable:="NO"} diff --git a/net/tayga/src/etc/rc.d/opnsense-tayga b/net/tayga/src/etc/rc.d/opnsense-tayga index d911e8a692..1b4be79c94 100755 --- a/net/tayga/src/etc/rc.d/opnsense-tayga +++ b/net/tayga/src/etc/rc.d/opnsense-tayga @@ -1,11 +1,8 @@ #!/bin/sh # -# $FreeBSD$ -# # PROVIDE: opnsense-tayga # REQUIRE: SERVERS # KEYWORD: shutdown -# . /etc/rc.subr diff --git a/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay b/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay index e16cab0c38..431191c467 100755 --- a/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay +++ b/net/udpbroadcastrelay/src/etc/rc.d/os-udpbroadcastrelay @@ -1,8 +1,5 @@ #!/bin/sh # -# $FreeBSD$ -# - # PROVIDE: osudpbroadcastrelay # KEYWORD: shutdown diff --git a/security/acme-client/src/etc/rc.d/acme_http_challenge b/security/acme-client/src/etc/rc.d/acme_http_challenge index 4eb01f559e..52ef66067a 100755 --- a/security/acme-client/src/etc/rc.d/acme_http_challenge +++ b/security/acme-client/src/etc/rc.d/acme_http_challenge @@ -1,7 +1,5 @@ #!/bin/sh # -# $FreeBSD$ -# # PROVIDE: acme_http_challenge # REQUIRE: DAEMON # KEYWORD: shutdown diff --git a/security/crowdsec/src/etc/rc.d/oscrowdsec b/security/crowdsec/src/etc/rc.d/oscrowdsec index 04a7e8c7b3..0d310efd6b 100755 --- a/security/crowdsec/src/etc/rc.d/oscrowdsec +++ b/security/crowdsec/src/etc/rc.d/oscrowdsec @@ -1,8 +1,5 @@ #!/bin/sh # -# $FreeBSD$ -# - # PROVIDE: oscrowdsec # REQUIRE: NETWORKING syslogd # BEFORE: DAEMON diff --git a/security/maltrail/src/etc/rc.d/opnsense-maltrailsensor b/security/maltrail/src/etc/rc.d/opnsense-maltrailsensor index b064c35b4d..70788ea780 100755 --- a/security/maltrail/src/etc/rc.d/opnsense-maltrailsensor +++ b/security/maltrail/src/etc/rc.d/opnsense-maltrailsensor @@ -1,11 +1,8 @@ #!/bin/sh # -# $FreeBSD$ -# # PROVIDE: opnsense-maltrailsensor # REQUIRE: SERVERS # KEYWORD: shutdown -# . /etc/rc.subr diff --git a/security/maltrail/src/etc/rc.d/opnsense-maltrailserver b/security/maltrail/src/etc/rc.d/opnsense-maltrailserver index aa3de2883a..c32d698108 100755 --- a/security/maltrail/src/etc/rc.d/opnsense-maltrailserver +++ b/security/maltrail/src/etc/rc.d/opnsense-maltrailserver @@ -1,11 +1,8 @@ #!/bin/sh # -# $FreeBSD$ -# # PROVIDE: opnsense-maltrailserver # REQUIRE: SERVERS # KEYWORD: shutdown -# . /etc/rc.subr diff --git a/security/openconnect/src/etc/rc.d/opnsense-openconnect b/security/openconnect/src/etc/rc.d/opnsense-openconnect index 518a83c7d4..3318f76673 100755 --- a/security/openconnect/src/etc/rc.d/opnsense-openconnect +++ b/security/openconnect/src/etc/rc.d/opnsense-openconnect @@ -1,11 +1,8 @@ #!/bin/sh # -# $FreeBSD$ -# # PROVIDE: opnsense-openconnect # REQUIRE: SERVERS # KEYWORD: shutdown -# . /etc/rc.subr diff --git a/security/stunnel/src/etc/rc.d/identd_stunnel b/security/stunnel/src/etc/rc.d/identd_stunnel index 003c2c3c4a..19be1bcc58 100755 --- a/security/stunnel/src/etc/rc.d/identd_stunnel +++ b/security/stunnel/src/etc/rc.d/identd_stunnel @@ -1,11 +1,8 @@ #!/bin/sh # -# $FreeBSD$ -# # PROVIDE: identd_stunnel # REQUIRE: SERVERS # KEYWORD: shutdown -# . /etc/rc.subr diff --git a/security/tinc/src/etc/rc.d/opnsense-tincd b/security/tinc/src/etc/rc.d/opnsense-tincd index 6a611bc1b1..c96b3bdec7 100755 --- a/security/tinc/src/etc/rc.d/opnsense-tincd +++ b/security/tinc/src/etc/rc.d/opnsense-tincd @@ -1,11 +1,8 @@ #!/bin/sh # -# $FreeBSD$ -# # PROVIDE: opnsense-tincd # REQUIRE: SERVERS # KEYWORD: shutdown -# . /etc/rc.subr From dcb8ace45f5424cddcbc072779e9d2d9a90ebee6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 6 Sep 2023 08:32:14 +0200 Subject: [PATCH 1569/3088] net/firewall: bump because of more intrusive model change --- net/firewall/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/firewall/Makefile b/net/firewall/Makefile index 7651367222..f92f3329d4 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= firewall PLUGIN_VERSION= 1.4 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Firewall API supplemental package PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_TIER= 2 From 037bc63c8645bcf016ab28b1412563840ea13374 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 6 Sep 2023 08:34:03 +0200 Subject: [PATCH 1570/3088] net/relayd: revision bump due to model changes --- net/relayd/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index f826734883..139dd2abe5 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= relayd PLUGIN_VERSION= 2.8 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com From 1baaa11fe99cd564206d0bece29fb830cab3f1e7 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 6 Sep 2023 08:42:53 +0200 Subject: [PATCH 1571/3088] dns/ddclient: update changelog --- dns/ddclient/Makefile | 2 +- dns/ddclient/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 4b731c1249..ad510c72ae 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.15 +PLUGIN_VERSION= 1.16 PLUGIN_DEPENDS= ddclient-devel py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 6964b5001b..a2039b1a79 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,10 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.16 + +* Add custom GET/PUT protocols to native backend (contributed by DaCookie4u) + 1.15 * Add AWS Route53 and DuckDNS to native backend (contributed by Greg Glockner) From c6ad8a442bcc50a9e15228dfd9566a7dadf5c5a2 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 6 Sep 2023 15:16:04 +0200 Subject: [PATCH 1572/3088] security/tinc: add routes to remote subnets with "subnet-up" script. for https://github.com/opnsense/plugins/pull/3539 --- security/tinc/Makefile | 2 +- .../src/opnsense/scripts/OPNsense/Tinc/tincd.py | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/security/tinc/Makefile b/security/tinc/Makefile index ecc4f25f3b..7d631fc778 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= tinc PLUGIN_VERSION= 1.6 -PLUGIN_REVISION= 5 +PLUGIN_REVISION= 6 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py index 3f5f887f49..d9020a76c8 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py @@ -30,10 +30,10 @@ """ import os import sys -import tempfile import glob import pipes import xml.etree.ElementTree +import shutil import subprocess import ipaddress from lib import objects @@ -96,6 +96,20 @@ def deploy(config_filename): if_up.append("configctl interface %s %s" % (interface_configd, interface_name)) write_file("%s/tinc-up" % network.get_basepath(), '\n'.join(if_up) + "\n", 0o700) + # write subnet-up file and ship required binaries into the chroot + chroot_needs = set(['/bin/sh', '/sbin/route', '/libexec/ld-elf.so.1']) + for item in list(chroot_needs): + for line in subprocess.run(['/usr/bin/ldd', item], capture_output=True, text=True).stdout.split('\n'): + if line.find('=>') > 0: + chroot_needs.add(line.split('=>')[1].strip().split()[0]) + for filename in chroot_needs: + os.makedirs('%s%s' % (network.get_basepath(), os.path.dirname(filename)), exist_ok=True) + shutil.copy(filename, '%s/%s' % (network.get_basepath(), filename)) + write_file("%s/subnet-up" % network.get_basepath(), '\n'.join([ + "#!/bin/sh", + "route add $SUBNET -iface %s\n" % interface_name + ]), 0o700) + # configure and rename new tun device, place all in group "tinc" symlink associated tun device if interface_name not in interfaces: tundev = subprocess.run(['/sbin/ifconfig', interface_type, 'create'], From 226340ab718fa950bc2e719add960c61067de2f9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 14 Sep 2023 00:56:00 +0200 Subject: [PATCH 1573/3088] net/haproxy: remove dead link --- .../src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index 54dd719be3..c831ef9c8b 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -717,7 +717,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Lastly, enable HAProxy using the %sService%s settings page.') | format('', '') }}
  • {{ lang._('Please be aware that you need to %smanually%s add the required firewall rules for all configured services.') | format('', '') }}

    -

    {{ lang._('Further information is available in our %sHAProxy plugin documentation%s and of course in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '', '', '') }}

    +

    {{ lang._('Further information is available in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '') }}


    From d260d55b51173b852f848d51c7bf95900489de0d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Sep 2023 09:37:41 +0200 Subject: [PATCH 1574/3088] net/haproxy: bump for update --- net/haproxy/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index f400b0ba29..49233c6f06 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 4.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer PLUGIN_DEPENDS= haproxy26 PLUGIN_MAINTAINER= opnsense@moov.de From 62cdab165b0021c09abfb9fd86382f8dbd29be99 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Sep 2023 09:40:25 +0200 Subject: [PATCH 1575/3088] net/frr: bump version --- net/frr/Makefile | 3 +-- net/frr/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index b6afb6b3fc..5282890e65 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.35 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.36 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr8 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 0046123c28..ba4c220766 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -12,6 +12,10 @@ WWW: https://frrouting.org/ Plugin Changelog ================ +1.36 + +* Added default-information originate option for OSPFv3 + 1.35 * Added automatic OSPFv3 firewall rules and opt-out automatic rule switch (contributed by Bill Gertz) From e005b6b9cde5c7082a8e1c7206e29fecc1d057e9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Sep 2023 09:44:00 +0200 Subject: [PATCH 1576/3088] net/wireguard: update changelog --- net/wireguard/pkg-descr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 77e00f49ca..97bd55ffcc 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,12 @@ WWW: https://www.wireguard.com/ Changelog --------- +2.1 + +* Only reload when interface configuration did not change +* Implement 'newwanip' and 'vpn' plugin facilities +* Refactor dashboard widget + 2.0 * Remove wireguard-go support and cleanup some go specific code as it's not being used anymore anyway From 322862ef7148e48479d3f161e520c1c52a8fa2d5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Sep 2023 09:45:07 +0200 Subject: [PATCH 1577/3088] security/tinc: update version --- security/tinc/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/security/tinc/Makefile b/security/tinc/Makefile index 7d631fc778..19cc944ff2 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= tinc -PLUGIN_VERSION= 1.6 -PLUGIN_REVISION= 6 +PLUGIN_VERSION= 1.7 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org From 28e8bc0cf0fedcc678c0935da65fa603f3805a90 Mon Sep 17 00:00:00 2001 From: Hasan UCAK Date: Sat, 16 Sep 2023 18:38:45 +0300 Subject: [PATCH 1578/3088] update repository hostname (#3586) --- vendor/sunnyvalley/src/etc/pkg/repos/SunnyValley.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/sunnyvalley/src/etc/pkg/repos/SunnyValley.conf.in b/vendor/sunnyvalley/src/etc/pkg/repos/SunnyValley.conf.in index c4c6acc7bb..4bc181315e 100644 --- a/vendor/sunnyvalley/src/etc/pkg/repos/SunnyValley.conf.in +++ b/vendor/sunnyvalley/src/etc/pkg/repos/SunnyValley.conf.in @@ -1,6 +1,6 @@ SunnyValley: { fingerprints: "/usr/local/etc/pkg/fingerprints/SunnyValley", - url: "https://updates.sunnyvalley.io/opnsense/${ABI}/%%PLUGIN_ABI%%/OpenSSL/latest", + url: "https://updates.zenarmor.com/opnsense/${ABI}/%%PLUGIN_ABI%%/latest", signature_type: "fingerprints", priority: 7, enabled: yes From f2413b5013dfbbc58ded9a74bef5dc23275cef7d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 18 Sep 2023 09:59:02 +0200 Subject: [PATCH 1579/3088] net/upnp: time to stop using get_interface_ip() in plugins The function is opportunistic and has weird VIP glue which is not needed in 98% of the code. --- net/upnp/Makefile | 2 +- net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/upnp/Makefile b/net/upnp/Makefile index 69773cd84c..6be3288b4e 100644 --- a/net/upnp/Makefile +++ b/net/upnp/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= upnp PLUGIN_VERSION= 1.5 -PLUGIN_REVISION= 3 +PLUGIN_REVISION= 4 PLUGIN_DEPENDS= miniupnpd PLUGIN_COMMENT= Universal Plug and Play Service PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc index cf3233c6e5..bc667ab016 100644 --- a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc +++ b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc @@ -146,7 +146,7 @@ function miniupnpd_configure_do($verbose = false) $if = get_real_interface($iface); /* above function returns iface if fail */ if ($if != $iface) { - $addr = get_interface_ip($iface); + list ($addr) = interfaces_primary_address($iface); if (!empty($addr)) { $config_text .= "listening_ip={$if}"; if (!empty($upnp_config['overridesubnet'])) { From 3cbf6f1fbf40d415f909bdf9b0e9f10acf095f83 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 18 Sep 2023 10:00:37 +0200 Subject: [PATCH 1580/3088] vendor/sunnyvalley: version bump --- vendor/sunnyvalley/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vendor/sunnyvalley/Makefile b/vendor/sunnyvalley/Makefile index b9ff6023ff..9bd1c0ce8b 100644 --- a/vendor/sunnyvalley/Makefile +++ b/vendor/sunnyvalley/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= sunnyvalley -PLUGIN_VERSION= 1.2 -PLUGIN_REVISION= 3 +PLUGIN_VERSION= 1.3 PLUGIN_COMMENT= Vendor Repository for Zenarmor (a.k.a Sensei, Next Generation Firewall Extensions) PLUGIN_MAINTAINER= opensource@sunnyvalley.io PLUGIN_WWW= https://www.sunnyvalley.io From 834a0dfa55fb608e6126c1536db8a9070227154a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 18 Sep 2023 10:28:01 +0200 Subject: [PATCH 1581/3088] security/acme-client: avoid including interfaces.inc in MVC, use proper function/flow --- security/acme-client/Makefile | 1 + .../OPNsense/AcmeClient/LeValidation/HttpOpnsense.php | 9 ++++----- .../OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php | 9 ++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 00a0327dea..1f3eaf6ce8 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= acme-client PLUGIN_VERSION= 3.19 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php index 3b2d7a3c97..c7a1672e34 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php @@ -28,8 +28,6 @@ namespace OPNsense\AcmeClient\LeValidation; -require_once("interfaces.inc"); - use OPNsense\AcmeClient\LeValidationInterface; use OPNsense\AcmeClient\LeUtils; use OPNsense\Core\Config; @@ -74,9 +72,10 @@ public function prepare() // Add IP address from chosen interface if (!empty((string)$this->config->http_opn_interface)) { - $interface_ip = get_interface_ip((string)$this->config->http_opn_interface); - if (!empty($interface_ip)) { - $iplist[] = $interface_ip; + $backend = new \OPNsense\Core\Backend(); + $response = $backend->configdpRun('interface address', [(string)$this->config->http_opn_interface]); + if (!empty($response['address'])) { + $iplist[] = $response['address']; } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php index db8466892a..f849ffd405 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php @@ -28,8 +28,6 @@ namespace OPNsense\AcmeClient\LeValidation; -require_once("interfaces.inc"); - use OPNsense\AcmeClient\LeValidationInterface; use OPNsense\AcmeClient\LeUtils; use OPNsense\Core\Config; @@ -75,9 +73,10 @@ public function prepare() // Add IP address from chosen interface if (!empty((string)$this->config->tlsalpn_acme_interface)) { - $interface_ip = get_interface_ip((string)$this->config->tlsalpn_acme_interface); - if (!empty($interface_ip)) { - $iplist[] = $interface_ip; + $backend = new \OPNsense\Core\Backend(); + $response = $backend->configdpRun('interface address', [(string)$this->config->tlsalpn_acme_interface]); + if (!empty($response['address'])) { + $iplist[] = $response['address']; } } From bea60a2883fb81a2fb213e98899265e477fa003b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 18 Sep 2023 11:09:58 +0200 Subject: [PATCH 1582/3088] dns/rfc2136: remove get_interface_ip(v6) use --- dns/rfc2136/Makefile | 2 +- dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc | 11 ++++------- dns/rfc2136/src/www/services_rfc2136.php | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/dns/rfc2136/Makefile b/dns/rfc2136/Makefile index fa96105ebf..f4ac272b23 100644 --- a/dns/rfc2136/Makefile +++ b/dns/rfc2136/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= rfc2136 PLUGIN_VERSION= 1.8 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= RFC-2136 Support PLUGIN_MAINTAINER= franco@opnsense.org PLUGIN_DEPENDS= bind-tools diff --git a/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc b/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc index 2de4d43c10..25c3fc9141 100644 --- a/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc +++ b/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc @@ -151,7 +151,7 @@ function rfc2136_configure_do($verbose = false, $int = '', $updatehost = '', $fo if (isset($dnsupdate['usepublicip'])) { $wanip = get_rfc2136_ip_address($dnsupdate['interface'], 4); } else { - $wanip = get_interface_ip($dnsupdate['interface']); + list ($wanip) = interfaces_primary_address($dnsupdate['interface']); } if (is_ipaddrv4($wanip)) { if (($wanip != $cachedipv4) || (($currentTime - $cacheTimev4) > $maxCacheAgeSecs) || $forced) { @@ -178,7 +178,7 @@ function rfc2136_configure_do($verbose = false, $int = '', $updatehost = '', $fo if (isset($dnsupdate['usepublicip'])) { $wanipv6 = get_rfc2136_ip_address($dnsupdate['interface'], 6); } else { - $wanipv6 = get_interface_ipv6($dnsupdate['interface']); + list ($wanipv6) = interfaces_primary_address6($dnsupdate['interface']); } if (is_ipaddrv6($wanipv6)) { if (($wanipv6 != $cachedipv6) || (($currentTime - $cacheTimev6) > $maxCacheAgeSecs) || $forced) { @@ -216,19 +216,16 @@ function rfc2136_configure_do($verbose = false, $int = '', $updatehost = '', $fo function get_rfc2136_ip_address($int, $ipver = 4) { - $ip_address = $ipver == 6 ? get_interface_ipv6($int) : get_interface_ip($int); + list ($ip_address) = $ipver == 6 ? interfaces_primary_address6($int) : interfaces_primary_address($int); if (empty($ip_address)) { log_error("Aborted IPv{$ipver} detection: no address for {$int}"); return 'down'; } if ($ipver != 6 && is_private_ip($ip_address)) { - /* Chinese alternative is http://ip.3322.net/ */ - $hosttocheck = 'http://checkip.dyndns.org'; - $ip_ch = curl_init($hosttocheck); + $ip_ch = curl_init('http://checkip.dyndns.org'); curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ip_ch, CURLOPT_INTERFACE, $ip_address); - curl_setopt($ip_ch, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($ip_ch, CURLOPT_TIMEOUT, 30); curl_setopt($ip_ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); $ip_result = curl_exec($ip_ch); diff --git a/dns/rfc2136/src/www/services_rfc2136.php b/dns/rfc2136/src/www/services_rfc2136.php index a7a5029bbb..4c7c385c07 100644 --- a/dns/rfc2136/src/www/services_rfc2136.php +++ b/dns/rfc2136/src/www/services_rfc2136.php @@ -148,7 +148,7 @@ if (isset($rfc2136['usepublicip'])) { $ipaddr = get_rfc2136_ip_address($rfc2136['interface'], 4); } else { - $ipaddr = get_interface_ip($rfc2136['interface']); + list ($ipaddr) = interfaces_primary_address($rfc2136['interface']); } $cached_ip_s = explode("|", file_get_contents($filename)); $cached_ip = $cached_ip_s[0]; @@ -169,7 +169,7 @@ if (isset($rfc2136['usepublicip'])) { $ipaddr = get_rfc2136_ip_address($rfc2136['interface'], 6); } else { - $ipaddr = get_interface_ipv6($rfc2136['interface']); + list ($ipaddr) = interfaces_primary_address6($rfc2136['interface']); } $cached_ip_s = explode("|", file_get_contents($filename6)); $cached_ip = $cached_ip_s[0]; From dd073fd6a651de5eecb173e3bb902279e703a1ef Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 18 Sep 2023 14:35:13 +0200 Subject: [PATCH 1583/3088] security/tinc - subnet-down script was added to tinc plugin (#3591) --- security/tinc/Makefile | 1 + security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/security/tinc/Makefile b/security/tinc/Makefile index 19cc944ff2..ea9b6397ab 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= tinc PLUGIN_VERSION= 1.7 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py index d9020a76c8..2f73ae60b6 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py @@ -96,7 +96,7 @@ def deploy(config_filename): if_up.append("configctl interface %s %s" % (interface_configd, interface_name)) write_file("%s/tinc-up" % network.get_basepath(), '\n'.join(if_up) + "\n", 0o700) - # write subnet-up file and ship required binaries into the chroot + # write subnet-{up|down} scripts and ship required binaries into the chroot chroot_needs = set(['/bin/sh', '/sbin/route', '/libexec/ld-elf.so.1']) for item in list(chroot_needs): for line in subprocess.run(['/usr/bin/ldd', item], capture_output=True, text=True).stdout.split('\n'): @@ -109,6 +109,10 @@ def deploy(config_filename): "#!/bin/sh", "route add $SUBNET -iface %s\n" % interface_name ]), 0o700) + write_file("%s/subnet-down" % network.get_basepath(), '\n'.join([ + "#!/bin/sh", + "route delete $SUBNET -iface %s\n" % interface_name + ]), 0o700) # configure and rename new tun device, place all in group "tinc" symlink associated tun device if interface_name not in interfaces: From d0ac0b3f9d527d23896c136157d5ff646f3bf3de Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 Sep 2023 13:13:41 +0200 Subject: [PATCH 1584/3088] misc: rename bootstrap-select files and bump version PR: https://github.com/opnsense/core/issues/6849 --- misc/theme-cicada/Makefile | 1 + ...lect-1.13.3.scss => bootstrap-select.scss} | 0 ...elect-1.13.3.css => bootstrap-select1.css} | 0 misc/theme-rebellion/Makefile | 1 + ...lect-1.13.3.scss => bootstrap-select.scss} | 0 .../build/css/bootstrap-select-1.13.3.css | 405 ------------------ .../rebellion/build/css/bootstrap-select.css | 262 ++++++++--- misc/theme-tukan/Makefile | 1 + ...ect-1.13.3.scss => bootstrap-select1.scss} | 0 .../build/css/bootstrap-select-1.13.3.css | 398 ----------------- .../tukan/build/css/bootstrap-select.css | 258 +++++++---- misc/theme-vicuna/Makefile | 1 + ...ect-1.13.3.scss => bootstrap-select1.scss} | 0 .../build/css/bootstrap-select-1.13.3.css | 398 ----------------- .../vicuna/build/css/bootstrap-select.css | 258 +++++++---- 15 files changed, 569 insertions(+), 1414 deletions(-) rename misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/{bootstrap-select-1.13.3.scss => bootstrap-select.scss} (100%) rename misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/{bootstrap-select-1.13.3.css => bootstrap-select1.css} (100%) rename misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/{bootstrap-select-1.13.3.scss => bootstrap-select.scss} (100%) delete mode 100644 misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/bootstrap-select-1.13.3.css rename misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/{bootstrap-select-1.13.3.scss => bootstrap-select1.scss} (100%) delete mode 100644 misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select-1.13.3.css rename misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/{bootstrap-select-1.13.3.scss => bootstrap-select1.scss} (100%) delete mode 100644 misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/bootstrap-select-1.13.3.css diff --git a/misc/theme-cicada/Makefile b/misc/theme-cicada/Makefile index 2d7b418c35..2783100d16 100644 --- a/misc/theme-cicada/Makefile +++ b/misc/theme-cicada/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= theme-cicada PLUGIN_VERSION= 1.34 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= The cicada theme - dark grey onyx PLUGIN_MAINTAINER= rene@team-rebellion.net PLUGIN_NO_ABI= yes diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/bootstrap-select-1.13.3.scss b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/bootstrap-select.scss similarity index 100% rename from misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/bootstrap-select-1.13.3.scss rename to misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/bootstrap-select.scss diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select-1.13.3.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select1.css similarity index 100% rename from misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select-1.13.3.css rename to misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select1.css diff --git a/misc/theme-rebellion/Makefile b/misc/theme-rebellion/Makefile index b15ab9ea56..e4c0763f58 100644 --- a/misc/theme-rebellion/Makefile +++ b/misc/theme-rebellion/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= theme-rebellion PLUGIN_VERSION= 1.8.8 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= A suitably dark theme PLUGIN_MAINTAINER= team-rebellion@queens-park.com PLUGIN_NO_ABI= yes diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/bootstrap-select-1.13.3.scss b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/bootstrap-select.scss similarity index 100% rename from misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/bootstrap-select-1.13.3.scss rename to misc/theme-rebellion/src/opnsense/www/themes/rebellion/assets/stylesheets/bootstrap-select.scss diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/bootstrap-select-1.13.3.css b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/bootstrap-select-1.13.3.css deleted file mode 100644 index bbc5c29d9a..0000000000 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/bootstrap-select-1.13.3.css +++ /dev/null @@ -1,405 +0,0 @@ -/*! - * Bootstrap-select v1.13.3 (https://developer.snapappointments.com/bootstrap-select) - * - * Copyright 2012-2018 SnapAppointments, LLC - * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) - */ - -select.bs-select-hidden, -.bootstrap-select > select.bs-select-hidden, -select.selectpicker { - display: none !important; - -} -.bootstrap-select { - width: 348px \0; - /*IE9 and below*/ -} -.bootstrap-select > .dropdown-toggle { - position: relative; - width: 100%; - - z-index: 1; - text-align: right; - white-space: nowrap; -} -.bootstrap-select > .dropdown-toggle.bs-placeholder, -.bootstrap-select > .dropdown-toggle.bs-placeholder:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder:active { - color: #ccc; -} -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active { - color: rgba(0, 0, 0, 0.5); -} -.bootstrap-select > select { - position: absolute !important; - bottom: 0; - left: 50%; - display: block !important; - width: 0.5px !important; - height: 100% !important; - padding: 0 !important; - opacity: 0 !important; - border: none; -} -.bootstrap-select > select.mobile-device { - top: 0; - left: 0; - display: block !important; - width: 100% !important; - z-index: 2; -} -.has-error .bootstrap-select .dropdown-toggle, -.error .bootstrap-select .dropdown-toggle, -.bootstrap-select.is-invalid .dropdown-toggle, -.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle { - border-color: #b94a48; -} -.bootstrap-select.is-valid .dropdown-toggle, -.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle { - border-color: #28a745; -} -.bootstrap-select.fit-width { - width: auto !important; -} -.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { - width: 348px; -} -.bootstrap-select > select.mobile-device:focus + .dropdown-toggle, -.bootstrap-select .dropdown-toggle:focus { - outline: thin dotted #bbbbbb !important; - outline: 5px auto -webkit-focus-ring-color !important; - outline-offset: -2px; -} -.bootstrap-select.form-control { - margin-bottom: 0; - padding: 0; - border: none; -} -:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) { - width: 100%; -} -.bootstrap-select.form-control.input-group-btn { - z-index: auto; -} -.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.bootstrap-select:not(.input-group-btn), -.bootstrap-select[class*="col-"] { - float: none; - display: inline-block; - margin-left: 0; -} -.bootstrap-select.dropdown-menu-right, -.bootstrap-select[class*="col-"].dropdown-menu-right, -.row .bootstrap-select[class*="col-"].dropdown-menu-right { - float: right; -} -.form-inline .bootstrap-select, -.form-horizontal .bootstrap-select, -.form-group .bootstrap-select { - margin-bottom: 0; -} -.form-group-lg .bootstrap-select.form-control, -.form-group-sm .bootstrap-select.form-control { - padding: 0; -} -.form-group-lg .bootstrap-select.form-control .dropdown-toggle, -.form-group-sm .bootstrap-select.form-control .dropdown-toggle { - height: 100%; - font-size: inherit; - line-height: inherit; - border-radius: inherit; -} -.bootstrap-select.form-control-sm .dropdown-toggle, -.bootstrap-select.form-control-lg .dropdown-toggle { - font-size: inherit; - line-height: inherit; - border-radius: inherit; -} -.bootstrap-select.form-control-sm .dropdown-toggle { - padding: 0.25rem 0.5rem; -} -.bootstrap-select.form-control-lg .dropdown-toggle { - padding: 0.5rem 1rem; -} -.form-inline .bootstrap-select .form-control { - width: 100%; -} -.bootstrap-select.disabled, -.bootstrap-select > .disabled { - cursor: not-allowed; -} -.bootstrap-select.disabled:focus, -.bootstrap-select > .disabled:focus { - outline: none !important; -} -.bootstrap-select.bs-container { - position: absolute; - top: 0; - left: 0; - height: 0 !important; - padding: 0 !important; -} -.bootstrap-select.bs-container .dropdown-menu { - z-index: 1060; -} -.bootstrap-select .dropdown-toggle:before { - content: ''; - display: inline-block; -} -.bootstrap-select .dropdown-toggle .filter-option { - position: absolute; - top: 0; - left: 0; - padding-top: inherit; - padding-right: inherit; - padding-bottom: inherit; - padding-left: inherit; - height: 100%; - width: 100%; - text-align: left; -} -.bootstrap-select .dropdown-toggle .filter-option-inner { - padding-right: inherit; -} -.bootstrap-select .dropdown-toggle .filter-option-inner-inner { - overflow: hidden; -} -.bootstrap-select .dropdown-toggle .caret { - position: absolute; - top: 50%; - right: 12px; - margin-top: -2px; - vertical-align: middle; -} -.input-group .bootstrap-select.form-control .dropdown-toggle { - border-radius: inherit; -} -.bootstrap-select[class*="col-"] .dropdown-toggle { - width: 100%; -} -.bootstrap-select .dropdown-menu { - min-width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bootstrap-select .dropdown-menu > .inner:focus { - outline: none !important; -} -.bootstrap-select .dropdown-menu.inner { - position: static; - float: none; - border: 0; - padding: 0; - margin: 0; - border-radius: 0; - -webkit-box-shadow: none; - box-shadow: none; -} -.bootstrap-select .dropdown-menu li { - position: relative; -} -.bootstrap-select .dropdown-menu li.active small { - color: rgba(255, 255, 255, 0.5) !important; -} -.bootstrap-select .dropdown-menu li.disabled a { - cursor: not-allowed; -} -.bootstrap-select .dropdown-menu li a { - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.bootstrap-select .dropdown-menu li a.opt { - position: relative; - padding-left: 2.25em; -} -.bootstrap-select .dropdown-menu li a span.check-mark { - display: none; -} -.bootstrap-select .dropdown-menu li a span.text { - display: inline-block; -} -.bootstrap-select .dropdown-menu li small { - padding-left: 0.5em; -} -.bootstrap-select .dropdown-menu .notify { - position: absolute; - bottom: 5px; - width: 96%; - margin: 0 2%; - min-height: 26px; - padding: 3px 5px; - background: #151515; - border: 1px solid #232323; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - pointer-events: none; - opacity: 0.9; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bootstrap-select .no-results { - padding: 3px; - background: #151515; - margin: 0 5px; - white-space: nowrap; -} -.bootstrap-select.fit-width .dropdown-toggle .filter-option { - position: static; - display: inline; - padding: 0; -} -.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner, -.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner { - display: inline; -} -.bootstrap-select.fit-width .dropdown-toggle .caret { - position: static; - top: auto; - margin-top: -1px; -} -.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { - position: absolute; - display: inline-block; - right: 15px; - top: 5px; -} -.bootstrap-select.show-tick .dropdown-menu li a span.text { - margin-right: 34px; -} -.bootstrap-select .bs-ok-default:after { - content: ''; - display: block; - width: 0.5em; - height: 1em; - border-style: solid; - border-width: 0 0.26em 0.26em 0; - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); -} -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle { - z-index: 1061; -} -.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before { - content: ''; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid rgba(204, 204, 204, 0.2); - position: absolute; - bottom: -4px; - left: 9px; - display: none; -} -.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after { - content: ''; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid white; - position: absolute; - bottom: -4px; - left: 10px; - display: none; -} -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before { - bottom: auto; - top: -4px; - border-top: 7px solid rgba(50, 50, 50, 0.2); - border-bottom: 0; -} -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after { - bottom: auto; - top: -4px; - border-top: 6px solid white; - border-bottom: 0; -} -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before { - right: 12px; - left: auto; -} -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after { - right: 13px; - left: auto; -} -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before, -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after { - display: block; -} -.bs-searchbox, -.bs-actionsbox, -.bs-donebutton { - padding: 4px 8px; -} -.bs-actionsbox { - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bs-actionsbox .btn-group button { - width: 50%; -} -.bs-donebutton { - float: left; - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bs-donebutton .btn-group button { - width: 100%; -} -.bs-searchbox + .bs-actionsbox { - padding: 0 8px 4px; -} -.bs-searchbox .form-control { - margin-bottom: 0; - width: 100%; - float: none; -} - -/* OPNsense edit to fix https://github.com/opnsense/core/issues/2612 : - * Move checkmarks to left hand side of the dropdown. - */ -.bootstrap-select .dropdown-menu > li > a { - padding: 3px 20px 3px 30px; -} -.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { - left: 10px; -} -/* End OPNsense edit to fix #2612. */ diff --git a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/bootstrap-select.css b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/bootstrap-select.css index 819f88d592..bbc5c29d9a 100644 --- a/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/bootstrap-select.css +++ b/misc/theme-rebellion/src/opnsense/www/themes/rebellion/build/css/bootstrap-select.css @@ -1,29 +1,66 @@ /*! - * Bootstrap-select v1.9.3 (http://silviomoreto.github.io/bootstrap-select) + * Bootstrap-select v1.13.3 (https://developer.snapappointments.com/bootstrap-select) * - * Copyright 2013-2015 bootstrap-select - * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) + * Copyright 2012-2018 SnapAppointments, LLC + * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ -/* set form-control on span height, which is used by liHeight to calculate height */ -span.form-control { - height: 34px !important; - padding: 6px 12px; +select.bs-select-hidden, +.bootstrap-select > select.bs-select-hidden, +select.selectpicker { + display: none !important; + } .bootstrap-select { width: 348px \0; /*IE9 and below*/ } .bootstrap-select > .dropdown-toggle { + position: relative; width: 100%; - padding-right: 25px; + z-index: 1; + text-align: right; + white-space: nowrap; +} +.bootstrap-select > .dropdown-toggle.bs-placeholder, +.bootstrap-select > .dropdown-toggle.bs-placeholder:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder:active { + color: #ccc; +} +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active { + color: rgba(0, 0, 0, 0.5); } .bootstrap-select > select { position: absolute !important; bottom: 0; left: 50%; - width: 0.11px !important; + display: block !important; + width: 0.5px !important; height: 100% !important; padding: 0 !important; opacity: 0 !important; @@ -37,17 +74,24 @@ span.form-control { z-index: 2; } .has-error .bootstrap-select .dropdown-toggle, -.error .bootstrap-select .dropdown-toggle { +.error .bootstrap-select .dropdown-toggle, +.bootstrap-select.is-invalid .dropdown-toggle, +.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle { border-color: #b94a48; } +.bootstrap-select.is-valid .dropdown-toggle, +.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle { + border-color: #28a745; +} .bootstrap-select.fit-width { width: auto !important; } .bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { width: 348px; } +.bootstrap-select > select.mobile-device:focus + .dropdown-toggle, .bootstrap-select .dropdown-toggle:focus { - outline: thin dotted #333333 !important; + outline: thin dotted #bbbbbb !important; outline: 5px auto -webkit-focus-ring-color !important; outline-offset: -2px; } @@ -56,72 +100,120 @@ span.form-control { padding: 0; border: none; } -.bootstrap-select.form-control:not([class*="col-"]) { +:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) { width: 100%; } .bootstrap-select.form-control.input-group-btn { z-index: auto; } -.bootstrap-select.btn-group:not(.input-group-btn), -.bootstrap-select.btn-group[class*="col-"] { +.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.bootstrap-select:not(.input-group-btn), +.bootstrap-select[class*="col-"] { float: none; display: inline-block; margin-left: 0; } -.bootstrap-select.btn-group.dropdown-menu-right, -.bootstrap-select.btn-group[class*="col-"].dropdown-menu-right, -.row .bootstrap-select.btn-group[class*="col-"].dropdown-menu-right { +.bootstrap-select.dropdown-menu-right, +.bootstrap-select[class*="col-"].dropdown-menu-right, +.row .bootstrap-select[class*="col-"].dropdown-menu-right { float: right; } -.form-inline .bootstrap-select.btn-group, -.form-horizontal .bootstrap-select.btn-group, -.form-group .bootstrap-select.btn-group { +.form-inline .bootstrap-select, +.form-horizontal .bootstrap-select, +.form-group .bootstrap-select { margin-bottom: 0; } -.form-group-lg .bootstrap-select.btn-group.form-control, -.form-group-sm .bootstrap-select.btn-group.form-control { +.form-group-lg .bootstrap-select.form-control, +.form-group-sm .bootstrap-select.form-control { padding: 0; } -.form-inline .bootstrap-select.btn-group .form-control { +.form-group-lg .bootstrap-select.form-control .dropdown-toggle, +.form-group-sm .bootstrap-select.form-control .dropdown-toggle { + height: 100%; + font-size: inherit; + line-height: inherit; + border-radius: inherit; +} +.bootstrap-select.form-control-sm .dropdown-toggle, +.bootstrap-select.form-control-lg .dropdown-toggle { + font-size: inherit; + line-height: inherit; + border-radius: inherit; +} +.bootstrap-select.form-control-sm .dropdown-toggle { + padding: 0.25rem 0.5rem; +} +.bootstrap-select.form-control-lg .dropdown-toggle { + padding: 0.5rem 1rem; +} +.form-inline .bootstrap-select .form-control { width: 100%; } -.bootstrap-select.btn-group.disabled, -.bootstrap-select.btn-group > .disabled { +.bootstrap-select.disabled, +.bootstrap-select > .disabled { cursor: not-allowed; } -.bootstrap-select.btn-group.disabled:focus, -.bootstrap-select.btn-group > .disabled:focus { +.bootstrap-select.disabled:focus, +.bootstrap-select > .disabled:focus { outline: none !important; } -.bootstrap-select.btn-group.bs-container { +.bootstrap-select.bs-container { position: absolute; + top: 0; + left: 0; + height: 0 !important; + padding: 0 !important; } -.bootstrap-select.btn-group.bs-container .dropdown-menu { +.bootstrap-select.bs-container .dropdown-menu { z-index: 1060; } -.bootstrap-select.btn-group .dropdown-toggle .filter-option { +.bootstrap-select .dropdown-toggle:before { + content: ''; display: inline-block; - overflow: hidden; +} +.bootstrap-select .dropdown-toggle .filter-option { + position: absolute; + top: 0; + left: 0; + padding-top: inherit; + padding-right: inherit; + padding-bottom: inherit; + padding-left: inherit; + height: 100%; width: 100%; text-align: left; } -.bootstrap-select.btn-group .dropdown-toggle .caret { +.bootstrap-select .dropdown-toggle .filter-option-inner { + padding-right: inherit; +} +.bootstrap-select .dropdown-toggle .filter-option-inner-inner { + overflow: hidden; +} +.bootstrap-select .dropdown-toggle .caret { position: absolute; top: 50%; right: 12px; margin-top: -2px; vertical-align: middle; } -.bootstrap-select.btn-group[class*="col-"] .dropdown-toggle { +.input-group .bootstrap-select.form-control .dropdown-toggle { + border-radius: inherit; +} +.bootstrap-select[class*="col-"] .dropdown-toggle { width: 100%; } -.bootstrap-select.btn-group .dropdown-menu { +.bootstrap-select .dropdown-menu { min-width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } -.bootstrap-select.btn-group .dropdown-menu.inner { +.bootstrap-select .dropdown-menu > .inner:focus { + outline: none !important; +} +.bootstrap-select .dropdown-menu.inner { position: static; float: none; border: 0; @@ -131,44 +223,44 @@ span.form-control { -webkit-box-shadow: none; box-shadow: none; } -.bootstrap-select.btn-group .dropdown-menu li { +.bootstrap-select .dropdown-menu li { position: relative; } -.bootstrap-select.btn-group .dropdown-menu li.active small { - color: #fff; +.bootstrap-select .dropdown-menu li.active small { + color: rgba(255, 255, 255, 0.5) !important; } -.bootstrap-select.btn-group .dropdown-menu li.disabled a { +.bootstrap-select .dropdown-menu li.disabled a { cursor: not-allowed; } -.bootstrap-select.btn-group .dropdown-menu li a { +.bootstrap-select .dropdown-menu li a { cursor: pointer; -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } -.bootstrap-select.btn-group .dropdown-menu li a.opt { +.bootstrap-select .dropdown-menu li a.opt { position: relative; padding-left: 2.25em; } -.bootstrap-select.btn-group .dropdown-menu li a span.check-mark { +.bootstrap-select .dropdown-menu li a span.check-mark { display: none; } -.bootstrap-select.btn-group .dropdown-menu li a span.text { +.bootstrap-select .dropdown-menu li a span.text { display: inline-block; } -.bootstrap-select.btn-group .dropdown-menu li small { +.bootstrap-select .dropdown-menu li small { padding-left: 0.5em; } -.bootstrap-select.btn-group .dropdown-menu .notify { +.bootstrap-select .dropdown-menu .notify { position: absolute; bottom: 5px; width: 96%; margin: 0 2%; min-height: 26px; padding: 3px 5px; - background: #f5f5f5; - border: 1px solid #e3e3e3; + background: #151515; + border: 1px solid #232323; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); pointer-events: none; @@ -177,33 +269,52 @@ span.form-control { -moz-box-sizing: border-box; box-sizing: border-box; } -.bootstrap-select.btn-group .no-results { +.bootstrap-select .no-results { padding: 3px; - background: #f5f5f5; + background: #151515; margin: 0 5px; white-space: nowrap; } -.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option { +.bootstrap-select.fit-width .dropdown-toggle .filter-option { position: static; + display: inline; + padding: 0; +} +.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner, +.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner { + display: inline; } -.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret { +.bootstrap-select.fit-width .dropdown-toggle .caret { position: static; top: auto; margin-top: -1px; } -.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark { +.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { position: absolute; display: inline-block; right: 15px; - margin-top: 5px; + top: 5px; } -.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text { +.bootstrap-select.show-tick .dropdown-menu li a span.text { margin-right: 34px; } -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle { +.bootstrap-select .bs-ok-default:after { + content: ''; + display: block; + width: 0.5em; + height: 1em; + border-style: solid; + border-width: 0 0.26em 0.26em 0; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle { z-index: 1061; } -.bootstrap-select.show-menu-arrow .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before { content: ''; border-left: 7px solid transparent; border-right: 7px solid transparent; @@ -213,7 +324,7 @@ span.form-control { left: 9px; display: none; } -.bootstrap-select.show-menu-arrow .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after { content: ''; border-left: 6px solid transparent; border-right: 6px solid transparent; @@ -223,28 +334,30 @@ span.form-control { left: 10px; display: none; } -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before { bottom: auto; - top: -3px; - border-top: 7px solid rgba(204, 204, 204, 0.2); + top: -4px; + border-top: 7px solid rgba(50, 50, 50, 0.2); border-bottom: 0; } -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after { bottom: auto; - top: -3px; + top: -4px; border-top: 6px solid white; border-bottom: 0; } -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before { right: 12px; left: auto; } -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after { right: 13px; left: auto; } -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before, -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before, +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after { display: block; } .bs-searchbox, @@ -279,3 +392,14 @@ span.form-control { width: 100%; float: none; } + +/* OPNsense edit to fix https://github.com/opnsense/core/issues/2612 : + * Move checkmarks to left hand side of the dropdown. + */ +.bootstrap-select .dropdown-menu > li > a { + padding: 3px 20px 3px 30px; +} +.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { + left: 10px; +} +/* End OPNsense edit to fix #2612. */ diff --git a/misc/theme-tukan/Makefile b/misc/theme-tukan/Makefile index 54f47d87c4..58302aefc0 100644 --- a/misc/theme-tukan/Makefile +++ b/misc/theme-tukan/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= theme-tukan PLUGIN_VERSION= 1.27 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= The tukan theme - blue/white PLUGIN_MAINTAINER= rene@team-rebellion.net PLUGIN_NO_ABI= yes diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/bootstrap-select-1.13.3.scss b/misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/bootstrap-select1.scss similarity index 100% rename from misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/bootstrap-select-1.13.3.scss rename to misc/theme-tukan/src/opnsense/www/themes/tukan/assets/stylesheets/bootstrap-select1.scss diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select-1.13.3.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select-1.13.3.css deleted file mode 100644 index 01c6683218..0000000000 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select-1.13.3.css +++ /dev/null @@ -1,398 +0,0 @@ -/*! - * Bootstrap-select v1.13.3 (https://developer.snapappointments.com/bootstrap-select) - * - * Copyright 2012-2018 SnapAppointments, LLC - * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) - */ - -select.bs-select-hidden, -.bootstrap-select > select.bs-select-hidden, -select.selectpicker { - display: none !important; -} -.bootstrap-select { - width: 348px \0; - /*IE9 and below*/ -} -.bootstrap-select > .dropdown-toggle { - position: relative; - width: 100%; - z-index: 1; - text-align: right; - white-space: nowrap; -} -.bootstrap-select > .dropdown-toggle.bs-placeholder, -.bootstrap-select > .dropdown-toggle.bs-placeholder:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder:active { - color: #000; -} -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active { - color: #ffffff; -} -.bootstrap-select > select { - position: absolute !important; - bottom: 0; - left: 50%; - display: block !important; - width: 0.5px !important; - height: 100% !important; - padding: 0 !important; - opacity: 0 !important; - border: none; -} -.bootstrap-select > select.mobile-device { - top: 0; - left: 0; - display: block !important; - width: 100% !important; - z-index: 2; -} -.has-error .bootstrap-select .dropdown-toggle, -.error .bootstrap-select .dropdown-toggle, -.bootstrap-select.is-invalid .dropdown-toggle, -.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle { - border-color: #b94a48; -} -.bootstrap-select.is-valid .dropdown-toggle, -.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle { - border-color: #28a745; -} -.bootstrap-select.fit-width { - width: auto !important; -} -.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { - width: 348px; -} - -.bootstrap-select.form-control { - margin-bottom: 0; - padding: 0; - border: none; -} -:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) { - width: 100%; -} -.bootstrap-select.form-control.input-group-btn { - z-index: auto; -} -.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.bootstrap-select:not(.input-group-btn), -.bootstrap-select[class*="col-"] { - float: none; - display: inline-block; - margin-left: 0; -} -.bootstrap-select.dropdown-menu-right, -.bootstrap-select[class*="col-"].dropdown-menu-right, -.row .bootstrap-select[class*="col-"].dropdown-menu-right { - float: right; -} -.form-inline .bootstrap-select, -.form-horizontal .bootstrap-select, -.form-group .bootstrap-select { - margin-bottom: 0; -} -.form-group-lg .bootstrap-select.form-control, -.form-group-sm .bootstrap-select.form-control { - padding: 0; -} -.form-group-lg .bootstrap-select.form-control .dropdown-toggle, -.form-group-sm .bootstrap-select.form-control .dropdown-toggle { - height: 100%; - font-size: inherit; - line-height: inherit; - border-radius: inherit; -} -.bootstrap-select.form-control-sm .dropdown-toggle, -.bootstrap-select.form-control-lg .dropdown-toggle { - font-size: inherit; - line-height: inherit; - border-radius: inherit; -} -.bootstrap-select.form-control-sm .dropdown-toggle { - padding: 0.25rem 0.5rem; -} -.bootstrap-select.form-control-lg .dropdown-toggle { - padding: 0.5rem 1rem; -} -.form-inline .bootstrap-select .form-control { - width: 100%; -} -.bootstrap-select.disabled, -.bootstrap-select > .disabled { - cursor: not-allowed; -} -.bootstrap-select.disabled:focus, -.bootstrap-select > .disabled:focus { - outline: none !important; -} -.bootstrap-select.bs-container { - position: absolute; - top: 0; - left: 0; - height: 0 !important; - padding: 0 !important; -} -.bootstrap-select.bs-container .dropdown-menu { - z-index: 1060; -} -.bootstrap-select .dropdown-toggle:before { - content: ''; - display: inline-block; -} -.bootstrap-select .dropdown-toggle .filter-option { - position: absolute; - top: 0; - left: 0; - padding-top: inherit; - padding-right: inherit; - padding-bottom: inherit; - padding-left: inherit; - height: 100%; - width: 100%; - text-align: left; -} -.bootstrap-select .dropdown-toggle .filter-option-inner { - padding-right: inherit; -} -.bootstrap-select .dropdown-toggle .filter-option-inner-inner { - overflow: hidden; -} -.bootstrap-select .dropdown-toggle .caret { - position: absolute; - top: 50%; - right: 12px; - margin-top: -2px; - vertical-align: middle; -} -.input-group .bootstrap-select.form-control .dropdown-toggle { - border-radius: inherit; -} -.bootstrap-select[class*="col-"] .dropdown-toggle { - width: 100%; -} -.bootstrap-select .dropdown-menu { - min-width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bootstrap-select .dropdown-menu > .inner:focus { - outline: none !important; -} -.bootstrap-select .dropdown-menu.inner { - position: static; - float: none; - border: 0; - padding: 0; - margin: 0; - border-radius: 0; - -webkit-box-shadow: none; - box-shadow: none; -} -.bootstrap-select .dropdown-menu li { - position: relative; -} -.bootstrap-select .dropdown-menu li.active small { - color: rgba(255, 255, 255, 0.5) !important; -} -.bootstrap-select .dropdown-menu li.disabled a { - cursor: not-allowed; -} -.bootstrap-select .dropdown-menu li a { - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.bootstrap-select .dropdown-menu li a.opt { - position: relative; - padding-left: 2.25em; -} -.bootstrap-select .dropdown-menu li a span.check-mark { - display: none; -} -.bootstrap-select .dropdown-menu li a span.text { - display: inline-block; -} -.bootstrap-select .dropdown-menu li small { - padding-left: 0.5em; -} -.bootstrap-select .dropdown-menu .notify { - position: absolute; - bottom: 5px; - width: 96%; - margin: 0 2%; - min-height: 26px; - padding: 3px 5px; - background: #f5f5f5; - border: 1px solid #e3e3e3; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - pointer-events: none; - opacity: 0.9; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bootstrap-select .no-results { - padding: 3px; - background: #f5f5f5; - margin: 0 5px; - white-space: nowrap; -} -.bootstrap-select.fit-width .dropdown-toggle .filter-option { - position: static; - display: inline; - padding: 0; -} -.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner, -.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner { - display: inline; -} -.bootstrap-select.fit-width .dropdown-toggle .caret { - position: static; - top: auto; - margin-top: -1px; -} -.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { - position: absolute; - display: inline-block; - right: 15px; - top: 5px; -} -.bootstrap-select.show-tick .dropdown-menu li a span.text { - margin-right: 34px; -} -.bootstrap-select .bs-ok-default:after { - content: ''; - display: block; - width: 0.5em; - height: 1em; - border-style: solid; - border-width: 0 0.26em 0.26em 0; - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); -} -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle { - z-index: 1061; -} -.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before { - content: ''; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid rgba(204, 204, 204, 0.2); - position: absolute; - bottom: -4px; - left: 9px; - display: none; -} -.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after { - content: ''; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid white; - position: absolute; - bottom: -4px; - left: 10px; - display: none; -} -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before { - bottom: auto; - top: -4px; - border-top: 7px solid rgba(204, 204, 204, 0.2); - border-bottom: 0; -} -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after { - bottom: auto; - top: -4px; - border-top: 6px solid white; - border-bottom: 0; -} -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before { - right: 12px; - left: auto; -} -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after { - right: 13px; - left: auto; -} -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before, -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after { - display: block; -} -.bs-searchbox, -.bs-actionsbox, -.bs-donebutton { - padding: 4px 8px; -} -.bs-actionsbox { - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bs-actionsbox .btn-group button { - width: 50%; -} -.bs-donebutton { - float: left; - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bs-donebutton .btn-group button { - width: 100%; -} -.bs-searchbox + .bs-actionsbox { - padding: 0 8px 4px; -} -.bs-searchbox .form-control { - margin-bottom: 0; - width: 100%; - float: none; -} - -/* OPNsense edit to fix https://github.com/opnsense/core/issues/2612 : - * Move checkmarks to left hand side of the dropdown. - */ -.bootstrap-select .dropdown-menu > li > a { - padding: 3px 20px 3px 30px; -} -.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { - left: 10px; -} -/* End OPNsense edit to fix #2612. */ diff --git a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select.css b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select.css index 56214371e7..01c6683218 100644 --- a/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select.css +++ b/misc/theme-tukan/src/opnsense/www/themes/tukan/build/css/bootstrap-select.css @@ -1,29 +1,64 @@ /*! - * Bootstrap-select v1.9.3 (http://silviomoreto.github.io/bootstrap-select) + * Bootstrap-select v1.13.3 (https://developer.snapappointments.com/bootstrap-select) * - * Copyright 2013-2015 bootstrap-select - * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) + * Copyright 2012-2018 SnapAppointments, LLC + * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ -/* set form-control on span height, which is used by liHeight to calculate height */ -span.form-control { - height: 34px !important; - padding: 6px 12px; +select.bs-select-hidden, +.bootstrap-select > select.bs-select-hidden, +select.selectpicker { + display: none !important; } .bootstrap-select { width: 348px \0; /*IE9 and below*/ } .bootstrap-select > .dropdown-toggle { + position: relative; width: 100%; - padding-right: 25px; z-index: 1; + text-align: right; + white-space: nowrap; +} +.bootstrap-select > .dropdown-toggle.bs-placeholder, +.bootstrap-select > .dropdown-toggle.bs-placeholder:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder:active { + color: #000; +} +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active { + color: #ffffff; } .bootstrap-select > select { position: absolute !important; bottom: 0; left: 50%; - width: 0.11px !important; + display: block !important; + width: 0.5px !important; height: 100% !important; padding: 0 !important; opacity: 0 !important; @@ -37,133 +72,180 @@ span.form-control { z-index: 2; } .has-error .bootstrap-select .dropdown-toggle, -.error .bootstrap-select .dropdown-toggle { +.error .bootstrap-select .dropdown-toggle, +.bootstrap-select.is-invalid .dropdown-toggle, +.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle { border-color: #b94a48; } +.bootstrap-select.is-valid .dropdown-toggle, +.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle { + border-color: #28a745; +} .bootstrap-select.fit-width { width: auto !important; } .bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { width: 348px; } -.bootstrap-select .dropdown-toggle:focus { - color:#FFFFFF !important; - outline-offset: -2px; -} + .bootstrap-select.form-control { margin-bottom: 0; padding: 0; border: none; } -.bootstrap-select.form-control:not([class*="col-"]) { +:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) { width: 100%; } .bootstrap-select.form-control.input-group-btn { z-index: auto; } -.bootstrap-select.btn-group:not(.input-group-btn), -.bootstrap-select.btn-group[class*="col-"] { +.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.bootstrap-select:not(.input-group-btn), +.bootstrap-select[class*="col-"] { float: none; display: inline-block; margin-left: 0; } -.bootstrap-select.btn-group.dropdown-menu-right, -.bootstrap-select.btn-group[class*="col-"].dropdown-menu-right, -.row .bootstrap-select.btn-group[class*="col-"].dropdown-menu-right { +.bootstrap-select.dropdown-menu-right, +.bootstrap-select[class*="col-"].dropdown-menu-right, +.row .bootstrap-select[class*="col-"].dropdown-menu-right { float: right; } -.form-inline .bootstrap-select.btn-group, -.form-horizontal .bootstrap-select.btn-group, -.form-group .bootstrap-select.btn-group { +.form-inline .bootstrap-select, +.form-horizontal .bootstrap-select, +.form-group .bootstrap-select { margin-bottom: 0; } -.form-group-lg .bootstrap-select.btn-group.form-control, -.form-group-sm .bootstrap-select.btn-group.form-control { +.form-group-lg .bootstrap-select.form-control, +.form-group-sm .bootstrap-select.form-control { padding: 0; } -.form-inline .bootstrap-select.btn-group .form-control { +.form-group-lg .bootstrap-select.form-control .dropdown-toggle, +.form-group-sm .bootstrap-select.form-control .dropdown-toggle { + height: 100%; + font-size: inherit; + line-height: inherit; + border-radius: inherit; +} +.bootstrap-select.form-control-sm .dropdown-toggle, +.bootstrap-select.form-control-lg .dropdown-toggle { + font-size: inherit; + line-height: inherit; + border-radius: inherit; +} +.bootstrap-select.form-control-sm .dropdown-toggle { + padding: 0.25rem 0.5rem; +} +.bootstrap-select.form-control-lg .dropdown-toggle { + padding: 0.5rem 1rem; +} +.form-inline .bootstrap-select .form-control { width: 100%; } -.bootstrap-select.btn-group.disabled, -.bootstrap-select.btn-group > .disabled { +.bootstrap-select.disabled, +.bootstrap-select > .disabled { cursor: not-allowed; } -.bootstrap-select.btn-group.disabled:focus, -.bootstrap-select.btn-group > .disabled:focus { +.bootstrap-select.disabled:focus, +.bootstrap-select > .disabled:focus { outline: none !important; } -.bootstrap-select.btn-group.bs-container { +.bootstrap-select.bs-container { position: absolute; + top: 0; + left: 0; + height: 0 !important; + padding: 0 !important; } -.bootstrap-select.btn-group.bs-container .dropdown-menu { +.bootstrap-select.bs-container .dropdown-menu { z-index: 1060; } -.bootstrap-select.btn-group .dropdown-toggle .filter-option { +.bootstrap-select .dropdown-toggle:before { + content: ''; display: inline-block; - overflow: hidden; +} +.bootstrap-select .dropdown-toggle .filter-option { + position: absolute; + top: 0; + left: 0; + padding-top: inherit; + padding-right: inherit; + padding-bottom: inherit; + padding-left: inherit; + height: 100%; width: 100%; text-align: left; } -.bootstrap-select.btn-group .dropdown-toggle .caret { +.bootstrap-select .dropdown-toggle .filter-option-inner { + padding-right: inherit; +} +.bootstrap-select .dropdown-toggle .filter-option-inner-inner { + overflow: hidden; +} +.bootstrap-select .dropdown-toggle .caret { position: absolute; top: 50%; right: 12px; margin-top: -2px; vertical-align: middle; } -.bootstrap-select.btn-group[class*="col-"] .dropdown-toggle { +.input-group .bootstrap-select.form-control .dropdown-toggle { + border-radius: inherit; +} +.bootstrap-select[class*="col-"] .dropdown-toggle { width: 100%; } -.bootstrap-select.btn-group .dropdown-menu { - border-color:#1d1d1d !important; - -webkit-box-shadow: inset 0 1px 1px rgb(0, 0, 0), 0 0 8px rgba(0, 0, 0, 0.6); - box-shadow: inset 0 1px 1px rgb(0, 0, 0), 0 0 8px rgba(0, 0, 0, 0.6); +.bootstrap-select .dropdown-menu { min-width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } -.bootstrap-select.btn-group .dropdown-menu.inner { +.bootstrap-select .dropdown-menu > .inner:focus { + outline: none !important; +} +.bootstrap-select .dropdown-menu.inner { position: static; float: none; border: 0; padding: 0; margin: 0; border-radius: 0; - min-width: 50px; -webkit-box-shadow: none; box-shadow: none; } -.bootstrap-select.btn-group .dropdown-menu li { +.bootstrap-select .dropdown-menu li { position: relative; } -.bootstrap-select.btn-group .dropdown-menu li.active small { - color: #fff; +.bootstrap-select .dropdown-menu li.active small { + color: rgba(255, 255, 255, 0.5) !important; } -.bootstrap-select.btn-group .dropdown-menu li.disabled a { +.bootstrap-select .dropdown-menu li.disabled a { cursor: not-allowed; } -.bootstrap-select.btn-group .dropdown-menu li a { +.bootstrap-select .dropdown-menu li a { cursor: pointer; -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } -.bootstrap-select.btn-group .dropdown-menu li a.opt { +.bootstrap-select .dropdown-menu li a.opt { position: relative; padding-left: 2.25em; } -.bootstrap-select.btn-group .dropdown-menu li a span.check-mark { +.bootstrap-select .dropdown-menu li a span.check-mark { display: none; } -.bootstrap-select.btn-group .dropdown-menu li a span.text { +.bootstrap-select .dropdown-menu li a span.text { display: inline-block; } -.bootstrap-select.btn-group .dropdown-menu li small { +.bootstrap-select .dropdown-menu li small { padding-left: 0.5em; } -.bootstrap-select.btn-group .dropdown-menu .notify { +.bootstrap-select .dropdown-menu .notify { position: absolute; bottom: 5px; width: 96%; @@ -180,33 +262,52 @@ span.form-control { -moz-box-sizing: border-box; box-sizing: border-box; } -.bootstrap-select.btn-group .no-results { +.bootstrap-select .no-results { padding: 3px; background: #f5f5f5; margin: 0 5px; white-space: nowrap; } -.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option { +.bootstrap-select.fit-width .dropdown-toggle .filter-option { position: static; + display: inline; + padding: 0; +} +.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner, +.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner { + display: inline; } -.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret { +.bootstrap-select.fit-width .dropdown-toggle .caret { position: static; top: auto; margin-top: -1px; } -.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark { +.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { position: absolute; display: inline-block; right: 15px; - margin-top: 5px; + top: 5px; } -.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text { +.bootstrap-select.show-tick .dropdown-menu li a span.text { margin-right: 34px; } -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle { +.bootstrap-select .bs-ok-default:after { + content: ''; + display: block; + width: 0.5em; + height: 1em; + border-style: solid; + border-width: 0 0.26em 0.26em 0; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle { z-index: 1061; } -.bootstrap-select.show-menu-arrow .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before { content: ''; border-left: 7px solid transparent; border-right: 7px solid transparent; @@ -216,7 +317,7 @@ span.form-control { left: 9px; display: none; } -.bootstrap-select.show-menu-arrow .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after { content: ''; border-left: 6px solid transparent; border-right: 6px solid transparent; @@ -226,28 +327,30 @@ span.form-control { left: 10px; display: none; } -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before { bottom: auto; - top: -3px; + top: -4px; border-top: 7px solid rgba(204, 204, 204, 0.2); border-bottom: 0; } -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after { bottom: auto; - top: -3px; + top: -4px; border-top: 6px solid white; border-bottom: 0; } -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before { right: 12px; left: auto; } -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after { right: 13px; left: auto; } -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before, -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before, +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after { display: block; } .bs-searchbox, @@ -282,3 +385,14 @@ span.form-control { width: 100%; float: none; } + +/* OPNsense edit to fix https://github.com/opnsense/core/issues/2612 : + * Move checkmarks to left hand side of the dropdown. + */ +.bootstrap-select .dropdown-menu > li > a { + padding: 3px 20px 3px 30px; +} +.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { + left: 10px; +} +/* End OPNsense edit to fix #2612. */ diff --git a/misc/theme-vicuna/Makefile b/misc/theme-vicuna/Makefile index c6ef6b2acd..967d22e13b 100644 --- a/misc/theme-vicuna/Makefile +++ b/misc/theme-vicuna/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= theme-vicuna PLUGIN_VERSION= 1.45 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= The vicuna theme - blue sapphire PLUGIN_MAINTAINER= rene@team-rebellion.net PLUGIN_NO_ABI= yes diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/bootstrap-select-1.13.3.scss b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/bootstrap-select1.scss similarity index 100% rename from misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/bootstrap-select-1.13.3.scss rename to misc/theme-vicuna/src/opnsense/www/themes/vicuna/assets/stylesheets/bootstrap-select1.scss diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/bootstrap-select-1.13.3.css b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/bootstrap-select-1.13.3.css deleted file mode 100644 index d8cfa48d25..0000000000 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/bootstrap-select-1.13.3.css +++ /dev/null @@ -1,398 +0,0 @@ -/*! - * Bootstrap-select v1.13.3 (https://developer.snapappointments.com/bootstrap-select) - * - * Copyright 2012-2018 SnapAppointments, LLC - * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) - */ - -select.bs-select-hidden, -.bootstrap-select > select.bs-select-hidden, -select.selectpicker { - display: none !important; -} -.bootstrap-select { - width: 348px \0; - /*IE9 and below*/ -} -.bootstrap-select > .dropdown-toggle { - position: relative; - width: 100%; - z-index: 1; - text-align: right; - white-space: nowrap; -} -.bootstrap-select > .dropdown-toggle.bs-placeholder, -.bootstrap-select > .dropdown-toggle.bs-placeholder:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder:active { - color: #fff; -} -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active, -.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active { - color: #ffffff; -} -.bootstrap-select > select { - position: absolute !important; - bottom: 0; - left: 50%; - display: block !important; - width: 0.5px !important; - height: 100% !important; - padding: 0 !important; - opacity: 0 !important; - border: none; -} -.bootstrap-select > select.mobile-device { - top: 0; - left: 0; - display: block !important; - width: 100% !important; - z-index: 2; -} -.has-error .bootstrap-select .dropdown-toggle, -.error .bootstrap-select .dropdown-toggle, -.bootstrap-select.is-invalid .dropdown-toggle, -.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle { - border-color: #b94a48; -} -.bootstrap-select.is-valid .dropdown-toggle, -.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle { - border-color: #28a745; -} -.bootstrap-select.fit-width { - width: auto !important; -} -.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { - width: 348px; -} - -.bootstrap-select.form-control { - margin-bottom: 0; - padding: 0; - border: none; -} -:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) { - width: 100%; -} -.bootstrap-select.form-control.input-group-btn { - z-index: auto; -} -.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child) > .btn { - border-radius: 0; -} -.bootstrap-select:not(.input-group-btn), -.bootstrap-select[class*="col-"] { - float: none; - display: inline-block; - margin-left: 0; -} -.bootstrap-select.dropdown-menu-right, -.bootstrap-select[class*="col-"].dropdown-menu-right, -.row .bootstrap-select[class*="col-"].dropdown-menu-right { - float: right; -} -.form-inline .bootstrap-select, -.form-horizontal .bootstrap-select, -.form-group .bootstrap-select { - margin-bottom: 0; -} -.form-group-lg .bootstrap-select.form-control, -.form-group-sm .bootstrap-select.form-control { - padding: 0; -} -.form-group-lg .bootstrap-select.form-control .dropdown-toggle, -.form-group-sm .bootstrap-select.form-control .dropdown-toggle { - height: 100%; - font-size: inherit; - line-height: inherit; - border-radius: inherit; -} -.bootstrap-select.form-control-sm .dropdown-toggle, -.bootstrap-select.form-control-lg .dropdown-toggle { - font-size: inherit; - line-height: inherit; - border-radius: inherit; -} -.bootstrap-select.form-control-sm .dropdown-toggle { - padding: 0.25rem 0.5rem; -} -.bootstrap-select.form-control-lg .dropdown-toggle { - padding: 0.5rem 1rem; -} -.form-inline .bootstrap-select .form-control { - width: 100%; -} -.bootstrap-select.disabled, -.bootstrap-select > .disabled { - cursor: not-allowed; -} -.bootstrap-select.disabled:focus, -.bootstrap-select > .disabled:focus { - outline: none !important; -} -.bootstrap-select.bs-container { - position: absolute; - top: 0; - left: 0; - height: 0 !important; - padding: 0 !important; -} -.bootstrap-select.bs-container .dropdown-menu { - z-index: 1060; -} -.bootstrap-select .dropdown-toggle:before { - content: ''; - display: inline-block; -} -.bootstrap-select .dropdown-toggle .filter-option { - position: absolute; - top: 0; - left: 0; - padding-top: inherit; - padding-right: inherit; - padding-bottom: inherit; - padding-left: inherit; - height: 100%; - width: 100%; - text-align: left; -} -.bootstrap-select .dropdown-toggle .filter-option-inner { - padding-right: inherit; -} -.bootstrap-select .dropdown-toggle .filter-option-inner-inner { - overflow: hidden; -} -.bootstrap-select .dropdown-toggle .caret { - position: absolute; - top: 50%; - right: 12px; - margin-top: -2px; - vertical-align: middle; -} -.input-group .bootstrap-select.form-control .dropdown-toggle { - border-radius: inherit; -} -.bootstrap-select[class*="col-"] .dropdown-toggle { - width: 100%; -} -.bootstrap-select .dropdown-menu { - min-width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bootstrap-select .dropdown-menu > .inner:focus { - outline: none !important; -} -.bootstrap-select .dropdown-menu.inner { - position: static; - float: none; - border: 0; - padding: 0; - margin: 0; - border-radius: 0; - -webkit-box-shadow: none; - box-shadow: none; -} -.bootstrap-select .dropdown-menu li { - position: relative; -} -.bootstrap-select .dropdown-menu li.active small { - color: rgba(255, 255, 255, 0.5) !important; -} -.bootstrap-select .dropdown-menu li.disabled a { - cursor: not-allowed; -} -.bootstrap-select .dropdown-menu li a { - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.bootstrap-select .dropdown-menu li a.opt { - position: relative; - padding-left: 2.25em; -} -.bootstrap-select .dropdown-menu li a span.check-mark { - display: none; -} -.bootstrap-select .dropdown-menu li a span.text { - display: inline-block; -} -.bootstrap-select .dropdown-menu li small { - padding-left: 0.5em; -} -.bootstrap-select .dropdown-menu .notify { - position: absolute; - bottom: 5px; - width: 96%; - margin: 0 2%; - min-height: 26px; - padding: 3px 5px; - background: #f5f5f5; - border: 1px solid #e3e3e3; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - pointer-events: none; - opacity: 0.9; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bootstrap-select .no-results { - padding: 3px; - background: #f5f5f5; - margin: 0 5px; - white-space: nowrap; -} -.bootstrap-select.fit-width .dropdown-toggle .filter-option { - position: static; - display: inline; - padding: 0; -} -.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner, -.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner { - display: inline; -} -.bootstrap-select.fit-width .dropdown-toggle .caret { - position: static; - top: auto; - margin-top: -1px; -} -.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { - position: absolute; - display: inline-block; - right: 15px; - top: 5px; -} -.bootstrap-select.show-tick .dropdown-menu li a span.text { - margin-right: 34px; -} -.bootstrap-select .bs-ok-default:after { - content: ''; - display: block; - width: 0.5em; - height: 1em; - border-style: solid; - border-width: 0 0.26em 0.26em 0; - -webkit-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); -} -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle { - z-index: 1061; -} -.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before { - content: ''; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid rgba(204, 204, 204, 0.2); - position: absolute; - bottom: -4px; - left: 9px; - display: none; -} -.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after { - content: ''; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid white; - position: absolute; - bottom: -4px; - left: 10px; - display: none; -} -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before { - bottom: auto; - top: -4px; - border-top: 7px solid rgba(204, 204, 204, 0.2); - border-bottom: 0; -} -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after { - bottom: auto; - top: -4px; - border-top: 6px solid white; - border-bottom: 0; -} -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before { - right: 12px; - left: auto; -} -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after { - right: 13px; - left: auto; -} -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before, -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after, -.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after { - display: block; -} -.bs-searchbox, -.bs-actionsbox, -.bs-donebutton { - padding: 4px 8px; -} -.bs-actionsbox { - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bs-actionsbox .btn-group button { - width: 50%; -} -.bs-donebutton { - float: left; - width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.bs-donebutton .btn-group button { - width: 100%; -} -.bs-searchbox + .bs-actionsbox { - padding: 0 8px 4px; -} -.bs-searchbox .form-control { - margin-bottom: 0; - width: 100%; - float: none; -} - -/* OPNsense edit to fix https://github.com/opnsense/core/issues/2612 : - * Move checkmarks to left hand side of the dropdown. - */ -.bootstrap-select .dropdown-menu > li > a { - padding: 3px 20px 3px 30px; -} -.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { - left: 10px; -} -/* End OPNsense edit to fix #2612. */ diff --git a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/bootstrap-select.css b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/bootstrap-select.css index 56214371e7..d8cfa48d25 100644 --- a/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/bootstrap-select.css +++ b/misc/theme-vicuna/src/opnsense/www/themes/vicuna/build/css/bootstrap-select.css @@ -1,29 +1,64 @@ /*! - * Bootstrap-select v1.9.3 (http://silviomoreto.github.io/bootstrap-select) + * Bootstrap-select v1.13.3 (https://developer.snapappointments.com/bootstrap-select) * - * Copyright 2013-2015 bootstrap-select - * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) + * Copyright 2012-2018 SnapAppointments, LLC + * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ -/* set form-control on span height, which is used by liHeight to calculate height */ -span.form-control { - height: 34px !important; - padding: 6px 12px; +select.bs-select-hidden, +.bootstrap-select > select.bs-select-hidden, +select.selectpicker { + display: none !important; } .bootstrap-select { width: 348px \0; /*IE9 and below*/ } .bootstrap-select > .dropdown-toggle { + position: relative; width: 100%; - padding-right: 25px; z-index: 1; + text-align: right; + white-space: nowrap; +} +.bootstrap-select > .dropdown-toggle.bs-placeholder, +.bootstrap-select > .dropdown-toggle.bs-placeholder:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder:active { + color: #fff; +} +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active { + color: #ffffff; } .bootstrap-select > select { position: absolute !important; bottom: 0; left: 50%; - width: 0.11px !important; + display: block !important; + width: 0.5px !important; height: 100% !important; padding: 0 !important; opacity: 0 !important; @@ -37,133 +72,180 @@ span.form-control { z-index: 2; } .has-error .bootstrap-select .dropdown-toggle, -.error .bootstrap-select .dropdown-toggle { +.error .bootstrap-select .dropdown-toggle, +.bootstrap-select.is-invalid .dropdown-toggle, +.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle { border-color: #b94a48; } +.bootstrap-select.is-valid .dropdown-toggle, +.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle { + border-color: #28a745; +} .bootstrap-select.fit-width { width: auto !important; } .bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { width: 348px; } -.bootstrap-select .dropdown-toggle:focus { - color:#FFFFFF !important; - outline-offset: -2px; -} + .bootstrap-select.form-control { margin-bottom: 0; padding: 0; border: none; } -.bootstrap-select.form-control:not([class*="col-"]) { +:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) { width: 100%; } .bootstrap-select.form-control.input-group-btn { z-index: auto; } -.bootstrap-select.btn-group:not(.input-group-btn), -.bootstrap-select.btn-group[class*="col-"] { +.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.bootstrap-select:not(.input-group-btn), +.bootstrap-select[class*="col-"] { float: none; display: inline-block; margin-left: 0; } -.bootstrap-select.btn-group.dropdown-menu-right, -.bootstrap-select.btn-group[class*="col-"].dropdown-menu-right, -.row .bootstrap-select.btn-group[class*="col-"].dropdown-menu-right { +.bootstrap-select.dropdown-menu-right, +.bootstrap-select[class*="col-"].dropdown-menu-right, +.row .bootstrap-select[class*="col-"].dropdown-menu-right { float: right; } -.form-inline .bootstrap-select.btn-group, -.form-horizontal .bootstrap-select.btn-group, -.form-group .bootstrap-select.btn-group { +.form-inline .bootstrap-select, +.form-horizontal .bootstrap-select, +.form-group .bootstrap-select { margin-bottom: 0; } -.form-group-lg .bootstrap-select.btn-group.form-control, -.form-group-sm .bootstrap-select.btn-group.form-control { +.form-group-lg .bootstrap-select.form-control, +.form-group-sm .bootstrap-select.form-control { padding: 0; } -.form-inline .bootstrap-select.btn-group .form-control { +.form-group-lg .bootstrap-select.form-control .dropdown-toggle, +.form-group-sm .bootstrap-select.form-control .dropdown-toggle { + height: 100%; + font-size: inherit; + line-height: inherit; + border-radius: inherit; +} +.bootstrap-select.form-control-sm .dropdown-toggle, +.bootstrap-select.form-control-lg .dropdown-toggle { + font-size: inherit; + line-height: inherit; + border-radius: inherit; +} +.bootstrap-select.form-control-sm .dropdown-toggle { + padding: 0.25rem 0.5rem; +} +.bootstrap-select.form-control-lg .dropdown-toggle { + padding: 0.5rem 1rem; +} +.form-inline .bootstrap-select .form-control { width: 100%; } -.bootstrap-select.btn-group.disabled, -.bootstrap-select.btn-group > .disabled { +.bootstrap-select.disabled, +.bootstrap-select > .disabled { cursor: not-allowed; } -.bootstrap-select.btn-group.disabled:focus, -.bootstrap-select.btn-group > .disabled:focus { +.bootstrap-select.disabled:focus, +.bootstrap-select > .disabled:focus { outline: none !important; } -.bootstrap-select.btn-group.bs-container { +.bootstrap-select.bs-container { position: absolute; + top: 0; + left: 0; + height: 0 !important; + padding: 0 !important; } -.bootstrap-select.btn-group.bs-container .dropdown-menu { +.bootstrap-select.bs-container .dropdown-menu { z-index: 1060; } -.bootstrap-select.btn-group .dropdown-toggle .filter-option { +.bootstrap-select .dropdown-toggle:before { + content: ''; display: inline-block; - overflow: hidden; +} +.bootstrap-select .dropdown-toggle .filter-option { + position: absolute; + top: 0; + left: 0; + padding-top: inherit; + padding-right: inherit; + padding-bottom: inherit; + padding-left: inherit; + height: 100%; width: 100%; text-align: left; } -.bootstrap-select.btn-group .dropdown-toggle .caret { +.bootstrap-select .dropdown-toggle .filter-option-inner { + padding-right: inherit; +} +.bootstrap-select .dropdown-toggle .filter-option-inner-inner { + overflow: hidden; +} +.bootstrap-select .dropdown-toggle .caret { position: absolute; top: 50%; right: 12px; margin-top: -2px; vertical-align: middle; } -.bootstrap-select.btn-group[class*="col-"] .dropdown-toggle { +.input-group .bootstrap-select.form-control .dropdown-toggle { + border-radius: inherit; +} +.bootstrap-select[class*="col-"] .dropdown-toggle { width: 100%; } -.bootstrap-select.btn-group .dropdown-menu { - border-color:#1d1d1d !important; - -webkit-box-shadow: inset 0 1px 1px rgb(0, 0, 0), 0 0 8px rgba(0, 0, 0, 0.6); - box-shadow: inset 0 1px 1px rgb(0, 0, 0), 0 0 8px rgba(0, 0, 0, 0.6); +.bootstrap-select .dropdown-menu { min-width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } -.bootstrap-select.btn-group .dropdown-menu.inner { +.bootstrap-select .dropdown-menu > .inner:focus { + outline: none !important; +} +.bootstrap-select .dropdown-menu.inner { position: static; float: none; border: 0; padding: 0; margin: 0; border-radius: 0; - min-width: 50px; -webkit-box-shadow: none; box-shadow: none; } -.bootstrap-select.btn-group .dropdown-menu li { +.bootstrap-select .dropdown-menu li { position: relative; } -.bootstrap-select.btn-group .dropdown-menu li.active small { - color: #fff; +.bootstrap-select .dropdown-menu li.active small { + color: rgba(255, 255, 255, 0.5) !important; } -.bootstrap-select.btn-group .dropdown-menu li.disabled a { +.bootstrap-select .dropdown-menu li.disabled a { cursor: not-allowed; } -.bootstrap-select.btn-group .dropdown-menu li a { +.bootstrap-select .dropdown-menu li a { cursor: pointer; -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } -.bootstrap-select.btn-group .dropdown-menu li a.opt { +.bootstrap-select .dropdown-menu li a.opt { position: relative; padding-left: 2.25em; } -.bootstrap-select.btn-group .dropdown-menu li a span.check-mark { +.bootstrap-select .dropdown-menu li a span.check-mark { display: none; } -.bootstrap-select.btn-group .dropdown-menu li a span.text { +.bootstrap-select .dropdown-menu li a span.text { display: inline-block; } -.bootstrap-select.btn-group .dropdown-menu li small { +.bootstrap-select .dropdown-menu li small { padding-left: 0.5em; } -.bootstrap-select.btn-group .dropdown-menu .notify { +.bootstrap-select .dropdown-menu .notify { position: absolute; bottom: 5px; width: 96%; @@ -180,33 +262,52 @@ span.form-control { -moz-box-sizing: border-box; box-sizing: border-box; } -.bootstrap-select.btn-group .no-results { +.bootstrap-select .no-results { padding: 3px; background: #f5f5f5; margin: 0 5px; white-space: nowrap; } -.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option { +.bootstrap-select.fit-width .dropdown-toggle .filter-option { position: static; + display: inline; + padding: 0; +} +.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner, +.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner { + display: inline; } -.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret { +.bootstrap-select.fit-width .dropdown-toggle .caret { position: static; top: auto; margin-top: -1px; } -.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark { +.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { position: absolute; display: inline-block; right: 15px; - margin-top: 5px; + top: 5px; } -.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text { +.bootstrap-select.show-tick .dropdown-menu li a span.text { margin-right: 34px; } -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle { +.bootstrap-select .bs-ok-default:after { + content: ''; + display: block; + width: 0.5em; + height: 1em; + border-style: solid; + border-width: 0 0.26em 0.26em 0; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle { z-index: 1061; } -.bootstrap-select.show-menu-arrow .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before { content: ''; border-left: 7px solid transparent; border-right: 7px solid transparent; @@ -216,7 +317,7 @@ span.form-control { left: 9px; display: none; } -.bootstrap-select.show-menu-arrow .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after { content: ''; border-left: 6px solid transparent; border-right: 6px solid transparent; @@ -226,28 +327,30 @@ span.form-control { left: 10px; display: none; } -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before { bottom: auto; - top: -3px; + top: -4px; border-top: 7px solid rgba(204, 204, 204, 0.2); border-bottom: 0; } -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after { bottom: auto; - top: -3px; + top: -4px; border-top: 6px solid white; border-bottom: 0; } -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before { right: 12px; left: auto; } -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after { right: 13px; left: auto; } -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before, -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before, +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after { display: block; } .bs-searchbox, @@ -282,3 +385,14 @@ span.form-control { width: 100%; float: none; } + +/* OPNsense edit to fix https://github.com/opnsense/core/issues/2612 : + * Move checkmarks to left hand side of the dropdown. + */ +.bootstrap-select .dropdown-menu > li > a { + padding: 3px 20px 3px 30px; +} +.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { + left: 10px; +} +/* End OPNsense edit to fix #2612. */ From 0ce2b67e52c790bbc81c1a7852d101cf2a3ec4c6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 Sep 2023 19:47:39 +0200 Subject: [PATCH 1585/3088] security/clamav: consistency in spelling PR: https://github.com/opnsense/lang/issues/62 --- .../mvc/app/controllers/OPNsense/ClamAV/forms/general.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/clamav/src/opnsense/mvc/app/controllers/OPNsense/ClamAV/forms/general.xml b/security/clamav/src/opnsense/mvc/app/controllers/OPNsense/ClamAV/forms/general.xml index 0bc9d75bbf..aa7841f34d 100644 --- a/security/clamav/src/opnsense/mvc/app/controllers/OPNsense/ClamAV/forms/general.xml +++ b/security/clamav/src/opnsense/mvc/app/controllers/OPNsense/ClamAV/forms/general.xml @@ -121,7 +121,7 @@ general.scanhtml checkbox - Perform HTML normalisation and decryption of MS Script Encoder code. + Perform HTML normalization and decryption of MS Script Encoder code. general.scanarchive From 9787d508064bc4ab6de70aed1a190beaea606e64 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 26 Sep 2023 20:55:17 +0200 Subject: [PATCH 1586/3088] net/wireguard - offer CARP vhid tracking support, closes https://github.com/opnsense/plugins/issues/3579 When the the selected vhid is in BACKUP or INIT mode, the wireguard interface in question will be set to "down", in which case communication stops and the new master may take over. The advantage of this strategy is that switching is relatively quick as only the interface flag need to be changed. --- net/wireguard/Makefile | 2 +- net/wireguard/pkg-descr | 4 ++ .../src/etc/rc.syshook.d/carp/20-wireguard | 3 + .../forms/dialogEditWireguardServer.xml | 7 +++ .../app/models/OPNsense/Wireguard/Server.xml | 5 ++ .../views/OPNsense/Wireguard/diagnostics.volt | 1 + .../scripts/Wireguard/wg-service-control.php | 58 +++++++++++++++++-- .../src/opnsense/scripts/Wireguard/wg_show.py | 8 +++ 8 files changed, 81 insertions(+), 7 deletions(-) create mode 100755 net/wireguard/src/etc/rc.syshook.d/carp/20-wireguard diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 4092c7e067..4bbfb22475 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 2.1 +PLUGIN_VERSION= 2.2 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 97bd55ffcc..1b9ba24a00 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,10 @@ WWW: https://www.wireguard.com/ Changelog --------- +2.2 + +* add vhid (carp) tracking support + 2.1 * Only reload when interface configuration did not change diff --git a/net/wireguard/src/etc/rc.syshook.d/carp/20-wireguard b/net/wireguard/src/etc/rc.syshook.d/carp/20-wireguard new file mode 100755 index 0000000000..d8337b6bfb --- /dev/null +++ b/net/wireguard/src/etc/rc.syshook.d/carp/20-wireguard @@ -0,0 +1,3 @@ +#!/bin/sh + +configctl -dq wireguard configure \ No newline at end of file diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml index eff1f9504c..04bb1a71bd 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml @@ -59,6 +59,13 @@ true List of addresses to configure on the tunnel adapter. Please use CIDR notation like 10.0.0.1/24. + + server.carp_depend_on + + dropdown + The carp VHID to depend on, when this virtual address is not in master state, + the instance will be shutdown. + server.peers diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml index 1dfada39e1..fe738e8af0 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml @@ -59,6 +59,11 @@ N + + carp + N + mvc + Y - N Choose an Peer.
    diff --git a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt index a8d870f839..1f812c463d 100644 --- a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt +++ b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/diagnostics.volt @@ -1,28 +1,28 @@ {# - # Copyright (c) 2023 Deciso B.V. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without modification, - # are permitted provided that the following conditions are met: - # - # 1. Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # - # 2. Redistributions in binary form must reproduce the above copyright notice, - # this list of conditions and the following disclaimer in the documentation - # and/or other materials provided with the distribution. - # - # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - # POSSIBILITY OF SUCH DAMAGE. - #} + # Copyright (c) 2023 Deciso B.V. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} +
    @@ -93,14 +94,14 @@ {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}}
    -
    - +
    +
    - - + + @@ -118,21 +119,21 @@
    {{ lang._('Enabled') }} {{ lang._('Name') }}{{ lang._('Endpoint Address') }}{{ lang._('Endpoint Port') }}{{ lang._('Endpoint address') }}{{ lang._('Endpoint port') }} {{ lang._('Allowed IPs') }} {{ lang._('ID') }} {{ lang._('Commands') }}
    -
    +
    - +
    - + - + @@ -166,5 +167,5 @@ -{{ partial("layout_partials/base_dialog",['fields':formDialogEditWireguardClient,'id':'dialogEditWireguardClient','label':lang._('Edit Endpoint')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogEditWireguardServer,'id':'dialogEditWireguardServer','label':lang._('Edit Local Configuration')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditWireguardClient,'id':'dialogEditWireguardClient','label':lang._('Edit peer')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditWireguardServer,'id':'dialogEditWireguardServer','label':lang._('Edit instance')])}} diff --git a/net/wireguard/src/www/widgets/widgets/wireguard.widget.php b/net/wireguard/src/www/widgets/widgets/wireguard.widget.php index 04ce75786c..a4927a8139 100644 --- a/net/wireguard/src/www/widgets/widgets/wireguard.widget.php +++ b/net/wireguard/src/www/widgets/widgets/wireguard.widget.php @@ -32,8 +32,8 @@
    {{ lang._('Enabled') }} {{ lang._('Name') }}{{ lang._('Interface') }}{{ lang._('Device') }} {{ lang._('Tunnel Address') }} {{ lang._('Port') }}{{ lang._('Endpoints') }}{{ lang._('Peers') }} {{ lang._('ID') }} {{ lang._('Commands') }}
    - - + + From a076f0fbb0e4378da5a4f50da3b8304148735b13 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 Oct 2023 10:30:04 +0200 Subject: [PATCH 1599/3088] net/wireguard: missed this cleanup --- .../src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml | 2 +- .../src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml index c64e13c25a..2d472d8381 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml @@ -11,7 +11,7 @@ Y - /^([0-9a-zA-Z._\-]){1,64}$/u + /^([0-9a-zA-Z._\-]){1,64}$/u Should be a string between 1 and 64 characters. Allowed characters are alphanumeric characters, dash and underscores. diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml index 2dda2c0efa..3fe0a0153c 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Server.xml @@ -11,7 +11,7 @@ Y - /^([0-9a-zA-Z._\-]){1,64}$/u + /^([0-9a-zA-Z._\-]){1,64}$/u Should be a string between 1 and 64 characters. Allowed characters are alphanumeric characters, dash and underscores. @@ -31,7 +31,7 @@ 9300 - /^([a-fA-F0-9\.:\[\]]*?,)*([a-fA-F0-9\.:\[\]]*)$/ + /^([a-fA-F0-9\.:\[\]]*?,)*([a-fA-F0-9\.:\[\]]*)$/ Please use valid IPv4 or IPv6 addresses. From 6c7fd0cc7b80eacfc7b786c97489d548881617ff Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 Oct 2023 10:31:50 +0200 Subject: [PATCH 1600/3088] net/frr: minor change revision bump --- net/frr/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/frr/Makefile b/net/frr/Makefile index 5282890e65..8cdba41d58 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.36 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr8 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From 1eacc53767e3ec0ac31a68473251f0fc4c7e30f0 Mon Sep 17 00:00:00 2001 From: itNGO <68963439+JSuenram@users.noreply.github.com> Date: Tue, 10 Oct 2023 13:14:36 +0200 Subject: [PATCH 1601/3088] Update multimap.conf (#3611) Reworked, make local whitelist by E-Mail-Adress possible.... --- .../service/templates/OPNsense/Rspamd/multimap.conf | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/multimap.conf b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/multimap.conf index 7875d94872..8926ee13d2 100644 --- a/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/multimap.conf +++ b/mail/rspamd/src/opnsense/service/templates/OPNsense/Rspamd/multimap.conf @@ -9,12 +9,21 @@ extension_blacklist { map = "/${LOCAL_CONFDIR}/local.d/bad_file_extensions.map"; symbol = "FILENAME_BLACKLISTED"; score 1000; -} + } WHITELIST_SENDER_DOMAIN { type = "from"; filter = "email:domain"; map = "/${LOCAL_CONFDIR}/local.d/whitelist_sender_domains.map"; - score = -1000 + score = -1000; } + +local_wl_from { + type = "from"; + map = "$CONFDIR/maps.d/local_wl_from.inc"; + symbol = "LOCAL_WL_FROM"; + description = "Whitelist map for LOCAL_WL_FROM"; + score = -1000; + } + {% endif %} From c00805fd25f0c8b14dfd75d7b38827c50949dbfc Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:17:00 +0300 Subject: [PATCH 1602/3088] www/nginx: add columns select button to the log viewer (#3411) --- www/nginx/src/opnsense/www/css/nginx/logs.css | 19 +++- .../www/js/nginx/dist/logviewer.min.js | 2 +- .../www/js/nginx/src/controller/LogView.js | 97 +++++++++++++--- .../www/js/nginx/src/models/LogColumn.js | 5 + .../js/nginx/src/templates/AccessLogLine.html | 9 -- .../js/nginx/src/templates/ErrorLogLine.html | 5 - .../www/js/nginx/src/templates/LogColumn.html | 6 + .../www/js/nginx/src/templates/LogLine.html | 3 + .../src/templates/StreamAccessLogLine.html | 6 - .../www/js/nginx/src/templates/logviewer.html | 105 +++++------------- 10 files changed, 142 insertions(+), 115 deletions(-) create mode 100644 www/nginx/src/opnsense/www/js/nginx/src/models/LogColumn.js delete mode 100644 www/nginx/src/opnsense/www/js/nginx/src/templates/AccessLogLine.html delete mode 100644 www/nginx/src/opnsense/www/js/nginx/src/templates/ErrorLogLine.html create mode 100644 www/nginx/src/opnsense/www/js/nginx/src/templates/LogColumn.html create mode 100644 www/nginx/src/opnsense/www/js/nginx/src/templates/LogLine.html delete mode 100644 www/nginx/src/opnsense/www/js/nginx/src/templates/StreamAccessLogLine.html diff --git a/www/nginx/src/opnsense/www/css/nginx/logs.css b/www/nginx/src/opnsense/www/css/nginx/logs.css index a5ea942e99..9501c1b0d5 100644 --- a/www/nginx/src/opnsense/www/css/nginx/logs.css +++ b/www/nginx/src/opnsense/www/css/nginx/logs.css @@ -26,7 +26,11 @@ thead.sticky-top th { position: sticky; - top: 80px; + top: 50px; +} + +tr.filter > th { + padding: 10px 10px 10px 10px !important; } thead.sticky-top tr:first-child th { @@ -38,4 +42,17 @@ tfoot.sticky-bottom th { bottom: 50px; font-weight: normal; font-family: inherit; + padding: 10px 10px 10px 10px !important; +} + +td.referer, td.request_line { + word-break: break-all; +} + +.ngx-dropdown-item { + cursor: pointer; + display: block; + margin: 0; + padding: 3px 20px; + white-space: nowrap; } diff --git a/www/nginx/src/opnsense/www/js/nginx/dist/logviewer.min.js b/www/nginx/src/opnsense/www/js/nginx/dist/logviewer.min.js index 57b3898188..9833831fb4 100644 --- a/www/nginx/src/opnsense/www/js/nginx/dist/logviewer.min.js +++ b/www/nginx/src/opnsense/www/js/nginx/dist/logviewer.min.js @@ -1 +1 @@ -!function(e){var t={};function n(i){if(t[i])return t[i].exports;var l=t[i]={i:i,l:!1,exports:{}};return e[i].call(l.exports,l,l.exports,n),l.l=!0,l.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(i,l,function(t){return e[t]}.bind(null,l));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}([function(e,t,n){var i=n(2),l=n(4),a=/[&<>"']/g,o=RegExp(a.source);e.exports=function(e){return(e=l(e))&&o.test(e)?e.replace(a,i):e}},function(e,t,n){var i=n(6).Symbol;e.exports=i},function(e,t,n){var i=n(3)({"&":"&","<":"<",">":">",'"':""","'":"'"});e.exports=i},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var i=n(5);e.exports=function(e){return null==e?"":i(e)}},function(e,t,n){var i=n(1),l=n(9),a=n(10),o=n(11),s=1/0,r=i?i.prototype:void 0,_=r?r.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return l(t,e)+"";if(o(t))return _?_.call(t):"";var n=t+"";return"0"==n&&1/t==-s?"-0":n}},function(e,t,n){var i=n(7),l="object"==typeof self&&self&&self.Object===Object&&self,a=i||l||Function("return this")();e.exports=a},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(8))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e,t){for(var n=-1,i=null==e?0:e.length,l=Array(i);++n\n \n\n'+(null==(__t=_.escape(name))?"":__t)+'\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj)__p+='\n\n '+(null==(__t=_.escape(name))?"":__t)+"\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='\n\n\n\n\n\n\n\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='\n\n\n\n\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='\n\n\n\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj){let count=0;__p+='
    '+(null==(__t=model.escape("time"))?"":__t)+''+(null==(__t=model.escape("remote_ip"))?"":__t)+''+(null==(__t=model.escape("username"))?"":__t)+''+(null==(__t=model.escape("status"))?"":__t)+''+(null==(__t=model.escape("size"))?"":__t)+''+(null==(__t=model.escape("http_referer"))?"":__t)+''+(null==(__t=model.escape("user_agent"))?"":__t)+''+(null==(__t=model.escape("forwarded_for"))?"":__t)+''+(null==(__t=model.escape("request_line"))?"":__t)+"'+(null==(__t=model.escape("time"))?"":__t)+''+(null==(__t=model.escape("remote_ip"))?"":__t)+''+(null==(__t=model.escape("status"))?"":__t)+''+(null==(__t=model.escape("bytes_sent"))?"":__t)+''+(null==(__t=model.escape("bytes_received"))?"":__t)+''+(null==(__t=model.escape("session_time"))?"":__t)+"'+(null==(__t=model.escape("date"))?"":__t)+''+(null==(__t=model.escape("time"))?"":__t)+''+(null==(__t=model.escape("severity"))?"":__t)+''+(null==(__t=model.escape("number"))?"":__t)+''+(null==(__t=model.escape("message"))?"":__t)+"
    \n \n \n ',"errors"===log_type||"stream_errors"===log_type?(count=5,__p+="\n \n \n \n \n \n "):"accesses"===log_type?(count=9,__p+="\n \n \n \n \n \n \n \n \n \n "):(count=6,__p+="\n \n \n \n \n \n \n "),__p+='\n \n \n ',"errors"===log_type||"stream_errors"===log_type?__p+='\n \n \n \n \n \n ':"accesses"===log_type?__p+='\n \n \n \n \n \n \n \n \n \n ':__p+='\n \n \n \n \n \n \n ',__p+='\n \n \n \n \n \n \n \n \n \n \n \n \n
    DateTimeSeverityNumberMessageTimeRemote IPUsernameStatusSizeRefererUser AgentForwarded ForRequest LineTimeRemote IPStatusBytes SentBytes ReceivedSession Time
    \n \n \n \n \n \n \n Page 1/0\n \n \n \n \n \n Found lines: 0/0
    \n'}return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='
    \n No data available...\n
    \n';return __p}},,,,function(e,t,n){"use strict";n.r(t);var i=Backbone.Model.extend({});var l=Backbone.Collection.extend({model:i,url:function(){return`/api/nginx/logs/${this.logType}`},initialize:function(e){this.logType=e.logType}}),a=Backbone.Model.extend({});var o=Backbone.Collection.extend({model:a,url:function(){return`/api/nginx/logs/${this.logType}/${this.uuid}`},initialize:function(e){this.logType=e.logType,this.uuid=e.uuid}}),s=n(16),r=n.n(s);var _=Backbone.View.extend({tagName:"li",events:{"click .mainentry":"mainMenuClick","click .menuEntry":"menuEntryClick","click .dropdown-toggle":"menuDropdownClick"},initialize:function(e){this.listenTo(this.collection,"update",this.render),this.logType=e.logType,this.logview=e.logview,this.render()},render:function(){this.$el.html(""),this.renderCollection()},renderCollection:function(){this.$el.addClass("dropdown"),"global"==this.model.get("id")&&(this.$el.addClass("active"),this.logview.get_log("errors","global",-1)),this.$el.html(""),this.$el.append(r()({model:this.collection,id:this.model.get("id"),name:this.model.has("server_name")?this.model.get("server_name"):"Port "+this.model.get("port")}))},mainMenuClick:function(){this.collection.models[0]&&(this.handleElementClick(this.model.get("id"),-1),$(`#tab_${this.model.get("id")} li`).removeClass("active"),$(`#subtab_item_${this.model.get("id")}_${this.collection.models[0].get("number")}`).parent().addClass("active"))},menuDropdownClick:function(e){this.collection.fetch()},menuEntryClick:function(e){this.handleElementClick(e.target.dataset.modelUuid,e.target.dataset.modelFileno)},handleElementClick:function(e,t){this.logview.get_log(this.logType,e,t)}}),c=n(17),u=n.n(c);Backbone.View.extend({tagName:"li",initialize:function(e){this.logview=e.logview,this.log_name=e.log_name,this.visible_name=e.visible_name,this.log_type=e.log_type},events:{"click .mainentry":"handleElementClick"},log_name:null,log_type:null,visible_name:null,render:function(){this.$el.html(u()({name:this.visible_name}))},handleElementClick:function(){this.logview.get_log(this.log_type,this.log_name)}});var p=Backbone.View.extend({tagName:"ul",className:"nav nav-tabs",initialize:function(e){this.listenTo(this.collection,"update",this.render),this.logview=e.logview,this.logType=e.logType},render:function(){this.$el.attr("role","tablist"),this.$el.html(""),"global"==this.logType?this.render_global_error_tab():this.collection.forEach(e=>this.render_one_server(e))},render_one_server:function(e){const t=new o({uuid:e.get("id"),logType:this.logType}),n=new _({collection:t,model:e,logType:this.logType,logview:this.logview});this.$el.append(n.$el)},render_global_error_tab:function(){const e=new o({uuid:"global",logType:"errors"}),t=new _({collection:e,model:new Backbone.Model({server_name:"Global Error Log",id:"global"}),logType:"errors",logview:this.logview});this.$el.append(t.$el),e.fetch()}}),d=n(18),h=n.n(d),m=n(19),g=n.n(m),b=n(20),f=n.n(b),v=n(21),y=n.n(v);var w=Backbone.Model.extend({});var x=Backbone.Collection.extend({model:w,url:function(){return`/api/nginx/logs/${this.logType}/${this.uuid}/${this.fileNo}/${this.page}/${this.pageSize}/${this.create_filter()}`},initialize:function(){this.logType="none",this.uuid="none",this.fileNo=-1,this.page=0,this.pageSize=0,this.filter_model=new Backbone.Model},parse:function(e){return"error"in e?[]:(this.page_count=e.pages,this.total_entries=e.total,this.displayed_entries=e.found,e.lines)},create_filter:function(){return encodeURIComponent(JSON.stringify(this.filter_model))}}),k=n(22),j=n.n(k);const T=Backbone.View.extend({tagName:"tr",initialize:function(e){this.type=e.type},render:function(){this.$el.html(this.get_template()({model:this.model}))},get_template:function(){return"accesses"===this.type?h.a:"stream_accesses"===this.type?g.a:f.a}});const C=new(Backbone.View.extend({tagName:"div",className:"content-box tab-content",events:{"keyup .filter input":"update_filter","click #paging_first":"page_first","click #paging_back":"page_back","click #refresh":"update","click #paging_forward":"page_forward","click #paging_last":"page_last","change #entrycount":"change_entry_count"},page_entry_count:100,filter_delay:-1,initialize:function(){this.collection=new x,this.listenTo(this.collection,"sync",this.render),this.listenTo(this.collection,"update",this.render),this.listenTo(this.collection.filter_model,"change",this.render),this.type=""},render:function(){let e=this.$("tbody");e.length<1?0!==this.collection.length?(this.$el.html(y()({log_type:this.type,model:this.collection.filter_model})),e=this.$("tbody")):this.$el.html(j.a):e.html(""),0!==this.collection.length&&null==this.current_filtered_collection&&this.collection.forEach(t=>this.render_one(e,t)),this.$("#entrycountdisplay").html(this.page_entry_count),this.$("#currentpage").html(this.current_page+1),this.$("#pagecount").html(this.collection.page_count),this.$("#totalcount").html(this.collection.total_entries),this.$("#resultcount").html(this.collection.displayed_entries),this.current_page>=this.collection.page_count-1?(this.$("#paging_last").addClass("disabled"),this.$("#paging_forward").addClass("disabled")):(this.$("#paging_last").removeClass("disabled"),this.$("#paging_forward").removeClass("disabled")),this.current_page<=0?(this.$("#paging_back").addClass("disabled"),this.$("#paging_first").addClass("disabled")):(this.$("#paging_back").removeClass("disabled"),this.$("#paging_first").removeClass("disabled"))},render_one:function(e,t){const n=new T({type:this.type,model:t});n.render(),e.append(n.$el)},get_log:function(e,t,n){this.collection.uuid=t,this.collection.logType=e,this.collection.fileNo=n,this.type=e,this.current_page=0,this.$el.html(""),this.collection.filter_model.clear(),this.update()},update:function(){this.collection.page=this.current_page,this.collection.pageSize=this.page_entry_count,this.collection.fetch()},update_filter:function(e){clearTimeout(this.filter_delay);const t=e.target;this.collection.filter_model.set(t.name,$(t).val()),this.current_page=0,this.filter_delay=setTimeout(function(e){e.update()},500,this)},page_first:function(){this.current_page=0,this.update()},page_back:function(){this.current_page>0&&(this.current_page--,this.update())},page_forward:function(){this.current_page"']/g,a=RegExp(o.source);e.exports=function(e){return(e=l(e))&&a.test(e)?e.replace(o,n):e}},function(e,t,i){var n=i(6).Symbol;e.exports=n},function(e,t,i){var n=i(3)({"&":"&","<":"<",">":">",'"':""","'":"'"});e.exports=n},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,i){var n=i(5);e.exports=function(e){return null==e?"":n(e)}},function(e,t,i){var n=i(1),l=i(9),o=i(10),a=i(11),s=1/0,r=n?n.prototype:void 0,c=r?r.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return l(t,e)+"";if(a(t))return c?c.call(t):"";var i=t+"";return"0"==i&&1/t==-s?"-0":i}},function(e,t,i){var n=i(7),l="object"==typeof self&&self&&self.Object===Object&&self,o=n||l||Function("return this")();e.exports=o},function(e,t,i){(function(t){var i="object"==typeof t&&t&&t.Object===Object&&t;e.exports=i}).call(this,i(8))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t){e.exports=function(e,t){for(var i=-1,n=null==e?0:e.length,l=Array(n);++i\n \n\n'+(null==(__t=_.escape(name))?"":__t)+'\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj)__p+='\n\n '+(null==(__t=_.escape(name))?"":__t)+"\n\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj)log_fields_visible.forEach(e=>{__p+='\n'+(null==(__t=model.escape(e.id))?"":__t)+"\n"}),__p+="\n";return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='\n
    \n \n \n
    \n\n';return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,"")}with(obj)__p+='\n \n \n \n \n \n \n \n \n \n
    \n
    \n \n
    \n \n \n \n \n \n Page 1/0\n
    \n \n \n \n
    \n Found lines: 0/0\n
    \n';return __p}},function(module,exports,__webpack_require__){var _={escape:__webpack_require__(0)};module.exports=function(obj){obj||(obj={});var __t,__p="";with(obj)__p+='
    \n No data available...\n
    \n';return __p}},,,,function(e,t,i){"use strict";i.r(t);var n=Backbone.Model.extend({});var l=Backbone.Collection.extend({model:n,url:function(){return`/api/nginx/logs/${this.logType}`},initialize:function(e){this.logType=e.logType}}),o=Backbone.Model.extend({});var a=Backbone.Collection.extend({model:o,url:function(){return`/api/nginx/logs/${this.logType}/${this.uuid}`},initialize:function(e){this.logType=e.logType,this.uuid=e.uuid}}),s=i(16),r=i.n(s);var c=Backbone.View.extend({tagName:"li",events:{"click .mainentry":"mainMenuClick","click .menuEntry":"menuEntryClick","click .dropdown-toggle":"menuDropdownClick"},initialize:function(e){this.listenTo(this.collection,"update",this.render),this.logType=e.logType,this.logview=e.logview,this.render()},render:function(){this.$el.html(""),this.renderCollection()},renderCollection:function(){this.$el.addClass("dropdown"),"global"==this.model.get("id")&&(this.$el.addClass("active"),this.logview.get_log("errors","global",-1)),this.$el.html(""),this.$el.append(r()({model:this.collection,id:this.model.get("id"),name:this.model.has("server_name")?this.model.get("server_name"):"Port "+this.model.get("port")}))},mainMenuClick:function(){this.collection.models[0]&&(this.handleElementClick(this.model.get("id"),-1),$(`#tab_${this.model.get("id")} li`).removeClass("active"),$(`#subtab_item_${this.model.get("id")}_${this.collection.models[0].get("number")}`).parent().addClass("active"))},menuDropdownClick:function(e){this.collection.fetch()},menuEntryClick:function(e){this.handleElementClick(e.target.dataset.modelUuid,e.target.dataset.modelFileno)},handleElementClick:function(e,t){this.logview.get_log(this.logType,e,t)}}),d=i(17),u=i.n(d);Backbone.View.extend({tagName:"li",initialize:function(e){this.logview=e.logview,this.log_name=e.log_name,this.visible_name=e.visible_name,this.log_type=e.log_type},events:{"click .mainentry":"handleElementClick"},log_name:null,log_type:null,visible_name:null,render:function(){this.$el.html(u()({name:this.visible_name}))},handleElementClick:function(){this.logview.get_log(this.log_type,this.log_name)}});var p=Backbone.View.extend({tagName:"ul",className:"nav nav-tabs",initialize:function(e){this.listenTo(this.collection,"update",this.render),this.logview=e.logview,this.logType=e.logType},render:function(){this.$el.attr("role","tablist"),this.$el.html(""),"global"==this.logType?this.render_global_error_tab():this.collection.forEach(e=>this.render_one_server(e))},render_one_server:function(e){const t=new a({uuid:e.get("id"),logType:this.logType}),i=new c({collection:t,model:e,logType:this.logType,logview:this.logview});this.$el.append(i.$el)},render_global_error_tab:function(){const e=new a({uuid:"global",logType:"errors"}),t=new c({collection:e,model:new Backbone.Model({server_name:"Global Error Log",id:"global"}),logType:"errors",logview:this.logview});this.$el.append(t.$el),e.fetch()}}),h=i(18),g=i.n(h),b=i(19),f=i.n(b),m=i(20),v=i.n(m);var y=Backbone.Model.extend({});var w=Backbone.Collection.extend({model:y,url:function(){return`/api/nginx/logs/${this.logType}/${this.uuid}/${this.fileNo}/${this.page}/${this.pageSize}/${this.create_filter()}`},initialize:function(){this.logType="none",this.uuid="none",this.fileNo=-1,this.page=0,this.pageSize=0,this.filter_model=new Backbone.Model},parse:function(e){return"error"in e?[]:(this.page_count=e.pages,this.total_entries=e.total,this.displayed_entries=e.found,e.lines)},create_filter:function(){return encodeURIComponent(JSON.stringify(this.filter_model))}});Backbone.Model.extend({});var k=i(21),x=i.n(k);const j=Backbone.View.extend({tagName:"tr",initialize:function(e){this.type=e.type,this.log_fields_visible=e.log_fields_visible},render:function(){this.$el.html(g()({log_fields_visible:this.log_fields_visible,model:this.model}))}}),T=Backbone.View.extend({tagName:"tr",className:"filter",initialize:function(e){this.log_fields_visible=e.log_fields_visible},render:function(){this.log_fields_visible.forEach(e=>this.$el.append(f()({field:e,model:this.model})))}});const C=new(Backbone.View.extend({tagName:"div",className:"content-box tab-content",events:{"keyup .filter input":"update_filter","click #paging_first":"page_first","click #paging_back":"page_back","click #refresh":"update","click #paging_forward":"page_forward","click #paging_last":"page_last","change #entrycount":"change_entry_count","click .ngx-dropdown-item":"toggle_column"},page_entry_count:100,filter_delay:-1,initialize:function(){this.collection=new w,this.listenTo(this.collection,"sync",this.render),this.listenTo(this.collection,"update",this.render),this.listenTo(this.collection.filter_model,"change",this.render),this.type=""},render:function(){this.logFields=[];let e=this.collection.uuid,t=this.type;switch(t){case"accesses":this.logFields.push({id:"time",header:"Time"},{id:"remote_ip",header:"Remote IP"},{id:"username",header:"Username"},{id:"status",header:"Status"},{id:"size",header:"Size"},{id:"referer",header:"Referer"},{id:"user_agent",header:"User Agent"},{id:"forwarded_for",header:"Forwarded For"},{id:"request_line",header:"Request Line"});break;case"errors":case"stream_errors":this.logFields.push({id:"date",header:"Date"},{id:"time",header:"Time"},{id:"severity",header:"Severity"},{id:"number",header:"Number"},{id:"message",header:"Message"});break;default:this.logFields.push({id:"time",header:"Time"},{id:"remote_ip",header:"Remote IP"},{id:"status",header:"Status"},{id:"bytes_sent",header:"Bytes Sent"},{id:"bytes_received",header:"Bytes Rcvd"},{id:"session_time",header:"Session Time"})}this.logFields.forEach(i=>{i.visible="false"!==localStorage.getItem("visibleColumns["+t+"]["+e+"]["+i.id+"]")}),this.logFieldsVisible=_.filter(this.logFields,["visible",!0]);let i=this.$("thead");if(i.children().length<1){const e=new T({log_fields_visible:this.logFieldsVisible,model:this.collection.filter_model});e.render(),i.html(e.$el)}let n=this.$("tbody");n.length<1?0!==this.collection.length?(this.$el.html(v()({log_type:this.type,log_fields:this.logFields,log_fields_visible:this.logFieldsVisible,model:this.collection.filter_model})),n=this.$("tbody")):this.$el.html(x.a):n.html(""),0!==this.collection.length&&null==this.current_filtered_collection&&this.collection.forEach(e=>this.render_one(n,e)),this.$("#entrycountdisplay").html(this.page_entry_count),this.$("#currentpage").html(this.current_page+1),this.$("#pagecount").html(this.collection.page_count),this.$("#totalcount").html(this.collection.total_entries),this.$("#resultcount").html(this.collection.displayed_entries),this.current_page>=this.collection.page_count-1?(this.$("#paging_last").addClass("disabled"),this.$("#paging_forward").addClass("disabled")):(this.$("#paging_last").removeClass("disabled"),this.$("#paging_forward").removeClass("disabled")),this.current_page<=0?(this.$("#paging_back").addClass("disabled"),this.$("#paging_first").addClass("disabled")):(this.$("#paging_back").removeClass("disabled"),this.$("#paging_first").removeClass("disabled"))},render_one:function(e,t){const i=new j({type:this.type,log_fields_visible:this.logFieldsVisible,model:t});i.render(),e.append(i.$el)},get_log:function(e,t,i){this.collection.uuid=t,this.collection.logType=e,this.collection.fileNo=i,this.type=e,this.current_page=0,this.$el.html(""),this.collection.filter_model.clear(),this.update()},update:function(){this.collection.page=this.current_page,this.collection.pageSize=this.page_entry_count,this.collection.fetch()},update_filter:function(e){clearTimeout(this.filter_delay);const t=e.target;this.collection.filter_model.set(t.name,$(t).val()),this.current_page=0,this.filter_delay=setTimeout(function(e){e.update()},500,this)},page_first:function(){this.current_page=0,this.update()},page_back:function(){this.current_page>0&&(this.current_page--,this.update())},page_forward:function(){this.current_page this.$el.append(LogColumn({field: field, model: this.model}))); + } }); const LogView = Backbone.View.extend({ @@ -39,6 +41,7 @@ const LogView = Backbone.View.extend({ "click #paging_forward": "page_forward", "click #paging_last": "page_last", "change #entrycount": "change_entry_count", + "click .ngx-dropdown-item": "toggle_column", }, page_entry_count: 100, filter_delay: -1, @@ -52,10 +55,60 @@ const LogView = Backbone.View.extend({ }, render: function() { + // set logline fields + // all the fields are visible by default + // users choice is stored in browser localStorage + this.logFields = []; + let uid = this.collection.uuid; + let type = this.type; + switch (type) { + case 'accesses': + this.logFields.push({id: "time", header: "Time"}, + {id: "remote_ip", header: "Remote IP"}, + {id: "username", header: "Username"}, + {id: "status", header: "Status"}, + {id: "size", header: "Size"}, + {id: "referer", header: "Referer"}, + {id: "user_agent", header: "User Agent"}, + {id: "forwarded_for", header: "Forwarded For"}, + {id: "request_line", header: "Request Line"}); + break; + case 'errors': + case 'stream_errors': + this.logFields.push({id: "date", header: "Date"}, + {id: "time", header: "Time"}, + {id: "severity", header: "Severity"}, + {id: "number", header: "Number"}, + {id: "message", header: "Message"}); + break; + default: + // stream access + this.logFields.push({id: "time", header: "Time"}, + {id: "remote_ip", header: "Remote IP"}, + {id: "status", header: "Status"}, + {id: "bytes_sent", header: "Bytes Sent"}, + {id: "bytes_received", header: "Bytes Rcvd"}, + {id: "session_time", header: "Session Time"}); + } + this.logFields.forEach( (field) => { + field.visible = localStorage.getItem('visibleColumns[' + type + '][' + uid + '][' + field.id + ']') !== 'false'; + }); + + this.logFieldsVisible = _.filter(this.logFields, ['visible', true]); + // fields are ready + + // create/update column headers + let thead = this.$('thead'); + if (thead.children().length < 1) { + const logColumns = new LogViewColumns({log_fields_visible: this.logFieldsVisible, model: this.collection.filter_model}); + logColumns.render(); + thead.html(logColumns.$el); + } + let tbody = this.$('tbody'); if (tbody.length < 1) { if (this.collection.length !== 0) { - this.$el.html(logViewer({log_type: this.type, model: this.collection.filter_model})); + this.$el.html(logViewer({log_type: this.type, log_fields: this.logFields, log_fields_visible: this.logFieldsVisible, model: this.collection.filter_model})); tbody = this.$('tbody'); } else { this.$el.html(noDataAvailable); @@ -99,7 +152,7 @@ const LogView = Backbone.View.extend({ }, render_one: function(parent_element, model) { - const logline = new LogViewLine({type: this.type, model: model}); + const logline = new LogViewLine({type: this.type, log_fields_visible: this.logFieldsVisible, model: model}); logline.render(); parent_element.append(logline.$el); }, @@ -161,6 +214,20 @@ const LogView = Backbone.View.extend({ this.page_entry_count = event.target.value; this.current_page = 0; this.update(); + }, + + toggle_column: function (event) { + event.stopPropagation(); + let uid = this.collection.uuid; + let type = this.type; + let field = $(event.currentTarget).find('input').prop('value'); + // toggle visibility + localStorage.setItem('visibleColumns[' + type + '][' + uid + '][' + field + ']', !_.find(this.logFields, { 'id': field }).visible); + // unset filter for this column (if any) so as not to confuse the user + this.collection.filter_model.unset(field, {silent: true}); + // reset table header and update data + this.$('thead').html(''); + this.update(); } }); diff --git a/www/nginx/src/opnsense/www/js/nginx/src/models/LogColumn.js b/www/nginx/src/opnsense/www/js/nginx/src/models/LogColumn.js new file mode 100644 index 0000000000..40e01a1556 --- /dev/null +++ b/www/nginx/src/opnsense/www/js/nginx/src/models/LogColumn.js @@ -0,0 +1,5 @@ + +const LogColumnModel = Backbone.Model.extend({ +}); + +export default LogColumnModel; diff --git a/www/nginx/src/opnsense/www/js/nginx/src/templates/AccessLogLine.html b/www/nginx/src/opnsense/www/js/nginx/src/templates/AccessLogLine.html deleted file mode 100644 index adde3d4d7c..0000000000 --- a/www/nginx/src/opnsense/www/js/nginx/src/templates/AccessLogLine.html +++ /dev/null @@ -1,9 +0,0 @@ -<%= model.escape('time') %> -<%= model.escape('remote_ip') %> -<%= model.escape('username') %> -<%= model.escape('status') %> -<%= model.escape('size') %> -<%= model.escape('http_referer') %> -<%= model.escape('user_agent') %> -<%= model.escape('forwarded_for') %> -<%= model.escape('request_line') %> diff --git a/www/nginx/src/opnsense/www/js/nginx/src/templates/ErrorLogLine.html b/www/nginx/src/opnsense/www/js/nginx/src/templates/ErrorLogLine.html deleted file mode 100644 index ec99b42328..0000000000 --- a/www/nginx/src/opnsense/www/js/nginx/src/templates/ErrorLogLine.html +++ /dev/null @@ -1,5 +0,0 @@ -<%= model.escape('date') %> -<%= model.escape('time') %> -<%= model.escape('severity') %> -<%= model.escape('number') %> -<%= model.escape('message') %> diff --git a/www/nginx/src/opnsense/www/js/nginx/src/templates/LogColumn.html b/www/nginx/src/opnsense/www/js/nginx/src/templates/LogColumn.html new file mode 100644 index 0000000000..92f303ef29 --- /dev/null +++ b/www/nginx/src/opnsense/www/js/nginx/src/templates/LogColumn.html @@ -0,0 +1,6 @@ + +
    + + +
    + diff --git a/www/nginx/src/opnsense/www/js/nginx/src/templates/LogLine.html b/www/nginx/src/opnsense/www/js/nginx/src/templates/LogLine.html new file mode 100644 index 0000000000..b7b7881f41 --- /dev/null +++ b/www/nginx/src/opnsense/www/js/nginx/src/templates/LogLine.html @@ -0,0 +1,3 @@ +<% log_fields_visible.forEach( (field) => { %> +<%= model.escape(field.id) %> +<% }) %> diff --git a/www/nginx/src/opnsense/www/js/nginx/src/templates/StreamAccessLogLine.html b/www/nginx/src/opnsense/www/js/nginx/src/templates/StreamAccessLogLine.html deleted file mode 100644 index 54cfd87895..0000000000 --- a/www/nginx/src/opnsense/www/js/nginx/src/templates/StreamAccessLogLine.html +++ /dev/null @@ -1,6 +0,0 @@ -<%= model.escape('time') %> -<%= model.escape('remote_ip') %> -<%= model.escape('status') %> -<%= model.escape('bytes_sent') %> -<%= model.escape('bytes_received') %> -<%= model.escape('session_time') %> diff --git a/www/nginx/src/opnsense/www/js/nginx/src/templates/logviewer.html b/www/nginx/src/opnsense/www/js/nginx/src/templates/logviewer.html index a92d60c6e1..a1b7e64321 100644 --- a/www/nginx/src/opnsense/www/js/nginx/src/templates/logviewer.html +++ b/www/nginx/src/opnsense/www/js/nginx/src/templates/logviewer.html @@ -1,93 +1,42 @@ -<% let count = 0; %> +
    - - <% if (log_type === 'errors' || log_type === 'stream_errors') { - count = 5; %> - - - - - - <% } else if (log_type === 'accesses') { - count = 9; %> - - - - - - - - - - <% } else { - count = 6; %> - - - - - - - <% } %> - - - <% if (log_type === 'errors' || log_type === 'stream_errors') { %> - - - - - - <% } else if (log_type === 'accesses') { %> - - - - - - - - - - <% } else { %> - - - - - - - <% } %> - - - - -
    DateTimeSeverityNumberMessageTimeRemote IPUsernameStatusSizeRefererUser AgentForwarded ForRequest LineTimeRemote IPStatusBytes SentBytes ReceivedSession Time
    + +
    + +
    + Page 1/0 +
    + + + +
    + Found lines: 0/0
    - Page 1/0 - - - - - - Found lines: 0/0
    From 863411646d36198da46600d96defcf94d737e77f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 Oct 2023 13:56:48 +0200 Subject: [PATCH 1603/3088] mail/rspamd: bump --- mail/rspamd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile index 382a18cf22..64c79a22ad 100644 --- a/mail/rspamd/Makefile +++ b/mail/rspamd/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= rspamd PLUGIN_VERSION= 1.12 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Protect your network from spam PLUGIN_DEPENDS= rspamd PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From fb14a0e04d2f31bee69a33c325a0e96830605f41 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 Oct 2023 13:57:39 +0200 Subject: [PATCH 1604/3088] www/nginx: bump --- www/nginx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index eb1abd76d4..2372c0d764 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= nginx PLUGIN_VERSION= 1.32.1 -PLUGIN_REVISION= 3 +PLUGIN_REVISION= 4 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From 2d900d4c4f40764c74a51ab66f03a782f664bcb3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 10 Oct 2023 14:09:42 +0200 Subject: [PATCH 1605/3088] Framework: allow license override --- Mk/plugins.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 893a96a54d..d00a5f5fc7 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -44,6 +44,7 @@ PLUGIN_SCRIPTS= +PRE_INSTALL +POST_INSTALL \ +PRE_DEINSTALL +POST_DEINSTALL PLUGIN_WWW?= https://opnsense.org/ +PLUGIN_LICENSE?= BSD2CLAUSE PLUGIN_TIER?= 3 PLUGIN_REVISION?= 0 @@ -116,7 +117,7 @@ manifest: check @echo "www: \"${PLUGIN_WWW}\"" @echo "prefix: \"${LOCALBASE}\"" @echo "licenselogic: \"single\"" - @echo "licenses: [ \"BSD2CLAUSE\" ]" + @echo "licenses: [ \"${PLUGIN_LICENSE}\" ]" .if defined(PLUGIN_NO_ABI) @echo "arch: \"${OSABIPREFIX:tl}:*:*\"" @echo "abi: \"${OSABIPREFIX}:*:*\"" From c9f3c7b79205bb9f98fc92e49978ee53753cd27d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 12 Oct 2023 08:27:26 +0200 Subject: [PATCH 1606/3088] misc/theme-cicada: fix faulty dropdown style --- misc/theme-cicada/Makefile | 2 +- .../cicada/assets/stylesheets/main.scss | 1 - .../cicada/build/css/bootstrap-select.css | 269 +++++++++++++----- .../www/themes/cicada/build/css/main.css | 1 - 4 files changed, 194 insertions(+), 79 deletions(-) diff --git a/misc/theme-cicada/Makefile b/misc/theme-cicada/Makefile index 2783100d16..b223882430 100644 --- a/misc/theme-cicada/Makefile +++ b/misc/theme-cicada/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= theme-cicada PLUGIN_VERSION= 1.34 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= The cicada theme - dark grey onyx PLUGIN_MAINTAINER= rene@team-rebellion.net PLUGIN_NO_ABI= yes diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss index 0d42c65b12..5e317a4565 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss @@ -5335,7 +5335,6 @@ tbody.collapse.in { } .dropdown-menu { - position: absolute; top: 100%; left: 0; z-index: 1000; diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select.css index a36cc2eaaf..bbc5c29d9a 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select.css @@ -1,29 +1,66 @@ /*! - * Bootstrap-select v1.9.3 (http://silviomoreto.github.io/bootstrap-select) + * Bootstrap-select v1.13.3 (https://developer.snapappointments.com/bootstrap-select) * - * Copyright 2013-2015 bootstrap-select - * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) + * Copyright 2012-2018 SnapAppointments, LLC + * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ -/* set form-control on span height, which is used by liHeight to calculate height */ -span.form-control { - height: 34px !important; - padding: 6px 12px; +select.bs-select-hidden, +.bootstrap-select > select.bs-select-hidden, +select.selectpicker { + display: none !important; + } .bootstrap-select { width: 348px \0; /*IE9 and below*/ } .bootstrap-select > .dropdown-toggle { + position: relative; width: 100%; - padding-right: 25px; + z-index: 1; + text-align: right; + white-space: nowrap; +} +.bootstrap-select > .dropdown-toggle.bs-placeholder, +.bootstrap-select > .dropdown-toggle.bs-placeholder:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder:active { + color: #ccc; +} +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active, +.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active { + color: rgba(0, 0, 0, 0.5); } .bootstrap-select > select { position: absolute !important; bottom: 0; left: 50%; - width: 0.11px !important; + display: block !important; + width: 0.5px !important; height: 100% !important; padding: 0 !important; opacity: 0 !important; @@ -37,20 +74,24 @@ span.form-control { z-index: 2; } .has-error .bootstrap-select .dropdown-toggle, -.error .bootstrap-select .dropdown-toggle { +.error .bootstrap-select .dropdown-toggle, +.bootstrap-select.is-invalid .dropdown-toggle, +.was-validated .bootstrap-select .selectpicker:invalid + .dropdown-toggle { border-color: #b94a48; } +.bootstrap-select.is-valid .dropdown-toggle, +.was-validated .bootstrap-select .selectpicker:valid + .dropdown-toggle { + border-color: #28a745; +} .bootstrap-select.fit-width { width: auto !important; } .bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { width: 348px; } +.bootstrap-select > select.mobile-device:focus + .dropdown-toggle, .bootstrap-select .dropdown-toggle:focus { - color:#FFFFFF !important; - border:1px solid #ee7822 !important; - -webkit-box-shadow: inset 0 0px 1px rgb(0, 0, 0), 0 0 8px rgba(0, 0, 0, 0.6); - box-shadow: inset 0 0px 1px rgb(0, 0, 0), 0 0 8px rgba(0, 0, 0, 0.6); + outline: thin dotted #bbbbbb !important; outline: 5px auto -webkit-focus-ring-color !important; outline-offset: -2px; } @@ -59,123 +100,167 @@ span.form-control { padding: 0; border: none; } -.bootstrap-select.form-control:not([class*="col-"]) { +:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) { width: 100%; } .bootstrap-select.form-control.input-group-btn { z-index: auto; } -.bootstrap-select.btn-group:not(.input-group-btn), -.bootstrap-select.btn-group[class*="col-"] { +.bootstrap-select.form-control.input-group-btn:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.bootstrap-select:not(.input-group-btn), +.bootstrap-select[class*="col-"] { float: none; display: inline-block; margin-left: 0; } -.bootstrap-select.btn-group.dropdown-menu-right, -.bootstrap-select.btn-group[class*="col-"].dropdown-menu-right, -.row .bootstrap-select.btn-group[class*="col-"].dropdown-menu-right { +.bootstrap-select.dropdown-menu-right, +.bootstrap-select[class*="col-"].dropdown-menu-right, +.row .bootstrap-select[class*="col-"].dropdown-menu-right { float: right; } -.form-inline .bootstrap-select.btn-group, -.form-horizontal .bootstrap-select.btn-group, -.form-group .bootstrap-select.btn-group { +.form-inline .bootstrap-select, +.form-horizontal .bootstrap-select, +.form-group .bootstrap-select { margin-bottom: 0; } -.form-group-lg .bootstrap-select.btn-group.form-control, -.form-group-sm .bootstrap-select.btn-group.form-control { +.form-group-lg .bootstrap-select.form-control, +.form-group-sm .bootstrap-select.form-control { padding: 0; } -.form-inline .bootstrap-select.btn-group .form-control { +.form-group-lg .bootstrap-select.form-control .dropdown-toggle, +.form-group-sm .bootstrap-select.form-control .dropdown-toggle { + height: 100%; + font-size: inherit; + line-height: inherit; + border-radius: inherit; +} +.bootstrap-select.form-control-sm .dropdown-toggle, +.bootstrap-select.form-control-lg .dropdown-toggle { + font-size: inherit; + line-height: inherit; + border-radius: inherit; +} +.bootstrap-select.form-control-sm .dropdown-toggle { + padding: 0.25rem 0.5rem; +} +.bootstrap-select.form-control-lg .dropdown-toggle { + padding: 0.5rem 1rem; +} +.form-inline .bootstrap-select .form-control { width: 100%; } -.bootstrap-select.btn-group.disabled, -.bootstrap-select.btn-group > .disabled { +.bootstrap-select.disabled, +.bootstrap-select > .disabled { cursor: not-allowed; } -.bootstrap-select.btn-group.disabled:focus, -.bootstrap-select.btn-group > .disabled:focus { +.bootstrap-select.disabled:focus, +.bootstrap-select > .disabled:focus { outline: none !important; } -.bootstrap-select.btn-group.bs-container { +.bootstrap-select.bs-container { position: absolute; + top: 0; + left: 0; + height: 0 !important; + padding: 0 !important; } -.bootstrap-select.btn-group.bs-container .dropdown-menu { +.bootstrap-select.bs-container .dropdown-menu { z-index: 1060; } -.bootstrap-select.btn-group .dropdown-toggle .filter-option { +.bootstrap-select .dropdown-toggle:before { + content: ''; display: inline-block; - overflow: hidden; +} +.bootstrap-select .dropdown-toggle .filter-option { + position: absolute; + top: 0; + left: 0; + padding-top: inherit; + padding-right: inherit; + padding-bottom: inherit; + padding-left: inherit; + height: 100%; width: 100%; text-align: left; } -.bootstrap-select.btn-group .dropdown-toggle .caret { +.bootstrap-select .dropdown-toggle .filter-option-inner { + padding-right: inherit; +} +.bootstrap-select .dropdown-toggle .filter-option-inner-inner { + overflow: hidden; +} +.bootstrap-select .dropdown-toggle .caret { position: absolute; top: 50%; right: 12px; margin-top: -2px; vertical-align: middle; } -.bootstrap-select.btn-group[class*="col-"] .dropdown-toggle { +.input-group .bootstrap-select.form-control .dropdown-toggle { + border-radius: inherit; +} +.bootstrap-select[class*="col-"] .dropdown-toggle { width: 100%; } -.bootstrap-select.btn-group .dropdown-menu { - border-color:#1d1d1d !important; - -webkit-box-shadow: inset 0 1px 1px rgb(0, 0, 0), 0 0 8px rgba(0, 0, 0, 0.6); - box-shadow: inset 0 1px 1px rgb(0, 0, 0), 0 0 8px rgba(0, 0, 0, 0.6); +.bootstrap-select .dropdown-menu { min-width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } -.bootstrap-select.btn-group .dropdown-menu.inner { +.bootstrap-select .dropdown-menu > .inner:focus { + outline: none !important; +} +.bootstrap-select .dropdown-menu.inner { position: static; float: none; border: 0; padding: 0; margin: 0; border-radius: 0; - min-width: 50px; -webkit-box-shadow: none; box-shadow: none; } -.bootstrap-select.btn-group .dropdown-menu li { +.bootstrap-select .dropdown-menu li { position: relative; } -.bootstrap-select.btn-group .dropdown-menu li.active small { - color: #fff; +.bootstrap-select .dropdown-menu li.active small { + color: rgba(255, 255, 255, 0.5) !important; } -.bootstrap-select.btn-group .dropdown-menu li.disabled a { +.bootstrap-select .dropdown-menu li.disabled a { cursor: not-allowed; } -.bootstrap-select.btn-group .dropdown-menu li a { +.bootstrap-select .dropdown-menu li a { cursor: pointer; -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } -.bootstrap-select.btn-group .dropdown-menu li a.opt { +.bootstrap-select .dropdown-menu li a.opt { position: relative; padding-left: 2.25em; } -.bootstrap-select.btn-group .dropdown-menu li a span.check-mark { +.bootstrap-select .dropdown-menu li a span.check-mark { display: none; } -.bootstrap-select.btn-group .dropdown-menu li a span.text { +.bootstrap-select .dropdown-menu li a span.text { display: inline-block; } -.bootstrap-select.btn-group .dropdown-menu li small { +.bootstrap-select .dropdown-menu li small { padding-left: 0.5em; } -.bootstrap-select.btn-group .dropdown-menu .notify { +.bootstrap-select .dropdown-menu .notify { position: absolute; bottom: 5px; width: 96%; margin: 0 2%; min-height: 26px; padding: 3px 5px; - background: #f5f5f5; - border: 1px solid #e3e3e3; + background: #151515; + border: 1px solid #232323; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); pointer-events: none; @@ -184,33 +269,52 @@ span.form-control { -moz-box-sizing: border-box; box-sizing: border-box; } -.bootstrap-select.btn-group .no-results { +.bootstrap-select .no-results { padding: 3px; - background: #f5f5f5; + background: #151515; margin: 0 5px; white-space: nowrap; } -.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option { +.bootstrap-select.fit-width .dropdown-toggle .filter-option { position: static; + display: inline; + padding: 0; +} +.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner, +.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner { + display: inline; } -.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret { +.bootstrap-select.fit-width .dropdown-toggle .caret { position: static; top: auto; margin-top: -1px; } -.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark { +.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { position: absolute; display: inline-block; right: 15px; - margin-top: 5px; + top: 5px; } -.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text { +.bootstrap-select.show-tick .dropdown-menu li a span.text { margin-right: 34px; } -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle { +.bootstrap-select .bs-ok-default:after { + content: ''; + display: block; + width: 0.5em; + height: 1em; + border-style: solid; + border-width: 0 0.26em 0.26em 0; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle { z-index: 1061; } -.bootstrap-select.show-menu-arrow .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before { content: ''; border-left: 7px solid transparent; border-right: 7px solid transparent; @@ -220,7 +324,7 @@ span.form-control { left: 9px; display: none; } -.bootstrap-select.show-menu-arrow .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after { content: ''; border-left: 6px solid transparent; border-right: 6px solid transparent; @@ -230,28 +334,30 @@ span.form-control { left: 10px; display: none; } -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before { bottom: auto; - top: -3px; - border-top: 7px solid rgba(204, 204, 204, 0.2); + top: -4px; + border-top: 7px solid rgba(50, 50, 50, 0.2); border-bottom: 0; } -.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after { bottom: auto; - top: -3px; + top: -4px; border-top: 6px solid white; border-bottom: 0; } -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before { +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before { right: 12px; left: auto; } -.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after { right: 13px; left: auto; } -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before, -.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after { +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before, +.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after, +.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after { display: block; } .bs-searchbox, @@ -286,3 +392,14 @@ span.form-control { width: 100%; float: none; } + +/* OPNsense edit to fix https://github.com/opnsense/core/issues/2612 : + * Move checkmarks to left hand side of the dropdown. + */ +.bootstrap-select .dropdown-menu > li > a { + padding: 3px 20px 3px 30px; +} +.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark { + left: 10px; +} +/* End OPNsense edit to fix #2612. */ diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css index 842b9ada4e..81019ce5a8 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css @@ -3164,7 +3164,6 @@ tbody.collapse.in { outline: 0; } .dropdown-menu { - position: absolute; top: 100%; left: 0; z-index: 1000; From 40785d2ec1cfd1512ae64e34e3f81a95c0ef7c69 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 12 Oct 2023 16:20:38 +0200 Subject: [PATCH 1607/3088] plugins: relax shebang requirement --- Mk/plugins.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index d00a5f5fc7..7b96d0ec87 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -304,7 +304,7 @@ lint-desc: check lint-shell: @for FILE in $$(find ${.CURDIR}/src -name "*.sh" -type f); do \ - if [ "$$(head $${FILE} | grep -cx '#!\/bin\/sh')" == "0" ]; then \ + if [ "$$(head $${FILE} | grep -c '^#!\/)" == "0" ]; then \ echo "Missing shebang in $${FILE}"; exit 1; \ fi; \ sh -n $${FILE} || exit 1; \ From 905214458f656c3f59167dc088e9a4f5d985756d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 12 Oct 2023 16:23:59 +0200 Subject: [PATCH 1608/3088] plugins: sorry, typo --- Mk/plugins.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 7b96d0ec87..5fa657dad6 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -304,7 +304,7 @@ lint-desc: check lint-shell: @for FILE in $$(find ${.CURDIR}/src -name "*.sh" -type f); do \ - if [ "$$(head $${FILE} | grep -c '^#!\/)" == "0" ]; then \ + if [ "$$(head $${FILE} | grep -c '^#!\/')" == "0" ]; then \ echo "Missing shebang in $${FILE}"; exit 1; \ fi; \ sh -n $${FILE} || exit 1; \ From 7c6fccdde0bc12d6521e25c64d49978b65113e28 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 12 Oct 2023 19:55:55 +0200 Subject: [PATCH 1609/3088] dns/ddclient - accept response codes between 200 and 300, closes https://github.com/opnsense/plugins/pull/3618 --- dns/ddclient/Makefile | 1 + .../src/opnsense/scripts/ddclient/lib/account/dyndns2.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index ad510c72ae..a8952749ea 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.16 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= ddclient-devel py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py index 34d5feeb37..975c94770b 100755 --- a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py +++ b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py @@ -98,7 +98,7 @@ def execute(self): } req = requests.get(**req_opts) - if req.status_code == 200: + if 200 >= req.status_code < 300: if self.is_verbose: syslog.syslog( syslog.LOG_NOTICE, From b276276aeb94c1d4914208712d133fe311c5d123 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 13 Oct 2023 16:02:07 +0200 Subject: [PATCH 1610/3088] misc/theme-cicada: apparently the other change was the only change... ... needed and the browser cache was playing tricks on me too. --- misc/theme-cicada/Makefile | 2 +- .../src/opnsense/www/themes/cicada/assets/stylesheets/main.scss | 1 + .../src/opnsense/www/themes/cicada/build/css/main.css | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/theme-cicada/Makefile b/misc/theme-cicada/Makefile index b223882430..0f23fe297c 100644 --- a/misc/theme-cicada/Makefile +++ b/misc/theme-cicada/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= theme-cicada PLUGIN_VERSION= 1.34 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= The cicada theme - dark grey onyx PLUGIN_MAINTAINER= rene@team-rebellion.net PLUGIN_NO_ABI= yes diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss index 5e317a4565..0d42c65b12 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/assets/stylesheets/main.scss @@ -5335,6 +5335,7 @@ tbody.collapse.in { } .dropdown-menu { + position: absolute; top: 100%; left: 0; z-index: 1000; diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css index 81019ce5a8..842b9ada4e 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/main.css @@ -3164,6 +3164,7 @@ tbody.collapse.in { outline: 0; } .dropdown-menu { + position: absolute; top: 100%; left: 0; z-index: 1000; From f3695f92d405c338535e9ff14306923474bf3cda Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 Oct 2023 08:21:13 +0200 Subject: [PATCH 1611/3088] net/wireguard: different approach to bootup handling --- net/wireguard/Makefile | 1 + .../src/etc/inc/plugins.inc.d/wireguard.inc | 19 +++++++++++++++++-- .../scripts/Wireguard/wg-service-control.php | 9 +-------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 821184b80d..dbf82fd5da 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.3 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc index a24eb716fa..ed933a375e 100644 --- a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc @@ -122,8 +122,23 @@ function wireguard_devices() function wireguard_prepare($device) { - mwexecf('/sbin/ifconfig wg create name %s', $device); - mwexecf('/sbin/ifconfig %s group wireguard', $device); + foreach ((new OPNsense\Wireguard\Server())->servers->server->iterateItems() as $node) { + if ($device != (string)$node->interface) { + continue; + } + + /* deleting the stat file marks the interface for eventual reconfiguration */ + @unlink((string)$node->statFilename); + + if (!does_interface_exist($device)) { + mwexecf('/sbin/ifconfig wg create name %s', $device); + mwexecf('/sbin/ifconfig %s group wireguard', $device); + } + + return $device; + } + + return null; } function wireguard_configure() diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index e3ab3fc3be..0d58a729be 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -223,14 +223,7 @@ function get_stat_hash($fhandle) wg_start($node, $statHandle, $carp_if_flag); break; case 'configure': - if ( - @md5_file($node->cnfFilename) != get_stat_hash($statHandle)['file'] || - !isset($ifdetails[(string)$node->interface]) || ( - // Interface has been setup, but without configuration - empty($ifdetails[(string)$node->interface]['ipv4']) && - empty($ifdetails[(string)$node->interface]['ipv6']) - ) - ) { + if (@md5_file($node->cnfFilename) != get_stat_hash($statHandle)['file']) { if (get_stat_hash($statHandle)['interface'] != wg_reconfigure_hash($node)) { // Fluent reloading not supported for this instance, make sure the user is informed syslog( From 7992ad2f2b59ba701bcc762fadfa162cf68e56f4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 Oct 2023 08:24:42 +0200 Subject: [PATCH 1612/3088] dns/ddclient: adjust accordingly --- dns/ddclient/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index a2039b1a79..9c56e6f7c1 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -9,6 +9,7 @@ Plugin Changelog 1.16 * Add custom GET/PUT protocols to native backend (contributed by DaCookie4u) +* Consider all 2xx status codes as success in native dyndns2 implementation 1.15 From 228d07711ab5c40c3f5dfad9696d21bcc3818657 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 Oct 2023 08:26:44 +0200 Subject: [PATCH 1613/3088] www/nginx: ready for next release --- www/nginx/Makefile | 3 +-- www/nginx/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 2372c0d764..337fbac2cb 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.32.1 -PLUGIN_REVISION= 4 +PLUGIN_VERSION= 1.32.2 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index e004fd20a5..60d89e3b89 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -10,6 +10,10 @@ WWW: https://nginx.org/ Plugin Changelog ================ +1.32.2 + +* Add columns select button to the log viewer (contributed by kulikov-a) + 1.32.1 * add "Host header port" and "use original Host header" options From ea6550812aeb257d38e276dc7d7b9700e3299adb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 17 Oct 2023 14:33:50 +0200 Subject: [PATCH 1614/3088] sysutils/api-backup: mark obsolete --- README.md | 2 +- sysutils/api-backup/Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 897cb651a8..5cc779f630 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ security/tinc -- Tinc VPN security/tor -- The Onion Router security/wazuh-agent -- Agent for the open source security platform Wazuh sysutils/apcupsd -- APCUPSD - APC UPS daemon -sysutils/api-backup -- Provide the functionality to download the config.xml +sysutils/api-backup -- EoL, core endpoint is /api/core/backup/download (pending removal) sysutils/apuled -- PC Engine APU LED control (development only) sysutils/dmidecode -- Display hardware information on the dashboard sysutils/git-backup -- Track config changes using git diff --git a/sysutils/api-backup/Makefile b/sysutils/api-backup/Makefile index 55131b846f..f4663d3b4b 100644 --- a/sysutils/api-backup/Makefile +++ b/sysutils/api-backup/Makefile @@ -1,6 +1,7 @@ PLUGIN_NAME= api-backup PLUGIN_VERSION= 1.1 -PLUGIN_COMMENT= Provide the functionality to download the config.xml +PLUGIN_OBSOLETE= yes +PLUGIN_COMMENT= EoL, core endpoint is /api/core/backup/download PLUGIN_MAINTAINER= franz.fabian.94@gmail.com .include "../../Mk/plugins.mk" From c45755f6dc2272f21f64102cd8befafc20edb8ad Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 18 Oct 2023 20:01:28 +0200 Subject: [PATCH 1615/3088] net/firewall: hide menu hints from page search --- net/firewall/Makefile | 2 +- .../opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/firewall/Makefile b/net/firewall/Makefile index f92f3329d4..08572205a6 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= firewall PLUGIN_VERSION= 1.4 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= Firewall API supplemental package PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_TIER= 2 diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml index a551652542..2889f9bff0 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml @@ -2,10 +2,10 @@ - + - + From 7ff3c44957f7cf99e204c821e4e7343453bff736 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 20 Oct 2023 10:56:06 +0200 Subject: [PATCH 1616/3088] net/mdns-repeater: note the recent docs change https://github.com/opnsense/docs/commit/2f1b56bc93619acc08d864fe7d86218a9653d2c2 It would be nice to have a constraint for this, but it's probably not worth the work in this case although the validation should be stating this, not the help text and documentation. --- net/mdns-repeater/Makefile | 1 + .../controllers/OPNsense/MDNSRepeater/forms/general.xml | 2 +- .../mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/net/mdns-repeater/Makefile b/net/mdns-repeater/Makefile index a1febb5539..8fc5683f4a 100644 --- a/net/mdns-repeater/Makefile +++ b/net/mdns-repeater/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= mdns-repeater PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Proxy multicast DNS between networks PLUGIN_MAINTAINER= franz.fabian.94@gmail.com PLUGIN_DEPENDS= mdns-repeater diff --git a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml index d7a8bea2ca..7a565757fe 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml @@ -15,6 +15,6 @@ mdnsrepeater.interfaces select_multiple - At least two interfaces must be selected. + At least 2 interfaces must be selected. The maximum number of supported interfaces by the daemon is 5. diff --git a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml index b3affd1764..85015e3d67 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml @@ -4,17 +4,17 @@ mdns-repeater settings - 0 + 0 Y - 0 + 0 Y - lan + lan Y - Y + Y From 0558d48493a477ac4a06d0d9a45deb34ae4a54d6 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 20 Oct 2023 17:57:51 +0200 Subject: [PATCH 1617/3088] net/wireguard - import https://github.com/opnsense/core/commit/c2d07aeef6965a22d4119f815b7afc6bb9d1db09 and https://github.com/opnsense/core/commit/4bef809bd031f0aa3d55963e57a82d988fd2d45a from core --- .../OPNsense/Wireguard/Api/ServiceController.php | 10 +--------- .../opnsense/scripts/Wireguard/wg-service-control.php | 3 ++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServiceController.php b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServiceController.php index 1812f83fbe..eab3998151 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServiceController.php +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ServiceController.php @@ -46,15 +46,6 @@ class ServiceController extends ApiMutableServiceControllerBase protected static $internalServiceEnabled = 'enabled'; protected static $internalServiceName = 'wireguard'; - /** - * hook group interface registration on reconfigure - * @return bool - */ - protected function invokeInterfaceRegistration() - { - return true; - } - /** * @return array */ @@ -66,6 +57,7 @@ public function reconfigureAction() $this->sessionClose(); $backend = new Backend(); + $backend->configdRun('interface invoke registration'); $backend->configdRun('template reload ' . escapeshellarg(static::$internalServiceTemplate)); $backend->configdpRun('wireguard configure'); diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index 0d58a729be..79835fa933 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -29,6 +29,7 @@ require_once('script/load_phalcon.php'); require_once('util.inc'); +require_once('config.inc'); require_once('interfaces.inc'); /** @@ -121,6 +122,7 @@ function wg_start($server, $fhandle, $ifcfgflag = 'up') ftruncate($fhandle, 0); fwrite($fhandle, @md5_file($server->cnfFilename) . "|" . wg_reconfigure_hash($server)); syslog(LOG_NOTICE, "Wireguard interface {$server->name} ({$server->interface}) started"); + interfaces_restart_by_device(false, [(string)$server->interface], false); } /** @@ -263,6 +265,5 @@ function get_stat_hash($fhandle) } } } - mwexecf('/usr/local/etc/rc.routing_configure'); } closelog(); From 3d4c6735adbf3319d8e3950b0490b31c07120ff2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 23 Oct 2023 08:13:47 +0200 Subject: [PATCH 1618/3088] net/upnp: fix a typo PR: https://github.com/opnsense/lang/issues/64 --- net/upnp/src/www/services_upnp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/upnp/src/www/services_upnp.php b/net/upnp/src/www/services_upnp.php index 3a73b5700b..5ca0754f16 100644 --- a/net/upnp/src/www/services_upnp.php +++ b/net/upnp/src/www/services_upnp.php @@ -390,7 +390,7 @@ function miniupnpd_validate_port($port) From 26d96b96c71c3a99b273becec0a6455443b30968 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 23 Oct 2023 17:02:45 +0200 Subject: [PATCH 1619/3088] net/radsecproxy: cleanup service control. os-radsecproxy wasn't used, so we're removing it and hook the required settings in rc.conf.d. To make the grids a bit more usable, make sure to wrap a container arount it. Final change is to hook syslog properly and add a menu item for it. (#3628) --- net/radsecproxy/Makefile | 2 +- .../src/etc/inc/plugins.inc.d/radsecproxy.inc | 36 ++++++------ net/radsecproxy/src/etc/rc.d/os-radsecproxy | 46 ---------------- .../models/OPNsense/RadSecProxy/Menu/Menu.xml | 1 + .../views/OPNsense/RadSecProxy/clients.volt | 54 +++++++++--------- .../views/OPNsense/RadSecProxy/realms.volt | 52 +++++++++--------- .../views/OPNsense/RadSecProxy/rewrites.volt | 50 +++++++++-------- .../views/OPNsense/RadSecProxy/servers.volt | 55 ++++++++++--------- .../app/views/OPNsense/RadSecProxy/tls.volt | 53 +++++++++--------- .../scripts/OPNsense/RadSecProxy/setup.sh | 7 +-- .../conf/actions.d/actions_radsecproxy.conf | 12 +--- .../OPNsense/RadSecProxy/radsecproxy.conf | 2 - .../templates/OPNsense/RadSecProxy/rc.conf.d | 3 +- .../OPNsense/Syslog/local/radsecproxy.conf | 6 ++ 14 files changed, 166 insertions(+), 213 deletions(-) delete mode 100755 net/radsecproxy/src/etc/rc.d/os-radsecproxy create mode 100644 net/radsecproxy/src/opnsense/service/templates/OPNsense/Syslog/local/radsecproxy.conf diff --git a/net/radsecproxy/Makefile b/net/radsecproxy/Makefile index 4d2d3d1cfe..e358659a05 100644 --- a/net/radsecproxy/Makefile +++ b/net/radsecproxy/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= radsecproxy PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= RADIUS proxy provides both RADIUS UDP and TCP/TLS (RadSec) transport PLUGIN_DEPENDS= radsecproxy PLUGIN_MAINTAINER= tobias@boehnert.dev diff --git a/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc b/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc index 19462cfb7e..3b4d464b5b 100644 --- a/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc +++ b/net/radsecproxy/src/etc/inc/plugins.inc.d/radsecproxy.inc @@ -1,6 +1,7 @@ general->enabled == '1') { - return true; - } - - return false; + return (string)(new \OPNsense\RadSecProxy\RadSecProxy())->general->enabled == '1'; } function radsecproxy_syslog() { - $logfacilities = array(); - $logfacilities['radsecproxy'] = array( - 'facility' => array('LOG_DAEMON'), - ); - return $logfacilities; + return [ + 'radsecproxy' => [ + 'facility' => ['radsecproxy'] + ] + ]; } function radsecproxy_services() { - $services = array(); + $services = []; if (radsecproxy_enabled()) { - $services[] = array( + $services[] = [ 'description' => gettext('Radius Secure Proxy'), - 'configd' => array( - 'restart' => array('radsecproxy restart'), - 'start' => array('radsecproxy start'), - 'stop' => array('radsecproxy stop'), - ), + 'configd' => [ + 'restart' => ['radsecproxy restart'], + 'start' => ['radsecproxy start'], + 'stop' => ['radsecproxy stop'], + ], 'name' => 'radsecproxy', - 'pidfile' => '/var/run/radsecproxy.pid' - ); + 'pidfile' => '/var/run/radsecproxy/radsecproxy.pid' + ]; } return $services; } diff --git a/net/radsecproxy/src/etc/rc.d/os-radsecproxy b/net/radsecproxy/src/etc/rc.d/os-radsecproxy deleted file mode 100755 index cb79588f7e..0000000000 --- a/net/radsecproxy/src/etc/rc.d/os-radsecproxy +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -# PROVIDE: radsecproxy -# REQUIRE: LOGIN -# KEYWORD: shutdown - -# Add the following line to /etc/rc.conf.local or /etc/rc.conf -# to enable this service: -# -# radsecproxy_enable (bool): Set to NO by default. -# Set it to YES to enable radsecproxy. - -. /etc/rc.subr - -name="radsecproxy" -rcvar=radsecproxy_enable - -: ${radsecproxy_enable:="NO"} -: ${radsecproxy_user:="root"} -: ${radsecproxy_group:="wheel"} -: ${radsecproxy_pidfile:="/var/run/radsecproxy.pid"} - -user=${radsecproxy_user} -group=${radsecproxy_group} -pidfile=${radsecproxy_pidfile} -required_files=/usr/local/etc/radsecproxy.conf - -command="/usr/local/sbin/${name}" -command_args="-c /usr/local/etc/radsecproxy.conf -i ${pidfile}" - -start_precmd="radsecproxy_prestart" -stop_postcmd="radsecproxy_poststop" - -radsecproxy_prestart() -{ - mkdir -p $(dirname $pidfile) - chown ${user}:${group} $(dirname $pidfile) -} - -radsecproxy_poststop() -{ - rm -f ${pidfile} -} - -load_rc_config $name -run_rc_command "$1" diff --git a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml index 38211fc76c..707b620ca0 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml @@ -7,6 +7,7 @@ + diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt index c03c5d45b1..ea71368b58 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/clients.volt @@ -24,33 +24,35 @@ }); - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    - - -
    +
    + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    -
    - +
    + +
    {{ partial("layout_partials/base_dialog",['fields':formDialogClient,'id':'DialogClient','label':lang._('Edit client')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt index 85453ec79d..9afdea0380 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/realms.volt @@ -23,32 +23,32 @@ }); }); +
    + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Realm') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Realm') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    - - -
    - -
    - +
    + +
    - {{ partial("layout_partials/base_dialog",['fields':formDialogRealm,'id':'DialogRealm','label':lang._('Edit realm')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt index 0da6b6612c..a6283441e6 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/rewrites.volt @@ -24,31 +24,33 @@ }); - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    - - -
    +
    + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Type') }}{{ lang._('Description') }}{{ lang._('Commands') }}
    + + +
    -
    - +
    + +
    {{ partial("layout_partials/base_dialog",['fields':formDialogRewrite,'id':'DialogRewrite','label':lang._('Edit rewrite-rule')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt index b394b1e5ad..86a51c1ffd 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/servers.volt @@ -24,33 +24,34 @@ }); - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Type') }}{{ lang._('TLS-Config') }}{{ lang._('Commands') }}
    - - -
    +
    + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Host') }}{{ lang._('Identifier') }}{{ lang._('Description') }}{{ lang._('Type') }}{{ lang._('TLS-Config') }}{{ lang._('Commands') }}
    + + +
    -
    - +
    + +
    - {{ partial("layout_partials/base_dialog",['fields':formDialogServer,'id':'DialogServer','label':lang._('Edit server')])}} diff --git a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt index cc63e0c747..5aedde0847 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt +++ b/net/radsecproxy/src/opnsense/mvc/app/views/OPNsense/RadSecProxy/tls.volt @@ -24,32 +24,33 @@ }); - - - - - - - - - - - - - - - - - - - -
    {{ lang._('ID') }}{{ lang._('Name') }}{{ lang._('Description') }}{{ lang._('CA-certificate') }}{{ lang._('Proxy-certificate') }}{{ lang._('Commands') }}
    - - -
    +
    + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Name') }}{{ lang._('Description') }}{{ lang._('CA-certificate') }}{{ lang._('Proxy-certificate') }}{{ lang._('Commands') }}
    + + +
    -
    - +
    + +
    - {{ partial("layout_partials/base_dialog",['fields':formDialogTls,'id':'DialogTls','label':lang._('Edit TLS-config')])}} diff --git a/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/setup.sh b/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/setup.sh index cd09c51f98..420c0e62f1 100755 --- a/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/setup.sh +++ b/net/radsecproxy/src/opnsense/scripts/OPNsense/RadSecProxy/setup.sh @@ -1,10 +1,10 @@ #!/bin/sh -RADSECPROXY_DIRS="/usr/local/etc/radsecproxy.d /usr/local/etc/radsecproxy.d/certs" +RADSECPROXY_DIRS="/usr/local/etc/radsecproxy.d/certs" for directory in ${RADSECPROXY_DIRS}; do mkdir -p ${directory} - chown -R www:www ${directory} + chown -R root:wheel ${directory} chmod -R 750 ${directory} done @@ -12,7 +12,4 @@ done # export required certs to filesystem /usr/local/opnsense/scripts/OPNsense/RadSecProxy/generate_certs.php > /dev/null 2>&1 -# remove logfile - sometimes it will stop radsecproxy from starting -#rm /var/log/radsecproxy.log - exit 0 diff --git a/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf b/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf index 79ca190462..6f7d0908f1 100644 --- a/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf +++ b/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf @@ -1,11 +1,5 @@ -[setup] -command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh; -parameters: -type:script -message:setup radsecproxy service requirements - [start] -command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy start; +command:/usr/local/etc/rc.d/radsecproxy start parameters: type:script message:starting radsecproxy @@ -17,13 +11,13 @@ type:script message:stopping radsecproxy [restart] -command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy restart; +command:/usr/local/etc/rc.d/radsecproxy restart; parameters: type:script message:restarting radsecproxy [reload] -command:/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh;/usr/local/etc/rc.d/radsecproxy restart; +command:/usr/local/etc/rc.d/radsecproxy restart; parameters: type:script message:reloading radsecproxy diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf index bdb62ce381..45dcc4c3ab 100644 --- a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/radsecproxy.conf @@ -5,8 +5,6 @@ # GENERAL ########################################### -#PidFile /var/run/radsecproxy.pid -#LogDestination file:///var/log/radsecproxy.log LogDestination x-syslog:///LOG_DAEMON {% if OPNsense.radsecproxy.general.logLevel is defined and OPNsense.radsecproxy.general.logLevel != "" %} diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d index 35042a335c..aa0daa9288 100644 --- a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d @@ -1,7 +1,8 @@ -{% if helpers.exists('OPNsense.radsecproxy.general.enabled') and OPNsense.radsecproxy.general.enabled == '1' %} +{% if not helpers.empty('OPNsense.radsecproxy.general.enabled') %} radsecproxy_enable="YES" {% else %} radsecproxy_enable="NO" {% endif %} radsecproxy_user="root" radsecproxy_group="wheel" +radsecproxy_setup="/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh" diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/Syslog/local/radsecproxy.conf b/net/radsecproxy/src/opnsense/service/templates/OPNsense/Syslog/local/radsecproxy.conf new file mode 100644 index 0000000000..2133f76f55 --- /dev/null +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/Syslog/local/radsecproxy.conf @@ -0,0 +1,6 @@ +################################################################### +# Local syslog-ng configuration filter definition [radsecproxy]. +################################################################### +filter f_local_radsecproxy { + program("radsecproxy"); +}; From cb4cf0cf2d3214554731da1654e72aa86e8ec767 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 24 Oct 2023 12:23:16 +0200 Subject: [PATCH 1620/3088] mail/rspamd: new version --- mail/rspamd/Makefile | 3 +-- mail/rspamd/pkg-descr | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile index 64c79a22ad..b72d9f6058 100644 --- a/mail/rspamd/Makefile +++ b/mail/rspamd/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= rspamd -PLUGIN_VERSION= 1.12 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.13 PLUGIN_COMMENT= Protect your network from spam PLUGIN_DEPENDS= rspamd PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/mail/rspamd/pkg-descr b/mail/rspamd/pkg-descr index 944931b608..80f7d7b76f 100644 --- a/mail/rspamd/pkg-descr +++ b/mail/rspamd/pkg-descr @@ -5,11 +5,14 @@ lua. Plugin Changelog ---------------- +1.13 + +* Make local whitelist by e-mail address possible (contributed by itNGO) + 1.12 * Adjusting the multimap setting to make the multimap whitelist work - 1.11 * Fix Milter Protocol by binding to Unix Sockets From 5a912c4edb062bc92e48d2234c70292c57618da2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 24 Oct 2023 12:24:46 +0200 Subject: [PATCH 1621/3088] net/wireguard: make it a full version --- net/wireguard/Makefile | 3 +-- net/wireguard/pkg-descr | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index dbf82fd5da..b338d74054 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 2.3 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 2.4 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index e9f0c211ff..f9c144085d 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,12 @@ WWW: https://www.wireguard.com/ Changelog --------- +2.4 + +* Only invoke routes for attached WireGuard instances +* Make bootup device creation more robust +* Correct interface group registration + 2.3 * Create WireGuard devices earlier to allow of to pick up NAT rules correctly From e474d4b17b1de9640d605be5a10aa17ab273c7f5 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 24 Oct 2023 12:37:57 +0200 Subject: [PATCH 1622/3088] net/radsecproxy: style scrubbing --- .../app/models/OPNsense/RadSecProxy/Menu/Menu.xml | 14 +++++++------- .../conf/actions.d/actions_radsecproxy.conf | 8 ++++---- .../templates/OPNsense/RadSecProxy/rc.conf.d | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml index 707b620ca0..274409397b 100644 --- a/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml +++ b/net/radsecproxy/src/opnsense/mvc/app/models/OPNsense/RadSecProxy/Menu/Menu.xml @@ -1,13 +1,13 @@ - - - - - - - + + + + + + + diff --git a/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf b/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf index 6f7d0908f1..0d60ddcf77 100644 --- a/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf +++ b/net/radsecproxy/src/opnsense/service/conf/actions.d/actions_radsecproxy.conf @@ -5,25 +5,25 @@ type:script message:starting radsecproxy [stop] -command:/usr/local/etc/rc.d/radsecproxy stop; +command:/usr/local/etc/rc.d/radsecproxy stop parameters: type:script message:stopping radsecproxy [restart] -command:/usr/local/etc/rc.d/radsecproxy restart; +command:/usr/local/etc/rc.d/radsecproxy restart parameters: type:script message:restarting radsecproxy [reload] -command:/usr/local/etc/rc.d/radsecproxy restart; +command:/usr/local/etc/rc.d/radsecproxy restart parameters: type:script message:reloading radsecproxy [status] -command:/usr/local/etc/rc.d/radsecproxy status;exit 0; +command:/usr/local/etc/rc.d/radsecproxy status; exit 0 parameters: type:script_output message:radsecproxy status diff --git a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d index aa0daa9288..7f32bf52ab 100644 --- a/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d +++ b/net/radsecproxy/src/opnsense/service/templates/OPNsense/RadSecProxy/rc.conf.d @@ -1,8 +1,8 @@ {% if not helpers.empty('OPNsense.radsecproxy.general.enabled') %} radsecproxy_enable="YES" -{% else %} -radsecproxy_enable="NO" -{% endif %} radsecproxy_user="root" radsecproxy_group="wheel" radsecproxy_setup="/usr/local/opnsense/scripts/OPNsense/RadSecProxy/setup.sh" +{% else %} +radsecproxy_enable="NO" +{% endif %} From ea205682724c97cd51238458734e4b84ecf11878 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 25 Oct 2023 09:27:34 +0200 Subject: [PATCH 1623/3088] security/intrusion-detection-content-et-open - deprecate version 4 rules (6 should be minimum now) --- security/intrusion-detection-content-et-open/Makefile | 2 +- .../scripts/suricata/metadata/rules/et-open-extra.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/security/intrusion-detection-content-et-open/Makefile b/security/intrusion-detection-content-et-open/Makefile index cb93113e2b..453c803cc9 100644 --- a/security/intrusion-detection-content-et-open/Makefile +++ b/security/intrusion-detection-content-et-open/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= intrusion-detection-content-et-open PLUGIN_VERSION= 1.0.1 -#PLUGIN_REVISION= 1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://rules.emergingthreats.net/ diff --git a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml index af9114aa4f..ae9c0bffc1 100644 --- a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml +++ b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml @@ -1,7 +1,7 @@ - - + + et_open-botcc.portgrouped.rules et_open.botcc.rules From 186ec0713fe49e730372c6e03547e89449baad26 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 25 Oct 2023 14:55:28 +0200 Subject: [PATCH 1624/3088] net/wireguard - startup missing import (bug) --- net/wireguard/Makefile | 1 + .../src/opnsense/scripts/Wireguard/wg-service-control.php | 1 + 2 files changed, 2 insertions(+) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index b338d74054..5454ec51c4 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.4 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index 79835fa933..742119c7f5 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -31,6 +31,7 @@ require_once('util.inc'); require_once('config.inc'); require_once('interfaces.inc'); +require_once('system.inc'); /** * collect carp status per vhid From 19eac172c83b3b4fbda9fa23a03dc3564057a74d Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Thu, 26 Oct 2023 13:49:02 +0200 Subject: [PATCH 1625/3088] wg - fix error when empty tunnel address in instance (#3638) --- .../src/opnsense/scripts/Wireguard/wg-service-control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index 742119c7f5..f66d0a08e3 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -69,7 +69,8 @@ function wg_start($server, $fhandle, $ifcfgflag = 'up') } mwexecf('/usr/bin/wg setconf %s %s', [$server->interface, $server->cnfFilename]); - foreach (explode(',', (string)$server->tunneladdress) as $alias) { + /* The tunneladdress can be empty, so array_filter without callback filters empty strings out. */ + foreach (array_filter(explode(',', (string)$server->tunneladdress)) as $alias) { $proto = strpos($alias, ':') === false ? "inet" : "inet6"; mwexecf('/sbin/ifconfig %s %s %s alias', [$server->interface, $proto, $alias]); } From 354d4348aa7e2cd94bdcba85a15dab0c1f69e0ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= <34602360+opnsenseuser@users.noreply.github.com> Date: Sat, 28 Oct 2023 11:42:08 +0200 Subject: [PATCH 1626/3088] Update bootstrap-select.css (#3642) --- .../opnsense/www/themes/cicada/build/css/bootstrap-select.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select.css b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select.css index bbc5c29d9a..15d668797b 100644 --- a/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select.css +++ b/misc/theme-cicada/src/opnsense/www/themes/cicada/build/css/bootstrap-select.css @@ -91,9 +91,7 @@ select.selectpicker { } .bootstrap-select > select.mobile-device:focus + .dropdown-toggle, .bootstrap-select .dropdown-toggle:focus { - outline: thin dotted #bbbbbb !important; - outline: 5px auto -webkit-focus-ring-color !important; - outline-offset: -2px; + outline: none !important; } .bootstrap-select.form-control { margin-bottom: 0; From 806fb05c1cf5781005c001e6f6444edfcc0bdb8f Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 30 Oct 2023 18:47:12 +0100 Subject: [PATCH 1627/3088] net/wireguard: Some improvements in carp event handing for https://github.com/opnsense/plugins/issues/3579 This commit addresses a couple of possible issues. 1. When a sequence of carp events is being processed and these processes lock eachother, its possible that collected interface state via legacy_interfaces_details() doesn't match the active one anymore. To prevent this from happening, only fetch the wireguard interface we're interested in inside the lock. 2. To limit the number of events being handled in wg-service-control.php it's likely cleaner to push the vhid as well when we're handling carp events. This means that we should switch between server id (current parameter) and vhid by looking at its format. 3. In case the target (wg) interface doesn't exist, make sure to create it. Although in practice this shouldn't happen (as the stat file is being removed on boot), dropping an interface manually should preferably lead to a funcitonal setup anyway (otherwise it will crash trying to pull it up) 4. When a vhid is passed and affects the interface in question, log relevant information to syslog. --- net/wireguard/Makefile | 2 +- .../src/etc/rc.syshook.d/carp/20-wireguard | 2 +- .../scripts/Wireguard/wg-service-control.php | 63 +++++++++++++------ .../conf/actions.d/actions_wireguard.conf | 4 +- 4 files changed, 49 insertions(+), 22 deletions(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 5454ec51c4..a7ffd83b3c 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.4 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/src/etc/rc.syshook.d/carp/20-wireguard b/net/wireguard/src/etc/rc.syshook.d/carp/20-wireguard index 8c69f6f959..5e5e42d67f 100755 --- a/net/wireguard/src/etc/rc.syshook.d/carp/20-wireguard +++ b/net/wireguard/src/etc/rc.syshook.d/carp/20-wireguard @@ -1,3 +1,3 @@ #!/bin/sh -configctl -dq wireguard configure +configctl -dq wireguard configure $1 diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index f66d0a08e3..2ac781a968 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -49,7 +49,7 @@ function get_vhid_status() if (!empty($ifdata['carp'])) { foreach ($ifdata['carp'] as $data) { if (isset($uuids[$data['vhid']])) { - $vhids[$uuids[$data['vhid']]] = $data['status']; + $vhids[$uuids[$data['vhid']]] = ['status' => $data['status'], 'vhid' => $data['vhid']]; } } } @@ -123,7 +123,7 @@ function wg_start($server, $fhandle, $ifcfgflag = 'up') fseek($fhandle, 0); ftruncate($fhandle, 0); fwrite($fhandle, @md5_file($server->cnfFilename) . "|" . wg_reconfigure_hash($server)); - syslog(LOG_NOTICE, "Wireguard interface {$server->name} ({$server->interface}) started"); + syslog(LOG_NOTICE, "wireguard instance {$server->name} ({$server->interface}) started"); interfaces_restart_by_device(false, [(string)$server->interface], false); } @@ -135,7 +135,7 @@ function wg_stop($server) if (does_interface_exist($server->interface)) { legacy_interface_destroy($server->interface); } - syslog(LOG_NOTICE, "Wireguard interface {$server->name} ({$server->interface}) stopped"); + syslog(LOG_NOTICE, "wireguard instance {$server->name} ({$server->interface}) stopped"); } @@ -182,21 +182,29 @@ function get_stat_hash($fhandle) openlog("wireguard", LOG_ODELAY, LOG_AUTH); if (isset($opts['h']) || empty($args) || !in_array($args[0], ['start', 'stop', 'restart', 'configure'])) { - echo "Usage: wg-service-control.php [-a] [-h] [stop|start|restart|configure] [uuid]\n\n"; + echo "Usage: wg-service-control.php [-a] [-h] [stop|start|restart|configure] [uuid|vhid]\n\n"; echo "\t-a all instances\n"; } elseif (isset($opts['a']) || !empty($args[1])) { - $server_id = $args[1] ?? null; + // either a server id (uuid) or a vhid could be offered + $server_id = $vhid = null; + if (preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/', $args[1] ?? '') == 1) { + $server_id = $args[1]; + } elseif (!empty($args[1])) { + $vhid = explode('@', $args[1])[0]; + } + $action = $args[0]; $server_devs = []; if (!empty((string)(new OPNsense\Wireguard\General())->enabled)) { - $ifdetails = legacy_interfaces_details(); $vhids = get_vhid_status(); foreach ((new OPNsense\Wireguard\Server())->servers->server->iterateItems() as $key => $node) { + $carp_depend_on = (string)$node->carp_depend_on; if (empty((string)$node->enabled)) { continue; - } - if ($server_id != null && $key != $server_id) { + } elseif ($server_id != null && $key != $server_id) { + continue; + } elseif ($vhid != null && (!empty($vhids[$carp_depend_on]) && $vhids[$carp_depend_on]['vhid'] != $vhid)) { continue; } /** @@ -206,15 +214,13 @@ function get_stat_hash($fhandle) * when in BACKUP or INIT mode. */ $carp_if_flag = 'up'; - if ( - !empty($vhids[(string)$node->carp_depend_on]) && - $vhids[(string)$node->carp_depend_on] != 'MASTER' - ) { + if (!empty($vhids[$carp_depend_on]) && $vhids[$carp_depend_on]['status'] != 'MASTER') { $carp_if_flag = 'down'; } $server_devs[] = (string)$node->interface; $statHandle = fopen($node->statFilename, "a+"); if (flock($statHandle, LOCK_EX)) { + $ifdetails = legacy_interfaces_details((string)$node->interface); switch ($action) { case 'stop': wg_stop($node); @@ -227,12 +233,34 @@ function get_stat_hash($fhandle) wg_start($node, $statHandle, $carp_if_flag); break; case 'configure': - if (@md5_file($node->cnfFilename) != get_stat_hash($statHandle)['file']) { + $ifstatus = '-'; + if (!empty($ifdetails[(string)$node->interface])) { + $ifstatus = in_array('up', $ifdetails[(string)$node->interface]['flags']) ? 'up' : 'down'; + } + + if (!empty($carp_depend_on) && !empty($vhid)) { + // CARP event traceability when a vhid is being passed + syslog( + LOG_NOTICE, + sprintf( + "Wireguard configure event instance %s (%s) vhid: %s carp: %s interface: %s", + $node->name, + $node->interface, + $vhid, + !empty($vhids[$carp_depend_on]) ? $vhids[$carp_depend_on]['status'] : '-', + $ifstatus + ) + ); + } + if ( + @md5_file($node->cnfFilename) != get_stat_hash($statHandle)['file'] || + empty($ifdetails[(string)$node->interface]) + ) { if (get_stat_hash($statHandle)['interface'] != wg_reconfigure_hash($node)) { // Fluent reloading not supported for this instance, make sure the user is informed syslog( LOG_NOTICE, - "Wireguard interface {$node->name} ({$node->interface}) " . + "wireguard instance {$node->name} ({$node->interface}) " . "can not reconfigure without stopping it first." ); wg_stop($node); @@ -240,8 +268,7 @@ function get_stat_hash($fhandle) wg_start($node, $statHandle, $carp_if_flag); } else { // when triggered via a CARP event, check our interface status [UP|DOWN] - $tmp = in_array('up', $ifdetails[(string)$node->interface]['flags']) ? 'up' : 'down'; - if ($tmp != $carp_if_flag) { + if ($ifstatus != $carp_if_flag) { mwexecf('/sbin/ifconfig %s %s', [$node->interface, $carp_if_flag]); } } @@ -254,9 +281,9 @@ function get_stat_hash($fhandle) } /** - * When -a is specified, cleaup up old or disabled instances (files and interfaces) + * When -a is specified, cleanup up old or disabled instances (files and interfaces) */ - if ($server_id == null) { + if ($server_id == null && $vhid == null) { foreach (glob('/usr/local/etc/wireguard/wg*') as $filename) { $this_dev = explode('.', basename($filename))[0]; if (!in_array($this_dev, $server_devs)) { diff --git a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf index 44c925e865..555afb2cd7 100644 --- a/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf +++ b/net/wireguard/src/opnsense/service/conf/actions.d/actions_wireguard.conf @@ -18,9 +18,9 @@ message: restart wireguard instance %s [configure] command:/usr/local/opnsense/scripts/Wireguard/wg-service-control.php -parameters: -a configure +parameters: -a configure %s type:script -message: configure wireguard instances +message: configure wireguard instances (%s) [renew] command:/usr/local/opnsense/scripts/Wireguard/reresolve-dns.py From d1eb2185ad2864078dfc8923d3dc08fc6e0f73c5 Mon Sep 17 00:00:00 2001 From: 0nnyx <54419678+0nnyx@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:43:25 +0100 Subject: [PATCH 1628/3088] Full ET open ruleset as open-extra (#3644) * Full ET open ruleset as open-extra Follow up on #3635 to have full ET open ruleset as plugin * Update et-open-extra.xml --- .../Makefile | 4 +- .../pkg-descr | 4 +- .../suricata/metadata/rules/et-open-extra.xml | 64 ++++++++++++++++--- 3 files changed, 58 insertions(+), 14 deletions(-) diff --git a/security/intrusion-detection-content-et-open/Makefile b/security/intrusion-detection-content-et-open/Makefile index 453c803cc9..e3b185e588 100644 --- a/security/intrusion-detection-content-et-open/Makefile +++ b/security/intrusion-detection-content-et-open/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= intrusion-detection-content-et-open -PLUGIN_VERSION= 1.0.1 +PLUGIN_VERSION= 1.0.2 PLUGIN_REVISION= 1 -PLUGIN_COMMENT= IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition +PLUGIN_COMMENT= IDS Proofpoint full ET open ruleset complementary subset for ET Pro Telemetry edition PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://rules.emergingthreats.net/ diff --git a/security/intrusion-detection-content-et-open/pkg-descr b/security/intrusion-detection-content-et-open/pkg-descr index 7065fc3ed4..ef686238dc 100644 --- a/security/intrusion-detection-content-et-open/pkg-descr +++ b/security/intrusion-detection-content-et-open/pkg-descr @@ -1,5 +1,5 @@ -IDS Proofpoint ET open ruleset duplicates rule files which are being -delivered empty in ET Pro Telemetry edition so both can be installed. +IDS Proofpoint ET open full ruleset to complement ET Pro Telemetry edition. +This plugin will trigger duplicate rules warnings in suricata logs when selecting the same categories for both ET open and ET Telemetry. LICENSE: https://www.proofpoint.com/us/license WWW: https://www.proofpoint.com/us/blog/threat-insight diff --git a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml index ae9c0bffc1..e421e8796f 100644 --- a/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml +++ b/security/intrusion-detection-content-et-open/src/opnsense/scripts/suricata/metadata/rules/et-open-extra.xml @@ -1,15 +1,59 @@ - - + + - et_open-botcc.portgrouped.rules - et_open.botcc.rules - et_open.ciarmy.rules - et_open.compromised.rules - et_open.drop.rules - et_open.dshield.rules - et_open.tor.rules - et_open.emerging-inappropriate.rules + 3coresec.rules + botcc.portgrouped.rules + botcc.rules + ciarmy.rules + compromised.rules + drop.rules + dshield.rules + emerging-activex.rules + emerging-adware_pup.rules + emerging-attack_response.rules + emerging-chat.rules + emerging-coinminer.rules + emerging-current_events.rules + emerging-deleted.rules + emerging-dns.rules + emerging-dos.rules + emerging-exploit.rules + emerging-exploit_kit.rules + emerging-ftp.rules + emerging-games.rules + emerging-hunting.rules + emerging-icmp.rules + emerging-icmp_info.rules + emerging-imap.rules + emerging-inappropriate.rules + emerging-info.rules + emerging-ja3.rules + emerging-malware.rules + emerging-misc.rules + emerging-mobile_malware.rules + emerging-netbios.rules + emerging-p2p.rules + emerging-phishing.rules + emerging-policy.rules + emerging-pop3.rules + emerging-rpc.rules + emerging-scada.rules + emerging-scan.rules + emerging-shellcode.rules + emerging-smtp.rules + emerging-snmp.rules + emerging-sql.rules + emerging-telnet.rules + emerging-tftp.rules + emerging-user_agents.rules + emerging-voip.rules + emerging-web_client.rules + emerging-web_server.rules + emerging-web_specific_apps.rules + emerging-worm.rules + tor.rules + threatview_CS_c2.rules From 8ecf7830a69e42ac52181f2ce28629636b6bc071 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 31 Oct 2023 22:41:14 +0100 Subject: [PATCH 1629/3088] security/intrusion-detection-content-et-open: fix revision --- security/intrusion-detection-content-et-open/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/security/intrusion-detection-content-et-open/Makefile b/security/intrusion-detection-content-et-open/Makefile index e3b185e588..acf629bc8a 100644 --- a/security/intrusion-detection-content-et-open/Makefile +++ b/security/intrusion-detection-content-et-open/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= intrusion-detection-content-et-open PLUGIN_VERSION= 1.0.2 -PLUGIN_REVISION= 1 PLUGIN_COMMENT= IDS Proofpoint full ET open ruleset complementary subset for ET Pro Telemetry edition PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://rules.emergingthreats.net/ From af80514ad843bc2ed2aa102f3766f95cadf625ec Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 31 Oct 2023 11:36:00 +0100 Subject: [PATCH 1630/3088] net/wireguard: use syncconf on newwanip event --- .../src/etc/inc/plugins.inc.d/wireguard.inc | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc index ed933a375e..08f344cd83 100644 --- a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc @@ -144,7 +144,7 @@ function wireguard_prepare($device) function wireguard_configure() { return [ - 'newwanip' => ['wireguard_renew:2'], + 'newwanip' => ['wireguard_sync:2'], 'vpn' => ['wireguard_configure_do:2'], ]; } @@ -162,15 +162,33 @@ function wireguard_configure_do($verbose = false, $unused = '') service_log("done.\n", $verbose); } -function wireguard_renew($verbose = false, $unused = '') +function wireguard_sync($verbose = false, $unused = '') { if (!wireguard_enabled()) { return; } - service_log('Renewing WireGuard VPN...', $verbose); + $instances = []; + foreach ((new OPNsense\Wireguard\Server())->servers->server->iterateItems() as $node) { + if (!empty((string)$node->enabled)) { + $instances[(string)$node->interface] = (string)$node->cnfFilename; + } + } + + if (!count($instances)) { + return; + } + + service_log('Synchronizing WireGuard VPN...', $verbose); + + openlog('wireguard', LOG_ODELAY, LOG_AUTH); + + foreach ($instances as $device => $config) { + mwexecf('/usr/bin/wg syncconf %s %s', [$device, $config]); + } - configd_run('wireguard renew'); + closelog(); + reopenlog(); service_log("done.\n", $verbose); } From 9af41b126b198e3126c2c9f151eb009fc6fbc0e4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 31 Oct 2023 22:43:08 +0100 Subject: [PATCH 1631/3088] net/wireguard: bump version --- net/wireguard/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index a7ffd83b3c..f77b3b923f 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= wireguard -PLUGIN_VERSION= 2.4 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 2.5 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go From 06d0969eb25e7fb7a94b66834cea86cd88061566 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 1 Nov 2023 08:21:18 +0100 Subject: [PATCH 1632/3088] net/wireguard: allow instance selection from peer --- .../Wireguard/Api/ClientController.php | 42 ++++++++++++++++++- .../forms/dialogEditWireguardClient.xml | 6 +++ .../forms/dialogEditWireguardServer.xml | 1 - 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ClientController.php b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ClientController.php index d4f2bf4f0b..8299f6fe20 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ClientController.php +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ClientController.php @@ -30,6 +30,8 @@ namespace OPNsense\Wireguard\Api; use OPNsense\Base\ApiMutableModelControllerBase; +use OPNsense\Core\Config; +use OPNsense\Wireguard\Server; class ClientController extends ApiMutableModelControllerBase { @@ -46,12 +48,22 @@ public function searchClientAction() public function getClientAction($uuid = null) { - return $this->getBase('client', 'clients.client', $uuid); + $result = $this->getBase('client', 'clients.client', $uuid); + if (!empty($result['client'])) { + $result['client']['servers'] = []; + foreach ((new Server())->servers->server->iterateItems() as $key => $node) { + $result['client']['servers'][$key] = [ + 'value' => (string)$node->name, + 'selected' => in_array($uuid, explode(',', (string)$node->peers)) ? '1' : '0' + ]; + } + } + return $result; } public function addClientAction() { - return $this->addBase('client', 'clients.client'); + return $this->setClientAction(null); } public function delClientAction($uuid) @@ -61,6 +73,32 @@ public function delClientAction($uuid) public function setClientAction($uuid) { + if (!empty($this->request->getPost(static::$internalModelName)) && $this->request->isPost()) { + $servers = []; + if (!empty($this->request->getPost(static::$internalModelName)['servers'])) { + $servers = explode(',', $this->request->getPost(static::$internalModelName)['servers']); + } + Config::getInstance()->lock(); + $mdl = new Server(); + if (empty($uuid)) { + // add new client, generate uuid + $uuid = $mdl->servers->generateUUID(); + } + foreach ($mdl->servers->server->iterateItems() as $key => $node) { + $peers = array_filter(explode(',', (string)$node->peers)); + if (in_array($uuid, $peers) && !in_array($key, $servers)) { + $node->peers = implode(',', array_diff($peers, [$uuid])); + } elseif (!in_array($uuid, $peers) && in_array($key, $servers)) { + $node->peers = implode(',', array_merge($peers, [$uuid])); + } + } + /** + * Save to in memory model. + * Ignore validations as $uuid might be new or trigger an existing validation issue. + * Persisting the data is handled by setBase() + */ + $mdl->serializeToConfig(false, true); + } return $this->setBase('client', 'clients.client', $uuid); } diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardClient.xml b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardClient.xml index e71c4ff5f0..ff303f842c 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardClient.xml +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardClient.xml @@ -43,6 +43,12 @@ text Set port the endpoint listens to. + + client.servers + + select_multiple + List of instances this peer belongs to. + client.keepalive diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml index 4c2fe27f0c..3b23f056f5 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/forms/dialogEditWireguardServer.xml @@ -69,7 +69,6 @@ server.peers select_multiple - true List of peers for this instance. From ab9d902df8ddaaaae4c6647a47156cd792405a79 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 1 Nov 2023 08:21:44 +0100 Subject: [PATCH 1633/3088] net/wireguard: UX and wording --- .../src/etc/inc/plugins.inc.d/wireguard.inc | 4 ++-- .../mvc/app/models/OPNsense/Wireguard/ACL/ACL.xml | 2 +- .../mvc/app/models/OPNsense/Wireguard/Client.xml | 2 +- .../mvc/app/views/OPNsense/Wireguard/general.volt | 14 ++++++++------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc index 08f344cd83..e935fa4b50 100644 --- a/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard/src/etc/inc/plugins.inc.d/wireguard.inc @@ -43,7 +43,7 @@ function wireguard_services() foreach ((new OPNsense\Wireguard\Server())->servers->server->iterateItems() as $key => $node) { if (!empty((string)$node->enabled)) { $services[] = [ - 'description' => "Wireguard " . htmlspecialchars($node->name), + 'description' => 'WireGuard ' . htmlspecialchars($node->name), 'configd' => [ 'start' => ["wireguard start {$key}"], 'restart' => ["wireguard restart {$key}"], @@ -104,7 +104,7 @@ function wireguard_devices() foreach ((new OPNsense\Wireguard\Server())->servers->server->iterateItems() as $key => $node) { if (!empty((string)$node->enabled)) { $names[(string)$node->interface] = [ - 'descr' => sprintf('%s (Wireguard - %s)', (string)$node->interface, (string)$node->name), + 'descr' => sprintf('%s (WireGuard - %s)', (string)$node->interface, (string)$node->name), 'ifdescr' => (string)$node->name, 'name' => (string)$node->interface ]; diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/ACL/ACL.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/ACL/ACL.xml index 21012db805..94360e7762 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/ACL/ACL.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/ACL/ACL.xml @@ -1,6 +1,6 @@ - VPN: Wireguard + VPN: WireGuard ui/wireguard/* api/wireguard/* diff --git a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml index 2d472d8381..82c24d1d53 100644 --- a/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml +++ b/net/wireguard/src/opnsense/mvc/app/models/OPNsense/Wireguard/Client.xml @@ -1,6 +1,6 @@ //OPNsense/wireguard/client - Wireguard peer configuration + WireGuard peer configuration 0.0.7 diff --git a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt index 2647b46f18..5cc1f6d627 100644 --- a/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt +++ b/net/wireguard/src/opnsense/mvc/app/views/OPNsense/Wireguard/general.volt @@ -90,14 +90,13 @@
    -
    - {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} -
    + {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}}
    - +
    + @@ -114,6 +113,7 @@ @@ -125,9 +125,10 @@ -
    {{ lang._('ID') }} {{ lang._('Enabled') }} {{ lang._('Name') }} {{ lang._('Endpoint address') }} +
    +
    + @@ -145,6 +146,7 @@ @@ -159,7 +161,7 @@

    From 82860aadeb0af8318c78affdb7bc908eb6db7cf2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 1 Nov 2023 08:25:11 +0100 Subject: [PATCH 1634/3088] net/wireguard: changelog --- net/wireguard/pkg-descr | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index f9c144085d..9b1576529a 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -16,6 +16,14 @@ WWW: https://www.wireguard.com/ Changelog --------- +2.5 + +* Fix error with empty tunnel address in instance (contributed by Monviech) +* Allow instance selection from peer +* Use "syncconf" on newwanip event +* CARP event handling improvements +* Minor UX and woring improvements + 2.4 * Only invoke routes for attached WireGuard instances From 1d4122b5a118a6c923d31b43d75f1364e056586e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 1 Nov 2023 08:27:08 +0100 Subject: [PATCH 1635/3088] misc/theme-cicada: bump revision --- misc/theme-cicada/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/theme-cicada/Makefile b/misc/theme-cicada/Makefile index 0f23fe297c..b6755843b9 100644 --- a/misc/theme-cicada/Makefile +++ b/misc/theme-cicada/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= theme-cicada PLUGIN_VERSION= 1.34 -PLUGIN_REVISION= 3 +PLUGIN_REVISION= 4 PLUGIN_COMMENT= The cicada theme - dark grey onyx PLUGIN_MAINTAINER= rene@team-rebellion.net PLUGIN_NO_ABI= yes From f1c56492b85a859013f746232bf47131555f6282 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 1 Nov 2023 08:27:45 +0100 Subject: [PATCH 1636/3088] security/intrusion-detection-content-et-open: tweak description --- security/intrusion-detection-content-et-open/pkg-descr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/security/intrusion-detection-content-et-open/pkg-descr b/security/intrusion-detection-content-et-open/pkg-descr index ef686238dc..5b7ad62ece 100644 --- a/security/intrusion-detection-content-et-open/pkg-descr +++ b/security/intrusion-detection-content-et-open/pkg-descr @@ -1,5 +1,6 @@ IDS Proofpoint ET open full ruleset to complement ET Pro Telemetry edition. -This plugin will trigger duplicate rules warnings in suricata logs when selecting the same categories for both ET open and ET Telemetry. +This plugin will trigger duplicate rules warnings in Suricata logs when +selecting the same categories for both ET open and ET Telemetry. LICENSE: https://www.proofpoint.com/us/license WWW: https://www.proofpoint.com/us/blog/threat-insight From a5f7a2773ca18147f8c368fdeb1fb983b41e39c4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 6 Nov 2023 09:10:18 +0100 Subject: [PATCH 1637/3088] security/openconnect: support more user name chars; closes #3428 --- security/openconnect/Makefile | 2 +- security/openconnect/pkg-descr | 4 ++ .../models/OPNsense/Openconnect/General.xml | 24 ++++----- .../views/OPNsense/Openconnect/general.volt | 54 +++++++++---------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/security/openconnect/Makefile b/security/openconnect/Makefile index 6ccfbb0c53..9296d2ffcc 100644 --- a/security/openconnect/Makefile +++ b/security/openconnect/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= openconnect -PLUGIN_VERSION= 1.4.4 +PLUGIN_VERSION= 1.4.5 PLUGIN_COMMENT= OpenConnect Client PLUGIN_DEPENDS= openconnect PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/openconnect/pkg-descr b/security/openconnect/pkg-descr index 77338528ce..9d18d3a10f 100644 --- a/security/openconnect/pkg-descr +++ b/security/openconnect/pkg-descr @@ -6,6 +6,10 @@ the Juniper SSL VPN which is now known as Pulse Connect Secure. Plugin Changelog ================ +1.4.5 + +* Allow ":" and "/" characters in user name + 1.4.4 * Improve compatibility via useragent="AnyConnect" diff --git a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml index 647d9accd3..9b9560a56b 100644 --- a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml +++ b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml @@ -4,33 +4,32 @@ 1.0.3 - 0 + 0 Y - server + server Y - /\S*/ + /\S*/ Please provide IP or hostname (no spaces allowed). - user + user Y - /^[a-zA-Z0-9.\@_-]{1,64}$/ - Please provide a valid username. Allowed characters are a-zA-Z0-9._-@ and it has to be 1-64 characters long. + /^[a-zA-Z0-9.\@_\-:\/]{1,64}$/ + Please provide a valid username. Allowed characters are a-zA-Z0-9.@_-:/ and it has to be 1-64 characters long. - password + password Y N - /^([a-zA-Z0-9\/\+\=]){40,64}$/u + /^([a-zA-Z0-9\/\+\=]){40,64}$/u Please provide a valid hash. - sha256 - N + sha256 Y SHA256 @@ -40,7 +39,7 @@ N - /^[() a-zA-Z0-9._-]{1,64}$/ + /^[() a-zA-Z0-9._-]{1,64}$/ Please provide a valid group name. Allowed are at most 64 characters from a-zA-Z0-9._-() and space. @@ -60,8 +59,7 @@ N - anyconnect - N + anyconnect Y Cisco AnyConnect diff --git a/security/openconnect/src/opnsense/mvc/app/views/OPNsense/Openconnect/general.volt b/security/openconnect/src/opnsense/mvc/app/views/OPNsense/Openconnect/general.volt index 2f876fdf0f..5faec528a5 100644 --- a/security/openconnect/src/opnsense/mvc/app/views/OPNsense/Openconnect/general.volt +++ b/security/openconnect/src/opnsense/mvc/app/views/OPNsense/Openconnect/general.volt @@ -1,35 +1,33 @@ {# + # Copyright (c) 2014-2018 Deciso B.V. + # Copyright (c) 2018 Michael Muenz + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} -OPNsense® is Copyright © 2014 – 2018 by Deciso B.V. -This file is Copyright © 2018 by Michael Muenz -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -#}
    {{ partial("layout_partials/base_form",['fields':generalForm,'id':'frm_general_settings'])}} -
    -
    +
    From 3881ab12d7f10c4bcc84b905860600134c15f19f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 6 Nov 2023 09:11:13 +0100 Subject: [PATCH 1638/3088] README: sync --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cc779f630..5036da85ce 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ security/acme-client -- ACME Client security/clamav -- Antivirus engine for detecting malicious threats security/crowdsec -- Lightweight and collaborative security engine security/etpro-telemetry -- ET Pro Telemetry Edition -security/intrusion-detection-content-et-open -- IDS Proofpoint ET open ruleset complementary subset for ET Pro Telemetry edition +security/intrusion-detection-content-et-open -- IDS Proofpoint full ET open ruleset complementary subset for ET Pro Telemetry edition security/intrusion-detection-content-et-pro -- IDS Proofpoint ET Pro ruleset (needs a valid subscription) security/intrusion-detection-content-pt-open -- IDS PT Research ruleset (only for non-commercial use) security/intrusion-detection-content-snort-vrt -- IDS Snort VRT ruleset (needs registration or subscription) From 69bc636cd5fb8a08597dcd1e1a409a20fcf62434 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 6 Nov 2023 09:14:28 +0100 Subject: [PATCH 1639/3088] security/tor: add rexml; closes #3655 --- security/tor/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/tor/Makefile b/security/tor/Makefile index b5f01436f0..ba90fb86f0 100644 --- a/security/tor/Makefile +++ b/security/tor/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= tor PLUGIN_VERSION= 1.9 PLUGIN_COMMENT= The Onion Router -PLUGIN_DEPENDS= tor ruby +PLUGIN_DEPENDS= tor ruby rubygem-rexml PLUGIN_MAINTAINER= franz.fabian.94@gmail.com .include "../../Mk/plugins.mk" From 8e57555345db9ccf347d3286da14229347f4bf60 Mon Sep 17 00:00:00 2001 From: doktornotor <1075960+doktornotor@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:21:58 +0100 Subject: [PATCH 1640/3088] [os-bind] #3650 - break-dnssec toggle needed for Enable filter-aaaa on IPv4/IPv6 clients (#3651) If DNSSEC validation is disabled, filter-aaaa-on-v4 or filter-aaaa-on-v6 is set to break-dnssec instead of yes, then AAAA records will be omitted even if they are signed. See https://github.com/opnsense/plugins/issues/3650 --- .../mvc/app/controllers/OPNsense/Bind/forms/general.xml | 4 ++-- .../opnsense/service/templates/OPNsense/Bind/named.conf | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml index 1a1d8c92a1..52929b3ef0 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml @@ -73,13 +73,13 @@ general.filteraaaav4 checkbox - This will filter AAAA records on IPv4 Clients + This will filter AAAA records on IPv4 Clients. Set "DNSSEC Validation" to "No" and AAAA records will be omitted even if they are signed. general.filteraaaav6 checkbox - This will filter AAAA records on IPv6 Clients + This will filter AAAA records on IPv6 Clients. Set "DNSSEC Validation" to "No" and AAAA records will be omitted even if they are signed. general.filteraaaaacl diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf index 6f95e9812b..b92aaf6d50 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf @@ -222,10 +222,18 @@ logging { {% if helpers.exists('OPNsense.bind.general.filteraaaav4') and OPNsense.bind.general.filteraaaav4 == '1' or helpers.exists('OPNsense.bind.general.filteraaaav6') and OPNsense.bind.general.filteraaaav6 == '1' %} plugin query "/usr/local/lib/bind/filter-aaaa.so" { {% if helpers.exists('OPNsense.bind.general.filteraaaav4') and OPNsense.bind.general.filteraaaav4 == '1' %} +{% if OPNsense.bind.general.dnssecvalidation == 'no' %} + filter-aaaa-on-v4 break-dnssec; +{% else %} filter-aaaa-on-v4 yes; +{% endif %} {% endif %} {% if helpers.exists('OPNsense.bind.general.filteraaaav6') and OPNsense.bind.general.filteraaaav6 == '1' %} +{% if OPNsense.bind.general.dnssecvalidation == 'no' %} + filter-aaaa-on-v6 break-dnssec; +{% else %} filter-aaaa-on-v6 yes; +{% endif %} {% endif %} {% if helpers.exists('OPNsense.bind.general.filteraaaaacl') and OPNsense.bind.general.filteraaaaacl != '' %} filter-aaaa { {{ OPNsense.bind.general.filteraaaaacl.replace(',', '; ') }}; }; From 9b0f5edf567fa0abbac3ce731d9a6cbcdeb70007 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 6 Nov 2023 14:27:38 +0100 Subject: [PATCH 1641/3088] net-mgmt/nrpe: switch to supported version --- net-mgmt/nrpe/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile index 26c5479963..864ade0cfa 100644 --- a/net-mgmt/nrpe/Makefile +++ b/net-mgmt/nrpe/Makefile @@ -2,7 +2,7 @@ PLUGIN_NAME= nrpe PLUGIN_VERSION= 1.0 PLUGIN_REVISION= 3 PLUGIN_COMMENT= Execute nagios plugins -PLUGIN_DEPENDS= nrpe3 +PLUGIN_DEPENDS= nrpe PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" From f6f72bb52427c3bb1b1b8a24f7fe84ed4e0b86a0 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 7 Nov 2023 09:21:00 +0100 Subject: [PATCH 1642/3088] dns/ddclient - fix logic issue in https://github.com/opnsense/plugins/commit/7c6fccdde0bc12d6521e25c64d49978b65113e28 (https://github.com/opnsense/plugins/pull/3618) --- dns/ddclient/Makefile | 2 +- .../src/opnsense/scripts/ddclient/lib/account/dyndns2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index a8952749ea..1be74d80e9 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.16 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_DEPENDS= ddclient-devel py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py index 975c94770b..d2753255aa 100755 --- a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py +++ b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py @@ -98,7 +98,7 @@ def execute(self): } req = requests.get(**req_opts) - if 200 >= req.status_code < 300: + if 200 <= req.status_code < 300: if self.is_verbose: syslog.syslog( syslog.LOG_NOTICE, From 85e4a256df0936fd4f15dcf23b781c8d078d4994 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 7 Nov 2023 11:10:57 +0100 Subject: [PATCH 1643/3088] dns/ddclient - handle empty response (req.text) in dyndns2, for https://github.com/opnsense/plugins/pull/3618 --- .../src/opnsense/scripts/ddclient/lib/account/dyndns2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py index d2753255aa..f712a3f6f1 100755 --- a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py +++ b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py @@ -105,7 +105,7 @@ def execute(self): "Account %s set new ip %s [%s]" % (self.description, self.current_address, req.text.strip()) ) - self.update_state(address=self.current_address, status=req.text.split()[0]) + self.update_state(address=self.current_address, status=req.text.split()[0] if req.text else '') return True else: syslog.syslog( From 7a7b5a5c9ce7144b567684a91ec24b4945e4aa52 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 7 Nov 2023 18:24:51 +0100 Subject: [PATCH 1644/3088] net/wireguard - replace setconf with syncconf in service control for more fluent reloading. (https://github.com/opnsense/plugins/pull/3358) --- net/wireguard/Makefile | 1 + .../src/opnsense/scripts/Wireguard/wg-service-control.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index f77b3b923f..f6ce57bbdf 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.5 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index 2ac781a968..249e6f606a 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -67,7 +67,7 @@ function wg_start($server, $fhandle, $ifcfgflag = 'up') mwexecf('/sbin/ifconfig wg create name %s', [$server->interface]); mwexecf('/sbin/ifconfig %s group wireguard', [$server->interface]); } - mwexecf('/usr/bin/wg setconf %s %s', [$server->interface, $server->cnfFilename]); + mwexecf('/usr/bin/wg syncconf %s %s', [$server->interface, $server->cnfFilename]); /* The tunneladdress can be empty, so array_filter without callback filters empty strings out. */ foreach (array_filter(explode(',', (string)$server->tunneladdress)) as $alias) { From 57639ea4873e212b1cf528c1d16dc444d62cbaec Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 7 Nov 2023 19:44:37 +0100 Subject: [PATCH 1645/3088] net/wireguard: not released yet --- net/wireguard/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index f6ce57bbdf..f77b3b923f 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.5 -PLUGIN_REVISION= 1 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go From 77fa2dce42a33523d8889f5cb2974aaca06204a3 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 7 Nov 2023 19:48:08 +0100 Subject: [PATCH 1646/3088] net/wireguard: last one --- net/wireguard/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 9b1576529a..57bbbedb31 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -19,6 +19,7 @@ Changelog 2.5 * Fix error with empty tunnel address in instance (contributed by Monviech) +* Switch "setconf" to "syncconf" on (re)configuration * Allow instance selection from peer * Use "syncconf" on newwanip event * CARP event handling improvements From 8cab26f71672396204963ef78fe1c5dc499ae2fe Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 7 Nov 2023 19:54:33 +0100 Subject: [PATCH 1647/3088] dns/bind: wrap new version --- dns/bind/Makefile | 3 +-- dns/bind/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index f0efb83354..d5a3705c8d 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.27 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.28 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind918 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 2b15382ee7..2eb158b7e7 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -10,6 +10,10 @@ WWW: https://www.isc.org Plugin Changelog ================ +1.28 + +* Add break-dnssec toggle when using filter-aaaa on IPv4/IPv6 clients (contributed by doktornotor) + 1.27 * Add DNAME support (contributed by Simon Fischer) From 2e42daed1ce7b621ba1ebdac2c87049d8d46627b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 9 Nov 2023 07:33:19 +0100 Subject: [PATCH 1648/3088] mail/postfix: move to newer postfix version --- mail/postfix/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 8ffb1be91d..659bcd8c19 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -2,7 +2,7 @@ PLUGIN_NAME= postfix PLUGIN_VERSION= 1.23 PLUGIN_REVISION= 3 PLUGIN_COMMENT= SMTP mail relay -PLUGIN_DEPENDS= postfix35 +PLUGIN_DEPENDS= postfix PLUGIN_MAINTAINER= m.muenz@gmail.com .include "../../Mk/plugins.mk" From 07133a134ae3065df76daf3b27e1461ab0488adc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 9 Nov 2023 09:25:58 +0100 Subject: [PATCH 1649/3088] sysutils/api-backup: update endpoint after improvement --- README.md | 2 +- sysutils/api-backup/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5036da85ce..b0d8aec2b3 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ security/tinc -- Tinc VPN security/tor -- The Onion Router security/wazuh-agent -- Agent for the open source security platform Wazuh sysutils/apcupsd -- APCUPSD - APC UPS daemon -sysutils/api-backup -- EoL, core endpoint is /api/core/backup/download (pending removal) +sysutils/api-backup -- EoL, core endpoint is /api/core/backup/download/this (pending removal) sysutils/apuled -- PC Engine APU LED control (development only) sysutils/dmidecode -- Display hardware information on the dashboard sysutils/git-backup -- Track config changes using git diff --git a/sysutils/api-backup/Makefile b/sysutils/api-backup/Makefile index f4663d3b4b..759fd29cc3 100644 --- a/sysutils/api-backup/Makefile +++ b/sysutils/api-backup/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= api-backup PLUGIN_VERSION= 1.1 PLUGIN_OBSOLETE= yes -PLUGIN_COMMENT= EoL, core endpoint is /api/core/backup/download +PLUGIN_COMMENT= EoL, core endpoint is /api/core/backup/download/this PLUGIN_MAINTAINER= franz.fabian.94@gmail.com .include "../../Mk/plugins.mk" From 47ccdcc078f7a58432a7cf1350ec9700863416cb Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 10 Nov 2023 18:46:37 +0100 Subject: [PATCH 1650/3088] net/wireguard - minor regression in addClient, not adding created uuid. closes https://github.com/opnsense/plugins/issues/3663 --- net/wireguard/Makefile | 1 + .../OPNsense/Wireguard/Api/ClientController.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index f77b3b923f..f6ce57bbdf 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.5 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ClientController.php b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ClientController.php index 8299f6fe20..90e4ed4c5f 100644 --- a/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ClientController.php +++ b/net/wireguard/src/opnsense/mvc/app/controllers/OPNsense/Wireguard/Api/ClientController.php @@ -73,6 +73,7 @@ public function delClientAction($uuid) public function setClientAction($uuid) { + $add_uuid = null; if (!empty($this->request->getPost(static::$internalModelName)) && $this->request->isPost()) { $servers = []; if (!empty($this->request->getPost(static::$internalModelName)['servers'])) { @@ -83,6 +84,7 @@ public function setClientAction($uuid) if (empty($uuid)) { // add new client, generate uuid $uuid = $mdl->servers->generateUUID(); + $add_uuid = $uuid; } foreach ($mdl->servers->server->iterateItems() as $key => $node) { $peers = array_filter(explode(',', (string)$node->peers)); @@ -99,7 +101,11 @@ public function setClientAction($uuid) */ $mdl->serializeToConfig(false, true); } - return $this->setBase('client', 'clients.client', $uuid); + $result = $this->setBase('client', 'clients.client', $uuid); + if (!empty($add_uuid) && $result['result'] == 'saved') { + $result['uuid'] = $add_uuid; + } + return $result; } public function toggleClientAction($uuid) From db616c0f006c8d877ded48bb562154cddc40e3f7 Mon Sep 17 00:00:00 2001 From: macaddict89 Date: Sat, 11 Nov 2023 03:23:50 -0500 Subject: [PATCH 1651/3088] Update general.volt (#3665) security\crowdsec: fixed typo --- .../src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt index 9a00769330..ed1b89b7dc 100644 --- a/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt +++ b/security/crowdsec/src/opnsense/mvc/app/views/OPNsense/CrowdSec/general.volt @@ -124,7 +124,7 @@

    On the Settings tab, you can expose CrowdSec to the LAN for other servers by changing `LAPI listen address`. - Otherwise, leave the defualt value. + Otherwise, leave the default value.

    From 028ee4c65392f6282055b473c7dfcd9ad6f2e02b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 11 Nov 2023 15:43:57 +0100 Subject: [PATCH 1652/3088] remove OpenSSL flavor from bug template (https://github.com/opnsense/src/pull/189) --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c06ec63b26..b77b481693 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -42,6 +42,6 @@ Add any other context about the problem here. Software version used and hardware type if relevant. e.g.: -OPNsense 19.1.1 (amd64, OpenSSL). +OPNsense 23.7.8 (amd64). Intel® Xeon™ E3-1225V5 3.3Ghz Quad Core Network Intel® I210-AT From 5bcc4d5410b84625b2378ad0ac037ebf304fd3fa Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 13 Nov 2023 09:53:20 +0100 Subject: [PATCH 1653/3088] net-mgmt/os-nrpe (#3668) --- net-mgmt/nrpe/Makefile | 3 +-- net-mgmt/nrpe/pkg-descr | 7 +++++++ net-mgmt/nrpe/src/etc/inc/plugins.inc.d/nrpe.inc | 2 +- net-mgmt/nrpe/src/opnsense/scripts/OPNsense/Nrpe/setup.sh | 4 ++-- .../src/opnsense/service/conf/actions.d/actions_nrpe.conf | 8 ++++---- .../src/opnsense/service/templates/OPNsense/Nrpe/+TARGETS | 2 +- .../src/opnsense/service/templates/OPNsense/Nrpe/nrpe | 6 +++--- .../src/opnsense/service/templates/OPNsense/Nrpe/nrpe.cfg | 2 +- 8 files changed, 20 insertions(+), 14 deletions(-) diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile index 864ade0cfa..abb4f51bd2 100644 --- a/net-mgmt/nrpe/Makefile +++ b/net-mgmt/nrpe/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nrpe -PLUGIN_VERSION= 1.0 -PLUGIN_REVISION= 3 +PLUGIN_VERSION= 1.1 PLUGIN_COMMENT= Execute nagios plugins PLUGIN_DEPENDS= nrpe PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/nrpe/pkg-descr b/net-mgmt/nrpe/pkg-descr index 483177b58d..787e80023b 100644 --- a/net-mgmt/nrpe/pkg-descr +++ b/net-mgmt/nrpe/pkg-descr @@ -7,3 +7,10 @@ the plugin requests to the remote host. Requires that nrpe be running on the remote host (either as a standalone daemon or as a service under inetd). WWW: http://www.nagios.org/ + +Plugin Changelog: +----------------- + +1.1 + +* Make plugin compatbile with nrpe (v4) diff --git a/net-mgmt/nrpe/src/etc/inc/plugins.inc.d/nrpe.inc b/net-mgmt/nrpe/src/etc/inc/plugins.inc.d/nrpe.inc index 59a70977d6..e5d1eaed64 100644 --- a/net-mgmt/nrpe/src/etc/inc/plugins.inc.d/nrpe.inc +++ b/net-mgmt/nrpe/src/etc/inc/plugins.inc.d/nrpe.inc @@ -47,7 +47,7 @@ function nrpe_services() 'start' => array('nrpe start'), 'stop' => array('nrpe stop'), ), - 'name' => 'nrpe3', + 'name' => 'nrpe', 'pid' => '/var/run/nrpe.pid' ); diff --git a/net-mgmt/nrpe/src/opnsense/scripts/OPNsense/Nrpe/setup.sh b/net-mgmt/nrpe/src/opnsense/scripts/OPNsense/Nrpe/setup.sh index 667c70099d..48665e1408 100755 --- a/net-mgmt/nrpe/src/opnsense/scripts/OPNsense/Nrpe/setup.sh +++ b/net-mgmt/nrpe/src/opnsense/scripts/OPNsense/Nrpe/setup.sh @@ -1,4 +1,4 @@ #!/bin/sh -mkdir -p /var/run/nrpe3 -chown -R nagios:nagios /var/run/nrpe3 +mkdir -p /var/run/nrpe +chown -R nagios:nagios /var/run/nrpe diff --git a/net-mgmt/nrpe/src/opnsense/service/conf/actions.d/actions_nrpe.conf b/net-mgmt/nrpe/src/opnsense/service/conf/actions.d/actions_nrpe.conf index 89b66602a7..d089ece296 100644 --- a/net-mgmt/nrpe/src/opnsense/service/conf/actions.d/actions_nrpe.conf +++ b/net-mgmt/nrpe/src/opnsense/service/conf/actions.d/actions_nrpe.conf @@ -1,23 +1,23 @@ [start] -command:/usr/local/etc/rc.d/nrpe3 start +command:/usr/local/etc/rc.d/nrpe start parameters: type:script message:starting nrpe [stop] -command:/usr/local/etc/rc.d/nrpe3 stop +command:/usr/local/etc/rc.d/nrpe stop parameters: type:script message:stopping nrpe [restart] -command:/usr/local/etc/rc.d/nrpe3 restart +command:/usr/local/etc/rc.d/nrpe restart parameters: type:script message:restarting nrpe [status] -command:/usr/local/etc/rc.d/nrpe3 status; exit 0 +command:/usr/local/etc/rc.d/nrpe status; exit 0 parameters: type:script_output message:request nrpe status diff --git a/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/+TARGETS b/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/+TARGETS index f0f1041965..d3154ecddc 100644 --- a/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/+TARGETS +++ b/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/+TARGETS @@ -1,3 +1,3 @@ -nrpe:/etc/rc.conf.d/nrpe3 +nrpe:/etc/rc.conf.d/nrpe nrpe.cfg:/usr/local/etc/nrpe.cfg nrpe_commands.cfg:/usr/local/etc/nrpe_commands.cfg diff --git a/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe b/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe index dc85ed6ac8..25419b71ff 100644 --- a/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe +++ b/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe @@ -1,6 +1,6 @@ {% if helpers.exists('OPNsense.nrpe.general.enabled') and OPNsense.nrpe.general.enabled == '1' %} -nrpe3_setup="/usr/local/opnsense/scripts/OPNsense/Nrpe/setup.sh" -nrpe3_enable="YES" +nrpe_setup="/usr/local/opnsense/scripts/OPNsense/Nrpe/setup.sh" +nrpe_enable="YES" {% else %} -nrpe3_enable="NO" +nrpe_enable="NO" {% endif %} diff --git a/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe.cfg b/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe.cfg index 3a439d537d..68c437209c 100644 --- a/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe.cfg +++ b/net-mgmt/nrpe/src/opnsense/service/templates/OPNsense/Nrpe/nrpe.cfg @@ -3,7 +3,7 @@ log_facility=daemon log_file=/var/log/nrpe.log debug=0 -pid_file=/var/run/nrpe3/nrpe.pid +pid_file=/var/run/nrpe/nrpe.pid nrpe_user=nagios nrpe_group=nagios From 2cfee828188ea9b7f33abfc57452a024ea37a310 Mon Sep 17 00:00:00 2001 From: Andy Binder Date: Mon, 13 Nov 2023 10:28:32 +0100 Subject: [PATCH 1654/3088] www/c-icap: fix locahost ACL (#3667) --- .../opnsense/service/templates/OPNsense/CICAP/c-icap.conf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf index 37580540ae..6fe06dbe98 100644 --- a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf @@ -46,7 +46,8 @@ ServerName {{ system.hostname }} {% if helpers.exists('OPNsense.proxy.forward.icap.SendUsername') and OPNsense.proxy.forward.icap.SendUsername == '1' %} RemoteProxyUsers on acl AUTH auth * -icap_access allow AUTH 127.0.0.1 +acl localserver srvip 127.0.0.1 +icap_access allow AUTH localserver {% else %} RemoteProxyUsers off {% endif %} @@ -61,7 +62,8 @@ RemoteProxyUserHeader {{OPNsense.proxy.forward.icap.UsernameHeader}} {% else %} RemoteProxyUsers on acl AUTH auth * -icap_access allow AUTH 127.0.0.1 +acl localserver srvip 127.0.0.1 +icap_access allow AUTH localserver RemoteProxyUserHeaderEncoded on RemoteProxyUserHeader X-Authenticated-User {% endif %} From 966069f3634d9510ea3c18dcbe8412e478b27c1a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 13 Nov 2023 10:46:14 +0100 Subject: [PATCH 1655/3088] www/c-ipcap: bump revision --- www/c-icap/Makefile | 2 +- .../src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/c-icap/Makefile b/www/c-icap/Makefile index 095dfd1622..575fb3e90a 100644 --- a/www/c-icap/Makefile +++ b/www/c-icap/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= c-icap PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 3 +PLUGIN_REVISION= 4 PLUGIN_COMMENT= c-icap connects the web proxy with a virus scanner PLUGIN_DEPENDS= c-icap c-icap-modules PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf index 6fe06dbe98..27b16b44ef 100644 --- a/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf +++ b/www/c-icap/src/opnsense/service/templates/OPNsense/CICAP/c-icap.conf @@ -46,7 +46,7 @@ ServerName {{ system.hostname }} {% if helpers.exists('OPNsense.proxy.forward.icap.SendUsername') and OPNsense.proxy.forward.icap.SendUsername == '1' %} RemoteProxyUsers on acl AUTH auth * -acl localserver srvip 127.0.0.1 +acl localserver srvip 127.0.0.1 icap_access allow AUTH localserver {% else %} RemoteProxyUsers off @@ -62,7 +62,7 @@ RemoteProxyUserHeader {{OPNsense.proxy.forward.icap.UsernameHeader}} {% else %} RemoteProxyUsers on acl AUTH auth * -acl localserver srvip 127.0.0.1 +acl localserver srvip 127.0.0.1 icap_access allow AUTH localserver RemoteProxyUserHeaderEncoded on RemoteProxyUserHeader X-Authenticated-User From 52de9c3412613819f2e143f035de452aba637ada Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 17 Nov 2023 09:23:34 +0100 Subject: [PATCH 1656/3088] net/frr: Add Adjacency logging (#3675) --- net/frr/Makefile | 3 +-- net/frr/pkg-descr | 4 ++++ .../mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml | 5 +++++ net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml | 5 +++++ .../opnsense/service/templates/OPNsense/Quagga/ospfd.conf | 3 +++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index 8cdba41d58..6edb0abf95 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= frr -PLUGIN_VERSION= 1.36 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.37 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr8 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index ba4c220766..71f40d5151 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -12,6 +12,10 @@ WWW: https://frrouting.org/ Plugin Changelog ================ +1.37 + +* Add Adjacency Logging to OSPF + 1.36 * Added default-information originate option for OSPFv3 diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml index ba766ee930..7a1fb79db0 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/ospf.xml @@ -49,6 +49,11 @@ dropdown Route Map to set for Redistribution. + + ospf.logadjacencychanges + + checkbox + ospf.originate diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml index 22f3cecc4d..cc19aa602f 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml @@ -22,10 +22,15 @@ 4294967 Must be a number between 1 and 4294967. + + 0 + Y + 0 Y + 0 Y diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf index 0177496458..91c282218e 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/ospfd.conf @@ -47,6 +47,9 @@ interface {{ physical_interface(interface.interfacename) }} {% endif %} ! router ospf +{% if helpers.exists('OPNsense.quagga.ospf.logadjacencychanges') and OPNsense.quagga.ospf.logadjacencychanges == '1' %} + log-adjacency-changes +{% endif %} {% if helpers.exists('OPNsense.quagga.ospf.costreference') and OPNsense.quagga.ospf.costreference != '' %} auto-cost reference-bandwidth {{ OPNsense.quagga.ospf.costreference }} {% endif %} From e8a3897fc254560b55e8d1e9bccf736f9fa2052c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 21 Nov 2023 16:36:34 +0100 Subject: [PATCH 1657/3088] www/squid: add a squid (web proxy) meta port --- README.md | 1 + www/squid/Makefile | 8 ++++++++ www/squid/pkg-descr | 3 +++ 3 files changed, 12 insertions(+) create mode 100644 www/squid/Makefile create mode 100644 www/squid/pkg-descr diff --git a/README.md b/README.md index b0d8aec2b3..5e39602c7d 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ vendor/sunnyvalley -- Vendor Repository for Zenarmor (a.k.a Sensei, Next Generat www/c-icap -- c-icap connects the web proxy with a virus scanner www/cache -- Webserver cache www/nginx -- Nginx HTTP server and reverse proxy +www/squid -- Squid is a caching proxy for the web www/web-proxy-sso -- Kerberos authentication module ``` diff --git a/www/squid/Makefile b/www/squid/Makefile new file mode 100644 index 0000000000..639759f605 --- /dev/null +++ b/www/squid/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= squid +PLUGIN_VERSION= 1.0.d +PLUGIN_COMMENT= Squid is a caching proxy for the web +PLUGIN_DEPENDS= squid squid-langpack +PLUGIN_TIER= 2 +PLUGIN_MAINTAINER= franco@opnsense.org + +.include "../../Mk/plugins.mk" diff --git a/www/squid/pkg-descr b/www/squid/pkg-descr new file mode 100644 index 0000000000..b725ff7f67 --- /dev/null +++ b/www/squid/pkg-descr @@ -0,0 +1,3 @@ +Squid is a fully-featured HTTP, HTTPS, FTP, etc. proxy offering rich access +control, authorization and logging environment to develop web proxy and +content serving applications. From 5a4000d7a7b9948bcafbf7f9c3b46468a2a0283b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 14 Nov 2023 10:14:59 +0100 Subject: [PATCH 1658/3088] dns/ddclient: dnsexit legacy was removed in ddclient 3.11.x --- dns/ddclient/Makefile | 3 +-- dns/ddclient/pkg-descr | 4 ++++ .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 1be74d80e9..567fd84b00 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.16 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.17 PLUGIN_DEPENDS= ddclient-devel py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 9c56e6f7c1..f06c77db05 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,10 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.17 + +* Update to ddclient 3.11.1 (dnsexit legacy support removed) + 1.16 * Add custom GET/PUT protocols to native backend (contributed by DaCookie4u) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 62f707d38a..7104462f0c 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -51,8 +51,7 @@ dinahosting DNS Made Easy (digicert) DNS-O-Matic - DNSExit API - DNSExit Legacy + DNSExit DynDNS.com DnsPark DSLReports From c65c6532ac08fc0c3ee9b06fe89e05017ba10631 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 21 Nov 2023 16:47:50 +0100 Subject: [PATCH 1659/3088] Framework: ignore missing src for meta packages --- Mk/plugins.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 5fa657dad6..ff75a2d42e 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -204,7 +204,7 @@ scripts-post: install: check @mkdir -p ${DESTDIR}${LOCALBASE}/opnsense/version - @(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \ + @(cd ${.CURDIR}/src 2> /dev/null && find * -type f) | while read FILE; do \ tar -C ${.CURDIR}/src -cpf - $${FILE} | \ tar -C ${DESTDIR}${LOCALBASE} -xpf -; \ if [ "$${FILE%%.in}" != "$${FILE}" ]; then \ @@ -215,7 +215,7 @@ install: check @cat ${TEMPLATESDIR}/version | sed ${SED_REPLACE} > "${DESTDIR}${LOCALBASE}/opnsense/version/${PLUGIN_NAME}" plist: check - @(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \ + @(cd ${.CURDIR}/src 2> /dev/null && find * -type f) | while read FILE; do \ if [ -f "$${FILE}.in" ]; then continue; fi; \ FILE="$${FILE%%.in}"; \ echo ${LOCALBASE}/$${FILE}; \ @@ -235,16 +235,16 @@ metadata: check @${MAKE} DESTDIR=${DESTDIR} plist > ${DESTDIR}/plist collect: check - @(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \ + @(cd ${.CURDIR}/src 2> /dev/null && find * -type f) | while read FILE; do \ tar -C ${DESTDIR}${LOCALBASE} -cpf - $${FILE} | \ tar -C ${.CURDIR}/src -xpf -; \ done remove: check - @(cd ${.CURDIR}/src; find * -type f) | while read FILE; do \ + @(cd ${.CURDIR}/src 2> /dev/null && find * -type f) | while read FILE; do \ rm -f ${DESTDIR}${LOCALBASE}/$${FILE}; \ done - @(cd ${.CURDIR}/src; find * -type d -depth) | while read DIR; do \ + @(cd ${.CURDIR}/src 2> /dev/null && find * -type d -depth) | while read DIR; do \ if [ -d ${DESTDIR}${LOCALBASE}/$${DIR} ]; then \ rmdir ${DESTDIR}${LOCALBASE}/$${DIR} 2> /dev/null || true; \ fi; \ From cad482687a9734bf3a765b9d36165840a0face85 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 21 Nov 2023 17:04:05 +0100 Subject: [PATCH 1660/3088] net/frr: lint --- net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml index cc19aa602f..5db827fdd7 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml @@ -30,7 +30,6 @@ 0 Y - 0 Y From 0dec112d17303b80ec35e64730ca5d4672462be4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 22 Nov 2023 07:44:15 +0100 Subject: [PATCH 1661/3088] net/frr: forgot version bump --- net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml index 5db827fdd7..924ac3cdaf 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF.xml @@ -1,7 +1,7 @@ //OPNsense/quagga/ospf OSPF Routing configuration - 1.0.4 + 1.0.5 0 From 8da84037c2228e00ab66fc9beba4c5b6d06bbe4a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 24 Nov 2023 11:00:20 +0100 Subject: [PATCH 1662/3088] net/upnp: add newwanip hook This could potentially disrupt operation for no apparent reason since this wasn't included and asked for for a long time now. PR: https://forum.opnsense.org/index.php?topic=36912.0 --- net/upnp/Makefile | 2 +- net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net/upnp/Makefile b/net/upnp/Makefile index 6be3288b4e..b43908434a 100644 --- a/net/upnp/Makefile +++ b/net/upnp/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= upnp PLUGIN_VERSION= 1.5 -PLUGIN_REVISION= 4 +PLUGIN_REVISION= 5 PLUGIN_DEPENDS= miniupnpd PLUGIN_COMMENT= Universal Plug and Play Service PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc index bc667ab016..411c57f66b 100644 --- a/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc +++ b/net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc @@ -88,7 +88,10 @@ function miniupnpd_stop() function miniupnpd_configure() { - return ['bootup' => ['miniupnpd_configure_do']]; + return [ + 'bootup' => ['miniupnpd_configure_do'], + 'newwanip' => ['miniupnpd_configure_do'], + ]; } function miniupnpd_uuid() From 837b403b7a71f872105eed2a84c9eefee99f0548 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 24 Nov 2023 14:32:02 +0100 Subject: [PATCH 1663/3088] net/wireguard-go: pull all names into device registration after core change PR: https://forum.opnsense.org/index.php?topic=37189.0 --- net/wireguard-go/Makefile | 2 +- .../src/etc/inc/plugins.inc.d/wireguard.inc | 27 ++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/net/wireguard-go/Makefile b/net/wireguard-go/Makefile index 9be4130ce7..e2fda10612 100644 --- a/net/wireguard-go/Makefile +++ b/net/wireguard-go/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= wireguard-go PLUGIN_VERSION= 1.13 -PLUGIN_REVISION= 7 +PLUGIN_REVISION= 8 PLUGIN_COMMENT= WireGuard VPN service Go implementation PLUGIN_CONFLICTS= wireguard PLUGIN_OBSOLETE= yes diff --git a/net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc index cc1e49ee8d..7cc6f8bc2b 100644 --- a/net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc @@ -50,11 +50,6 @@ function wireguard_services() 'name' => 'wireguard-go', ]; - if (file_exists('/boot/modules/if_wg.ko') || file_exists('/boot/kernel/if_wg.ko')) { - $service['name'] = 'wireguard'; - $service['nocheck'] = true; - } - $services[] = $service; return $services; @@ -89,14 +84,26 @@ function wireguard_xmlrpc_sync() $result['description'] = gettext('WireGuard'); $result['services'] = ['wireguard-go']; - if (file_exists('/boot/modules/if_wg.ko') || file_exists('/boot/kernel/if_wg.ko')) { - $result['services'] = ['wireguard']; - } - return [$result]; } function wireguard_devices() { - return [['pattern' => '^wg', 'volatile' => true]]; + $names = []; + foreach ((new OPNsense\Wireguard\Server())->servers->server->iterateItems() as $key => $node) { + if (!empty((string)$node->enabled)) { + $names[(string)$node->interface] = [ + 'descr' => sprintf('%s (WireGuard - %s)', (string)$node->interface, (string)$node->name), + 'ifdescr' => (string)$node->name, + 'name' => (string)$node->interface + ]; + } + } + return [[ + 'configurable' => false, + 'pattern' => '^wg', + 'type' => 'wireguard', + 'volatile' => true, + 'names' => $names, + ]]; } From 2c2644e54e873474948509ec0b84382bcd0f273a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 24 Nov 2023 14:48:26 +0100 Subject: [PATCH 1664/3088] net/wireguard: $node->interface doesn't exist yet --- net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc b/net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc index 7cc6f8bc2b..ad234adcfd 100644 --- a/net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc +++ b/net/wireguard-go/src/etc/inc/plugins.inc.d/wireguard.inc @@ -92,10 +92,11 @@ function wireguard_devices() $names = []; foreach ((new OPNsense\Wireguard\Server())->servers->server->iterateItems() as $key => $node) { if (!empty((string)$node->enabled)) { - $names[(string)$node->interface] = [ - 'descr' => sprintf('%s (WireGuard - %s)', (string)$node->interface, (string)$node->name), + $device = 'wg' . $node->instance; + $names[$device] = [ + 'descr' => sprintf('%s (WireGuard - %s)', $device, (string)$node->name), 'ifdescr' => (string)$node->name, - 'name' => (string)$node->interface + 'name' => $device, ]; } } From aba4bd20e8a6d9c297c90fd8f832041342205ab8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 27 Nov 2023 10:04:38 +0100 Subject: [PATCH 1665/3088] dns/ddclient: moving back to FreeBSD port --- dns/ddclient/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 567fd84b00..f21eeef035 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.17 -PLUGIN_DEPENDS= ddclient-devel py${PLUGIN_PYTHON}-boto3 +PLUGIN_DEPENDS= ddclient py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org From 0e0ff854dbbdba8ea57b6d190acc7b66a9d57605 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 27 Nov 2023 11:36:06 +0100 Subject: [PATCH 1666/3088] dns/ddclient: more changes for a full 1.18; also closes #3685 --- dns/ddclient/Makefile | 2 +- dns/ddclient/pkg-descr | 6 ++++++ .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 6 ++---- dns/ddclient/src/opnsense/scripts/ddclient/setup.sh | 5 +++++ .../opnsense/service/conf/actions.d/actions_ddclient.conf | 7 ++----- .../templates/OPNsense/ddclient/ddclient_opn.rc.conf.d | 1 + .../opnsense/service/templates/OPNsense/ddclient/rc.conf.d | 1 + 7 files changed, 18 insertions(+), 10 deletions(-) create mode 100755 dns/ddclient/src/opnsense/scripts/ddclient/setup.sh diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index f21eeef035..b01fe14d4d 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.17 +PLUGIN_VERSION= 1.18 PLUGIN_DEPENDS= ddclient py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index f06c77db05..434055d291 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,12 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.18 + +* Update to ddclient 3.11.2 FreeBSD ports version +* Default to native backend for new installs +* Fix permission of ddclient.json + 1.17 * Update to ddclient 3.11.1 (dnsexit legacy support removed) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 7104462f0c..a3ae3beae5 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -1,9 +1,7 @@ //OPNsense/DynDNS 1.5.1 - - Dynamic DNS client - + Dynamic DNS client @@ -26,7 +24,7 @@ Y - ddclient + opnsense A backend is required. ddclient diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/setup.sh b/dns/ddclient/src/opnsense/scripts/ddclient/setup.sh new file mode 100755 index 0000000000..7cf7b8d4ad --- /dev/null +++ b/dns/ddclient/src/opnsense/scripts/ddclient/setup.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +for CONF in /usr/local/etc/ddclient.conf /usr/local/etc/ddclient.json; do + chmod 0600 ${CONF} +done diff --git a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf index ce63a7ef8d..8500bfa483 100644 --- a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf +++ b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf @@ -1,7 +1,6 @@ [start] command: - chmod 600 /usr/local/etc/ddclient.conf; - /usr/local/etc/rc.d/ddclient start ; + /usr/local/etc/rc.d/ddclient start; /usr/local/etc/rc.d/ddclient_opn start type:script message:starting ddclient @@ -18,9 +17,8 @@ message:get ddclient status [restart] command: - chmod 600 /usr/local/etc/ddclient.conf; pkill -F /var/run/ddclient.pid 2> /dev/null; - /usr/local/etc/rc.d/ddclient restart ; + /usr/local/etc/rc.d/ddclient restart; /usr/local/etc/rc.d/ddclient_opn restart type:script message:restarting ddclient @@ -28,7 +26,6 @@ description:Restart ddclient service [force] command: - chmod 600 /usr/local/etc/ddclient.conf; rm /var/tmp/ddclient_opn.status 2>/dev/null; /usr/local/etc/rc.d/ddclient_opn restart 2>/dev/null; /usr/local/sbin/ddclient -force diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient_opn.rc.conf.d b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient_opn.rc.conf.d index df8079f834..b6a9cf0140 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient_opn.rc.conf.d +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient_opn.rc.conf.d @@ -1,5 +1,6 @@ {% if not helpers.empty('OPNsense.DynDNS.general.enabled') and OPNsense.DynDNS.general.backend == 'opnsense' %} ddclient_opn_enable="YES" +ddclient_opn_setup="/usr/local/opnsense/scripts/ddclient/setup.sh" {% else %} ddclient_opn_enable="NO" {% endif %} diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d index dae5683f0f..ecb315a717 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d @@ -1,5 +1,6 @@ {% if not helpers.empty('OPNsense.DynDNS.general.enabled') and OPNsense.DynDNS.general.backend == 'ddclient' %} ddclient_enable="YES" +ddclient_setup="/usr/local/opnsense/scripts/ddclient/setup.sh" ddclient_flags="-daemon {{OPNsense.DynDNS.general.daemon_delay|default('300')}}" {% else %} ddclient_enable="NO" From 0b70e35c8c1e07c0b04ad9a1719b0c7e13131564 Mon Sep 17 00:00:00 2001 From: Stephan de Wit Date: Wed, 29 Nov 2023 09:54:20 +0100 Subject: [PATCH 1667/3088] dec-hw: dual power supply status for Deciso appliances (#3687) - API endpoint to query the current power supply status - small dashboard widget --- sysutils/dec-hw/+POST_INSTALL | 1 + sysutils/dec-hw/Makefile | 8 ++ sysutils/dec-hw/pkg-descr | 4 + .../src/etc/rc.syshook.d/early/30-powerstat | 13 +++ .../OPNsense/dechw/Api/InfoController.php | 57 +++++++++++ .../src/opnsense/scripts/dec-hw/powerstat | 15 +++ .../service/conf/actions.d/actions_dechw.conf | 5 + .../dec-hw/src/www/widgets/include/dechw.inc | 3 + .../src/www/widgets/widgets/dechw.widget.php | 94 +++++++++++++++++++ 9 files changed, 200 insertions(+) create mode 100644 sysutils/dec-hw/+POST_INSTALL create mode 100644 sysutils/dec-hw/Makefile create mode 100644 sysutils/dec-hw/pkg-descr create mode 100755 sysutils/dec-hw/src/etc/rc.syshook.d/early/30-powerstat create mode 100644 sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php create mode 100755 sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat create mode 100644 sysutils/dec-hw/src/opnsense/service/conf/actions.d/actions_dechw.conf create mode 100644 sysutils/dec-hw/src/www/widgets/include/dechw.inc create mode 100644 sysutils/dec-hw/src/www/widgets/widgets/dechw.widget.php diff --git a/sysutils/dec-hw/+POST_INSTALL b/sysutils/dec-hw/+POST_INSTALL new file mode 100644 index 0000000000..a9ba080244 --- /dev/null +++ b/sysutils/dec-hw/+POST_INSTALL @@ -0,0 +1 @@ +/usr/local/etc/rc.syshook.d/early/30-powerstat diff --git a/sysutils/dec-hw/Makefile b/sysutils/dec-hw/Makefile new file mode 100644 index 0000000000..326b548953 --- /dev/null +++ b/sysutils/dec-hw/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= dec-hw +PLUGIN_VERSION= 1.0 +PLUGIN_COMMENT= Deciso Hardware specific information +PLUGIN_MAINTAINER= stephan.de.wit@deciso.com +PLUGIN_TIER= 2 + +.include "../../Mk/plugins.mk" + diff --git a/sysutils/dec-hw/pkg-descr b/sysutils/dec-hw/pkg-descr new file mode 100644 index 0000000000..c8f40a55ed --- /dev/null +++ b/sysutils/dec-hw/pkg-descr @@ -0,0 +1,4 @@ +This package allows fetching the current power status for Deciso +appliances with dual power supplies via an API call and includes a simple +dashboard widget. + diff --git a/sysutils/dec-hw/src/etc/rc.syshook.d/early/30-powerstat b/sysutils/dec-hw/src/etc/rc.syshook.d/early/30-powerstat new file mode 100755 index 0000000000..df63a9fc32 --- /dev/null +++ b/sysutils/dec-hw/src/etc/rc.syshook.d/early/30-powerstat @@ -0,0 +1,13 @@ +#!/bin/sh + +AMDGPIO="/boot/kernel/amdgpio.ko" + +if [ ! -e "$AMDGPIO" ]; then + echo "Error: amdpgio kernel module missing" + logger -t "dec-hw" "Error: amdpgio kernel module missing" + exit 1 +fi + +kldload "$AMDGPIO" 2>&1 + +exit 0 diff --git a/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php b/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php new file mode 100644 index 0000000000..9581cc1012 --- /dev/null +++ b/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php @@ -0,0 +1,57 @@ + "failed", + "status_translated" => gettext("Power status could not be fetched. + This widget is only applicable to Deciso hardware with dual power supplies.") + ]; + $status = parse_ini_string((new Backend())->configdRun('dechw power')); + + if (!empty($status)) { + $result["status"] = "OK"; + unset($result["status_translated"]); + + foreach (['pwr1', 'pwr2'] as $key) { + $result[$key . '_translated'] = $status[$key] === '1' ? gettext('On') : gettext('Off'); + } + $result = array_merge($result, $status); + } + + return $result; + } +} diff --git a/sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat b/sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat new file mode 100755 index 0000000000..08773e4513 --- /dev/null +++ b/sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat @@ -0,0 +1,15 @@ +#!/bin/sh + +GPIOC="/dev/gpioc0" + +if [ ! -e "$GPIOC" ]; then + logger -t "dec-hw" "Error: GPIO device does not exist, exiting." + exit 0 +fi + +i=1 +for PIN in 4 5; do + STATUS=$(gpioctl -f "$GPIOC" "$PIN") + printf "pwr%d=%d\n" "$i" "$STATUS" + i=$((i + 1)) +done diff --git a/sysutils/dec-hw/src/opnsense/service/conf/actions.d/actions_dechw.conf b/sysutils/dec-hw/src/opnsense/service/conf/actions.d/actions_dechw.conf new file mode 100644 index 0000000000..7483a404db --- /dev/null +++ b/sysutils/dec-hw/src/opnsense/service/conf/actions.d/actions_dechw.conf @@ -0,0 +1,5 @@ +[power] +command:/usr/local/opnsense/scripts/dec-hw/powerstat +parameters: +type:script_output +message:Deciso PWR LED state diff --git a/sysutils/dec-hw/src/www/widgets/include/dechw.inc b/sysutils/dec-hw/src/www/widgets/include/dechw.inc new file mode 100644 index 0000000000..64b6114020 --- /dev/null +++ b/sysutils/dec-hw/src/www/widgets/include/dechw.inc @@ -0,0 +1,3 @@ + + + + + + +

    +
    +
    + +
    +
    + +
    +
    From 7b94f91a5f3c99b907db8cad38e99141ea9f8f3a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Nov 2023 10:30:50 +0100 Subject: [PATCH 1668/3088] net/wireguard: add a filter reload if something was reconfigured PR: https://forum.opnsense.org/index.php?topic=37248.0 --- net/wireguard/Makefile | 2 +- net/wireguard/pkg-descr | 2 ++ .../src/opnsense/scripts/Wireguard/wg-service-control.php | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index f6ce57bbdf..ab8782ab78 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.5 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/pkg-descr b/net/wireguard/pkg-descr index 57bbbedb31..0d5c694c16 100644 --- a/net/wireguard/pkg-descr +++ b/net/wireguard/pkg-descr @@ -20,6 +20,8 @@ Changelog * Fix error with empty tunnel address in instance (contributed by Monviech) * Switch "setconf" to "syncconf" on (re)configuration +* Fix regression of UUID return in setClientAction() +* Reload the packet filter after reconfiguration * Allow instance selection from peer * Use "syncconf" on newwanip event * CARP event handling improvements diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index 249e6f606a..0e09a98a60 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -294,5 +294,9 @@ function get_stat_hash($fhandle) } } } + + if (count($server_devs)) { + configd_run('filter reload'); /* XXX required for NAT rules, but needs coalescing */ + } } closelog(); From 88673948cd8cb09ce40df3fcb4350d151ab778fc Mon Sep 17 00:00:00 2001 From: Pierre Christen <404111+netadvanced@users.noreply.github.com> Date: Thu, 30 Nov 2023 07:26:06 +0100 Subject: [PATCH 1669/3088] [net-mgmt/telegraf] Fixed #3633 + additional UI cleanup (#3652) --- .../OPNsense/Telegraf/forms/output.xml | 80 +++++++++++++++---- .../app/models/OPNsense/Telegraf/Input.xml | 2 +- .../app/models/OPNsense/Telegraf/Output.xml | 70 +++++++++++----- .../templates/OPNsense/Telegraf/telegraf.conf | 35 +++++--- 4 files changed, 143 insertions(+), 44 deletions(-) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index 9b17933184..4f085287fb 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -1,4 +1,8 @@
    + + + header + output.influx_enable @@ -41,6 +45,10 @@ checkbox This will skip chain and host verification. + + + header + output.influx_v2_enable @@ -83,6 +91,10 @@ text Flush timeout for the v2 Telegraf output in seconds, formatted as a string. If not provided, will default to 5. 0 means no timeout, but is not recommended. Increase if you get timeout errors. + + + header + output.graphite_enable @@ -125,6 +137,10 @@ checkbox This will enable support for tags. + + + header + output.graylog_enable @@ -137,6 +153,10 @@ text Set the IP and port where metrics shoud be sent to. + + + header + output.elastic_enable @@ -155,7 +175,7 @@ text Optional HTTP basic authentication details for Elasticsearch. - + output.elastic_password text @@ -173,6 +193,10 @@ text Set the index name. + + + header + output.prometheus_enable @@ -197,6 +221,10 @@ checkbox Send string metrics as Prometheus labels. + + + header + output.datadog_enable @@ -215,6 +243,10 @@ text Set the API Key for accessing Datadog. + + + header + output.mqtt_enable @@ -223,21 +255,41 @@ output.mqtt_topic_prefix - + text - Topic for producer messages. + MQTT Topic Prefix - Will be overidden by the Topic if defined below. + + + output.mqtt_topic + + text + MQTT Topic for produced messages. if left blank, will default to [ mqtt_topic_prefix/{{ .Hostname }}/{{ .PluginName }} ] output.mqtt_servers - text - URLs of mqtt brokers. Format is without square brackets, just like localhost:8083. + select_multiple + + true + URL of MQTT brokers. Format is without square brackets, just like localhost:8083 or mqtts://server.net:8883. The same credentials will be used when defining multiple brokers. + + + output.mqtt_insecure_skip_verify + + checkbox + Use TLS, but skip chain and host verification. output.mqtt_qos - text - QoS policy for messages. 0 = at most once, 1 = at least once, 2 = exactly once. Defaults to 2. + dropdown + QoS policy for messages. 0 = at most once, 1 = at least once, 2 = exactly once. Defaults to 2. + + + output.mqtt_retain + + checkbox + When selected, metrics will have the RETAIN flag set. output.mqtt_username @@ -261,18 +313,18 @@ output.mqtt_timeout text - Timeout for write operations. Default is 5s. + Timeout for write operations. Default is 5s. - output.mqtt_insecure_skip_verify - - checkbox - Use TLS, but skip chain and host verification. + output.mqtt_layout + + dropdown + Data layout to output. Defaults to "non-batch". - output.mqtt_format + output.mqtt_data_format - text + dropdown Data format to output. Defaults to "influx". diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml index 95e8efdf82..51b8e4645d 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Input.xml @@ -35,7 +35,7 @@ 1 N - + 0 N diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index baee0a02a7..634145ed9a 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -1,7 +1,7 @@ //OPNsense/telegraf/output Telegraf outputs configuration - 1.4.3 + 1.4.5 0 @@ -147,25 +147,42 @@ N /^([0-9a-zA-Z._\-]){1,128}$/u - Only characters, numbers, a dot, underscore and hyphen allowed. Do not use more than 128 characters. + Only characters, numbers, a dot, underscore and hyphen are allowed. Do not use more than 128 characters. - + N + /^([0-9a-zA-Z._\-\/{}]){1,200}$/u + Only characters, numbers, a dot, underscore, hyphen, slash and curly braces are allowed. Do not use more than 200 characters. + + + N + Y + , + + 0 + N + N /^([0-9a-zA-Z._\-]){1,128}$/u Only characters, numbers, a dot, underscore and hyphen allowed. Do not use more than 128 characters. - + + 2 + Y + + (0) At most once + (1) At least once + (2) Exactly once + + + N - 0 - 2 - Allowed values are 0-2 - + 5 N @@ -180,15 +197,32 @@ N - - 0 - N - - - - N - /^([0-9a-zA-Z._\-]){1,128}$/u - Only characters, numbers, a dot, underscore and hyphen allowed. Do not use more than 128 characters. - + + non-batch + Y + + (non-batch) send individual messages, one for each metric + (batch) send all metric as a single message per MQTT topic + (field) send individual messages for each field + + + + influx + Y + + Carbon2 + CloudEvents + CSV + Graphite + Influx + Json + MsgPack + NowMetric + Prometheus + PrometheusRemoteWrite + SplunkMetric + Wavefront + + diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index 355eb96a95..a0ac2ca8be 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -1,7 +1,6 @@ {% if helpers.exists('OPNsense.telegraf.general.enabled') and OPNsense.telegraf.general.enabled == '1' %} [global_tags] - {% if helpers.exists('OPNsense.telegraf.key.keys.key') %} {% for key_list in helpers.toList('OPNsense.telegraf.key.keys.key') %} {% if key_list.enabled == '1' %} @@ -94,13 +93,24 @@ {% if helpers.exists('OPNsense.telegraf.output.mqtt_enable') and OPNsense.telegraf.output.mqtt_enable == '1' %} [[outputs.mqtt]] {% if helpers.exists('OPNsense.telegraf.output.mqtt_servers') and OPNsense.telegraf.output.mqtt_servers != '' %} - servers = ["{{ OPNsense.telegraf.output.mqtt_servers }}"] + servers = [{{ '"' + ('","'.join(OPNsense.telegraf.output.mqtt_servers.split(","))) + '"' }}] {% endif %} -{% if helpers.exists('OPNsense.telegraf.output.mqtt_topic_prefix') and OPNsense.telegraf.output.mqtt_topic_prefix != '' %} - topic_prefix = "{{ OPNsense.telegraf.output.mqtt_topic_prefix }}" +{% if helpers.exists('OPNsense.telegraf.output.mqtt_topic') and OPNsense.telegraf.output.mqtt_topic != '' %} + topic = "{{ OPNsense.telegraf.output.mqtt_topic }}" +{% else %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_topic_prefix') and OPNsense.telegraf.output.mqtt_topic_prefix != '' %} + topic = "{{ OPNsense.telegraf.output.mqtt_topic_prefix + '/{{ .Hostname }}/{{ .PluginName }}' }}" +{% else %} + topic = "{{ 'telegraf/{{ .Hostname }}/{{ .PluginName }}' }}" +{% endif %} {% endif %} {% if helpers.exists('OPNsense.telegraf.output.mqtt_qos') and OPNsense.telegraf.output.mqtt_qos != '' %} - topic_prefix = "{{ OPNsense.telegraf.output.mqtt_qos }}" + qos = {{ OPNsense.telegraf.output.mqtt_qos }} +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_retain') and OPNsense.telegraf.output.mqtt_retain == '1' %} + retain = true +{% else %} + retain = false {% endif %} {% if helpers.exists('OPNsense.telegraf.output.mqtt_client_id') and OPNsense.telegraf.output.mqtt_client_id != '' %} client_id = "{{ OPNsense.telegraf.output.mqtt_client_id }}" @@ -111,14 +121,17 @@ {% if helpers.exists('OPNsense.telegraf.output.mqtt_username') and OPNsense.telegraf.output.mqtt_username != '' %} username = "{{ OPNsense.telegraf.output.mqtt_username }}" {% endif %} -{% if helpers.exists('OPNsense.telegraf.output.mqtt_password') and OPNsense.telegraf.output.mqtt_password != '' %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_password') and OPNsense.telegraf.output.mqtt_password != '' %} password = "{{ OPNsense.telegraf.output.mqtt_password }}" {% endif %} -{% if helpers.exists('OPNsense.telegraf.output.mqtt_insecure_skip_verify') and OPNsense.telegraf.output.mqtt_insecure_skip_verify == '1' %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_insecure_skip_verify') and OPNsense.telegraf.output.mqtt_insecure_skip_verify == '1' %} insecure_skip_verify = true {% else %} insecure_skip_verify = false {% endif %} +{% if helpers.exists('OPNsense.telegraf.output.mqtt_layout') and OPNsense.telegraf.output.mqtt_layout != '' %} + layout = "{{ OPNsense.telegraf.output.mqtt_layout }}" +{% endif %} {% if helpers.exists('OPNsense.telegraf.output.mqtt_data_format') and OPNsense.telegraf.output.mqtt_data_format != '' %} data_format = "{{ OPNsense.telegraf.output.mqtt_data_format }}" {% endif %} @@ -333,10 +346,10 @@ {% if helpers.exists('OPNsense.telegraf.input.unbound') and OPNsense.telegraf.input.unbound == '1' %} [[inputs.unbound]] - binary = "/usr/local/sbin/unbound-control" - config_file = "/var/unbound/unbound.conf" - thread_as_tag = true - timeout = "5s" + binary = "/usr/local/sbin/unbound-control" + config_file = "/var/unbound/unbound.conf" + thread_as_tag = true + timeout = "5s" {% endif %} {% if helpers.exists('OPNsense.telegraf.input.apcupsd') and OPNsense.telegraf.input.apcupsd == '1' %} From 766804aa08af1c4edadaf77a9884f00dca1d0b7b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 30 Nov 2023 07:55:32 +0100 Subject: [PATCH 1670/3088] net-mgmt/telegraf: bump version and changelog --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index 9704c0c8f9..c9cc2cfb21 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.12.9 +PLUGIN_VERSION= 1.12.10 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 190772affe..2d83a444a1 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.influxdata.com/time-series-platform/telegraf/ Plugin Changelog ================ +1.12.10 + +* Fix MQTT output and additional UI cleanup (contributed by Pierre Christen) + 1.12.9 * Add MQTT output From 1ee95029f0ee47aa71174958e4b06c7d88264dc6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 30 Nov 2023 08:11:33 +0100 Subject: [PATCH 1671/3088] sysutils/dec-hw: style sweep --- sysutils/dec-hw/Makefile | 1 - sysutils/dec-hw/pkg-descr | 1 - .../mvc/app/controllers/OPNsense/dechw/Api/InfoController.php | 4 ++-- sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sysutils/dec-hw/Makefile b/sysutils/dec-hw/Makefile index 326b548953..5ac268775e 100644 --- a/sysutils/dec-hw/Makefile +++ b/sysutils/dec-hw/Makefile @@ -5,4 +5,3 @@ PLUGIN_MAINTAINER= stephan.de.wit@deciso.com PLUGIN_TIER= 2 .include "../../Mk/plugins.mk" - diff --git a/sysutils/dec-hw/pkg-descr b/sysutils/dec-hw/pkg-descr index c8f40a55ed..30378c6218 100644 --- a/sysutils/dec-hw/pkg-descr +++ b/sysutils/dec-hw/pkg-descr @@ -1,4 +1,3 @@ This package allows fetching the current power status for Deciso appliances with dual power supplies via an API call and includes a simple dashboard widget. - diff --git a/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php b/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php index 9581cc1012..ad0393ba4f 100644 --- a/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php +++ b/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php @@ -37,7 +37,7 @@ public function powerStatusAction() { $result = [ "status" => "failed", - "status_translated" => gettext("Power status could not be fetched. + "status_translated" => gettext("Power status could not be fetched. This widget is only applicable to Deciso hardware with dual power supplies.") ]; $status = parse_ini_string((new Backend())->configdRun('dechw power')); @@ -52,6 +52,6 @@ public function powerStatusAction() $result = array_merge($result, $status); } - return $result; + return $result; } } diff --git a/sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat b/sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat index 08773e4513..81c24a015f 100755 --- a/sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat +++ b/sysutils/dec-hw/src/opnsense/scripts/dec-hw/powerstat @@ -11,5 +11,5 @@ i=1 for PIN in 4 5; do STATUS=$(gpioctl -f "$GPIOC" "$PIN") printf "pwr%d=%d\n" "$i" "$STATUS" - i=$((i + 1)) + i=$((i + 1)) done From 111564a35eb240d3a27e6dd6d15ac4cdde8d0ef2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 30 Nov 2023 08:40:05 +0100 Subject: [PATCH 1672/3088] README: sync --- README.md | 1 + sysutils/dec-hw/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e39602c7d..5da2442d40 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ security/wazuh-agent -- Agent for the open source security platform Wazuh sysutils/apcupsd -- APCUPSD - APC UPS daemon sysutils/api-backup -- EoL, core endpoint is /api/core/backup/download/this (pending removal) sysutils/apuled -- PC Engine APU LED control (development only) +sysutils/dec-hw -- Deciso hardware specific information sysutils/dmidecode -- Display hardware information on the dashboard sysutils/git-backup -- Track config changes using git sysutils/hw-probe -- Collect hardware diagnostics diff --git a/sysutils/dec-hw/Makefile b/sysutils/dec-hw/Makefile index 5ac268775e..e605779641 100644 --- a/sysutils/dec-hw/Makefile +++ b/sysutils/dec-hw/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= dec-hw PLUGIN_VERSION= 1.0 -PLUGIN_COMMENT= Deciso Hardware specific information +PLUGIN_COMMENT= Deciso hardware specific information PLUGIN_MAINTAINER= stephan.de.wit@deciso.com PLUGIN_TIER= 2 From 6b4680f58fb2c889a9e87a8c188b8b0ff78f3e0d Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 5 Dec 2023 23:17:58 +0100 Subject: [PATCH 1673/3088] net/haproxy: fix typo in cert sync script --- net/haproxy/pkg-descr | 3 +++ net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 22d70bfaea..def41ade07 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,9 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +Fixed: +* fix typo in cert sync script + 4.1 Fixed: diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py index cf8ac67975..f4932a0cdb 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py @@ -357,7 +357,7 @@ def sync(self): for message in cert['messages']: print(" " + repr(message)) - for cert in sync['delete']: + for cert in sync['deleted']: print(f"\n DEL: {cert['cert']}") for message in cert['messages']: print(" " + repr(message)) From 13ab16cd96dda236c9e4c6481e6b09662e8f2179 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 5 Dec 2023 23:23:53 +0100 Subject: [PATCH 1674/3088] net/haproxy: replace bundled haproxyctl library The bundled library is a modified version of haproxyctl: https://github.com/neurogeek/haproxyctl Now a proper fork was created: https://github.com/markt-de/haproxy-cli The FreeBSD port is pending approval: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275562 --- net/haproxy/Makefile | 2 +- net/haproxy/pkg-descr | 3 + .../OPNsense/HAProxy/lib/haproxy/__init__.py | 3 - .../OPNsense/HAProxy/lib/haproxy/cmds.py | 335 ------------------ .../OPNsense/HAProxy/lib/haproxy/conn.py | 83 ----- .../OPNsense/HAProxy/lib/haproxy/const.py | 7 - .../HAProxy/lib/haproxy/tests/__init__.py | 0 .../HAProxy/lib/haproxy/tests/test_cmds.py | 291 --------------- .../HAProxy/lib/haproxy/tests/test_conn.py | 59 --- .../scripts/OPNsense/HAProxy/socketCommand.py | 1 - .../scripts/OPNsense/HAProxy/syncCerts.py | 1 - 11 files changed, 4 insertions(+), 781 deletions(-) delete mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py delete mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py delete mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py delete mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py delete mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py delete mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py delete mode 100755 net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 49233c6f06..95013f8e1b 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -2,7 +2,7 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 4.1 PLUGIN_REVISION= 1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer -PLUGIN_DEPENDS= haproxy26 +PLUGIN_DEPENDS= haproxy26 py${PLUGIN_PYTHON}-haproxy-cli PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index def41ade07..2681b9f8d8 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -9,6 +9,9 @@ Plugin Changelog Fixed: * fix typo in cert sync script +Changed: +* replace bundled haproxyctl library with haproxy-cli + 4.1 Fixed: diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py deleted file mode 100755 index c7f37eafa1..0000000000 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""haproxy lib for socket commands. -Based on: https://github.com/neurogeek/haproxyctl""" -__version__ = "1.0" diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py deleted file mode 100755 index 733daf113b..0000000000 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/cmds.py +++ /dev/null @@ -1,335 +0,0 @@ -"""cmds.py - Implementations of the different HAProxy commands""" -import re -import csv -import json -from collections import OrderedDict -from io import StringIO - -class Cmd(): - """Cmd - Command base class""" - req_args = [] - args = {} - cmdTxt = "" - helpTxt = "" - - # pylint: disable=unused-argument - def __init__(self, *args, **kwargs): - """Argument to the command are given in kwargs only. We ignore *args.""" - self.args = kwargs - valid_kwargs = [k for (k, v) in kwargs.items() if v is not None] - - if not all([a in valid_kwargs for a in self.req_args]): - raise Exception(f"Wrong number of arguments. Required arguments are: {self.WhatArgs()}") - - def WhatArgs(self): - """Returns a formatted string of arguments to this command.""" - return ",".join(self.req_args) - - @classmethod - def getHelp(cls): - """Get formatted help string for this command.""" - txtArgs = ",".join(cls.req_args) - - if not txtArgs: - txtArgs = "None" - return " ".join((cls.helpTxt, "Arguments: %s" % txtArgs)) - - def getCmd(self): - """Gets the command line for this command. - The default behavior is to apply the args dict to cmdTxt - """ - return self.cmdTxt % self.args - - def getBootstrapOutput(self, resObj): - """ Returns results gathered from HAProxy as jquery bootstrap output """ - args = { - "rows": resObj, - "page": int(self.args['page']) if self.args['page'] != None else 1, - "page_rows": int(self.args['page_rows']) if self.args['page_rows'] != None else len(rows), - "search": self.args['search'], - "sort_col": self.args['sort_col'] if self.args['sort_col'] else 'id', - "sort_dir": self.args['sort_dir'], - } - rows = args['rows'] - # search - if args['search']: - filtered_rows = [] - for row in rows: - def inner(row): - for k, v in row.items(): - if args['search'] in v: - return row - return None - - match = inner(row) - if match: - filtered_rows.append(match) - rows = filtered_rows - - # sort - rows.sort(key=lambda k: k[args['sort_col']], reverse=True if args['sort_dir'] == 'desc' else False) - - # pager - total = len(rows) - pages = [rows[i:i + args['page_rows']] for i in range(0, total, args['page_rows'])] - if pages and (args['page'] > len(pages) or args['page'] < 1): - raise KeyError(f"Current page {args['page']} does not exist. Available pages: {len(pages)}") - page = pages[args['page'] - 1] if pages else [] - - return json.dumps({ - "rows": page, - "total": total, - "rowCount": args['page_rows'], - "current": args['page'] - }) - - def getJsonOutput(self, resObj): - """Returns results gathered from HAProxy as json""" - return json.dumps(resObj) - - def getResult(self, res): - """Returns raw results gathered from HAProxy""" - if res == '\n': - res = None - - if self.args['output'] == 'json': - return self.getJsonOutput(self.getResultObj(res)) - - if self.args['output'] == 'bootstrap': - return self.getBootstrapOutput(self.getResultObj(res)) - - return res - - def getResultObj(self, res): - """Returns refined output from HAProxy, packed inside a Python obj i.e. a dict()""" - return res - -class setServerAgent(Cmd): - cmdTxt = "set server %(backend)s/%(server)s agent %(value)s\r\n" - req_args = ['backend', 'server', 'value'] - helpTxt = "Force a server's agent to a new state." - -class setServerHealth(Cmd): - cmdTxt = "set server %(backend)s/%(server)s health %(value)s\r\n" - req_args = ['backend', 'server', 'value'] - helpTxt = "Force a server's health to a new state." - -class setServerState(Cmd): - cmdTxt = "set server %(backend)s/%(server)s state %(value)s\r\n" - req_args = ['backend', 'server', 'value'] - helpTxt = "Force a server's administrative state to a new state." - -class setServerWeight(Cmd): - cmdTxt = "set server %(backend)s/%(server)s weight %(value)s\r\n" - req_args = ['backend', 'server', 'value'] - helpTxt = "Force a server's weight to a new state." - -class showSslCrtLists(Cmd): - cmdTxt = "show ssl crt-list\r\n" - helpTxt = "Show the list of crt-lists." - - def getResultObj(self, res): - result = { "crt_lists": []} - for line in res.split("\n"): - if line.startswith('/'): - result["crt_lists"].append(line) - return result - -class showSslCrtList(Cmd): - cmdTxt = "show ssl crt-list -n %(crt_list)s\r\n" - req_args = ['crt_list'] - helpTxt = "Show the the content of a crt-list." - - def getResultObj(self, res): - result = {} - list_id = None - for line in res.split("\n"): - if line.startswith('# '): - list_id = line.split("# ")[1] - result["certs"] = [] - - if list_id and line.startswith('/'): - result["certs"].append(line) - - if result: - return result - - return {"error": res.strip()} - -class showSslCerts(Cmd): - cmdTxt = "show ssl cert\r\n" - helpTxt = "Display the SSL certificates used in memory." - - def getResultObj(self, res): - result = { - "transaction": [], - "filename": [] - } - for line in res.split("\n"): - if line.startswith('*'): - result['transaction'].append(line) - elif line.startswith('/'): - result['filename'].append(line) - return result - -class showSslCert(Cmd): - cmdTxt = "show ssl cert %(certfile)s\r\n" - req_args = ['certfile'] - helpTxt = "Display the details of a SSL certificate used in memory." - - def getResultObj(self, res): - result = {} - cert_id = None - for line in res.split("\n"): - if line: - key = line.split(":")[0] - val = line.split(":")[1].strip() - - if key == 'Filename': - cert_id = val - - if cert_id: - result[key] = val - - if result: - return result - - return {"error": res.strip()} - -class addToSslCrtList(Cmd): - cmdTxt = "add ssl crt-list %(crt_list)s %(certfile)s\r\n" - req_args = ['crt_list', 'certfile'] - helpTxt = "Add a ssl cert to a crt-list." - -class delFromSslCrtList(Cmd): - cmdTxt = "del ssl crt-list %(crt_list)s %(certfile)s\r\n" - req_args = ['crt_list', 'certfile'] - helpTxt = "Delete a ssl cert from a crt-list." - -class newSslCrt(Cmd): - """" Create an empty slot for the certificate in HAProxy’s memory """ - cmdTxt = "new ssl cert %(certfile)s\r\n" - req_args = ['certfile'] - helpTxt = "Create a new certificate file to be used in a crt-list or a directory." - -class updateSslCrt(Cmd): - """" Begin a transaction to upload the certificate into a slot in HAProxy’s memory """ - cmdTxt = "set ssl cert %(certfile)s <<\n%(payload)s\r\n" - req_args = ['certfile', 'payload'] - helpTxt = "Replace a certificate file." - -class delSslCrt(Cmd): - """" Begin a transaction to remove the certificate from a slot in HAProxy’s memory """ - cmdTxt = "del ssl cert %(certfile)s\r\n" - req_args = ['certfile'] - helpTxt = "Delete delete an unused certificate file." - -class commitSslCrt(Cmd): - """ Commit the transaction so HAProxy detects the change. """ - cmdTxt = "commit ssl cert %(certfile)s\r\n" - req_args = ['certfile'] - helpTxt = "Commit a certificate file." - -class abortSslCrt(Cmd): - cmdTxt = "abort ssl cert %(certfile)s\r\n" - req_args = ['certfile'] - helpTxt = "Abort a transaction for a certificate file." - -class showFBEnds(Cmd): - """Base class for getting a listing Frontends and Backends""" - switch = "" - cmdTxt = "show stat\r\n" - - def getResult(self, res): - return "\n".join(self._getResult(res)) - - def getResultObj(self, res): - return self._getResult(res) - - def _getResult(self, res): - """Show Frontend/Backends. To do this, we extract info from - the stat command and filter out by a specific - switch (FRONTEND/BACKEND)""" - - if not self.switch: - raise Exception("No action specified") - - result = [] - lines = res.split('\n') - cl = re.compile("^[^,].+," + self.switch.upper() + ",.*$") - - for e in lines: - me = re.match(cl, e) - if me: - print(e) - result.append(e.split(",")[0]) - return result - -class showFrontends(showFBEnds): - """Show frontends command.""" - switch = "frontend" - helpTxt = "List all Frontends." - -class showBackends(showFBEnds): - """Show backends command.""" - switch = "backend" - helpTxt = "List all Backends." - -class showInfo(Cmd): - """Show info HAProxy command""" - cmdTxt = "show info\r\n" - helpTxt = "Show info on HAProxy instance." - - def getResultObj(self, res): - resDict = {} - for line in res.split('\n'): - k, v = line.split(':') - resDict[k] = v - - return resDict - -class showSessions(Cmd): - """Show sess HAProxy command""" - cmdTxt = "show sess\r\n" - helpTxt = "Show HAProxy sessions." - - def getResultObj(self, res): - return res.split('\n') - -class baseStat(Cmd): - """Base class for stats commands.""" - - def getDict(self, res): - # clean response - res = re.sub(r'^# ', '', res, re.MULTILINE) - res = re.sub(r',\n', '\n', res, re.MULTILINE) - res = re.sub(r',\n\n', '\n', res, re.MULTILINE) - - csv_string = StringIO(res) - return csv.DictReader(csv_string, delimiter=',') - -class showServers(baseStat): - """Show all servers. If backend is given, show only servers for this backend. """ - cmdTxt = "show stat\r\n" - helpTxt = "Lists all servers. Filter for servers in backend, if set." - - def getResultObj(self, res): - servers = [] - - reader = self.getDict(res) - for row in reader: - row = OrderedDict(row) - # show only server - if row['svname'] in ['BACKEND', 'FRONTEND']: - continue - - # filter server for given backend - if self.args['backend'] and row['pxname'] != self.args['backend']: - continue - - # add id - row['id'] = f"{row['pxname']}/{row['svname']}" - row.move_to_end('id', last=False) - servers.append(dict(row)) - - return servers diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py deleted file mode 100755 index 0c38673c16..0000000000 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/conn.py +++ /dev/null @@ -1,83 +0,0 @@ -# pylint: disable=locally-disabled, too-few-public-methods, no-self-use, invalid-name -"""conn.py - Connection module.""" -import re -from socket import socket, AF_INET, AF_UNIX, SOCK_STREAM -from haproxy import const - -class HapError(Exception): - """Generic exception for haproxyctl.""" - pass - -class HaPConn(object): - """HAProxy Socket object. - This class abstract the socket interface so - commands can be sent to HAProxy and results received and - parse by the command objects""" - - def __init__(self, sfile, socket_module=socket): - """Initializes an HAProxy and opens a connection to it - (sfile, type) -> Path for the UNIX socket""" - - self.sock = None - sfile = sfile.strip() - stype = AF_UNIX - self.socket_module = socket_module - - mobj = re.match( - '(?Punix://|tcp://)(?P[^:]+):*(?P[0-9]*)$', sfile) - - if mobj: - proto = mobj.groupdict().get('proto', None) - addr = mobj.groupdict().get('addr', None) - port = mobj.groupdict().get('port', '') - - if not addr or not proto: - raise HapError('Could not determine type of socket.') - - if proto == const.HAP_TCP_PATH: - if not port: - raise HapError('When using a tcp socket, a port is needed.') - stype = AF_INET - sfile = (addr, int(port)) - - if proto == const.HAP_UNIX_PATH: - stype = AF_UNIX - sfile = addr - - # Fallback should be sfile/AF_UNIX by default - self.sfile = (sfile, stype) - self.open() - - def open(self): - """Opens a connection for the socket. - This function should only be called if - self.closed() method was called""" - - sfile, stype = self.sfile - self.sock = self.socket_module(stype, SOCK_STREAM) - self.sock.connect(sfile) - - def sendCmd(self, cmd, objectify=False): - """Receives a command obj and sends it to the socket. Receives the output and passes it - through the command to parse it. - objectify -> Return an object instead of plain text""" - - res = "" - try: - self.sock.send(cmd.getCmd()) - except TypeError: - self.sock.send(bytearray(cmd.getCmd(), 'ASCII')) - output = self.sock.recv(const.HAP_BUFSIZE) - - while output: - res += output.decode('UTF-8') - output = self.sock.recv(const.HAP_BUFSIZE) - - if objectify: - return cmd.getResultObj(res) - - return cmd.getResult(res) - - def close(self): - """Closes the socket""" - self.sock.close() diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py deleted file mode 100755 index ebd60d8c89..0000000000 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/const.py +++ /dev/null @@ -1,7 +0,0 @@ -"""const.py - Constants for haproxyctl.""" -HAP_OK = 1 -HAP_ERR = 2 -HAP_SOCK_ERR = 3 -HAP_BUFSIZE = 8192 -HAP_UNIX_PATH = 'unix://' -HAP_TCP_PATH = 'tcp://' diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/__init__.py deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py deleted file mode 100755 index 3277871636..0000000000 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_cmds.py +++ /dev/null @@ -1,291 +0,0 @@ -# pylint: disable=star-args, locally-disabled, too-few-public-methods, no-self-use, invalid-name -"""test_cmds.py - Unittests related to command implementations.""" -import sys, os, unittest - -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) -from haproxy import cmds - - -class TestCommands(unittest.TestCase): - """Tests all of the commands.""" - - def setUp(self): - self.maxDiff = None - self.pem_cert_content = """ - -----BEGIN CERTIFICATE----- - MIIGNjCCBR6gAwIBAgITAPoWnilNUBNcAb8iJ2dgK1eXeTANBgkqhkiG9w0BAQsF - ADAiMSAwHgYDVQQDDBdGYWtlIExFIEludGVybWVkaWF0ZSBYMTAeFw0yMTAyMDMw - ODQ2MTBaFw0yMTA1MDQwODQ2MTBaMBoxGDAWBgNVBAMTD3Rlc3QuYW5kZW1hbi5k - ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL7DSlOfRdoKZdX825O4 - Q+uEN85NYR/SJtSLDfaaRebanbDzxp90PEIHCqZyf0q7Zz5eF6qd2ycldtJSVk8b - lVOyJjPIOLUrUAeF6I07b/AOBO/8DU9G3lARSOQkPmC80ahGAW3F1eaccf08qncW - CGxKKXmeL9mbAsA4k6+6pIq8YRBqMCE2bkRQ/scAa8pL7ms5hceONWfqjHC12zIp - yavvnfNVZ6z7QlwHEh3Rajk1IaHLyE7+9+oQ3zXqFtM6sBvXlvVhwsizgkH3ZodN - 81ycvHoP1MWqHGHX0klREQ9qRrHuSuqHsjJHX8gtbqI2Z9DVOUUEunbIkImTwqYj - e5tp7g4RQJUgAdsauyN02NTdeUeci+JDvA3FHJpAtA7tDXIeNcyPjRho17i4VUIc - Yasu5JDF0iSPDT/Srxt6EsDntDFDco1HXMsFqUhMbY2+gUWC3P0n98VWSO+BCtAd - Fbc4+N3QEM8RnQKI86WHR/vnVDoigOhALupXa6czjLGMjaSLDI0nyJ5M81r8ZuBZ - Wu2Q6HTikNmoWl3w6x+9WvY6TQd9OpCjQUu13UMVAco8CGEOj0ZqhhLTccX8dxPK - /01bXMtFRivJfe6vML+O0N54JbI5caXmaEdcEuazAVJWt1ZPGFTMjiw/O0S6Hb0V - YJKXqjJs9t95O5MpL9W4YvGxAgMBAAGjggJrMIICZzAOBgNVHQ8BAf8EBAMCBaAw - HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYD - VR0OBBYEFHQLXiD/GxQD11ocGiFauejS5RRmMB8GA1UdIwQYMBaAFMDMA0a5WCDM - XHJw8+EuyyCm9Wg6MHcGCCsGAQUFBwEBBGswaTAyBggrBgEFBQcwAYYmaHR0cDov - L29jc3Auc3RnLWludC14MS5sZXRzZW5jcnlwdC5vcmcwMwYIKwYBBQUHMAKGJ2h0 - dHA6Ly9jZXJ0LnN0Zy1pbnQteDEubGV0c2VuY3J5cHQub3JnLzAaBgNVHREEEzAR - gg90ZXN0LmFuZGVtYW4uZGUwTAYDVR0gBEUwQzAIBgZngQwBAgEwNwYLKwYBBAGC - 3xMBAQEwKDAmBggrBgEFBQcCARYaaHR0cDovL2Nwcy5sZXRzZW5jcnlwdC5vcmcw - ggEDBgorBgEEAdZ5AgQCBIH0BIHxAO8AdQAW6GnB0ZXq18P4lxrj8HYB94zhtp0x - qFIYtoN/MagVCAAAAXdnSPbpAAAEAwBGMEQCICAST5iJD7DVrcKRvu9rvNVVnkOW - hAYUgihWr/1Gu6VdAiAcRcZYBP0hIHmFExM9ehJ+J7YmqM35SyiC7s0chsNdHQB2 - AN2ZNPyl5ySAyVZofYE0mQhJskn3tWnYx7yrP1zB825kAAABd2dI+N0AAAQDAEcw - RQIgaaUndm8O3+nCl5OHTf6rOdi9VF9szVckdgDargdWKkgCIQCAjW4UvuMIv4Bt - c6auowPcpdqHjL8XRcztJA3XUGRGHTANBgkqhkiG9w0BAQsFAAOCAQEABza4/ocY - J/XwN8PP+Ane7fVerqL7mRfhzJhxz4mbCPfv4Drq3kUu9fnhR/vaGgdaNdnO83a9 - PUBCm6FCPMcVwX0uKDJ9J4Xj+SVjnVu4+7uhS5LyygtaegoBZyMb5ppxWH1n5r47 - 10ug+KptERFf1datb8/jsEVF7rYCtPXBygjfGAbGuCxViakr4BNcOBPNL+MusfvP - qpH8kEyPAIwHX02XvvpLTy77qiyTpQSuFOusOJptNNqBUeBehqpf8FHn01fnKkcW - pKmFJ2e2VSnTZIBJvD58HMR+WNAEp7tHffHk2z/mPPtdRdxW5Zieoe5+6+HDtwgG - +VCAIWMkC36Dvg== - -----END CERTIFICATE----- - - -----BEGIN RSA PRIVATE KEY----- - MIIJKgIBAAKCAgEAvsNKU59F2gpl1fzbk7hD64Q3zk1hH9Im1IsN9ppF5tqdsPPG - n3Q8QgcKpnJ/SrtnPl4Xqp3bJyV20lJWTxuVU7ImM8g4tStQB4XojTtv8A4E7/wN - T0beUBFI5CQ+YLzRqEYBbcXV5pxx/TyqdxYIbEopeZ4v2ZsCwDiTr7qkirxhEGow - ITZuRFD+xwBrykvuazmFx441Z+qMcLXbMinJq++d81VnrPtCXAcSHdFqOTUhocvI - Tv736hDfNeoW0zqwG9eW9WHCyLOCQfdmh03zXJy8eg/UxaocYdfSSVERD2pGse5K - 6oeyMkdfyC1uojZn0NU5RQS6dsiQiZPCpiN7m2nuDhFAlSAB2xq7I3TY1N15R5yL - 4kO8DcUcmkC0Du0Nch41zI+NGGjXuLhVQhxhqy7kkMXSJI8NP9KvG3oSwOe0MUNy - jUdcywWpSExtjb6BRYLc/Sf3xVZI74EK0B0Vtzj43dAQzxGdAojzpYdH++dUOiKA - 6EAu6ldrpzOMsYyNpIsMjSfInkzzWvxm4Fla7ZDodOKQ2ahaXfDrH71a9jpNB306 - kKNBS7XdQxUByjwIYQ6PRmqGEtNxxfx3E8r/TVtcy0VGK8l97q8wv47Q3nglsjlx - peZoR1wS5rMBUla3Vk8YVMyOLD87RLodvRVgkpeqMmz233k7kykv1bhi8bECAwEA - AQKCAgEAswbSPXJPetahRdcdNyAKVgBq4ykJinSOTpAF1bZo/cOTlFrjwAe0+X5k - R1tTDQ6dURG7AjtNTgrB3Za6O1m2paqeYaB5X8U7QSQx4EG0xsRRa+vPjeQDhX8D - OmCtTdpGpLa2Zo/xM5EFBVUm4cYCt6ZOED4dyAnK5hzytUvjWfR6343Yh4LurxyY - TqidgGgMZALDA0n54wFjNe/lu8kt5Ddns9MmDlhrqbRVEzjSiMfNPWvjHAf7IGcf - JBkBvNDqL+b/XGCYDgUxrLkDNt44E2VhGOi8lZkVM9n5FyeGbEIgAKKTGlGpMbh8 - MoA4wPFwMrO5IIXUfN+zjfnnBkZsnAomGQYDh/hrsQPwU7MoyfO0Wzw+RzLWK8JH - EnjR7O/Lgh+A2AdLhCLiRC5td2uuJ2yLRIRUlcQPsCsYnCCL6Ip9IwK1idmQySGw - bG83decXNSJUv5h3qF6f3fl+JPrHnAbviBzEJ67xAf1MdHbFxwYvRFVfEHj9RZ3W - z+cw7ofD8XVHTfXn0XipvYqI/bVsitMXI35pOt+/ZV8rjJlXopw+IV6U9/60cBkk - BXC7ONDyH2pNwxPbRgcLm2sEK0L9qhxRzCj0iD1WyOAiFJX4ytVbJhR7pt0goiun - i2XDh2l8hoK1lKZNS/yJ+VhnbX595mdqScmIXD8utlgK8f0bLfECggEBAORXimSK - gzegnsBjieTtzC6MmRRxxN46vnMZ2LCeLMxhs3vM7LBcBfsQYqbt/FVFtYBRpr+d - TGTmfPXqKuSqbtAbghxAMo/lECXzALa0nQSsz1fFhX8B7slFarsDmmCb1GmXF/kG - ku/Uoa7jmY3htBj5rjVHjDKPZFVetU+2wbuwlU17Bj4nlSzqud4NMlu56pm3FZ/1 - BAhMxm3z6dLnOgqJzpN1QmKZHNkjLmi8fza/HQM5pP3DpQcPiyuLzywGIqHaO1qT - OIdpZfLEvNpMV7bJ2bagv5nX3TVRWWsBkh0HCAuH30qqaVPpQvkPem1zsM3x+D5q - +PhMIPGpbQiUyCUCggEBANXefd0ZcJymG15WJyO44eFwzgMz9ezfdB8INa+vCOiZ - Y7FtYDgEKu4uzBxtMjO4mQO6DCkfi7JwTJFN4ag3dJEJNGmrf7Xe84IAImJQk0Of - BojAXCFAuNf1Xl3prkvnvtzNirwQMHCUbv5wYzOqglgj2i/hjIj3/Wbt91riq5j+ - 4qQT4kkw/XgCtbQ27HohKIcC/mXbHchEi7NtXrGoM1xqmu1mGH1uul3LQ6p5VwHc - ZFiIAC0awsx9Qe9khZ5EGpZuS0tqJsREcv8ygYMvWcPJEv8aMQM7Nj4biA5rKEgo - L+66ibpntldvbz2qntEvJ2rKzGci0RDUQHy4sW8/d50CggEBAKCZaX7ZZPzk/YL2 - /2+CSQ+cV7ZnZj2fN4Ag96UROxTsyp4SPY60yogQuDIMRGN9SfDcfNlcOvTkn5Me - hdiafqHkFxjjlixawYbPaPsYAS/ek156UDBKHbZ2GmE6YYP9VeKGIJhHpWUFOkqV - TdTaoB7IzVwv3E1bSQg6Om+8bHoj8n6yPmvMz0DuPpgM1BRrqLNAb/c3DwT/ari+ - ywBJHSt4TVCtMmnCouWdtvB3U0ogFLnF+2N4DUPwDMQt6yJdllIb+Y706NdkrA2Z - jfJDq5WmVnf6i4gaqTzs4GVAj5HW9jOV9ti/DqGz+CTQXB1LN1lCDIVqG34XnTwb - G9LjQfkCggEAZwYAt4tTtgJGWNFDlW+wT/sZIm3bX7ncpD4+Ll0w+2s4nPXFTfaj - /4zHgkIP1t5rx2HODdlGYDS8jZpow7HDE0LN3sFgienWf5808QtDhWWLrkCLoPEe - mdl3FeJFtgby6EaTODjMPM8kEKlvACp5E6BhsIMEQc7EYNrtNvjOFKtj3go+DWfu - EeusQB3dGI/0h+UnS0WcOSbb7RkYbphJ9ZDdBNMTpQi7+ga6l9pP0XOrWwJYo2Gq - yPrl0j4oJ69C54hF+RQvjIg0pT5dKSacJTYtUnn5dkcFwDFe/yMbinbhcCynwAXJ - zqC9g4U3cCk44bbDdENPVr4IOox13NND+QKCAQEAilm2oMZoP3WGkBMTSzJl6OGd - F8NnE95noleknNFYuThhCT6T4Z1s28VpxXV7d0DTNOtXj+TzeZq4jrwkgOSZbif0 - 8ky4gRZmm0iFwvAu8ZXk1olHbhMZnCOfh0Qhd4bU2tSoWgWVIAQWEHUhDI7Q1rsX - s4sCjYHKuNMEKdfYvxtKeiunoFqdmT65hwM9o3TfvJfm/RChb7i/nVruXQ6IhPEM - 9WYZS7hlKyqVBESJuonR15biy7Xov5ELl6A821cskZO3vTwtlBSeCDiqaeVLpKR3 - aYwf5YZo7v+N8KBSLEdLNjoKK4PfXUdczD7uOUllbd4/MRgCn4EmFvmpljGiEQ== - -----END RSA PRIVATE KEY----- - - -----BEGIN CERTIFICATE----- - MIIEqzCCApOgAwIBAgIRAIvhKg5ZRO08VGQx8JdhT+UwDQYJKoZIhvcNAQELBQAw - GjEYMBYGA1UEAwwPRmFrZSBMRSBSb290IFgxMB4XDTE2MDUyMzIyMDc1OVoXDTM2 - MDUyMzIyMDc1OVowIjEgMB4GA1UEAwwXRmFrZSBMRSBJbnRlcm1lZGlhdGUgWDEw - ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDtWKySDn7rWZc5ggjz3ZB0 - 8jO4xti3uzINfD5sQ7Lj7hzetUT+wQob+iXSZkhnvx+IvdbXF5/yt8aWPpUKnPym - oLxsYiI5gQBLxNDzIec0OIaflWqAr29m7J8+NNtApEN8nZFnf3bhehZW7AxmS1m0 - ZnSsdHw0Fw+bgixPg2MQ9k9oefFeqa+7Kqdlz5bbrUYV2volxhDFtnI4Mh8BiWCN - xDH1Hizq+GKCcHsinDZWurCqder/afJBnQs+SBSL6MVApHt+d35zjBD92fO2Je56 - dhMfzCgOKXeJ340WhW3TjD1zqLZXeaCyUNRnfOmWZV8nEhtHOFbUCU7r/KkjMZO9 - AgMBAAGjgeMwgeAwDgYDVR0PAQH/BAQDAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAw - HQYDVR0OBBYEFMDMA0a5WCDMXHJw8+EuyyCm9Wg6MHoGCCsGAQUFBwEBBG4wbDA0 - BggrBgEFBQcwAYYoaHR0cDovL29jc3Auc3RnLXJvb3QteDEubGV0c2VuY3J5cHQu - b3JnLzA0BggrBgEFBQcwAoYoaHR0cDovL2NlcnQuc3RnLXJvb3QteDEubGV0c2Vu - Y3J5cHQub3JnLzAfBgNVHSMEGDAWgBTBJnSkikSg5vogKNhcI5pFiBh54DANBgkq - hkiG9w0BAQsFAAOCAgEABYSu4Il+fI0MYU42OTmEj+1HqQ5DvyAeyCA6sGuZdwjF - UGeVOv3NnLyfofuUOjEbY5irFCDtnv+0ckukUZN9lz4Q2YjWGUpW4TTu3ieTsaC9 - AFvCSgNHJyWSVtWvB5XDxsqawl1KzHzzwr132bF2rtGtazSqVqK9E07sGHMCf+zp - DQVDVVGtqZPHwX3KqUtefE621b8RI6VCl4oD30Olf8pjuzG4JKBFRFclzLRjo/h7 - IkkfjZ8wDa7faOjVXx6n+eUQ29cIMCzr8/rNWHS9pYGGQKJiY2xmVC9h12H99Xyf - zWE9vb5zKP3MVG6neX1hSdo7PEAb9fqRhHkqVsqUvJlIRmvXvVKTwNCP3eCjRCCI - PTAvjV+4ni786iXwwFYNz8l3PmPLCyQXWGohnJ8iBm+5nk7O2ynaPVW0U2W+pt2w - SVuvdDM5zGv2f9ltNWUiYZHJ1mmO97jSY/6YfdOUH66iRtQtDkHBRdkNBsMbD+Em - 2TgBldtHNSJBfB3pm9FblgOcJ0FSWcUDWJ7vO0+NTXlgrRofRT6pVywzxVo6dND0 - WzYlTWeUVsO40xJqhgUQRER9YLOLxJ0O6C8i0xFxAMKOtSdodMB3RIwt7RFQ0uyt - n5Z5MqkYhlMI3J1tPRTp1nEt9fyGspBOO05gi148Qasp+3N+svqKomoQglNoAxU= - -----END CERTIFICATE----- - """ - - self.Resp = { - "disable": "disable server redis-ro/redis-ro0", - "set-server-agent": "set server redis-ro/redis-ro0 agent up", - "set-server-health": "set server redis-ro/redis-ro0 health stopping", - "set-server-state": "set server redis-ro/redis-ro0 state drain", - "set-server-weight": "set server redis-ro/redis-ro0 weight 10", - "frontends": "show stat", - "info": "show info", - "sessions": "show sess", - "servers": "show stat", - "show-ssl-crt-lists": "show ssl crt-list", - "show-ssl-crt-list": "show ssl crt-list -n /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", - "show-ssl-certs": "show ssl cert", - "show-ssl-cert": "show ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - "add-to-crt-list": "add ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", - "del-from-crt-list": "del ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist /tmp/haproxy/ssl/601a70e4844b0.pem", - "new-ssl-cert": "new ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - "update-ssl-cert": "set ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem <<\n%s" % self.pem_cert_content, - "del-ssl-cert": "del ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - "commit-ssl-cert": "commit ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - "abort-ssl-cert": "abort ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem", - } - - self.Resp = dict([(k, v + "\r\n") for k, v in self.Resp.items()]) - - def test_setServerAgent(self): - """Test 'set server agent' command""" - args = {"backend": "redis-ro", "server": "redis-ro0", "value": "up"} - cmdOutput = cmds.setServerAgent(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["set-server-agent"]) - - def test_setServerHealth(self): - """Test 'set server health' command""" - args = {"backend": "redis-ro", "server": "redis-ro0", "value": "stopping"} - cmdOutput = cmds.setServerHealth(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["set-server-health"]) - - def test_setServerState(self): - """Test 'set server state' command""" - args = {"backend": "redis-ro", "server": "redis-ro0", "value": "drain"} - cmdOutput = cmds.setServerState(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["set-server-state"]) - - def test_setServerWeight(self): - """Test 'set server weight' command""" - args = {"backend": "redis-ro", "server": "redis-ro0", "value": "10"} - cmdOutput = cmds.setServerWeight(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["set-server-weight"]) - - def test_showFrontends(self): - """Test 'frontends/backends' commands""" - args = {} - cmdOutput = cmds.showFrontends(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["frontends"]) - - def test_showInfo(self): - """Test 'show info' command""" - cmdOutput = cmds.showInfo().getCmd() - self.assertEqual(cmdOutput, self.Resp["info"]) - - def test_showSessions(self): - """Test 'show sess' command""" - cmdOutput = cmds.showSessions().getCmd() - self.assertEqual(cmdOutput, self.Resp["sessions"]) - - def test_showServers(self): - """Test 'show stat' command""" - args = {"backend": "redis-ro"} - cmdOutput = cmds.showServers(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["servers"]) - - def test_showSslCrtLists(self): - """Test 'show ssl crt-list' command""" - cmdOutput = cmds.showSslCrtLists().getCmd() - self.assertEqual(cmdOutput, self.Resp["show-ssl-crt-lists"]) - - def test_showSslCrtList(self): - """Test 'show ssl crt-list ' command""" - args = { - "crt_list": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", - } - cmdOutput = cmds.showSslCrtList(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["show-ssl-crt-list"]) - - def test_showSslCerts(self): - """Test 'show ssl cert' command""" - cmdOutput = cmds.showSslCerts().getCmd() - self.assertEqual(cmdOutput, self.Resp["show-ssl-certs"]) - - def test_showSslCert(self): - """Test 'show ssl cert ' command""" - args = { - "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem" - } - cmdOutput = cmds.showSslCert(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["show-ssl-cert"]) - - def test_addToSslCrtList(self): - """Test 'add ssl crt-list ' command""" - args = { - "crt_list": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", - "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem" - } - cmdOutput = cmds.addToSslCrtList(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["add-to-crt-list"]) - - def test_delFromSslCrtList(self): - """Test 'del ssl crt-list ' command""" - args = { - "crt_list": "/tmp/haproxy/ssl/601a7392cc9984.99301413.certlist", - "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem" - } - cmdOutput = cmds.delFromSslCrtList(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["del-from-crt-list"]) - - def test_newSslCrt(self): - """Test 'new ssl cert ' command""" - args = { - "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", - } - cmdOutput = cmds.newSslCrt(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["new-ssl-cert"]) - - def test_updateSslCrt(self): - """Test 'set ssl cert ' command""" - args = { - "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", - "payload": "%s" % self.pem_cert_content - } - cmdOutput = cmds.updateSslCrt(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["update-ssl-cert"]) - - def test_delSslCrt(self): - """Test 'del ssl cert ' command""" - args = { - "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", - } - cmdOutput = cmds.delSslCrt(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["del-ssl-cert"]) - - def test_commitSslCrt(self): - """Test 'commit ssl cert ' command""" - args = { - "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", - } - cmdOutput = cmds.commitSslCrt(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["commit-ssl-cert"]) - - def test_abortSslCrt(self): - """Test 'abort ssl cert ' command""" - args = { - "certfile": "/tmp/haproxy/ssl/601a70e4844b0.pem", - } - cmdOutput = cmds.abortSslCrt(**args).getCmd() - self.assertEqual(cmdOutput, self.Resp["abort-ssl-cert"]) - - -if __name__ == '__main__': - unittest.main() diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py deleted file mode 100755 index ea8c15f607..0000000000 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/lib/haproxy/tests/test_conn.py +++ /dev/null @@ -1,59 +0,0 @@ -# pylint: disable=locally-disabled, too-few-public-methods, no-self-use, invalid-name, broad-except -"""test_conn.py - Unittests related to connections to HAProxy.""" -import sys, os -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) -from haproxy import conn -import unittest -from socket import AF_INET, AF_UNIX - -class SimpleConnMock(object): - """Simple socket mock.""" - def __init__(self, stype, stream): - self.stype = stype - self.stream = stream - - def connect(self, addr): - """Mocked socket.connect method.""" - pass - -class TestConnection(unittest.TestCase): - """Tests different aspects of haproxyctl's connections to HAProxy.""" - - def testConnSimple(self): - """Tests that connection to non-protocol path works and fallsback to UNIX socket.""" - sfile = "/some/path/to/socket.sock" - c = conn.HaPConn(sfile, socket_module=SimpleConnMock) - addr, stype = c.sfile - self.assertEqual(sfile, addr) - self.assertEqual(stype, AF_UNIX) - - def testConnUnixString(self): - """Tests that unix:// protocol works and connects to a socket.""" - sfile = "unix:///some/path/to/socket.socket" - c = conn.HaPConn(sfile, socket_module=SimpleConnMock) - addr, stype = c.sfile - self.assertEqual("/some/path/to/socket.socket", addr) - self.assertEqual(stype, AF_UNIX) - - def testConnTCPString(self): - """Tests that tcp:// protocol works and connects to an IP.""" - sfile = "tcp://1.2.3.4:8080" - c = conn.HaPConn(sfile, socket_module=SimpleConnMock) - addr, stype = c.sfile - ip, port = addr - self.assertEqual("1.2.3.4", ip) - self.assertEqual(8080, port) - self.assertEqual(stype, AF_INET) - - def testConnTCPStringNoPort(self): - """Tests that passing a tcp:// address with no port, raises an Exception.""" - sfile = "tcp://1.2.3.4" - # Not using assertRaises because we still support 2.6 - try: - conn.HaPConn(sfile, socket_module=SimpleConnMock) - raise Exception('Connection should have thrown an exception') - except conn.HapError: - pass - -if __name__ == '__main__': - unittest.main() diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py index 554db684aa..bcf407c36f 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/socketCommand.py @@ -4,7 +4,6 @@ import argparse import traceback -sys.path.append(os.path.join(os.path.dirname(__file__), 'lib')) from haproxy.conn import HaPConn from haproxy import cmds diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py index f4932a0cdb..8df8543f3b 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/syncCerts.py @@ -9,7 +9,6 @@ import json from typing import List -sys.path.append(os.path.join(os.path.dirname(__file__), 'lib')) from haproxy.conn import HaPConn from haproxy import cmds From bbec7f3afcda438aceb90ec71ae3c86058361aca Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 7 Dec 2023 10:59:32 +0100 Subject: [PATCH 1675/3088] Framework: add keyword support for sample/shadow like in core --- Keywords/sample.ucl | 57 +++++++++++++++++++++++++++++++++++++++++++++ Keywords/shadow.ucl | 48 ++++++++++++++++++++++++++++++++++++++ Mk/plugins.mk | 17 +++++++++++--- 3 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 Keywords/sample.ucl create mode 100644 Keywords/shadow.ucl diff --git a/Keywords/sample.ucl b/Keywords/sample.ucl new file mode 100644 index 0000000000..ea5bf5db18 --- /dev/null +++ b/Keywords/sample.ucl @@ -0,0 +1,57 @@ +# MAINTAINER: portmgr@FreeBSD.org +# +# @sample etc/somefile.conf.sample +# or +# @sample file1 file2 +# +# Where file1 is considered as a sample file and file2 the target file +# +# This will install the somefile.conf.sample and automatically copy to +# somefile.conf if it doesn't exist. On deinstall it will remove the +# somefile.conf if it still matches the sample, otherwise it is +# kept. +# +# This replaces the old pattern: +# @unexec if cmp -s %D/etc/pkgtools.conf %D/etc/pkgtools.conf.sample; then rm -f %D/etc/pkgtools.conf; fi +# etc/pkgtools.conf.sample +# @exec [ -f %B/pkgtools.conf ] || cp %B/%f %B/pkgtools.conf + +actions: [file(1)] +arguments: true +post-install: < "${DESTDIR}${LOCALBASE}/opnsense/version/${PLUGIN_NAME}" @@ -217,8 +222,14 @@ install: check plist: check @(cd ${.CURDIR}/src 2> /dev/null && find * -type f) | while read FILE; do \ if [ -f "$${FILE}.in" ]; then continue; fi; \ - FILE="$${FILE%%.in}"; \ - echo ${LOCALBASE}/$${FILE}; \ + FILE="$${FILE%%.in}"; PREFIX=""; \ + if [ "$${FILE%%.sample}" != "$${FILE}" ]; then \ + PREFIX="@sample "; \ + elif [ "$${FILE%%.shadow}" != "$${FILE}" ]; then \ + FILE="$${FILE%%.shadow}.sample"; \ + PREFIX="@shadow "; \ + fi; \ + echo "$${PREFIX}${LOCALBASE}/$${FILE}"; \ done @echo "${LOCALBASE}/opnsense/version/${PLUGIN_NAME}" @@ -269,7 +280,7 @@ package: check @${MAKE} DESTDIR=${WRKSRC} metadata @echo " done" @echo ">>> Packaging files for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}:" - @${PKG} create -v -m ${WRKSRC} -r ${WRKSRC} \ + @PORTSDIR=${PLUGINSDIR} ${PKG} create -v -m ${WRKSRC} -r ${WRKSRC} \ -p ${WRKSRC}/plist -o ${PKGDIR} upgrade-check: check From d714e8fc24b233c93556c16c33ac17f26b2cfde1 Mon Sep 17 00:00:00 2001 From: doktornotor <1075960+doktornotor@users.noreply.github.com> Date: Sat, 9 Dec 2023 14:03:25 +0100 Subject: [PATCH 1676/3088] Fix mib_indexes directory path (#3700) --- .../net-snmp/src/opnsense/scripts/OPNsense/Netsnmp/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-mgmt/net-snmp/src/opnsense/scripts/OPNsense/Netsnmp/setup.sh b/net-mgmt/net-snmp/src/opnsense/scripts/OPNsense/Netsnmp/setup.sh index 3f497afafd..dc9a65242c 100755 --- a/net-mgmt/net-snmp/src/opnsense/scripts/OPNsense/Netsnmp/setup.sh +++ b/net-mgmt/net-snmp/src/opnsense/scripts/OPNsense/Netsnmp/setup.sh @@ -5,5 +5,5 @@ chown -R root:wheel /var/net-snmp chmod 755 /var/net-snmp mkdir -p /var/net-snmp/mib_indexes -chown -R root:wheel /var/mib_indexes +chown -R root:wheel /var/net-snmp/mib_indexes chmod 700 /var/net-snmp/mib_indexes From 25940b512c0764f58107392fa5916877c739a5e3 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 10 Dec 2023 16:07:20 +0100 Subject: [PATCH 1677/3088] net/frr - reuse opnsense-treeview.js from core to ease maintanance and offer the same functionality. --- .../OPNsense/Quagga/DiagnosticsController.php | 19 +++ .../views/OPNsense/Quagga/diagnostics.volt | 97 +++++-------- .../opnsense/www/js/frr/diagnostics_utils.js | 128 ------------------ 3 files changed, 54 insertions(+), 190 deletions(-) delete mode 100644 net/frr/src/opnsense/www/js/frr/diagnostics_utils.js diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/DiagnosticsController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/DiagnosticsController.php index 78b70e231d..7cb40b2320 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/DiagnosticsController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/DiagnosticsController.php @@ -27,6 +27,25 @@ class DiagnosticsController extends \OPNsense\Base\IndexController { + /** + * {@inheritdoc} + */ + protected function templateJSIncludes() + { + return array_merge(parent::templateJSIncludes(), [ + '/ui/js/tree.jquery.min.js', + '/ui/js/opnsense-treeview.js' + ]); + } + + /** + * {@inheritdoc} + */ + protected function templateCSSIncludes() + { + return array_merge(parent::templateCSSIncludes(), ['/css/jqtree.css']); + } + public function bgpAction() { $this->view->tabs = [ diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnostics.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnostics.volt index 0307fbbf26..8c3f69d670 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnostics.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnostics.volt @@ -29,8 +29,6 @@ POSSIBILITY OF SUCH DAMAGE. #} - - - - + .bootstrap-dialog-body { + overflow-x: auto; + } + .modal-dialog, + .modal-content { + height: 80%; + } + + .modal-body { + height: calc(100% - 120px); + overflow-y: scroll; + } + @media (min-width: 768px) { + .modal-dialog { + width: 90%; + } + } + + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_INVALID_RESP.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_INVALID_RESP.html new file mode 100644 index 0000000000..72a381dfd3 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_INVALID_RESP.html @@ -0,0 +1,44 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    Invalid Response error was encountered while trying to process the request:

    + +
    +
    %R
    +
    + +

    The HTTP Response message received from the contacted server could not be understood or was otherwise malformed. Please contact the site operator.

    + +

    Your cache administrator may be able to provide you with more details about the exact nature of the problem if needed.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_INVALID_URL.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_INVALID_URL.html new file mode 100644 index 0000000000..e13755f45b --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_INVALID_URL.html @@ -0,0 +1,50 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Invalid URL

    +
    + +

    Some aspect of the requested URL is incorrect.

    + +

    Some possible problems are:

    +
      +
    • Missing or incorrect access protocol (should be http:// or similar)

    • +
    • Missing hostname

    • +
    • Illegal double-escape in the URL-Path

    • +
    • Illegal character in hostname; underscores are not allowed.

    • +
    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_LIFETIME_EXP.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_LIFETIME_EXP.html new file mode 100644 index 0000000000..100e75f229 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_LIFETIME_EXP.html @@ -0,0 +1,42 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Connection Lifetime Expired

    +
    + +

    Squid has terminated the request because it has exceeded the maximum connection lifetime.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_NO_RELAY.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_NO_RELAY.html new file mode 100644 index 0000000000..7068131b2e --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_NO_RELAY.html @@ -0,0 +1,42 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    No Wais Relay

    +
    + +

    There is no WAIS Relay host defined for this Cache! Yell at the administrator.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_ONLY_IF_CACHED_MISS.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_ONLY_IF_CACHED_MISS.html new file mode 100644 index 0000000000..f91c79e9fd --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_ONLY_IF_CACHED_MISS.html @@ -0,0 +1,42 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Valid document was not found in the cache and only-if-cached directive was specified.

    +
    + +

    You have issued a request with a only-if-cached cache control directive. The document was not found in the cache, or it required revalidation prohibited by the only-if-cached directive.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_PRECONDITION_FAILED.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_PRECONDITION_FAILED.html new file mode 100644 index 0000000000..c34728485c --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_PRECONDITION_FAILED.html @@ -0,0 +1,44 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Precondition Failed.

    +
    + +

    This means:

    +
    +

    At least one precondition specified by the HTTP client in the request header has failed.

    +
    + +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_PROTOCOL_UNKNOWN.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_PROTOCOL_UNKNOWN.html new file mode 100644 index 0000000000..b61de9c99c --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_PROTOCOL_UNKNOWN.html @@ -0,0 +1,42 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Unsupported Protocol

    +
    + +

    Squid does not support some access protocols. For example, the SSH protocol is currently not supported.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_READ_ERROR.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_READ_ERROR.html new file mode 100644 index 0000000000..b699225a8e --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_READ_ERROR.html @@ -0,0 +1,44 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Read Error

    +
    + +

    The system returned: %E

    + +

    An error condition occurred while reading data from the network. Please retry your request.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_READ_TIMEOUT.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_READ_TIMEOUT.html new file mode 100644 index 0000000000..2576ffa58e --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_READ_TIMEOUT.html @@ -0,0 +1,44 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Read Timeout

    +
    + +

    The system returned: %E

    + +

    A Timeout occurred while waiting to read data from the network. The network or server may be down or congested. Please retry your request.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SECURE_CONNECT_FAIL.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SECURE_CONNECT_FAIL.html new file mode 100644 index 0000000000..0046c8e1ce --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SECURE_CONNECT_FAIL.html @@ -0,0 +1,50 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Failed to establish a secure connection to %I

    +
    + +
    +

    The system returned:

    +
    +
    %E (TLS code: %x)
    +

    %D

    +
    +
    + +

    This proxy and the remote host failed to negotiate a mutually acceptable security settings for handling your request. It is possible that the remote host does not support secure connections, or the proxy is not satisfied with the host security credentials.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SHUTTING_DOWN.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SHUTTING_DOWN.html new file mode 100644 index 0000000000..3a668ea148 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SHUTTING_DOWN.html @@ -0,0 +1,38 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +

    This cache is in the process of shutting down and can not service your request at this time. Please retry your request again soon.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SOCKET_FAILURE.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SOCKET_FAILURE.html new file mode 100644 index 0000000000..025c0f77d3 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_SOCKET_FAILURE.html @@ -0,0 +1,44 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Socket Failure

    +
    + +

    The system returned: %E

    + +

    Squid is unable to create a TCP socket, presumably due to excessive load. Please retry your request.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_TOO_BIG.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_TOO_BIG.html new file mode 100644 index 0000000000..b12de395b0 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_TOO_BIG.html @@ -0,0 +1,44 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    The request or reply is too large.

    +
    + +

    If you are making a POST or PUT request, then the item you are trying to upload is too large.

    +

    If you are making a GET request, then the item you are trying to download is too large.

    +

    These limits have been established by the Internet Service Provider who operates this cache. Please contact them directly if you feel this is an error.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_UNSUP_HTTPVERSION.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_UNSUP_HTTPVERSION.html new file mode 100644 index 0000000000..457bc200e0 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_UNSUP_HTTPVERSION.html @@ -0,0 +1,42 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    Unsupported HTTP version

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Unsupported HTTP version

    +
    + +

    This Squid does not accept the HTTP version you are attempting to use.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_UNSUP_REQ.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_UNSUP_REQ.html new file mode 100644 index 0000000000..589691eca1 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_UNSUP_REQ.html @@ -0,0 +1,42 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Unsupported Request Method and Protocol

    +
    + +

    Squid does not support all request methods for all access protocols.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_URN_RESOLVE.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_URN_RESOLVE.html new file mode 100644 index 0000000000..d260dfe32c --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_URN_RESOLVE.html @@ -0,0 +1,42 @@ + + + + +ERROR: The requested URN could not be retrieved + + + + + + +
    +

    ERROR

    +

    A URL for the requested URN could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URN: %U

    + +
    +

    Cannot Resolve URN

    +
    + +

    Hey, don't expect too much from URNs on %T :)

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_WRITE_ERROR.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_WRITE_ERROR.html new file mode 100644 index 0000000000..b7414f3401 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_WRITE_ERROR.html @@ -0,0 +1,44 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Write Error

    +
    + +

    The system returned: %E

    + +

    An error condition occurred while writing to the network. Please retry your request.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_ZERO_SIZE_OBJECT.html b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_ZERO_SIZE_OBJECT.html new file mode 100644 index 0000000000..0fca1a8ef1 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/ERR_ZERO_SIZE_OBJECT.html @@ -0,0 +1,42 @@ + + + + +ERROR: The requested URL could not be retrieved + + + + + + +
    +

    ERROR

    +

    The requested URL could not be retrieved

    +
    +
    + +
    +

    The following error was encountered while trying to retrieve the URL: %U

    + +
    +

    Zero Sized Reply

    +
    + +

    Squid did not receive any data for this request.

    + +

    Your cache administrator is %w.

    +
    +
    + +
    + + diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/error-details.txt b/www/squid/src/opnsense/data/proxy/template_error_pages/error-details.txt new file mode 100644 index 0000000000..881add9909 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/error-details.txt @@ -0,0 +1,227 @@ +name: SQUID_X509_V_ERR_INFINITE_VALIDATION +detail: "%ssl_error_descr: %ssl_subject" +descr: "Cert validation infinite loop detected" + +name: SQUID_TLS_ERR_ACCEPT +detail: "%ssl_error_descr: %ssl_lib_error" +descr: "Failed to accept a secure connection" + +name: SQUID_TLS_ERR_CONNECT +detail: "%ssl_error_descr: %ssl_lib_error" +descr: "Failed to establish a secure connection" + +name: SQUID_X509_V_ERR_DOMAIN_MISMATCH +detail: "%ssl_error_descr: %ssl_subject" +descr: "Certificate does not match domainname" + +name: X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT +detail: "SSL Certificate error: certificate issuer (CA) not known: %ssl_ca_name" +descr: "Unable to get issuer certificate" + +name: X509_V_ERR_UNABLE_TO_GET_CRL +detail: "%ssl_error_descr: %ssl_subject" +descr: "Unable to get certificate CRL" + +name: X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE +detail: "%ssl_error_descr: %ssl_subject" +descr: "Unable to decrypt certificate's signature" + +name: X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE +detail: "%ssl_error_descr: %ssl_subject" +descr: "Unable to decrypt CRL's signature" + +name: X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY +detail: "Unable to decode issuer (CA) public key: %ssl_ca_name" +descr: "Unable to decode issuer public key" + +name: X509_V_ERR_CERT_SIGNATURE_FAILURE +detail: "%ssl_error_descr: %ssl_subject" +descr: "Certificate signature failure" + +name: X509_V_ERR_CRL_SIGNATURE_FAILURE +detail: "%ssl_error_descr: %ssl_subject" +descr: "CRL signature failure" + +name: X509_V_ERR_CERT_NOT_YET_VALID +detail: "SSL Certificate is not valid before: %ssl_notbefore" +descr: "Certificate is not yet valid" + +name: X509_V_ERR_CERT_HAS_EXPIRED +detail: "SSL Certificate expired on: %ssl_notafter" +descr: "Certificate has expired" + +name: X509_V_ERR_CRL_NOT_YET_VALID +detail: "%ssl_error_descr: %ssl_subject" +descr: "CRL is not yet valid" + +name: X509_V_ERR_CRL_HAS_EXPIRED +detail: "%ssl_error_descr: %ssl_subject" +descr: "CRL has expired" + +name: X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD +detail: "SSL Certificate has invalid start date (the 'not before' field): %ssl_subject" +descr: "Format error in certificate's notBefore field" + +name: X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD +detail: "SSL Certificate has invalid expiration date (the 'not after' field): %ssl_subject" +descr: "Format error in certificate's notAfter field" + +name: X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD +detail: "%ssl_error_descr: %ssl_subject" +descr: "Format error in CRL's lastUpdate field" + +name: X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD +detail: "%ssl_error_descr: %ssl_subject" +descr: "Format error in CRL's nextUpdate field" + +name: X509_V_ERR_OUT_OF_MEM +detail: "%ssl_error_descr" +descr: "Out of memory" + +name: X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT +detail: "Self-signed SSL Certificate: %ssl_subject" +descr: "Self signed certificate" + +name: X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN +detail: "Self-signed SSL Certificate in chain: %ssl_subject" +descr: "Self signed certificate in certificate chain" + +name: X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY +detail: "SSL Certificate error: certificate issuer (CA) not known: %ssl_ca_name" +descr: "Unable to get local issuer certificate" + +name: X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE +detail: "%ssl_error_descr: %ssl_subject" +descr: "Unable to verify the first certificate" + +name: X509_V_ERR_CERT_CHAIN_TOO_LONG +detail: "%ssl_error_descr: %ssl_subject" +descr: "Certificate chain too long" + +name: X509_V_ERR_CERT_REVOKED +detail: "%ssl_error_descr: %ssl_subject" +descr: "Certificate revoked" + +name: X509_V_ERR_INVALID_CA +detail: "%ssl_error_descr: %ssl_ca_name" +descr: "Invalid CA certificate" + +name: X509_V_ERR_PATH_LENGTH_EXCEEDED +detail: "%ssl_error_descr: %ssl_subject" +descr: "Path length constraint exceeded" + +name: X509_V_ERR_INVALID_PURPOSE +detail: "%ssl_error_descr: %ssl_subject" +descr: "Unsupported certificate purpose" + +name: X509_V_ERR_CERT_UNTRUSTED +detail: "%ssl_error_descr: %ssl_subject" +descr: "Certificate not trusted" + +name: X509_V_ERR_CERT_REJECTED +detail: "%ssl_error_descr: %ssl_subject" +descr: "Certificate rejected" + +name: X509_V_ERR_SUBJECT_ISSUER_MISMATCH +detail: "%ssl_error_descr: %ssl_ca_name" +descr: "Subject issuer mismatch" + +name: X509_V_ERR_AKID_SKID_MISMATCH +detail: "%ssl_error_descr: %ssl_subject" +descr: "Authority and subject key identifier mismatch" + +name: X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH +detail: "%ssl_error_descr: %ssl_ca_name" +descr: "Authority and issuer serial number mismatch" + +name: X509_V_ERR_KEYUSAGE_NO_CERTSIGN +detail: "%ssl_error_descr: %ssl_subject" +descr: "Key usage does not include certificate signing" + +name: X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER +detail: "%ssl_error_descr: %ssl_subject" +descr: "unable to get CRL issuer certificate" + +name: X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION +detail: "%ssl_error_descr: %ssl_subject" +descr: "unhandled critical extension" + +name: X509_V_ERR_KEYUSAGE_NO_CRL_SIGN +detail: "%ssl_error_descr: %ssl_subject" +descr: "key usage does not include CRL signing" + +name: X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION +detail: "%ssl_error_descr: %ssl_subject" +descr: "unhandled critical CRL extension" + +name: X509_V_ERR_INVALID_NON_CA +detail: "%ssl_error_descr: %ssl_subject" +descr: "invalid non-CA certificate (has CA markings)" + +name: X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED +detail: "%ssl_error_descr: %ssl_subject" +descr: "proxy path length constraint exceeded" + +name: X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE +detail: "%ssl_error_descr: %ssl_subject" +descr: "key usage does not include digital signature" + +name: X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED +detail: "%ssl_error_descr: %ssl_subject" +descr: "proxy certificates not allowed, please set the appropriate flag" + +name: X509_V_ERR_INVALID_EXTENSION +detail: "%ssl_error_descr: %ssl_subject" +descr: "invalid or inconsistent certificate extension" + +name: X509_V_ERR_INVALID_POLICY_EXTENSION +detail: "%ssl_error_descr: %ssl_subject" +descr: "invalid or inconsistent certificate policy extension" + +name: X509_V_ERR_NO_EXPLICIT_POLICY +detail: "%ssl_error_descr: %ssl_subject" +descr: "no explicit policy" + +name: X509_V_ERR_DIFFERENT_CRL_SCOPE +detail: "%ssl_error_descr: %ssl_subject" +descr: "Different CRL scope" + +name: X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE +detail: "%ssl_error_descr: %ssl_subject" +descr: "Unsupported extension feature" + +name: X509_V_ERR_UNNESTED_RESOURCE +detail: "%ssl_error_descr: %ssl_subject" +descr: "RFC 3779 resource not subset of parent's resources" + +name: X509_V_ERR_PERMITTED_VIOLATION +detail: "%ssl_error_descr: %ssl_subject" +descr: "permitted subtree violation" + +name: X509_V_ERR_EXCLUDED_VIOLATION +detail: "%ssl_error_descr: %ssl_subject" +descr: "excluded subtree violation" + +name: X509_V_ERR_SUBTREE_MINMAX +detail: "%ssl_error_descr: %ssl_subject" +descr: "name constraints minimum and maximum not supported" + +name: X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE +detail: "%ssl_error_descr: %ssl_subject" +descr: "unsupported name constraint type" + +name: X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX +detail: "%ssl_error_descr: %ssl_subject" +descr: "unsupported or invalid name constraint syntax" + +name: X509_V_ERR_UNSUPPORTED_NAME_SYNTAX +detail: "%ssl_error_descr: %ssl_subject" +descr: "unsupported or invalid name syntax" + +name: X509_V_ERR_CRL_PATH_VALIDATION_ERROR +detail: "%ssl_error_descr: %ssl_subject" +descr: "CRL path validation error" + +name: X509_V_ERR_APPLICATION_VERIFICATION +detail: "%ssl_error_descr: %ssl_subject" +descr: "Application verification failure" diff --git a/www/squid/src/opnsense/data/proxy/template_error_pages/errorpage.css b/www/squid/src/opnsense/data/proxy/template_error_pages/errorpage.css new file mode 100644 index 0000000000..1efbf0e059 --- /dev/null +++ b/www/squid/src/opnsense/data/proxy/template_error_pages/errorpage.css @@ -0,0 +1,104 @@ +/* + * Copyright (C) 1996-2021 The Squid Software Foundation and contributors + * + * Squid software is distributed under GPLv2+ license and includes + * contributions from numerous individuals and organizations. + * Please see the COPYING and CONTRIBUTORS files for details. + */ + +/* + Stylesheet for Squid Error pages + Adapted from design by Free CSS Templates + http://www.freecsstemplates.org + Released for free under a Creative Commons Attribution 2.5 License +*/ + +/* Page basics */ +* { + font-family: verdana, sans-serif; +} + +html body { + margin: 0; + padding: 0; + background: #efefef; + font-size: 12px; + color: #1e1e1e; +} + +/* Page displayed title area */ +#titles { + margin-left: 15px; + padding: 10px; + padding-left: 130px; + background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+Cjxzdmcgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDk1IDk4IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zOnNlcmlmPSJodHRwOi8vd3d3LnNlcmlmLmNvbS8iIHN0eWxlPSJmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMTsiPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHBhdGggZD0iTTk0Ljc0Nyw5LjAxMUw4Ny40NTcsOS4wMTFMODcuNDU3LDcuNDk1TDEwLjc2OCw3LjQ5NUMxMC40NTYsNy40OTUgMTAuMjEsNy41MzkgOS44OTgsNy42MDZMOS44NzYsNy42MDZMOS40OTcsNy43NEw5LjQzLDcuNzYyTDkuMzg2LDcuNzg1TDkuMzE5LDcuODI5TDkuMDI5LDcuOTg1TDguOTYyLDguMDA3TDguOTYyLDguMDNMOC44MjgsOC4wOTdMOC43MTcsOC4xODZMOC42NzIsOC4yM0w4LjYwNSw4LjI3NUw4LjU2MSw4LjI5N0w4LjU2MSw4LjMyTDguNTE2LDguMzY0TDguNDQ5LDguNDA5TDguNDA1LDguNDUzTDguMzYsOC40OThMOC4yNDksOC42MDlMOC4yMjYsOC42NTRMOC4xNTksOC43MjFMOC4xMTUsOC43NDNMOC4xMzcsOC43NDNMOC4wNyw4LjgxTDguMDQ4LDguODMyTDguMDQ4LDguODU1TDguMDAzLDguODk5TDguMDAzLDguOTIyTDcuOTU5LDguOTY2TDcuOTM2LDkuMDExTDAuMjksOS4wMTFMMC4yOSw4LjQ5OEMxLjQyNywzLjYzOCA1LjcwNywwLjAwNCAxMC43NjgsMC4wMDRMOTQuNzQ3LDAuMDA0TDk0Ljc0Nyw5LjAxMVoiIHN0eWxlPSJmaWxsOnJnYigyMjcsMjI4LDIyOSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICA8L2c+CiAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLDAsMCwxLDAsLTAuMDA0MTU0NzEpIj4KICAgICAgICA8cGF0aCBkPSJNODcuNDU3LDcuNTE3TDk0Ljc0NywzLjU5M0w5NC43NDcsMTEuMDg0TDg3LjQ3OSwxNC45ODVMODcuNDU3LDE0Ljk4NUw4Ny40NTcsNy41MTdaIiBzdHlsZT0iZmlsbDp1cmwoI19MaW5lYXIxKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgIDwvZz4KICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDEsMCwwLDEsMCwtMC4wMDQxNTQ3MSkiPgogICAgICAgIDxwYXRoIGQ9Ik0yLjAwNiw0LjY2M0w4LjY3Miw4LjIzTDguNjA1LDguMjc1TDguNTYxLDguMjk3TDguNTYxLDguMzJMOC41MTYsOC4zNjRMOC40NDksOC40MDlMOC40MDUsOC40NTNMOC4zNiw4LjQ5OEw4LjI0OSw4LjYwOUw4LjIyNiw4LjY1NEw4LjE1OSw4LjcyMUw4LjExNSw4Ljc0M0w4LjEzNyw4Ljc0M0w4LjA3LDguODFMOC4wNDgsOC44MzJMOC4wNDgsOC44NTVMOC4wMDMsOC44OTlMOC4wMDMsOC45MjJMNy45NTksOC45NjZMNy44OTIsOS4wNzhMNy44Nyw5LjFMNy44MDMsOS4yMTFMNy43NTgsOS4yNzhMNy43NTgsOS4zTDcuNjAyLDkuNTY4TDcuNjAyLDkuNTlMNy41OCw5LjY1N0w3LjU1Nyw5LjcwMkw3LjUzNSw5Ljc0Nkw3LjUzNSw5Ljc2OUw3LjQwMSwxMC4xOTJDNy40MDEsMTAuMTcgNy4yOSwxMC43NzIgNy4yOSwxMS4wNjJMNy4yOSwxNC45ODVMMCwxMS4wODRMMCwxMS4wNjJDMCw4LjY3NiAwLjczNiw2LjQ2OSAyLjAwNiw0LjY2M1oiIHN0eWxlPSJmaWxsOnVybCgjX0xpbmVhcjIpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHJlY3QgeD0iMTQuNTgiIHk9IjE0Ljk4NSIgd2lkdGg9IjY1LjU4NyIgaGVpZ2h0PSI3LjQ5MSIgc3R5bGU9ImZpbGw6cmdiKDE0NywxNDYsMTQ2KTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgIDwvZz4KICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDEsMCwwLDEsMCwtMC4wMDQxNTQ3MSkiPgogICAgICAgIDxwYXRoIGQ9Ik0wLDg4LjM3NUw3LjI5LDg4LjM3NUw3LjI5LDg5Ljg2OUw4My45NzksODkuODY5Qzg0LjI5MSw4OS44NjkgODQuNTM3LDg5Ljg0NyA4NC44MjYsODkuNzU3TDg0Ljg0OSw4OS43NTdMODUuMjUsODkuNjI0TDg1LjI5NSw4OS42MDFMODUuMzM5LDg5LjU3OUw4NS40MjgsODkuNTU3TDg1LjY5Niw4OS40MDFMODUuNzYzLDg5LjM1Nkw4NS43ODUsODkuMzU2TDg1Ljg5Niw4OS4yNjdMODYuMDA4LDg5LjJMODYuMDA4LDg5LjE3OEw4Ni4wNzUsODkuMTMzTDg2LjE0Miw4OS4wODlMODYuMTY0LDg5LjA2Nkw4Ni4yMzEsODkuMDIyTDg2LjI5OCw4OC45NTVMODYuMzIsODguOTMzTDg2LjMyLDg4LjkxTDg2LjM2NSw4OC44ODhMODYuNDc2LDg4Ljc3Nkw4Ni40NzYsODguNzU0TDg2LjUyMSw4OC43MzJMODYuNTY1LDg4LjY2NUw4Ni42MSw4OC42Mkw4Ni42NTQsODguNTU0TDg2LjY3Nyw4OC41MzFMODYuNzIxLDg4LjQ2NEw4Ni43NjYsODguMzk3TDg2Ljc4OCw4OC4zOTdMODYuODEsODguMzc1TDk0LjQzNSw4OC4zNzVMOTQuNDM1LDg4Ljg4OEM5My4yOTgsOTMuNzQ4IDg5LjA0LDk3LjM1OSA4My45NzksOTcuMzU5TDAsOTcuMzU5TDAsODkuOTU4TDAsODkuODY5TDAsODguMzc1WiIgc3R5bGU9ImZpbGw6cmdiKDIyNywyMjgsMjI5KTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgIDwvZz4KICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDEsMCwwLDEsMCwtMC4wMDQxNTQ3MSkiPgogICAgICAgIDxwYXRoIGQ9Ik03LjI5LDg5Ljg2OUwwLDkzLjc3TDAsODkuOTU4TDAsODkuODY5TDAsODYuMjhMNy4yNDUsODIuMzc4TDcuMjksODIuMzc4TDcuMjksODkuODY5WiIgc3R5bGU9ImZpbGw6dXJsKCNfTGluZWFyMyk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICA8L2c+CiAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLDAsMCwxLDAsLTAuMDA0MTU0NzEpIj4KICAgICAgICA8cGF0aCBkPSJNOTIuNzQxLDkyLjdMODYuMDc1LDg5LjEzM0w4Ni4xNDIsODkuMDg5TDg2LjE2NCw4OS4wNjZMODYuMjMxLDg5LjAyMkw4Ni4yOTgsODguOTU1TDg2LjMyLDg4LjkzM0w4Ni4zMiw4OC45MUw4Ni4zNjUsODguODg4TDg2LjQ3Niw4OC43NzZMODYuNDc2LDg4Ljc1NEw4Ni41MjEsODguNzMyTDg2LjU2NSw4OC42NjVMODYuNjEsODguNjJMODYuNjU0LDg4LjU1NEw4Ni42NzcsODguNTMxTDg2LjcyMSw4OC40NjRMODYuNzY2LDg4LjM5N0w4Ni43ODgsODguMzk3TDg2Ljg1NSw4OC4yODZMODYuOTQ0LDg4LjE1Mkw4Ni45ODksODguMDg1TDg3LjEyMyw4Ny43OTZMODcuMTQ1LDg3Ljc3M0w4Ny4xNjcsODcuNzI5TDg3LjE2Nyw4Ny43MDZMODcuMTg5LDg3LjY2Mkw4Ny4xODksODcuNjM5TDg3LjIxMiw4Ny42MTdMODcuMzQ2LDg3LjE5NEM4Ny4zNDYsODcuMTk0IDg3LjQ1Nyw4Ni41OTIgODcuNDU3LDg2LjMwMkw4Ny40NTcsODIuNDAxTDk0Ljc0Nyw4Ni4yOEw5NC43NDcsODYuMzAyQzk0LjcyNSw4OC42ODcgOTMuOTg5LDkwLjg5NCA5Mi43NDEsOTIuN1oiIHN0eWxlPSJmaWxsOnVybCgjX0xpbmVhcjQpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHJlY3QgeD0iNy4yOSIgeT0iMjkuOTY2IiB3aWR0aD0iMjguMDIzIiBoZWlnaHQ9IjcuNDkxIiBzdHlsZT0iZmlsbDpyZ2IoMTcwLDE3MSwxNzEpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHBhdGggZD0iTTIxLjE1NiwzNy40NTdMNy4yOSwzMC4wMTFMNy4yOSwyOS45NjZMMjEuNDAyLDI5Ljk2NkwzNS4zMTMsMzcuNDEyTDM1LjMxMywzNy40NTdMMjEuMTU2LDM3LjQ1N1oiIHN0eWxlPSJmaWxsOnVybCgjX0xpbmVhcjUpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHJlY3QgeD0iNTkuNDEyIiB5PSIyOS45NjYiIHdpZHRoPSIyOC4wNDUiIGhlaWdodD0iNy40OTEiIHN0eWxlPSJmaWxsOnJnYigxNzAsMTcxLDE3MSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICA8L2c+CiAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLDAsMCwxLDAsLTAuMDA0MTU0NzEpIj4KICAgICAgICA8cGF0aCBkPSJNNzMuNTY4LDM3LjQ1N0w4Ny40NTcsMzAuMDExTDg3LjQ1NywyOS45NjZMNzMuMzIzLDI5Ljk2Nkw1OS40MTIsMzcuNDEyTDU5LjQxMiwzNy40NTdMNzMuNTY4LDM3LjQ1N1oiIHN0eWxlPSJmaWxsOnVybCgjX0xpbmVhcjYpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHJlY3QgeD0iNTkuNDEyIiB5PSI1OS45MjkiIHdpZHRoPSIyOC4wNDUiIGhlaWdodD0iNy40OTEiIHN0eWxlPSJmaWxsOnJnYigxNzAsMTcxLDE3MSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICA8L2c+CiAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLDAsMCwxLDAsLTAuMDA0MTU0NzEpIj4KICAgICAgICA8cGF0aCBkPSJNNzMuNTY4LDU5LjkyOUw4Ny40NTcsNjcuMzUyTDg3LjQ1Nyw2Ny40MTlMNzMuMzIzLDY3LjQxOUw1OS40MTIsNTkuOTUxTDU5LjQxMiw1OS45MjlMNzMuNTY4LDU5LjkyOVoiIHN0eWxlPSJmaWxsOnVybCgjX0xpbmVhcjcpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHJlY3QgeD0iNy4yOSIgeT0iNTkuOTI5IiB3aWR0aD0iMjguMDIzIiBoZWlnaHQ9IjcuNDkxIiBzdHlsZT0iZmlsbDpyZ2IoMTcwLDE3MSwxNzEpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHBhdGggZD0iTTIxLjE1Niw1OS45MjlMNy4yOSw2Ny4zNTJMNy4yOSw2Ny40MTlMMjEuNDAyLDY3LjQxOUwzNS4zMTMsNTkuOTUxTDM1LjMxMyw1OS45MjlMMjEuMTU2LDU5LjkyOVoiIHN0eWxlPSJmaWxsOnVybCgjX0xpbmVhcjgpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHBhdGggZD0iTTM1LjMxMywzNy40NTdMMCwxOC41NTJMMCwxMS4wNjJMMzUuMzEzLDI5Ljk2NkwzNS4zMTMsMzcuNDU3WiIgc3R5bGU9ImZpbGw6dXJsKCNfTGluZWFyOSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICA8L2c+CiAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLDAsMCwxLDAsLTAuMDA0MTU0NzEpIj4KICAgICAgICA8cGF0aCBkPSJNNTkuNDEyLDM3LjQ1N0w5NC43NDcsMTguNTUyTDk0Ljc0NywxMS4wNjJMNTkuNDEyLDI5Ljk2Nkw1OS40MTIsMzcuNDU3WiIgc3R5bGU9ImZpbGw6dXJsKCNfTGluZWFyMTApO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHJlY3QgeD0iMTQuNzE0IiB5PSI3NC45MSIgd2lkdGg9IjY1LjU4NyIgaGVpZ2h0PSI3LjQ2OCIgc3R5bGU9ImZpbGw6cmdiKDE0NywxNDYsMTQ2KTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgIDwvZz4KICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDEsMCwwLDEsMCwtMC4wMDQxNTQ3MSkiPgogICAgICAgIDxwYXRoIGQ9Ik01OS40MTIsNTkuOTI5TDk0Ljc0Nyw3OC44MTFMOTQuNzQ3LDg2LjMwMkw1OS40MTIsNjcuNDE5TDU5LjQxMiw1OS45MjlaIiBzdHlsZT0iZmlsbDp1cmwoI19MaW5lYXIxMSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICA8L2c+CiAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLDAsMCwxLDAsLTAuMDA0MTU0NzEpIj4KICAgICAgICA8cGF0aCBkPSJNMzUuMzEzLDU5LjkyOUwwLDc4LjgxMUwwLDg2LjMwMkwzNS4zMTMsNjcuNDE5TDM1LjMxMyw1OS45MjlaIiBzdHlsZT0iZmlsbDp1cmwoI19MaW5lYXIxMik7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICA8L2c+CiAgICA8ZyB0cmFuc2Zvcm09Im1hdHJpeCgxLDAsMCwxLDAsLTAuMDA0MTU0NzEpIj4KICAgICAgICA8cGF0aCBkPSJNOTQuNzQ3LDQ0Ljk0OEw3My40MTIsNDQuOTQ4TDgwLjE0NSw0MS4zMzZMODAuMTQ1LDMzLjg0Nkw1OS40MTIsNDQuOTQ4TDU5LjQxMiw1Mi40MzhMNTkuNDM0LDUyLjQzOEw4MC4xNjcsNjMuNTE4TDgwLjE2Nyw1Ni4wMjdMNzMuNDM0LDUyLjQzOEw5NC43NDcsNTIuNDM4TDk0Ljc0Nyw0NC45NDhaIiBzdHlsZT0iZmlsbDpyZ2IoMjE3LDc5LDApO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPC9nPgogICAgPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwwLC0wLjAwNDE1NDcxKSI+CiAgICAgICAgPHBhdGggZD0iTTE0LjU4LDMzLjg0NkwxNC41OCw0MS4zMzZMMjEuMzM1LDQ0Ljk0OEwwLDQ0Ljk0OEwwLDUyLjQzOEwyMS4zMTIsNTIuNDM4TDE0LjU4LDU2LjAyN0wxNC41OCw2My41MThMMzUuMzEzLDUyLjQzOEwzNS4zMTMsNTIuNDE2TDM1LjMxMyw0NC45NDhMMTQuNTgsMzMuODQ2WiIgc3R5bGU9ImZpbGw6cmdiKDIxNyw3OSwwKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgIDwvZz4KICAgIDxkZWZzPgogICAgICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iX0xpbmVhcjEiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxLjY1ODQxLDUuODQwNTYsLTUuODQwNTYsMS42NTg0MSw5MC4yNjM1LDYuMzY5MTIpIj48c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOnJnYigyMjgsMjI4LDIyOCk7c3RvcC1vcGFjaXR5OjEiLz48c3RvcCBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOnJnYigxNjIsMTYyLDE2Mik7c3RvcC1vcGFjaXR5OjEiLz48L2xpbmVhckdyYWRpZW50PgogICAgICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iX0xpbmVhcjIiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgtMi4yOTE1NCw1LjgxOTU4LC01LjgxOTU4LC0yLjI5MTU0LDUuNDc2ODYsNi45MTQ1KSI+PHN0b3Agb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMjI4LDIyOCwyMjgpO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMTYyLDE2MiwxNjIpO3N0b3Atb3BhY2l0eToxIi8+PC9saW5lYXJHcmFkaWVudD4KICAgICAgICA8bGluZWFyR3JhZGllbnQgaWQ9Il9MaW5lYXIzIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLTEuNjU4ODUsLTUuODM5MzEsNS44MzkzMSwtMS42NTg4NSw0LjQ3MzEsOTEuMDAyNykiPjxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDIyOCwyMjgsMjI4KTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDE2MiwxNjIsMTYyKTtzdG9wLW9wYWNpdHk6MSIvPjwvbGluZWFyR3JhZGllbnQ+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJfTGluZWFyNCIgeDE9IjAiIHkxPSIwIiB4Mj0iMSIgeTI9IjAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KDIuMjkxMzEsLTUuODE5MjQsNS44MTkyNCwyLjI5MTMxLDg5LjI1OTQsOTAuNDU3NikiPjxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDIyOCwyMjgsMjI4KTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDE2MiwxNjIsMTYyKTtzdG9wLW9wYWNpdHk6MSIvPjwvbGluZWFyR3JhZGllbnQ+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJfTGluZWFyNSIgeDE9IjAiIHkxPSIwIiB4Mj0iMSIgeTI9IjAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KC00Ni4xODUsLTEyLjAxNjgsMTIuMDE2OCwtNDYuMTg1LDQ0LjM5MzcsMzkuNzE1NikiPjxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDE3MCwxNzEsMTcxKTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMC4xIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMTcwLDE3MSwxNzEpO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoNzgsNzgsNzgpO3N0b3Atb3BhY2l0eToxIi8+PC9saW5lYXJHcmFkaWVudD4KICAgICAgICA8bGluZWFyR3JhZGllbnQgaWQ9Il9MaW5lYXI2IiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoNDYuMTg2MSwtMTIuMDE1OSwxMi4wMTU5LDQ2LjE4NjEsNTAuMzQyLDM5LjcxNTIpIj48c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOnJnYigxNzAsMTcxLDE3MSk7c3RvcC1vcGFjaXR5OjEiLz48c3RvcCBvZmZzZXQ9IjAuMSIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDE3MCwxNzEsMTcxKTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDc4LDc4LDc4KTtzdG9wLW9wYWNpdHk6MSIvPjwvbGluZWFyR3JhZGllbnQ+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJfTGluZWFyNyIgeDE9IjAiIHkxPSIwIiB4Mj0iMSIgeTI9IjAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KDQ2LjE4NTQsMTIuMDE1OSwtMTIuMDE1OSw0Ni4xODU0LDUwLjM0MjUsNTcuNjU2OSkiPjxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDE3MCwxNzEsMTcxKTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMC4xIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMTcwLDE3MSwxNzEpO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoNzgsNzgsNzgpO3N0b3Atb3BhY2l0eToxIi8+PC9saW5lYXJHcmFkaWVudD4KICAgICAgICA8bGluZWFyR3JhZGllbnQgaWQ9Il9MaW5lYXI4IiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLTQ2LjE4NDQsMTIuMDE2NiwtMTIuMDE2NiwtNDYuMTg0NCw0NC4zOTM1LDU3LjY1NjQpIj48c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOnJnYigxNzAsMTcxLDE3MSk7c3RvcC1vcGFjaXR5OjEiLz48c3RvcCBvZmZzZXQ9IjAuMSIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDE3MCwxNzEsMTcxKTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDc4LDc4LDc4KTtzdG9wLW9wYWNpdHk6MSIvPjwvbGluZWFyR3JhZGllbnQ+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJfTGluZWFyOSIgeDE9IjAiIHkxPSIwIiB4Mj0iMSIgeTI9IjAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KDM1LjMxNTUsMCwwLDM1LjMxNTUsLTAuMDAwMjgzNDY3LDI0LjI1ODcpIj48c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOnJnYigyNTQsMjU0LDI1NCk7c3RvcC1vcGFjaXR5OjEiLz48c3RvcCBvZmZzZXQ9IjAuMjMiIHN0eWxlPSJzdG9wLWNvbG9yOnJnYigyNTQsMjU0LDI1NCk7c3RvcC1vcGFjaXR5OjEiLz48c3RvcCBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOnJnYigxNzYsMTc2LDE3Nik7c3RvcC1vcGFjaXR5OjEiLz48L2xpbmVhckdyYWRpZW50PgogICAgICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iX0xpbmVhcjEwIiB4MT0iMCIgeTE9IjAiIHgyPSIxIiB5Mj0iMCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoLTM1LjMxNTQsNC4zMjQ4OWUtMTUsLTQuMzI0ODllLTE1LC0zNS4zMTU0LDk0LjczNiwyNC4yNTg3KSI+PHN0b3Agb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMjU0LDI1NCwyNTQpO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIwLjIzIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMjU0LDI1NCwyNTQpO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMTc2LDE3NiwxNzYpO3N0b3Atb3BhY2l0eToxIi8+PC9saW5lYXJHcmFkaWVudD4KICAgICAgICA8bGluZWFyR3JhZGllbnQgaWQ9Il9MaW5lYXIxMSIgeDE9IjAiIHkxPSIwIiB4Mj0iMSIgeTI9IjAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KC0zNS4zMTU0LDQuMzI0ODllLTE1LC00LjMyNDg5ZS0xNSwtMzUuMzE1NCw5NC43MzYsNzMuMTEzMykiPjxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDI1NCwyNTQsMjU0KTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMC4yMyIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDI1NCwyNTQsMjU0KTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6cmdiKDE3NiwxNzYsMTc2KTtzdG9wLW9wYWNpdHk6MSIvPjwvbGluZWFyR3JhZGllbnQ+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJfTGluZWFyMTIiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgzNS4zMTU1LDAsMCwzNS4zMTU1LC0wLjAwMDI4MzQ2Nyw3My4xMTMzKSI+PHN0b3Agb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMjU0LDI1NCwyNTQpO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIwLjIzIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMjU0LDI1NCwyNTQpO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjpyZ2IoMTc2LDE3NiwxNzYpO3N0b3Atb3BhY2l0eToxIi8+PC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KPC9zdmc+Cg==') no-repeat left; +} + +/* initial title */ +#titles h1 { + color: #000000; +} +#titles h2 { + color: #000000; +} + +/* special event: FTP success page titles */ +#titles ftpsuccess { + background-color:#00ff00; + width:100%; +} + +/* Page displayed body content area */ +#content { + padding: 10px; + background: #ffffff; +} + +/* General text */ +p { +} + +/* error brief description */ +#error p { +} + +/* some data which may have caused the problem */ +#data { +} + +/* the error message received from the system or other software */ +#sysmsg { +} + +pre { +} + +/* special event: FTP / Gopher directory listing */ +#dirmsg { + font-family: courier, monospace; + color: black; + font-size: 10pt; +} +#dirlisting { + margin-left: 2%; + margin-right: 2%; +} +#dirlisting tr.entry td.icon,td.filename,td.size,td.date { + border-bottom: groove; +} +#dirlisting td.size { + width: 50px; + text-align: right; + padding-right: 5px; +} + +/* horizontal lines */ +hr { + margin: 0; +} + +/* page displayed footer area */ +#footer { + font-size: 9px; + padding-left: 10px; +} diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php new file mode 100644 index 0000000000..3fa2f25a55 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php @@ -0,0 +1,157 @@ +forward->sslcertificate) != $prev_sslbump_cert) || + (!empty((string)$mdlProxy->general->cache->local->enabled) != $prev_cache_active); + } + + private function hookStartErrorHandler($result) + { + if (preg_match('/__ok__$/', $result['response'])) { + $result['response'] = "ok"; + } else { + throw new UserException($result['response'], gettext("proxy load error")); + } + return $result; + } + + public function startAction() + { + return $this->hookStartErrorHandler(parent::startAction()); + } + + public function restartAction() + { + return $this->hookStartErrorHandler(parent::restartAction()); + } + + /** + * reload template only (for example PAC does not need to change squid configuration) + * @return array + */ + public function resetAction() + { + if ($this->request->isPost()) { + // close session for long running action + $this->sessionClose(); + $backend = new Backend(); + return array('status' => $backend->configdRun('proxy reset')); + } else { + return array('error' => 'This API endpoint must be called via POST', + 'status' => 'error'); + } + } + + /** + * reload template only (for example PAC does not need to change squid configuration) + * @return array + */ + public function refreshTemplateAction() + { + if ($this->request->isPost()) { + // close session for long running action + $this->sessionClose(); + $backend = new Backend(); + return array('status' => $backend->configdRun('template reload OPNsense/Proxy')); + } else { + return array('error' => 'This API endpoint must be called via POST', + 'status' => 'error'); + } + } + + /** + * fetch acls (download + install) + * @return array + */ + public function fetchaclsAction() + { + if ($this->request->isPost()) { + // close session for long running action + $this->sessionClose(); + + $backend = new Backend(); + // generate template + $backend->configdRun('template reload OPNsense/Proxy'); + + // fetch files + $response = $backend->configdRun("proxy fetchacls"); + return array("response" => $response,"status" => "ok"); + } else { + return array("response" => array()); + } + } + + /** + * download (only) acls + * @return array + */ + public function downloadaclsAction() + { + if ($this->request->isPost()) { + // close session for long running action + $this->sessionClose(); + + $backend = new Backend(); + // generate template + $backend->configdRun('template reload OPNsense/Proxy'); + + // download files + $response = $backend->configdRun("proxy downloadacls"); + return array("response" => $response,"status" => "ok"); + } else { + return array("response" => array()); + } + } +} diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/SettingsController.php b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/SettingsController.php new file mode 100644 index 0000000000..386c117f40 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/SettingsController.php @@ -0,0 +1,334 @@ + + * Copyright (C) 2017 Fabian Franz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Proxy\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; +use OPNsense\Cron\Cron; +use OPNsense\Core\Config; +use OPNsense\Base\UIModelGrid; + +/** + * Class SettingsController + * @package OPNsense\Proxy + */ +class SettingsController extends ApiMutableModelControllerBase +{ + protected static $internalModelName = 'proxy'; + protected static $internalModelClass = '\OPNsense\Proxy\Proxy'; + + /** + * + * search remote blacklists + * @return array + */ + public function searchRemoteBlacklistsAction() + { + $this->sessionClose(); + $mdlProxy = $this->getModel(); + $grid = new UIModelGrid($mdlProxy->forward->acl->remoteACLs->blacklists->blacklist); + return $grid->fetchBindRequest( + $this->request, + array("enabled", "filename", "url", "description"), + "description" + ); + } + + /** + * retrieve remote blacklist settings or return defaults + * @param $uuid item unique id + * @return array + */ + public function getRemoteBlacklistAction($uuid = null) + { + return $this->getBase("blacklist", "forward.acl.remoteACLs.blacklists.blacklist", $uuid); + } + + /** + * update remote blacklist item + * @param string $uuid + * @return array result status + * @throws \Phalcon\Filter\Validation\Exception + */ + public function setRemoteBlacklistAction($uuid) + { + return $this->setBase('blacklist', 'forward.acl.remoteACLs.blacklists.blacklist', $uuid); + } + + /** + * add new blacklist and set with attributes from post + * @return array + */ + public function addRemoteBlacklistAction() + { + return $this->addBase('blacklist', 'forward.acl.remoteACLs.blacklists.blacklist'); + } + + /** + * delete blacklist by uuid + * @param $uuid item unique id + * @return array status + */ + public function delRemoteBlacklistAction($uuid) + { + return $this->delBase('forward.acl.remoteACLs.blacklists.blacklist', $uuid); + } + + /** + * toggle blacklist by uuid (enable/disable) + * @param $uuid item unique id + * @return array status + */ + public function toggleRemoteBlacklistAction($uuid) + { + return $this->toggleBase('forward.acl.remoteACLs.blacklists.blacklist', $uuid); + } + + /** + * create new cron item for remote acl or return already available one + * @return array status action + */ + public function fetchRBCronAction() + { + $result = array("result" => "failed"); + + if ($this->request->isPost()) { + $mdlProxy = $this->getModel(); + if ((string)$mdlProxy->forward->acl->remoteACLs->UpdateCron == "") { + $mdlCron = new Cron(); + // update cron relation (if this doesn't break consistency) + $uuid = $mdlCron->newDailyJob("Proxy", "proxy fetchacls", "fetch proxy acls", "1"); + $mdlProxy->forward->acl->remoteACLs->UpdateCron = $uuid; + + if ($mdlCron->performValidation()->count() == 0) { + $mdlCron->serializeToConfig(); + // save data to config, do not validate because the current in memory model doesn't know about the + // cron item just created. + $mdlProxy->serializeToConfig($validateFullModel = false, $disable_validation = true); + Config::getInstance()->save(); + $result['result'] = "new"; + $result['uuid'] = $uuid; + } else { + $result['result'] = "unable to add cron"; + } + } else { + $result['result'] = "existing"; + $result['uuid'] = (string)$mdlProxy->forward->acl->remoteACLs->UpdateCron; + } + } + + return $result; + } + + /** + * + * search PAC Rule + * @return array + */ + public function searchPACRuleAction() + { + $this->sessionClose(); + return $this->searchBase('pac.rule', array("enabled", "description", "proxies", "matches"), "description"); + } + + /** + * retrieve PAC Rule or return defaults + * @param $uuid item unique id + * @return array + */ + public function getPACRuleAction($uuid = null) + { + $this->sessionClose(); + return array("pac" => $this->getBase('rule', 'pac.rule', $uuid)); + } + + /** + * add new PAC Rule and set with attributes from post + * @return array + */ + public function addPACRuleAction() + { + $this->pac_set_helper(); + return $this->addBase('rule', 'pac.rule'); + } + + /** + * update PAC Rule + * @param string $uuid + * @return array result status + * @throws \Phalcon\Filter\Validation\Exception + */ + public function setPACRuleAction($uuid) + { + $this->pac_set_helper(); + return $this->setBase('rule', 'pac.rule', $uuid); + } + + /** + * toggle PAC Rule by uuid (enable/disable) + * @param $uuid item unique id + * @return array status + */ + public function togglePACRuleAction($uuid) + { + return $this->toggleBase('pac.rule', $uuid); + } + + /** + * delete PAC Rule by uuid + * @param $uuid item unique id + * @return array status + */ + public function delPACRuleAction($uuid) + { + return $this->delBase('pac.rule', $uuid); + } + + /** + * + * search PAC Proxy + * @return array + */ + public function searchPACProxyAction() + { + $this->sessionClose(); + return $this->searchBase('pac.proxy', array("enabled","proxy_type", "name", "url", "description"), "description"); + } + + /** + * retrieve PAC Proxy or return defaults + * @param $uuid item unique id + * @return array + */ + public function getPACProxyAction($uuid = null) + { + $this->sessionClose(); + return array("pac" => $this->getBase('proxy', 'pac.proxy', $uuid)); + } + + /** + * add new PAC Proxy and set with attributes from post + * @return array + */ + public function addPACProxyAction() + { + $this->pac_set_helper(); + return $this->addBase('proxy', 'pac.proxy'); + } + + /** + * update PAC Proxy + * @param string $uuid + * @return array result status + * @throws \Phalcon\Filter\Validation\Exception + */ + public function setPACProxyAction($uuid) + { + $this->pac_set_helper(); + return $this->setBase('proxy', 'pac.proxy', $uuid); + } + + /** + * delete PAC Proxy by uuid + * @param $uuid item unique id + * @return array status + */ + public function delPACProxyAction($uuid) + { + return $this->delBase('pac.proxy', $uuid); + } + + /** + * search PAC Match + * @return array + */ + public function searchPACMatchAction() + { + $this->sessionClose(); + return $this->searchBase('pac.match', array("enabled", "name", "description", "negate", "match_type"), "name"); + } + + /** + * retrieve PAC Match or return defaults + * @param $uuid item unique id + * @return array + */ + public function getPACMatchAction($uuid = null) + { + $this->sessionClose(); + return array("pac" => $this->getBase('match', 'pac.match', $uuid)); + } + + /** + * add new PAC Proxy and set with attributes from post + * @return array + */ + public function addPACMatchAction() + { + $this->pac_set_helper(); + return $this->addBase('match', 'pac.match'); + } + + /** + * update PAC Rule + * @param string $uuid + * @return array result status + * @throws \Phalcon\Filter\Validation\Exception + */ + public function setPACMatchAction($uuid) + { + $this->pac_set_helper(); + return $this->setBase('match', 'pac.match', $uuid); + } + + /** + * delete PAC Match by uuid + * @param $uuid item unique id + * @return array status + */ + public function delPACMatchAction($uuid) + { + return $this->delBase('pac.match', $uuid); + } + + /** + * flatten post data structure + */ + private function pac_set_helper() + { + if ($this->request->isPost() && $this->request->hasPost("pac")) { + $pac_data = $this->request->getPost('pac'); + if (is_array($pac_data)) { + foreach ($pac_data as $key => $value) { + $_POST[$key] = $value; + } + } + } + } +} diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/TemplateController.php b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/TemplateController.php new file mode 100644 index 0000000000..d6f5c04d3a --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/TemplateController.php @@ -0,0 +1,102 @@ +request->isPost() && $this->request->hasPost("content")) { + $this->sessionClose(); + $mdl = $this->getModel(); + $mdl->error_pages->template = $this->request->getPost("content", "striptags"); + $result = $this->validate(); + if (empty($result['validations'])) { + // save config if validated correctly + $this->save(); + $result = array("result" => "saved"); + } else { + $result["result"] = "failed"; + } + return $result; + } else { + return array("result" => "failed"); + } + } + + /** + * reset error_pages template + */ + public function resetAction() + { + if ($this->request->isPost()) { + $mdl = $this->getModel(); + $mdl->error_pages->template = null; + $this->save(); + return array("result" => "saved"); + } + return array("result" => "failed"); + } + + /** + * retrieve error pages template, overlay provided template zip file on top of OPNsense error pages + * using configd calls + */ + public function getAction() + { + $backend = new Backend(); + $backend->configdRun("template reload OPNsense/Proxy"); + $result = json_decode($backend->configdRun("proxy download_error_pages"), true); + if ($result != null) { + $this->response->setRawHeader("Content-Type: application/octet-stream"); + $this->response->setRawHeader("Content-Disposition: attachment; filename=proxy_template.zip"); + return base64_decode($result['payload']); + } else { + // return empty response on error + return ""; + } + } +} diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/IndexController.php b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/IndexController.php new file mode 100644 index 0000000000..7e9c7a6f11 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/IndexController.php @@ -0,0 +1,52 @@ +view->mainForm = $this->getForm("main"); + $this->view->formDialogEditPACMatch = $this->getForm("dialogEditPACMatch"); + $this->view->formDialogEditPACRule = $this->getForm("dialogEditPACRule"); + $this->view->formDialogEditPACProxy = $this->getForm("dialogEditPACProxy"); + $this->view->formDialogEditBlacklist = $this->getForm("dialogEditBlacklist"); + $this->view->pick('OPNsense/Proxy/index'); + } +} diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditBlacklist.xml b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditBlacklist.xml new file mode 100644 index 0000000000..3080848291 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditBlacklist.xml @@ -0,0 +1,51 @@ +
    + + blacklist.enabled + + checkbox + Select if job is enabled or not + + + blacklist.filename + + text + Enter a filename for storing the blacklist. + + + blacklist.url + + text + Enter an url to fetch the blacklist from. + + + blacklist.username + + text + (optional) user credentials. + + + blacklist.password + + password + (optional) user credentials. + + + blacklist.filter + + select_multiple + 300 + + + + blacklist.sslNoVerify + + checkbox + Ignore SSL certificate validation (for self-signed certificates) + + + blacklist.description + + text + Enter a description to explain what this blacklist is intended for. + + diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACMatch.xml b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACMatch.xml new file mode 100644 index 0000000000..68ae6fd226 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACMatch.xml @@ -0,0 +1,92 @@ +
    + + pac.match.name + + text + Select a name for this match. + + + pac.match.description + + text + Enter a description for this rule. The description should help you to identify this rule. + + + pac.match.negate + + checkbox + Negate this match. For example you can match if a host is not inside a network. + + + pac.match.match_type + + dropdown + Select the type of the match. Depending on the match, you will need different arguments. + + + pac.match.network + + text + Enter the network address to match in CIDR notation for example like 127.0.0.1/8 or ::1/128 + + + pac.match.hostname + + text + Enter a hostname pattern like *.opnsense.org. + + + pac.match.url + + text + Enter a URL pattern like forum.opnsense.org/index*. + + + pac.match.domain_level_from + + text + Enter the minimum amount of dots in the domain name. + + + pac.match.domain_level_to + + text + Enter the maximum amount of dots in the domain name. + + + pac.match.time_from + + text + Enter start hour (minimum 0). + + + pac.match.time_to + + text + Enter the end time (maximum 23, minimum 0 or start time). + + + pac.match.date_from + + dropdown + Enter the first month. + + + pac.match.date_to + + dropdown + Enter the last month (maximum December, minimum January or From Month). + + + pac.match.weekday_from + + dropdown + Enter the first day of the week. + + + pac.match.weekday_to + + dropdown + Enter the last day of the week. + + diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACProxy.xml b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACProxy.xml new file mode 100644 index 0000000000..d07bf44061 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACProxy.xml @@ -0,0 +1,26 @@ +
    + + pac.proxy.name + + text + Enter a name for this match. + + + pac.proxy.description + + text + Enter a description for this proxy for your reference. + + + pac.proxy.proxy_type + + dropdown + Choose a proxy type. Usually you should use Direct for a direct connection or Proxy for a Proxy. + + + pac.proxy.url + + text + Enter a proxy URL in the form proxy.example.com:3128. + + diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACRule.xml b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACRule.xml new file mode 100644 index 0000000000..3e901766c2 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogEditPACRule.xml @@ -0,0 +1,40 @@ +
    + + pac.rule.enabled + + checkbox + Please select if this rule should be added to the PAC file. + + + pac.rule.description + + text + Enter a description for this rule. The description should help you to identify this rule. + + + pac.rule.matches + + select_multiple + + Select some matches you want to use in this rule. This matches are joined using the selected separator. + + + pac.rule.join_type + + dropdown + Please select a separator to join the matches. Or means any mach can be true which can be used to configure the same proxy for multiple networks while And means all matches must be true which can be used to assign the proxy in a more detailed way. + + + pac.rule.match_type + + dropdown + Choose If in case any case you want to ensure a match to evaluate as is, else choose unless if you want the negated version. Unless is used if you want to use the proxy for every host but not for some special ones. + + + pac.rule.proxies + + select_multiple + + true + + diff --git a/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml new file mode 100644 index 0000000000..1db7c2fd7f --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/main.xml @@ -0,0 +1,634 @@ +
    + + + + proxy.general.enabled + + checkbox + Enable or disable the proxy service. + + + proxy.general.error_pages + + dropdown + + The proxy error pages can be altered, default layout uses OPNsense content, when Squid is selected + the content for the selected language will be used (standard squid layout), Custom offers the possibility + to upload your own theme content. + + + + proxy.general.icpPort + + text + The port number where Squid sends and receives ICP queries to and from neighbor caches. Leave blank to disable (default). The standard UDP port for ICP is 3130. + true + + + proxy.general.logging.enable.accessLog + + checkbox + Enable access logging. + true + + + proxy.general.logging.target + + dropdown + Send log data to the selected target. When syslog is selected, facility local 4 will be used to send messages of info level for these logs. + true + + + proxy.general.logging.enable.storeLog + + checkbox + Enable store logging. + true + + + proxy.general.logging.ignoreLogACL + + select_multiple + + Type subnets/addresses you want to ignore for the access.log. + true + true + + + proxy.general.alternateDNSservers + + select_multiple + + Type IPs of alternative DNS servers you like to use. + true + true + + + proxy.general.useViaHeader + + checkbox + If set (default), Squid will include a Via header in requests and replies as required by RFC2616. + true + + + proxy.general.forwardedForHandling + + dropdown + Select what to do with X-Forwarded-For header. If set to: "on", Squid will append your client's IP address in the HTTP requests it forwards. By default it looks like X-Forwarded-For: 192.1.2.3; If set to: "off", it will appear as X-Forwarded-For: unknown; "transparent", Squid will not alter the X-Forwarded-For header in any way; If set to: "delete", Squid will delete the entire X-Forwarded-For header; If set to: "truncate", Squid will remove all existing X-Forwarded-For entries, and place the client IP as the sole entry. + true + + + proxy.general.VisibleHostname + + text + This is the hostname to be displayed in proxy server error messages. + true + + + proxy.general.VisibleEmail + + text + This is the email address displayed in error messages to the users. + true + + + proxy.general.suppressVersion + + checkbox + Suppress Squid version string info in HTTP headers and HTML error pages. + true + + + proxy.general.connecttimeout + + text + This can help you when having connection issues with IPv6 enabled servers. Set a value in seconds + true + + + proxy.general.uriWhitespaceHandling + + dropdown + Select what to do with URI that contain whitespaces. The current Squid implementation of encode and chop violates RFC2616 by not using a 301 redirect after altering the URL. + true + + + proxy.general.enablePinger + + checkbox + Toggles the Squid pinger service. This service is used in the selection of the best parent proxy. + true + + + + + proxy.general.cache.local.cache_mem + + text + Enter the cache memory size to use or zero to disable completely. + + + proxy.general.cache.local.enabled + + checkbox + Enable or disable the local cache. Only UFS directory cache type is supported. Do not enable on embedded systems with SD or CF cards as this will wear down your drive. + + + proxy.general.cache.local.size + + text + Enter the storage size for the local cache (default is 100). + true + + + proxy.general.cache.local.directory + + text + Enter the directory location for the local cache (default is /var/squid/cache). + true + + + proxy.general.cache.local.l1 + + text + Enter the number of first-level subdirectories for the local cache (default is 16). + true + + + proxy.general.cache.local.l2 + + text + Enter the number of second-level subdirectories for the local cache (default is 256). + true + + + proxy.general.cache.local.maximum_object_size + + text + Set the maximum object size (default 4MB when left empty). + true + + + proxy.general.cache.local.maximum_object_size_in_memory + + text + Set the maximum object size in memory (default 512KB when left empty). + true + + + proxy.general.cache.local.memory_cache_mode + + dropdown + + Controls which objects to keep in the memory cache (cache_mem) + always: Keep most recently fetched objects in memory (default) + disk: Only disk cache hits are kept in memory, which means an object must first be cached on disk and then hit a second time before cached in memory. + network: Only objects fetched from network is kept in memory + + true + + + proxy.general.cache.local.cache_linux_packages + + checkbox + Enable or disable the caching of packages for linux distributions. This makes sense if you have multiple servers in your network and do not host your own package mirror. This will reduce internet traffic usage but increase disk access. + + + proxy.general.cache.local.cache_windows_updates + + checkbox + Enable or disable the caching of Windows updates. This makes sense if you don't have a WSUS server. If you can setup a WSUS server, this solution should be preferred. + + + + + proxy.general.traffic.enabled + + checkbox + Enable or disable traffic management. + + + proxy.general.traffic.maxDownloadSize + + text + Enter the maximum size for downloads in kilobytes (leave empty to disable). + + + proxy.general.traffic.maxUploadSize + + text + Enter the maximum size for uploads in kilobytes (leave empty to disable). + + + proxy.general.traffic.OverallBandwidthTrotteling + + text + Enter the allowed overall bandwidth in kilobits per second (leave empty to disable). + + + proxy.general.traffic.perHostTrotteling + + text + Enter the allowed per host bandwidth in kilobits per second (leave empty to disable). + + + + + proxy.general.parentproxy.enabled + + checkbox + Enable parent proxy feature. + + + proxy.general.parentproxy.host + + text + Parent proxy IP address or hostname. + + + proxy.general.parentproxy.port + + text + Parent proxy port. + + + proxy.general.parentproxy.enableauth + + checkbox + Enable authentication against the parent proxy. + + + proxy.general.parentproxy.user + + text + Set a username if parent proxy requires authentication. + + + proxy.general.parentproxy.password + + password + Set a password if parent proxy requires authentication. + + + proxy.general.parentproxy.localdomains + + select_multiple + + true + List of domains not to be sent via parent proxy. + + + proxy.general.parentproxy.localips + + select_multiple + + true + List of IP addresses not to be sent via parent proxy. + + + + + + + proxy.forward.interfaces + + select_multiple + Select interface(s) the proxy will bind to. + + + proxy.forward.port + + text + The port the proxy service will listen to. + + + proxy.forward.transparentMode + + checkbox + Add a new firewall rule ]]> + + + proxy.forward.sslbump + + checkbox + Add a new firewall rule ]]> + + + proxy.forward.sslurlonly + + checkbox + Do not decode and/or filter SSL content, only log requested domains and IP addresses. Some old servers may not provide SNI, so their addresses will not be indicated. + + + proxy.forward.sslbumpport + + text + The port the ssl proxy service will listen to. + + + proxy.forward.sslcertificate + + dropdown + CA Manager.]]> + + + proxy.forward.sslnobumpsites + + select_multiple + + true + Create a list of sites which may not be inspected, for example bank sites. Prefix the domain with a . to accept all subdomains (e.g. .google.com). + + + proxy.forward.ssl_crtd_storage_max_size + + text + Enter the maximum size (in MB) to use for SSL certificates. + true + + + proxy.forward.sslcrtd_children + + text + Enter the number of ssl certificate workers to use (sslcrtd_children). + true + + + proxy.forward.addACLforInterfaceSubnets + + checkbox + When enabled the subnets of the selected interfaces will be added to the allow access list. + true + + + + + proxy.forward.ftpInterfaces + + select_multiple + Select interface(s) the ftp proxy will bind to. + + + proxy.forward.ftpPort + + text + The port the proxy service will listen to. + + + proxy.forward.ftpTransparentMode + + checkbox + Enable transparent ftp proxy mode to forward all requests for destination port 21 to the proxy server without any additional configuration. + + + + + proxy.forward.acl.allowedSubnets + + select_multiple + + Type subnets you want to allow access to the proxy server. + true + + + proxy.forward.acl.unrestricted + + select_multiple + + Type IP addresses you want to allow access to the proxy server. + true + + + proxy.forward.acl.bannedHosts + + select_multiple + + Type IP addresses you want to deny access to the proxy server. + true + + + proxy.forward.acl.whiteList + + select_multiple + + Whitelist destination domains. You may use a regular expression, use a comma or press Enter for new item. Examples: "mydomain.com" matches on "*.mydomain.com"; "^https?:\/\/([a-zA-Z]+)\.mydomain\." matches on "http(s)://textONLY.mydomain.*"; "\.gif$" matches on "\*.gif" but not on "\*.gif\test"; "\[0-9]+\.gif$" matches on "\123.gif" but not on "\test.gif" + true + + + proxy.forward.acl.blackList + + select_multiple + + Blacklist destination domains. You may use a regular expression, use a comma or press Enter for new item. Examples: "mydomain.com" matches on "*.mydomain.com"; "^https?:\/\/([a-zA-Z]+)\.mydomain\." matches on "http(s)://textONLY.mydomain.*"; "\.gif$" matches on "*.gif" but not on "\*.gif\test"; "\[0-9]+\.gif$" matches on "\123.gif" but not on "\test.gif" + true + + + proxy.forward.acl.browser + + select_multiple + + Block user-agents. You may use a regular expression, use a comma or press Enter for new item. Examples: "^(.)+Macintosh(.)+Firefox/37\.0" matches on "Macintosh version of Firefox revision 37.0"; "^Mozilla" matches on "all Mozilla based browsers" + true + true + + + proxy.forward.acl.mimeType + + select_multiple + + Block specific MIME type reply. You may use a regular expression, use a comma or press Enter for new item. Examples: "video/flv" matches on "Flash Video"; "application/x-javascript" matches on "javascripts" + true + true + + + proxy.forward.acl.googleapps + + text + true + + + + proxy.forward.acl.youtube + + dropdown + true + + + + proxy.forward.acl.safePorts + + select_multiple + + Allowed destination TCP ports, you may use ranges (ex. 222-226) and add comments with colon (ex. 22:ssh). + true + true + + + proxy.forward.acl.sslPorts + + select_multiple + + Allowed destination SSL ports, you may use ranges (ex. 222-226) and add comments with colon (ex. 22:ssh). + true + true + + + + + proxy.forward.icap.enable + + checkbox + + If this checkbox is checked, you can use an ICAP server to filter or replace content. + true + false + + + proxy.forward.icap.RequestURL + + text + + Enter the url where the REQMOD requests should be sent to. + true + false + + + proxy.forward.icap.ResponseURL + + text + + Enter the url where the RESPMOD requests should be sent to. + true + false + + + proxy.forward.icap.OptionsTTL + + text + + Default ttl + true + true + + + proxy.forward.icap.SendClientIP + + checkbox + + If you enable this option, the client IP address will be sent to the ICAP server. This can be useful if you want to filter traffic based on IP addresses. + true + true + + + proxy.forward.icap.SendUsername + + checkbox + + If you enable this option, the username of the client will be sent to the ICAP server. This can be useful if you want to filter traffic based on usernames. Authentication is required to use usernames. + true + true + + + proxy.forward.icap.EncodeUsername + + checkbox + + Use this option if your usernames need to be encoded. + true + true + + + proxy.forward.icap.UsernameHeader + + text + + The header which should be used to send the username to the ICAP server. + true + true + + + proxy.forward.icap.EnablePreview + + checkbox + + If you use previews, only a part of the data is sent to the ICAP server. Setting this option can improve the performance. + true + true + + + proxy.forward.icap.PreviewSize + + text + + Enter the size of the preview which is sent to the ICAP server. + true + true + + + proxy.forward.icap.exclude + + select_multiple + + Exclusion list destination domains.You may use a regular expression, use a comma or press Enter for new item. Examples: "mydomain.com" matches on "*.mydomain.com"; "https://([a-zA-Z]+)\.mydomain\." matches on "http(s)://textONLY.mydomain.*"; "\.gif$" matches on "\*.gif" but not on "\*.gif\test"; "\[0-9]+\.gif$" matches on "\123.gif" but not on "\test.gif" + true + + + + + proxy.forward.authentication.method + + select_multiple + Select Authentication method + + + proxy.forward.authentication.authEnforceGroup + + select_multiple + + NOTE: please be aware that users (or vouchers) which aren't administered locally will be denied when using this option.]]> + + + + proxy.forward.authentication.realm + + text + The prompt will be displayed in the authentication request window. + + + proxy.forward.authentication.credentialsttl + + text + This specifies for how long (in hours) the proxy server assumes an externally validated username and password combination is valid (Time To Live). When the TTL expires, the user will be prompted for credentials again. + + + proxy.forward.authentication.children + + text + The total number of authenticator processes to spawn. + + + + + proxy.forward.snmp_enable + + checkbox + Enable or disable the squid SNMP Agent. + + + proxy.forward.snmp_port + + text + The port number where Squid listens for SNMP requests. To enable SNMP support set this to a suitable port number. Port number 3401 is often used for the Squid SNMP agent. + + + proxy.forward.snmp_password + + text + The password for access to SNMP agent + + + + + proxy-general-settings + diff --git a/www/squid/src/opnsense/mvc/app/library/OPNsense/Auth/Services/Squid.php b/www/squid/src/opnsense/mvc/app/library/OPNsense/Auth/Services/Squid.php new file mode 100644 index 0000000000..1c5f0b44d9 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/library/OPNsense/Auth/Services/Squid.php @@ -0,0 +1,105 @@ +object(); + + if (!empty((string)$configObj->OPNsense->proxy->forward->authentication->method)) { + $result = explode(',', (string)$configObj->OPNsense->proxy->forward->authentication->method); + } else { + $result[] = 'Local Database'; + } + return $result; + } + + /** + * {@inheritdoc} + */ + public function setUserName($username) + { + $this->username = $username; + } + + /** + * {@inheritdoc} + */ + public function getUserName() + { + return $this->username; + } + + /** + * {@inheritdoc} + */ + public function checkConstraints() + { + $configObj = Config::getInstance()->object(); + if (!empty((string)$configObj->OPNsense->proxy->forward->authentication->authEnforceGroup)) { + $groups = explode(',', (string)$configObj->OPNsense->proxy->forward->authentication->authEnforceGroup); + $acl = new ACL(); + foreach ($groups as $local_group) { + if ($acl->inGroup($this->getUserName(), $local_group, false)) { + return true; + } + } + return false; + } else { + return true; + } + } +} diff --git a/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/ACL/ACL.xml b/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/ACL/ACL.xml new file mode 100644 index 0000000000..220b30a9ab --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/ACL/ACL.xml @@ -0,0 +1,11 @@ + + + Services: Proxy + + ui/proxy/* + api/proxy/* + ui/diagnostics/log/squid/* + api/diagnostics/log/squid/* + + + diff --git a/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Menu/Menu.xml b/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Menu/Menu.xml new file mode 100644 index 0000000000..71280faf76 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Menu/Menu.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Migrations/M1_0_0.php b/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Migrations/M1_0_0.php new file mode 100644 index 0000000000..bbf52d2f23 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Migrations/M1_0_0.php @@ -0,0 +1,37 @@ +getFlatNodes() as $key => $node) { + if ($validateFullModel || $node->isFieldChanged()) { + // if match_type has changed we need to make some fields required + if ($node->getInternalXMLTagName() == "match_type") { + $match = $node->getParentNode(); + $match_type = (string)$match->match_type; + switch ($match_type) { + case 'url_matches': + if (strlen((string)$match->url) == 0) { + $result->appendMessage(new \Phalcon\Messages\Message( + gettext('URL must be set.'), + 'pac.match.url' + )); + } + break; + case 'hostname_matches': + case 'dns_domain_is': + case 'is_resolvable': + if (strlen((string)$match->hostname) == 0) { + $result->appendMessage(new \Phalcon\Messages\Message( + gettext('Hostname must be set.'), + 'pac.match.hostname' + )); + } + break; + case 'destination_in_net': + case 'my_ip_in_net': + if (strlen((string)$match->network) == 0) { + $result->appendMessage(new \Phalcon\Messages\Message( + gettext('Network must be set.'), + 'pac.match.network' + )); + } + case 'plain_hostname': + case 'dns_domain_levels': + case 'weekday_range': + case 'date_range': + case 'time_range': + break; // no special validation + } + } + } + } + return $result; + } +} diff --git a/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml b/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml new file mode 100644 index 0000000000..d7d2ed578e --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/models/OPNsense/Proxy/Proxy.xml @@ -0,0 +1,686 @@ + + //OPNsense/proxy + 1.0.6 + Squid web proxy settings + + + + 0 + Y + + + Squid + + OPNsense + Custom + + + + 1 + 65535 + ICP port needs to be an integer value between 1 and 65535 + + + + + 1 + Y + + + 1 + Y + + + + /^([\/0-9a-fA-F.:,])*/u + + + File + + File (Extended) + File (Json) + Syslog + Syslog (Json) + + + + + /^([\/0-9a-fA-F.:,])*/u + + + Default + + Append client's IP (on) + Set forward header to unknown (off) + Do not alter forward header (transparent) + Remove forward header (delete) + Replace all with client's IP (truncate) + + + + Default + + Strip whitespaces + Deny request + Allow whitespaces + Encode whitespaces (RFC1738) + Chop URI at first whitespace + + + + 1 + Y + + + + + 1 + 120 + + + Please enter a valid email address. + + + /^([0-9a-zA-Z\.,_\-:]){0,1024}$/u + Please enter a valid servername, ip address or leave this option blank. + + + + + 0 + Y + + + /var/squid/cache + Y + + + 256 + 0 + Specify a positive memory cache size. (number of MB's) + Y + + + 1 + 99999 + Specify a maximum object size. (number of MB's) + + + 1 + 99999 + Specify a maximum object size in memory. (number of KB's) + + + Default + + Keep all most recent files (always) + Keep most recent HIT files(disk) + Keep only files fetched from network (network) + + + + 100 + 1 + Specify a positive cache size. (number of MB's) + Y + + + 16 + 1 + Specify a positive number of first-level subdirectories. + Y + + + 256 + 1 + Specify a positive number of second-level subdirectories. + Y + + + 0 + Y + + + 0 + Y + + + + + + 0 + Y + + + 1 + Specify the maximum download size (kB). + + + 1 + Specify the maximum upload size (kB). + + + 1 + Specify the overall bandwidth for downloads in kilobits per second. + + + Both throttling parameters should either be filled or empty + AllOrNoneConstraint + + perHostTrotteling + + + + + + 1 + Specify the per host bandwidth for downloads in kilobits per second. + + + OverallBandwidthTrotteling.check001 + + + + + + + 0 + Y + + + + + A host must be set. + DependConstraint + + enabled + + + + + + 0 + Y + + + username + Y + /^([0-9a-zA-Z\._\-%@]){1,128}$/u + Username can be up to 128 signs long. Alphanumeric characters and also dot, dash, percent sign (for URL escapes), at sign and underscore allowed. + + + password + Y + /^([0-9a-zA-Z\._\-%]){1,128}$/u + Password can be up to 128 signs long. Alphanumeric characters and also dot, dash, percent sign (for URL escapes) and underscore allowed. + + + + + A port must be set. + DependConstraint + + enabled + + + + + + + + + + + Y + S + + /^(?!0).*$/ + /^((?!dhcp).)*$/ + + + + 3128 + 1 + 65535 + Proxy port needs to be an integer value between 1 and 65535 + Y + + + 3129 + 1 + 65535 + SSL Proxy port needs to be an integer value between 1 and 65535 + Y + + + 0 + Y + + + When enabling "Log SNI information only", SSL inspection must also be enabled + DependConstraint + + sslurlonly + + + + + + 0 + Y + + + sslbump.check001 + + + + + ca + Please select a valid certificate from the list + + + /^([a-zA-Z0-9\.:\[\]\s\-]*?,)*([a-zA-Z0-9\.:\[\]\s\-]*)$/ + Please enter ip addresses or domain names here + + + Y + 4 + 1 + 65535 + max size needs to be an integer value between 1 and 65535 + + + Y + 5 + 1 + 32 + the number of sslrtd children needs to be an integer value between 1 and 32 + + + 0 + Y + + + 1 + 65535 + SNMP port needs to be an integer value between 1 and 65535 + Y + 3401 + + + public + Y + + + Y + + /^(?!0).*$/ + /^((?!dhcp).)*$/ + + + + 2121 + 1 + 65535 + FTP Proxy port needs to be an integer value between 1 and 65535 + Y + + + 0 + Y + + + 1 + Y + + + 0 + Y + + + + /^([\/0-9a-fA-F.:,])*/u + + + /^([\/0-9a-fA-F.:,])*/u + + + /^([\/0-9a-fA-F.:,])*/u + + + + + + + /^([a-zA-Z0-9]){0,}\.([a-zA-Z0-9].){0,}/ + Please enter a valid domain name here + + + + Strict + Moderate + + + + /^([ \-0-9a-zA-Z:,])*/u + + + /^([ \-0-9a-zA-Z:,])*/u + + + + + + 1 + Y + + + Y + /^[a-zA-Z0-9]{1,245}\.?[a-zA-z0-9]{1,10}$/ + The filename may only contain letters, digits and one dot (not required). + + + Filename should be unique + UniqueConstraint + + + + + Y + + + /^([\t\n\v\f\r 0-9a-zA-Z.,_\x{00A0}-\x{FFFF}]){1,255}$/u + + + /^([\t\n\v\f\r 0-9a-zA-Z.,_\x{00A0}-\x{FFFF}]){1,255}$/u + + + filename + /usr/local/etc/squid/acl/%s.index + Y + Y + + + 0 + Y + + + Y + /^([\t\n\v\f\r 0-9a-zA-Z.,_\x{00A0}-\x{FFFF}]){1,255}$/u + + + + + + + OPNsense.Cron.Cron + jobs.job + description + + /Proxy/ + + + + Related cron not found + + + + + + 0 + Y + + + + + Y + 1 + + + 0 + Y + + + 0 + Y + + + Y + X-Username + /^([a-zA-Z-]+)$/ + + + 1 + Y + + + 1024 + Y + + + 60 + Y + + + + + + Y + + + Y + + + /^([\t\n\v\f\r 0-9a-zA-Z.,_\x{00A0}-\x{FFFF}]){0,255}$/u + + + 1 + Credentials TTL needs to be an integer value above 0 + + + 1 + Number of children needs to be an integer value above 0 + + + + + + + Y + The proxy name must be set. + + + Proxy name should be unique + UniqueConstraint + + + + + Y + + Proxy + Direct Connection (no Proxy) + HTTP Proxy + HTTPS Proxy + SOCKS + SOCKS Version 4 + SOCKS Version 5 + + + + This does not look like a valid proxy or direct connection. + + + /^([\t\n\v\f\r 0-9a-zA-Z\-.,_\x{00A0}-\x{FFFF}]){1,255}$/u + + + + + Y + The match name must be set. + + + Match name should be unique + UniqueConstraint + + + + + /^([\t\n\v\f\r 0-9a-zA-Z\-.,_\x{00A0}-\x{FFFF}]){1,255}$/u + + + 0 + Y + + + Y + + URL Matches + Hostname Matches + DNS Domain Is + IP Is In Network + My IP Is In Network + Plain Hostname (No Dots Inside) + Is Resolvable + DNS Domain Levels (Count Of Dots) + Weekday Range + Date Range + Time Range + + + + + /^[^"]*$/ + + + + 0 + Minimum domain level must be bigger than 0. + + + 0 + A hostname cannot have a negative count of levels. + + + 0 + The first hour of the day is 0. + + + 0 + 23 + The last hour of the day is 23! + + + Y + + January + February + March + April + May + June + July + August + September + October + November + December + + + + Y + + January + February + March + April + May + June + July + August + September + October + November + December + + + + Y + + Monday + Tuesday + Wednesday + Thursday + Friday + Saturday + Sunday + + + + Y + + Monday + Tuesday + Wednesday + Thursday + Friday + Saturday + Sunday + + + + + + 1 + Y + + + /^([\t\n\v\f\r 0-9a-zA-Z\-.,_\x{00A0}-\x{FFFF}]){1,255}$/u + + + + + OPNsense.Proxy.Proxy + pac.match + name + + + Y + Y + + + Y + + And + Or + + + + Y + + If + Unless + + + + Y + + + OPNsense.Proxy.Proxy + pac.proxy + name + + + Y + Y + + + + + + + + diff --git a/www/squid/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt b/www/squid/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt new file mode 100644 index 0000000000..bda232e0d4 --- /dev/null +++ b/www/squid/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt @@ -0,0 +1,602 @@ +{# + # Copyright (c) 2014-2015 Deciso B.V. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} + + + + + +
    + {{ partial("layout_partials/base_tabs_content",['formData':mainForm]) }} +
    +
    {{ lang._('ID') }} {{ lang._('Enabled') }} {{ lang._('Name') }} {{ lang._('Device') }} +
    + + + + + + + + + + + + + + + + +
    {{ lang._('Name') }}{{ lang._('Description') }}{{ lang._('Match Type') }}{{ lang._('Action') }}
    + + +
    +
    +
    + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Description') }}{{ lang._('Actions') }}
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + +
    {{ lang._('Name') }}{{ lang._('Type') }}{{ lang._('URL') }}{{ lang._('Description') }}{{ lang._('Actions') }}
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + +
    + {{ lang._('full help') }} +
    + + {{ lang._('Remote Blacklist') }} +
    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Filename') }}{{ lang._('URL') }}{{ lang._('Description') }}{{ lang._('Edit | Delete') }}
    + +
    +
    +
    + + + + +
    +
    +
    +
    + + + + + + + + + + + + + +
    {{ lang._('Action')}}
    + + + {{ lang._('Reset all generated content (cached files and certificates included) and restart the proxy.') }} +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Action')}}
    + +
    + +
    + + + +
    +
    + +
    + {{ lang._('Download and upload custom error pages, if no (new) files are provided our defaults are used.')}} +
    + +
    +
    +
    +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogEditBlacklist,'id':'DialogEditBlacklist','label':lang._('Edit blacklist')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditPACProxy,'id':'DialogEditPACProxy','label':lang._('Edit Proxy')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditPACMatch,'id':'DialogEditPACMatch','label':lang._('Edit Match')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditPACRule,'id':'DialogEditPACRule','label':lang._('Edit Rule')])}} diff --git a/www/squid/src/opnsense/scripts/proxy/deploy_error_pages.py b/www/squid/src/opnsense/scripts/proxy/deploy_error_pages.py new file mode 100755 index 0000000000..f6e63c8aa5 --- /dev/null +++ b/www/squid/src/opnsense/scripts/proxy/deploy_error_pages.py @@ -0,0 +1,54 @@ +#!/usr/local/bin/python3 + +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +import ujson +import os +import re +from lib import ProxyTemplates +target_directory = "/usr/local/etc/squid/errors/local" + +if __name__ == '__main__': + proxy_templates = ProxyTemplates() + + # install error_pages into target_directory + if not os.path.isdir(target_directory): + os.mkdir(target_directory) + for filename, data in proxy_templates.templates(proxy_templates.overlay_enabled()): + match = proxy_templates.css_section(data) + if match: + inline_css = list() + for dep_filename in proxy_templates.css_dependencies(filename, proxy_templates.overlay_enabled()): + css_content = proxy_templates.get_file(dep_filename, proxy_templates.overlay_enabled()) + if css_content: + inline_css.append(b'' % css_content) + data = b"%s%s%s" % (data[0:match.start()], b"\n".join(inline_css), data[match.end():]) + with open("%s/%s" % (target_directory, os.path.splitext(filename)[0]), "wb") as target_fh: + target_fh.write(data) + print(ujson.dumps({ + 'overlay_status': proxy_templates.get_overlay_status() + })) diff --git a/www/squid/src/opnsense/scripts/proxy/download_error_pages.py b/www/squid/src/opnsense/scripts/proxy/download_error_pages.py new file mode 100755 index 0000000000..4c786a8dd2 --- /dev/null +++ b/www/squid/src/opnsense/scripts/proxy/download_error_pages.py @@ -0,0 +1,53 @@ +#!/usr/local/bin/python3 + +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +import base64 +import ujson +import os +import re +import zipfile +from io import BytesIO +from lib import ProxyTemplates + +if __name__ == '__main__': + root_dir = "/proxy_template" + proxy_templates = ProxyTemplates() + output_data = BytesIO() + processed = list() + with zipfile.ZipFile(output_data, mode='w', compression=zipfile.ZIP_DEFLATED) as zf: + for filename, data in proxy_templates.templates(True): + zf.writestr("%s/%s" % (root_dir, filename), data) + for dep_filename in proxy_templates.css_dependencies(filename, True): + if dep_filename not in processed: + zf.writestr("%s/%s" % (root_dir, dep_filename), proxy_templates.get_file(dep_filename, True)) + processed.append(dep_filename) + + response = dict() + response['payload'] = base64.b64encode(output_data.getvalue()).decode() + response['size'] = len(response['payload']) + print(ujson.dumps(response)) diff --git a/www/squid/src/opnsense/scripts/proxy/fetchACLs.py b/www/squid/src/opnsense/scripts/proxy/fetchACLs.py new file mode 100755 index 0000000000..af59239976 --- /dev/null +++ b/www/squid/src/opnsense/scripts/proxy/fetchACLs.py @@ -0,0 +1,381 @@ +#!/usr/local/bin/python3 + +""" + Copyright (c) 2016-2019 Ad Schellevis + Copyright (c) 2015 Jos Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" + +import tempfile +import os +import sys +import json +import glob +import os.path +import tarfile +import gzip +import zipfile +import syslog +import urllib3 +from configparser import ConfigParser +from urllib.request import urlopen +from urllib.error import URLError +from urllib.error import HTTPError +import requests +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + +acl_config_fn = '/usr/local/etc/squid/externalACLs.conf' +acl_target_dir = '/usr/local/etc/squid/acl' +acl_max_timeout = 30 + + +class Downloader(object): + """ Download helper + """ + + def __init__(self, url,username, password, timeout, ssl_no_verify=False): + """ init new + :param url: source url + :param timeout: timeout in seconds + """ + self._url = url.strip() + self._timeout = timeout + self._source_handle = None + self._username = username + self._password = password + self._ssl_no_verify = ssl_no_verify + + def fetch(self): + """ fetch (raw) source data into tempfile using self._source_handle + """ + self._source_handle = None + if self._url.lower().startswith('http://') or self._url.lower().startswith('https://'): + # HTTP(S) download + req_opts = dict() + req_opts['url'] = self._url + req_opts['stream'] = True + req_opts['timeout'] = self._timeout + if self._ssl_no_verify: + req_opts['verify'] = False + if self._username is not None: + req_opts['auth'] = (self._username, self._password) + req = requests.get(**req_opts) + if req.status_code == 200: + req.raw.decode_content = True + self._source_handle = tempfile.NamedTemporaryFile('wb+', 10240) + while True: + data = req.raw.read(10240) + if not data: + break + else: + self._source_handle.write(data) + self._source_handle.seek(0) + else: + syslog.syslog(syslog.LOG_ERR, 'proxy acl: error downloading %s (http code: %s)' % (self._url, + req.status_code)) + elif self._url.lower().startswith('ftp://'): + # FTP download + try: + f = urlopen(self._url, timeout=self._timeout) + self._source_handle = tempfile.NamedTemporaryFile('wb+', 10240) + while True: + data = f.read(10240) + if not data: + break + else: + self._source_handle.write(data) + self._source_handle.seek(0) + f.close() + except (URLError, HTTPError, IOError) as e: + syslog.syslog(syslog.LOG_ERR, 'proxy acl: error downloading %s' % self._url) + else: + syslog.syslog(syslog.LOG_ERR, 'proxy acl: unsupported protocol for %s' % self._url) + + def get_files(self): + """ process downloaded data, handle compression + :return: iterator filename, file handle + """ + if self._source_handle is not None: + # handle compressed data + if (len(self._url) > 8 and self._url[-7:] == '.tar.gz') \ + or (len(self._url) > 4 and self._url[-4:] == '.tgz'): + # source is in tar.gz format, extract all into a single string + try: + tf = tarfile.open(fileobj=self._source_handle) + for tf_file in tf.getmembers(): + if tf_file.isfile(): + yield tf_file.name, tf.extractfile(tf_file) + except IOError as e: + syslog.syslog(syslog.LOG_ERR, 'proxy acl: error downloading %s (%s)' % (self._url, e)) + elif len(self._url) > 4 and self._url[-3:] == '.gz': + # source is in .gz format unpack + try: + gf = gzip.GzipFile(mode='r', fileobj=self._source_handle) + yield os.path.basename(self._url), gf + except IOError as e: + syslog.syslog(syslog.LOG_ERR, 'proxy acl: error downloading %s (%s)' % (self._url, e)) + elif len(self._url) > 5 and self._url[-4:] == '.zip': + # source is in .zip format, extract all into a single string + with zipfile.ZipFile(self._source_handle, + mode='r', + compression=zipfile.ZIP_DEFLATED) as zf: + for item in zf.infolist(): + if item.file_size > 0: + yield item.filename, zf.open(item) + else: + yield os.path.basename(self._url), self._source_handle + + def download(self): + """ download / unpack ACL + :return: iterator filename, type, content + """ + self.fetch() + for filename, filehandle in self.get_files(): + basefilename = os.path.basename(filename).lower() + file_ext = filename.split('.')[-1].lower() + while True: + line = filehandle.readline().decode(encoding='utf-8', errors='ignore') + if not line: + break + yield filename, basefilename, file_ext, line + + +class DomainSorter(object): + """ Helper class for building sorted squid domain acl list. + Use as file type object, close flushes the actual (sorted) data to disc + """ + + def __init__(self, filename=None): + """ new sorted output file, uses an acl record in reverse order as sort key + :param filename: target filename + :param mode: file open mode + """ + self._num_targets = 20 + self._separator = '|' + self._buckets = dict() + self._sort_map = dict() + # setup target + self._target_filename = filename + # setup temp files + self.generate_targets() + + def generate_targets(self): + """ generate ordered targets + """ + sets = 255 + for i in range(sets): + target = chr(i + 1) + setid = int(i / (sets / self._num_targets)) + if setid not in self._buckets: + self._buckets[setid] = tempfile.NamedTemporaryFile('wb+', 10240) + self._sort_map[target] = self._buckets[setid] + + def write(self, data): + """ save content, send reverse sorted to buffers + :param data: line to write + """ + line = data.strip().lower() + if len(line) > 0: + # Calculate sort key, which is the reversed url with dots (.) replaced by spaces. + # We need to replace dots (.) here to avoid having a wrong sorting order when dashes + # or similar characters are used inside the url. + # (The process writing out the domains checks for domain overlaps) + sort_key = line[::-1].replace('.', ' ') + self.add(sort_key, line) + + def add(self, key, value): + """ spool data to temp + :param key: key to use + :param value: value to store + """ + target = key[0] + if target in self._sort_map: + for part in (key, self._separator, value, '\n'): + self._sort_map[target].write(part.encode('utf-8')) + else: + # not supposed to happen, every key should have a calculated target pool + pass + + def reader(self): + """ read reverse + """ + for target in sorted(self._buckets): + self._buckets[target].seek(0) + set_content = dict() + while True: + line = self._buckets[target].readline().decode() + if not line: + break + else: + set_content[line.split('|')[0]] = '|'.join(line.split('|')[1:]) + for itemkey in sorted(set_content, reverse=True): + yield set_content[itemkey] + + @staticmethod + def is_domain(tag): + """ check if tag is probably a domain name + :param tag: tag to inspect + :return: boolean + """ + has_chars = False + for tag_item in tag: + if not tag_item.isdigit() and tag_item not in ('.', ',', '|', '/', '\n'): + has_chars = True + elif tag_item in (':', '|', '/'): + return False + if has_chars: + return True + else: + return False + + def close(self): + """ close and dump content + """ + if self._target_filename is not None: + # flush to file on close + with open(self._target_filename, 'wb', buffering=10240) as f_out: + prev_line = None + for line in self.reader(): + line = line.lstrip('.') + if prev_line == line: + # duplicate, skip + continue + if self.is_domain(line): + # prefix domain, if this domain is different then the previous one + if prev_line is None or '.%s' % line not in prev_line: + f_out.write(b'.') + f_out.write(line.encode()) + prev_line = line + + +def filename_in_ignorelist(bfilename, filename_ext): + """ ignore certain files from processing. + :param bfilename: basefilename to inspect + :param filename_ext: extension of the filename + """ + if filename_ext in ['pdf', 'txt', 'doc']: + return True + elif bfilename in ('readme', 'license', 'usage', 'categories'): + return True + return False + + +def main(): + # parse OPNsense external ACLs config + if os.path.exists(acl_config_fn): + # create acl directory (if new) + if not os.path.exists(acl_target_dir): + os.mkdir(acl_target_dir) + else: + # remove index files + for filename in glob.glob('%s/*.index' % acl_target_dir): + os.remove(filename) + # read config and download per section + cnf = ConfigParser() + cnf.read(acl_config_fn) + for section in cnf.sections(): + target_filename = acl_target_dir + '/' + section + if cnf.has_option(section, 'url'): + # collect filters to apply + acl_filters = list() + if cnf.has_option(section, 'filter'): + for acl_filter in cnf.get(section, 'filter').strip().split(','): + if len(acl_filter.strip()) > 0: + acl_filters.append(acl_filter) + + # define target(s) + targets = {'domain': {'filename': target_filename, 'handle': None, 'class': DomainSorter}} + + # only generate files if enabled, otherwise dump empty files + if cnf.has_option(section, 'enabled') and cnf.get(section, 'enabled') == '1': + download_url = cnf.get(section, 'url') + if cnf.has_option(section, 'username'): + download_username = cnf.get(section, 'username') + download_password = cnf.get(section, 'password') + else: + download_username = None + download_password = None + if cnf.has_option(section, 'sslNoVerify') and cnf.get(section, 'sslNoVerify') == '1': + sslNoVerify = True + else: + sslNoVerify = False + acl = Downloader(download_url, download_username, download_password, acl_max_timeout, sslNoVerify) + all_filenames = list() + for filename, basefilename, file_ext, line in acl.download(): + if filename_in_ignorelist(basefilename, file_ext): + # ignore documents, licenses and readme's + continue + + # detect output type + if '/' in line or '|' in line: + filetype = 'url' + elif line.startswith('#'): + filetype = 'comment' + else: + filetype = 'domain' + + if filename not in all_filenames: + all_filenames.append(filename) + + if len(acl_filters) > 0: + acl_found = False + for acl_filter in acl_filters: + if acl_filter in filename: + acl_found = True + break + if not acl_found: + # skip this acl entry + continue + + if filetype in targets and targets[filetype]['handle'] is None: + targets[filetype]['handle'] = targets[filetype]['class'](targets[filetype]['filename']) + if filetype in targets: + targets[filetype]['handle'].write(line) + targets[filetype]['handle'].write('\n') + # save index to disc + with open('%s.index' % target_filename, 'w', buffering=10240) as idx_out: + index_data = dict() + for filename in all_filenames: + if len(filename.split('/')) > 2: + index_key = '/'.join(filename.split('/')[1:-1]) + if index_key not in index_data: + index_data[index_key] = index_key + idx_out.write(json.dumps(index_data)) + + # cleanup + for filetype in targets: + if targets[filetype]['handle'] is not None: + targets[filetype]['handle'].close() + elif cnf.has_option(section, 'enabled') and cnf.get(section, 'enabled') != '1': + if os.path.isfile(targets[filetype]['filename']): + # disabled, remove previous data + os.remove(targets[filetype]['filename']) + elif not os.path.isfile(targets[filetype]['filename']): + # no data fetched and no file available, create new empty file + with open(targets[filetype]['filename'], 'w') as target_out: + target_out.write("") + + +# execute downloader +main() diff --git a/www/squid/src/opnsense/scripts/proxy/generate_cert.php b/www/squid/src/opnsense/scripts/proxy/generate_cert.php new file mode 100755 index 0000000000..b2df4aabf7 --- /dev/null +++ b/www/squid/src/opnsense/scripts/proxy/generate_cert.php @@ -0,0 +1,53 @@ +#!/usr/local/bin/php + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +""" +import ujson +import os +import base64 +import binascii +import re +import zipfile +import glob +from io import BytesIO + +class ProxyTemplates: + error_config = "/usr/local/etc/squid/error_directory.in" + + def __init__(self): + self._all_src_files = dict() + self._all_ovl_files = dict() + self._overlay_status = None + self._install_overlay = False + self._overlay_data = None + self._load_config() + self.load() + + def _load_config(self): + """ initialize configuration + """ + if os.path.isfile(self.error_config): + error_cfg = ujson.loads(open(self.error_config, 'rb').read()) + self._install_overlay = 'install' not in error_cfg or error_cfg['install'] != 'opnsense' + self._overlay_data = error_cfg['content'] if 'content' in error_cfg else None + + def load(self): + """ load (custom) error pages in memory + """ + self._overlay_status = None + self._all_src_files = dict() + self._all_ovl_files = dict() + # base (OPNsense) template + for filename in glob.glob("/usr/local/opnsense/data/proxy/template_error_pages/*"): + bfilename = os.path.basename(filename) + with open(filename, "rb") as f_in: + self._all_src_files[bfilename] = f_in.read() + + # when a (valid) overlay is provided, read it's contents + if self._overlay_data and self._install_overlay: + try: + input_data = BytesIO(base64.b64decode(self._overlay_data)) + root_dir = "" + with zipfile.ZipFile(input_data, mode='r', compression=zipfile.ZIP_DEFLATED) as zf_in: + for zf_info in zf_in.infolist(): + if not root_dir and zf_info.filename.endswith('/'): + root_dir = zf_info.filename + else: + self._all_ovl_files[zf_info.filename.replace(root_dir, "")] = zf_in.read(zf_info.filename) + except binascii.Error: + self._overlay_status = 'Not a base64 encoded file' + except zipfile.BadZipFile: + self._overlay_status = 'Illegal zip file' + except IOError: + self._overlay_status = 'Error reading file' + + def templates(self, overlay=False): + """ return template html files + :param overlay: consider custom theme files when applicable + :rtype: [string, bytes] + """ + for filename in self._all_src_files: + if filename.endswith('.html'): + if overlay and filename in self._all_ovl_files: + yield filename, self._all_ovl_files[filename] + else: + yield filename, self._all_src_files[filename] + + def get_file(self, filename, overlay=False): + """ return file content + :param filename: source filename + :param overlay: consider custom theme files when applicable + :return: string + """ + if filename in self._all_src_files: + if overlay and filename in self._all_ovl_files: + return self._all_ovl_files[filename] + else: + return self._all_src_files[filename] + + @staticmethod + def css_section(data): + """ extract css definition block from provided data + :param data: html data + :return: MatchObject + """ + return re.search(b'()', data, re.DOTALL) + + def css_dependencies(self, filename, overlay=False): + """ extract css dependencies from provided filename + :param filename: source filename + :param overlay: consider custom theme files when applicable + :rtype: list + """ + data = self.get_file(filename, overlay) + if filename.endswith('.html') and data: + match = self.css_section(data) + if match: + for href in re.findall(b"(href[\s]*=[\s]*[\"|'])(.*?)([\"|'])" ,match.group(0)): + yield href[1].decode() + + def overlay_enabled(self): + """ when deploying files, should we consider an overlay + :return: bool + """ + return self._install_overlay + + def get_overlay_status(self): + """ return validity of the installed overlay + :return: string + """ + return self._overlay_status diff --git a/www/squid/src/opnsense/scripts/proxy/setup.sh b/www/squid/src/opnsense/scripts/proxy/setup.sh new file mode 100755 index 0000000000..795ebdd0d9 --- /dev/null +++ b/www/squid/src/opnsense/scripts/proxy/setup.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +SQUID_DIRS="/var/log/squid /var/run/squid /var/squid /var/squid/cache /var/squid/ssl /var/squid/logs /usr/local/etc/squid/errors/local" + +for SQUID_DIR in ${SQUID_DIRS}; do + mkdir -p ${SQUID_DIR} + chown -R squid:squid ${SQUID_DIR} + chmod -R 750 ${SQUID_DIR} +done +/usr/sbin/pw groupmod proxy -m squid +/usr/local/sbin/squid -z -N > /dev/null 2>&1 + +# remove ssl certificate store in case the user changed the CA +if [ -f /usr/local/etc/squid/ca.pem.id ]; then + current_cert=`cat /usr/local/etc/squid/ca.pem.id` + if [ -d /var/squid/ssl_crtd ]; then + if [ -f /var/squid/ssl_crtd.id ]; then + running_cert=`cat /var/squid/ssl_crtd.id` + else + running_cert="" + fi + if [ "$current_cert" != "$running_cert" ]; then + rm -rf /var/squid/ssl_crtd + fi + fi +fi + +# create ssl certificate store, in case sslbump is enabled we need this +if [ ! -d /var/squid/ssl_crtd ]; then + /usr/local/libexec/squid/security_file_certgen -c -s /var/squid/ssl_crtd -M 10 > /dev/null 2>&1 + chown -R squid:squid /var/squid/ssl_crtd + chmod -R 750 /var/squid/ssl_crtd + if [ -f /usr/local/etc/squid/ca.pem.id ]; then + cat /usr/local/etc/squid/ca.pem.id > /var/squid/ssl_crtd.id + fi +fi + +# generate SSL bump certificate +/usr/local/opnsense/scripts/proxy/generate_cert.php > /dev/null 2>&1 + +# install theme files +/usr/local/opnsense/scripts/proxy/deploy_error_pages.py > /dev/null 2>&1 diff --git a/www/squid/src/opnsense/scripts/syslog/logformats/squid.py b/www/squid/src/opnsense/scripts/syslog/logformats/squid.py new file mode 100755 index 0000000000..e5dca0c66d --- /dev/null +++ b/www/squid/src/opnsense/scripts/syslog/logformats/squid.py @@ -0,0 +1,107 @@ +""" + Copyright (c) 2020 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import re +import datetime +from . import NewBaseLogFormat +squid_ext_timeformat = r'.*(\[\d{1,2}/[A-Za-z]{3}/\d{4}:\d{1,2}:\d{1,2}:\d{1,2} \+\d{4}\]).*' +squid_timeformat = r'^(\d{4}/\d{1,2}/\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}).*' + + +class SquidLogFormat(NewBaseLogFormat): + def __init__(self, filename): + super().__init__(filename) + self._priority = 100 + + def match(self, line): + return self._filename.find('squid') > -1 and re.match(squid_timeformat, line) is not None + + @property + def timestamp(self): + tmp = re.match(squid_timeformat, self._line) + grp = tmp.group(1) + return datetime.datetime.strptime(grp, "%Y/%m/%d %H:%M:%S").isoformat() + + @property + def process_name(self): + return "squid" + + @property + def line(self): + return self._line[19:].strip() + + +class SquidExtLogFormat(NewBaseLogFormat): + def __init__(self, filename): + super().__init__(filename) + self._priority = 120 + + def match(self, line): + return self._filename.find('squid') > -1 and re.match(squid_ext_timeformat, line) is not None + + @property + def timestamp(self): + tmp = re.match(squid_ext_timeformat, self._line) + grp = tmp.group(1) + return datetime.datetime.strptime(grp[1:].split()[0], "%d/%b/%Y:%H:%M:%S").isoformat() + + @property + def process_name(self): + return "squid" + + @property + def line(self): + tmp = re.match(squid_ext_timeformat, self._line) + grp = tmp.group(1) + return self._line.replace(grp, '') + + +class SquidJsonLogFormat(NewBaseLogFormat): + def __init__(self, filename): + super().__init__(filename) + self._priority = 140 + local_now = datetime.datetime.now() + utc_now = datetime.datetime.utcnow() + self._localtimezone = datetime.timezone(local_now - utc_now) + + def match(self, line): + return self._filename.find('squid') > -1 and line.find('"@timestamp"') > -1 + + @property + def timestamp(self, line): + tmp = line[line.find('"@timestamp"')+13:].split(',')[0].strip().strip('"') + try: + return datetime.datetime.strptime(tmp, "%Y-%m-%dT%H:%M:%S%z")\ + .astimezone(self._localtimezone).isoformat().split('.')[0].split('+')[0] + except ValueError: + return None + + @property + def process_name(self): + return "squid" + + @property + def line(self): + return self._line diff --git a/www/squid/src/opnsense/service/conf/actions.d/actions_proxy.conf b/www/squid/src/opnsense/service/conf/actions.d/actions_proxy.conf new file mode 100644 index 0000000000..6082fc81d7 --- /dev/null +++ b/www/squid/src/opnsense/service/conf/actions.d/actions_proxy.conf @@ -0,0 +1,82 @@ +[start] +command: + /usr/local/sbin/pluginctl -c webproxy start; + /usr/local/etc/rc.d/squid start 2>&1 && echo "__ok__"; exit 0 +parameters: +type:script_output +message:starting proxy + +[stop] +command: + /usr/local/etc/rc.d/squid stop; + /usr/bin/killall squid; + /usr/local/sbin/pluginctl -c webproxy stop; + exit 0 +parameters: +type:script +message:stopping proxy + +[restart] +command: + /usr/local/sbin/pluginctl -c webproxy restart; + /usr/local/etc/rc.d/squid restart 2>&1 && echo "__ok__"; exit 0 +parameters: +type:script_output +message:restarting proxy +description:Restart Web Proxy service + +[reset] +command: + /usr/bin/killall -9 squid; + rm /var/run/squid/squid.pid; + rm -rf /var/squid/*; + /usr/local/sbin/pluginctl -c webproxy start; + /usr/local/etc/rc.d/squid start +parameters: +type:script +message:reset and restart proxy + +[reload] +command: + /usr/local/sbin/pluginctl -c webproxy reload; + /usr/local/opnsense/scripts/proxy/deploy_error_pages.py; + /usr/local/etc/rc.d/squid reload +parameters: +type:script +message:reload proxy + +[status] +command:/usr/local/etc/rc.d/squid status;exit 0 +parameters: +type:script_output +message:request proxy status + +[fetchacls] +command: + /usr/local/bin/flock -n -E 0 -o /tmp/fetchACLs.lock /usr/local/opnsense/scripts/proxy/fetchACLs.py && ( + /usr/local/sbin/pluginctl -c webproxy reload; + /usr/local/etc/rc.d/squid reload + ) +parameters: +type:script +message:download and reload proxy ACLs from remote locations +description:Download and reload external proxy ACLs + +[downloadacls] +command:/usr/local/bin/flock -n -E 0 -o /tmp/fetchACLs.lock /usr/local/opnsense/scripts/proxy/fetchACLs.py +parameters: +type:script +message:download proxy ACLs from remote locations +description:Download external proxy ACLs + +[deploy_error_pages] +command:/usr/local/opnsense/scripts/proxy/deploy_error_pages.py +parameters: +type:script_output +message:deploy error pages + +[download_error_pages] +command:/usr/local/opnsense/scripts/proxy/download_error_pages.py +parameters: +type:script_output +message:download error pages diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/+TARGETS b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/+TARGETS new file mode 100644 index 0000000000..113237f505 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/+TARGETS @@ -0,0 +1,15 @@ +auth.conf:/usr/local/etc/squid/auth/dummy.conf +ca.pem.id:/usr/local/etc/squid/ca.pem.id +cache.active:/var/squid/cache/active +error_directory_in:/usr/local/etc/squid/error_directory.in +externalACLs.conf:/usr/local/etc/squid/externalACLs.conf +newsyslog.conf:/etc/newsyslog.conf.d/squid +nobumpsites.acl:/usr/local/etc/squid/nobumpsites.acl +parentproxy.conf:/usr/local/etc/squid/pre-auth/parentproxy.conf +post-auth.conf:/usr/local/etc/squid/post-auth/dummy.conf +pre-auth.conf:/usr/local/etc/squid/pre-auth/dummy.conf +rc.conf.d:/etc/rc.conf.d/squid/squid +snmp.conf:/usr/local/etc/squid/pre-auth/40-snmp.conf +squid.conf:/usr/local/etc/squid/squid.conf +squid.pam:/etc/pam.d/squid +wpad.dat:/usr/local/www/wpad.dat diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/auth.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/auth.conf new file mode 100644 index 0000000000..d0ef53e5ef --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/auth.conf @@ -0,0 +1,3 @@ +# AUTOGENERATED FILE. DO NOT EDIT. +# DO NOT REMOVE THIS FILE! +# This directory is for auth config files diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/ca.pem.id b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/ca.pem.id new file mode 100644 index 0000000000..e907aec5e9 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/ca.pem.id @@ -0,0 +1,3 @@ +{% if helpers.exists('OPNsense.proxy.forward.sslcertificate') %} +{{ OPNsense.proxy.forward.sslcertificate }} +{% endif %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/cache.active b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/cache.active new file mode 100644 index 0000000000..e8eac9df14 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/cache.active @@ -0,0 +1,5 @@ +{% if helpers.exists('OPNsense.proxy.general.cache.local') %} +{% if OPNsense.proxy.general.cache.local.enabled == '1' %} +yes +{% endif %} +{% endif %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/error_directory_in b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/error_directory_in new file mode 100644 index 0000000000..f9d52ca004 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/error_directory_in @@ -0,0 +1,7 @@ +{# + base64 encoded zip archive containing template overrides +#} +{ + "install": "{{ OPNsense.proxy.general.error_pages|default('opnsense') }}", + "content": "{% if not helpers.empty('OPNsense.proxy.error_pages.template') %}{{ OPNsense.proxy.error_pages.template }}{% endif %}" +} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/externalACLs.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/externalACLs.conf new file mode 100644 index 0000000000..5db85f5320 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/externalACLs.conf @@ -0,0 +1,16 @@ +# +# Automatic generated configuration for fetching remote ACLs. +# Do not edit this file manually. +{% if helpers.exists('OPNsense.proxy.forward.acl.remoteACLs.blacklists') %} +{% for blacklist in helpers.toList('OPNsense.proxy.forward.acl.remoteACLs.blacklists.blacklist') %} +[{{blacklist.filename}}] +url:{{blacklist.url}} +enabled:{{blacklist.enabled}} +filter:{{blacklist.filter|default('')}} +{% if blacklist.username|default('') != '' %} +username={{blacklist.username}} +password={{blacklist.password|default('')}} +{% endif %} +sslNoVerify={{blacklist.sslNoVerify|default('0')}} +{% endfor %} +{% endif %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/newsyslog.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/newsyslog.conf new file mode 100644 index 0000000000..db392ab305 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/newsyslog.conf @@ -0,0 +1,6 @@ +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +{% if helpers.exists('OPNsense.proxy.general.enabled') and OPNsense.proxy.general.enabled|default("0") == "1" %} +/var/log/squid/access.log squid:squid 644 14 * @T00 ZB /var/run/squid/squid.pid 30 +/var/log/squid/cache.log squid:squid 644 2 * @T00 ZB /var/run/squid/squid.pid 30 +/var/log/squid/store.log squid:squid 644 2 * @T00 ZB /var/run/squid/squid.pid 30 +{% endif %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/nobumpsites.acl b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/nobumpsites.acl new file mode 100644 index 0000000000..0bf00cd387 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/nobumpsites.acl @@ -0,0 +1,5 @@ +{% if helpers.exists('OPNsense.proxy.forward.sslnobumpsites') and OPNsense.proxy.forward.sslnobumpsites != '' %} +{% for line in OPNsense.proxy.forward.sslnobumpsites.split(',') %} +{{ line }} +{% endfor %} +{% endif %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/parentproxy.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/parentproxy.conf new file mode 100644 index 0000000000..1dafefa75f --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/parentproxy.conf @@ -0,0 +1,24 @@ +{% if helpers.exists('OPNsense.proxy.general.parentproxy.enabled') and OPNsense.proxy.general.parentproxy.enabled == '1' %} +cache_peer {{ OPNsense.proxy.general.parentproxy.host }} parent {{ OPNsense.proxy.general.parentproxy.port }} 0 no-query default {% if helpers.exists('OPNsense.proxy.general.parentproxy.enableauth') and OPNsense.proxy.general.parentproxy.enableauth == '1' %} login={{ OPNsense.proxy.general.parentproxy.user }}:{{ OPNsense.proxy.general.parentproxy.password }}{% endif %} + +{% if helpers.exists('OPNsense.proxy.general.parentproxy.localdomains') and OPNsense.proxy.general.parentproxy.localdomains != '' %} +acl ExcludePPDomains dstdomain {{ OPNsense.proxy.general.parentproxy.localdomains.replace(',', ' ') }} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.parentproxy.localips') and OPNsense.proxy.general.parentproxy.localips != '' %} +acl ExcludePPIPs dst {{ OPNsense.proxy.general.parentproxy.localips.replace(',', ' ') }} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.parentproxy.localdomains') and OPNsense.proxy.general.parentproxy.localdomains != '' %} +cache_peer_access {{ OPNsense.proxy.general.parentproxy.host }} deny ExcludePPDomains +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.parentproxy.localips') and OPNsense.proxy.general.parentproxy.localips != '' %} +cache_peer_access {{ OPNsense.proxy.general.parentproxy.host }} deny ExcludePPIPs +{% endif %} +cache_peer_access {{ OPNsense.proxy.general.parentproxy.host }} allow all +{% if helpers.exists('OPNsense.proxy.general.parentproxy.localdomains') and OPNsense.proxy.general.parentproxy.localdomains != '' %} +never_direct deny ExcludePPDomains +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.parentproxy.localips') and OPNsense.proxy.general.parentproxy.localips != '' %} +never_direct deny ExcludePPIPs +{% endif %} +never_direct allow all +{% endif %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/post-auth.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/post-auth.conf new file mode 100644 index 0000000000..5b91051e90 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/post-auth.conf @@ -0,0 +1,3 @@ +# AUTOGENERATED FILE. DO NOT EDIT. +# DO NOT REMOVE THIS FILE! +# This directory is for post-auth config files diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/pre-auth.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/pre-auth.conf new file mode 100644 index 0000000000..6a0794e4fc --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/pre-auth.conf @@ -0,0 +1,3 @@ +# AUTOGENERATED FILE. DO NOT EDIT. +# DO NOT REMOVE THIS FILE! +# This directory is for pre-auth config files diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/rc.conf.d b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/rc.conf.d new file mode 100644 index 0000000000..2a1dc037fd --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/rc.conf.d @@ -0,0 +1,6 @@ +{% if helpers.exists('OPNsense.proxy.general.enabled') and OPNsense.proxy.general.enabled|default("0") == "1" %} +squid_setup="/usr/local/opnsense/scripts/proxy/setup.sh" +squid_enable="YES" +{% else %} +squid_enable="NO" +{% endif %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/snmp.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/snmp.conf new file mode 100644 index 0000000000..610e23ca37 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/snmp.conf @@ -0,0 +1,5 @@ +{% if helpers.exists('OPNsense.proxy.forward.snmp_enable') and OPNsense.proxy.forward.snmp_enable == '1' %} +snmp_port {{ OPNsense.proxy.forward.snmp_port }} +acl snmppublic snmp_community {{ OPNsense.proxy.forward.snmp_password }} +snmp_access allow snmppublic +{% endif %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.acl.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.acl.conf new file mode 100644 index 0000000000..b9e1f87873 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.acl.conf @@ -0,0 +1,248 @@ + +{% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %} + +# ALLOW UNRESTRICTED +# ACL list (Allow) unrestricted +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod allow unrestricted +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod allow unrestricted +{% endif %} +{% endif %} +http_access allow unrestricted +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.acl.whiteList') %} + +# ACL list (Allow) whitelist +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod allow whiteList +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod allow whiteList +{% endif %} +{% endif %} +http_access allow whiteList +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.acl.blackList') %} + +# +# ACL list (Deny) blacklist +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny blackList +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny blackList +{% endif %} +{% endif %} +http_access deny blackList +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.acl.remoteACLs.blacklists') %} +{% for blacklist in helpers.toList('OPNsense.proxy.forward.acl.remoteACLs.blacklists.blacklist') if blacklist.enabled=='1' %} +# ACL list (Deny) remoteblacklist_{{blacklist.filename}} +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny remoteblacklist_{{blacklist.filename}} +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny remoteblacklist_{{blacklist.filename}} +{% endif %} +{% endif %} +http_access deny remoteblacklist_{{blacklist.filename}} +{% endfor %} +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.acl.browser') %} + +# ACL list (Deny) blockuseragent +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny blockuseragents +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny blockuseragents +{% endif %} +{% endif %} +http_access deny blockuseragents +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.acl.mimeType') %} + +# ACL list (Deny) blockmimetypes +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny blockmimetypes {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted {% endif %} +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny blockmimetypes {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted {% endif %} +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny blockmimetypes_requests {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted {% endif %} +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny blockmimetypes_requests {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted {% endif %} +{% endif %} + +{% endif %} +http_reply_access deny blockmimetypes {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted {% endif %} + +http_access deny blockmimetypes_requests {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted {% endif %} + +{% endif %} + +# Google Suite Filter +{% if not helpers.empty('OPNsense.proxy.forward.acl.googleapps') %} +request_header_add X-GoogApps-Allowed-Domains {{OPNsense.proxy.forward.acl.googleapps}} +{% endif %} + +# YouTube Filter +{% if helpers.exists('OPNsense.proxy.forward.acl.youtube') and OPNsense.proxy.forward.acl.youtube|default('') != '' %} +request_header_add YouTube-Restrict {{OPNsense.proxy.forward.acl.youtube}} +{% endif %} + +# Deny requests to certain unsafe ports +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny !Safe_ports {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted{% endif %} +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny !Safe_ports {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted{% endif %} +{% endif %} +{% endif %} + +http_access deny !Safe_ports {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted{% endif %} + +# Deny CONNECT to other than secure SSL ports +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny CONNECT !SSL_ports {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted{% endif %} +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny CONNECT !SSL_ports {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted{% endif %} +{% endif %} +{% endif %} + +http_access deny CONNECT !SSL_ports {% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %}!unrestricted{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.acl.bannedHosts') %} +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny bannedHosts +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny bannedHosts +{% endif %} +{% endif %} +http_access deny bannedHosts +{% endif %} + +# Only allow cachemgr access from localhost +http_access allow localhost manager +http_access deny manager + +# We strongly recommend the following be uncommented to protect innocent +# web applications running on the proxy server who think the only +# one who can access services on "localhost" is a local user +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny to_localhost +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny to_localhost +{% endif %} +{% endif %} +http_access deny to_localhost + +{% if helpers.exists('OPNsense.proxy.forward.icap.exclude') %} +# ACL - Whitelist - User defined (whiteList) +{% for element in OPNsense.proxy.forward.icap.exclude.split(",") %} +{% if '^' in element or '\\' in element or '$' in element or '[' in element %} +acl exclude_icap url_regex {{element|encode_idna}} +{% else %} +acl exclude_icap url_regex {{element|encode_idna|replace(".","\.")}} +{% endif %} +{% endfor %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny exclude_icap +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny exclude_icap +{% endif %} +{% endif %} + +# Auth plugins +include /usr/local/etc/squid/auth/*.conf + +# +# Access Permission configuration: +# +# Deny request from unauthorized clients +{% if helpers.exists('OPNsense.proxy.forward.authentication.method') and OPNsense.proxy.forward.authentication.method != '' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod allow local_auth +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod allow local_auth +{% endif %} +{% endif %} +http_access allow local_auth +{% endif %} + +# +# ACL - localnet - default these include ranges from selected interfaces (Allow local subnets) +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod allow localnet +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod allow localnet +{% endif %} +{% endif %} +http_access allow localnet + +# ACL - localhost +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod allow localhost +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod allow localhost +{% endif %} +{% endif %} +http_access allow localhost +{% if helpers.exists('OPNsense.proxy.forward.acl.allowedSubnets') %} + +# ACL list (Allow) subnets +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod allow subnets +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod allow subnets +{% endif %} +{% endif %} +http_access allow subnets +{% endif %} + +# Deny all other access to this proxy +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny all +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny all +{% endif %} +{% endif %} +http_access deny all diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.conf new file mode 100644 index 0000000000..4b334cd3f0 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.conf @@ -0,0 +1,487 @@ +# +# Automatic generated configuration for Squid. +# Do not edit this file manually. +# + +{# wrap listener configuration for reuse #} +{% macro listener_config(network, port='3129', tags='', protocol='') -%} +{% if protocol == 'ssl' %} +{% set listener_type = 'https_port' %} +{% else %} +{% set listener_type = 'http_port' %} +{% endif %} +{% set sslparams = '' %} +{% if helpers.exists('OPNsense.proxy.forward.sslbump') and OPNsense.proxy.forward.sslbump == '1' %} +{% set sslparams = 'ssl-bump cert=/var/squid/ssl/ca.pem dynamic_cert_mem_cache_size=10MB generate-host-certificates=on' %} +{% endif %} +{{listener_type}} {{network}}:{{port}} {{tags}} {{sslparams}} +{%- endmacro %} + +{% if helpers.exists('OPNsense.proxy.forward.transparentMode') and OPNsense.proxy.forward.transparentMode == '1' %} +# Setup transparent mode listeners on loopback interfaces +{{ listener_config('127.0.0.1', OPNsense.proxy.forward.port, 'intercept') }} +{{ listener_config('[::1]', OPNsense.proxy.forward.port, 'intercept') }} +{% if helpers.exists('OPNsense.proxy.forward.sslbump') and OPNsense.proxy.forward.sslbump == '1' %} +{{ listener_config('127.0.0.1', OPNsense.proxy.forward.sslbumpport, 'intercept', 'ssl') }} +{{ listener_config('[::1]', OPNsense.proxy.forward.sslbumpport, 'intercept', 'ssl') }} +{% endif %} +{% endif %} + +# Setup regular listeners configuration +{% if helpers.exists('OPNsense.proxy.forward.interfaces') %} +{% for interface in OPNsense.proxy.forward.interfaces.split(",") %} +{% for intf_key,intf_item in interfaces.items() %} +{% if intf_key == interface and intf_item.ipaddr and intf_item.ipaddr != 'dhcp' %} +{{ listener_config(intf_item.ipaddr, OPNsense.proxy.forward.port) }} +{% endif %} +{% if intf_key == interface and intf_item.ipaddrv6 and intf_item.ipaddrv6.find(':') > -1 %} +{{ listener_config('['+intf_item.ipaddrv6+']', OPNsense.proxy.forward.port) }} +{% endif %} +{% endfor %} +{# virtual ip's #} +{% if helpers.exists('virtualip') %} +{% for intf_item in helpers.toList('virtualip.vip') %} +{% if intf_item.interface == interface and intf_item.mode in ['carp', 'ipalias'] %} +{% if intf_item.subnet.find(':') > -1 %} +{{ listener_config('['+intf_item.subnet+']', OPNsense.proxy.forward.port) }} +{% else %} +{{ listener_config(intf_item.subnet, OPNsense.proxy.forward.port) }} +{% endif %} +{% endif %} +{% endfor %} +{% endif %} +{% endfor %} +{% endif %} + +{% if helpers.exists('OPNsense.proxy.forward.sslbump') and OPNsense.proxy.forward.sslbump == '1' %} +# setup ssl re-cert +sslcrtd_program /usr/local/libexec/squid/security_file_certgen -s /var/squid/ssl_crtd -M {{ OPNsense.proxy.forward.ssl_crtd_storage_max_size|default('4') }}MB +sslcrtd_children {{ OPNsense.proxy.forward.sslcrtd_children|default('5') }} + +tls_outgoing_options options=NO_TLSv1 cipher=HIGH:MEDIUM:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS + +# setup ssl bump acl's +acl bump_step1 at_step SslBump1 +acl bump_step2 at_step SslBump2 +acl bump_step3 at_step SslBump3 +acl bump_nobumpsites ssl::server_name "/usr/local/etc/squid/nobumpsites.acl" + +# configure bump +{% if helpers.exists('OPNsense.proxy.forward.sslurlonly') and OPNsense.proxy.forward.sslurlonly == '1' %} +ssl_bump peek bump_step1 all +ssl_bump splice all +ssl_bump peek bump_step2 all +ssl_bump splice bump_step3 all +ssl_bump bump + +{% else %} +ssl_bump peek bump_step1 all +ssl_bump peek bump_step2 bump_nobumpsites +ssl_bump splice bump_step3 bump_nobumpsites +ssl_bump stare bump_step2 +ssl_bump bump bump_step3 +{% endif %} + +sslproxy_cert_error deny all +{% endif %} + +acl ftp proto FTP +http_access allow ftp + +{% if helpers.exists('OPNsense.proxy.forward.ftpTransparentMode') and OPNsense.proxy.forward.ftpTransparentMode == '1' %} +# transparent mode, listen on localhost +ftp_port 127.0.0.1:{{ OPNsense.proxy.forward.ftpPort }} intercept +ftp_port [::1]:{{ OPNsense.proxy.forward.ftpPort }} intercept +{% endif %} + +# Setup ftp proxy +{% if helpers.exists('OPNsense.proxy.forward.ftpInterfaces') %} +{% for interface in OPNsense.proxy.forward.ftpInterfaces.split(",") %} +{% for intf_key,intf_item in interfaces.items() %} +{% if intf_key == interface and intf_item.ipaddr and intf_item.ipaddr != 'dhcp' %} +ftp_port {{intf_item.ipaddr}}:{{ OPNsense.proxy.forward.ftpPort }} accel ftp-track-dirs protocol=HTTP +{% endif %} +{% endfor %} +{# virtual ip's #} +{% if helpers.exists('virtualip') %} +{% for intf_key,intf_item in virtualip.items() %} +{% if intf_item.interface == interface and intf_item.mode == 'ipalias' %} +ftp_port {{intf_item.subnet}}:{{ OPNsense.proxy.forward.ftpPort }} accel ftp-track-dirs protocol=HTTP +{% endif %} +{% endfor %} +{% endif %} +{% endfor %} +{% endif %} + +# Rules allowing access from your local networks. +# Generated list of (internal) IP networks from where browsing +# should be allowed. (Allow interface subnets). +{% if helpers.exists('OPNsense.proxy.forward.interfaces') %} +{% if helpers.exists('OPNsense.proxy.forward.addACLforInterfaceSubnets') %} +{% if OPNsense.proxy.forward.addACLforInterfaceSubnets == '1' %} +{% for interface in OPNsense.proxy.forward.interfaces.split(",") %} +{% for intf_key,intf_item in interfaces.items() %} +{% if intf_key == interface and intf_item.ipaddr and intf_item.ipaddr != 'dhcp' %} +acl localnet src {{ helpers.getIPNetwork(intf_item.ipaddr+'/'+intf_item.subnet)[0].format() }}/{{intf_item.subnet}} # Possible internal network (interfaces v4) +{% endif %} +{% if intf_key == interface and intf_item.ipaddrv6 and intf_item.ipaddrv6.find(':') > -1 %} +acl localnet src {{helpers.getIPNetwork(intf_item.ipaddrv6+'/'+intf_item.subnetv6)[0].format()}}/{{intf_item.subnetv6}} # Possible internal network (interfaces v6) +{% endif %} +{% endfor %} +{% if helpers.exists('virtualip.vip') %} +{% for intf_item in helpers.toList('virtualip.vip') %} +{% if intf_item.interface == interface and intf_item.mode == 'ipalias' %} +acl localnet src {{intf_item.subnet}}/{{intf_item.subnet_bits}} # Possible internal network (aliases) +{% endif %} +{% endfor %} +{% endif %} +{% endfor %} +{% endif %} +{% endif %} +{% endif %} +# Default allow for local-link and private networks +acl localnet src fc00::/7 # RFC 4193 local private network range +acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines + +# ACL - Allow localhost for PURGE cache if enabled +{% if helpers.exists('OPNsense.proxy.general.cache.local') and OPNsense.proxy.general.cache.local.enabled == '1' %} +acl PURGE method PURGE +http_access allow localhost PURGE +http_access deny PURGE +{% endif %} + +# ACL lists +{% if helpers.exists('OPNsense.proxy.forward.acl.allowedSubnets') %} + +# ACL - Allow Subnets - User defined (subnets) +{% for network in OPNsense.proxy.forward.acl.allowedSubnets.split(",") %} +acl subnets src {{network}} +{% endfor %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.acl.unrestricted') %} + +# ACL - Unrestricted IPs - User defined (unrestricted) +{% for ip in OPNsense.proxy.forward.acl.unrestricted.split(",") %} +acl unrestricted src {{ip}} +{% endfor %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.acl.bannedHosts') %} + +# ACL - Banned Hosts - User defined (bannedHosts) +{% for ip in OPNsense.proxy.forward.acl.bannedHosts.split(",") %} +acl bannedHosts src {{ip}} +{% endfor %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.acl.whiteList') %} +# ACL - Whitelist - User defined (whiteList) +{% for element in OPNsense.proxy.forward.acl.whiteList.split(",") %} +{% if '^' in element or '\\' in element or '$' in element or '[' in element %} +acl whiteList url_regex {{element|encode_idna}} +{% else %} +acl whiteList url_regex {{element|encode_idna|replace(".","\.")}} +{% endif %} +{% endfor %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.acl.blackList') %} + +# ACL - Blacklist - User defined (blackList) +{% for element in OPNsense.proxy.forward.acl.blackList.split(",") %} +{% if '^' in element or '\\' in element or '$' in element or '[' in element %} +acl blackList url_regex {{element|encode_idna}} +{% else %} +acl blackList url_regex {{element|encode_idna|replace(".","\.")}} +{% endif %} +{% endfor %} +{% endif %} + +# ACL - Remote fetched Blacklist (remoteblacklist) +{% if helpers.exists('OPNsense.proxy.forward.acl.remoteACLs.blacklists') %} +{% for blacklist in helpers.toList('OPNsense.proxy.forward.acl.remoteACLs.blacklists.blacklist') %} +{% if blacklist.enabled=='1' %} +acl remoteblacklist_{{blacklist.filename}} dstdomain "/usr/local/etc/squid/acl/{{blacklist.filename}}" +{% endif %} +{% endfor %} +{% endif %} + +# ACL - Block browser/user-agent - User defined (browser) +{% if helpers.exists('OPNsense.proxy.forward.acl.browser') %} +{% for element in OPNsense.proxy.forward.acl.browser.split(",") %} +acl blockuseragents browser {{element}} +{% endfor %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.acl.mimeType') %} + +# ACL - Block MIME types - User defined (mimetype) +{% for element in OPNsense.proxy.forward.acl.mimeType.split(",") %} +acl blockmimetypes rep_mime_type {{element}} +acl blockmimetypes_requests req_mime_type {{element}} +{% endfor %} +{% endif %} + +# ACL - SSL ports, default are configured in config.xml +# Configured SSL ports (if defaults are not listed, then they have been removed from the configuration!): +{% if helpers.exists('OPNsense.proxy.forward.acl.sslPorts') %} +{% for element in OPNsense.proxy.forward.acl.sslPorts.split(",") %} +acl SSL_ports port {{element.split(":")[0]}} # {{element.split(":")[1]|default('unknown')}} +{% endfor %} +{% endif %} + +# Default Safe ports are now defined in config.xml +# Configured Safe ports (if defaults are not listed, then they have been removed from the configuration!): +{% if helpers.exists('OPNsense.proxy.forward.acl.safePorts') %} +# ACL - Safe_ports +{% for element in OPNsense.proxy.forward.acl.safePorts.split(",") %} +acl Safe_ports port {{element.split(":")[0]}} # {{element.split(":")[1]|default('unknown')}} +{% endfor %} +{% endif %} +acl CONNECT method CONNECT + +# ICAP SETTINGS +{% if helpers.exists('OPNsense.proxy.forward.icap.enable') and OPNsense.proxy.forward.icap.enable == '1' %} +# enable icap +icap_enable on +{% if helpers.exists('OPNsense.proxy.forward.icap.OptionsTTL') %} +icap_default_options_ttl {{OPNsense.proxy.forward.icap.OptionsTTL}} +{% endif %} + +# send user information to the icap server +{% if helpers.exists('OPNsense.proxy.forward.icap.SendClientIP') and OPNsense.proxy.forward.icap.SendClientIP == '1' %} +adaptation_send_client_ip on +{% else %} +adaptation_send_client_ip off +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.SendUsername') and OPNsense.proxy.forward.icap.SendUsername == '1' %} +adaptation_send_username on +{% else %} +adaptation_send_username off +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.EncodeUsername') and OPNsense.proxy.forward.icap.EncodeUsername == '1' %} +icap_client_username_encode on +{% else %} +icap_client_username_encode off +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.UsernameHeader') and OPNsense.proxy.forward.icap.UsernameHeader != '' %} +icap_client_username_header {{OPNsense.proxy.forward.icap.UsernameHeader}} +{% endif %} + +# preview +{% if helpers.exists('OPNsense.proxy.forward.icap.EnablePreview') and OPNsense.proxy.forward.icap.EnablePreview == '1' %} +icap_preview_enable on +{% else %} +icap_preview_enable off +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.PreviewSize') %} +icap_preview_size {{OPNsense.proxy.forward.icap.PreviewSize}} +{% endif %} + +# add the servers +{% if helpers.exists('OPNsense.proxy.forward.icap.ResponseURL') %} +icap_service response_mod respmod_precache {{OPNsense.proxy.forward.icap.ResponseURL}} +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.icap.RequestURL') %} +icap_service request_mod reqmod_precache {{OPNsense.proxy.forward.icap.RequestURL}} +{% endif %} + +{% else %} +# disable icap +icap_enable off +{% endif %} + +# Pre-auth plugins +include /usr/local/etc/squid/pre-auth/*.conf + +# Authentication Settings +{% if helpers.exists('OPNsense.proxy.forward.authentication.method') and OPNsense.proxy.forward.authentication.method != '' %} +{% include ['OPNsense/Proxy/squid.user.alt_auth.conf', 'OPNsense/Proxy/squid.user.local_auth.conf'] %} +{% endif %} + +{% include "OPNsense/Proxy/squid.acl.conf" ignore missing with context %} + +# Post-auth plugins +include /usr/local/etc/squid/post-auth/*.conf + +# Caching settings +{% if helpers.exists('OPNsense.proxy.general.cache.local') %} +{% if OPNsense.proxy.general.cache.local.cache_mem|default('256')|int == 0 and OPNsense.proxy.general.cache.local.enabled == '0' %} +cache deny all +cache_mem 0 +{% else %} +cache_mem {{ OPNsense.proxy.general.cache.local.cache_mem|default('256') }} MB +{% if OPNsense.proxy.general.cache.local.maximum_object_size|default('') != '' %} +maximum_object_size {{OPNsense.proxy.general.cache.local.maximum_object_size}} MB +{% if OPNsense.proxy.general.cache.local.maximum_object_size|int > 4 %} +cache_replacement_policy heap LFUDA +{% endif %} +{% endif %} +{% if OPNsense.proxy.general.cache.local.maximum_object_size_in_memory|default('') != '' %} +maximum_object_size_in_memory {{OPNsense.proxy.general.cache.local.maximum_object_size_in_memory}} KB +{% endif %} +{% if OPNsense.proxy.general.cache.local.memory_cache_mode|default('always') != 'always' %} +memory_cache_mode {{OPNsense.proxy.general.cache.local.memory_cache_mode}} +{% endif %} +{% if OPNsense.proxy.general.cache.local.enabled == '1' %} +cache_dir ufs {{OPNsense.proxy.general.cache.local.directory}} {{OPNsense.proxy.general.cache.local.size}} {{OPNsense.proxy.general.cache.local.l1}} {{OPNsense.proxy.general.cache.local.l2}} +{% endif %} +{% endif %} +{% endif %} + +# Leave coredumps in the first cache dir +coredump_dir /var/squid/cache + +# +# Add any of your own refresh_pattern entries above these. +# + +{% if helpers.exists('OPNsense.proxy.general.cache.local.cache_linux_packages') and OPNsense.proxy.general.cache.local.cache_linux_packages == '1' %} +# Linux package cache: +refresh_pattern pkg\.tar\.zst$ 0 20% 4320 refresh-ims +refresh_pattern d?rpm$ 0 20% 4320 refresh-ims +refresh_pattern deb$ 0 20% 4320 refresh-ims +refresh_pattern udeb$ 0 20% 4320 refresh-ims +refresh_pattern Packages\.bz2$ 0 20% 4320 refresh-ims +refresh_pattern Sources\.bz2$ 0 20% 4320 refresh-ims +refresh_pattern Release\.gpg$ 0 20% 4320 refresh-ims +refresh_pattern Release$ 0 20% 4320 refresh-ims +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.cache.local.cache_windows_updates') and OPNsense.proxy.general.cache.local.cache_windows_updates == '1' %} +# http://wiki.squid-cache.org/SquidFaq/WindowsUpdate +refresh_pattern -i microsoft.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip|esd) 4320 80% 129600 reload-into-ims +refresh_pattern -i windowsupdate.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip|esd) 4320 80% 129600 reload-into-ims +refresh_pattern -i windows.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip|esd) 4320 80% 129600 reload-into-ims +{% endif %} + +refresh_pattern ^ftp: 1440 20% 10080 +refresh_pattern ^gopher: 1440 0% 1440 +refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 +refresh_pattern . 0 20% 4320 + +# Squid Options +{% if helpers.empty('OPNsense.proxy.general.enablePinger') %} +pinger_enable off +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.logging.enable.accessLog') %} +{% if OPNsense.proxy.general.logging.enable.accessLog == '0' %} +# Disable access logging +access_log none +{% else %} +{% if OPNsense.proxy.general.logging.ignoreLogACL|default('') != '' %} +# ignore source hosts from access.log +acl accesslog_ignore src {{ OPNsense.proxy.general.logging.ignoreLogACL.replace(',', ' ') }} +{% endif %} +{% if OPNsense.proxy.general.logging.target|default('') == 'syslog' %} +access_log syslog:local4.info {% if not helpers.empty('OPNsense.proxy.general.logging.ignoreLogACL') %}!accesslog_ignore {% endif %} +{% elif OPNsense.proxy.general.logging.target|default('') == 'file_extendend' %} +logformat opnsense %>a %[ui %>eui %[un [%tl] "%rm %ru HTTP/%rv" %>Hs %h" "%{User-Agent}>h" %Ss:%Sh +access_log stdio:/var/log/squid/access.log opnsense {% if not helpers.empty('OPNsense.proxy.general.logging.ignoreLogACL') %}!accesslog_ignore {% endif %} +{% elif OPNsense.proxy.general.logging.target|default('') in ('file_json', 'syslog_json') %} +logformat opnsense {% raw %} {"@timestamp":"%{%Y-%m-%dT%H:%M:%S%z}tg","ecs":{"version":"1.0.0"},"event":{"id":"%{X-Request-Event-Id}>ha","dataset":"squid.access","duration":"%tr"},"http":{"version":"%rv","request":{"method":"%rm","referrer":"%{Referer}>h"},"response":{"bytes": %Hs}}},"host":{"hostname":"%>A"},"service":{"name":"proxy","type":"squid"},"source":{"ip":"%>a"},"url":{"original":"%ru"},"user":{"name":"%un"},"user_agent":{"original":"%{User-Agent}>h"},"labels":{"request_status":"%Ss","hierarchy_status":"%Sh"},"message":"%rm %ru HTTP/%rv"} {% endraw %} + +{% if OPNsense.proxy.general.logging.target == 'file_json'%} +access_log stdio:/var/log/squid/access.log opnsense {% if not helpers.empty('OPNsense.proxy.general.logging.ignoreLogACL') %}!accesslog_ignore {% endif %} +{% else %} +access_log syslog:local4.info opnsense {% if not helpers.empty('OPNsense.proxy.general.logging.ignoreLogACL') %}!accesslog_ignore {% endif %} +{% endif %} +{% else %} +access_log stdio:/var/log/squid/access.log squid {% if not helpers.empty('OPNsense.proxy.general.logging.ignoreLogACL') %}!accesslog_ignore {% endif %} +{% endif %} +{% endif %} +{% endif %} + +{% if helpers.exists('OPNsense.proxy.general.logging.enable.storeLog') %} +{% if OPNsense.proxy.general.logging.enable.storeLog == '0' %} +# Disable cache store log +cache_store_log none +{% else %} +cache_store_log stdio:/var/log/squid/store.log +{% endif %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.alternateDNSservers' ) %} +{% for dns in OPNsense.proxy.general.alternateDNSservers.split(",") %} +dns_nameservers {{dns}} +{% endfor %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.useViaHeader') %} +{% if OPNsense.proxy.general.useViaHeader == '0' %} +# Disable via Header +via off +{% endif %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.suppressVersion') %} +{% if OPNsense.proxy.general.suppressVersion == '1' %} +# Suppress http version string (default=off) +httpd_suppress_version_string on +{% endif %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.icpPort') %} +{% if OPNsense.proxy.general.icpPort != '' %} +icp_port {{OPNsense.proxy.general.icpPort}} +{% endif %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.uriWhitespaceHandling') %} +# URI handling with Whitespaces (default=strip) +uri_whitespace {{OPNsense.proxy.general.uriWhitespaceHandling}} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.forwardedForHandling') %} +# X-Forwarded header handling (default=on) +forwarded_for {{OPNsense.proxy.general.forwardedForHandling}} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.traffic.enabled') and OPNsense.proxy.general.traffic.enabled == '1' %} +{% if helpers.exists('OPNsense.proxy.general.traffic.maxDownloadSize') %} +# Define max download size +reply_body_max_size {{OPNsense.proxy.general.traffic.maxDownloadSize}} KB +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.traffic.maxUploadSize') %} +# Define max upload size +request_body_max_size {{OPNsense.proxy.general.traffic.maxUploadSize}} KB +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.traffic.perHostTrotteling') %} +delay_pools 1 +delay_class 1 3 +delay_access 1 allow all +{% if helpers.exists('OPNsense.proxy.general.traffic.OverallBandwidthTrotteling') %} +# Define PerHost and Overall Bandwidth Trotteling +delay_parameters 1 {{OPNsense.proxy.general.traffic.OverallBandwidthTrotteling|int // 8 * 1000}}/{{OPNsense.proxy.general.traffic.OverallBandwidthTrotteling|int // 8 * 1000}} -1/-1 {{OPNsense.proxy.general.traffic.perHostTrotteling|int // 8 * 1000}}/{{OPNsense.proxy.general.traffic.OverallBandwidthTrotteling|int // 8 * 1000}} +{% else %} +# Define PerHost Trotteling +delay_parameters -1/-1 {{OPNsense.proxy.general.traffic.perHostTrotteling|int // 8 * 1000}}/{{OPNsense.proxy.general.traffic.perHostTrotteling|int // 8 * 1000}} +{% endif %} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.traffic.OverallBandwidthTrotteling') and not helpers.exists('OPNsense.proxy.general.traffic.perHostTrotteling') %} +# Define Overall Bandwidth Trotteling +delay_pools 1 +delay_class 1 1 +delay_access 1 allow all +delay_parameters 1 {{OPNsense.proxy.general.traffic.OverallBandwidthTrotteling|int // 8 * 1000}}/{{OPNsense.proxy.general.traffic.OverallBandwidthTrotteling|int // 8 * 1000}} +{% endif %} +{% endif %} +# Disable squid logfile rotate to use system defaults +logfile_rotate 0 +{% if helpers.exists('OPNsense.proxy.general.VisibleHostname') %} +# Define visible hostname +visible_hostname {{OPNsense.proxy.general.VisibleHostname}} +{% endif %} +{% if helpers.exists('OPNsense.proxy.general.VisibleEmail') %} +# Define visible email +cache_mgr {{OPNsense.proxy.general.VisibleEmail}} +{% endif %} +{% if not helpers.empty('OPNsense.proxy.general.connecttimeout') %} +# Set connection timeout +connect_timeout {{OPNsense.proxy.general.connecttimeout}} seconds +{% endif %} + +# Set error directory language +{% set lang = namespace(dirs = [], done = false) %} +{% if not helpers.empty('OPNsense.proxy.general.error_pages') %} +{% do lang.dirs.append('/usr/local/etc/squid/errors/local') %} +{% elif helpers.exists('system.language') and system.language != "" %} +{% set langdir = system.language|lower|replace('_', '-') %} +{% do lang.dirs.append('/usr/local/share/squid-langpack/' + langdir) %} +{% do lang.dirs.append('/usr/local/share/squid-langpack/' + langdir[:2]) %} +{% endif %} +{% do lang.dirs.append('/usr/local/share/squid-langpack/en') %} +{% for langdir in lang.dirs %} +{% if not lang.done and helpers.file_exists(langdir) %} +{% set lang.done = true %} +error_directory {{ langdir }} +{% endif %} +{% endfor %} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.pam b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.pam new file mode 100644 index 0000000000..eee0a90568 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.pam @@ -0,0 +1,5 @@ +# auth +auth sufficient pam_opnsense.so + +# account +account sufficient pam_opnsense.so diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.user.local_auth.conf b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.user.local_auth.conf new file mode 100644 index 0000000000..7cd8e8c5ab --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/squid.user.local_auth.conf @@ -0,0 +1,13 @@ +# Configure Local User Authentication helper +auth_param basic program /usr/local/libexec/squid/basic_pam_auth -o +{% if helpers.exists('OPNsense.proxy.forward.authentication.realm') %} +auth_param basic realm {{OPNsense.proxy.forward.authentication.realm}} +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.authentication.credentialsttl') %} +auth_param basic credentialsttl {{OPNsense.proxy.forward.authentication.credentialsttl}} hours +{% endif %} +{% if helpers.exists('OPNsense.proxy.forward.authentication.children') %} +auth_param basic children {{OPNsense.proxy.forward.authentication.children}} +{% endif %} +# ACL - Local Authorized Users - local_auth +acl local_auth proxy_auth REQUIRED diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Proxy/wpad.dat b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/wpad.dat new file mode 100644 index 0000000000..cd4aeaabc1 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Proxy/wpad.dat @@ -0,0 +1,104 @@ +/* + PAC file created via OPNsense + To use this file you have to enter its URL into your browsers network settings. +*/ +function FindProxyForURL(url, host) { +{% if helpers.exists('OPNsense.proxy.pac.rule') %} +{# define only if needed as because of performance issues #} +{% set data = {'dl' : '', 'dstip' : '', 'is_resolvable' : '' } %} +{% set dstip = '' %} +{% set is_resolvable = '' %} +{% for match in helpers.toList('OPNsense.proxy.pac.match') %} +{% if match.match_type == 'dns_domain_levels' %} +{% do data.update({ 'dl': 'var dl = dnsDomainLevels(host);'}) %} +{% endif %} +{% if match.match_type == 'dns_domain_levels' or match.match_type == 'destination_in_net' %} +{% do data.update({ 'dstip': 'var dstip = dnsResolve(host);'}) %} +{% endif %} +{% if match.match_type == 'is_resolvable' %} +{% do data.update({ 'is_resolvable': 'var is_resolvable = isResolvable(host);'}) %} +{% endif %} +{% endfor %} +{{ data.values()|join("\n") }} + +{% if helpers.exists('OPNsense.proxy.pac.rule') %} +{% for rule in helpers.toList('OPNsense.proxy.pac.rule') %} +{% if not rule.enabled == '1' %} +{% continue %} +{% endif %} +{% set expression = [] %} +{# Join type is used to join the checks of the if statement #} +{% set join_type = ' && ' %} +{% if rule.join_type == 'or' %} +{% set join_type = ' || ' %} +{% endif %} +{% for match_uuid in rule.matches.split(',') %} +{% set match = helpers.getUUID(match_uuid) %} +{# be sure it has not been deleted yet #} +{% if match != None %} +{% set match_script = '(' %} +{% if match.negate == '1' %} +{% set match_script = match_script + '!' %} +{% endif %} +{% if match.match_type == 'url_matches' %} +{% set match_script = match_script + 'shExpMatch(url, "' + match.url + '")' %} +{% endif %} +{% if match.match_type == 'hostname_matches' %} +{% set match_script = match_script + 'shExpMatch(host, "' + match.hostname + '")' %} +{% endif %} +{% if match.match_type == 'dns_domain_is' %} +{% set match_script = match_script + 'dnsDomainIs(host, "' + match.hostname + '")' %} +{% endif %} +{% if match.match_type == 'destination_in_net' %} +{% set tmp_net = helpers.getIPNetwork(match.network) %} +{% set match_script = match_script + 'isInNet(dstip, "' + tmp_net.network.__str__() + '", "' + tmp_net.netmask.__str__() + '")' %} +{% endif %} +{% if match.match_type == 'my_ip_in_net' %} +{% set tmp_net = helpers.getIPNetwork(match.network) %} +{% set match_script = match_script + 'isInNet(myIpAddress(), "' + tmp_net.network.__str__() + '", "' + tmp_net.netmask.__str__() + '")' %} +{% endif %} +{% if match.match_type == 'plain_hostname' %} +{% set match_script = match_script + 'isPlainHostName(host)' %} +{% endif %} +{% if match.match_type == 'is_resolvable' %} +{% set match_script = match_script + 'is_resolvable' %} +{% endif %} +{% if match.match_type == 'dns_domain_levels' %} +{% set match_script = match_script + '(' + match.domain_level_from + ' <= dl) && (' + match.domain_level_to + ' >= dl)' %} +{% endif %} +{% if match.match_type == 'weekday_range' %} +{% set match_script = match_script + 'weekdayRange("' + match.weekday_from + '", "' + match.weekday_to + '")' %} +{% endif %} +{% if match.match_type == 'date_range' %} +{% set match_script = match_script + 'dateRange("' + match.date_from + '", "' + match.date_to + '")' %} +{% endif %} +{% if match.match_type == 'time_range' %} +{% set match_script = match_script + 'timeRange(' + match.time_from + ', ' + match.time_to + ')' %} +{% endif %} +{% set match_script = match_script + ')' %} +{% do expression.append(match_script) %} +{% endif %} +{% endfor %} +if ({% if rule.match_type == 'unless' %}!{% endif %}({{ expression|join(join_type) }})) { +{% set proxylist = [] %} +{% for proxy_uuid in rule.proxies.split(',') %} +{% set proxy = helpers.getUUID(proxy_uuid) %} +{% if proxy != None %} +{% if proxy.proxy_type == 'DIRECT' %} +{% do proxylist.append("DIRECT") %} +{% else %} +{% do proxylist.append(proxy.proxy_type + ' ' + proxy.url) %} +{% endif %} +{% endif %} +{% endfor %} +return "{{ proxylist|join(';') }}"; +} +{% endfor %} +{% else %} +/* no rules active or defined*/ +{% endif %} + +{% endif %} + // If no rule exists - use a direct connection + return "DIRECT"; +} diff --git a/www/squid/src/opnsense/service/templates/OPNsense/Syslog/local/squid_access.conf b/www/squid/src/opnsense/service/templates/OPNsense/Syslog/local/squid_access.conf new file mode 100644 index 0000000000..0f742e2a14 --- /dev/null +++ b/www/squid/src/opnsense/service/templates/OPNsense/Syslog/local/squid_access.conf @@ -0,0 +1,6 @@ +################################################################### +# Local syslog-ng configuration filter definition [squid_access]. +################################################################### +filter f_local_squid_access { + program("(squid-1)"); +}; From 8e65fdc09f8f0a2158e048504058e49da65fa237 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 Dec 2023 15:23:38 +0100 Subject: [PATCH 1685/3088] LICENSE: sync and fix Jos' mail address --- LICENSE | 2 +- .../controllers/OPNsense/Quagga/Api/Ospf6settingsController.php | 2 +- .../mvc/app/controllers/OPNsense/Tor/Api/GeneralController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index a2ba1d66bc..54c5ba4521 100644 --- a/LICENSE +++ b/LICENSE @@ -27,7 +27,7 @@ Copyright (c) 2016 IT-assistans Sverige AB Copyright (c) 2021-2023 Jan Winkler Copyright (c) 2023 Jeremy Gutierrez Copyright (c) 2010 Jim Pingle -Copyright (c) 2015 Jos Schellevis +Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça Copyright (c) 2019-2022 Juergen Kellerer Copyright (c) 2020-2021 Manuel Faux diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/Ospf6settingsController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/Ospf6settingsController.php index 5c35e9ff13..0046b5df7a 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/Ospf6settingsController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/Ospf6settingsController.php @@ -2,7 +2,7 @@ /* * Copyright (C) 2015-2017 Deciso B.V. - * Copyright (C) 2015 Jos Schellevis + * Copyright (C) 2015 Jos Schellevis * Copyright (C) 2017 Fabian Franz * Copyright (C) 2017 Michael Muenz * All rights reserved. diff --git a/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/Api/GeneralController.php b/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/Api/GeneralController.php index 2a36f3ab6e..b87068681e 100644 --- a/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/Api/GeneralController.php +++ b/security/tor/src/opnsense/mvc/app/controllers/OPNsense/Tor/Api/GeneralController.php @@ -2,7 +2,7 @@ /* * Copyright (C) 2017 Fabian Franz - * Copyright (C) 2015 Jos Schellevis + * Copyright (C) 2015 Jos Schellevis * Copyright (C) 2015-2017 Deciso B.V. * All rights reserved. * From 8636a1f883c62907508a44eb96e7b55243772215 Mon Sep 17 00:00:00 2001 From: Liam Steckler <553265+buckbanzai@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:11:17 -0800 Subject: [PATCH 1686/3088] Add support for Bunny DNS API --- security/acme-client/pkg-descr | 4 ++ .../AcmeClient/forms/dialogValidation.xml | 10 +++++ .../AcmeClient/LeValidation/DnsBunny.php | 43 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 4 ++ 4 files changed, 61 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsBunny.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index b0adf45c98..1c99960d9d 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,10 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +3.20 +Added: +* add Bunny DNS API + 3.19 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 195f519f7b..c0f26f73bc 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -226,6 +226,16 @@ text
    + + + header + + + + validation.dns_bunny_api_key + + text + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsBunny.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsBunny.php new file mode 100644 index 0000000000..092d621609 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsBunny.php @@ -0,0 +1,43 @@ + + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\AcmeClient\LeValidation; + +use OPNsense\AcmeClient\LeValidationInterface; +use OPNsense\Core\Config; + +/** + * Bunny DNS API + * @package OPNsense\AcmeClient + */ +class DnsBunny extends Base implements LeValidationInterface +{ + public function prepare() + { + $this->acme_env['BUNNY_API_KEY'] = (string)$this->config->dns_bunny_api_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 7f80fb1647..82c4d397ef 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -429,6 +429,7 @@ AutoDNS (InterNetX) AWS Route 53 Azure DNS + Bunny ClouDNS CloudFlare.com CloudXNS.com @@ -558,6 +559,9 @@ N + + N + N From 1a1630b875af10a7f928470acc6df1ae022e9851 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 20 Dec 2023 15:28:04 +0100 Subject: [PATCH 1687/3088] net/haproxy: add support for forwarded header (RFC7239) --- net/haproxy/pkg-descr | 1 + .../OPNsense/HAProxy/forms/dialogBackend.xml | 15 +++++++++++++++ .../mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 17 +++++++++++++++++ .../templates/OPNsense/HAProxy/haproxy.conf | 9 +++++++++ 4 files changed, 42 insertions(+) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index e0f6044fee..056cc01d92 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -8,6 +8,7 @@ Plugin Changelog Added: * add support for built-in OCSP update feature +* add support for forwarded header (RFC7239) Fixed: * fix typo in cert sync script diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index c7babd3a7a..5895c1013a 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -173,6 +173,21 @@ true + + backend.forwardedHeader + + checkbox + + + + backend.forwardedHeaderParameters + + select_multiple + + true + true + HAProxy documentation for a full description.]]> + header diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 5c42f7c201..c4eff76bc2 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -1053,6 +1053,23 @@ HTTP/1.0 + + 0 + N + + + N + Y + Y + + proto + host + by + by_port + for + for_port + + N sticktable diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index bcfc4c6e26..19b5c50ea1 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1686,6 +1686,15 @@ backend {{backend.name}} {% if backend.tuning_httpreuse|default("") != "" and backend.mode == "http" %} http-reuse {{backend.tuning_httpreuse}} {% endif %} +{% if backend.forwardedHeader == '1' and backend.mode == 'http' %} +{% set forwarded_params = [] %} +{% if backend.forwardedHeaderParameters|default("") != "" %} +{% for fwd_param in backend.forwardedHeaderParameters.split(",") %} +{% do forwarded_params.append(fwd_param) %} +{% endfor %} +{% endif %} + option forwarded {{forwarded_params|join(' ')}} +{% endif %} {% if helpers.exists('OPNsense.HAProxy.general.cache') and OPNsense.HAProxy.general.cache.enabled|default("") == "1" and backend.tuning_caching|default("") == "1" and backend.mode == "http" %} http-request cache-use opnsense-haproxy-cache http-response cache-store opnsense-haproxy-cache From 79aec1ccb4b02227e2d32625802adfb95b426d8a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Wed, 20 Dec 2023 15:46:16 +0100 Subject: [PATCH 1688/3088] net/haproxy: add forwardfor option to backend settings --- net/haproxy/pkg-descr | 4 ++++ .../controllers/OPNsense/HAProxy/forms/dialogBackend.xml | 6 ++++++ .../controllers/OPNsense/HAProxy/forms/dialogFrontend.xml | 4 ++-- .../opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 5 +++++ .../service/templates/OPNsense/HAProxy/haproxy.conf | 3 +++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 056cc01d92..da3d9d987a 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -9,6 +9,7 @@ Plugin Changelog Added: * add support for built-in OCSP update feature * add support for forwarded header (RFC7239) +* add option "X-Forwarded-For Header" to backend settings Fixed: * fix typo in cert sync script @@ -17,6 +18,9 @@ Changed: * move OCSP settings from "Service" to "Global" section * replace bundled haproxyctl library with haproxy-cli +Deprecated: +* frontend option "X-Forwarded-For Header" (the backend option should be used) + Removed: * remove OSCP update cron job diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index 5895c1013a..73bb33ce61 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -188,6 +188,12 @@ true HAProxy documentation for a full description.]]> + + backend.forwardFor + + checkbox + + header diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml index 2a4c492a52..d21e258f9b 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml @@ -207,9 +207,9 @@ frontend.forwardFor - + checkbox - + frontend.prometheus_enabled diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index c4eff76bc2..01e1eb4deb 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -814,6 +814,7 @@ HTTP/1.0 + 0 Y @@ -1053,6 +1054,10 @@ HTTP/1.0 + + 0 + N + 0 N diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 19b5c50ea1..13754b1116 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1695,6 +1695,9 @@ backend {{backend.name}} {% endif %} option forwarded {{forwarded_params|join(' ')}} {% endif %} +{% if backend.forwardFor == '1' and backend.mode == 'http' %} + option forwardfor +{% endif %} {% if helpers.exists('OPNsense.HAProxy.general.cache') and OPNsense.HAProxy.general.cache.enabled|default("") == "1" and backend.tuning_caching|default("") == "1" and backend.mode == "http" %} http-request cache-use opnsense-haproxy-cache http-response cache-store opnsense-haproxy-cache From 0da31a9e95caba60bc1317509ded87ba38b1771b Mon Sep 17 00:00:00 2001 From: bernhardfrenking <58109356+bernhardfrenking@users.noreply.github.com> Date: Tue, 26 Dec 2023 11:21:37 +0100 Subject: [PATCH 1689/3088] dns/ddclient: add native service Domeneshop (#3714) --------- Co-authored-by: Franco Fichtner --- .../ddclient/lib/account/domeneshop.py | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 dns/ddclient/src/opnsense/scripts/ddclient/lib/account/domeneshop.py diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/domeneshop.py b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/domeneshop.py new file mode 100644 index 0000000000..2448cd5092 --- /dev/null +++ b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/domeneshop.py @@ -0,0 +1,93 @@ +""" + Copyright (c) 2023 Bernhard Frenking + Copyright (c) 2023 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------------------------------- + Domeneshop DNS updater + Token should be set via the username field + Secret should be set via the password field +""" +import syslog +import requests +from requests.auth import HTTPBasicAuth +from . import BaseAccount + + +class Domeneshop(BaseAccount): + + _services = { + 'domeneshop': 'api.domeneshop.no' + } + + def __init__(self, account: dict): + super().__init__(account) + + @staticmethod + def known_services(): + return Domeneshop._services.keys() + + @staticmethod + def match(account): + return account.get('service') in Domeneshop._services + + def execute(self): + if super().execute(): + hostnames = self.settings.get('hostnames') + + # DNS update request using the "IP update protocol" + url = f'https://api.domeneshop.no/v0/dyndns/update?hostnames={hostnames}&myip={str(self.current_address)}' + req_opts = { + 'url': url, + 'auth': HTTPBasicAuth(self.settings.get('username'), self.settings.get('password')), + 'headers': { + 'User-Agent': 'OPNsense-dyndns' + } + } + response = requests.get(**req_opts) + + # Parse response and update state and log + if response.status_code is 204: + if self.is_verbose: + syslog.syslog( + syslog.LOG_NOTICE, + "Account %s set new ip %s [%s] for %s" % (self.description, self.current_address, response.text.strip(), hostnames) + ) + self.update_state(address=self.current_address, status=response.text.split()[0] if response.text else '') + return True + elif response.status_code is 404: + syslog.syslog( + syslog.LOG_ERR, + "Account %s failed to set new ip %s [%d - %s], because %s could not be found" % ( + self.description, self.current_address, response.status_code, response.text.replace('\n', ''), hostnames + ) + ) + else: + syslog.syslog( + syslog.LOG_ERR, + "Account %s failed to set new ip %s [%d - %s] for %s" % ( + self.description, self.current_address, response.status_code, response.text.replace('\n', ''), hostnames + ) + ) + + return False From a186956c52eb5716b92f28a99177e46e6457a547 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 26 Dec 2023 12:38:23 +0100 Subject: [PATCH 1690/3088] security/stunnel - fix regression caused by changed parent save() method (https://github.com/opnsense/core/commit/e36123c99f4ff2a518a927f1807be51186f78577) --- security/stunnel/Makefile | 2 +- .../controllers/OPNsense/Stunnel/Api/ServicesController.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile index d771947df2..a7e42ae0dc 100644 --- a/security/stunnel/Makefile +++ b/security/stunnel/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= stunnel PLUGIN_VERSION= 1.0.5 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= Stunnel TLS proxy PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_DEPENDS= stunnel diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php index 0083aec567..5db04eb871 100644 --- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php +++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/Api/ServicesController.php @@ -35,7 +35,7 @@ class ServicesController extends ApiMutableModelControllerBase protected static $internalModelName = 'stunnel'; protected static $internalModelClass = 'OPNsense\Stunnel\Stunnel'; - protected function save() + protected function save($validateFullModel = false, $disable_validation = false) { // hook service enable status on enabled tunnels $this->getModel()->general->enabled = "0"; @@ -45,7 +45,7 @@ protected function save() break; } } - return parent::save(); + return parent::save($validateFullModel, $disable_validation); } public function searchItemAction() From 785893d347b8108aa6a92d8415c60e9c8eb7e0a2 Mon Sep 17 00:00:00 2001 From: Michael Leinartas Date: Tue, 26 Dec 2023 12:37:32 -0600 Subject: [PATCH 1691/3088] Add EasyDNS support to acme-client --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsEasydns.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 3 files changed, 67 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 195f519f7b..4731b47e8b 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1386,6 +1386,21 @@ validation.dns_schlundtech_password password + + + + header + + + + validation.dns_easydns_apitoken + + text + + + validation.dns_easydns_apikey + + password diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php new file mode 100644 index 0000000000..59d4a759ad --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php @@ -0,0 +1,45 @@ +acme_env[EASYDNS_Key] = (string)$this->config->dns_easydns_apikey; + $this->acme_env[EASYDNS_Token] = (string)$this->config->dns_easydns_apitoken; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 7f80fb1647..cade8f5c82 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -451,6 +451,7 @@ Dyn Managed Dynu dynv6 + EasyDNS EUserv FreeDNS Gandi LiveDNS @@ -1071,6 +1072,12 @@ N + + N + + + N + N From f6f324891261d8a1f75eeb0cd9bb0736e7a4403a Mon Sep 17 00:00:00 2001 From: Russ Kubes Date: Thu, 28 Dec 2023 02:44:06 -0500 Subject: [PATCH 1692/3088] sysutils/smart: add word break to ident in widget (#3726) Add word-breaking to the "Ident" column of the SMART Dashboard widget, to prevent long device names from causing the table to extend outside of the widget's div. --- sysutils/smart/src/www/widgets/widgets/smart_status.widget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysutils/smart/src/www/widgets/widgets/smart_status.widget.php b/sysutils/smart/src/www/widgets/widgets/smart_status.widget.php index 52d951f5fe..976be530d1 100644 --- a/sysutils/smart/src/www/widgets/widgets/smart_status.widget.php +++ b/sysutils/smart/src/www/widgets/widgets/smart_status.widget.php @@ -64,7 +64,7 @@ device) ?> - ident) ?> + ident) ?> From a57e2a3ccd00f721401d1b3cc7890c3493bf0502 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 28 Dec 2023 22:00:04 +0100 Subject: [PATCH 1693/3088] net/haproxy: adjust HTTP/2 settings to adopt HAProxy 2.8 defaults --- net/haproxy/pkg-descr | 2 ++ .../src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml | 4 ++-- .../opnsense/service/templates/OPNsense/HAProxy/haproxy.conf | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index da3d9d987a..18eeccabac 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -15,6 +15,8 @@ Fixed: * fix typo in cert sync script Changed: +* change default for HTTP/2 to enabled (only new frontends/backends) +* add "no-alpn" option if HTTP/2 is not enabled (TLS-enabled frontends) * move OCSP settings from "Service" to "Global" section * replace bundled haproxyctl library with haproxy-cli diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index 01e1eb4deb..ed8670c42e 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -796,7 +796,7 @@ N - 0 + 1 N @@ -1036,7 +1036,7 @@ N - 0 + 1 N diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 13754b1116..571562c8d8 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1369,6 +1369,9 @@ frontend {{frontend.name}} {# # convert protocols to HAProxy-compatible format #} {% set alpn_options = frontend.advertised_protocols|replace('http10', 'http/1.0')|replace('http11', 'http/1.1') %} {% do ssl_options.append('alpn ' ~ alpn_options) %} +{% else %} +{# # disable ALPN to enforce the GUI settings #} +{% do ssl_options.append('no-alpn') %} {% endif %} {# # HTTP/2 without TLS #} {% elif frontend.http2Enabled|default("") == '1' and frontend.http2Enabled_nontls|default("") == '1' %} From 557f02a684ee0c92929172e0452a1841eeb94d13 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 28 Dec 2023 22:36:55 +0100 Subject: [PATCH 1694/3088] net/haproxy: add HTTP/2 performance settings --- net/haproxy/pkg-descr | 1 + .../OPNsense/HAProxy/forms/generalTuning.xml | 40 +++++++++++++++++++ .../app/models/OPNsense/HAProxy/HAProxy.xml | 36 +++++++++++++++++ .../templates/OPNsense/HAProxy/haproxy.conf | 18 +++++++++ 4 files changed, 95 insertions(+) diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 18eeccabac..44cb5c9525 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -10,6 +10,7 @@ Added: * add support for built-in OCSP update feature * add support for forwarded header (RFC7239) * add option "X-Forwarded-For Header" to backend settings +* add options for HTTP/2 performance tuning Fixed: * fix typo in cert sync script diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml index 364cf6032d..f20d662dc5 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/generalTuning.xml @@ -132,4 +132,44 @@ true + + + header + + + haproxy.general.tuning.h2_initialWindowSize + + text + + + + haproxy.general.tuning.h2_initialWindowSizeOutgoing + + text + + + + haproxy.general.tuning.h2_initialWindowSizeIncoming + + text + + + + haproxy.general.tuning.h2_maxConcurrentStreams + + text + + + + haproxy.general.tuning.h2_maxConcurrentStreamsOutgoing + + text + + + + haproxy.general.tuning.h2_maxConcurrentStreamsIncoming + + text + + diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index ed8670c42e..3e90be2f2b 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -201,6 +201,42 @@ TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 N + + 0 + 10000000 + Please specify a value between 0 and 10000000. + N + + + 0 + 10000000 + Please specify a value between 0 and 10000000. + N + + + 0 + 10000000 + Please specify a value between 0 and 10000000. + N + + + 0 + 10000000 + Please specify a value between 0 and 10000000. + N + + + 0 + 10000000 + Please specify a value between 0 and 10000000. + N + + + 0 + 10000000 + Please specify a value between 0 and 10000000. + N + diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index 571562c8d8..4ee9337003 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -1011,6 +1011,24 @@ global {% if OPNsense.HAProxy.general.tuning.luaMaxMem|default("") != "" %} tune.lua.maxmem {{OPNsense.HAProxy.general.tuning.luaMaxMem}} {% endif %} +{% if OPNsense.HAProxy.general.tuning.h2_initialWindowSize|default("") != "" %} + tune.h2.initial-window-size {{OPNsense.HAProxy.general.tuning.h2_initialWindowSize}} +{% endif %} +{% if OPNsense.HAProxy.general.tuning.h2_initialWindowSizeOutgoing|default("") != "" %} + tune.h2.be.initial-window-size {{OPNsense.HAProxy.general.tuning.h2_initialWindowSizeOutgoing}} +{% endif %} +{% if OPNsense.HAProxy.general.tuning.h2_initialWindowSizeIncoming|default("") != "" %} + tune.h2.fe.initial-window-size {{OPNsense.HAProxy.general.tuning.h2_initialWindowSizeIncoming}} +{% endif %} +{% if OPNsense.HAProxy.general.tuning.h2_maxConcurrentStreams|default("") != "" %} + tune.h2.max-concurrent-streams {{OPNsense.HAProxy.general.tuning.h2_maxConcurrentStreams}} +{% endif %} +{% if OPNsense.HAProxy.general.tuning.h2_maxConcurrentStreamsOutgoing|default("") != "" %} + tune.h2.be.max-concurrent-streams {{OPNsense.HAProxy.general.tuning.h2_maxConcurrentStreamsOutgoing}} +{% endif %} +{% if OPNsense.HAProxy.general.tuning.h2_maxConcurrentStreamsIncoming|default("") != "" %} + tune.h2.fe.max-concurrent-streams {{OPNsense.HAProxy.general.tuning.h2_maxConcurrentStreamsIncoming}} +{% endif %} {# # logging configuration #} {% set logging = [] %} {% if OPNsense.HAProxy.general.logging.host != '127.0.0.1' %} From 3d42eb6a9956d98836838baa8d15936b684535b9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 28 Dec 2023 22:51:37 +0100 Subject: [PATCH 1695/3088] net/haproxy: switch to HAProxy 2.8, refs #3459 --- net/haproxy/Makefile | 2 +- net/haproxy/pkg-descr | 1 + .../OPNsense/HAProxy/forms/dialogAction.xml | 12 ++++++------ .../OPNsense/HAProxy/forms/dialogBackend.xml | 10 +++++----- .../OPNsense/HAProxy/forms/dialogFcgi.xml | 2 +- .../OPNsense/HAProxy/forms/dialogFrontend.xml | 6 +++--- .../OPNsense/HAProxy/forms/dialogMapfile.xml | 2 +- .../mvc/app/views/OPNsense/HAProxy/index.volt | 10 +++++----- 8 files changed, 23 insertions(+), 22 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 95013f8e1b..14dccc7afa 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -2,7 +2,7 @@ PLUGIN_NAME= haproxy PLUGIN_VERSION= 4.1 PLUGIN_REVISION= 1 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer -PLUGIN_DEPENDS= haproxy26 py${PLUGIN_PYTHON}-haproxy-cli +PLUGIN_DEPENDS= haproxy py${PLUGIN_PYTHON}-haproxy-cli PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 44cb5c9525..8eb91e61da 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -16,6 +16,7 @@ Fixed: * fix typo in cert sync script Changed: +* upgrade to HAProxy 2.8 release series (#3459) * change default for HTTP/2 to enabled (only new frontends/backends) * add "no-alpn" option if HTTP/2 is not enabled (TLS-enabled frontends) * move OCSP settings from "Service" to "Global" section diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml index e03c3632bf..7945ded643 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogAction.xml @@ -89,7 +89,7 @@ action.http_request_redirect text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -128,7 +128,7 @@ action.http_request_add_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -145,7 +145,7 @@ action.http_request_set_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -251,7 +251,7 @@ action.http_response_add_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -268,7 +268,7 @@ action.http_response_set_header_content text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> @@ -468,6 +468,6 @@ action.fcgi_set_param text - Custom Log format rules. With this directive, it is possible to overwrite the value of default FastCGI parameters.]]> + Custom Log format rules. With this directive, it is possible to overwrite the value of default FastCGI parameters.]]> diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index 73bb33ce61..8411a6ad93 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -28,7 +28,7 @@ backend.algorithm dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> Choose a load balancing algorithm. @@ -42,7 +42,7 @@ backend.proxyProtocol dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> true @@ -213,7 +213,7 @@ backend.persistence_cookiemode dropdown - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> backend.persistence_cookiename @@ -235,14 +235,14 @@ backend.stickiness_pattern dropdown - HAProxy documentation for a full description.
    NOTE: Consider not using this feature in multi-process mode, it can result in random behaviours.
    ]]>
    + HAProxy documentation for a full description.
    NOTE: Consider not using this feature in multi-process mode, it can result in random behaviours.
    ]]>
    Choose a persistence type.
    backend.stickiness_dataTypes select_multiple - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> backend.stickiness_expire diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFcgi.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFcgi.xml index fd6e48bfd3..c02327bcea 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFcgi.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFcgi.xml @@ -33,7 +33,7 @@ fcgi.path_info text - HAProxy's documentation for further details and examples.]]> + HAProxy's documentation for further details and examples.]]> fcgi.log_stderr diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml index d21e258f9b..2268abe723 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogFrontend.xml @@ -350,14 +350,14 @@ frontend.stickiness_pattern dropdown - HAProxy documentation for further information.]]> + HAProxy documentation for further information.]]> Choose a stick-table type. frontend.stickiness_dataTypes select_multiple - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> frontend.stickiness_expire @@ -384,7 +384,7 @@ frontend.stickiness_counter_key text - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> true diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml index 6b8e712a38..4955c8519a 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogMapfile.xml @@ -15,6 +15,6 @@ mapfile.content textbox - HAProxy documentation for a full description.]]> + HAProxy documentation for a full description.]]> diff --git a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt index c831ef9c8b..932c8814f3 100644 --- a/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt +++ b/net/haproxy/src/opnsense/mvc/app/views/OPNsense/HAProxy/index.volt @@ -717,7 +717,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Lastly, enable HAProxy using the %sService%s settings page.') | format('', '') }}
  • {{ lang._('Please be aware that you need to %smanually%s add the required firewall rules for all configured services.') | format('', '') }}

    -

    {{ lang._('Further information is available in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '') }}

    +

    {{ lang._('Further information is available in the %sofficial HAProxy documentation%s. Be sure to report bugs and request features on our %sGitHub issue page%s. Code contributions are also very welcome!') | format('', '', '', '') }}


    @@ -759,7 +759,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('%sConditions:%s HAProxy is capable of extracting data from requests, responses and other connection data and match it against predefined patterns. Use these powerful patterns to compose a condition that may be used in multiple Rules.') | format('', '') }}
  • {{ lang._('%sRules:%s Perform a large set of actions if one or more %sConditions%s match. These Rules may be used in %sBackend Pools%s as well as %sPublic Services%s.') | format('', '', '', '', '', '', '', '') }}
  • -

    {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    +

    {{ lang._("For more information on HAProxy's %sACL feature%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    {{ lang._('Note that it is possible to directly add options to the HAProxy configuration by using the "option pass-through", a setting that is available for several configuration items. It allows you to implement configurations that are currently not officially supported by this plugin. It is strongly discouraged to rely on this feature. Please report missing features on our GitHub page!') | format('', '') }}


    @@ -774,7 +774,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('%sGroup:%s A optional list containing one or more users. Groups usually make it easier to manage permissions for a large number of users') | format('', '') }}
  • {{ lang._('Note that users and groups must be selected from the Backend Pool or Public Service configuration in order to be used for authentication. In addition to this users and groups may also be used in Rules/Conditions.') }}

    -

    {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}

    +

    {{ lang._("For more information on HAProxy's %suser/group management%s see the %sofficial documentation%s.") | format('', '', '', '') }}


    @@ -792,7 +792,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sCache:%s HAProxy's cache which was designed to perform cache on small objects (favicon, css, etc.). This is a minimalist low-maintenance cache which runs in RAM.") | format('', '', '', '') }}
  • {{ lang._("%sPeers:%s Configure a communication channel between two HAProxy instances. This will propagate entries of any data-types in stick-tables between these HAProxy instances over TCP connections in a multi-master fashion. Useful when aiming for a seamless failover in a HA setup.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sStatistics%s, %sCache%s and %sPeers%s features.") | format('', '', '', '', '', '') }}


    @@ -810,7 +810,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._("%sResolvers:%s This feature allows in-depth configuration of how HAProxy handles name resolution and interacts with name resolvers (DNS). Each resolver configuration can be used in %sBackend Pools%s to apply individual name resolution configurations.") | format('', '', '', '') }}
  • {{ lang._("%sE-Mail Alerts:%s It is possible to send email alerts when the state of servers changes. Each configuration can be used in %sBackend Pools%s to send e-mail alerts to the configured recipient.") | format('', '', '', '') }}
  • -

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}

    +

    {{ lang._("For more details visit HAProxy's official documentation regarding the %sError Messages%s, %sLua Script%s and the %sMap Files%s features. More information on HAProxy's CPU Affinity is also available %shere%s, %shere%s and %shere%s. A detailed explanation of the resolvers feature can be found %shere%s.") | format('', '', '', '', '', '' ,'', '' ,'', '' ,'', '','', '') }}


    From de900c2c5786bdc660b85ceba1131a2d1d72e12e Mon Sep 17 00:00:00 2001 From: Sattam Date: Sat, 30 Dec 2023 18:23:28 +0300 Subject: [PATCH 1696/3088] security/acme-client: Add support for DNSExit (#3732) --- security/acme-client/pkg-descr | 1 + .../AcmeClient/forms/dialogValidation.xml | 20 ++++++++ .../AcmeClient/LeValidation/DnsDnsexit.php | 47 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 10 ++++ 4 files changed, 78 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnsexit.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 1c99960d9d..11a6d4150e 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -11,6 +11,7 @@ Plugin Changelog 3.20 Added: * add Bunny DNS API +* add support for DNSExit 3.19 diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index c4bbcd4533..9eecd5f2ef 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -366,6 +366,26 @@ text + + + header + + + + validation.dns_dnsexit_auth_user + + text + + + validation.dns_dnsexit_auth_pass + + password + + + validation.dns_dnsexit_api + + text + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnsexit.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnsexit.php new file mode 100644 index 0000000000..8943f1baa3 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnsexit.php @@ -0,0 +1,47 @@ +acme_env['DNSEXIT_AUTH_USER'] = (string)$this->config->dns_dnsexit_auth_user; + $this->acme_env['DNSEXIT_AUTH_PASS'] = (string)$this->config->dns_dnsexit_auth_pass; + $this->acme_env['DNSEXIT_API_KEY'] = (string)$this->config->dns_dnsexit_api; + + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 019844738c..65adfcef4c 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -440,6 +440,7 @@ deSEC.io DigitalOcean DirectAdmin + DNSExit DNSimple DNS.Services Domeneshop @@ -612,6 +613,15 @@ N + + N + + + N + + + N + N From 0caa6d7a3a872b3b7545e490893bc8170f243f26 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 30 Dec 2023 16:41:54 +0100 Subject: [PATCH 1697/3088] security/acme-client: add world4you DNS API, closes #3722 --- security/acme-client/pkg-descr | 2 + .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsWorld4you.php | 44 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 4 files changed, 68 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsWorld4you.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 11a6d4150e..696ed56245 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -9,9 +9,11 @@ Plugin Changelog ================ 3.20 + Added: * add Bunny DNS API * add support for DNSExit +* add World4You DNS API (#3722) 3.19 diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 9eecd5f2ef..382086ecae 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1656,4 +1656,19 @@ password + + + header + + + + validation.dns_world4you_username + + text + + + validation.dns_world4you_password + + password + diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsWorld4you.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsWorld4you.php new file mode 100644 index 0000000000..192c8d63e1 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsWorld4you.php @@ -0,0 +1,44 @@ +acme_env['WORLD4YOU_USERNAME'] = (string)$this->config->dns_world4you_username; + $this->acme_env['WORLD4YOU_PASSWORD'] = (string)$this->config->dns_world4you_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 65adfcef4c..980c0b9587 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -509,6 +509,7 @@ Variomedia.de Vscale Vultr + World4You Yandex PDD Zilore Zone.eu @@ -1172,6 +1173,12 @@ N + + N + + + N + From 2aed162fa6dde8ee22d112f775bea7b550a7dec7 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 30 Dec 2023 16:48:35 +0100 Subject: [PATCH 1698/3088] security/acme-client: remove support for defunct highwinds CDN (#3626) --- security/acme-client/pkg-descr | 3 + .../AcmeClient/forms/dialogAction.xml | 17 -- .../LeAutomation/ConfigdUploadHighwinds.php | 45 ---- .../models/OPNsense/AcmeClient/AcmeClient.xml | 13 +- .../OPNsense/AcmeClient/upload_highwinds.php | 254 ------------------ .../conf/actions.d/actions_acmeclient.conf | 6 - 6 files changed, 4 insertions(+), 334 deletions(-) delete mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/ConfigdUploadHighwinds.php delete mode 100755 security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_highwinds.php diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 696ed56245..a9b8d64296 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -15,6 +15,9 @@ Added: * add support for DNSExit * add World4You DNS API (#3722) +Removed: +* remove automation: Highwinds CDN (#3626) + 3.19 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml index 905f1d49fb..c05efa9835 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml @@ -23,23 +23,6 @@ dropdown Pre-defined commands for this automation. - - - header - - - - action.highwinds_account_hash - - text - Account hash for Highwinds API. - - - action.highwinds_access_token - - text - Access token for Highwinds API. - header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/ConfigdUploadHighwinds.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/ConfigdUploadHighwinds.php deleted file mode 100644 index a17197815f..0000000000 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/ConfigdUploadHighwinds.php +++ /dev/null @@ -1,45 +0,0 @@ -cert_id . ' ' . $this->config->id; - $this->command = $command; - return true; - } -} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index 980c0b9587..f4f434d5e3 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1,6 +1,6 @@ //OPNsense/AcmeClient - 3.4.0 + 3.5.0 A secure ACME Client plugin @@ -1206,7 +1206,6 @@ Restart OPNsense Web UI Restart HAProxy (OPNsense plugin) Restart Nginx (OPNsense plugin) - Upload certificate to Highwinds CDN Upload certificate via SFTP Remote Command via SSH Upload certificate to FRITZ!Box router @@ -1219,16 +1218,6 @@ System or Plugin Command
    - - N - /^.{1,1024}$/u - Should be a string between 1 and 1024 characters. - - - N - /^.{1,1024}$/u - Should be a string between 1 and 1024 characters. - N /^.{1,255}$/u diff --git a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_highwinds.php b/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_highwinds.php deleted file mode 100755 index 2819626a45..0000000000 --- a/security/acme-client/src/opnsense/scripts/OPNsense/AcmeClient/upload_highwinds.php +++ /dev/null @@ -1,254 +0,0 @@ -#!/usr/local/bin/php -object(); - if (isset($configObj->OPNsense->AcmeClient->certificates) && $configObj->OPNsense->AcmeClient->certificates->count() > 0) { - foreach ($configObj->OPNsense->AcmeClient->certificates->children() as $certObj) { - $cert_id = (string)$certObj->id; - $cert_name = (string)$certObj->name; - if ($cert_id == $acme_cert_id) { - if ($certObj->enabled == 0) { - log_error("AcmeClient: certificate ${cert_name} is disabled, ignoring upload request"); - return 'None'; - } - if (isset($certObj->certRefId)) { - $data = array(); - $data['name'] = $cert_name; - $data['refid'] = (string)$certObj->certRefId; - return $data; - } else { - log_error("AcmeClient: certificate ${cert_name} could not be found in trust storage, ignoring upload request"); - break; - } - } - } - return 'None'; - } -} - -function export_certificate($cert_refid) -{ - $configObj = Config::getInstance()->object(); - foreach ($configObj->cert as $cert) { - if ($cert_refid == (string)$cert->refid) { - $cert_content = str_replace("\n\n", "\n", str_replace("\r", "", base64_decode((string)$cert->crt))); - $key_content = str_replace("\n\n", "\n", str_replace("\r", "", base64_decode((string)$cert->prv))); - // check if a CA is linked - if (!empty((string)$cert->caref)) { - $cert = (array)$cert; - $ca = ca_chain($cert); - $ca_content = $ca; - } - $result = array(); - $result['cert'] = $cert_content; - $result['key'] = $key_content; - $result['ca'] = $ca_content; - return $result; - } - } - log_error("AcmeClient: cert with refid ${cert_refid} not found in trust storage"); - return 'None'; -} - -function upload_certificate($cert_name, $cert_refid, $acme_cert_id, $acme_automation_id) -{ - $modelObj = new OPNsense\AcmeClient\AcmeClient(); - $configObj = Config::getInstance()->object(); - if (isset($configObj->OPNsense->AcmeClient->actions) && $configObj->OPNsense->AcmeClient->actions->count() > 0) { - foreach ($configObj->OPNsense->AcmeClient->actions->children() as $automObj) { - $autom_id = (string)$automObj->id; - if ($autom_id == $acme_automation_id) { - if ($automObj->enabled == 0) { - log_error("AcmeClient: ignoring disabled upload job for cert ${cert_name}"); - return 'None'; - } - if (isset($automObj->highwinds_account_hash) && isset($automObj->highwinds_access_token)) { - $hw_account_hash = (string)$automObj->highwinds_account_hash; - $hw_access_token = (string)$automObj->highwinds_access_token; - $cert_data = export_certificate($cert_refid); - if ($cert_data !== 'None') { - $hw_result = hw_upload_certificate($hw_account_hash, $hw_access_token, $cert_name, $cert_data); - if ($hw_result !== 'None') { - return true; - } - } - } else { - log_error("AcmeClient: upload job for cert ${cert_name} is incomplete, missing Highwinds configuration"); - return 'None'; - } - } - } - return 'None'; - } -} - -function hw_list_certificates($account_hash, $access_token) -{ - global $HIGHWINDS_API_URL; - $curl = curl_init(); - curl_setopt_array($curl, array( - CURLOPT_URL => "${HIGHWINDS_API_URL}/${account_hash}/certificates", - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_MAXREDIRS => 1, - CURLOPT_TIMEOUT => 10, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_HTTPHEADER => array( - "Authorization: Bearer ${access_token}", - "Content-Type: application/json", - "User-Agent: OPNsense Firewall", - "X-Application-Id: OPNsense Firewall" - ) - )); - $response = curl_exec($curl); - $err = curl_error($curl); - $info = curl_getinfo($curl); - curl_close($curl); - $http_code = $info['http_code']; - if ($http_code != 200 || $err) { - log_error("AcmeClient: failed to access Highwinds API, HTTP Code: ${http_code}, error ${err}"); - return 'None'; - } - return json_decode($response); -} - -function hw_get_certificate($account_hash, $access_token, $cert_name) -{ - $certificates = hw_list_certificates($account_hash, $access_token); - if ($certificates !== 'None') { - foreach ($certificates->list as $cert) { - if ($cert->commonName == $cert_name) { - return $cert; - } - } - } - return 'None'; -} - -function hw_upload_certificate($account_hash, $access_token, $cert_name, $cert_data) -{ - global $HIGHWINDS_API_URL; - // Check current status of certificate at Highwinds - $hw_cert = hw_get_certificate($account_hash, $access_token, $cert_name); - $hw_url = 'certificates'; - $hw_method = 'POST'; - if ($hw_cert == 'None') { - log_error("AcmeClient: cert for ${cert_name} not found in Highwinds API, starting upload..."); - } else { - log_error("AcmeClient: cert for ${cert_name} found in Highwinds API"); - $hw_method = 'PUT'; - - // Extract certificate details - $cert = openssl_x509_parse($cert_data['cert']); - $cert_sn = (string)$cert['serialNumber']; - $hw_cert_sn = (string)$hw_cert->certificateInformation->serialNumber; - $hw_cert_id = $hw_cert->id; - - // Compare local and remote certificates - if ($cert_sn == $hw_cert_sn) { - log_error("AcmeClient: cert ${cert_name} has same serial in Highwinds API, not updating (${cert_sn})"); - return 'None'; - } - log_error("AcmeClient: cert serial is different in Highwinds API, updating..."); - $hw_url = "${hw_url}/${hw_cert_id}"; - } - - // adjust data format for Highwinds API - $cert_post = json_encode(array('certificate' => $cert_data['cert'], 'key' => $cert_data['key'], 'caBundle' => $cert_data['ca'])); - - $curl = curl_init(); - curl_setopt_array($curl, array( - CURLOPT_URL => "${HIGHWINDS_API_URL}/${account_hash}/${hw_url}", - CURLOPT_CUSTOMREQUEST => $hw_method, - CURLOPT_POSTFIELDS => (string)$cert_post, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_MAXREDIRS => 1, - CURLOPT_TIMEOUT => 10, - CURLOPT_SAFE_UPLOAD => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_HTTPHEADER => array( - "Authorization: Bearer ${access_token}", - "Content-Type: application/json", - "User-Agent: OPNsense Firewall", - "X-Application-Id: OPNsense Firewall", - "Expect:" - ) - )); - $response = curl_exec($curl); - $err = curl_error($curl); - $info = curl_getinfo($curl); - curl_close($curl); - $http_code = $info['http_code']; - if ($http_code != 200 || $err) { - log_error("AcmeClient: Failed to upload cert ${cert_name} to Highwinds API, HTTP Code: ${http_code}, error ${err}"); - return 'None'; - } - return json_decode($response); -} - -// Evaluate CLI arguments -$options = getopt("a:c:"); -if (!isset($options["a"]) or !isset($options["c"])) { - print "ERROR: not enough arguments\n"; - exit(1); -} -$acme_cert_id = $options["c"]; -$acme_automation_id = $options["a"]; - -// Search certificate in configuration -$cert_data = find_certificate($acme_cert_id); -if ($cert_data == 'None') { - log_error("AcmeClient: ignoring cert ID ${acme_cert_id}"); - exit(1); -} else { - // Upload certificate (if required) - $upload_result = upload_certificate($cert_data['name'], $cert_data['refid'], $acme_cert_id, $acme_automation_id); - if ($upload_result === 'None') { - log_error("AcmeClient: cert ID ${acme_cert_id} was neither uploaded nor updated"); - } else { - log_error("AcmeClient: cert ID ${acme_cert_id} was uploaded or updated"); - } -} -exit(0); diff --git a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf index 7c47bdf858..c58df0bef8 100644 --- a/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf +++ b/security/acme-client/src/opnsense/service/conf/actions.d/actions_acmeclient.conf @@ -91,12 +91,6 @@ parameters:%s type:script message:registering an account -[upload_highwinds] -command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/upload_highwinds.php -parameters:-c %s -a %s -type:script -message:uploading a certificate to highwinds - [upload-sftp] command:/usr/local/opnsense/scripts/OPNsense/AcmeClient/upload_sftp.php parameters:--certificates=%s --automation-id=%s From a087b1a135cf1298e934ab1947b95dab017ac258 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 30 Dec 2023 17:10:48 +0100 Subject: [PATCH 1699/3088] security/acme-client: fix 2FA support in Synology deployhook, closes #3627 --- security/acme-client/pkg-descr | 3 +++ .../controllers/OPNsense/AcmeClient/forms/dialogAction.xml | 6 ++++++ .../OPNsense/AcmeClient/LeAutomation/AcmeSynologyDsm.php | 5 ++++- .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index a9b8d64296..4223241535 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -15,6 +15,9 @@ Added: * add support for DNSExit * add World4You DNS API (#3722) +Fixed: +* fix 2FA support in Synology deployhook (#3627) + Removed: * remove automation: Highwinds CDN (#3626) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml index c05efa9835..5fa9e700dd 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogAction.xml @@ -219,6 +219,12 @@ text If Synology DSM has OTP enabled, then the device ID has to be provided so that no OTP is required when running the automation. + + action.acme_synology_dsm_devicename + + text + If Synology DSM has OTP enabled, then the device name has to be provided so that no OTP is required when running the automation. + action.acme_synology_dsm_create diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeSynologyDsm.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeSynologyDsm.php index c1fb58a0a1..3194f57450 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeSynologyDsm.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/AcmeSynologyDsm.php @@ -48,7 +48,10 @@ public function prepare() $this->acme_env['SYNO_Create'] = (string)$this->config->acme_synology_dsm_create; } if (!empty((string)$this->config->acme_synology_dsm_deviceid)) { - $this->acme_env['SYNO_DID'] = (string)$this->config->acme_synology_dsm_deviceid; + $this->acme_env['SYNO_Device_ID'] = (string)$this->config->acme_synology_dsm_deviceid; + } + if (!empty((string)$this->config->acme_synology_dsm_devicename)) { + $this->acme_env['SYNO_Device_Name'] = (string)$this->config->acme_synology_dsm_devicename; } $this->acme_args[] = '--deploy-hook synology_dsm'; return true; diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index f4f434d5e3..b5339d9383 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -1380,6 +1380,11 @@ /^.{1,1024}$/u Should be a string between 1 and 1024 characters. + + N + /^.{1,1024}$/u + Should be a string between 1 and 1024 characters. + N /^.{1,1024}$/u From 2c725f15e68aedd447182100384944012aea9bae Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 30 Dec 2023 17:20:37 +0100 Subject: [PATCH 1700/3088] security/acme-client: bump version --- security/acme-client/Makefile | 3 +-- security/acme-client/pkg-descr | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 1f3eaf6ce8..d9e7b6a6a0 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 3.19 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 3.20 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 4223241535..f9bc03d723 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -11,12 +11,12 @@ Plugin Changelog 3.20 Added: -* add Bunny DNS API -* add support for DNSExit +* add Bunny DNS API (#3715) +* add DNSExit DNS API (#3724) * add World4You DNS API (#3722) Fixed: -* fix 2FA support in Synology deployhook (#3627) +* fix 2FA support in Synology automation (#3627) Removed: * remove automation: Highwinds CDN (#3626) From ab0d4a95848b170ab7d524d3fd8ee7d0f436f750 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 28 Dec 2023 22:58:14 +0100 Subject: [PATCH 1701/3088] net/haproxy: bump version --- net/haproxy/Makefile | 5 ++--- net/haproxy/pkg-descr | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 14dccc7afa..7ea41d9365 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -1,8 +1,7 @@ PLUGIN_NAME= haproxy -PLUGIN_VERSION= 4.1 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 4.2 PLUGIN_COMMENT= Reliable, high performance TCP/HTTP load balancer -PLUGIN_DEPENDS= haproxy py${PLUGIN_PYTHON}-haproxy-cli +PLUGIN_DEPENDS= haproxy28 py${PLUGIN_PYTHON}-haproxy-cli PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index 8eb91e61da..f692d8110e 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -6,6 +6,8 @@ very high loads while needing persistence or Layer7 processing. Plugin Changelog ================ +4.2 + Added: * add support for built-in OCSP update feature * add support for forwarded header (RFC7239) @@ -13,12 +15,12 @@ Added: * add options for HTTP/2 performance tuning Fixed: -* fix typo in cert sync script +* fix SSL sync cron job (bulk sync was never working properly) Changed: * upgrade to HAProxy 2.8 release series (#3459) * change default for HTTP/2 to enabled (only new frontends/backends) -* add "no-alpn" option if HTTP/2 is not enabled (TLS-enabled frontends) +* add "no-alpn" option if HTTP/2 is not enabled (only TLS-enabled frontends) * move OCSP settings from "Service" to "Global" section * replace bundled haproxyctl library with haproxy-cli From d9a5fe0e05242534fb016aab89eb38dcae65f7b9 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 30 Dec 2023 14:37:08 -0500 Subject: [PATCH 1702/3088] dns/ddclient: Add Porkbun ddns support --- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../service/templates/OPNsense/ddclient/ddclient.conf | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index a3ae3beae5..ea00f4a7fc 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -75,6 +75,7 @@ nsupdate.info (IPv4) nsupdate.info (IPv6) OVHcloud DynHost + Porkbun regfish.de Servercow Sitelutions diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 5255b43ac9..bed35365b9 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -89,6 +89,10 @@ server=dyndns.strato.com, \ {% elif account.service == 'ovh' %} protocol=dyndns2, \ server=www.ovh.com, \ +{% elif account.service == 'porkbun' %} +protocol={{account.service}}, \ +apikey={{account.username}}, \ +secretapikey={{account.password}}, \ {% else %} protocol={{account.service}}, \ {% endif %} From 1f6e20f19780ed71cf7121ec481697ccb10f8828 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 30 Dec 2023 21:25:36 +0100 Subject: [PATCH 1703/3088] security/acme-client: support token authentication in Gandi LiveDNS, closes #3526 (#3740) --- security/acme-client/pkg-descr | 3 +++ .../OPNsense/AcmeClient/forms/dialogValidation.xml | 8 +++++++- .../OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php | 6 +++++- .../mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index f9bc03d723..41b68f69d4 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -15,6 +15,9 @@ Added: * add DNSExit DNS API (#3724) * add World4You DNS API (#3722) +Changed: +* support token authentication in Gandi LiveDNS (#3526) + Fixed: * fix 2FA support in Synology automation (#3627) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 382086ecae..7df74ee392 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -542,10 +542,16 @@ header + + validation.dns_gandi_livedns_token + + text + validation.dns_gandi_livedns_key - + text + The API Key is the previous mechanism that was replaced with Personal Access Tokens. API Keys should no longer be used. diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php index afebc94825..928cf65742 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsGandiLivedns.php @@ -39,6 +39,10 @@ class DnsGandiLivedns extends Base implements LeValidationInterface { public function prepare() { - $this->acme_env['GANDI_LIVEDNS_KEY'] = (string)$this->config->dns_gandi_livedns_key; + if (!empty((string)$this->config->dns_gandi_livedns_token)) { + $this->acme_env['GANDI_LIVEDNS_TOKEN'] = (string)$this->config->dns_gandi_livedns_token; + } else { + $this->acme_env['GANDI_LIVEDNS_KEY'] = (string)$this->config->dns_gandi_livedns_key; + } } } diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index b5339d9383..ae10ea3e19 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -683,6 +683,9 @@ N + + N + N From 88e0745a4624fb20ce73009a4d5414f0687e8081 Mon Sep 17 00:00:00 2001 From: Niklas Femerstrand Date: Sat, 30 Dec 2023 22:50:13 +0100 Subject: [PATCH 1704/3088] etpro_telemetry: Fixes unimplemented "insecure" sensor_info argument (#3737) --- .../src/opnsense/scripts/etpro_telemetry/sensor_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/etpro-telemetry/src/opnsense/scripts/etpro_telemetry/sensor_info.py b/security/etpro-telemetry/src/opnsense/scripts/etpro_telemetry/sensor_info.py index 9cec122d0c..762fa70d90 100755 --- a/security/etpro-telemetry/src/opnsense/scripts/etpro_telemetry/sensor_info.py +++ b/security/etpro-telemetry/src/opnsense/scripts/etpro_telemetry/sensor_info.py @@ -45,7 +45,7 @@ cnf = telemetry.get_config(args.config) if cnf.token is not None: try: - req = requests.get(args.endpoint, headers={'Authorization': 'Bearer %s' % cnf.token}) + req = requests.get(args.endpoint, headers={'Authorization': 'Bearer %s' % cnf.token}, verify=not args.insecure) if req.status_code == 200: response = ujson.loads(req.text) response['status'] = 'ok' From 9ff64a3e41428a2b23ae55846a5b92d498d47245 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 31 Dec 2023 13:28:12 +0100 Subject: [PATCH 1705/3088] net/wireguard - handle disabled carp vhid's by initialising to 'DISABLED'. closes https://github.com/opnsense/plugins/issues/3741 --- net/wireguard/Makefile | 2 +- .../src/opnsense/scripts/Wireguard/wg-service-control.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index ab8782ab78..032c929bf5 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.5 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index 0e09a98a60..b0cd9c13da 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -43,6 +43,7 @@ function get_vhid_status() foreach ((new OPNsense\Interfaces\Vip())->vip->iterateItems() as $id => $item) { if ($item->mode == 'carp') { $uuids[(string)$item->vhid] = $id; + $vhids[$id] = ['status' => 'DISABLED', 'vhid' => (string)$item->vhid]; } } foreach (legacy_interfaces_details() as $ifdata) { From c6e16e54f366dcb207f415818eac0b8cc7063da9 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 1 Jan 2024 17:14:09 +0100 Subject: [PATCH 1706/3088] net/firewall - add NPTv6 for https://github.com/opnsense/core/issues/6383 --- .../src/etc/inc/plugins.inc.d/pfplugin.inc | 3 + .../Firewall/Api/FilterBaseController.php | 40 +++++++++++ .../Firewall/Api/FilterController.php | 8 ++- .../OPNsense/Firewall/Api/NptController.php | 67 +++++++++++++++++++ .../Firewall/Api/SourceNatController.php | 8 ++- .../OPNsense/Firewall/NptController.php | 38 +++++++++++ .../Firewall/forms/dialogFilterRule.xml | 8 ++- .../OPNsense/Firewall/forms/dialogNptRule.xml | 40 +++++++++++ .../Firewall/forms/dialogSNatRule.xml | 7 ++ .../app/models/OPNsense/Firewall/Filter.xml | 55 +++++++++++++++ .../models/OPNsense/Firewall/Menu/Menu.xml | 3 + .../app/views/OPNsense/Firewall/filter.volt | 59 ++++++++++++++-- 12 files changed, 327 insertions(+), 9 deletions(-) create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/NptController.php create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/NptController.php create mode 100644 net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogNptRule.xml diff --git a/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc b/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc index cdb25a5de4..3c9aa2fceb 100644 --- a/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc +++ b/net/firewall/src/etc/inc/plugins.inc.d/pfplugin.inc @@ -42,4 +42,7 @@ function pfplugin_firewall($fw) foreach ($mdlFilter->snatrules->rule->sortedBy(["sequence"]) as $key => $rule) { $fw->registerSNatRule(50, $rule->serialize()); } + foreach ($mdlFilter->npt->rule->sortedBy(["sequence"]) as $key => $rule) { + $fw->registerNptRule(50, $rule->serialize()); + } } diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterBaseController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterBaseController.php index 789ae9a89e..3162d985f1 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterBaseController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterBaseController.php @@ -30,6 +30,7 @@ use OPNsense\Base\ApiMutableModelControllerBase; use OPNsense\Core\Backend; use OPNsense\Core\Config; +use OPNsense\Firewall\Category; /** * Class FilterBaseController implements actions for various types @@ -39,6 +40,45 @@ abstract class FilterBaseController extends ApiMutableModelControllerBase { protected static $internalModelName = 'filter'; protected static $internalModelClass = 'OPNsense\Firewall\Filter'; + protected static $categorysource = null; + + /** + * list categories and usage + * @return array + */ + public function listCategoriesAction() + { + $response = ['rows' => []]; + $catcount = []; + if (!empty(static::$categorysource)) { + $node = $this->getModel(); + foreach (explode('.', static::$categorysource) as $ref) { + $node = $node->$ref; + } + foreach ($node->iterateItems() as $item) { + if (!empty((string)$item->categories)) { + foreach (explode(',', (string)$item->categories) as $cat) { + if (!isset($catcount[$cat])) { + $catcount[$cat] = 0; + } + $catcount[$cat] += 1; + } + } + } + } + foreach ((new Category())->categories->category->iterateItems() as $key => $category) { + $response['rows'][] = [ + "uuid" => $key, + "name" => (string)$category->name, + "color" => (string)$category->color, + "used" => isset($catcount[$key]) ? $catcount[$key] : 0 + ]; + } + array_multisort(array_column($response['rows'], "name"), SORT_ASC, SORT_NATURAL, $response['rows']); + + return $response; + } + public function applyAction($rollback_revision = null) { diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php index 225a07b723..7af4676eb9 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/FilterController.php @@ -29,9 +29,15 @@ class FilterController extends FilterBaseController { + protected static $categorysource = "rules.rule"; + public function searchRuleAction() { - return $this->searchBase("rules.rule", array('enabled', 'sequence', 'description'), "sequence"); + $category = $this->request->get('category'); + $filter_funct = function ($record) use ($category) { + return empty($category) || array_intersect(explode(',', $record->categories), $category); + }; + return $this->searchBase("rules.rule", ['enabled', 'sequence', 'description'], "sequence", $filter_funct); } public function setRuleAction($uuid) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/NptController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/NptController.php new file mode 100644 index 0000000000..61b1d5705e --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/NptController.php @@ -0,0 +1,67 @@ +request->get('category'); + $filter_funct = function ($record) use ($category) { + return empty($category) || array_intersect(explode(',', $record->categories), $category); + }; + return $this->searchBase("npt.rule", ['enabled', 'sequence', 'description'], "sequence", $filter_funct); + } + + public function setRuleAction($uuid) + { + return $this->setBase("rule", "npt.rule", $uuid); + } + + public function addRuleAction() + { + return $this->addBase("rule", "npt.rule"); + } + + public function getRuleAction($uuid = null) + { + return $this->getBase("rule", "npt.rule", $uuid); + } + + public function delRuleAction($uuid) + { + return $this->delBase("npt.rule", $uuid); + } + + public function toggleRuleAction($uuid, $enabled = null) + { + return $this->toggleBase("npt.rule", $uuid, $enabled); + } +} diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php index 151bf14db6..5833225d96 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/SourceNatController.php @@ -29,9 +29,15 @@ class SourceNatController extends FilterBaseController { + protected static $categorysource = "snatrules.rule"; + public function searchRuleAction() { - return $this->searchBase("snatrules.rule", array('enabled', 'sequence', 'description'), "sequence"); + $category = $this->request->get('category'); + $filter_funct = function ($record) use ($category) { + return empty($category) || array_intersect(explode(',', $record->categories), $category); + }; + return $this->searchBase("snatrules.rule", ['enabled', 'sequence', 'description'], "sequence", $filter_funct); } public function setRuleAction($uuid) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/NptController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/NptController.php new file mode 100644 index 0000000000..07b1c7efda --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/NptController.php @@ -0,0 +1,38 @@ +view->pick('OPNsense/Firewall/filter'); + $this->view->ruleController = "npt"; + $this->view->formDialogFilterRule = $this->getForm("dialogNptRule"); + } +} diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml index f299cc1c42..af4cda9bcf 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogFilterRule.xml @@ -99,7 +99,13 @@ checkbox Log packets that are handled by this rule - + + rule.categories + + select_multiple + + For grouping purposes you may select multiple groups here to organize items. + rule.description diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogNptRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogNptRule.xml new file mode 100644 index 0000000000..abfe782dfd --- /dev/null +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogNptRule.xml @@ -0,0 +1,40 @@ +
    + + rule.enabled + + checkbox + Enable this rule + + + rule.sequence + + text + + + rule.interface + + dropdown + + + rule.source_net + + text + + + rule.destination_net + + text + + + rule.categories + + select_multiple + + For grouping purposes you may select multiple groups here to organize items. + + + rule.description + + text + +
    diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogSNatRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogSNatRule.xml index 0c87b04503..90dc7a90ba 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogSNatRule.xml +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogSNatRule.xml @@ -86,6 +86,13 @@ checkbox Log packets that are handled by this rule
    + + rule.categories + + select_multiple + + For grouping purposes you may select multiple groups here to organize items. + rule.description diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index 65262b536f..ca30b9f982 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -100,6 +100,17 @@ 0 Y + + + + OPNsense.Firewall.Category + categories.category + name + + + Y + Related category not found. + N /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u @@ -184,6 +195,17 @@ 0 Y + + + + OPNsense.Firewall.Category + categories.category + name + + + Y + Related category not found. + N /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u @@ -191,5 +213,38 @@ + + + + 1 + Y + + + Y + lan + Y + + + Y + + + + + + OPNsense.Firewall.Category + categories.category + name + + + Y + Related category not found. + + + N + /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){0,255}$/u + Description should be a string between 1 and 255 characters + + +
    diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml index 2889f9bff0..476e1f38b8 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Menu/Menu.xml @@ -7,6 +7,9 @@ + + + diff --git a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt index 567eff3362..34622514c9 100644 --- a/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt +++ b/net/firewall/src/opnsense/mvc/app/views/OPNsense/Firewall/filter.volt @@ -2,12 +2,47 @@ $( document ).ready(function() { let initial_load = true; let grid = $("#grid-rules").UIBootgrid({ - search:'/api/firewall/{{ruleController}}/searchRule/', - get:'/api/firewall/{{ruleController}}/getRule/', - set:'/api/firewall/{{ruleController}}/setRule/', - add:'/api/firewall/{{ruleController}}/addRule/', - del:'/api/firewall/{{ruleController}}/delRule/', - toggle:'/api/firewall/{{ruleController}}/toggleRule/' + search:'/api/firewall/{{ruleController}}/search_rule/', + get:'/api/firewall/{{ruleController}}/get_rule/', + set:'/api/firewall/{{ruleController}}/set_rule/', + add:'/api/firewall/{{ruleController}}/add_rule/', + del:'/api/firewall/{{ruleController}}/del_rule/', + toggle:'/api/firewall/{{ruleController}}/toggle_rule/', + options:{ + requestHandler: function(request){ + if ( $('#category_filter').val().length > 0) { + request['category'] = $('#category_filter').val(); + } + return request; + } + } + }); + grid.on("loaded.rs.jquery.bootgrid", function (e){ + // reload categories before grid load + ajaxCall('/api/firewall/{{ruleController}}/list_categories', {}, function(data, status){ + if (data.rows !== undefined) { + let current_selection = $("#category_filter").val(); + $("#category_filter").empty(); + for (i=0; i < data.rows.length ; ++i) { + let row = data.rows[i]; + let opt_val = $('
    ').html(row.name).text(); + let bgcolor = row.color != "" ? row.color : '31708f;'; // set category color + let option = $("
    From e1ce22a52003a83a96c36d53cb3c58f9144c8f67 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Jan 2024 08:20:23 +0100 Subject: [PATCH 1719/3088] Framework: allow phony `plist-fix' target for core compat --- Makefile | 4 ++-- Mk/plugins.mk | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 865656059a..d6aebe498c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2023 Franco Fichtner +# Copyright (c) 2015-2024 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -44,7 +44,7 @@ list: .endfor # shared targets that are sane to run from the root directory -TARGETS= clean lint revision style style-fix style-python sweep test +TARGETS= clean lint plist-fix revision style style-fix style-python sweep test .for TARGET in ${TARGETS} ${TARGET}: diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 3481c34de5..2b3b9cb7ce 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2023 Franco Fichtner +# Copyright (c) 2015-2024 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -377,6 +377,8 @@ lint-php: check lint: lint-desc lint-shell lint-xml lint-model lint-exec lint-php +plist-fix: + sweep: check find ${.CURDIR}/src -type f -name "*.map" -print0 | \ xargs -0 -n1 rm @@ -439,4 +441,4 @@ test: check ${.CURDIR}/src/opnsense/mvc/tests; \ fi -.PHONY: check +.PHONY: check plist-fix From e4ec51fd3521ea4a33888a294bcf605844325f39 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Jan 2024 08:20:50 +0100 Subject: [PATCH 1720/3088] LICENSE: sync --- LICENSE | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 54c5ba4521..dd377bc74a 100644 --- a/LICENSE +++ b/LICENSE @@ -3,6 +3,7 @@ Copyright (c) 2022 agh1467 Copyright (c) 2021 Alexander Noack Copyright (c) 2021 Andreas Stuerz Copyright (c) 2021 Axelrtgs +Copyright (c) 2023 Bernhard Frenking Copyright (c) 2023 Cannon Matthews Copyright (c) 2019 Cloudfence - Julio Camargo (JCC) Copyright (c) 2005-2006 Colin Smith @@ -19,7 +20,7 @@ Copyright (c) 2008-2010 Ermal Luçi Copyright (c) 2016-2019 EURO-LOG AG Copyright (c) 2017-2020 Fabian Franz Copyright (c) 2019 Felix Matouschek -Copyright (c) 2014-2023 Franco Fichtner +Copyright (c) 2014-2024 Franco Fichtner Copyright (c) 2016-2023 Frank Wall Copyright (c) 2021 Github-jjw Copyright (c) 2023 Greg Glockner @@ -30,6 +31,7 @@ Copyright (c) 2010 Jim Pingle Copyright (c) 2015 Jos Schellevis Copyright (c) 2018 João Vilaça Copyright (c) 2019-2022 Juergen Kellerer +Copyright (c) 2023 Liam Steckler Copyright (c) 2020-2021 Manuel Faux Copyright (c) 2021 Manuel Hofmann Copyright (c) 2003-2004 Manuel Kasper @@ -41,12 +43,14 @@ Copyright (c) 2020 Martin Wasley Copyright (c) 2022 Marvo2011 Copyright (c) 2017-2021 Michael Muenz Copyright (c) 2012 mkirbst +Copyright (c) 2023 mleinart Copyright (c) 2021 Nicola Pellegrini Copyright (c) 2022 Nikolaj Brinch Jørgensen Copyright (c) 2021 Nim G Copyright (c) 2023 Oliver Hartl Copyright (c) 2022 Patrik Kernstock Copyright (c) 2022 Robbert Rijkse +Copyright (c) 2023 sattamjh Copyright (c) 2004-2012 Scott Ullrich Copyright (c) 2010 Seth Mos Copyright (c) 2008 Shrew Soft Inc. From e8a83cb4cda4a90805e18652711d5ec8afbd8991 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Jan 2024 08:50:42 +0100 Subject: [PATCH 1721/3088] net/firewall: style update --- .../src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php | 1 - 1 file changed, 1 deletion(-) diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php index 98edce4fd3..310a65a23a 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -105,7 +105,6 @@ public function performValidation($validateFullModel = false) $rule->source_net->__reference )); } - } } return $messages; From 6143ea9bf709abb52eed422c1b7ff0a84fa673f7 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 4 Jan 2024 08:52:09 +0100 Subject: [PATCH 1722/3088] net-mgmt/nrpe: improve changelog --- net-mgmt/nrpe/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-mgmt/nrpe/pkg-descr b/net-mgmt/nrpe/pkg-descr index 787e80023b..4f74afccd5 100644 --- a/net-mgmt/nrpe/pkg-descr +++ b/net-mgmt/nrpe/pkg-descr @@ -13,4 +13,4 @@ Plugin Changelog: 1.1 -* Make plugin compatbile with nrpe (v4) +* Make plugin compatible with NRPE version 4 From ab8853c434d85563c6807437a36f59fd490b9eb9 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 4 Jan 2024 11:59:31 +0100 Subject: [PATCH 1723/3088] net/firewall - NPTv6 add track interface and validations for https://github.com/opnsense/core/issues/6383 --- .../OPNsense/Firewall/Api/NptController.php | 2 +- .../OPNsense/Firewall/NptController.php | 3 +++ .../OPNsense/Firewall/forms/dialogNptRule.xml | 13 +++++++++++++ .../app/models/OPNsense/Firewall/Filter.php | 18 +++++++++++++----- .../app/models/OPNsense/Firewall/Filter.xml | 6 ++++++ 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/NptController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/NptController.php index 1f8f4819e0..9b04139d2e 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/NptController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/NptController.php @@ -39,7 +39,7 @@ public function searchRuleAction() }; return $this->searchBase( "npt.rule", - ['enabled', 'sequence', 'source_net', 'destination_net', 'description'], + ['enabled', 'sequence', 'source_net', 'destination_net', 'trackif', 'description'], "sequence", $filter_funct ); diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/NptController.php b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/NptController.php index 50661eaae7..0e69ca4fe3 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/NptController.php +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/NptController.php @@ -47,6 +47,9 @@ public function indexAction() [ 'id' => 'destination_net', 'heading' => gettext('External IPv6 Prefix') ], + [ + 'id' => 'trackif', 'heading' => gettext('Track if') + ], [ 'id' => 'description', 'heading' => gettext('Description') ] diff --git a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogNptRule.xml b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogNptRule.xml index 051dc40613..4c68b0e40b 100644 --- a/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogNptRule.xml +++ b/net/firewall/src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogNptRule.xml @@ -10,6 +10,12 @@ text + + rule.log + + checkbox + Log packets that are handled by this rule + rule.interface @@ -24,6 +30,13 @@ rule.destination_net text + Enter the external IPv6 prefix for this network prefix translation. Leave empty to auto-detect the prefix address using the specified tracking interface instead. The prefix size specified for the internal prefix will also be applied to the external prefix. + + + rule.trackif + + dropdown + Use prefix defined on the selected interface instead of the interface this rule applies to when target prefix is not provided. rule.categories diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php index 310a65a23a..6ca0fd4e68 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php @@ -97,14 +97,22 @@ public function performValidation($validateFullModel = false) } foreach ($this->npt->rule->iterateItems() as $rule) { if ($validateFullModel || $rule->isFieldChanged()) { - $src_is_addr = Util::isSubnet($rule->source_net) || Util::isIpAddress($rule->source_net); - $src_proto = strpos($rule->source_net, ':') === false ? "inet" : "inet6"; - if ($src_is_addr && $src_proto != 'inet6') { + if (!empty((string)$rule->destination_net) && !empty((string)$rule->trackif)) { $messages->appendMessage(new Message( - gettext("You can not use IPv4 addresses in IPv6 rules."), - $rule->source_net->__reference + gettext("A track interface is only allowed without an extrenal prefix."), + $rule->trackif->__reference )); } + if (!empty((string)$rule->destination_net) && !empty((string)$rule->source_net)) { + $dparts = explode('/', (string)$rule->destination_net); + $sparts = explode('/', (string)$rule->source_net); + if (count($dparts) == 2 && count($sparts) == 2 && $dparts[1] != $sparts[1]) { + $messages->appendMessage(new Message( + gettext("External subnet should match internal subnet."), + $rule->destination_net->__reference + )); + } + } } } return $messages; diff --git a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml index e18a1caa71..3e93bded07 100644 --- a/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml +++ b/net/firewall/src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml @@ -219,6 +219,10 @@ 1 Y
    + + 0 + Y + 1 99999 @@ -242,6 +246,8 @@ Y N + + From f7837735ede0fd4c377a8c18cefe550ccc32bea9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 6 Jan 2024 16:36:53 +0100 Subject: [PATCH 1724/3088] security/acme-client: use common function to run shell commands --- .../library/OPNsense/AcmeClient/LeAccount.php | 68 +++++-------------- .../OPNsense/AcmeClient/LeAutomation/Base.php | 28 ++------ .../OPNsense/AcmeClient/LeCertificate.php | 63 ++++------------- .../library/OPNsense/AcmeClient/LeUtils.php | 6 +- .../OPNsense/AcmeClient/LeValidation/Base.php | 33 +++------ 5 files changed, 49 insertions(+), 149 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAccount.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAccount.php index 94a91008d7..1186dbccb5 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAccount.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAccount.php @@ -1,7 +1,7 @@ config->name, $this->debug); + // Preparation to run acme client - $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env = $this->acme_env; // add env variables $proc_env['PATH'] = $this::ACME_ENV_PATH; - $proc_desc = array( // descriptor array for proc_open() - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - 2 => array("pipe", "w") // stderr - ); - $proc_pipes = array(); - - // Run acme client to generate a account key + + // Prepare acme.sh command to generate a account key $acmecmd = '/usr/local/sbin/acme.sh ' . '--createAccountKey ' . implode(' ', $this->acme_args) . ' ' . LeUtils::execSafe('--accountkeylength %s', self::ACME_ACCOUNT_KEY_LENGTH) . ' ' . LeUtils::execSafe('--accountconf %s', $account_conf_file); LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); - $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); - - // Make sure the resource could be setup properly - if (is_resource($proc)) { - // Close all pipes - fclose($proc_pipes[0]); - fclose($proc_pipes[1]); - fclose($proc_pipes[2]); - // Get exit code - $result = proc_close($proc); - } else { - LeUtils::log_error('unable to start acme client process'); - $this->setStatus(500); - return false; - } - // Check exit code + // Run acme.sh command + $result = LeUtils::run_shell_command($acmecmd, $proc_env); + + // Check acme.sh result if ($result) { LeUtils::log_error('failed to create a new account key for ' . (string)$this->config->name); $this->setStatus(300); @@ -220,38 +204,20 @@ public function register() } // Preparation to run acme client - $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env = $this->acme_env; // add env variables $proc_env['PATH'] = $this::ACME_ENV_PATH; - $proc_desc = array( // descriptor array for proc_open() - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - 2 => array("pipe", "w") // stderr - ); - $proc_pipes = array(); - - // Run acme client + + // Prepare acme.sh command to register an account $acmecmd = '/usr/local/sbin/acme.sh ' . '--registeraccount ' . implode(' ', $this->acme_args) . ' ' . LeUtils::execSafe('--accountconf %s', $this->account_conf_file); LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); - $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); - - // Make sure the resource could be setup properly - if (is_resource($proc)) { - // Close all pipes - fclose($proc_pipes[0]); - fclose($proc_pipes[1]); - fclose($proc_pipes[2]); - // Get exit code - $result = proc_close($proc); - } else { - LeUtils::log_error('unable to start acme client process'); - $this->setStatus(500); - return false; - } - // Check validation result + // Run acme.sh command + $result = LeUtils::run_shell_command($acmecmd, $proc_env); + + // Check acme.sh result if ($result) { LeUtils::log_error('account registration failed for ' . $this->config->name); $this->setStatus(400); diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php index 4f79aa4712..fc31195802 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeAutomation/Base.php @@ -1,7 +1,7 @@ * All rights reserved. @@ -120,16 +120,10 @@ public function runAcme() LeUtils::log('running automation (acme.sh): ' . $this->config->name); // Preparation to run acme client - $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env = $this->acme_env; // add env variables $proc_env['PATH'] = $this::ACME_ENV_PATH; - $proc_desc = array( // descriptor array for proc_open() - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - 2 => array("pipe", "w") // stderr - ); - $proc_pipes = array(); - - // Run acme client + + // Prepare acme.sh command to run a deploy hook $acmecmd = self::ACME_CMD . ' ' . '--deploy ' @@ -137,18 +131,8 @@ public function runAcme() LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); - // Make sure the resource could be setup properly - if (is_resource($proc)) { - // Close all pipes - fclose($proc_pipes[0]); - fclose($proc_pipes[1]); - fclose($proc_pipes[2]); - // Get exit code - $result = proc_close($proc); - } else { - LeUtils::log_error('unable to start acme client process'); - return false; - } + // Run acme.sh command + $result = LeUtils::run_shell_command($acmecmd, $proc_env); // acme.sh records the last used deploy hook and would automatically // use it on the next run. This information must be removed from the diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index 06e406b579..bf16c5fb54 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -1,7 +1,7 @@ config->name); // Preparation to run acme client - $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env = $this->acme_env; // add env variables $proc_env['PATH'] = $this::ACME_ENV_PATH; - $proc_desc = array( // descriptor array for proc_open() - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - 2 => array("pipe", "w") // stderr - ); - $proc_pipes = array(); - - // Run acme client to remove certificate and related config + + // Prepare acme.sh command to remove certificate and related config $acmecmd = '/usr/local/sbin/acme.sh ' . '--remove ' . implode(' ', $this->acme_args) . ' ' . LeUtils::execSafe('--domain %s', (string)$this->config->name); LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); - $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); - - // Make sure the resource could be setup properly - if (is_resource($proc)) { - // Close all pipes - fclose($proc_pipes[0]); - fclose($proc_pipes[1]); - fclose($proc_pipes[2]); - // Get exit code - $result = proc_close($proc); - } else { - LeUtils::log_error('unable to start acme client process'); - return false; - } - // Check exit code + // Run acme.sh command + $result = LeUtils::run_shell_command($acmecmd, $proc_env); + + // Check acme.sh result if ($result) { LeUtils::log_error('error removing certificate ' . (string)$this->config->name); return false; @@ -565,36 +549,19 @@ public function revoke() $account_conf_file = $account_conf_dir . '/account.conf'; // Preparation to run acme client - $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env = $this->acme_env; // add env variables $proc_env['PATH'] = $this::ACME_ENV_PATH; - $proc_desc = array( // descriptor array for proc_open() - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - 2 => array("pipe", "w") // stderr - ); - $proc_pipes = array(); - - // Run acme client to revoke certificate + + // Prepare acme.sh command to revoke certificate $acmecmd = '/usr/local/sbin/acme.sh ' . '--revoke ' . implode(' ', $this->acme_args) . ' ' . LeUtils::execSafe('--domain %s', (string)$this->config->name) . ' ' . LeUtils::execSafe('--accountconf %s', $account_conf_file); LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); - $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); - - // Make sure the resource could be setup properly - if (is_resource($proc)) { - // Close all pipes - fclose($proc_pipes[0]); - fclose($proc_pipes[1]); - fclose($proc_pipes[2]); - // Get exit code - $result = proc_close($proc); - } else { - LeUtils::log_error('unable to start acme client process'); - return false; - } + + // Run acme.sh command + $result = LeUtils::run_shell_command($acmecmd, $proc_env); // Check exit code if ($result) { diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php index ab4d46c85b..f7c497c78c 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php @@ -1,7 +1,7 @@ * Copyright (C) 2008 Shrew Soft Inc. @@ -200,11 +200,11 @@ public static function run_shell_command($proc_cmd, $proc_env = array()) fclose($proc_pipes[2]); // Get exit code $result = proc_close($proc); - log_error(sprintf("AcmeClient: The shell command '%s' returned exit code '%d'", $proc_cmd, $result)); + log_error(sprintf("AcmeClient: The shell command returned exit code '%d': '%s'", $result, $proc_cmd)); return($result); } else { log_error(sprintf("AcmeClient: Unable to prepare shell command '%s'", $proc_cmd)); - return false; + return(-999); } } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php index b516343d67..1af7c8dfe1 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/Base.php @@ -1,7 +1,7 @@ * All rights reserved. @@ -154,16 +154,10 @@ public function run(bool $renew = false) $account_conf_file = $account_conf_dir . '/account.conf'; // Preparation to run acme client - $proc_env = $this->acme_env; // env variables for proc_open() + $proc_env = $this->acme_env; // add env variables $proc_env['PATH'] = $this::ACME_ENV_PATH; - $proc_desc = array( // descriptor array for proc_open() - 0 => array("pipe", "r"), // stdin - 1 => array("pipe", "w"), // stdout - 2 => array("pipe", "w") // stderr - ); - $proc_pipes = array(); - - // Run acme client + + // Prepare acme.sh command // NOTE: We "export" certificates to our own directory, so we don't have to deal // with domain names in filesystem, but instead can use the ID of our certObj, which // will never change. @@ -173,25 +167,14 @@ public function run(bool $renew = false) . implode(' ', $this->acme_args) . ' ' . LeUtils::execSafe('--accountconf %s', $account_conf_file); LeUtils::log_debug('running acme.sh command: ' . (string)$acmecmd, $this->debug); - $proc = proc_open($acmecmd, $proc_desc, $proc_pipes, null, $proc_env); - - // Make sure the resource could be setup properly - if (is_resource($proc)) { - // Close all pipes - fclose($proc_pipes[0]); - fclose($proc_pipes[1]); - fclose($proc_pipes[2]); - // Get exit code - $result = proc_close($proc); - } else { - LeUtils::log_error('unable to start acme client process'); - return false; - } + + // Run acme.sh command + $result = LeUtils::run_shell_command($acmecmd, $proc_env); // Run optional cleanup tasks. $this->cleanup(); - // Check validation result + // Check acme.sh result if ($result) { LeUtils::log_error('domain validation failed (' . $this->getMethod() . ')'); return false; From 9d8564c8554ea3299ea8884b8b243c675718827b Mon Sep 17 00:00:00 2001 From: Mathias Schneuwly Date: Sat, 6 Jan 2024 17:40:38 +0100 Subject: [PATCH 1725/3088] Add Digitalocean ddns support (#3748) --- .../mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml | 2 +- .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 1 + .../opnsense/service/templates/OPNsense/ddclient/ddclient.conf | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml index 12aedb288a..f0e889a1c8 100644 --- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml +++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml @@ -62,7 +62,7 @@ account.zone text - + Zone containing the host entry. diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index ea00f4a7fc..3416fdf40a 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -46,6 +46,7 @@ Changeip Cloudflare ClouDNS + Digitalocean dinahosting DNS Made Easy (digicert) DNS-O-Matic diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index bed35365b9..333d478a83 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -36,7 +36,7 @@ use=cmd, cmd="/usr/local/opnsense/scripts/ddclient/checkip -t {{account.force_ss {% if account.service == 'custom' %} protocol={{account.protocol}}, \ server={{account.server}}, \ -{% elif account.service == 'cloudflare' %} +{% elif account.service in ['cloudflare', 'digitalocean'] %} protocol={{account.service}}, \ zone={{account.zone}}, \ {% elif account.service == 'cloudns' %} From 580300c9b218e5810d7d9167c8aa2f17425e7145 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 7 Jan 2024 21:07:54 +0100 Subject: [PATCH 1726/3088] net/firewall: not for 24.1 anymore --- net/firewall/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net/firewall/Makefile b/net/firewall/Makefile index 6293ad1b5b..eec978a634 100644 --- a/net/firewall/Makefile +++ b/net/firewall/Makefile @@ -2,6 +2,7 @@ PLUGIN_NAME= firewall PLUGIN_VERSION= 1.4 PLUGIN_REVISION= 3 PLUGIN_COMMENT= Firewall API supplemental package +PLUGIN_OBSOLETE= yes PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_TIER= 2 From ff1ffbdf320ca54ab40d1689c5e366ae6eecb688 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 7 Jan 2024 21:08:46 +0100 Subject: [PATCH 1727/3088] README: sync --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5da2442d40..197bce5a2e 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ misc/theme-rebellion -- A suitably dark theme misc/theme-tukan -- The tukan theme - blue/white misc/theme-vicuna -- The vicuna theme - blue sapphire net/chrony -- Chrony time synchronisation -net/firewall -- Firewall API supplemental package +net/firewall -- Firewall API supplemental package (pending removal) net/freeradius -- RADIUS Authentication, Authorization and Accounting Server net/frr -- The FRRouting Protocol Suite net/ftp-proxy -- Control ftp-proxy processes From 89c9255d38bd58ec10271d1bce8699b74fc2db98 Mon Sep 17 00:00:00 2001 From: Jonatan Date: Mon, 8 Jan 2024 16:07:42 +0100 Subject: [PATCH 1728/3088] sysutils/node_exporter: Allow setting IPv6 address as Listen Address (#3707) * Node Exporter: Allow setting IPv6 listenaddress * Node Exporter: Change IntegerField to PortField * Node Exporter: Increment version and add changelog --- sysutils/node_exporter/Makefile | 2 +- sysutils/node_exporter/pkg-descr | 4 ++++ .../mvc/app/models/OPNsense/NodeExporter/General.xml | 12 +++++------- .../templates/OPNsense/NodeExporter/node_exporter | 8 +++++++- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/sysutils/node_exporter/Makefile b/sysutils/node_exporter/Makefile index 985de5c2e2..bb52769b48 100644 --- a/sysutils/node_exporter/Makefile +++ b/sysutils/node_exporter/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= node_exporter -PLUGIN_VERSION= 1.1 +PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= Prometheus exporter for machine metrics PLUGIN_DEPENDS= node_exporter PLUGIN_MAINTAINER= jkegh@k123.eu diff --git a/sysutils/node_exporter/pkg-descr b/sysutils/node_exporter/pkg-descr index 16c736a183..862f318098 100644 --- a/sysutils/node_exporter/pkg-descr +++ b/sysutils/node_exporter/pkg-descr @@ -7,6 +7,10 @@ WWW: https://github.com/prometheus/node_exporter Changelog --------- +1.2 + +* Allow setting IPv6 addresses as ListenAddress + 1.1 * Allow to toggle the "zfs" collector diff --git a/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml b/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml index c47915f10b..4f1d24539d 100644 --- a/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml +++ b/sysutils/node_exporter/src/opnsense/mvc/app/models/OPNsense/NodeExporter/General.xml @@ -3,23 +3,21 @@ node_exporter - Prometheus exporter for hardware and OS metrics. - 0.1.0 + 0.2.0 0 Y - + 0.0.0.0 Y - /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-4]|2[0-5][0-9]|[01]?[0-9][0-9]?)$/ - Please provide a valid IPv4 address. + N + Please provide a valid IP address. - + 9100 Y - 1 - 65535 Please provide a valid port number between 1 and 65535. Port 9100 is the default. diff --git a/sysutils/node_exporter/src/opnsense/service/templates/OPNsense/NodeExporter/node_exporter b/sysutils/node_exporter/src/opnsense/service/templates/OPNsense/NodeExporter/node_exporter index a5d3b02fcc..e7ea96fbc6 100644 --- a/sysutils/node_exporter/src/opnsense/service/templates/OPNsense/NodeExporter/node_exporter +++ b/sysutils/node_exporter/src/opnsense/service/templates/OPNsense/NodeExporter/node_exporter @@ -46,8 +46,14 @@ {%- set zfs = no_collector + "zfs " -%} {%- endif -%} +{%- if ':' in OPNsense.NodeExporter.listenaddress -%} + {%- set listenaddress = '[' + OPNsense.NodeExporter.listenaddress + ']' -%} +{%- else -%} + {%- set listenaddress = OPNsense.NodeExporter.listenaddress -%} +{%- endif -%} + node_exporter_args="{{ cpu }}{{ exec }}{{ filesystem }}{{ loadavg }}{{ meminfo }}{{ netdev }}{{ ntp }}{{ time }}{{ devstat }}{{ zfs }}" -node_exporter_listen_address="{{ OPNsense.NodeExporter.listenaddress }}:{{ OPNsense.NodeExporter.listenport }}" +node_exporter_listen_address="{{ listenaddress }}:{{ OPNsense.NodeExporter.listenport }}" node_exporter_enable="YES" {%- else -%} From e6742e3169ff269120ca39abff7ea2758218312a Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sat, 6 Jan 2024 17:40:41 +0100 Subject: [PATCH 1729/3088] security/acme-client: fix command failure with gcloud, refs #3745 --- security/acme-client/pkg-descr | 3 +++ .../mvc/app/library/OPNsense/AcmeClient/LeUtils.php | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 41b68f69d4..bfec3433cf 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,9 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +Fixed: +* fix sporadic command failure with gcloud DNS API (#3745) + 3.20 Added: diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php index f7c497c78c..cca7ce55ed 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeUtils.php @@ -194,10 +194,19 @@ public static function run_shell_command($proc_cmd, $proc_env = array()) // Make sure the resource could be setup properly if (is_resource($proc)) { - // Close all pipes + // This workaround ensures that the accurate return code + // is reliably returned. fclose($proc_pipes[0]); + $output = array(); + while (!feof($proc_pipes[1])) { + $output[] = rtrim(fgets($proc_pipes[1], 1024), "\n"); + } fclose($proc_pipes[1]); + while (!feof($proc_pipes[2])) { + $output[] = rtrim(fgets($proc_pipes[2], 1024), "\n"); + } fclose($proc_pipes[2]); + // Get exit code $result = proc_close($proc); log_error(sprintf("AcmeClient: The shell command returned exit code '%d': '%s'", $result, $proc_cmd)); From d92bb27d87dc2d0f1c441aa04651204ce37b37b7 Mon Sep 17 00:00:00 2001 From: Greg Glockner Date: Tue, 9 Jan 2024 08:25:05 -0800 Subject: [PATCH 1730/3088] Fix crash on ACME automations (#3752) --- .../library/OPNsense/AcmeClient/LeCertificate.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php index bf16c5fb54..1776518535 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeCertificate.php @@ -598,10 +598,14 @@ public function runAutomations() foreach ($automations as $auto_uuid) { $autoFactory = new LeAutomationFactory(); $automation = $autoFactory->getAutomation($auto_uuid); - $automation->init($this->getId(), (string)$this->config->name, (string)$this->config->account, $this->cert_ecc); - // Ignore invalid automations. - if ($automation->prepare()) { - $automation->run(); + // Skip invalid automations. + if (!is_null($automation)) { + $automation->init($this->getId(), (string)$this->config->name, (string)$this->config->account, $this->cert_ecc); + if ($automation->prepare()) { + $automation->run(); + } + } else { + LeUtils::log_error("ignoring invalid automation: ${auto_uuid}"); } } From cfac344e4a6382936d0393e42c916cc615fe48f5 Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:33:44 +0300 Subject: [PATCH 1731/3088] dns/bind: check&preview primary zone, log to syslog with desired severity (#3708) * dns/bind: check&preview primary zone, log to syslog with desired severity and make grids responsive also * ver bump and remove foreign part from template * Update dns/bind/src/etc/inc/plugins.inc.d/bind.inc * Update dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml * cleanup -prettify js, actions naming, phalcon post payload handling. -Error message if Check&Preview button clicked for disabled Zone -dont show Copy button if not supported --------- Co-authored-by: Franco Fichtner --- dns/bind/Makefile | 3 +- dns/bind/pkg-descr | 5 + dns/bind/src/etc/inc/plugins.inc.d/bind.inc | 13 + .../OPNsense/Bind/Api/GeneralController.php | 23 + .../OPNsense/Bind/forms/general.xml | 9 +- .../mvc/app/models/OPNsense/Bind/General.xml | 16 +- .../mvc/app/views/OPNsense/Bind/general.volt | 431 ++++++++++++------ .../mvc/app/views/OPNsense/Bind/logs.volt | 41 +- .../scripts/OPNsense/Bind/zoneCheck.sh | 14 + .../scripts/OPNsense/Bind/zoneShow.py | 27 ++ .../service/conf/actions.d/actions_bind.conf | 10 + .../templates/OPNsense/Bind/named.conf | 15 +- .../OPNsense/Syslog/local/named.conf | 6 + 13 files changed, 438 insertions(+), 175 deletions(-) create mode 100644 dns/bind/src/opnsense/scripts/OPNsense/Bind/zoneCheck.sh create mode 100644 dns/bind/src/opnsense/scripts/OPNsense/Bind/zoneShow.py create mode 100644 dns/bind/src/opnsense/service/templates/OPNsense/Syslog/local/named.conf diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 8717b2f01d..773381a4c8 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.28 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.29 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind918 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 500ed4c02a..160e424f59 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -10,6 +10,11 @@ WWW: https://www.isc.org Plugin Changelog ================ +1.29 + +* Migrate General Log to Syslog +* Add Check & Preview button to Primary Zones grid + 1.28 * Add break-dnssec toggle when using filter-aaaa on IPv4/IPv6 clients (contributed by doktornotor) diff --git a/dns/bind/src/etc/inc/plugins.inc.d/bind.inc b/dns/bind/src/etc/inc/plugins.inc.d/bind.inc index 627e108083..e1d8b1b2cf 100644 --- a/dns/bind/src/etc/inc/plugins.inc.d/bind.inc +++ b/dns/bind/src/etc/inc/plugins.inc.d/bind.inc @@ -99,3 +99,16 @@ function bind_configure_do($verbose) service_log("done.\n", $verbose); } + +/** + * register syslog facilities + * @return array + */ +function bind_syslog() +{ + $syslogconf = []; + + $syslogconf['bind'] = ['facility' => ['named']]; + + return $syslogconf; +} diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/GeneralController.php b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/GeneralController.php index d712f7fde9..cbcb0e7c28 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/GeneralController.php +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/Api/GeneralController.php @@ -31,9 +31,32 @@ namespace OPNsense\Bind\Api; use OPNsense\Base\ApiMutableModelControllerBase; +use OPNsense\Core\Backend; class GeneralController extends ApiMutableModelControllerBase { protected static $internalModelClass = '\OPNsense\Bind\General'; protected static $internalModelName = 'general'; + + public function zonetestAction($zonename = null) + { + $response = "request error"; + if ($this->request->hasPost("zone")) { + $zonename = $this->request->getPost("zone"); + $backend = new Backend(); + $response = trim($backend->configdpRun("bind zone check", [$zonename])); + } + return array("response" => $response); + } + + public function zoneshowAction($zonename = null) + { + $response = "request error"; + if ($this->request->hasPost("zone")) { + $zonename = $this->request->getPost("zone"); + $backend = new Backend(); + $response = json_decode($backend->configdpRun("bind zone show", [$zonename]), true); + } + return $response; + } } diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml index 52929b3ef0..5be009dac0 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml @@ -93,7 +93,14 @@ general.logsize text - Set the amount how big a logfile can growth. + Set the amount how big a logfile can growth. For Query and Blocked logs. + + + general.general_log_level + + + dropdown + Select General Log level. Log levels are listed in the order of increasing verbosity. Setting a certain log level will cause all messages of the specified and more severe log levels to be logged. general.maxcachesize diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml index 35e193df39..8ab42f3c62 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml @@ -1,7 +1,7 @@ //OPNsense/bind/general BIND configuration - 1.0.10 + 1.0.11 0 @@ -76,6 +76,20 @@ 1000 Choose a value between 1 and 1000. + + + Emergency + Alert + Critical + Error + Warning + Notice + Informational + Debug + + Y + info + 80 Y diff --git a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt index e29bc64346..0649c0eb2c 100644 --- a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt +++ b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt @@ -53,28 +53,30 @@
    - - - - - - - - - - - - - - - - - - -
    {{ lang._('Enabled') }}{{ lang._('Name') }}{{ lang._('Networks') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    - - -
    +
    + + + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Name') }}{{ lang._('Networks') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    + + +
    +

    @@ -85,44 +87,46 @@

    {{ lang._('Zones') }}

    - - - - - - - - - - - - - - - - - - - - - - -
    {{ lang._('Enabled') }}{{ lang._('Zone') }}{{ lang._('TTL') }}{{ lang._('Refresh') }}{{ lang._('Retry') }}{{ lang._('Expire') }}{{ lang._('Negative TTL') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    - -
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Zone') }}{{ lang._('TTL') }}{{ lang._('Refresh') }}{{ lang._('Retry') }}{{ lang._('Expire') }}{{ lang._('Negative TTL') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    + +
    +

    -
    -
    -

    {{ lang._('Records') }}

    -
    - +
    +

    {{ lang._('Records') }}

    +
    +
    +
    - + @@ -153,27 +157,29 @@

    {{ lang._('Zones') }}

    -
    {{ lang._('Enabled') }} {{ lang._('Zone') }} {{ lang._('Name') }} {{ lang._('Type') }}{{ lang._('Value') }}{{ lang._('Value') }} {{ lang._('ID') }} {{ lang._('Commands') }}
    - - - - - - - - - - - - - - - - - -
    {{ lang._('Enabled') }}{{ lang._('Zone') }}{{ lang._('Primary IPs') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    - -
    +
    + + + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Zone') }}{{ lang._('Primary IPs') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    + +
    +

    - +
    diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py index 2fc795ab44..da949afefb 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py @@ -32,7 +32,7 @@ def run_service_command(action, action_message): result = {"message": action_message} - + if action == "validate": try: # Call Setup script diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index 95892a5908..079d3a19e1 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -465,39 +465,39 @@ log { output file /var/log/caddy/access/{{ reverse['@uuid'] }}.log { roll_keep_for {{ generalSettings.LogAccessPlainKeep|default("10") }}d - } + } } {% endif %} {% endif %} {% set customCert = reverse.CustomCertificate|default("") %} {% set dnsChallenge = reverse.DnsChallenge|default("0") %} {{ tls_configuration(dnsProvider, dnsApiKey, customCert, dnsChallenge, dnsSecretApiKey, TlsDnsOptionalField1, TlsDnsOptionalField2, TlsDnsOptionalField3, TlsDnsOptionalField4, TlsDnsOptionalField5, TlsDnsOptionalField6) }} - + {% if not reverse.accesslist %} {% set basicauth_uuids = reverse.basicauth %} {{ basicauth_configuration(basicauth_uuids) }} {% endif %} - + {% for subdomain in helpers.toList('Pischem.caddy.reverseproxy.subdomain') %} {% if subdomain.enabled|default("0") == "1" and subdomain.reverse == reverse['@uuid'] %} @{{ subdomain['@uuid'] }} { host {{ subdomain.FromDomain }}{% if subdomain.FromPort %}:{{ subdomain.FromPort }}{% endif %} } handle @{{ subdomain['@uuid'] }} { - + {% if not subdomain.accesslist %} {% set subdomain_basicauth_uuids = subdomain.basicauth %} {{ basicauth_configuration(subdomain_basicauth_uuids) }} {% endif %} - + {% if subdomain.accesslist %} {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', subdomain.accesslist) | first %} {{ access_list_configuration(accesslist, accesslist.accesslistInvert|default("0") == "1") }} handle @{{ accesslist['@uuid'] }} { - + {% set subdomain_basicauth_uuids = subdomain.basicauth %} {{ basicauth_configuration(subdomain_basicauth_uuids) }} - + {% set subdomain_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('subdomain', 'equalto', subdomain['@uuid']) | list %} {% for handle in subdomain_handles %} {% if handle.enabled|default("0") == "1" and handle.HandlePath %} @@ -534,10 +534,10 @@ {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', reverse.accesslist) | first %} {{ access_list_configuration(accesslist, accesslist.accesslistInvert|default("0") == "1") }} handle @{{ accesslist['@uuid'] }} { - + {% set basicauth_uuids = reverse.basicauth %} {{ basicauth_configuration(basicauth_uuids) }} - + {% set wildcard_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('reverse', 'equalto', reverse['@uuid']) | selectattr('subdomain', 'undefined') | list %} {% for handle in wildcard_handles %} {% if handle.enabled|default("0") == "1" and handle.HandlePath %} From 3ab564626d59c84a7cffa9e09a97bd7573472b97 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 8 Mar 2024 12:56:06 +0100 Subject: [PATCH 1812/3088] LICENSE/README: sync --- LICENSE | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/LICENSE b/LICENSE index c3a812e87f..61caa7c55e 100644 --- a/LICENSE +++ b/LICENSE @@ -5,6 +5,7 @@ Copyright (c) 2021 Andreas Stuerz Copyright (c) 2021 Axelrtgs Copyright (c) 2023 Bernhard Frenking Copyright (c) 2023 Cannon Matthews +Copyright (c) 2023-2024 Cedrik Pischem Copyright (c) 2019 Cloudfence - Julio Camargo (JCC) Copyright (c) 2005-2006 Colin Smith Copyright (c) 2021 Dan Lundqvist diff --git a/README.md b/README.md index 1d3a70e882..2afccc1887 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ sysutils/xen -- Xen guest utilities vendor/sunnyvalley -- Vendor Repository for Zenarmor (a.k.a Sensei, Next Generation Firewall Extensions) www/c-icap -- c-icap connects the web proxy with a virus scanner www/cache -- Webserver cache +www/caddy -- Easy to configure Reverse Proxy based on Caddy with Automatic HTTPS and Dynamic DNS www/nginx -- Nginx HTTP server and reverse proxy www/squid -- Squid is a caching proxy for the web www/web-proxy-sso -- Kerberos authentication module From 0d569516ec2c1a98dc665cd5a5faa0a28435692f Mon Sep 17 00:00:00 2001 From: Joachim Friberg Date: Mon, 11 Mar 2024 11:07:44 +0100 Subject: [PATCH 1813/3088] Update named.conf (#3852) Fixed bug, allowrndcupdate in the named.conf --- .../src/opnsense/service/templates/OPNsense/Bind/named.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf index b0de3585d2..0c091b00ed 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf @@ -180,7 +180,7 @@ zone "{{ domain.domainname }}" { {% endfor %} }; {% endif %} -{% if domain.allowrndcupdate is defined and domain.allowrndc == "1" %} +{% if domain.allowrndcupdate is defined and domain.allowrndcupdate == "1" %} update-policy { grant rndc-key zonesub ANY; }; From 9999bf14722a0ec288d49cd970f666aca2dc1ea7 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 11 Mar 2024 11:08:19 +0100 Subject: [PATCH 1814/3088] dns/bind: bump revision --- dns/bind/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index c7dbfdf425..9ef5a09dfe 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= bind PLUGIN_VERSION= 1.30 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind918 PLUGIN_MAINTAINER= m.muenz@gmail.com From 6fbc5137d352f7a3a34cf2fe826b6b14f20e50d6 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 13 Mar 2024 19:39:27 +0100 Subject: [PATCH 1815/3088] dns/ddclient - prevent model usage in ddclient_services() The ddclient model uses configd for additional info, which makes model initialization a bit slower than usual. When only checking if the module is used, accessing the config object saves a lot of time. --- dns/ddclient/Makefile | 2 +- dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 9bb1936a3a..fcf1873f72 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.21 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_DEPENDS= ddclient py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc b/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc index 8e087a38e4..2a45595e5f 100644 --- a/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc +++ b/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc @@ -30,9 +30,13 @@ function ddclient_services() { $services = []; + $cnf = \OPNsense\Core\Config::getInstance()->object(); + $is_enabled = false; + if ($cnf->OPNsense && $cnf->OPNsense->DynDNS && $cnf->OPNsense->DynDNS->general){ + $is_enabled = $cnf->OPNsense->DynDNS->general->enabled == '1'; + } - $mdl = new \OPNsense\DynDNS\DynDNS(); - if ($mdl->general->enabled == '1') { + if ($is_enabled) { $service = [ 'description' => gettext('ddclient'), 'configd' => [ @@ -42,7 +46,7 @@ function ddclient_services() ], 'name' => 'ddclient', ]; - $service['pidfile'] = (string)$mdl->general->backend != 'opnsense' ? '/var/run/ddclient.pid' : '/var/run/ddclient_opn.pid'; + $service['pidfile'] = $cnf->OPNsense->DynDNS->general->backend != 'opnsense' ? '/var/run/ddclient.pid' : '/var/run/ddclient_opn.pid'; $services[] = $service; } From f1b3c4216a1d0633d3a527f7fada5d0eb0ae45b7 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 13 Mar 2024 19:56:24 +0100 Subject: [PATCH 1816/3088] security/wazuh-agent - prevent model usage in wazuhagent_services() The wazuh model uses configd for additional info, which makes model initialization a bit slower than usual. When only checking if the module is used, accessing the config object saves a lot of time. --- security/wazuh-agent/Makefile | 1 + .../wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/security/wazuh-agent/Makefile b/security/wazuh-agent/Makefile index d30039151e..cd1e3dbccd 100644 --- a/security/wazuh-agent/Makefile +++ b/security/wazuh-agent/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wazuh-agent PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Agent for the open source security platform Wazuh PLUGIN_DEPENDS= wazuh-agent PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc b/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc index 0907f052d3..132dfd5dc5 100644 --- a/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc +++ b/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc @@ -30,7 +30,13 @@ function wazuhagent_services() { $services = []; - if ((new \OPNsense\WazuhAgent\WazuhAgent())->general->enabled == '1') { + $cnf = \OPNsense\Core\Config::getInstance()->object(); + $is_enabled = false; + if ($cnf->OPNsense && $cnf->OPNsense->WazuhAgent && $cnf->OPNsense->WazuhAgent->general){ + $is_enabled = $cnf->OPNsense->WazuhAgent->general->enabled == '1'; + } + + if ($is_enabled) { $service = [ 'description' => gettext('Wazuh Agent'), 'configd' => [ From f3ed2695fe14f6aa890d599a92ed740a0349c9ae Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Thu, 14 Mar 2024 08:32:50 +0100 Subject: [PATCH 1817/3088] www/caddy: Version 1.5.2 (#3851) * Update pkg-descr Added Version changelog from first stable to current release (also making sure contributors other than me are named) * Update Caddy.xml Add remaining caddy-dns providers. Gotta catch em all. * Update Caddyfile Add DNS Providers with special configuration to Caddyfile template, others are caught by the catch all for DNS Providers (which only need 1 api_token) at the end of the if statement. * Update dnsprovider.xml Added helptext for the remaining DNS Providers. * Update pkg-descr Added changelog for DNS Providers * Update Makefile Bump version to 1.5.2 * Update Caddyfile Even though Civo has only one api_token it demands special configuration, fixed. * Update general.volt - Add additional save functionality to apply button to prevent user error from forgetting to save the form with the save button. - Increase the timeout of the message area so users can see validation errors longer. * Update reverse_proxy.volt Same as general.volt * Update Caddyfile Fixed directadmin configuration keys * Update pkg-descr Added changes to changelog * Revert DNS Provider changes due to compilation problems of binary to last good known state. * Satisfy Lint by making sure Defaults are either required, or deleted if not needed. * Update pkg-descr * Update dynamicdns.xml Made help text about the DynDns Interface more concise because the bug upstream has been fixed that also extracted private IP ranges. Now only GUA and non-RFC1918 addresses are extracted, making this option a valid choice. https://github.com/mholt/caddy-dynamicdns/issues/59 * Update pkg-descr * Delete www/caddy/README.md It's being turned into a doc article so this can be deleted here. --- www/caddy/Makefile | 3 +- www/caddy/README.md | 205 ------------------ www/caddy/pkg-descr | 70 +++++- .../OPNsense/Caddy/forms/dynamicdns.xml | 2 +- .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 47 ++-- .../mvc/app/views/OPNsense/Caddy/general.volt | 46 ++-- .../views/OPNsense/Caddy/reverse_proxy.volt | 2 +- 7 files changed, 112 insertions(+), 263 deletions(-) delete mode 100644 www/caddy/README.md diff --git a/www/caddy/Makefile b/www/caddy/Makefile index 7059ebe9dc..95dd8078a2 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= caddy -PLUGIN_VERSION= 1.5.1 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.5.2 PLUGIN_DEPENDS= caddy-custom PLUGIN_COMMENT= Easy to configure Reverse Proxy based on Caddy with Automatic HTTPS and Dynamic DNS PLUGIN_MAINTAINER= cedrik@pischem.com diff --git a/www/caddy/README.md b/www/caddy/README.md deleted file mode 100644 index 3dbfc9571a..0000000000 --- a/www/caddy/README.md +++ /dev/null @@ -1,205 +0,0 @@ -# Caddy Plugin for OPNsense - -- This project provides a simple yet powerful plugin for [OPNsense](https://github.com/opnsense) to enable support for [Caddy](https://github.com/caddyserver/caddy). -- The scope is the reverse proxy features. -- The main goal is an easy to configure plugin. Most options that aren't generally needed are hidden behind the advanced mode for this reason. -- The feature set is complete for now. - -## Main Features - -- Modern and fast Reverse Proxy based on [Caddy](https://caddyserver.com/) -- Automatic Let's Encrypt and ZeroSSL Certificates without configuration with HTTP-01 and TLS-ALPN-01 -- ACME DNS-01 challenge with configuration (requires supported DNS Provider) -- Dynamic DNS (DynDns) with configuration (requires supported DNS Provider) -- Supported DNS Providers in GUI: ```cloudflare, duckdns, digitalocean, dnspod, hetzner, godaddy, gandi, ionos, desec, porkbun, route53, acmedns, alidns, googleclouddns, azure, openstack-designate, ovh, namecheap, netlify, namesilo, powerdns, vercel, ddnss, njalla, metaname, linode, tencentcloud, dinahosting, hexonet, mailinabox``` -- Use custom certificates from OPNsense certificate store -- Normal domains, wildcard domains and subdomains -- Access Lists to restrict access based on static networks -- Basic Auth to restrict access by username and password -- Syslog-ng integration and HTTP Access Log -- NTLM Transport for Exchange Server - -## License - -- This project is licensed under the BSD 2-Clause "Simplified" license. See the LICENSE file for details. -- Caddy is licensed under the Apache License, Version 2.0. -- OPNsense is licensed under the BSD 2-Clause “Simplified” license. - -## Acknowledgments - -- Thanks to the Caddy community/developers for creating a fantastic open source web server. -- Thanks to the OPNsense community/developers for creating a powerful and flexible open source firewall and routing platform. -- Additional big **Thank You** in no particular order: [AdShellevis](https://github.com/Adschellevis), [mimugmail](https://forum.opnsense.org/index.php?action=profile;u=15464), [gspannu](https://github.com/gspannu), [francislavoie](https://caddy.community/u/francislavoie/summary), [matt](https://caddy.community/u/matt/summary), [fichtner](https://github.com/fichtner) - -# How to install - -- Install "os-caddy" from the OPNsense Plugins. - -## Prepare Caddy for use after the installation - -**Attention**, additional preparation of OPNsense needed: -- Make sure that port `80` and `443` aren't occupied. You have to change the default listen port to `8443` for example. Go to `System: Settings: Administration` to change the `TCP Port`. Then also enable `HTTP Redirect - Disable web GUI redirect rule`. -- If you have other reverse proxy or webserver plugins installed, make sure they don't use the same ports as Caddy -- Create Firewall rules that allow 80 and 443 TCP to "This Firewall" on WAN and (optionally) LAN, OPT1 etc... -- There is a lot of input validation. If you read all the hints, help texts and error messages, its unlikely that you create a configuration that won't work. -- **Attention**: If you use this in HA (High Availability), only use your own custom certificates. Caddy needs a shared storage for the ACME challenges to work on two or more firewalls in HA at the same time. This is out of scope, since offering shared storage on firewalls where one can potentially fail, would leave the other without storage for Caddy to work with. - -# Available Settings in "Services - Caddy Web Server" -**Please note that some options are hidden in advanced mode.** -## General Settings - General -- `Enable` or `disable` Caddy -- `ACME Email`: e.g. `info@example.com`, it's optional. -- `Auto HTTPS`: `On (default)` creates automatic Let's Encrypt Certificates for all Domains that don't have more specific options set, like custom certificates. -- `Trusted Proxies`: Leave empty if you don't use a CDN in front of your OPNsense. If you use Cloudflare or another CDN provider, create an access list with the IP addresses of that CDN and add it here. Add the same Access List to the domain this CDN tries to reach. -- `Abort Connections`: This option, when enabled, aborts all connections to the Reverse Proxy Domain that don't match any specified handler or access list. This setting doesn't affect Let's Encrypt's ability to issue certificates, ensuring secure connections regardless of the option's status. If unchecked, the Reverse Proxy Domain remains accessible even without a matching handler, allowing for connectivity and certificate checks, even in the absence of a configured Backend Server. When using Access Lists, enabling this option is recommended to reject unauthorized connections outright. Without this option, unmatched IP addresses will encounter an empty page instead of an explicit rejection, though the Access Lists continue to function and restrict access. - -## General Settings - DNS Provider -- `DNS Provider`: Select the DNS provider for the DNS-01 Challenge and Dynamic DNS. This is optional, since certificates will be requested from Let's Encrypt via HTTP-01 or TLS-ALPN-01 Challenge when this option is unset. You mostly need this for Wildcard Certificates, and for Dynamic DNS. To use the DNS-01 Challenge and Dynamic DNS, enable the checkbox in a Reverse Proxy Domain or Subdomain. For more information: https://github.com/caddy-dns -- `DNS API Standard Field`: This is the standard field for the API Key. Field can be left empty if optional: Cloudflare "api_token", Duckdns "api_token", DigitalOcean "auth_token", DNSPod "auth_token", Hetzner "api_token", Godaddy "api_token", Gandi "bearer_token", IONOS "api_token", deSEC "token", Route53 "access_key_id", Porkbun "api_key", ACME-DNS "username", Netlify "personal_access_token", Namesilo "api_token", Njalla "api_token", Vercel "api_token", Google Cloud DNS "gcp_project", Alidns "access_key_id", Azure "tenant_id", OpenStack Designate "region_name", OVH "endpoint", Namecheap "api_key", PowerDNS "server_url", DDNSS "api_token", Metaname "api_key", Linode "api_token", Tencent Cloud "secret_id", Dinahosting "username", Hexonet "username", Mail-in-a-Box "api_url". -- `DNS API Additional Field 1`: Leave empty if your DNS Provider isn't specified here. Field can be left empty if optional: Duckdns "override_domain", Route53 "secret_access_key", Porkbun "api_secret_key", ACME-DNS "password", Alidns "access_key_secret", Azure "client_id", OpenStack Designate "tenant_id", OVH "application_key", Namecheap "user", PowerDNS "api_token", DDNSS "username", Metaname "account_reference", Linode "api_url", Tencent Cloud "secret_key", Dinahosting "password", Hexonet "password", Mail-in-a-Box "email_address". -- `DNS API Additional Field 2`: Leave empty if your DNS Provider isn't specified here. Field can be left empty if optional: Route53 "max_retries", ACME-DNS "subdomain", Azure "client_secret", OpenStack Designate "identity_api_version", OVH "application_secret", Namecheap "api_endpoint", DDNSS "password", Linode "api_version", Mail-in-a-Box "password". -- `DNS API Additional Field 3`: Leave empty if your DNS Provider isn't specified here. Field can be left empty if optional: Route53 "aws_profile", ACME-DNS "server_url", Azure "subscription_id", OpenStack Designate "password", OVH "consumer_key", Namecheap "client_ip", DDNS "password". -- `DNS API Additional Field 4`: Leave empty if your DNS Provider isn't specified here. Field can be left empty if optional: Route53 "region", Azure "resource_group_name", OpenStack Designate "username". -- `DNS API Additional Field 5`: Leave empty if your DNS Provider isn't specified here. Field can be left empty if optional: Route53 "token", OpenStack Designate "tenant_name". -- `DNS API Additional Field 6`: Leave empty if your DNS Provider isn't specified here. Field can be left empty if optional: OpenStack Designate "auth_url". -- `DNS API Additional Field 7`: Leave empty if your DNS Provider isn't specified here. Field can be left empty if optional: OpenStack Designate "endpoint_type". - -## General Settings - Dynamic DNS -- `DynDns Check Http`: Optionally, enter an URL to test the current IP address of the firewall via HTTP procotol. Generally, this is not needed. Caddy uses default providers to test the current IP addresses. If you rather use your own, enter the https:// link to an IP address testing website. -- `DynDns Check Interface`: Optionally, select an interface to extract the current IP address of the firewall. Attention, all IP addresses will be read from this interface. Only choose this option if you know the implications. -- `DynDns Check Interval`: Interval to poll for changes of the IP address. The default is 5 minutes. Can be a number between 1 to 1440 minutes. -- `DynDns IP Version`: Leave on None to set IPv4 A-Records and IPv6 AAAA-Records. Select "Ipv4 only" for setting A-Records. Select "IPv6 only" for setting AAAA-Records. -- `DynDns TTL`: Set the TTL (time to live) for DNS Records. The default is 1 hour. Can be a number between 1 to 24 hours. - -## General Settings - Log Settings -- `Log Credentials`: Log all Cookies and Authorization in HTTP request logging. Use combined with HTTP Access Log in the Reverse Proxy Domain. Enable this option only for troubleshooting. -- `Log Access in Plain Format`: Don't send HTTP(S) access logs to the central OPNsense logging facility but save them in plain Caddy JSON format in a subdirectory instead. Only effective for Reverse Proxy Domains that have HTTP Access Log enabled. The feature is intended to have access log files processed by e.g. CrowdSec. They can be found in `/var/log/caddy/access`. -- `Keep Plain Access Logs for (days)`: How many days until the plain format log files are deleted. - -## Reverse Proxy - Domains -- Press `+` to create a new Reverse Proxy Domain -- `Enable` this new entry -- `Reverse Proxy Domain`: Can either be a domain name or an IP address. If a domain name is chosen, Caddy will automatically try to get an ACME certificate, and the header will be automatically passed to the Server in the backend. -- `Reverse Proxy Port`: Should be the port the OPNsense will listen on. Don't forget to create Firewall rules that allow traffic to this port on `WAN` or `LAN` to `This Firewall`. You can leave this empty if you want to use the default ports of Caddy (`80` and `443`) with automatic redirection from HTTP to HTTPS. -- `Access List`: Restrict the access to this domain to a list of IP addresses you define in the `Access` Tab. This doesn't influence the Let's Encrypt certificate generation, so you can be as restrictive as you want here. -- `Basic Auth`: Restrict the access to this domain to one or multiple users you define in the `Access` Tab. This doesn't influence the Let's Encrypt certificate generation, so you can be as restrictive as you want here. -- `DNS-01 challenge`: Enable this if you want to use the `DNS-01` ACME challenge instead of HTTP challenge. This can be set per entry, so you can have both types of challenges at the same time for different entries. This option needs the `General Settings` - `DNS Provider` and `API KEY` set. -- `Dynamic DNS`: Enable Dynamic DNS, please configure DNS Provider and API Key in General Settings. The DNS Records of this domain will be automatically updated with your DNS Provider. -- `Custom Certificate`: Use a Certificate you imported or generated in `System - Trust - Certificates`. The chain is generated automatically. `Certificate + Intermediate CA + Root CA`, `Certificate + Root CA` and `self signed Certificate` are all fully supported. -- `HTTP Access Log`: Enable the HTTP request logging for this domain and its subdomains. This option is mostly for troubleshooting since it will log every single request. -- `Description`: The description is mandatory. Create descriptions for each domain. Since there could be multiples of the same domain with different ports, do it like this: `foo.example.com` and `foo.example.com.8443`. - -## Reverse Proxy - Subdomains -- Press `+` to create a new Reverse Proxy Subdomain -- `Reverse Proxy Domain` - Choose a wildcard domain you prepared in "Reverse Proxy - Domains", it has to be formatted like `*.example.com` -- `Reverse Proxy Subdomain` - Create a name that is seated under the Wildcard domain, for example `foo.example.com` and `bar.example.com`. -- For the other options refer to Domains. - -## Reverse Proxy - Handler -Please note that the order that handlers are saved in the scope of each domain or domain/subdomain can influence functionality - The first matching handler wins. So if you put /ui* in front of a more specific handler like /ui/opnsense, the /ui* will match first and /ui/opnsense won't ever match (in the scope of their domain). Right now there isn't an easy way to move the position of handlers in the grid, so you have to clone them if you want to change their order, and delete the old entries afterwards. Most of the time, creating just one empty catch-all handler is the best choice. The template logic makes sure that catch-all handlers are always placed last, after all other handlers. -- Press `+` to create a new `Handler`. A Handler is like a location in nginx. -- `Enable` this new entry. -- `Reverse Proxy Domain`: Select the domain you have created in `Reverse Proxy Domains`. -- `Reverse Proxy Subdomain`: Leave this on `None`. It is not needed without having a wildcard certificate, or a `*.example.com` Domain. -- `Handle Type`: `Handle` or `Handle Path` can be chosen. If in doubt, always use `Handle`, the most common option. `Handle Path` is used to strip the path from the URI. For example if you have example.com/opnsense internally, but want to call it with just example.com externally. -- `Handle Path`: Leave this empty if you want to create a catch all location. You can create multiple Handler entries, and have each of them point at different locations like `/foo/*` or `/foo/bar/*` or `/foo*`. -- `Backend Server Domain`: Should be an internal domain name or an IP Address of the Backend Server that should receive the traffic of the `Reverse Proxy Domain`. -- `Backend Server Port`: Should be the port the Backend Server listens on. This can be left empty to use Caddy default ports 80 and 443. -- `Backend Server Path`: In case the backend application resides in a sub-path of the web root and you don't want this path visible in the frontend URL you can use this setting to prepend an initial path starting with '/' to every backend request. Java applications running in a servlet container like Tomcat are known to behave this way, so you can set it to e.g. '/guacamole' to access Apache Guacamole at the frontend root URL without needing a redirect. -- `TLS`: If your Backend Server only accepts HTTPS, enable this option. If the Backend Server has a globally trusted certificate, this is all you need. -- `TLS Trusted CA Certificates`: Choose a CA certificate to trust for the Backend Server connection. Import your self-signed certificate or your CA certificate into the OPNsense "System - Trust - Authorities" store, and select it here. -- `TLS Server Name`: If the SAN (Subject Alternative Names) of the offered trusted CA certificate or self-signed certificate doesn't match with the IP address or hostname of the `Backend Server Domain`, you can enter it here. This will change the SNI (Server Name Identification) of Caddy to the `TLS Server Name`. IP address e.g. `192.168.1.1` or hostname e.g. `localhost` or `opnsense.local` are all valid choices. Only if the SAN and SNI match, the TLS connection will work, otherwise an error is logged that can be used to troubleshoot. -- `NTLM`: If your Backend Server needs NTLM authentication, enable this option together with `TLS`. For example, Exchange Server. - -**Attention**: The GUI doesn't allow "tls_insecure_skip_verify" due to safety reasons, as the Caddy documentation states not to use it. Use the `TLS Trusted CA Certificates` and `TLS Server Name` options instead to get a **secure TLS connection** to your Backend Server. Otherwise, use HTTP. If you really need to use "tls_insecure_skip_verify" and know the implications, use the import statements of custom configuration files. - -## Reverse Proxy - Access - Access Lists -- Press `+` to create a new Access List -- `Access List name`: Choose a name for the Access List, for example `private_ips`. -- `Client IP Addresses`: Enter any number of IPv4 and IPv6 addresses or networks that this access list should contain. For example for matching only internal networks, add `192.168.0.0/16` `172.16.0.0/12` `10.0.0.0/8` `127.0.0.1/8` `fd00::/8` `::1`. -- `Invert List`: Invert the logic of the access list. If unchecked, the Client IP Addresses will be ALLOWED, all other IP addresses will be blocked. When checked, the Client IP Addresses will be BLOCKED, all other IP addresses will be allowed. -- Afterwards, go back to Domains or Subdomains and add the Access List you have created to them (advanced mode). All handlers created under these Domains will get an additional matcher. That means, the requests still reach Caddy, but if the IP Addresses don't match with the Access List logic, the request doesn't match any handler and will be dropped before being reverse proxied to any Backend Server. If you are using a CDN, make sure the Access List in General - Trusted Proxies and on each Domain used for that CDN are the same. - -## Reverse Proxy - Access - Basic Auth -- Press `+` to create a new User for Basic Auth -- `User`: Enter a username. Afterwards, you can select it in Reverse Proxy Domains or Subdomains to restrict access with basic auth. Usernames are only allowed to have alphanumeric characters. -- `Password`: Enter a password. Write it down. It will be hashed with bcrypt. It can only be set and changed but won't be visible anymore. The hash can't be turned back into the original password. -- Afterwards, go back to Domains or Subdomains and add the one or multiple basic auth users you have created to them (advanced mode). The basic auth matches after access lists, so you can set both to first restrict access by IP address, and then additionally by username and password. Please note that if you delete a user before deselecting it in a domain, the basic auth will stay with no user. If that happens you have to select the "clear all" in the domain or subdomain and save. Don't set basic auth on top of a wildcard domain directly, always set it on the subdomains instead. - -# HOW TO Section: - -## HOW TO: Create an easy reverse proxy -**Services - Caddy Web Server - General Settings:** -- `Enable` Caddy and press `Apply` - -**Services - Caddy Web Server - Reverse Proxy - Domain:** -- Press `+` to create a new Reverse Proxy Domain -- `Reverse Proxy Domain` - `foo.example.com` -- `Description` - `foo.example.com` -- `Save` - -**Services - Caddy Web Server - Reverse Proxy - Handler:** -- Press `+` to create a new Handler -- `Reverse Proxy Domain` - `foo.example.com` -- `Backend Server Domain` - `192.168.10.1` -- `Save` -- `Apply` - -Done, leave all other fields to default or empty. You don't need the advanced mode options. After just a few seconds the Let's Encrypt Certificate will be installed and everything just works. Check the Logfile for that. -Now you have a "Internet <-- HTTPS --> OPNsense (Caddy) <-- HTTP --> Backend Server" Reverse Proxy. - -## HOW TO: Create a wildcard subdomain reverse proxy -- Do everything the same as above, but create your Reverse Proxy Domain like this `*.example.com` and activate the `DNS-01` challenge checkbox. -- OR - `Custom Certificate` - Use a Certificate you imported or generated in `System - Trust - Certificates`. It has to be a wildcard certificate. -- Go to the `Reverse Proxy Subdomain` Tab and create all subdomains that you need in relation to the `*.example.com` domain. So for example `foo.example.com` and `bar.example.com`. -- Create descriptions for each subdomain. Since there could be multiples of the same subdomain with different ports, do it like this: `foo.example.com` and `foo.example.com.8443`. -- In the `Handler` Tab you can now select your `*.example.com` `Reverse Proxy Domain`, and if `Reverse Proxy Subdomain` is `None`, the Handlers are added to the base `Reverse Proxy Domain`. For example, if you want a catch all Handler for all non referenced subdomains. -- If you create a Handler with `*.example.com` as `Reverse Proxy Domain` and `foo.example.com` as `Reverse Proxy Subdomain`, a nested Handler will be generated. You can do all the same configurations as if the subdomain is a normal domain, with multiple Handlers and Handler paths. - -## HOW TO: Create a Handle with TLS and a trusted self-signed Certificate -**Example: Reverse Proxy the OPNsense Configuration GUI Website with Caddy** -- Open your OPNsense GUI in a Browser (e.g. Chrome or Firefox). Inspect the certificate. Copy the SAN for later use, for example `OPNsense.localdomain`. -- Save the certificate in your Browser as PEM file. Open it up with a text editor, and copy the contents into a new entry in `System - Trust - Authorities`. Name the certificate e.g. `opnsense-selfsigned`. -- Add a new Reverse Proxy Domain, for example `opn.example.com`. Make sure the name is externally resolvable to the IP of your OPNsense Firewall with Caddy. -- Add a new Handler with the following options (enable advanced mode): -- `Reverse Proxy Domain`: `opn.example.com` -- `Backend Server Domain`: `127.0.0.1` -- `Backend Server Port`: `8443` (Enter the port of your OPNsense GUI. You have changed it from 443 to a different port, since Caddy needs port 443.) -- `TLS`: `X` -- `TLS Trusted CA Certificates`: `opnsense-selfsigned` (The certificate you have saved in `System - Trust - Authorities`) -- `TLS Server Name`: `OPNsense.localdomain` (The SAN of the certificate) -- Save -- Apply -- Open `https://opn.example.com` and it should serve the reverse proxied OPNsense Configuration GUI Website. Check the log file for errors if it doesn't work, most of the time the `TLS Server Name` doesn't match the SAN of the `TLS Trusted CA Certificates`. Please note that Caddy doesn't support CN (Common Name) in certificate since it's been deprecated since many years. -- Additionally, you can create an access list to limit access to the GUI only from trusted IP addresses (recommended). Add that access list to the domain `opn.example.com` in advanced mode. Also, enable `Abort Connections` in the `General` Settings to abort all connections immediately that don't match the access list or the handler. - -# Troubleshooting -- You can always test if your current Caddyfile is valid by invoking `/api/caddy/service/validate` - This is also done automatically each time `Apply` is pressed. If you have an invalid configuration, Caddy will refuse to start and show the exact error message. -- Check `/var/log/caddy/caddy.log` or `@latest.log` to find errors. There is also a Caddy Log File in the GUI. -- A good indicator that Caddy is indeed running is this log entry: `serving initial configuration` -- Check the Service Widget and the "General Settings" Service Control buttons. If everything works they should show a green "Play" sign. If Caddy is stopped there is a red "Stop" sign. If Caddy is disabled, there is no widget and no control buttons. - -# Build caddy and os-caddy from source -- As build system use a FreeBSD 13.2 - https://github.com/opnsense/tools -- Use xcaddy to build your own caddy binary. Additonal Caddy plugins can be compiled in, here is an example: [Additional Plugins](https://github.com/opnsense/tools/blob/a555d25b11486835460a136af0b8ad2e517ae96b/config/24.1/make.conf#L94) -- Check the +MANIFEST file and put all dependant files into the right paths on your build system. Make sure to check your own file hashes with ```sha256 /path/to/file```. -- Use ```pkg create -M ./+MANIFEST``` in the folder of the ```+MANIFEST``` file. -- For os-caddy.pkg make sure you have the OPNsense tools build system properly set up. -- Build the os-caddy.pkg by going into /usr/plugins/devel/caddy/ and invoking ```make package``` - -# Custom configuration files -- The Caddyfile has an additional import from the path ```/usr/local/etc/caddy/caddy.d/```. You can place your own custom configuration files inside that adhere to the Caddyfile syntax. -- ```*.global``` will be imported into the global block of the Caddyfile. Global options can be found here: [Global Options Block](https://caddyserver.com/docs/caddyfile/options) -- ```*.conf``` will be imported at the end of the Caddyfile, you can put your own reverse_proxy or other settings there. Don't forget to test your custom configuration with `caddy run --config /usr/local/etc/caddy/Caddyfile`. - -# Using the REST API to control the plugin: -The Rest API is now fully integreated with the OPNsense syntax. -https://docs.opnsense.org/development/api.html - -All API Actions can be found in the API Controller files ```/usr/local/opnsense/mvc/app/controllers/Pischem/Caddy/Api``` - -Examples: -- /api/caddy/ReverseProxy/get -- /api/caddy/General/get -- /api/caddy/service/status -- /api/caddy/service/validate diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 46d05631d5..311733b3cd 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -22,6 +22,13 @@ Main features of this plugin: Plugin Changelog ================ +1.5.2 + +* Increased timeout of message area in reverse_proxy.volt and general.volt to 15 seconds. +* When pressing Apply, the form is saved automatically before the reconfigure action. +* Cleaned up Caddy.xml model to satisfy make lint. +* When selecting an interface in Dynamic DNS, at most one IPv6 GUA and IPv4 non-RFC1918 address will be extracted. Fixes all IP addresses being read. + 1.5.1 * More DNS Providers added: netlify, namesilo, njalla, vercel, googleclouddns, alidns, powerdns, tencentcloud, dinahosting, metaname, hexonet, ddnss, linode, mailinabox, ovh, namecheap, azure, openstack-designate. @@ -37,4 +44,65 @@ Plugin Changelog 1.5.0 -* Initial release +* Omit vultr from DNS-Providers since it can't be built without errors. +* General view cleanup by seperating options into different tabs. +* Added ACME-DNS Provider for custom ACME Server support. +* When pressing save, a hint will appear that changes should be applied. Apply and Save now give feedback on success. +* Create ACL for Caddy +* Code consistency improved. + +1.4.5 + +* New validate api action when pressing apply that validates the Caddyfile + Validation model fix. +* Added configuration option to log HTTP access to plain JSON files. [contributed by @pmhausen] +* Added backend path prepend feature to handler configuration. [contributed by @pmhausen] + +1.4.4 + +* Route53 DNS Provider added +* Dark Mode GUI fix + +1.4.2 + +* Added Basic Auth as additional access restriction, multiple users can be set per domain and subdomain. +* Made views cleaner: Seperated General Settings and DNS Provider Settings, joined Access List and Basic Auth in new Access Tab. +* Fixed template generation of Caddyfile for new DNS Providers deSEC. +* Added Porkbun DNS Provider for GUI configuration with additional DNS Secret Api Key input field. +* Cleaned up some code and fixed some typos. + +1.4.0 + +* DynDNS (Dynamic DNS) Feature added. +* Logging refactored to syslog-ng. +* HTTP Access Logs can be enabled. +* More DNS Providers added: Cloudflare, Duck DNS, DigitalOcean, DNSPod, Hetzner, GoDaddy, Gandi, Vultr, IONOS, deSEC + +1.3.4 + +* Added abort statement to close all connections that don't match any handle. +* Added tls_server_name to model +* Fixes DNS Challenge not adhering to the status of the DNS-01 Checkbox + +1.3.3 + +* Swapped processing order in template from wildcard domains -> subdomains to subdomains -> wildcard domains + +1.3.2 + +* Added inline loop logic to template to always print empty handles last in the Caddyfile before specific handles. + +1.3.1 + +* Added AccessList functionality. +* Small constraint to handle added. Handles have to start at least with / when they're not empty, or Caddy won't start. +* Add reload for the ServiceControlUI after pressing Apply. + +1.3.0 + +* Initial first stable release. +* Create easy Reverse Proxy entries, use the HTTP or DNS-01 Challenge to get quick and easy ACME Certificates with Let's Encrypt. +* Control Caddy and view the Logfile in the OPNsense GUI. +* Create more complicated nested handle structures with wildcard domains, subdomains, handles and catch all handles. +* Use your own certificates where needed. +* Use TLS, NTLM and CA certificates to communicate with your Backend Servers. +* Use Caddy with two OPNsense Firewalls in HA - only fully supported with custom certificates from OPNsense trust store. diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml index 0ed65411f3..d57c17e575 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml @@ -10,7 +10,7 @@ caddy.general.DynDnsInterface dropdown - + true diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index 0c95d2b7df..89bc764fbb 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -1,7 +1,7 @@ //Pischem/caddy A GUI model for configuring a reverse proxy in the Caddy web server. - 1.1.3 + 1.1.4 @@ -12,7 +12,6 @@ Please enter a valid email address. - on On (default) Off @@ -73,19 +72,14 @@ - - 0 - - - 0 - - - 0 - + + + 10 1 Please enter a valid number of 1 or larger. + Y Please enter a valid URL, starting with http or https. @@ -96,6 +90,7 @@ 1 1440 Please enter a valid number from 1 to 1440 minutes. + Y ipv4 @@ -103,12 +98,14 @@ IPv4 only IPv6 only + Y 1 1 24 Please enter a valid number from 1 to 24 hours. + Y @@ -154,16 +151,10 @@ /^([\t\n\v\f\r 0-9a-zA-Z.,_*-\x{00A0}-\x{FFFF}]){1,255}$/u Please provide a valid description. - - 0 - + - - 0 - - - 0 - + + @@ -214,9 +205,7 @@ /^([\t\n\v\f\r 0-9a-zA-Z.,_-\x{00A0}-\x{FFFF}]){1,255}$/u Please provide a valid description. - - 0 - + @@ -268,12 +257,8 @@ /^(\/.*)?$/u Please enter a valid 'Backend Path' that starts with '/'. - - 0 - - - 0 - + + ca @@ -303,9 +288,7 @@ Y Please enter valid IP address(es) or network(s), separated by commas. - - 0 - + /^([\t\n\v\f\r 0-9a-zA-Z.,_*-\x{00A0}-\x{FFFF}]){1,255}$/u Please provide a valid description. diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/general.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/general.volt index fe8ecfe148..9fcca897b1 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/general.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/general.volt @@ -71,7 +71,7 @@ messageArea.removeClass("alert-success alert-danger").addClass(alertClass).html(message); // Use fadeIn to make the message appear smoothly, then fadeOut after a delay - messageArea.fadeIn(500).delay(5000).fadeOut(500, function() { + messageArea.fadeIn(500).delay(15000).fadeOut(500, function() { // Clear the message after fading out to ensure it's clean for the next message $(this).html(''); }); @@ -82,31 +82,35 @@ $("#messageArea").hide(); }); - // Reconfigure the Caddy service, additional validation with a validation API is made beforehand + // Reconfigure the Caddy service, additional form save and validation with a validation API is made beforehand $("#reconfigureAct").SimpleActionButton({ onPreAction: function() { const dfObj = $.Deferred(); - // Directly proceed to validation - $.ajax({ - url: "/api/caddy/service/validate", - type: "GET", - dataType: "json", - success: function(data) { - if (data && data['status'].toLowerCase() === 'ok') { - // If configuration is valid, resolve the Deferred object to proceed - dfObj.resolve(); - } else { - // If configuration is invalid, show alert using showAlert - showAlert(data['message'], "Validation Error"); - dfObj.reject(); + // Save the form before continue + saveFormToEndpoint("/api/caddy/general/set", 'frm_GeneralSettings', function() { + // After successful save, proceed with validation + $.ajax({ + url: "/api/caddy/service/validate", + type: "GET", + dataType: "json", + success: function(data) { + if (data && data['status'].toLowerCase() === 'ok') { + dfObj.resolve(); // Configuration is valid + } else { + showAlert(data['message'], "Validation Error"); + dfObj.reject(); // Configuration is invalid + } + }, + error: function(xhr, status, error) { + showAlert("Validation request failed: " + error, "Validation Error"); + dfObj.reject(); // AJAX request failed } - }, - error: function(xhr, status, error) { - // On AJAX error, show alert using showAlert - showAlert("Validation request failed: " + error, "Validation Error"); - dfObj.reject(); - } + }); + }, function() { + // If save fails, reject the deferred object to stop the reconfigure action + showAlert("Failed to save configuration.", "Error"); + dfObj.reject(); }); return dfObj.promise(); diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt index f152a356dd..1ba868a24c 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt @@ -81,7 +81,7 @@ messageArea.removeClass("alert-success alert-danger").addClass(alertClass).html(message); // Use fadeIn to make the message appear smoothly, then fadeOut after a delay - messageArea.fadeIn(500).delay(5000).fadeOut(500, function() { + messageArea.fadeIn(500).delay(15000).fadeOut(500, function() { // Clear the message after fading out to ensure it's clean for the next message $(this).html(''); }); From 85a27147c4b1308102134acf136ba8dde9e8b0f6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Mar 2024 08:49:45 +0100 Subject: [PATCH 1818/3088] plugins: style sweep --- dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc | 4 ++-- .../wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc | 2 +- www/caddy/pkg-descr | 2 +- www/caddy/src/etc/inc/plugins.inc.d/caddy.inc | 6 ++++-- .../controllers/OPNsense/Caddy/ReverseProxyController.php | 6 ++++-- .../mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php | 3 --- .../src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php | 3 ++- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc b/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc index 2a45595e5f..e41cb18354 100644 --- a/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc +++ b/dns/ddclient/src/etc/inc/plugins.inc.d/ddclient.inc @@ -32,8 +32,8 @@ function ddclient_services() $services = []; $cnf = \OPNsense\Core\Config::getInstance()->object(); $is_enabled = false; - if ($cnf->OPNsense && $cnf->OPNsense->DynDNS && $cnf->OPNsense->DynDNS->general){ - $is_enabled = $cnf->OPNsense->DynDNS->general->enabled == '1'; + if ($cnf->OPNsense && $cnf->OPNsense->DynDNS && $cnf->OPNsense->DynDNS->general) { + $is_enabled = $cnf->OPNsense->DynDNS->general->enabled == '1'; } if ($is_enabled) { diff --git a/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc b/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc index 132dfd5dc5..ce7d94ade4 100644 --- a/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc +++ b/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc @@ -32,7 +32,7 @@ function wazuhagent_services() $services = []; $cnf = \OPNsense\Core\Config::getInstance()->object(); $is_enabled = false; - if ($cnf->OPNsense && $cnf->OPNsense->WazuhAgent && $cnf->OPNsense->WazuhAgent->general){ + if ($cnf->OPNsense && $cnf->OPNsense->WazuhAgent && $cnf->OPNsense->WazuhAgent->general) { $is_enabled = $cnf->OPNsense->WazuhAgent->general->enabled == '1'; } diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 311733b3cd..483ce846cb 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -27,7 +27,7 @@ Plugin Changelog * Increased timeout of message area in reverse_proxy.volt and general.volt to 15 seconds. * When pressing Apply, the form is saved automatically before the reconfigure action. * Cleaned up Caddy.xml model to satisfy make lint. -* When selecting an interface in Dynamic DNS, at most one IPv6 GUA and IPv4 non-RFC1918 address will be extracted. Fixes all IP addresses being read. +* When selecting an interface in Dynamic DNS, at most one IPv6 GUA and IPv4 non-RFC1918 address will be extracted. Fixes all IP addresses being read. 1.5.1 diff --git a/www/caddy/src/etc/inc/plugins.inc.d/caddy.inc b/www/caddy/src/etc/inc/plugins.inc.d/caddy.inc index a04d784d93..78da119b7c 100644 --- a/www/caddy/src/etc/inc/plugins.inc.d/caddy.inc +++ b/www/caddy/src/etc/inc/plugins.inc.d/caddy.inc @@ -32,8 +32,10 @@ function caddy_services() $services = array(); - if (isset($config['Pischem']['caddy']['general']['enabled']) && - $config['Pischem']['caddy']['general']['enabled'] == 1) { + if ( + isset($config['Pischem']['caddy']['general']['enabled']) && + $config['Pischem']['caddy']['general']['enabled'] == 1 + ) { $services[] = array( 'description' => gettext('Caddy Web Server'), 'configd' => array( diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/ReverseProxyController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/ReverseProxyController.php index d6727b48d2..4a9947d759 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/ReverseProxyController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/ReverseProxyController.php @@ -33,8 +33,10 @@ use OPNsense\Base\IndexController; -class ReverseProxyController extends IndexController { - public function indexAction() { +class ReverseProxyController extends IndexController +{ + public function indexAction() + { $this->view->pick('OPNsense/Caddy/reverse_proxy'); $this->view->formDialogReverseProxy = $this->getForm("dialogReverseProxy"); $this->view->formDialogSubdomain = $this->getForm("dialogSubdomain"); diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php index b8948233c2..c103f8d48b 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php @@ -40,16 +40,13 @@ public function run($model) // Ensure there are reverse proxy configurations to process if (!empty($config->Pischem->caddy->reverseproxy)) { - // Loop through each reverse proxy configuration in the stored configuration config.xml foreach ($config->Pischem->caddy->reverseproxy->children() as $configNode) { - // Extract the UUID attribute to identify the configuration item $uuid = (string)$configNode->attributes()->uuid; // Check if the current configuration item has a 'Description' to migrate if (!empty($configNode->Description)) { - // Store the value of 'Description' for migration $descriptionValue = (string)$configNode->Description; diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php index df8550d337..f4f0f6bf60 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php @@ -37,7 +37,8 @@ $configObj = Config::getInstance()->object(); $temp_dir = '/usr/local/etc/caddy/certificates/temp/'; -function extract_and_save_certificates($configObj, $temp_dir) { +function extract_and_save_certificates($configObj, $temp_dir) +{ // Traverse through certificates foreach ($configObj->cert as $cert) { $cert_refid = (string)$cert->refid; From 6ba4fb33c165a703b8cfe4bdb190148f012db044 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Mar 2024 08:59:35 +0100 Subject: [PATCH 1819/3088] security/wazuh-agent: update changelog --- security/wazuh-agent/pkg-descr | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/security/wazuh-agent/pkg-descr b/security/wazuh-agent/pkg-descr index 34fe48113c..d131468862 100644 --- a/security/wazuh-agent/pkg-descr +++ b/security/wazuh-agent/pkg-descr @@ -1,3 +1,14 @@ -Wazuh is a free and open source platform used for threat prevention, detection, and response. It is capable of protecting workloads across on-premises, virtualized, containerized, and cloud-based environments. +Wazuh is a free and open source platform used for threat prevention, detection, +and response. It is capable of protecting workloads across on-premises, +virtualized, containerized, and cloud-based environments. -Using this plugin you can integrate your OPNsense firewall into the Wazuh solution. +Using this plugin you can integrate your OPNsense firewall into the Wazuh +solution. + +Plugin Changelog +================ + +1.0 + +* Initial version +* Improve service information fetch by avoiding creation of a model From 0c3df9dcca595c5b89db00841e3802a3e12ca39b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 14 Mar 2024 08:59:51 +0100 Subject: [PATCH 1820/3088] dns/ddclient: update changelog --- dns/ddclient/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 7ca2b5b793..a54d3b5708 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -11,6 +11,7 @@ Plugin Changelog * Add Netcup support (contributed by Ingo Lafrenz) * Use '==' instead of 'is' in Domeneshop Python support (contributed by ssmendon) * Update DNS record instead of overwriting in Cloudflare Python support (contributed by lin-xianming) +* Improve service information fetch by avoiding creation of a model 1.20 From ed456b2c36d5378b9f5ccf8b73c904e559799db3 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 20 Mar 2024 09:56:13 +0100 Subject: [PATCH 1821/3088] net/relayd - make sure required items are required and enable new items when created for ease of use. closes https://github.com/opnsense/plugins/issues/3850 --- .../opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml index 2e17e27dca..56baf5eed7 100644 --- a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml +++ b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml @@ -82,7 +82,7 @@ - 0 + 1 Y @@ -155,7 +155,7 @@ - 0 + 1 Y @@ -242,7 +242,8 @@ The timeout must be greater than 0 - N + Y + roundrobin Hash Least States @@ -305,7 +306,8 @@ - N + Y + roundrobin Hash Least States From 715b17679fe064065f67edc77cd8e5db6be70cb1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 20 Mar 2024 10:10:40 +0100 Subject: [PATCH 1822/3088] net/relayd: bump revision --- net/relayd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index 139dd2abe5..c370db7956 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= relayd PLUGIN_VERSION= 2.8 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com From cf4fa70cd24a09dd7729420809c1968f030c0a5c Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 20 Mar 2024 11:38:53 +0100 Subject: [PATCH 1823/3088] net/relayd - move validation responsibility to the model, for https://github.com/opnsense/plugins/issues/3850 @fbrendel fyi --- .../Relayd/Api/SettingsController.php | 92 +--------------- .../mvc/app/models/OPNsense/Relayd/Relayd.php | 102 ++++++++++++++++++ 2 files changed, 105 insertions(+), 89 deletions(-) diff --git a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php index c47153d922..fee390f1f4 100644 --- a/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php +++ b/net/relayd/src/opnsense/mvc/app/controllers/OPNsense/Relayd/Api/SettingsController.php @@ -98,7 +98,7 @@ public function getAction($nodeType = null, $uuid = null) */ public function setAction($nodeType = null, $uuid = null) { - $result = array('result' => 'failed', 'validations' => array()); + $result = array('result' => 'failed', 'validations' => []); if ($this->request->isPost() && $this->request->hasPost('relayd') && $nodeType != null) { $this->validateNodeType($nodeType); if ($nodeType == 'general') { @@ -111,93 +111,7 @@ public function setAction($nodeType = null, $uuid = null) } } if ($node != null) { - $relaydInfo = $this->request->getPost('relayd'); - - // perform plugin specific validations - if ($nodeType == 'virtualserver') { - // preset defaults for validations - if (empty($relaydInfo[$nodeType]['type'])) { - $relaydInfo[$nodeType]['type'] = $node->type->__toString(); - } - if (empty($relaydInfo[$nodeType]['transport_tablemode'])) { - $relaydInfo[$nodeType]['transport_tablemode'] = $node->transport_tablemode->__toString(); - } - if (empty($relaydInfo[$nodeType]['backuptransport_tablemode'])) { - $relaydInfo[$nodeType]['backuptransport_tablemode'] = - $node->backuptransport_tablemode->__toString(); - } - - if ($relaydInfo[$nodeType]['type'] == 'redirect') { - if ( - $relaydInfo[$nodeType]['transport_tablemode'] != 'least-states' && - $relaydInfo[$nodeType]['transport_tablemode'] != 'roundrobin' - ) { - $result['validations']['relayd.virtualserver.transport_tablemode'] = sprintf( - gettext('Scheduler "%s" not supported for redirects.'), - $relaydInfo[$nodeType]['transport_tablemode'] - ); - } - if ( - $relaydInfo[$nodeType]['backuptransport_tablemode'] != 'least-states' && - $relaydInfo[$nodeType]['backuptransport_tablemode'] != 'roundrobin' - ) { - $result['validations']['relayd.virtualserver.backuptransport_tablemode'] = sprintf( - gettext('Scheduler "%s" not supported for redirects.'), - $relaydInfo[$nodeType]['backuptransport_tablemode'] - ); - } - if ( - $relaydInfo[$nodeType]['transport_type'] == 'route' && - empty($relaydInfo[$nodeType]['routing_interface']) - ) { - $result['validations']['relayd.virtualserver.routing_interface'] = - gettext('Routing interface cannot be empty'); - } - } - if ($relaydInfo[$nodeType]['type'] == 'relay') { - if ($relaydInfo[$nodeType]['transport_tablemode'] == 'least-states') { - $result['validations']['relayd.virtualserver.transport_tablemode'] = sprintf( - gettext('Scheduler "%s" not supported for relays.'), - $relaydInfo[$nodeType]['transport_tablemode'] - ); - } - if ($relaydInfo[$nodeType]['backuptransport_tablemode'] == 'least-states') { - $result['validations']['relayd.virtualserver.backuptransport_tablemode'] = sprintf( - gettext('Scheduler "%s" not supported for relays.'), - $relaydInfo[$nodeType]['backuptransport_tablemode'] - ); - } - } - } elseif ($nodeType == 'tablecheck') { - switch ($relaydInfo[$nodeType]['type']) { - case 'send': - if (empty($relaydInfo[$nodeType]['expect'])) { - $result['validations']['relayd.tablecheck.expect'] = - gettext('Expect Pattern cannot be empty.'); - } - break; - case 'script': - if (empty($relaydInfo[$nodeType]['path'])) { - $result['validations']['relayd.tablecheck.path'] = - gettext('Script path cannot be empty.'); - } - break; - case 'http': - if (empty($relaydInfo[$nodeType]['path'])) { - $result['validations']['relayd.tablecheck.path'] = - gettext('Path cannot be empty.'); - } - if (empty($relaydInfo[$nodeType]['code']) && empty($relaydInfo[$nodeType]['digest'])) { - $result['validations']['relayd.tablecheck.code'] = - gettext('Provide one of Response Code or Message Digest.'); - $result['validations']['relayd.tablecheck.digest'] = - gettext('Provide one of Response Code or Message Digest.'); - } - break; - } - } - - $node->setNodes($relaydInfo[$nodeType]); + $node->setNodes($this->request->getPost('relayd')[$nodeType]); $valMsgs = $this->getModel()->performValidation(); foreach ($valMsgs as $field => $msg) { $fieldnm = str_replace($node->__reference, "relayd." . $nodeType, $msg->getField()); @@ -330,7 +244,7 @@ public function searchAction($nodeType = null) if ($this->request->isPost() && $nodeType != null) { $this->validateNodeType($nodeType); $grid = new UIModelGrid($this->getModel()->$nodeType); - $fields = array(); + $fields = []; switch ($nodeType) { case 'host': $fields = ['enabled', 'name', 'address']; diff --git a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.php b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.php index 0669849ed4..37e495b0f5 100644 --- a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.php +++ b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.php @@ -31,6 +31,7 @@ namespace OPNsense\Relayd; use OPNsense\Base\BaseModel; +use OPNsense\Base\Messages\Message; /** * Class Relayd @@ -65,6 +66,107 @@ public function configClean() return @unlink("/tmp/relayd.dirty"); } + /** + * {@inheritdoc} + */ + public function performValidation($validateFullModel = false) + { + $messages = parent::performValidation($validateFullModel); + foreach ($this->virtualserver->iterateItems() as $node) { + if (!$validateFullModel && !$node->isFieldChanged()) { + continue; + } + $key = $node->__reference; + if ($node->type == 'redirect') { + if (!in_array((string)$node->transport_tablemode, ['least-states', 'roundrobin'])) { + $messages->appendMessage( + new Message( + sprintf(gettext('Scheduler "%s" not supported for redirects.'), $node->transport_tablemode), + $key . ".transport_tablemode" + ) + ); + } + if (!in_array((string)$node->backuptransport_tablemode, ['least-states', 'roundrobin'])) { + $messages->appendMessage( + new Message( + sprintf(gettext('Scheduler "%s" not supported for redirects.'), $node->transport_tablemode), + $key . ".backuptransport_tablemode" + ) + ); + } + if ($node->transport_type == 'route' && empty((string)$node->routing_interface)) { + $messages->appendMessage( + new Message(gettext('Routing interface cannot be empty'), $key . ".routing_interface") + ); + } + } elseif ($node->type == 'relay') { + if ($node->transport_tablemode == 'least-states') { + $messages->appendMessage( + new Message( + sprintf(gettext('Scheduler "%s" not supported for relays.'), $node->transport_tablemode), + $key . ".transport_tablemode" + ) + ); + } + if ($node->backuptransport_tablemode == 'least-states') { + $messages->appendMessage( + new Message( + sprintf( + gettext('Scheduler "%s" not supported for relays.'), + $node->backuptransport_tablemode + ), + $key . ".backuptransport_tablemode" + ) + ); + } + } + foreach ($this->tablecheck->iterateItems() as $node) { + if (!$validateFullModel && !$node->isFieldChanged()) { + continue; + } + $key = $node->__reference; + switch ((string)$node->type) { + case 'send': + if (empty((string)$node->expect)) { + $messages->appendMessage( + new Message(gettext('Expect Pattern cannot be empty.'), $key . ".expect") + ); + } + break; + case 'script': + if (empty((string)$node->path)) { + $messages->appendMessage( + new Message(gettext('Script path cannot be empty.'), $key . ".path") + ); + } + break; + case 'http': + if (empty((string)$node->path)) { + $messages->appendMessage( + new Message(gettext('Path cannot be empty.'), $key . ".path") + ); + } + if (empty((string)$node->code) && empty((string)$node->digest)) { + $messages->appendMessage( + new Message( + gettext('Provide one of Response Code or Message Digest.'), + $key . ".code" + ) + ); + $messages->appendMessage( + new Message( + gettext('Provide one of Response Code or Message Digest.'), + $key . ".digest" + ) + ); + } + break; + } + } + } + return $messages; + } + /** * @param string $type type of object (host, table, virtualserver) * @param string $name name of the attribute From e18f0ef182b49f2e2ec000d847363e4e6cbeb548 Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Wed, 20 Mar 2024 16:11:31 +0100 Subject: [PATCH 1824/3088] security/acme-client: add support for ArtFiles DNS API --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsArtfiles.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 3 files changed, 67 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsArtfiles.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 98fdc7e56c..151eec1a6d 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1483,6 +1483,21 @@ password + + + header + + + + validation.dns_artfiles_username + + text + + + validation.dns_artfiles_password + + password + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsArtfiles.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsArtfiles.php new file mode 100644 index 0000000000..2c6e5eca80 --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsArtfiles.php @@ -0,0 +1,45 @@ +acme_env['AF_API_USERNAME'] = (string)$this->config->dns_artfiles_username; + $this->acme_env['AF_API_PASSWORD'] = (string)$this->config->dns_artfiles_password; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index a583d068bd..b2e378a9d3 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -426,6 +426,7 @@ aliyun.com All-Inkl.com ArvanCloud + ArtFiles Aurora (PCextreme/Versio) AutoDNS (InterNetX) AWS Route 53 @@ -1123,6 +1124,12 @@ N + + N + + + N + N From b258cab9bd8ebbb6310868ca72ff6ff3d5e000d0 Mon Sep 17 00:00:00 2001 From: Brendan Bank <63699049+brendanbank@users.noreply.github.com> Date: Wed, 27 Mar 2024 09:05:33 +0100 Subject: [PATCH 1825/3088] dns:bind: do not add the update-policy if the zone type is secondary (#3873) --- .../src/opnsense/service/templates/OPNsense/Bind/named.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf index 0c091b00ed..23839cf437 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf @@ -180,7 +180,7 @@ zone "{{ domain.domainname }}" { {% endfor %} }; {% endif %} -{% if domain.allowrndcupdate is defined and domain.allowrndcupdate == "1" %} +{% if domain.allowrndcupdate is defined and domain.allowrndcupdate == "1" and domain.type != 'secondary' %} update-policy { grant rndc-key zonesub ANY; }; From 3835878b5f034107cbaebc05a52174d79fd6c85c Mon Sep 17 00:00:00 2001 From: stuart-mclaren <8805659+stuart-mclaren@users.noreply.github.com> Date: Fri, 29 Mar 2024 07:37:32 +0000 Subject: [PATCH 1826/3088] net/freeradius: Support NT hash of user password (#3828) * net/freeradius: Support NT hash of user password To improve security provide an "advanced" option to avoid storing users' radius passwords in plaintext. The default behaviour is unchanged. Tested using an openwrt access point as a client with the opnsense freeradius plugin set to use PEAP. Compare: https://github.com/pfsense/FreeBSD-ports/pull/822 * net/freeradius: Bump user model version To reflect NT password hash change. --------- Co-authored-by: Stuart McLaren --- .../Freeradius/forms/dialogEditFreeRADIUSUser.xml | 7 +++++++ .../mvc/app/models/OPNsense/Freeradius/User.xml | 11 ++++++++++- .../service/templates/OPNsense/Freeradius/users | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/dialogEditFreeRADIUSUser.xml b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/dialogEditFreeRADIUSUser.xml index ea4848a834..e6fc8d7484 100644 --- a/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/dialogEditFreeRADIUSUser.xml +++ b/net/freeradius/src/opnsense/mvc/app/controllers/OPNsense/Freeradius/forms/dialogEditFreeRADIUSUser.xml @@ -17,6 +17,13 @@ password Set the password for the user. Allowed characters are 0-9, a-z, A-Z, and ,._-!$%/()+#= with up to 128 characters. + + user.passwordencryption + + dropdown + true + Cleartext-Password The password will be stored in plaintext. This may be less secure than alternatives. Works with all RADIUS authentication protocols.
    NT-Password (pre-hashed) An NT hash of the password will be stored. First the NT hash of the password should be generated; this will be a string such as 469DCB69D4A58A5F29272787713D96F8. Then the hash (not the password) should be entered into the password field above. A command such as smbencrypt secret123 may be used to generate the pre-hashed NT Password. Works with the following RADIUS authentication protocols: PEAP, EAP-MSCHAPv2, EAP-GTC, PAP, MS-CHAP, Cisco LEAP.]]>
    +
    user.description diff --git a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml index 616b946b9e..506ab2d3f9 100644 --- a/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml +++ b/net/freeradius/src/opnsense/mvc/app/models/OPNsense/Freeradius/User.xml @@ -1,7 +1,7 @@ //OPNsense/freeradius/user FreeRADIUS user configuration - 1.0.3 + 1.0.4 @@ -17,6 +17,15 @@ Y /^([0-9a-zA-Z._\-\!\$\%\/\(\)\+\#\=\{\}]){1,128}$/u + + Cleartext-Password + Y + N + + Cleartext-Password + NT-Password (pre-hashed) + + N diff --git a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users index a7c46550e6..ff9a97916f 100644 --- a/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users +++ b/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users @@ -3,7 +3,7 @@ {% for user_list in helpers.toList('OPNsense.freeradius.user.users.user') %} {% if user_list.enabled == '1' %} -{{ user_list.username }} Cleartext-Password := "{{ user_list.password }}"{% if helpers.exists('OPNsense.freeradius.general.sessionlimit') and OPNsense.freeradius.general.sessionlimit == '1' %}{% if user_list.sessionlimit_max_session_limit is defined %}, Max-Daily-Session := {{ user_list.sessionlimit_max_session_limit }}{% endif %}{% endif %}{% if user_list.simuse is defined %}, Simultaneous-Use := "{{ user_list.simuse }}"{% endif %}{% if user_list.logintime is defined %}, Login-Time := "{{ user_list.logintime }}"{% endif %} +{{ user_list.username }} {{ user_list.passwordencryption }} := "{{ user_list.password }}"{% if helpers.exists('OPNsense.freeradius.general.sessionlimit') and OPNsense.freeradius.general.sessionlimit == '1' %}{% if user_list.sessionlimit_max_session_limit is defined %}, Max-Daily-Session := {{ user_list.sessionlimit_max_session_limit }}{% endif %}{% endif %}{% if user_list.simuse is defined %}, Simultaneous-Use := "{{ user_list.simuse }}"{% endif %}{% if user_list.logintime is defined %}, Login-Time := "{{ user_list.logintime }}"{% endif %} {% if user_list.ip is defined %} Framed-IP-Address = {{ user_list.ip }}, From 26e6379874d56190e409c07c37cb12a58679c1ff Mon Sep 17 00:00:00 2001 From: Malte Rabenseifner Date: Fri, 29 Mar 2024 10:53:29 +0100 Subject: [PATCH 1827/3088] net-mgmt/zabbix-proxy: Add logging options (#3711) --- .../OPNsense/Zabbixproxy/forms/general.xml | 19 +++++++++++++++ .../models/OPNsense/Zabbixproxy/General.xml | 24 ++++++++++++++++++- .../OPNsense/Zabbixproxy/zabbix_proxy.conf.in | 11 +++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml b/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml index 168f981c3c..efef9db911 100644 --- a/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml +++ b/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/controllers/OPNsense/Zabbixproxy/forms/general.xml @@ -153,6 +153,25 @@ true IP address of host allowed to retrieve proxy statistics. + + general.syslogEnable + + checkbox + Use syslog instead of logging to a file. + + + general.logFileSize + + text + Maximum size of log file (in MB). + true + + + general.debugLevel + + dropdown + Specifies the debug level for the proxy. + general.encryption diff --git a/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml b/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml index ab55fb06cc..e9a060522f 100644 --- a/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml +++ b/net-mgmt/zabbix-proxy/src/opnsense/mvc/app/models/OPNsense/Zabbixproxy/General.xml @@ -1,7 +1,7 @@ //OPNsense/zabbixproxy/general Zabbix Proxy configuration - 2.0.3 + 2.0.4 0 @@ -106,6 +106,28 @@ Y N + + 0 + Y + + + 100 + 1 + 1024 + Y + + + val_3 + + basic information (0) + critical information (1) + error information (2) + warnings (3, default) + debugging (4) + extended debugging (5) + + Y + 0 Y diff --git a/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in b/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in index 3ee03b5dc1..23d9f5cb3c 100644 --- a/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in +++ b/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in @@ -25,7 +25,18 @@ ListenPort={{ OPNsense.zabbixproxy.general.listenport }} {% if helpers.exists('OPNsense.zabbixproxy.general.sourceip') and OPNsense.zabbixproxy.general.sourceip != '' %} SourceIP={{ OPNsense.zabbixproxy.general.sourceip }} {% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.syslogEnable') and OPNsense.zabbixproxy.general.syslogEnable == '1' %} +LogType=system +{% else %} +LogType=file LogFile=/var/log/zabbix/zabbix_proxy.log +{% if helpers.exists('OPNsense.zabbixproxy.general.logFileSize') %} +LogFileSize={{OPNsense.zabbixproxy.general.logFileSize}} +{% endif %} +{% endif %} +{% if helpers.exists('OPNsense.zabbixproxy.general.debugLevel') +DebugLevel={{OPNsense.zabbixproxy.general.debugLevel|replace("val_", "")}} +{% endif %} PidFile=/var/run/zabbix/zabbix_proxy.pid DBName=/var/db/zabbix/%%PLUGIN_VARIANT%%_proxy.db {% if helpers.exists('OPNsense.zabbixproxy.general.proxyofflinebuffer') and OPNsense.zabbixproxy.general.proxyofflinebuffer != '' %} From a2ccdcc65ef005ca365b6da447444f37195bb68a Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Sat, 30 Mar 2024 08:43:03 +0300 Subject: [PATCH 1828/3088] adjust severity levels --- .../opnsense/mvc/app/models/OPNsense/Bind/General.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml index 8ab42f3c62..9935dbae45 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml @@ -1,7 +1,7 @@ //OPNsense/bind/general BIND configuration - 1.0.11 + 1.0.12 0 @@ -78,14 +78,13 @@ - Emergency - Alert - Critical + Critical Error - Warning + Warning Notice Informational Debug + Dynamic Y info From 354782cf9beff470c46580859556d8e070aa2416 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:36:18 +0200 Subject: [PATCH 1829/3088] www/caddy: v1.5.3 (#3865) --- www/caddy/Makefile | 4 +- www/caddy/pkg-descr | 13 ++ .../Caddy/Api/ReverseProxyController.php | 4 +- .../OPNsense/Caddy/forms/dialogHandle.xml | 74 +++++----- .../Caddy/forms/dialogReverseProxy.xml | 72 ++++++---- .../OPNsense/Caddy/forms/dialogSubdomain.xml | 45 +++--- .../OPNsense/Caddy/forms/dnsprovider.xml | 36 ++--- .../OPNsense/Caddy/forms/dynamicdns.xml | 37 ++--- .../OPNsense/Caddy/forms/general.xml | 12 +- .../OPNsense/Caddy/forms/logsettings.xml | 2 - .../mvc/app/models/OPNsense/Caddy/Caddy.php | 2 +- .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 39 ++---- .../views/OPNsense/Caddy/reverse_proxy.volt | 10 +- .../scripts/OPNsense/Caddy/caddy_certs.php | 7 +- .../opnsense/scripts/OPNsense/Caddy/setup.sh | 28 ++-- .../service/conf/actions.d/actions_caddy.conf | 1 + .../templates/OPNsense/Caddy/Caddyfile | 130 +++++++----------- 17 files changed, 244 insertions(+), 272 deletions(-) diff --git a/www/caddy/Makefile b/www/caddy/Makefile index 95dd8078a2..138ee9fee6 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= caddy -PLUGIN_VERSION= 1.5.2 +PLUGIN_VERSION= 1.5.3 PLUGIN_DEPENDS= caddy-custom -PLUGIN_COMMENT= Easy to configure Reverse Proxy based on Caddy with Automatic HTTPS and Dynamic DNS +PLUGIN_COMMENT= Easy to configure Reverse Proxy with Automatic HTTPS and Dynamic DNS PLUGIN_MAINTAINER= cedrik@pischem.com .include "../../Mk/plugins.mk" diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 483ce846cb..72f60a2dac 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -19,9 +19,22 @@ Main features of this plugin: * Syslog-ng integration and HTTP Access Log * NTLM Transport +DOC: https://docs.opnsense.org/manual/how-tos/caddy.html + Plugin Changelog ================ +1.5.3 + +* Change from "Phalcon Messages" to "OPNsense Messages" in Caddy.php. +* Change default storage location from /usr/local/etc/caddy to /var/db/caddy/data/caddy/. +* Change description from "TextField" to "DescriptionField" in Caddy.xml model. +* Add tls_insecure_skip_verify to handlers. +* Add possibility to restart Caddy with the ACME Client by using "Automations - Run Command - System or Plugin Command". +* Add option to redirect the ACME HTTP-01 challenge to an upstream destination as advanced option in domains. +* Remove unmaintained DNS Providers: dnspod, hetzner, namesilo, vercel, alidns, metaname, openstack-designate. +* Cleanup dialogs and UI to present all options better. + 1.5.2 * Increased timeout of message area in reverse_proxy.volt and general.volt to 15 seconds. diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php index a1d71c8312..5236dfba93 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php @@ -43,7 +43,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase public function searchReverseProxyAction() { - return $this->searchBase("reverseproxy.reverse", ['enabled', 'FromDomain', 'FromPort', 'accesslist', 'basicauth', 'DnsChallenge', 'CustomCertificate', 'AccessLog', 'DynDns', 'description']); + return $this->searchBase("reverseproxy.reverse", ['enabled', 'FromDomain', 'FromPort', 'accesslist', 'basicauth', 'DnsChallenge', 'CustomCertificate', 'AccessLog', 'DynDns', 'AcmePassthrough', 'description']); } public function setReverseProxyAction($uuid) @@ -109,7 +109,7 @@ public function toggleSubdomainAction($uuid, $enabled = null) public function searchHandleAction() { - return $this->searchBase("reverseproxy.handle", ['enabled', 'reverse', 'subdomain', 'HandleType', 'HandlePath', 'ToDomain', 'ToPort', 'ToPath', 'HttpTls', 'HttpTlsTrustedCaCerts', 'HttpTlsServerName', 'HttpNtlm', 'description']); + return $this->searchBase("reverseproxy.handle", ['enabled', 'reverse', 'subdomain', 'HandleType', 'HandlePath', 'ToDomain', 'ToPort', 'ToPath', 'HttpTls', 'HttpTlsTrustedCaCerts', 'HttpTlsServerName', 'HttpNtlm', 'HttpTlsInsecureSkipVerify', 'description']); } public function setHandleAction($uuid) diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml index 26bb9cacbc..68ac76a59b 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml @@ -7,85 +7,95 @@ handle.reverse - + dropdown handle.subdomain - + dropdown - - true + handle.HandleType dropdown - + true handle.HandlePath text - - true + + + + handle.description + + text + + + + header + handle.ToDomain - + text 192.168.1.1 - + handle.ToPort - + text - 443 - - true + 80 + handle.ToPath - + text - + true + + header + + true + handle.HttpTls checkbox - + + + + handle.HttpNtlm + + checkbox + + true + + + handle.HttpTlsInsecureSkipVerify + + checkbox + true handle.HttpTlsTrustedCaCerts dropdown - - true + handle.HttpTlsServerName text - true - - - handle.HttpNtlm - - checkbox - - true - - - handle.description - - text - diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogReverseProxy.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogReverseProxy.xml index 16699cf3a6..a849f3593b 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogReverseProxy.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogReverseProxy.xml @@ -7,33 +7,41 @@ reverse.FromDomain - + text example.com reverse.FromPort - + text 443 - true - reverse.accesslist - - dropdown - - true + reverse.description + + text + example.com.443 + - reverse.basicauth - - select_multiple - 5 - - true + header + + true + + + reverse.DynDns + + checkbox + + + + header + + true reverse.DnsChallenge @@ -42,30 +50,40 @@ - reverse.DynDns - - checkbox - + reverse.AcmePassthrough + + text + + true reverse.CustomCertificate dropdown - true + + + header + + true + + + reverse.accesslist + + dropdown + + + + reverse.basicauth + + select_multiple + 5 + reverse.AccessLog checkbox - true - - - reverse.description - - text - example.com.443 - diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogSubdomain.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogSubdomain.xml index a43e961eee..4aeace28a4 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogSubdomain.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogSubdomain.xml @@ -7,31 +7,52 @@ subdomain.reverse - + dropdown subdomain.FromDomain - + text opn.example.com subdomain.FromPort - + text 443 - true + + + subdomain.description + + text + opn.example.com.443 + + + + header + + true + + + subdomain.DynDns + + checkbox + + + + header + + true subdomain.accesslist dropdown - true subdomain.basicauth @@ -39,19 +60,5 @@ select_multiple 5 - true - - - subdomain.DynDns - - checkbox - - - - subdomain.description - - text - opn.example.com.443 - diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml index ad963b984b..cd6f75bf78 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml @@ -9,55 +9,41 @@ caddy.general.TlsDnsApiKey text - + + + + header + + true caddy.general.TlsDnsSecretApiKey text - - true + caddy.general.TlsDnsOptionalField1 text - - true + caddy.general.TlsDnsOptionalField2 text - - true + caddy.general.TlsDnsOptionalField3 text - - true + caddy.general.TlsDnsOptionalField4 text - - true - - - caddy.general.TlsDnsOptionalField5 - - text - - true - - - caddy.general.TlsDnsOptionalField6 - - text - - true + diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml index d57c17e575..d7fa66ef17 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml @@ -1,17 +1,9 @@
    - caddy.general.DynDnsSimpleHttp - - text - - true - - - caddy.general.DynDnsInterface - + caddy.general.DynDnsIpVersions + dropdown - - true + caddy.general.DynDnsCheckInterval @@ -19,16 +11,27 @@ text - - caddy.general.DynDnsIpVersions - - dropdown - - caddy.general.DynDnsTTL text + + header + + true + + + caddy.general.DynDnsSimpleHttp + + text + + + + caddy.general.DynDnsInterface + + dropdown + +
    diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/general.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/general.xml index b00d7085eb..e17e870261 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/general.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/general.xml @@ -18,16 +18,16 @@ dropdown - - caddy.general.abort - - checkbox - - caddy.general.accesslist dropdown + + caddy.general.abort + + checkbox + + diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/logsettings.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/logsettings.xml index 5af8a9a146..022ce6ca01 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/logsettings.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/logsettings.xml @@ -10,7 +10,6 @@ checkbox - true caddy.general.LogAccessPlainKeep @@ -18,6 +17,5 @@ 10 text - true diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php index e9bbb97dfe..953f284fb1 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php @@ -31,7 +31,7 @@ namespace OPNsense\Caddy; use OPNsense\Base\BaseModel; -use Phalcon\Messages\Message; +use OPNsense\Base\Messages\Message; class Caddy extends BaseModel { diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index 89bc764fbb..3d8497fd33 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -1,7 +1,7 @@ //Pischem/caddy A GUI model for configuring a reverse proxy in the Caddy web server. - 1.1.4 + 1.1.5 @@ -26,8 +26,6 @@ Cloudflare Duck DNS DigitalOcean - DNSPod - Hetzner GoDaddy Gandi IONOS @@ -35,19 +33,14 @@ Porkbun Route53 ACME-DNS - Alidns Google Cloud DNS Azure - OpenStack Designate OVH Namecheap Netlify - Namesilo PowerDNS - Vercel DDNSS Njalla - Metaname Linode Tencent Cloud Dinahosting @@ -61,8 +54,6 @@ - - @@ -146,15 +137,17 @@ Y - + Y - /^([\t\n\v\f\r 0-9a-zA-Z.,_*-\x{00A0}-\x{FFFF}]){1,255}$/u - Please provide a valid description. + + Please enter a valid 'to' domain or IP address. + Y + @@ -200,10 +193,8 @@ Y - + Y - /^([\t\n\v\f\r 0-9a-zA-Z.,_-\x{00A0}-\x{FFFF}]){1,255}$/u - Please provide a valid description. @@ -259,6 +250,7 @@ + ca @@ -269,10 +261,7 @@ Y N - - /^([\t\n\v\f\r 0-9a-zA-Z.,_-\x{00A0}-\x{FFFF}]){1,255}$/u - Please provide a valid description. - + @@ -289,10 +278,7 @@ Please enter valid IP address(es) or network(s), separated by commas. - - /^([\t\n\v\f\r 0-9a-zA-Z.,_*-\x{00A0}-\x{FFFF}]){1,255}$/u - Please provide a valid description. - + @@ -303,10 +289,7 @@ Y - - /^([\t\n\v\f\r 0-9a-zA-Z.,_-\x{00A0}-\x{FFFF}]){1,255}$/u - Please provide a valid description. - + diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt index 1ba868a24c..92aaac25d0 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt @@ -166,6 +166,7 @@ Dynamic DNS HTTP Access Log Custom Certificate + HTTP-01 redirection Description Commands @@ -232,14 +233,15 @@ Domain Subdomain Handle Type - Handle Path - Backend Domain - Backend Port - Backend Path + Handle Path + Upstream Domain + Upstream Port + Upstream Path TLS TLS CA TLS Server Name NTLM + TLS Insecure Skip Verify Description Commands diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php index f4f0f6bf60..0f6078b466 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php @@ -29,13 +29,11 @@ */ require_once("config.inc"); -require_once("certs.inc"); -require_once("legacy_bindings.inc"); use OPNsense\Core\Config; $configObj = Config::getInstance()->object(); -$temp_dir = '/usr/local/etc/caddy/certificates/temp/'; +$temp_dir = '/var/db/caddy/data/caddy/certificates/temp/'; function extract_and_save_certificates($configObj, $temp_dir) { @@ -68,9 +66,7 @@ function extract_and_save_certificates($configObj, $temp_dir) // Save the certificate chain and private key file_put_contents($temp_dir . $cert_refid . '.pem', $cert_chain); - chmod($temp_dir . $cert_refid . '.pem', 0600); file_put_contents($temp_dir . $cert_refid . '.key', $key_content); - chmod($temp_dir . $cert_refid . '.key', 0600); } // Traverse through CA certificates and save them @@ -80,7 +76,6 @@ function extract_and_save_certificates($configObj, $temp_dir) // Save the CA certificate file_put_contents($temp_dir . $ca_refid . '.pem', $ca_content); - chmod($temp_dir . $ca_refid . '.pem', 0600); } } diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/setup.sh b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/setup.sh index 6ee35ebb7b..334bd5672b 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/setup.sh +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/setup.sh @@ -2,37 +2,25 @@ # Define directories CADDY_DIR="/usr/local/etc/caddy" -CADDY_ACME_DIR="${CADDY_DIR}/acme" -CADDY_CERTS_DIR="${CADDY_DIR}/certificates/temp" -CADDY_OCSP_DIR="${CADDY_DIR}/ocsp" -CADDY_LOCKS_DIR="${CADDY_DIR}/locks" +CADDY_CERTS_DIR="/var/db/caddy/data/caddy/certificates/temp" CADDY_LOG_DIR="/var/log/caddy/access" CADDY_CONF_DIR="${CADDY_DIR}/caddy.d" -# Create Caddy configuration directories with appropriate permissions -mkdir -p "${CADDY_DIR}" -mkdir -p "${CADDY_ACME_DIR}" +# Create custom directories with appropriate permissions mkdir -p "${CADDY_CERTS_DIR}" -mkdir -p "${CADDY_OCSP_DIR}" -mkdir -p "${CADDY_LOCKS_DIR}" -mkdir -p "${CADDY_CONF_DIR}" - -# Set permissions for Caddy configuration directories -chown -R root:wheel "${CADDY_DIR}" -chmod -R 750 "${CADDY_DIR}" +chown -R root:wheel "${CADDY_CERTS_DIR}" +chmod -R 600 "${CADDY_CERTS_DIR}" -# Create Caddy log directory mkdir -p "${CADDY_LOG_DIR}" - -# Set permissions for Caddy log directory chown -R root:wheel "${CADDY_LOG_DIR}" chmod -R 750 "${CADDY_LOG_DIR}" +mkdir -p "${CADDY_CONF_DIR}" +chown -R root:wheel "${CADDY_CONF_DIR}" +chmod -R 750 "${CADDY_CONF_DIR}" + # Format and overwrite the Caddyfile (cd "${CADDY_DIR}" && /usr/local/bin/caddy fmt --overwrite) # Write custom certs from the OPNsense Trust Store into a directory where Caddy can read them /usr/local/opnsense/scripts/OPNsense/Caddy/caddy_certs.php - -# Optional Debug message -# echo "Caddy installation completed. All caddy directories and files created successfully." diff --git a/www/caddy/src/opnsense/service/conf/actions.d/actions_caddy.conf b/www/caddy/src/opnsense/service/conf/actions.d/actions_caddy.conf index 764809f8e8..28b10be8d5 100644 --- a/www/caddy/src/opnsense/service/conf/actions.d/actions_caddy.conf +++ b/www/caddy/src/opnsense/service/conf/actions.d/actions_caddy.conf @@ -15,6 +15,7 @@ command:/usr/local/opnsense/scripts/OPNsense/Caddy/caddy_control.py restart parameters: type:script message:Reloading Caddy configuration +description:Restart Caddy service [validate] command:/usr/local/opnsense/scripts/OPNsense/Caddy/caddy_control.py validate diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index 079d3a19e1..e0e84bc72b 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -4,9 +4,6 @@ # Global Options { - storage file_system { - root /usr/local/etc/caddy - } log { {% if generalSettings.LogAccessPlain|default("0") == "0" %} {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} @@ -57,8 +54,6 @@ {% set dnsOptionalField2 = generalSettings.TlsDnsOptionalField2 %} {% set dnsOptionalField3 = generalSettings.TlsDnsOptionalField3 %} {% set dnsOptionalField4 = generalSettings.TlsDnsOptionalField4 %} - {% set dnsOptionalField5 = generalSettings.TlsDnsOptionalField5 %} - {% set dnsOptionalField6 = generalSettings.TlsDnsOptionalField6 %} {% set dynDnsSimpleHttp = generalSettings.DynDnsSimpleHttp %} {% set dynDnsInterface = generalSettings.DynDnsInterface %} {% set dynDnsCheckInterval = generalSettings.DynDnsCheckInterval %} @@ -85,7 +80,7 @@ {% if dnsProvider and dnsProvider != "none" and dnsProvider != "acmedns" and dynDnsDomains|length > 0 %} dynamic_dns { - {% if dnsProvider in ['porkbun', 'desec', 'route53', 'alidns', 'googleclouddns', 'azure', 'openstack-designate', 'ovh', 'namecheap', 'powerdns', 'ddnss', 'linode', 'tencentcloud', 'dinahosting', 'hexonet', 'mailinabox'] %} + {% if dnsProvider in ['porkbun', 'desec', 'route53', 'googleclouddns', 'azure', 'ovh', 'namecheap', 'powerdns', 'ddnss', 'linode', 'tencentcloud', 'dinahosting', 'hexonet', 'mailinabox'] %} provider {{ dnsProvider }} { {% if dnsProvider == 'porkbun' %} {% if dnsApiKey %}api_key {{ dnsApiKey }} @@ -108,11 +103,6 @@ {% endif %} {% if dnsOptionalField4 %}token {{ dnsOptionalField4 }} {% endif %} - {% elif dnsProvider == 'alidns' %} - {% if dnsApiKey %}access_key_id {{ dnsApiKey }} - {% endif %} - {% if dnsSecretApiKey %}access_key_secret {{ dnsSecretApiKey }} - {% endif %} {% elif dnsProvider == 'googleclouddns' %} {% if dnsApiKey %}gcp_project {{ dnsApiKey }} {% endif %} @@ -127,23 +117,6 @@ {% endif %} {% if dnsOptionalField3 %}resource_group_name {{ dnsOptionalField3 }} {% endif %} - {% elif dnsProvider == 'openstack-designate' %} - {% if dnsApiKey %}region_name {{ dnsApiKey }} - {% endif %} - {% if dnsSecretApiKey %}tenant_id {{ dnsSecretApiKey }} - {% endif %} - {% if dnsOptionalField1 %}identity_api_version {{ dnsOptionalField1 }} - {% endif %} - {% if dnsOptionalField2 %}password {{ dnsOptionalField2 }} - {% endif %} - {% if dnsOptionalField3 %}username {{ dnsOptionalField3 }} - {% endif %} - {% if dnsOptionalField4 %}tenant_name {{ dnsOptionalField4 }} - {% endif %} - {% if dnsOptionalField5 %}auth_url {{ dnsOptionalField5 }} - {% endif %} - {% if dnsOptionalField6 %}endpoint_type {{ dnsOptionalField6 }} - {% endif %} {% elif dnsProvider == 'ovh' %} {% if dnsApiKey %}endpoint {{ dnsApiKey }} {% endif %} @@ -204,8 +177,6 @@ {% endif %} {% endif %} } - {% elif dnsProvider in ['metaname'] %} - provider {{ dnsProvider }} {{ dnsApiKey }} {{ dnsSecretApiKey }} {% else %} provider {{ dnsProvider }} {{ dnsApiKey }} {% endif %} @@ -248,9 +219,24 @@ } # Reverse Proxy Configuration -{% macro tls_configuration(dnsProvider, dnsApiKey, customCert, dnsChallenge, dnsSecretApiKey, TlsDnsOptionalField1, TlsDnsOptionalField2, TlsDnsOptionalField3, TlsDnsOptionalField4, TlsDnsOptionalField5, TlsDnsOptionalField6) %} + +{% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} + {% if reverse.enabled|default("0") == "1" and reverse.AcmePassthrough %} + # HTTP-01 challenge redirection for domain: "{{ reverse['@uuid'] }}" + http://{{ reverse.FromDomain|default("") }} { + handle /.well-known/acme-challenge/* { + reverse_proxy {{ reverse.AcmePassthrough }} + } + handle { + redir https://{host}{uri} 308 + } + } + {% endif %} +{% endfor %} + +{% macro tls_configuration(dnsProvider, dnsApiKey, customCert, dnsChallenge, dnsSecretApiKey, TlsDnsOptionalField1, TlsDnsOptionalField2, TlsDnsOptionalField3, TlsDnsOptionalField4) %} {% if dnsChallenge == "1" and dnsProvider and dnsProvider != "none" %} - {% if dnsProvider in ['duckdns', 'porkbun', 'desec', 'route53', 'acmedns', 'alidns', 'googleclouddns', 'azure', 'openstack-designate', 'ovh', 'namecheap', 'powerdns', 'ddnss', 'linode', 'tencentcloud', 'dinahosting', 'hexonet', 'mailinabox'] %} + {% if dnsProvider in ['duckdns', 'porkbun', 'desec', 'route53', 'acmedns', 'googleclouddns', 'azure', 'ovh', 'namecheap', 'powerdns', 'ddnss', 'linode', 'tencentcloud', 'dinahosting', 'hexonet', 'mailinabox'] %} tls { dns {{ dnsProvider }} { {% if dnsProvider == 'duckdns' %} @@ -288,11 +274,6 @@ {% endif %} {% if dnsOptionalField2 %}server_url {{ dnsOptionalField2 }} {% endif %} - {% elif dnsProvider == 'alidns' %} - {% if dnsApiKey %}access_key_id {{ dnsApiKey }} - {% endif %} - {% if dnsSecretApiKey %}access_key_secret {{ dnsSecretApiKey }} - {% endif %} {% elif dnsProvider == 'googleclouddns' %} {% if dnsApiKey %}gcp_project {{ dnsApiKey }} {% endif %} @@ -307,23 +288,6 @@ {% endif %} {% if dnsOptionalField3 %}resource_group_name {{ dnsOptionalField3 }} {% endif %} - {% elif dnsProvider == 'openstack-designate' %} - {% if dnsApiKey %}region_name {{ dnsApiKey }} - {% endif %} - {% if dnsSecretApiKey %}tenant_id {{ dnsSecretApiKey }} - {% endif %} - {% if dnsOptionalField1 %}identity_api_version {{ dnsOptionalField1 }} - {% endif %} - {% if dnsOptionalField2 %}password {{ dnsOptionalField2 }} - {% endif %} - {% if dnsOptionalField3 %}username {{ dnsOptionalField3 }} - {% endif %} - {% if dnsOptionalField4 %}tenant_name {{ dnsOptionalField4 }} - {% endif %} - {% if dnsOptionalField5 %}auth_url {{ dnsOptionalField5 }} - {% endif %} - {% if dnsOptionalField6 %}endpoint_type {{ dnsOptionalField6 }} - {% endif %} {% elif dnsProvider == 'ovh' %} {% if dnsApiKey %}endpoint {{ dnsApiKey }} {% endif %} @@ -385,10 +349,6 @@ {% endif %} } } - {% elif dnsProvider in ['metaname'] %} - tls { - dns {{ dnsProvider }} {{ dnsApiKey }} {{ dnsSecretApiKey }} - } {% else %} tls { dns {{ dnsProvider }} {{ dnsApiKey }} @@ -396,7 +356,7 @@ {% endif %} {% endif %} {% if customCert %} - tls /usr/local/etc/caddy/certificates/temp/{{ customCert }}.pem /usr/local/etc/caddy/certificates/temp/{{ customCert }}.key + tls /var/db/caddy/data/caddy/certificates/temp/{{ customCert }}.pem /var/db/caddy/data/caddy/certificates/temp/{{ customCert }}.key {% endif %} {% endmacro %} @@ -406,28 +366,36 @@ rewrite * {{ handle.ToPath }}{uri} {% endif %} reverse_proxy {{ handle.ToDomain }}{% if handle.ToPort %}:{{ handle.ToPort }}{% endif %} { - {% if handle.HttpTls|default("0") == "1" %} - {% if handle.HttpNtlm|default("0") == "1" %} - transport http_ntlm { - tls - {% if handle.HttpTlsTrustedCaCerts %} - tls_trusted_ca_certs /usr/local/etc/caddy/certificates/temp/{{ handle.HttpTlsTrustedCaCerts }}.pem - {% endif %} - {% if handle.HttpTlsServerName %} - tls_server_name {{ handle.HttpTlsServerName }} - {% endif %} - } - {% else %} - transport http { - tls - {% if handle.HttpTlsTrustedCaCerts %} - tls_trusted_ca_certs /usr/local/etc/caddy/certificates/temp/{{ handle.HttpTlsTrustedCaCerts }}.pem - {% endif %} - {% if handle.HttpTlsServerName %} - tls_server_name {{ handle.HttpTlsServerName }} + {% if handle.HttpTls|default("0") == "1" or handle.HttpTlsInsecureSkipVerify|default("0") == "1" %} + {% if handle.HttpNtlm|default("0") == "1" %} + transport http_ntlm { + {% if handle.HttpTlsInsecureSkipVerify|default("0") == "1" %} + tls_insecure_skip_verify + {% else %} + tls + {% if handle.HttpTlsTrustedCaCerts %} + tls_trusted_ca_certs /var/db/caddy/data/caddy/certificates/temp/{{ handle.HttpTlsTrustedCaCerts }}.pem + {% endif %} + {% if handle.HttpTlsServerName %} + tls_server_name {{ handle.HttpTlsServerName }} + {% endif %} + {% endif %} + } + {% else %} + transport http { + {% if handle.HttpTlsInsecureSkipVerify|default("0") == "1" %} + tls_insecure_skip_verify + {% else %} + tls + {% if handle.HttpTlsTrustedCaCerts %} + tls_trusted_ca_certs /var/db/caddy/data/caddy/certificates/temp/{{ handle.HttpTlsTrustedCaCerts }}.pem + {% endif %} + {% if handle.HttpTlsServerName %} + tls_server_name {{ handle.HttpTlsServerName }} + {% endif %} + {% endif %} + } {% endif %} - } - {% endif %} {% endif %} } } @@ -471,7 +439,7 @@ {% endif %} {% set customCert = reverse.CustomCertificate|default("") %} {% set dnsChallenge = reverse.DnsChallenge|default("0") %} - {{ tls_configuration(dnsProvider, dnsApiKey, customCert, dnsChallenge, dnsSecretApiKey, TlsDnsOptionalField1, TlsDnsOptionalField2, TlsDnsOptionalField3, TlsDnsOptionalField4, TlsDnsOptionalField5, TlsDnsOptionalField6) }} + {{ tls_configuration(dnsProvider, dnsApiKey, customCert, dnsChallenge, dnsSecretApiKey, TlsDnsOptionalField1, TlsDnsOptionalField2, TlsDnsOptionalField3, TlsDnsOptionalField4) }} {% if not reverse.accesslist %} {% set basicauth_uuids = reverse.basicauth %} From 1618fc6190f25d493f527a903de9796844b9afe8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 3 Apr 2024 12:24:48 +0200 Subject: [PATCH 1830/3088] net/relayd: bump revision --- net/relayd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index c370db7956..6a3a1aba62 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= relayd PLUGIN_VERSION= 2.8 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com From 38c731888d8687542d2317b765e1d37bd2cc59bf Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 3 Apr 2024 12:28:10 +0200 Subject: [PATCH 1831/3088] dns/bind: new version --- dns/bind/Makefile | 3 +-- dns/bind/pkg-descr | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 9ef5a09dfe..abb2e5fa59 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.30 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.31 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind918 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index fc882fdcde..98b8af40f5 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -6,13 +6,17 @@ necessary for asking and answering name service questions. WWW: https://www.isc.org - Plugin Changelog ================ +1.31 + +* Do not add the update-policy if the zone type is secondary (contributed by Brendan Bank) +* Adjust severity log levels (contributed by kulikov-a) + 1.30 -* Add ability for RNDC key updates from other nameservers +* Add ability for RNDC key updates from other nameservers (contributed by Joachim Friberg) 1.29 From 4f60a949e2684983188f250d2122f40121a8eb07 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 3 Apr 2024 12:30:19 +0200 Subject: [PATCH 1832/3088] net-mgmt/zabbix-proxy: new version --- net-mgmt/zabbix-proxy/Makefile | 3 +-- net-mgmt/zabbix-proxy/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net-mgmt/zabbix-proxy/Makefile b/net-mgmt/zabbix-proxy/Makefile index a9cf15b2b8..c86a78b96b 100644 --- a/net-mgmt/zabbix-proxy/Makefile +++ b/net-mgmt/zabbix-proxy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= zabbix-proxy -PLUGIN_VERSION= 1.9 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.10 PLUGIN_COMMENT= Zabbix monitoring proxy PLUGIN_MAINTAINER= m.muenz@gmail.com PLUGIN_VARIANTS= zabbix6 zabbix64 zabbix5 diff --git a/net-mgmt/zabbix-proxy/pkg-descr b/net-mgmt/zabbix-proxy/pkg-descr index 1af3a44a85..391046febb 100644 --- a/net-mgmt/zabbix-proxy/pkg-descr +++ b/net-mgmt/zabbix-proxy/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.zabbix.com/ Plugin Changelog ---------------- +1.10 + +* Add logging options (contributed by Malte Rabenseifner) + 1.9 * Add plugin variant for Zabbix Proxy 6.2 From 57ae4626a2c02ec251c92ef0909e453febc25ce4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 3 Apr 2024 12:32:03 +0200 Subject: [PATCH 1833/3088] net/freeradius: next version --- net/freeradius/Makefile | 2 +- net/freeradius/pkg-descr | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net/freeradius/Makefile b/net/freeradius/Makefile index 0d7330d4fb..ae9ecd3b7b 100644 --- a/net/freeradius/Makefile +++ b/net/freeradius/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= freeradius -PLUGIN_VERSION= 1.9.22 +PLUGIN_VERSION= 1.9.23 PLUGIN_COMMENT= RADIUS Authentication, Authorization and Accounting Server PLUGIN_DEPENDS= freeradius3 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/freeradius/pkg-descr b/net/freeradius/pkg-descr index beae3fa10f..3d8d1afa8f 100644 --- a/net/freeradius/pkg-descr +++ b/net/freeradius/pkg-descr @@ -15,6 +15,10 @@ The server is fast, feature-rich, modular, and scalable. Plugin Changelog ================ +1.9.23 + +* Support NT hash of user password (contributed by Stuart McLaren) + 1.9.22 * Add Proxy configuration page: HomeServer, HomeServerPool, Realm From e15b18a565ad2901dd564cf1dd4e853233fcad2b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 8 Apr 2024 10:56:51 +0200 Subject: [PATCH 1834/3088] www/OPNProxy - move proxy access management feature to the community version. This plugin uses squid's external acl helpers and redis to query policies quicker and more lightweight. It has been part of the business edition for some time, but due to recent changes, it makes sense to add it to the community version as well. Due to the redis requirement, we keep it a separate plugin, so existing setups won't start to pull redis in unexpected. current documentation: https://docs.opnsense.org/vendor/deciso/opnproxy.html --- www/OPNProxy/+POST_DEINSTALL.post | 2 + www/OPNProxy/Makefile | 10 + www/OPNProxy/pkg-descr | 10 + .../src/etc/inc/plugins.inc.d/opnproxy.inc | 50 ++++ .../OPNsense/Proxy/AclController.php | 40 ++++ .../OPNsense/Proxy/Api/AclController.php | 131 +++++++++++ .../Proxy/forms/dialogCustomPolicy.xml | 40 ++++ .../Proxy/forms/dialogDefaultPolicy.xml | 39 ++++ .../mvc/app/models/Deciso/Proxy/ACL.php | 35 +++ .../mvc/app/models/Deciso/Proxy/ACL.xml | 132 +++++++++++ .../Proxy/FieldTypes/CustomPolicyField.php | 94 ++++++++ .../Proxy/FieldTypes/UserGroupField.php | 76 ++++++ .../mvc/app/models/Deciso/Proxy/Menu/Menu.xml | 8 + .../mvc/app/views/Deciso/Proxy/acl.volt | 191 +++++++++++++++ .../scripts/OPNProxy/download_cleanse_ut1.py | 93 ++++++++ .../opnsense/scripts/OPNProxy/lib/__init__.py | 135 +++++++++++ .../OPNProxy/policies_to_redis_proto.py | 100 ++++++++ .../scripts/OPNProxy/redis_sync_users.py | 76 ++++++ .../scripts/OPNProxy/squid_acl_helper.py | 217 ++++++++++++++++++ .../conf/actions.d/actions_opnproxy.conf | 21 ++ .../service/templates/Deciso/Proxy/+TARGETS | 2 + .../Deciso/Proxy/10-opnproxy-ext.auth.conf | 43 ++++ .../Deciso/Proxy/proxy_policies.conf | 30 +++ 23 files changed, 1575 insertions(+) create mode 100644 www/OPNProxy/+POST_DEINSTALL.post create mode 100644 www/OPNProxy/Makefile create mode 100644 www/OPNProxy/pkg-descr create mode 100644 www/OPNProxy/src/etc/inc/plugins.inc.d/opnproxy.inc create mode 100644 www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/AclController.php create mode 100644 www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/AclController.php create mode 100644 www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogCustomPolicy.xml create mode 100644 www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogDefaultPolicy.xml create mode 100644 www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/ACL.php create mode 100644 www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/ACL.xml create mode 100644 www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/FieldTypes/CustomPolicyField.php create mode 100644 www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/FieldTypes/UserGroupField.php create mode 100644 www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/Menu/Menu.xml create mode 100644 www/OPNProxy/src/opnsense/mvc/app/views/Deciso/Proxy/acl.volt create mode 100755 www/OPNProxy/src/opnsense/scripts/OPNProxy/download_cleanse_ut1.py create mode 100755 www/OPNProxy/src/opnsense/scripts/OPNProxy/lib/__init__.py create mode 100755 www/OPNProxy/src/opnsense/scripts/OPNProxy/policies_to_redis_proto.py create mode 100755 www/OPNProxy/src/opnsense/scripts/OPNProxy/redis_sync_users.py create mode 100755 www/OPNProxy/src/opnsense/scripts/OPNProxy/squid_acl_helper.py create mode 100644 www/OPNProxy/src/opnsense/service/conf/actions.d/actions_opnproxy.conf create mode 100644 www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/+TARGETS create mode 100644 www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/10-opnproxy-ext.auth.conf create mode 100644 www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/proxy_policies.conf diff --git a/www/OPNProxy/+POST_DEINSTALL.post b/www/OPNProxy/+POST_DEINSTALL.post new file mode 100644 index 0000000000..5630e0114a --- /dev/null +++ b/www/OPNProxy/+POST_DEINSTALL.post @@ -0,0 +1,2 @@ +#!/bin/sh +rm /usr/local/etc/squid/auth/10-opnproxy-ext.auth.conf diff --git a/www/OPNProxy/Makefile b/www/OPNProxy/Makefile new file mode 100644 index 0000000000..3cc481e385 --- /dev/null +++ b/www/OPNProxy/Makefile @@ -0,0 +1,10 @@ +PLUGIN_NAME= OPNProxy +PLUGIN_VERSION= 1.0.5 +PLUGIN_COMMENT= OPNsense proxy additions +PLUGIN_DEPENDS= os-redis${PLUGIN_PKGSUFFIX} \ + os-squid${PLUGIN_PKGSUFFIX} \ + py${PLUGIN_PYTHON}-redis +PLUGIN_MAINTAINER= ad@opnsense.org +PLUGIN_TIER= 2 + +.include "../../Mk/plugins.mk" diff --git a/www/OPNProxy/pkg-descr b/www/OPNProxy/pkg-descr new file mode 100644 index 0000000000..c731c51c9f --- /dev/null +++ b/www/OPNProxy/pkg-descr @@ -0,0 +1,10 @@ +OPNsense proxy additions to support more fine grained access management + +1.0.5 + +* Prepare for community release + +1.0.4: + +* Remove ident support as by default it is denied anyway nowadays + diff --git a/www/OPNProxy/src/etc/inc/plugins.inc.d/opnproxy.inc b/www/OPNProxy/src/etc/inc/plugins.inc.d/opnproxy.inc new file mode 100644 index 0000000000..96f00a995a --- /dev/null +++ b/www/OPNProxy/src/etc/inc/plugins.inc.d/opnproxy.inc @@ -0,0 +1,50 @@ + ['opnproxy_user_changed:2'], + 'webproxy' => ['opnproxy_webproxy:2'], + ); +} + + +function opnproxy_user_changed($verbose = false, $username = '') +{ + exec("/usr/local/opnsense/scripts/OPNProxy/redis_sync_users.py " . escapeshellarg($username)); +} + + +function opnproxy_webproxy($verbose = false, $action = null) +{ + $response = configd_run('template reload Deciso/Proxy'); + if ($verbose) { + printf("template reload Deciso/Proxy: %s\n", trim($response)); + } +} diff --git a/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/AclController.php b/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/AclController.php new file mode 100644 index 0000000000..c0be1fa08c --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/AclController.php @@ -0,0 +1,40 @@ +view->pick('Deciso/Proxy/acl'); + $this->view->formDialogDefaultPolicy = $this->getForm("dialogDefaultPolicy"); + $this->view->formDialogCustomPolicy = $this->getForm("dialogCustomPolicy"); + } +} diff --git a/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/AclController.php b/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/AclController.php new file mode 100644 index 0000000000..80a7563ff4 --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/AclController.php @@ -0,0 +1,131 @@ +searchBase("policies.policy", array('enabled', 'description', 'action'), "description"); + } + + public function setPolicyAction($uuid) + { + return $this->setBase("policy", "policies.policy", $uuid); + } + + public function addPolicyAction() + { + return $this->addBase("policy", "policies.policy"); + } + + public function getPolicyAction($uuid = null) + { + return $this->getBase("policy", "policies.policy", $uuid); + } + + public function delPolicyAction($uuid) + { + return $this->delBase("policies.policy", $uuid); + } + + public function togglePolicyAction($uuid, $enabled = null) + { + return $this->toggleBase("policies.policy", $uuid, $enabled); + } + public function searchCustomPolicyAction() + { + return $this->searchBase("custom_policies.policy", array('enabled', 'description', 'action'), "description"); + } + + public function setCustomPolicyAction($uuid) + { + return $this->setBase("custom_policy", "custom_policies.policy", $uuid); + } + + public function addCustomPolicyAction() + { + return $this->addBase("custom_policy", "custom_policies.policy"); + } + + public function getCustomPolicyAction($uuid = null) + { + return $this->getBase("custom_policy", "custom_policies.policy", $uuid); + } + + public function delCustomPolicyAction($uuid) + { + return $this->delBase("custom_policies.policy", $uuid); + } + + public function toggleCustomPolicyAction($uuid, $enabled = null) + { + return $this->toggleBase("custom_policies.policy", $uuid, $enabled); + } + + public function applyAction() + { + if ($this->request->isPost()) { + $this->sessionClose(); + $backend = new Backend(); + $backend->configdRun('template reload Deciso/Proxy'); + $backend->configdRun('opnproxy sync_users'); + return array("status" => trim($backend->configdRun('opnproxy apply_policies'))); + } else { + return array("status" => "error"); + } + } + + public function testAction() + { + if ($this->request->isPost() && $this->request->hasPost('uri')) { + $src = $this->request->getPost('src', 'striptags', ''); + $src = !empty($src) ? $src : "-"; + $user = $this->request->getPost('user', null, ''); + $user = !empty($user) ? $user : "-"; + $this->sessionClose(); + $backend = new Backend(); + $response = $backend->configdpRun('opnproxy user test', [ + $user, $this->request->getPost('uri'), $src + ]); + $respose = json_decode($response, true); + if (!empty($response)) { + return $respose; + } + } + return array("status" => "error"); + } +} diff --git a/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogCustomPolicy.xml b/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogCustomPolicy.xml new file mode 100644 index 0000000000..f7ad32c89b --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogCustomPolicy.xml @@ -0,0 +1,40 @@ +
    + + custom_policy.enabled + + checkbox + Enable this item + + + custom_policy.applies_on + + select_multiple + ACL applies on selected users and groups. Users are prefixed with *, best use groups to structure policies + + + custom_policy.source_net + + select_multiple + + true + source ip or network, examples 10.0.0.0/24, 10.0.0.1 + + + custom_policy.action + + dropdown + Action to perform. + + + custom_policy.content + + textbox + List of domains and path entries, prefix with . to include subdomains (e.g. .com to block all .com domains). To match all use * + true + + + custom_policy.description + + text + +
    diff --git a/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogDefaultPolicy.xml b/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogDefaultPolicy.xml new file mode 100644 index 0000000000..275b6b6576 --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/controllers/OPNsense/Proxy/forms/dialogDefaultPolicy.xml @@ -0,0 +1,39 @@ +
    + + policy.enabled + + checkbox + Enable this item + + + policy.applies_on + + select_multiple + ACL applies on selected users and groups. Users are prefixed with *, best use groups to structure policies + + + policy.source_net + + select_multiple + + true + source ip or network, examples 10.0.0.0/24, 10.0.0.1 + + + policy.action + + dropdown + Action to perform. + + + policy.content + + select_multiple + List of standard categories + + + policy.description + + text + +
    diff --git a/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/ACL.php b/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/ACL.php new file mode 100644 index 0000000000..3f5bfa84f7 --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/ACL.php @@ -0,0 +1,35 @@ + + //Deciso/Proxy/ACL + 1.0.0 + + OPNsense central management / Proxy module + + + + + + 1 + Y + + + Y + deny + + Deny + Allow + + + + Y + Y + + adult + aggressive + astrology + audio-video + bank + bitcoin + blog + celebrity + chat + child + cleaning + cooking + cryptojacking + dangerous_material + dating + ddos + doh + download + drugs + educational_games + filehosting + financial + forums + gambling + games + hacking + jobsearch + lingerie + malware + manga + marketingware + mixed_adult + mobile-phone + phishing + press + advertisements + radio + redirector + remote-control + sexual_education + shopping + shortener + social_networks + sports + stalkerware + translation + update + vpn + warez + webmail + + + + Y + N + You need to select at least one user or group for who this list applies + + + N + N + , + Y + + + Y + /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){1,255}$/u + Description should be a string between 1 and 255 characters + + + + + + + 1 + Y + + + Y + deny + + Deny + Allow + + + + Y + + + Y + N + You need to select at least one user or group for who this list applies + + + N + N + , + Y + + + Y + /^([\t\n\v\f\r 0-9a-zA-Z.\-,_\x{00A0}-\x{FFFF}]){1,255}$/u + Description should be a string between 1 and 255 characters + + + + + diff --git a/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/FieldTypes/CustomPolicyField.php b/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/FieldTypes/CustomPolicyField.php new file mode 100644 index 0000000000..15637602a2 --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/FieldTypes/CustomPolicyField.php @@ -0,0 +1,94 @@ +separatorchar, trim($data)) as $value) { + yield $value; + } + } + + /** + * retrieve field validators for this field type + * @return array + */ + public function getValidators() + { + $validators = parent::getValidators(); + if ($this->internalValue != null) { + $validators[] = new CallbackValidator(["callback" => function ($data) { + $messages = array(); + foreach ($this->getItems($data) as $item) { + $parts = explode("/", $item, 2); + $domain = substr($parts[0], 0, 1) == "." ? substr($parts[0], 1) : $parts[0]; + if ($item == "*") { + // explicit wildcard + continue; + } elseif ( + filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false && + filter_var($domain, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6) === false + ) { + $messages[] = sprintf( + gettext('Entry "%s" does not contain a valid domain or address.'), + $item + ); + } elseif (filter_var("https://{$domain}", FILTER_VALIDATE_URL) === false) { + $messages[] = sprintf( + gettext('Entry "%s" does not contain a valid path.'), + $item + ); + continue; + } + } + return $messages; + } + ]); + } + return $validators; + } +} diff --git a/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/FieldTypes/UserGroupField.php b/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/FieldTypes/UserGroupField.php new file mode 100644 index 0000000000..b50ce32192 --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/FieldTypes/UserGroupField.php @@ -0,0 +1,76 @@ +optionSetId(); + if (!isset(self::$internalCacheOptionList[$setid])) { + self::$internalCacheOptionList[$setid] = array(); + } + if (empty(self::$internalCacheOptionList[$setid])) { + $cnf = Config::getInstance()->object(); + foreach (['group', 'user'] as $topic) { + if (!empty($cnf->system->$topic)) { + foreach ($cnf->system->$topic as $node) { + $prefix = $topic == "user" ? "*" : ""; + $tp = $topic == "user" ? "u" : "g"; + self::$internalCacheOptionList[$setid][$tp . ":" . $node->name] = $prefix . $node->name; + } + } + } + ksort(self::$internalCacheOptionList[$setid]); + } + $this->internalOptionList = self::$internalCacheOptionList[$setid]; + } +} diff --git a/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/Menu/Menu.xml b/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/Menu/Menu.xml new file mode 100644 index 0000000000..54400fe64e --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/models/Deciso/Proxy/Menu/Menu.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/www/OPNProxy/src/opnsense/mvc/app/views/Deciso/Proxy/acl.volt b/www/OPNProxy/src/opnsense/mvc/app/views/Deciso/Proxy/acl.volt new file mode 100644 index 0000000000..9d25467fdf --- /dev/null +++ b/www/OPNProxy/src/opnsense/mvc/app/views/Deciso/Proxy/acl.volt @@ -0,0 +1,191 @@ + + + + +
    +
    + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Description') }}{{ lang._('Action') }}{{ lang._('Commands') }}
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Description') }}{{ lang._('Action') }}{{ lang._('Commands') }}
    + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Property') }}{{ lang._('Value') }}
    {{ lang._('Username') }}
    {{ lang._('Source') }}
    {{ lang._('Uri') }}
    + +
    +
    +
    + +
    +
    +
    + +
    + +

    +
    +
    + + +{{ partial("layout_partials/base_dialog",['fields':formDialogDefaultPolicy,'id':'DialogDefaultPolicy','label':lang._('Edit List')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogCustomPolicy,'id':'DialogCustomPolicy','label':lang._('Edit List')])}} diff --git a/www/OPNProxy/src/opnsense/scripts/OPNProxy/download_cleanse_ut1.py b/www/OPNProxy/src/opnsense/scripts/OPNProxy/download_cleanse_ut1.py new file mode 100755 index 0000000000..75cf4d94e6 --- /dev/null +++ b/www/OPNProxy/src/opnsense/scripts/OPNProxy/download_cleanse_ut1.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 +# coding=utf-8 +""" + Copyright (c) 2023 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import argparse +import os +import shutil +import sys +import tempfile +import tarfile +import io +import requests + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('filename', help='output filename') + cmd_args = parser.parse_args() + + req_opts = { + 'url': 'http://dsi.ut-capitole.fr/blacklists/download/blacklists.tar.gz', + 'timeout': 120, + 'stream': True + } + try: + req = requests.get(**req_opts) + except Exception as e: + print("unable to download %s" % req_opts['url']) + sys.exit(99) + + directory_map = { + 'blacklists/agressif': 'blacklists/aggressive', + 'blacklists/publicite': 'blacklists/advertisements', + 'blacklists/drogue': 'blacklists/drugs', + 'blacklists/tricheur': None, + 'blacklists/arjel': None, + 'blacklists/associations_religieuses': None, + 'blacklists/dialer': None, + 'blacklists/liste_bu': None, + 'blacklists/reaffected': None, + 'blacklists/strict_redirector': None, + 'blacklists/strong_redirector': None, + 'blacklists/sect': None, + + } + filenames = ['urls', 'domains', 'README', 'global_usage', 'cc-by-sa-4-0.pdf', 'LICENSE.pdf'] + + if 200 <= req.status_code <= 299: + with tempfile.NamedTemporaryFile() as tmp_stream: + shutil.copyfileobj(req.raw, tmp_stream) + tmp_stream.seek(0) + tf = tarfile.open(fileobj=tmp_stream) + with tarfile.open(cmd_args.filename, "w:gz") as tar_handle: + for tf_file in tf.getmembers(): + filename = os.path.basename(tf_file.name) + if tf_file.isreg() and filename in filenames: + target = tf_file.name + dirname = os.path.dirname(tf_file.name) + if dirname in directory_map: + if directory_map[dirname] is None: + continue + else: + target = "%s/%s" % (directory_map[dirname], filename) + fhandle = tf.extractfile(tf_file) + info = tarfile.TarInfo(target) + fhandle.seek(0, io.SEEK_END) + info.size = fhandle.tell() + fhandle.seek(0, io.SEEK_SET) + tar_handle.addfile(info, fhandle) + + tar_handle.close() diff --git a/www/OPNProxy/src/opnsense/scripts/OPNProxy/lib/__init__.py b/www/OPNProxy/src/opnsense/scripts/OPNProxy/lib/__init__.py new file mode 100755 index 0000000000..95988b247e --- /dev/null +++ b/www/OPNProxy/src/opnsense/scripts/OPNProxy/lib/__init__.py @@ -0,0 +1,135 @@ +""" + Copyright (c) 2023 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import copy +import tarfile +import os +import stat +import syslog +import time +import requests +from configparser import ConfigParser + + +class Policy: + def __init__(self, policy_filename): + self._policy_config = policy_filename + self._domain_entries = dict() + self._policy_settings = dict() + self._tf = None + self.load() + + def load(self): + """ load policy database + :return: + """ + self._domain_entries = dict() + self._policy_settings = dict() + # collect all policies per domain, so we can safely overwrite existing content when it exists + cnf = ConfigParser() + cnf.read(self._policy_config) + if cnf.has_section('source'): + blocklist_filename = cnf.get('source', 'blocklist') + if cnf.has_option('source', 'blocklist_download_uri'): + blocklist_ttl = cnf.getint('source', 'blocklist_ttl') + if not os.path.isfile(blocklist_filename) or \ + time.time() - os.stat(blocklist_filename)[stat.ST_MTIME] > blocklist_ttl: + try: + response = requests.get(cnf.get('source', 'blocklist_download_uri'), stream=True) + response.raise_for_status() + with open(blocklist_filename, 'wb') as handle: + for block in response.iter_content(1024): + handle.write(block) + except requests.exceptions.RequestException as e: + # we are unable to download a new blocklist, if a previous version still exists keep using that + syslog.syslog(syslog.LOG_ERR, 'unable to download new blocklist (%s)' % e) + + if os.path.isfile(blocklist_filename) and tarfile.is_tarfile(blocklist_filename): + self._tf = tarfile.open(fileobj=open(blocklist_filename, "rb")) + else: + syslog.syslog(syslog.LOG_ERR, 'default policy rules not available (%s missing)' % blocklist_filename) + + for section in cnf.sections(): + if cnf.has_option(section, 'policy_type') and cnf.has_option(section, 'content'): + self._policy_settings[section] = { + 'action': cnf.get(section, 'action'), + 'id': section.split('_', 1)[-1], + 'applies_on': cnf.get(section, 'applies_on').split(','), + 'source_net': cnf.get(section, 'source_net').split(','), + 'policy_type': cnf.get(section, 'policy_type'), + 'description': cnf.get(section, 'description') + } + ittr_method = self._itr_default if cnf.get(section, 'policy_type') == "default" else self._itr_custom + split_char = ',' if cnf.get(section, 'policy_type') == "default" else '\n' + for is_wildcard, item in ittr_method(cnf.get(section, 'content').split(split_char)): + parts = item.split('/', 1) + domain = parts[0] + if domain not in self._domain_entries: + self._domain_entries[domain] = list() + self._domain_entries[domain].append([ + section, + "/%s" % parts[1] if len(parts) > 1 else "/", + is_wildcard + ]) + + def _itr_default(self, items: list): + if self._tf: + for tf_file in self._tf.getmembers(): + if tf_file.isreg(): + fhandle = self._tf.extractfile(tf_file) + if tf_file.name.count('/') >= 2 and tf_file.name.split('/')[-2] in items: + filename = os.path.basename(tf_file.name) + if filename in ['urls', 'domains']: + for line in fhandle.read().decode().split('\n'): + line = line.strip() + if line: + # assume domains are wildcards (e.g. youtube.com --> .youtube.com) + yield line.find('/') == -1, line + + @staticmethod + def _itr_custom(items: list): + for line in items: + if line.startswith('.') or line.startswith('*'): + # wildcard search, e.g. matches all subdomains of given domain, where * is the absolute toplevel (root) + yield True, line.lstrip('.') + else: + yield False, line + + def __iter__(self): + for domain in self._domain_entries: + # prepare domain policies + policy = { + 'domain': domain, + 'items': [] + } + for entry in self._domain_entries[domain]: + politem = copy.deepcopy(self._policy_settings[entry[0]]) + politem['path'] = entry[1] + politem['wildcard'] = entry[2] + policy['items'].append(politem) + yield policy + + def exists(self, domain): + return domain.split(':')[-1] in self._domain_entries diff --git a/www/OPNProxy/src/opnsense/scripts/OPNProxy/policies_to_redis_proto.py b/www/OPNProxy/src/opnsense/scripts/OPNProxy/policies_to_redis_proto.py new file mode 100755 index 0000000000..0e4599d6c4 --- /dev/null +++ b/www/OPNProxy/src/opnsense/scripts/OPNProxy/policies_to_redis_proto.py @@ -0,0 +1,100 @@ +#!/usr/local/bin/python3 +# -*- coding: utf-8 -*- +""" + Copyright (c) 2023 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import argparse +import fcntl +import time +import ujson +from lib import Policy +import redis + + +def redis_proto_parser(*args): + """ + https://redis.io/topics/protocol + :return: + """ + response = ["*%d\r\n$%d\r\n%s\r\n" % (len(args), len(args[0]), args[0])] + for item in args[1:]: + response.append("$%d\r\n%s\r\n" % (len(item), item)) + return "".join(response) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument( + '--redis_host', + help='redis hostname to read keys from (default: 127.0.0.1)', + default='127.0.0.1' + ) + parser.add_argument( + '--redis_port', + help='redis port number (default: 6379)', + type=int, + default=6379 + ) + parser.add_argument( + '--proxy_policies', + help='proxy policies configuration file', + default='/usr/local/etc/squid/proxy_policies.conf' + ) + parser.add_argument('--output', help='output filename', default='/dev/stdout') + + cmd_args = parser.parse_args() + + try: + lck = open('/tmp/policies_to_redis_proto.LCK', 'w+') + fcntl.flock(lck, fcntl.LOCK_EX | fcntl.LOCK_NB) + except IOError: + # already running, exit status 99 + sys.exit(99) + + policy = Policy(cmd_args.proxy_policies) + + # fetch current domain keys from redis + try: + existing_domains = redis.StrictRedis( + host=cmd_args.redis_host, port=cmd_args.redis_port, db=0, decode_responses=True + ).keys('domain:*') + except (redis.exceptions.ConnectionError, redis.exceptions.BusyLoadingError) as e: + existing_domains = list() + + with open(cmd_args.output, 'w') as output_stream: + statistics = {'domains': 0, 'policies': 0, 'generated': time.time()} + # generate delete statements for non existing keys + for domain in existing_domains: + domain = domain.split(':')[-1] + if not policy.exists(domain): + output_stream.write(redis_proto_parser("DEL", "domain:%s" % domain)) + + # generate set statements for new data (upsert) + for item in policy: + statistics['domains'] += 1 + statistics['policies'] += len(item['items']) + output_stream.write(redis_proto_parser("SET", "domain:%s" % item['domain'], ujson.dumps(item))) + + output_stream.write(redis_proto_parser("SET", "domain_statistics", ujson.dumps(statistics))) diff --git a/www/OPNProxy/src/opnsense/scripts/OPNProxy/redis_sync_users.py b/www/OPNProxy/src/opnsense/scripts/OPNProxy/redis_sync_users.py new file mode 100755 index 0000000000..3e22e09099 --- /dev/null +++ b/www/OPNProxy/src/opnsense/scripts/OPNProxy/redis_sync_users.py @@ -0,0 +1,76 @@ +#!/usr/local/bin/python3 +# -*- coding: utf-8 -*- +""" + Copyright (c) 2023 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import argparse +import fcntl +import sys +import syslog +import redis +import ujson +import xml.etree.ElementTree as ET + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--redis_host', help='redis hostname (default: 127.0.0.1)', default='127.0.0.1') + parser.add_argument('--redis_port', help='redis port number (default: 6379)', type=int, default=6379) + parser.add_argument('username', help='optional username', nargs='?', default=None) + args = parser.parse_args() + + # wait for other redis_sync_users sync events to complete + lck = open('/tmp/redis_sync_users.LCK', 'w+') + fcntl.flock(lck, fcntl.LOCK_EX) + + redisdb = redis.Redis(host=args.redis_host, port=args.redis_port, db=0) + + # ideally we would flush config data using the template system first, but since user settings may change + # more rappidly we opt to read the raw source here. + try: + tree = ET.parse('/conf/config.xml') + xmlroot = tree.getroot() + except (FileNotFoundError, ET.ParseError): + syslog.syslog(syslog.LOG_ERR, 'enable to open /conf/config.xml') + sys.exit(1) + + # merge group membership into user object and flush to redis + membership = dict() + for group in xmlroot.findall('./system/group'): + for member in group.findall('member'): + if member.text not in membership: + membership[member.text] = list() + membership[member.text].append(group.findtext('name')) + + for user in xmlroot.findall('./system/user'): + if args.username is None or args.username == user.findtext('name'): + user_object = dict() + user_object['uid'] = user.findtext('name') + user_object['id'] = user.findtext('uid') + user_object['applies_on'] = ["u:%s" % user.findtext('name')] + if user_object['id'] in membership: + for group in membership[user_object['id']]: + user_object['applies_on'].append("g:%s" % group) + redisdb.set('user:%s' % user_object['uid'], ujson.dumps(user_object)) diff --git a/www/OPNProxy/src/opnsense/scripts/OPNProxy/squid_acl_helper.py b/www/OPNProxy/src/opnsense/scripts/OPNProxy/squid_acl_helper.py new file mode 100755 index 0000000000..17d4d87fa6 --- /dev/null +++ b/www/OPNProxy/src/opnsense/scripts/OPNProxy/squid_acl_helper.py @@ -0,0 +1,217 @@ +#!/usr/local/bin/python3 +# -*- coding: utf-8 -*- +""" + Copyright (c) 2023 Ad Schellevis + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +""" +import argparse +import decimal +import sys +import syslog +import traceback +from urllib.parse import urlparse +import redis +import ujson +import ipaddress + + +class RedisAuth: + def __init__(self, host, port): + self._redis = redis.Redis(host=host, port=port, db=0) + + def domain_policy_iterator(self, r_fqdn): + """ traverse domain policies + :param r_fqdn: fqdn + :return: + """ + try: + tmp = self._redis.get("domain:%s" % r_fqdn) + if tmp: + domain_policy = ujson.loads(tmp.decode()) + else: + return + except Exception as e: + # connectivity or parse issue, log and return + syslog.syslog(syslog.LOG_ERR, traceback.format_exc().replace('\n', ' ')) + return + + if type(domain_policy.get('items', None)) is list: + for policy in domain_policy['items']: + if type(policy) is dict: + for fieldname in ['id', 'path', 'wildcard', 'action', 'applies_on', 'source_net']: + if fieldname not in policy: + policy[fieldname] = None + yield policy + + def get_user(self, uid): + if uid == "-": + return {'applies_on': set('-')} + try: + tmp = self._redis.get("user:%s" % uid) + if not tmp: + return None + udata = ujson.loads(tmp.decode()) + # cleanse data + udata['applies_on'] = set(udata['applies_on']) if 'applies_on' in udata else set() + except Exception: + syslog.syslog(syslog.LOG_ERR, traceback.format_exc().replace('\n', ' ')) + return None + + return udata + +def in_network(src, networks): + if networks is None or type(networks) is not list or src == '-': + return True + try: + src_net = ipaddress.ip_network(src) + except ValueError: + syslog.syslog(syslog.LOG_ERR, traceback.format_exc().replace('\n', ' ')) + return False + for network in networks: + try: + if src_net.overlaps(ipaddress.ip_network(network)): + return True + except ValueError: + syslog.syslog(syslog.LOG_ERR, traceback.format_exc().replace('\n', ' ')) + + return False + +def match_policy(acl, ident, src, method, uri, sslurlonly=False): + # default response, invalid user + match_res = {'message': "ERR message=\"no (valid) IDENT %s\"\n" % ident} + if uri.find('://') == -1: + base_domain = uri.split(':')[0] + request_path = '/' + else: + uri_parsed = urlparse(uri) + base_domain = uri_parsed.netloc.split(':')[0] + request_path = uri_parsed.path if uri_parsed.path else '/' + + syslog.syslog( + syslog.LOG_NOTICE, + "ACL-REQ |%s| |%s| |%s| |%s| |%s| %s" % (acl, ident, src, method, uri, 'SNI only' if sslurlonly else '') + ) + fqdn = base_domain + user_data = redis_auth.get_user(ident) + if user_data: + acl_decisions = dict() + # traverse domain upwards until either a policy is found or no matches are possible + # matches are prioritized on best path match and accept (higher) or deny. + while len(acl_decisions) == 0: + for this_policy in redis_auth.domain_policy_iterator(fqdn): + is_parent = base_domain != fqdn + match_parent = this_policy['path'] == '/' and is_parent and this_policy['wildcard'] + match_main = request_path.find(this_policy['path']) == 0 and not is_parent + if (match_parent or match_main) and set(this_policy['applies_on']) & user_data['applies_on']: + if not in_network(src, this_policy['source_net']): + continue + tp = 0 if this_policy['action'] == 'deny' else 1 + this_prio = decimal.Decimal("%d.%d" % (len(this_policy['path']), tp)) + acl_decisions[this_prio] = this_policy + acl_decisions[this_prio]['domain'] = fqdn + + if fqdn.find('.') == -1: + if fqdn == '*': + break + else: + # top level wildcard (add extra level) + fqdn = '*' + else: + fqdn = fqdn.split('.', maxsplit=1)[1] + + match_res['user'] = user_data + match_res['user']['applies_on'] = list(user_data['applies_on']) + + if not sslurlonly and method.lower() == 'connect': + # skip connect when full ssl bump is enabled + match_res['policy'] = {'action': 'allow', 'policy_type': 'fallback'} + match_res['message'] = "OK user=\"%s\"\n" % ident + elif len(acl_decisions) > 0: + acl_decision = acl_decisions[sorted(acl_decisions.keys(), reverse=True)[0]] + match_res['policy'] = acl_decision + if match_res['policy']['action'] == 'deny': + match_res['message'] = "ERR message=\"reason:%s policy_type:%s\" user=\"%s\"\n" % ( + acl_decision['id'], acl_decision['policy_type'], ident + ) + else: + match_res['message'] = "OK message=\"whitelisted %s\" user=\"%s\"\n" % (acl_decision['id'], ident) + elif ident != '-': + # network only authentication needs an explicit policy, user-based allows by default + match_res['policy'] = {'action': 'allow', 'policy_type': 'fallback'} + match_res['message'] = "OK user=\"%s\"\n" % ident + + return match_res + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--test_user', help='test mode (singleshot), username') + parser.add_argument('--test_uri', help='test mode (singleshot), uri') + parser.add_argument('--test_src', help='test mode (singleshot), source address', default='-') + parser.add_argument('--redis_host', help='redis hostname (default: 127.0.0.1)', default='127.0.0.1') + parser.add_argument('--redis_port', help='redis port number (default: 6379)', type=int, default=6379) + parser.add_argument('--sslurlonly', help='Log SNI information only enabled', action="store_true", default=False) + parser.add_argument( + '--no_ident', + help='Do not expect iden/user information in the message line', + action="store_true", + default=False + ) + + args = parser.parse_args() + syslog.openlog('squid', facility=syslog.LOG_LOCAL2) + redis_auth = RedisAuth(args.redis_host, args.redis_port) + if args.test_user and args.test_uri: + # test mode, dump raw json object to stdout + result = match_policy(acl='-', ident=args.test_user, src=args.test_src, method='-', uri=args.test_uri) + print (ujson.dumps(result)) + else: + # squid worker mode + while True: + try: + # accept messages like: + # my_ext_acl user 127.0.0.2 GET https://requested.domain/path/ + line = sys.stdin.readline().strip() + if line == "": + sys.exit() + if line: + try: + acl_parts = line.split() + except ValueError: + sys.stdout.write("ERR message=\"missing input\"\n") + break + offset = -1 if args.no_ident else 0 + result = match_policy( + acl=acl_parts[0], + ident='-' if args.no_ident else acl_parts[1], + src=acl_parts[2+offset], + method=acl_parts[3+offset], + uri=acl_parts[4+offset], + sslurlonly=args.sslurlonly + ) + sys.stdout.write(result['message']) + + sys.stdout.flush() + except IOError: + pass diff --git a/www/OPNProxy/src/opnsense/service/conf/actions.d/actions_opnproxy.conf b/www/OPNProxy/src/opnsense/service/conf/actions.d/actions_opnproxy.conf new file mode 100644 index 0000000000..bafa0f6993 --- /dev/null +++ b/www/OPNProxy/src/opnsense/service/conf/actions.d/actions_opnproxy.conf @@ -0,0 +1,21 @@ +[apply_policies] +command: + /usr/local/opnsense/scripts/OPNProxy/policies_to_redis_proto.py | redis-cli --pipe && + /usr/local/sbin/squid -k reconfigure +parameters: +type:script +message:download proxy policies and apply to redisdb +description:OPNProxy apply policies + + +[sync_users] +command: /usr/local/opnsense/scripts/OPNProxy/redis_sync_users.py +parameters: +type:script +message:synchronise proxy users + +[user.test] +command: /usr/local/opnsense/scripts/OPNProxy/squid_acl_helper.py +parameters: --test_user %s --test_uri %s --test_src %s +type:script_output +message:test user login diff --git a/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/+TARGETS b/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/+TARGETS new file mode 100644 index 0000000000..b9419e8aee --- /dev/null +++ b/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/+TARGETS @@ -0,0 +1,2 @@ +proxy_policies.conf:/usr/local/etc/squid/proxy_policies.conf +10-opnproxy-ext.auth.conf:/usr/local/etc/squid/auth/10-opnproxy-ext.auth.conf diff --git a/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/10-opnproxy-ext.auth.conf b/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/10-opnproxy-ext.auth.conf new file mode 100644 index 0000000000..408895ad80 --- /dev/null +++ b/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/10-opnproxy-ext.auth.conf @@ -0,0 +1,43 @@ +external_acl_type ext_opnproxy_helper_net ttl=30 negative_ttl=5 %ACL %SRC %METHOD %URI /usr/local/opnsense/scripts/OPNProxy/squid_acl_helper.py --no_ident {% if not helpers.empty('OPNsense.proxy.forward.sslurlonly') %} --sslurlonly {% endif %} + +acl opnproxy_ext_acl_net external ext_opnproxy_helper_net +http_access allow opnproxy_ext_acl_net + +{% if not helpers.empty('OPNsense.proxy.forward.authentication.method') %} +# Login based authentication +external_acl_type ext_opnproxy_helper_usr ttl=30 negative_ttl=5 %ACL %LOGIN %SRC %METHOD %URI /usr/local/opnsense/scripts/OPNProxy/squid_acl_helper.py {% if not helpers.empty('OPNsense.proxy.forward.sslurlonly') %} --sslurlonly {% endif %} + +acl opnproxy_ext_acl_usr external ext_opnproxy_helper_usr +http_access allow opnproxy_ext_acl_usr +{% endif %} + + +{% if not helpers.empty('OPNsense.proxy.forward.icap.enable') %} +{% if not helpers.empty('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod allow opnproxy_ext_acl_net +{% if not helpers.empty('OPNsense.proxy.forward.authentication.method') %} +adaptation_access response_mod allow opnproxy_ext_acl_usr +{% endif %} +{% endif %} +{% if not helpers.empty('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod allow opnproxy_ext_acl_net +{% if not helpers.empty('OPNsense.proxy.forward.authentication.method') %} +adaptation_access request_mod allow opnproxy_ext_acl_usr +{% endif %} +{% endif %} +{% endif %} + +{% if not helpers.empty('OPNsense.proxy.forward.authentication.method') %} +# explicit disable default allow authenticated users clause +http_access deny local_auth all +{% if not helpers.empty('OPNsense.proxy.forward.icap.enable') %} +{% if not helpers.empty('OPNsense.proxy.forward.icap.ResponseURL') %} +adaptation_access response_mod deny local_auth +{% endif %} +{% if not helpers.empty('OPNsense.proxy.forward.icap.RequestURL') %} +adaptation_access request_mod deny local_auth +{% endif %} +{% endif %} +{% else %} +http_access deny localnet +{% endif %} diff --git a/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/proxy_policies.conf b/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/proxy_policies.conf new file mode 100644 index 0000000000..ce330f22d5 --- /dev/null +++ b/www/OPNProxy/src/opnsense/service/templates/Deciso/Proxy/proxy_policies.conf @@ -0,0 +1,30 @@ +{% for policy in helpers.toList('Deciso.Proxy.ACL.policies.policy') %} +{% if policy.enabled|default('0') == '1' %} +[policy_{{ policy['@uuid'] }}] +policy_type=default +description={{ policy.description }} +content={{ policy.content }} +applies_on={{ policy.applies_on|default('-') }} +source_net={{ policy.source_net }} +action={{ policy.action }} +{% endif %} + +{% endfor %} + +{% for policy in helpers.toList('Deciso.Proxy.ACL.custom_policies.policy') %} +{% if policy.enabled|default('0') == '1' %} +[policy_{{ policy['@uuid'] }}] +policy_type=custom +description={{ policy.description }} +content={{ policy.content.replace('\n', '\n\t') }} +applies_on={{ policy.applies_on|default('-') }} +source_net={{ policy.source_net }} +action={{ policy.action }} +{% endif %} + +{% endfor %} + +[source] +blocklist=/usr/local/opnsense/data/proxy/blocklists.tar.gz +blocklist_download_uri=https://rulesets.opnsense.org/proxy/blocklists.tar.gz +blocklist_ttl=86300 From 0eb9557470bf18b0a7b14ec1e118cec17ea61911 Mon Sep 17 00:00:00 2001 From: realizelol Date: Mon, 8 Apr 2024 23:21:42 +0200 Subject: [PATCH 1835/3088] security/acme-client: Add support for dnshome DNS API (#3882) * Add DNSHome to AcmeClient --- .../AcmeClient/forms/dialogValidation.xml | 15 +++++++ .../AcmeClient/LeValidation/DnsDnshome.php | 45 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 7 +++ 3 files changed, 67 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnshome.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 151eec1a6d..9e14eb5bbc 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -386,6 +386,21 @@ text + + + header + + + + validation.dns_dnshome_password + + password + + + validation.dns_dnshome_subdomain + + text + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnshome.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnshome.php new file mode 100644 index 0000000000..2e7facd9ca --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsDnshome.php @@ -0,0 +1,45 @@ +acme_env['DNSHOME_SubdomainPassword'] = (string)$this->config->dns_dnshome_password; + $this->acme_env['DNSHOME_Subdomain'] = (string)$this->config->dns_dnshome_subdomain; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index b2e378a9d3..f30465009d 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -445,6 +445,7 @@ DigitalOcean DirectAdmin DNSExit + dnsHome DNSimple DNS.Services Domeneshop @@ -633,6 +634,12 @@ N + + N + + + N + N From f6422ce2f66fdc14bafbfa5a24a5d2fe00ff9d39 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 8 Apr 2024 23:33:04 +0200 Subject: [PATCH 1836/3088] security/acme-client: fix PHP deprecation warnings, closes #3892 --- .../OPNsense/AcmeClient/Api/SettingsController.php | 4 ++-- .../models/OPNsense/AcmeClient/Migrations/M1_6_0.php | 12 ++++++------ .../models/OPNsense/AcmeClient/Migrations/M4_0_0.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php index d91f9cfd3f..f631fb8bb1 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/SettingsController.php @@ -347,14 +347,14 @@ public function fetchHAProxyIntegrationAction() // Link to ACME Action is currently missing: add it! if (!empty((string)$_actions)) { // Extend existing string. - $_actions .= ",${action_ref}"; + $_actions .= ",{$action_ref}"; } else { // First linked Action for this frontend. $_actions = $action_ref; } // Add modified list of linked Actions to frontend. $frontend->linkedActions = $_actions; - $this->getLogger()->error("AcmeClient: HAProxy integration: updating frontend ${_frontend}"); + $this->getLogger()->error("AcmeClient: HAProxy integration: updating frontend {$_frontend}"); // We need to write changes to config. $integration_changes = true; } diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M1_6_0.php b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M1_6_0.php index f6982d2362..f2718c91f2 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M1_6_0.php +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M1_6_0.php @@ -44,26 +44,26 @@ public function run($model) foreach ($model->getNodeByReference('accounts.account')->iterateItems() as $account) { $account_id = (string)$account->id; $account_dir = $dir . $account_id; - $new_account_dir = "${dir}${account_id}_${env}"; + $new_account_dir = "{$dir}{$account_id}_{$env}"; // Check if account directory exists // Accounts that haven't been used yet don't need to be migrated. if (is_dir($account_dir)) { // Check if account configuration can be found. - $account_file = "${account_dir}/account.conf"; + $account_file = "{$account_dir}/account.conf"; if (is_file($account_file)) { // Parse config file and modify path information $account_conf = parse_ini_file($account_file); foreach ($account_conf as $key => $value) { switch ($key) { case 'ACCOUNT_KEY_PATH': - $account_conf[$key] = "${new_account_dir}/account.key"; + $account_conf[$key] = "{$new_account_dir}/account.key"; break; case 'ACCOUNT_JSON_PATH': - $account_conf[$key] = "${new_account_dir}/account.json"; + $account_conf[$key] = "{$new_account_dir}/account.json"; break; case 'CA_CONF': - $account_conf[$key] = "${new_account_dir}/ca.conf"; + $account_conf[$key] = "{$new_account_dir}/ca.conf"; break; } } @@ -71,7 +71,7 @@ public function run($model) // Convert array back to ini file format $new_account_conf = array(); foreach ($account_conf as $key => $value) { - $new_account_conf[] = "${key}='${value}'"; + $new_account_conf[] = "{$key}='{$value}'"; } // Write changes back to file diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M4_0_0.php b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M4_0_0.php index 2a776cbe96..51b3817707 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M4_0_0.php +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/Migrations/M4_0_0.php @@ -54,7 +54,7 @@ public function run($model) // Convert array back to ini file format $new_account_conf = array(); foreach ($account_conf as $key => $value) { - $new_account_conf[] = "${key}='${value}'"; + $new_account_conf[] = "{$key}='{$value}'"; } // Write changes back to file From 0262a19125ca67c540d342cdfed3255c4618cd59 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 8 Apr 2024 23:37:26 +0200 Subject: [PATCH 1837/3088] security/acme-client: bump version, update changelog --- security/acme-client/Makefile | 2 +- security/acme-client/pkg-descr | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 3bc52eb066..b95b600127 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 4.1 +PLUGIN_VERSION= 4.2 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 537abdbc8e..fb222939bf 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,15 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +4.2 + +Added: +* add ArtFiles DNS API (#3866) +* add dnsHome DNS API (#3882) + +Fixed: +* fix PHP deprecation messages (#3892) + 4.1 Fixed: From d1d17ce43facaf2254b98f7bf6f5ad86d5ce5744 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Apr 2024 21:58:10 +1200 Subject: [PATCH 1838/3088] security/acme-client: add support for Oracle Cloud Infrastructure DNS API (#3901) * Add support for Oracle Cloud (OCI) --- .../AcmeClient/forms/dialogValidation.xml | 26 ++++++++++ .../AcmeClient/LeValidation/DnsOci.php | 47 +++++++++++++++++++ .../models/OPNsense/AcmeClient/AcmeClient.xml | 13 +++++ 3 files changed, 86 insertions(+) create mode 100644 security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOci.php diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 9e14eb5bbc..6ec14b57b4 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1108,6 +1108,32 @@ info + + + header + + + + validation.dns_oci_cli_user + + text + + + validation.dns_oci_cli_tenancy + + text + + + validation.dns_oci_cli_region + + text + + + validation.dns_oci_cli_key + + textbox + acme.sh documentation for further information.]]> + header diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOci.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOci.php new file mode 100644 index 0000000000..aada37b84c --- /dev/null +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsOci.php @@ -0,0 +1,47 @@ +acme_env['OCI_CLI_USER'] = (string)$this->config->dns_oci_cli_user; + $this->acme_env['OCI_CLI_TENANCY'] = (string)$this->config->dns_oci_cli_tenancy; + $this->acme_env['OCI_CLI_REGION'] = (string)$this->config->dns_oci_cli_region; + $this->acme_env['OCI_CLI_KEY'] = (string)$this->config->dns_oci_cli_key; + } +} diff --git a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml index f30465009d..e39b8dd18b 100644 --- a/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml +++ b/security/acme-client/src/opnsense/mvc/app/models/OPNsense/AcmeClient/AcmeClient.xml @@ -501,6 +501,7 @@ nsupdate (RFC 2136) online.net OPNsense BIND Plugin + Oracle Cloud Infrastructure (OCI) OVH, kimsufi, soyoustart and runabove PowerDNS.com Plesk @@ -953,6 +954,18 @@ N + + N + + + N + + + N + + + N + N From 5877048d985226732e621210e06f7f60850dee1f Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 9 Apr 2024 12:03:40 +0200 Subject: [PATCH 1839/3088] security/acme-client: update changelog --- security/acme-client/pkg-descr | 1 + 1 file changed, 1 insertion(+) diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index fb222939bf..462328d2ef 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -13,6 +13,7 @@ Plugin Changelog Added: * add ArtFiles DNS API (#3866) * add dnsHome DNS API (#3882) +* add Oracle Cloud Infrastructure DNS API (#3901) Fixed: * fix PHP deprecation messages (#3892) From bbebfd3e5082484ed35951957b8afe0eb6f00dbc Mon Sep 17 00:00:00 2001 From: skidoodle Date: Tue, 9 Apr 2024 20:35:51 +0200 Subject: [PATCH 1840/3088] Update net/udpbroadcastrelay: fix typo (#3903) --- README.md | 2 +- net/udpbroadcastrelay/Makefile | 2 +- net/udpbroadcastrelay/pkg-descr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2afccc1887..460c2f7392 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ net/shadowsocks -- Secure socks5 proxy net/siproxd -- Siproxd is a proxy daemon for the SIP protocol net/sslh -- sslh configuration front-end net/tayga -- Tayga NAT64 -net/udpbroadcastrelay -- Control ubpbroadcastrelay processes +net/udpbroadcastrelay -- Control udpbroadcastrelay processes net/upnp -- Universal Plug and Play (UPnP IGD & PCP/NAT-PMP) Service net/vnstat -- Network traffic monitor net/wol -- Wake on LAN Service diff --git a/net/udpbroadcastrelay/Makefile b/net/udpbroadcastrelay/Makefile index 850085eb92..938cadc201 100644 --- a/net/udpbroadcastrelay/Makefile +++ b/net/udpbroadcastrelay/Makefile @@ -1,7 +1,7 @@ PLUGIN_NAME= udpbroadcastrelay PLUGIN_VERSION= 1.0 PLUGIN_REVISION= 3 -PLUGIN_COMMENT= Control ubpbroadcastrelay processes +PLUGIN_COMMENT= Control udpbroadcastrelay processes PLUGIN_DEPENDS= udpbroadcastrelay PLUGIN_MAINTAINER= mjwasley@gmail.com diff --git a/net/udpbroadcastrelay/pkg-descr b/net/udpbroadcastrelay/pkg-descr index bd8f32978d..b2aad18334 100644 --- a/net/udpbroadcastrelay/pkg-descr +++ b/net/udpbroadcastrelay/pkg-descr @@ -1,4 +1,4 @@ -udbproadcastrelay is a UDP multicast relayer. Its intended use is to +udpbroadcastrelay is a UDP multicast relayer. Its intended use is to rebroadbcast udp packets on a specific port across interfaces, be those interfaces physical or VLAN. From cb2e7d3e6ec555aeb247b0a381b23089f60ddbaf Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:24:43 +0200 Subject: [PATCH 1841/3088] www/caddy: v1.5.4 (#3891) * Update ReverseProxyController.php Update searchBase() for easier maintainability: Requires: https://github.com/opnsense/core/commit/2d45b78f744059089078d56b3c108765b2d23608 * Update caddy_control.py - Change onerestart and other actions to restart Might fix: https://github.com/opnsense/plugins/issues/3887 * Update Caddy.xml - Model Relation Fields to allow displaying multiple elements instead of only the description. This prevents duplicates being displayed without being able to know which entry is which. Possibly fixes: https://github.com/opnsense/plugins/issues/3885 https://github.com/opnsense/plugins/issues/3884 Also, since the descriptions are used by "internalModelUseSafeDelete", it's better to make them all required. * Update actions_caddy.conf - Add reload action The rc.d file communicates directly with the caddy admin endpoint, and can reload the configuration with the /var/run/caddy/caddy.sock without restarting the whole caddy process. * Update caddy_control.py - Add reload action The rc.d file communicates directly with the caddy admin endpoint, and can reload the configuration with the /var/run/caddy/caddy.sock without restarting the whole caddy process. * Update ServiceController.php - Turn off the ForceRestart Since caddy can use a reload instead * Add option to set a custom HTTP response code and message instead of using abort. This option can only be set globally in general settings. * Update pkg-descr - Add 1.5.4 * Update Makefile - Bump to 1.5.4 * Tether the HTTP repond logic to the Access List for more flexibility. * Update Caddy.xml - Change HTTPResponseCode and Message from general to accesslist * Add configuration framework for setting custom headers. WIP for opnsense/plugins#3881 * Update Caddy.xml - This shouldn't be here anymore... * Update Caddy.xml - Another mistake has sneaked in, fixed. * Update reverse_proxy.volt - Add new fields to bootgrid * Add template logic for header manipulation. WIP for opnsense/plugins#3881 * Update pkg-descr * Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS. * Update Caddyfile - Added some much needed comments the the most important sections and macros of the template. This should improve maintainability. * Update Caddyfile - Improve Comments, add Copyright header * Update Caddyfile - Improve comments --- www/caddy/Makefile | 3 +- www/caddy/pkg-descr | 11 + .../Caddy/Api/ReverseProxyController.php | 48 +++- .../OPNsense/Caddy/Api/ServiceController.php | 6 + .../OPNsense/Caddy/ReverseProxyController.php | 1 + .../OPNsense/Caddy/forms/dialogAccessList.xml | 16 ++ .../OPNsense/Caddy/forms/dialogHandle.xml | 13 ++ .../OPNsense/Caddy/forms/dialogHeader.xml | 34 +++ .../OPNsense/Caddy/forms/dynamicdns.xml | 2 +- .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 88 ++++++-- .../mvc/app/views/OPNsense/Caddy/general.volt | 27 --- .../views/OPNsense/Caddy/reverse_proxy.volt | 46 ++++ .../scripts/OPNsense/Caddy/caddy_control.py | 7 +- .../service/conf/actions.d/actions_caddy.conf | 9 +- .../templates/OPNsense/Caddy/Caddyfile | 211 +++++++++++++++++- 15 files changed, 456 insertions(+), 66 deletions(-) create mode 100644 www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHeader.xml diff --git a/www/caddy/Makefile b/www/caddy/Makefile index 138ee9fee6..208aef7c0d 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= caddy -PLUGIN_VERSION= 1.5.3 +PLUGIN_VERSION= 1.5.4 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= caddy-custom PLUGIN_COMMENT= Easy to configure Reverse Proxy with Automatic HTTPS and Dynamic DNS PLUGIN_MAINTAINER= cedrik@pischem.com diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 72f60a2dac..93d02a5395 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -18,12 +18,23 @@ Main features of this plugin: * Basic Auth to restrict access by username and password * Syslog-ng integration and HTTP Access Log * NTLM Transport +* Header manipulation with header_up and header_down DOC: https://docs.opnsense.org/manual/how-tos/caddy.html Plugin Changelog ================ +1.5.4 + +* Fix: When pressing Apply, the Caddy service will be reloaded instead of restarted. This fixes long restart times and service interruptions. +* Change: All Description Fields are now required to be populated. +* Change: Model Relation Fields now display two values instead of one to make most options appear unique. +* Add: HTTP response code and HTTP response message can be set per access list in advanced mode. +* Add: Header functionality added. Multiple header manipulations can be set per handler. +* Cleanup: Update searchBase() in ReverseProxyController.php for easier maintainability. +* Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS. + 1.5.3 * Change from "Phalcon Messages" to "OPNsense Messages" in Caddy.php. diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php index 5236dfba93..140330a06b 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php @@ -41,9 +41,9 @@ class ReverseProxyController extends ApiMutableModelControllerBase /*ReverseProxy Section*/ - public function searchReverseProxyAction() + public function searchReverseProxyAction($add_empty='0') { - return $this->searchBase("reverseproxy.reverse", ['enabled', 'FromDomain', 'FromPort', 'accesslist', 'basicauth', 'DnsChallenge', 'CustomCertificate', 'AccessLog', 'DynDns', 'AcmePassthrough', 'description']); + return $this->searchBase("reverseproxy.reverse", null, 'description'); } public function setReverseProxyAction($uuid) @@ -74,9 +74,9 @@ public function toggleReverseProxyAction($uuid, $enabled = null) /*Subdomain Section*/ - public function searchSubdomainAction() + public function searchSubdomainAction($add_empty='0') { - return $this->searchBase("reverseproxy.subdomain", ['enabled', 'reverse', 'FromDomain', 'FromPort', 'accesslist', 'basicauth', 'DynDns', 'description']); + return $this->searchBase("reverseproxy.subdomain", null, 'description'); } public function setSubdomainAction($uuid) @@ -107,9 +107,9 @@ public function toggleSubdomainAction($uuid, $enabled = null) /*Handler Section*/ - public function searchHandleAction() + public function searchHandleAction($add_empty='0') { - return $this->searchBase("reverseproxy.handle", ['enabled', 'reverse', 'subdomain', 'HandleType', 'HandlePath', 'ToDomain', 'ToPort', 'ToPath', 'HttpTls', 'HttpTlsTrustedCaCerts', 'HttpTlsServerName', 'HttpNtlm', 'HttpTlsInsecureSkipVerify', 'description']); + return $this->searchBase("reverseproxy.handle", null, 'description'); } public function setHandleAction($uuid) @@ -140,9 +140,9 @@ public function toggleHandleAction($uuid, $enabled = null) /* AccessList Section */ - public function searchAccessListAction() + public function searchAccessListAction($add_empty='0') { - return $this->searchBase("reverseproxy.accesslist", ['accesslistName', 'clientIps', 'accesslistInvert', 'description']); + return $this->searchBase("reverseproxy.accesslist", null, 'description'); } public function setAccessListAction($uuid) @@ -168,9 +168,9 @@ public function delAccessListAction($uuid) /* BasicAuth Section */ - public function searchBasicAuthAction() + public function searchBasicAuthAction($add_empty='0') { - return $this->searchBase("reverseproxy.basicauth", ['basicauthuser', 'basicauthpass', 'description']); + return $this->searchBase("reverseproxy.basicauth", null, 'description'); } public function setBasicAuthAction($uuid) @@ -212,4 +212,32 @@ public function delBasicAuthAction($uuid) { return $this->delBase("reverseproxy.basicauth", $uuid); } + + + /* Header Section */ + + public function searchHeaderAction($add_empty='0') + { + return $this->searchBase("reverseproxy.header", null, 'description'); + } + + public function setHeaderAction($uuid) + { + return $this->setBase("header", "reverseproxy.header", $uuid); + } + + public function addHeaderAction() + { + return $this->addBase("header", "reverseproxy.header"); + } + + public function getHeaderAction($uuid = null) + { + return $this->getBase("header", "reverseproxy.header", $uuid); + } + + public function delHeaderAction($uuid) + { + return $this->delBase("reverseproxy.header", $uuid); + } } diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php index fa1b43842b..f719a74d9b 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php @@ -41,6 +41,12 @@ class ServiceController extends ApiMutableServiceControllerBase protected static $internalServiceEnabled = 'general.enabled'; protected static $internalServiceName = 'caddy'; + protected function reconfigureForceRestart() + { + // Caddy can use a reload action instead + return 0; + } + public function validateAction() { $backend = new Backend(); diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/ReverseProxyController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/ReverseProxyController.php index 4a9947d759..fde12d63c7 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/ReverseProxyController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/ReverseProxyController.php @@ -43,5 +43,6 @@ public function indexAction() $this->view->formDialogHandle = $this->getForm("dialogHandle"); $this->view->formDialogAccessList = $this->getForm("dialogAccessList"); $this->view->formDialogBasicAuth = $this->getForm("dialogBasicAuth"); + $this->view->formDialogHeader = $this->getForm("dialogHeader"); } } diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogAccessList.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogAccessList.xml index b38a67826c..8fff82b7ea 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogAccessList.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogAccessList.xml @@ -19,6 +19,22 @@ checkbox + + accesslist.HttpResponseCode + + text + 403 + + true + + + accesslist.HttpResponseMessage + + text + Forbidden + + true + accesslist.description diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml index 68ac76a59b..51bf040773 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml @@ -36,6 +36,19 @@ text + + header + + true + + + handle.header + + dropdown + select_multiple + 5 + + header diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHeader.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHeader.xml new file mode 100644 index 0000000000..585ddf5124 --- /dev/null +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHeader.xml @@ -0,0 +1,34 @@ +
    + + header.HeaderUpDown + + dropdown + + + + header.HeaderType + + Host + text + + + + header.HeaderValue + + {upstream_hostport} + text + + + + header.HeaderReplace + + text + + + + header.description + + text + + +
    diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml index d7fa66ef17..a0a3630952 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dynamicdns.xml @@ -3,7 +3,7 @@ caddy.general.DynDnsIpVersions dropdown - +
    caddy.general.DynDnsCheckInterval diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index 3d8497fd33..d967254ef4 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -1,7 +1,7 @@ //Pischem/caddy A GUI model for configuring a reverse proxy in the Caddy web server. - 1.1.5 + 1.1.7 @@ -12,8 +12,8 @@ Please enter a valid email address. + On (default) - On (default) Off Disable Redirects Disable Certs @@ -21,8 +21,8 @@ + None (default) - None (default) Cloudflare Duck DNS DigitalOcean @@ -59,7 +59,8 @@ OPNsense.Caddy.Caddy reverseproxy.accesslist - accesslistName + accesslistName,description + %s - %s @@ -84,12 +85,11 @@ Y - ipv4 + IPv4+IPv6 IPv4 only IPv6 only - Y 1 @@ -123,7 +123,8 @@ OPNsense.Caddy.Caddy reverseproxy.accesslist - accesslistName + accesslistName,description + %s - %s @@ -132,7 +133,8 @@ OPNsense.Caddy.Caddy reverseproxy.basicauth - basicauthuser + basicauthuser,description + %s - %s Y @@ -160,7 +162,8 @@ OPNsense.Caddy.Caddy reverseproxy.reverse - description + FromDomain,FromPort + %s:%s @@ -179,7 +182,8 @@ OPNsense.Caddy.Caddy reverseproxy.accesslist - accesslistName + accesslistName,description + %s - %s @@ -188,7 +192,8 @@ OPNsense.Caddy.Caddy reverseproxy.basicauth - basicauthuser + basicauthuser,description + %s - %s Y @@ -209,7 +214,8 @@ OPNsense.Caddy.Caddy reverseproxy.reverse - description + FromDomain,FromPort + %s:%s @@ -218,7 +224,8 @@ OPNsense.Caddy.Caddy reverseproxy.subdomain - description + FromDomain,FromPort + %s:%s @@ -234,6 +241,17 @@ /^(\/.*)?$/u Please enter a valid 'Handle Path' that starts with '/'. +
    + + + OPNsense.Caddy.Caddy + reverseproxy.header + HeaderUpDown,HeaderType,HeaderValue,description + %s %s %s - %s + + + Y +
    Y Please enter a valid 'to' domain or IP address. @@ -261,7 +279,9 @@ Y N - + + Y + @@ -278,7 +298,15 @@ Please enter valid IP address(es) or network(s), separated by commas. - + + 100 + 599 + Please enter a valid HTTP response code between 100 and 599 + + + + Y + @@ -289,8 +317,36 @@ Y - + + Y + +
    + + header_up + + header_up + header_down + + Y + + + Y + /^([^"]{0,1024})$/u + The header type must not contain quotation marks (") and must be less than 1024 characters. + + + /^([^"]{0,1024})$/u + The header value must not contain quotation marks (") and must be less than 1024 characters. + + + /^([^"]{0,1024})$/u + The header replacement must not contain quotation marks (") and must be less than 1024 characters. + + + Y + +
    diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/general.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/general.volt index 9fcca897b1..eac7320b6b 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/general.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/general.volt @@ -28,33 +28,6 @@ $(document).ready(function() { var data_get_map = {'frm_GeneralSettings':"/api/caddy/General/get"}; mapDataToFormUI(data_get_map).done(function(data){ - // console.log("Fetched data:", data); // Log the fetched data - var generalSettings = data.frm_GeneralSettings.caddy.general; - - // Populate TlsAutoHttps dropdown - var tlsAutoHttpsSelect = $('#caddy\\.general\\.TlsAutoHttps'); - tlsAutoHttpsSelect.empty(); // Clear existing options - $.each(generalSettings.TlsAutoHttps, function(key, option) { - if (key !== "") { // Filter out the unwanted "None" option - tlsAutoHttpsSelect.append(new Option(option.value, key, false, option.selected === 1)); - } - }); - - // Populate TlsDnsProvider dropdown - var tlsDnsProviderSelect = $('#caddy\\.general\\.TlsDnsProvider'); - tlsDnsProviderSelect.empty(); // Clear existing options - $.each(generalSettings.TlsDnsProvider, function(key, option) { - if (key !== "") { // Filter out the unwanted "None" option - tlsDnsProviderSelect.append(new Option(option.value, key, false, option.selected === 1)); - } - }); - - // Populate Trusted Proxies dropdown - var accesslistSelect = $('#caddy\\.general\\.accesslist'); - accesslistSelect.empty(); // Clear existing options - $.each(generalSettings.accesslist, function(key, option) { - accesslistSelect.append(new Option(option.value, key, false, option.selected === 1)); - }); // Refresh selectpicker for these dropdowns $('.selectpicker').selectpicker('refresh'); diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt index 92aaac25d0..7f397b615c 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt @@ -69,6 +69,14 @@ del:'/api/caddy/ReverseProxy/delBasicAuth/', }); + $("#reverseHeaderGrid").UIBootgrid({ + search:'/api/caddy/ReverseProxy/searchHeader/', + get:'/api/caddy/ReverseProxy/getHeader/', + set:'/api/caddy/ReverseProxy/setHeader/', + add:'/api/caddy/ReverseProxy/addHeader/', + del:'/api/caddy/ReverseProxy/delHeader/', + }); + // Function to show alerts in the HTML message area function showAlert(message, type = "error") { var alertClass = type === "error" ? "alert-danger" : "alert-success"; @@ -143,6 +151,7 @@
  • Domains
  • Handlers
  • Access
  • +
  • Headers
  • @@ -234,6 +243,7 @@ Subdomain Handle Type Handle Path + Header Upstream Domain Upstream Port Upstream Path @@ -275,6 +285,8 @@ Name Client IPs Invert + HTTP Code + HTTP Message Description Commands @@ -322,6 +334,39 @@
    + + +
    +
    +

    Headers

    +
    + + + + + + + + + + + + + + + + + + + + +
    IDHeaderHeader TypeHeader ValueHeader ReplaceDescriptionCommands
    + + +
    +
    +
    +
    @@ -351,3 +396,4 @@ {{ partial("layout_partials/base_dialog",['fields':formDialogHandle,'id':'DialogHandle','label':lang._('Edit Handler')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogAccessList,'id':'DialogAccessList','label':lang._('Edit Access List')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogBasicAuth,'id':'DialogBasicAuth','label':lang._('Edit Basic Auth')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogHeader,'id':'DialogHeader','label':lang._('Edit Header')])}} diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py index da949afefb..6598926dc1 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py @@ -64,9 +64,10 @@ def run_service_command(action, action_message): # Updated actions dictionary actions = { - "start": "onestart", - "stop": "onestop", - "restart": "onerestart", + "start": "start", + "stop": "stop", + "restart": "restart", + "reload": "reload", "validate": "validate" # Validate action } diff --git a/www/caddy/src/opnsense/service/conf/actions.d/actions_caddy.conf b/www/caddy/src/opnsense/service/conf/actions.d/actions_caddy.conf index 28b10be8d5..cd5f1b2f66 100644 --- a/www/caddy/src/opnsense/service/conf/actions.d/actions_caddy.conf +++ b/www/caddy/src/opnsense/service/conf/actions.d/actions_caddy.conf @@ -14,9 +14,16 @@ message:Stopping Caddy service command:/usr/local/opnsense/scripts/OPNsense/Caddy/caddy_control.py restart parameters: type:script -message:Reloading Caddy configuration +message:Restarting Caddy service description:Restart Caddy service +[reload] +command:/usr/local/opnsense/scripts/OPNsense/Caddy/caddy_control.py reload +parameters: +type:script +message:Reloading Caddy configuration +description:Reload Caddy service + [validate] command:/usr/local/opnsense/scripts/OPNsense/Caddy/caddy_control.py validate parameters: diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index e0e84bc72b..6a4272fb25 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -1,9 +1,40 @@ +{# +# Copyright (c) 2023-2024 Cedrik Pischem +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +#} + # DO NOT EDIT THIS FILE -- OPNsense auto-generated file {% set generalSettings = helpers.getNodeByTag('Pischem.caddy.general') %} # Global Options { + {# + # Section: Global Log Settings + # Purpose: Sets up global log settings. The time format and unix socket make Caddy compatible + # with the syslog-ng instance running on the OPNsense. + #} log { {% if generalSettings.LogAccessPlain|default("0") == "0" %} {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} @@ -19,6 +50,11 @@ } } + {# + # Section: Global Trusted Proxy and Credential Logging + # Purpose: The trusted proxy section is important when using CDNs so that headers are trusted. + # Credential logging is useful for troubleshooting basic auth. + #} {% set accessListUuid = generalSettings.accesslist %} {% set logCredentials = generalSettings.LogCredentials %} @@ -47,6 +83,26 @@ } {% endif %} + {# + # Section: Dynamic DNS Global Configuration + # Purpose: Sets up global configuration for Dynamic DNS. Caddy needs to be compiled with + # https://github.com/mholt/caddy-dynamicdns and https://github.com/caddy-dns. Otherwise the + # generated Caddyfile won't run. Each DNS Provider that is added below has to be compiled in. + # Some Providers don't support setting A and AAAA-Records, like acmedns. + # Most need specific configurations. Since only one provider can be used at the same time, + # they all share the same fields for configuration. + # Parameters: + # - @param dnsProvider (string): Specifies the DNS provider for DDNS updates. + # - @param dnsApiKey (string): The API key for authenticating with the DNS provider. + # - @param dnsSecretApiKey (string): A secret API key or token for additional authentication security. + # - @param dnsOptionalField1 to 4 (string): Optional configuration field for the DNS provider. + # - @param dynDnsSimpleHttp (string): URL for a simple HTTP-based service to discover the server's public IP. + # - @param dynDnsInterface (string): Network interface(s) to use for IP discovery. + # - @param dynDnsCheckInterval (integer): Interval in minutes to check for IP changes. + # - @param dynDnsIpVersions (string): The IP version(s) (IPv4, IPv6) for the DDNS update. + # - @param dynDnsTTL (integer): Time-To-Live for the DNS records, in hours. + # - @param dynDnsDomains (list): Domains and subdomains list for which DDNS updates are enabled. + #} {% set dnsProvider = helpers.toList('Pischem.caddy.general.TlsDnsProvider') | first %} {% set dnsApiKey = generalSettings.TlsDnsApiKey %} {% set dnsSecretApiKey = generalSettings.TlsDnsSecretApiKey %} @@ -78,7 +134,7 @@ {% endfor %} {% endfor %} - {% if dnsProvider and dnsProvider != "none" and dnsProvider != "acmedns" and dynDnsDomains|length > 0 %} + {% if dnsProvider and dnsProvider != "acmedns" and dynDnsDomains|length > 0 %} dynamic_dns { {% if dnsProvider in ['porkbun', 'desec', 'route53', 'googleclouddns', 'azure', 'ovh', 'namecheap', 'powerdns', 'ddnss', 'linode', 'tencentcloud', 'dinahosting', 'hexonet', 'mailinabox'] %} provider {{ dnsProvider }} { @@ -207,12 +263,18 @@ } {% endif %} + {# + # Section: ACME Email, Auto HTTPS selection and global import statement + # Purpose: The ACME email is optional for receiving certificate notices. + # Auto HTTPS is optional, the default is on (which means the section is empty). + # The import statement is for user specific configuration out of scope of this template. + #} {% set emailValue = helpers.toList('Pischem.caddy.general.TlsEmail') | first %} {% if emailValue %} email {{ emailValue }} {% endif %} {% set autoHttpsValue = helpers.toList('Pischem.caddy.general.TlsAutoHttps') | first %} - {% if autoHttpsValue != "on" %} + {% if autoHttpsValue %} auto_https {{ autoHttpsValue }} {% endif %} import /usr/local/etc/caddy/caddy.d/*.global @@ -220,6 +282,11 @@ # Reverse Proxy Configuration +{# +# Section: HTTP-01 Challenge Redirection +# Purpose: A small premade reverse_proxy section +# that can redirect the HTTP-01 challenge to a different webserver. +#} {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} {% if reverse.enabled|default("0") == "1" and reverse.AcmePassthrough %} # HTTP-01 challenge redirection for domain: "{{ reverse['@uuid'] }}" @@ -234,8 +301,21 @@ {% endif %} {% endfor %} +{# +# Macro: tls_configuration +# Purpose: Configures TLS settings based on the DNS provider, API keys, and optional fields. +# Sets up the Caddyfile to update TXT Records with the chosen DNS Provider and receive +# certificates with the DNS-01 challenge. Refer to Dynamic DNS section for more details. +# Parameters: +# - @param dnsProvider (string): The DNS provider used for the DNS challenge. +# - @param dnsApiKey (string): API key for the DNS provider, essential for authentication. +# - @param customCert (string, optional): The config extracted name of a certificate. +# - @param dnsChallenge (boolean): Indicates if a DNS challenge is used for certificate authentication. +# - @param dnsSecretApiKey (string, optional): A secret API key or token for additional security, depending on the provider. +# - @param TlsDnsOptionalField1 to 4 (string, optional): Additional fields for specific DNS provider configurations. +#} {% macro tls_configuration(dnsProvider, dnsApiKey, customCert, dnsChallenge, dnsSecretApiKey, TlsDnsOptionalField1, TlsDnsOptionalField2, TlsDnsOptionalField3, TlsDnsOptionalField4) %} - {% if dnsChallenge == "1" and dnsProvider and dnsProvider != "none" %} + {% if dnsChallenge == "1" and dnsProvider %} {% if dnsProvider in ['duckdns', 'porkbun', 'desec', 'route53', 'acmedns', 'googleclouddns', 'azure', 'ovh', 'namecheap', 'powerdns', 'ddnss', 'linode', 'tencentcloud', 'dinahosting', 'hexonet', 'mailinabox'] %} tls { dns {{ dnsProvider }} { @@ -360,12 +440,74 @@ {% endif %} {% endmacro %} +{# +# Macro: header_manipulation +# Purpose: Customizes HTTP headers for requests or responses; to add, remove, or modify headers. +# It uses a 'handle' object that specifies which headers to manipulate based on their @UUIDs. +# Each handle can have multiple of these HTTP headers assigned. +# Parameters: +# @param handle (@object): +# - @uuid (@string) +# - HeaderUpDown (string): Determines the direction of the header. +# - HeaderType (string): Specifies the name of the header. +# - HeaderValue (string, optional): The new value to set for the header, if any. +# - HeaderReplace (string, optional): Specifies a value to replace in the header. +#} +{% macro header_manipulation(handle) %} + {% if handle.header %} + {% for header_uuid in handle.header.split(',') %} + {% set header = helpers.toList('Pischem.caddy.reverseproxy.header') | selectattr('@uuid', 'equalto', header_uuid) | first %} + {# Generate directive only if HeaderUpDown and HeaderType are present #} + {% if header.HeaderUpDown and header.HeaderType %} + {# Prepare variables, making HeaderValue and HeaderReplace optional #} + {% set header_value = header.HeaderValue | default('') %} + {% set header_replace = header.HeaderReplace | default('') %} + {# Adjust output formatting based on the presence and style of HeaderValue #} + {% if header.HeaderReplace and header.HeaderValue %} + {% if header_value.startswith('{') %} + {{ header.HeaderUpDown }} {{ header.HeaderType }} {{ header_value }} "{{ header_replace }}" + {% else %} + {{ header.HeaderUpDown }} {{ header.HeaderType }} "{{ header_value }}" "{{ header_replace }}" + {% endif %} + {% elif header.HeaderValue %} + {% if header_value.startswith('{') %} + {{ header.HeaderUpDown }} {{ header.HeaderType }} {{ header_value }} + {% else %} + {{ header.HeaderUpDown }} {{ header.HeaderType }} "{{ header_value }}" + {% endif %} + {% else %} + {{ header.HeaderUpDown }} {{ header.HeaderType }} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} +{% endmacro %} + +{# +# Macro: reverse_proxy_configuration +# Purpose: Sets up the handle with the reverse proxy configurations. The TLS Settings are generated here for the Upstream. +# Integrated Macros: header_manipulation +# Parameters: +# @param handle (@object): +# - @uuid (@string) +# - HandleType (string): Specifies the handling strategy. +# - HandlePath (string, optional): The path the handle should match on. +# - ToDomain (string): Target domain for the reverse proxy. +# - ToPort (string, optional): Target port on the ToDomain. +# - ToPath (string, optional): Destination path on the ToDomain. +# - HttpTls (boolean, optional): Enable TLS for the connection. +# - HttpNtlm (boolean, optional): Enable NTLM authentication for the connection. +# - HttpTlsInsecureSkipVerify (boolean, optional): If true, the server's SSL certificate is not verified. +# - HttpTlsTrustedCaCerts (string, optional): The config extracted name of a CA certificate. +# - HttpTlsServerName (string, optional): Specifies the server name for the TLS handshake. +#} {% macro reverse_proxy_configuration(handle) %} {{ handle.HandleType }} {{ handle.HandlePath|default("") }} { {% if handle.ToPath|default("") != "" %} rewrite * {{ handle.ToPath }}{uri} {% endif %} reverse_proxy {{ handle.ToDomain }}{% if handle.ToPort %}:{{ handle.ToPort }}{% endif %} { + {{ header_manipulation(handle) }} {% if handle.HttpTls|default("0") == "1" or handle.HttpTlsInsecureSkipVerify|default("0") == "1" %} {% if handle.HttpNtlm|default("0") == "1" %} transport http_ntlm { @@ -401,6 +543,18 @@ } {% endmacro %} +{# +# Macro: access_list_configuration +# Purpose: Defines access lists based on client IP addresses. The standard logic is "allow these IP addresses, deny all others." +# A handle with an @ matcher is created that will put the reverse_proxy_configuration inside. That means, the traffic will +# only get to the reverse proxy, when the access list matches. Invert is also possible, to explicitely deny IPs. +# The assembly is handled by the "Section: Reverse Proxy Configurations". +# Parameters: +# @param accesslist (@object): +# - @uuid (@string) +# - clientIps (@string): A comma-separated list of client IP addresses +# - invert (@boolean): A flag that inverts the logic of the access list +#} {% macro access_list_configuration(accesslist, invert) %} {% set client_ips = accesslist.clientIps.split(',') %} {% set client_ips_space_separated = client_ips | join(' ') %} @@ -409,6 +563,16 @@ } {% endmacro %} +{# +# Macro: basicauth_configuration +# Purpose: Implements basic authentication with a username and password for access. +# Parameters: +# @param basicauth_uuids (@string): A comma-separated list of UUIDs, each UUID corresponding to +# a specific user credentials (username and password). +# - @uuid (@string) +# - basicauthuser (@string): The username required for authentication. +# - basicauthpass (@string): The password associated with the username. +#} {% macro basicauth_configuration(basicauth_uuids) %} {% if basicauth_uuids %} basicauth { @@ -422,6 +586,20 @@ {% endif %} {% endmacro %} +{# +# Section: Reverse Proxy Configurations +# Purpose: Assembles reverse proxy configurations using predefined macros. +# This is the main logic of the whole template, handle with care. +# Macros Used: +# - tls_configuration +# - basicauth_configuration +# - access_list_configuration +# - reverse_proxy_configuration +# - indirect: header_manipulation +# Important Details: +# - Order of Path specific Handles - Prioritizes order of specific path handles over catch-all handles. +# - Order of Wildcard Domains and Subdomains: Handles for wildcard domains come after all subdomains. +#} {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} {% if reverse.enabled|default("0") == "1" %} # Reverse Proxy Domain: "{{ reverse['@uuid'] }}" @@ -491,8 +669,17 @@ {% endif %} {% endfor %} {% endif %} - {% if Pischem.caddy.general.abort|default("0") == "1" %} - abort + + {% if subdomain.accesslist %} + {% if accesslist.HttpResponseCode or accesslist.HttpResponseMessage %} + respond {{ '"' + accesslist.HttpResponseMessage|default('') + '"' if accesslist.HttpResponseMessage else '' }} {{ accesslist.HttpResponseCode|default(403) }} + {% elif Pischem.caddy.general.abort|default("0") == "1" %} + abort + {% endif %} + {% else %} + {% if Pischem.caddy.general.abort|default("0") == "1" %} + abort + {% endif %} {% endif %} } {% endif %} @@ -531,8 +718,18 @@ {% endif %} {% endfor %} {% endif %} - {% if Pischem.caddy.general.abort|default("0") == "1" %} - abort + + {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', reverse.accesslist) | first %} + {% if accesslist %} + {% if accesslist.HttpResponseCode or accesslist.HttpResponseMessage %} + respond {{ '"' + accesslist.HttpResponseMessage|default('') + '"' if accesslist.HttpResponseMessage else '' }} {{ accesslist.HttpResponseCode|default(403) }} + {% elif Pischem.caddy.general.abort|default("0") == "1" %} + abort + {% endif %} + {% else %} + {% if Pischem.caddy.general.abort|default("0") == "1" %} + abort + {% endif %} {% endif %} } {% endif %} From 971b4da0cfb6730c3c482161db001c80162584e3 Mon Sep 17 00:00:00 2001 From: Robert Zaage Date: Sun, 11 Feb 2024 20:31:20 +0100 Subject: [PATCH 1842/3088] os-openconnect: Added option to enable the use of insecure ciphers Committer: Robert Zaage --- .../app/controllers/OPNsense/Openconnect/forms/general.xml | 6 ++++++ .../mvc/app/models/OPNsense/Openconnect/General.xml | 4 ++++ .../service/templates/OPNsense/Openconnect/openconnect.conf | 3 +++ 3 files changed, 13 insertions(+) diff --git a/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/forms/general.xml b/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/forms/general.xml index 0e13339b86..a40a423e0a 100644 --- a/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/forms/general.xml +++ b/security/openconnect/src/opnsense/mvc/app/controllers/OPNsense/Openconnect/forms/general.xml @@ -59,6 +59,12 @@ text Enter a secret to use with one-time password generation.
    + + general.allowinsecure + + checkbox + This option allows the use of insecure ciphers. + general.protocol diff --git a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml index 9b9560a56b..e3de23d1c7 100644 --- a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml +++ b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml @@ -58,6 +58,10 @@ N + + 0 + N + anyconnect Y diff --git a/security/openconnect/src/opnsense/service/templates/OPNsense/Openconnect/openconnect.conf b/security/openconnect/src/opnsense/service/templates/OPNsense/Openconnect/openconnect.conf index 32d13a2866..f04b3e5061 100644 --- a/security/openconnect/src/opnsense/service/templates/OPNsense/Openconnect/openconnect.conf +++ b/security/openconnect/src/opnsense/service/templates/OPNsense/Openconnect/openconnect.conf @@ -25,6 +25,9 @@ token-mode={{ OPNsense.openconnect.general.tokenmode }} token-secret={{ OPNsense.openconnect.general.tokensecret }} {% endif %} {% endif %} +{% if OPNsense.openconnect.general.allowinsecure|default('0') == '1' %} +allow-insecure-crypto +{% endif %} {% if helpers.exists('OPNsense.openconnect.general.protocol') and OPNsense.openconnect.general.protocol != '' %} protocol={{ OPNsense.openconnect.general.protocol }} {% if OPNsense.openconnect.general.protocol == 'anyconnect' %} From 447b8cd5cc19f90f728013ff94a692c5fae9e506 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 12 Apr 2024 09:27:12 +0200 Subject: [PATCH 1843/3088] security/openconnect - template safety and versioning for https://github.com/opnsense/plugins/pull/3815 --- security/openconnect/Makefile | 2 +- security/openconnect/pkg-descr | 4 ++++ .../opnsense/mvc/app/models/OPNsense/Openconnect/General.xml | 2 +- .../service/templates/OPNsense/Openconnect/openconnect.conf | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/security/openconnect/Makefile b/security/openconnect/Makefile index 9296d2ffcc..9c0c4721ae 100644 --- a/security/openconnect/Makefile +++ b/security/openconnect/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= openconnect -PLUGIN_VERSION= 1.4.5 +PLUGIN_VERSION= 1.4.6 PLUGIN_COMMENT= OpenConnect Client PLUGIN_DEPENDS= openconnect PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/security/openconnect/pkg-descr b/security/openconnect/pkg-descr index 9d18d3a10f..57081e80df 100644 --- a/security/openconnect/pkg-descr +++ b/security/openconnect/pkg-descr @@ -6,6 +6,10 @@ the Juniper SSL VPN which is now known as Pulse Connect Secure. Plugin Changelog ================ +1.4.6 + +* add allowinsecure + 1.4.5 * Allow ":" and "/" characters in user name diff --git a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml index e3de23d1c7..0bd610eba8 100644 --- a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml +++ b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml @@ -1,7 +1,7 @@ //OPNsense/openconnect/general Openconnect configuration - 1.0.3 + 1.0.4 0 diff --git a/security/openconnect/src/opnsense/service/templates/OPNsense/Openconnect/openconnect.conf b/security/openconnect/src/opnsense/service/templates/OPNsense/Openconnect/openconnect.conf index f04b3e5061..69d7a51ea0 100644 --- a/security/openconnect/src/opnsense/service/templates/OPNsense/Openconnect/openconnect.conf +++ b/security/openconnect/src/opnsense/service/templates/OPNsense/Openconnect/openconnect.conf @@ -25,7 +25,7 @@ token-mode={{ OPNsense.openconnect.general.tokenmode }} token-secret={{ OPNsense.openconnect.general.tokensecret }} {% endif %} {% endif %} -{% if OPNsense.openconnect.general.allowinsecure|default('0') == '1' %} +{% if not helpers.empty('OPNsense.openconnect.general.allowinsecure') %} allow-insecure-crypto {% endif %} {% if helpers.exists('OPNsense.openconnect.general.protocol') and OPNsense.openconnect.general.protocol != '' %} From 5c1ecf0ba5779c4a1f4b183ae20b195d93647ea3 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 12 Apr 2024 11:41:33 +0200 Subject: [PATCH 1844/3088] security/openconnect - minot model fix for https://github.com/opnsense/plugins/pull/3815 --- .../opnsense/mvc/app/models/OPNsense/Openconnect/General.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml index 0bd610eba8..b9713f044d 100644 --- a/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml +++ b/security/openconnect/src/opnsense/mvc/app/models/OPNsense/Openconnect/General.xml @@ -60,7 +60,7 @@ 0 - N + Y anyconnect From 74c1c75491948645bef117e8b573374ef6533464 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 13 Apr 2024 14:56:04 +0200 Subject: [PATCH 1845/3088] Add staticd to routing suite (#3904) --------- Co-authored-by: Mike Shuey --- .../OPNsense/Quagga/Api/StaticController.php | 69 +++++++++++ .../OPNsense/Quagga/StaticController.php | 41 +++++++ .../Quagga/forms/dialogEditSTATICRoute.xml | 25 ++++ .../OPNsense/Quagga/forms/static.xml | 8 ++ .../app/models/OPNsense/Quagga/Menu/Menu.xml | 3 +- .../app/models/OPNsense/Quagga/STATICd.php | 69 +++++++++++ .../app/models/OPNsense/Quagga/STATICd.xml | 36 ++++++ .../views/OPNsense/Quagga/diagnostics.volt | 3 +- .../mvc/app/views/OPNsense/Quagga/static.volt | 113 ++++++++++++++++++ .../templates/OPNsense/Quagga/+TARGETS | 1 + .../service/templates/OPNsense/Quagga/frr | 1 + .../templates/OPNsense/Quagga/staticd.conf | 18 +++ 12 files changed, 385 insertions(+), 2 deletions(-) create mode 100644 net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php create mode 100644 net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php create mode 100644 net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditSTATICRoute.xml create mode 100644 net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/static.xml create mode 100644 net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/STATICd.php create mode 100644 net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/STATICd.xml create mode 100644 net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/static.volt create mode 100644 net/frr/src/opnsense/service/templates/OPNsense/Quagga/staticd.conf diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php new file mode 100644 index 0000000000..802d279834 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php @@ -0,0 +1,69 @@ +searchBase('routes.route'); + } + + public function getRouteAction($uuid = null) + { + return $this->getBase('route', 'routes.route', $uuid); + } + + public function setRouteAction($uuid) + { + return $this->setBase('route', 'routes.route', $uuid); + } + + public function addRouteAction() + { + return $this->addBase('route', 'routes.route'); + } + + public function delRouteAction($uuid) + { + return $this->delBase('routes.route', $uuid); + } + + public function toggleRouteAction($uuid) + { + return $this->toggleBase('routes.route', $uuid); + } +} diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php new file mode 100644 index 0000000000..5798e168e5 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php @@ -0,0 +1,41 @@ +view->staticForm = $this->getForm("static"); + $this->view->formDialogEditSTATICRoute = $this->getForm("dialogEditSTATICRoute"); + $this->view->pick('OPNsense/Quagga/static'); + } +} diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditSTATICRoute.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditSTATICRoute.xml new file mode 100644 index 0000000000..adbbeb2d4f --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditSTATICRoute.xml @@ -0,0 +1,25 @@ +
    + + route.enabled + + checkbox + + + route.network + + text + Defines the target for the static route, in CIDR notation. + + + route.gateway + + text + Optional gateway IP address for this route. + + + route.interfacename + + dropdown + Select an interface where this settings apply to. + +
    diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/static.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/static.xml new file mode 100644 index 0000000000..0a766e8f63 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/static.xml @@ -0,0 +1,8 @@ +
    + + staticd.enabled + + checkbox + This will activate the staticd service if the support of routing protocols is enabled in "General". + +
    diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml index 2a0fc1634f..e63c3a58eb 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/Menu/Menu.xml @@ -7,7 +7,8 @@ - + + diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/STATICd.php b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/STATICd.php new file mode 100644 index 0000000000..b365c62f04 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/STATICd.php @@ -0,0 +1,69 @@ +routes->route->iterateItems() as $route) { + if (!$validateFullModel && !$route->isFieldChanged()) { + continue; + } + $key = $route->__reference; + if (!empty((string)$route->network) && !empty((string)$route->gateway)) { + $net_proto = str_contains($route->network, ':') ? 'inet6' : 'inet'; + $gw_proto = str_contains($route->gateway, ':') ? 'inet6' : 'inet'; + if ($net_proto != $gw_proto) { + $messages->appendMessage( + new Message(gettext("Gateway IP protocol should match network protocol"), $key . ".gateway") + ); + } + } + if (empty((string)$route->gateway) && empty((string)$route->interfacename)) { + $messages->appendMessage( + new Message( + gettext("When no interface is provided, at least a gateway must be offered"), + $key . ".gateway" + ) + ); + } + } + return $messages; + } +} diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/STATICd.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/STATICd.xml new file mode 100644 index 0000000000..f0c7d37c24 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/STATICd.xml @@ -0,0 +1,36 @@ + + //OPNsense/quagga/static + Staticd Routing configuration + 1.0.0 + + + 0 + Y + + + + + 1 + Y + + + Y + Y + Specify a valid network matching the gateways ip protocol. + + + N + N + + + N + Y + + /^(?!0).*$/ + /^(?!group).*$/ + + + + + + diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnostics.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnostics.volt index 8c3f69d670..289f2bbf57 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnostics.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/diagnostics.volt @@ -115,7 +115,8 @@ POSSIBILITY OF SUCH DAMAGE. 'connected': {short: 'C', long: '{{ lang._('Connected') }}'}, 'bgp': {short: 'B', long: '{{ lang._('BGP') }}'}, 'ospf': {short: 'O', long: '{{ lang._('OSPF') }}'}, - 'ospf6': {short: 'O', long: '{{ lang._('OSPFv3') }}'} + 'ospf6': {short: 'O', long: '{{ lang._('OSPFv3') }}'}, + 'static': {short: 'S', long: '{{ lang._('STATIC') }}'}, }; let field = $("
    "); if (protocols[row.protocol] !== undefined) { diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/static.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/static.volt new file mode 100644 index 0000000000..5de53fc3e8 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/static.volt @@ -0,0 +1,113 @@ +{# + # Copyright (c) 2024 Deciso B.V. + # Copyright (c) 2024 by Mike Shuey + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} + + + + + + +
    + +
    + {{ partial("layout_partials/base_form",['fields':staticForm,'id':'frm_static_settings'])}} +
    + +
    + + + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Enabled') }}{{ lang._('Network') }}{{ lang._('Gateway') }}{{ lang._('Interface') }}{{ lang._('Commands') }}
    + + +
    +
    +
    + +
    +
    +
    +
    + +

    +
    +
    +
    + +{{ partial("layout_partials/base_dialog",['fields':formDialogEditSTATICRoute,'id':'DialogEditSTATICRoute','label':lang._('Edit Routes')])}} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS index ea22bda2da..430e871671 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/+TARGETS @@ -6,6 +6,7 @@ ospf6d.conf:/usr/local/etc/frr/ospf6d.conf ospf6d_carp.conf:/usr/local/etc/frr/ospf6d_carp.conf ripd.conf:/usr/local/etc/frr/ripd.conf sa_policies.conf:/usr/local/etc/frr/sa_policies.conf +staticd.conf:/usr/local/etc/frr/staticd.conf frr:/etc/rc.conf.d/frr zebra.conf:/usr/local/etc/frr/zebra.conf vtysh.conf:/usr/local/etc/frr/vtysh.conf diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr index d85566ce8e..4347dd76cc 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/frr @@ -13,6 +13,7 @@ if helpers.exists('OPNsense.quagga.bfd.enabled') and OPNsense.quagga.bfd.enabled if helpers.exists('OPNsense.quagga.bgp.enabled') and OPNsense.quagga.bgp.enabled == '1' %} bgpd{% endif %}{% if helpers.exists('OPNsense.quagga.ospf6.enabled') and OPNsense.quagga.ospf6.enabled == '1' %} ospf6d{% endif %}{% if helpers.exists('OPNsense.quagga.ripng.enabled') and OPNsense.quagga.ripng.enabled == '1' %} ripngd{% endif %}{% +if helpers.exists('OPNsense.quagga.staticd.enabled') and OPNsense.quagga.staticd.enabled == '1' %} staticd{% endif %}{% if helpers.exists('OPNsense.quagga.isis.enabled') and OPNsense.quagga.isis.enabled == '1' %} isisd{% endif %}" frr_carp_demote="{% if not helpers.empty('OPNsense.quagga.ospf.carp_demote') %} ospfd{% endif %}{% diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/staticd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/staticd.conf new file mode 100644 index 0000000000..099a06ea72 --- /dev/null +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/staticd.conf @@ -0,0 +1,18 @@ +! +! staticd Zebra config autogenerated by OPNsense +! +{% if not helpers.empty('OPNsense.quagga.static.enabled') %} +{% if not helpers.empty('OPNsense.quagga.general') %} +log syslog {{ OPNsense.quagga.general.sysloglevel }} +{% endif %} +{% if not helpers.empty('OPNsense.quagga.general.profile') %} +frr defaults {{ OPNsense.quagga.general.profile }} +{% endif %} +! +{% for route in helpers.toList('OPNsense.quagga.static.routes.route') %} +{% if route.enabled == '1' %} +{% if ':' in route.network %}ipv6{% else %}ip{% endif %} route {{ route.network }} {{ route.gateway|default('')}} {{ helpers.physical_interface(route.interfacename) }} +{% endif %} +{% endfor %} +! +{% endif %} From 7a5c968dc5c977e2fc6814b01564d215fb578386 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Sat, 13 Apr 2024 14:58:42 +0200 Subject: [PATCH 1846/3088] www/caddy: Add simple load balancing (#3911) * Add: Simple Load Balancing support of Upstreams with the random policy, by allowing multiple Upstream Domains in Handlers. * Add passive health fail duration test. It enables unhealthy upstreams to be sorted when simple load balancing is enabled. * Update pkg-descr --- www/caddy/pkg-descr | 3 +++ .../OPNsense/Caddy/forms/dialogHandle.xml | 13 +++++++++++-- .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 7 +++++++ .../mvc/app/views/OPNsense/Caddy/reverse_proxy.volt | 1 + .../service/templates/OPNsense/Caddy/Caddyfile | 9 ++++++++- 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 93d02a5395..452ecabe8d 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -19,6 +19,7 @@ Main features of this plugin: * Syslog-ng integration and HTTP Access Log * NTLM Transport * Header manipulation with header_up and header_down +* Simple load balancing with passive health check DOC: https://docs.opnsense.org/manual/how-tos/caddy.html @@ -34,6 +35,8 @@ Plugin Changelog * Add: Header functionality added. Multiple header manipulations can be set per handler. * Cleanup: Update searchBase() in ReverseProxyController.php for easier maintainability. * Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS. +* Add: Simple Load Balancing support with the default random policy, by allowing to add multiple Upstream Domains in Handlers. +* Add: Passive Health check for load balancing (Upstream Fail Duration) in Handlers. 1.5.3 diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml index 51bf040773..4a6d5ee509 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml @@ -56,9 +56,11 @@ handle.ToDomain - text + select_multiple + + true 192.168.1.1 - + handle.ToPort @@ -74,6 +76,13 @@ true + + handle.PassiveHealthFailDuration + + text + + true + header diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index d967254ef4..acfc075d9e 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -256,6 +256,8 @@ Y Please enter a valid 'to' domain or IP address. Y + , + Y Please enter a valid 'to' port number. @@ -266,6 +268,11 @@ /^(\/.*)?$/u Please enter a valid 'Backend Path' that starts with '/'. + + 1 + 100 + Please enter a value between 1 to 100. + diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt index 7f397b615c..5d9ebc4069 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt @@ -247,6 +247,7 @@ Upstream Domain Upstream Port Upstream Path + Fail Duration TLS TLS CA TLS Server Name diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index 6a4272fb25..178c3ea781 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -500,14 +500,21 @@ # - HttpTlsInsecureSkipVerify (boolean, optional): If true, the server's SSL certificate is not verified. # - HttpTlsTrustedCaCerts (string, optional): The config extracted name of a CA certificate. # - HttpTlsServerName (string, optional): Specifies the server name for the TLS handshake. +# - PassiveHealthFailDuration (integer, optional): Enables passive health checks when set > 0. #} {% macro reverse_proxy_configuration(handle) %} {{ handle.HandleType }} {{ handle.HandlePath|default("") }} { {% if handle.ToPath|default("") != "" %} rewrite * {{ handle.ToPath }}{uri} {% endif %} - reverse_proxy {{ handle.ToDomain }}{% if handle.ToPort %}:{{ handle.ToPort }}{% endif %} { + reverse_proxy {% for domain in handle.ToDomain.split(',') %} + {# For each domain/IP, append the port if it's specified, followed by a space #} + {{- domain -}}{% if handle.ToPort %}:{{ handle.ToPort }}{% endif %}{% if not loop.last %} {% endif %} + {% endfor %}{ {{ header_manipulation(handle) }} + {% if handle.PassiveHealthFailDuration|default("") %} + fail_duration {{ handle.PassiveHealthFailDuration }}s + {% endif %} {% if handle.HttpTls|default("0") == "1" or handle.HttpTlsInsecureSkipVerify|default("0") == "1" %} {% if handle.HttpNtlm|default("0") == "1" %} transport http_ntlm { From cfc2bdf89cc965e2bd23b4148148157643287064 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 13 Apr 2024 17:59:05 +0200 Subject: [PATCH 1847/3088] Squashed commit of the following: commit 5087edf5211a41dc903c4ceca90e39c2d36616f6 Author: Ad Schellevis Date: Sat Apr 13 17:56:09 2024 +0200 net/frr - style cleanups for https://github.com/opnsense/plugins/pull/3759 , including the use of https://github.com/opnsense/core/commit/2d45b78f744059089078d56b3c108765b2d23608 to return all fields on search for the controller in question. commit c121bb855d29cbb8cbf649b234d642c2120faa8c Author: Franco Fichtner Date: Tue Mar 5 17:23:56 2024 +0100 net/frr: bump revision for change commit 0091d4679d237dfb7d67f9817c65a040c1207d51 Author: Franco Fichtner Date: Tue Feb 6 09:02:13 2024 +0100 net/frr: wrap up next version commit 41d7c2d12203ef5abdc15c8634c986f95e955f27 Author: Michael Date: Fri Jan 26 06:42:52 2024 +0100 Update bgpd.conf commit 63e4be87d070c8847582bf50186b2438b33f49ee Author: Michael Date: Fri Jan 12 16:56:01 2024 +0100 Update bgp.xml commit 22880d7d4d248f4e8e00296d180572b0839b9a5a Author: Michael Date: Fri Jan 12 16:50:16 2024 +0100 Update bgpd.conf commit e5b5ee38198d13dfb1be995acd75c7eb98fbb113 Author: Michael Date: Fri Jan 12 16:44:26 2024 +0100 Update bgpd.conf commit f7d7630d76766425aab780d7f1712d52dc9d8a08 Author: Michael Date: Fri Jan 12 16:42:43 2024 +0100 add distance commit 30e479ee559a04a9c32d53ce46db77899b5555ab Author: Michael Date: Fri Jan 12 16:22:25 2024 +0100 Update bgpd.conf commit fbc89c7aeb88b73ac155e49b85a097bd2d527b7e Author: Michael Date: Fri Jan 12 09:38:47 2024 +0100 Update BGP.xml commit f18d80733661da36ffc6bf1c0c7006b211a6b21c Author: Michael Date: Fri Jan 12 09:36:21 2024 +0100 Update BGP.xml commit b10a53ac52f3d1c38be90d389892eb390ef0439a Author: Michael Date: Fri Jan 12 08:33:33 2024 +0100 typos commit fd2d9d71b11e801ad52bb66e08be61aa1622917e Author: Michael Date: Fri Jan 12 07:58:49 2024 +0100 bgp-group support --- net/frr/pkg-descr | 4 + .../OPNsense/Quagga/Api/BgpController.php | 83 +++++++------- .../OPNsense/Quagga/BgpController.php | 3 +- .../controllers/OPNsense/Quagga/forms/bgp.xml | 7 ++ .../Quagga/forms/dialogEditBGPNeighbor.xml | 6 ++ .../Quagga/forms/dialogEditBGPPeergroups.xml | 59 ++++++++++ .../mvc/app/models/OPNsense/Quagga/BGP.xml | 93 +++++++++++++++- .../mvc/app/views/OPNsense/Quagga/bgp.volt | 101 ++++++++++++------ .../templates/OPNsense/Quagga/bgpd.conf | 59 ++++++++++ 9 files changed, 336 insertions(+), 79 deletions(-) create mode 100644 net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPPeergroups.xml diff --git a/net/frr/pkg-descr b/net/frr/pkg-descr index 78f2520ca4..e07ba54025 100644 --- a/net/frr/pkg-descr +++ b/net/frr/pkg-descr @@ -14,6 +14,10 @@ Plugin Changelog 1.39 +* Add plain password authentication to OSPF +* Set multihop value to 255 (contributed by Cogan Ng Jun Lin) +* Add distance to BGP +* Add BGP peer-group support * Add plain password authentication to OSPF * Set multihop value to 255 (contributed by Cogan Ng Jun Lin) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php index 79de7caf46..2d1759dcec 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/BgpController.php @@ -1,9 +1,9 @@ + * Copyright (C) 2017-2024 Michael Muenz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,32 +39,11 @@ class BgpController extends ApiMutableModelControllerBase public function searchNeighborAction() { - return $this->searchBase( - 'neighbors.neighbor', - array("enabled", - "description", - "address", - "remoteas", - "password", - "localip", - "updatesource", - "nexthopself", - "multihop", - "keepalive", - "holddown", - "connecttimer", - "defaultoriginate", - "asoverride", - "linkedPrefixlistIn", - "linkedPrefixlistOut", - "linkedRoutemapIn", - "linkedRoutemapOut") - ); + return $this->searchBase('neighbors.neighbor'); } public function getNeighborAction($uuid = null) { - $this->sessionClose(); return $this->getBase('neighbor', 'neighbors.neighbor', $uuid); } @@ -85,15 +64,11 @@ public function setNeighborAction($uuid) public function searchAspathAction() { - return $this->searchBase( - 'aspaths.aspath', - array("enabled", "description", "number", "action", "as" ) - ); + return $this->searchBase('aspaths.aspath'); } public function getAspathAction($uuid = null) { - $this->sessionClose(); return $this->getBase('aspath', 'aspaths.aspath', $uuid); } @@ -114,14 +89,11 @@ public function setAspathAction($uuid) public function searchPrefixlistAction() { - return $this->searchBase( - 'prefixlists.prefixlist', - array("enabled", "description", "name", "seqnumber", "action", "network" ) - ); + return $this->searchBase('prefixlists.prefixlist'); } + public function getPrefixlistAction($uuid = null) { - $this->sessionClose(); return $this->getBase('prefixlist', 'prefixlists.prefixlist', $uuid); } @@ -142,14 +114,11 @@ public function setPrefixlistAction($uuid) public function searchCommunitylistAction() { - return $this->searchBase( - 'communitylists.communitylist', - array("enabled", "description", "number", "seqnumber", "action", "community" ) - ); + return $this->searchBase('communitylists.communitylist'); } + public function getCommunitylistAction($uuid = null) { - $this->sessionClose(); return $this->getBase('communitylist', 'communitylists.communitylist', $uuid); } @@ -170,15 +139,11 @@ public function setCommunitylistAction($uuid) public function searchRoutemapAction() { - return $this->searchBase( - 'routemaps.routemap', - array("enabled", "description", "name", "action", "id", "match", "match2", "set") - ); + return $this->searchBase('routemaps.routemap'); } public function getRoutemapAction($uuid = null) { - $this->sessionClose(); return $this->getBase('routemap', 'routemaps.routemap', $uuid); } @@ -197,6 +162,31 @@ public function setRoutemapAction($uuid) return $this->setBase('routemap', 'routemaps.routemap', $uuid); } + public function searchPeergroupAction() + { + return $this->searchBase('peergroups.peergroup'); + } + + public function getPeergroupAction($uuid = null) + { + return $this->getBase('peergroup', 'peergroups.peergroup', $uuid); + } + + public function addPeergroupAction() + { + return $this->addBase('peergroup', 'peergroups.peergroup'); + } + + public function delPeergroupAction($uuid) + { + return $this->delBase('peergroups.peergroup', $uuid); + } + + public function setPeergroupAction($uuid) + { + return $this->setBase('peergroup', 'peergroups.peergroup', $uuid); + } + public function toggleCommunitylistAction($uuid) { return $this->toggleBase('communitylists.communitylist', $uuid); @@ -221,4 +211,9 @@ public function toggleRoutemapAction($uuid) { return $this->toggleBase('routemaps.routemap', $uuid); } + + public function togglePeergroupAction($uuid) + { + return $this->toggleBase('peergroups.peergroup', $uuid); + } } diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/BgpController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/BgpController.php index 373d4bea4c..0b34cfd6c2 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/BgpController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/BgpController.php @@ -2,7 +2,7 @@ /* * Copyright (C) 2017 Fabian Franz - * Copyright (C) 2017-2020 Michael Muenz + * Copyright (C) 2017-2024 Michael Muenz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,6 +38,7 @@ public function indexAction() $this->view->formDialogEditBGPPrefixLists = $this->getForm("dialogEditBGPPrefixLists"); $this->view->formDialogEditBGPCommunityLists = $this->getForm("dialogEditBGPCommunityLists"); $this->view->formDialogEditBGPRouteMaps = $this->getForm("dialogEditBGPRouteMaps"); + $this->view->formDialogEditBGPPeergroups = $this->getForm("dialogEditBGPPeergroups"); $this->view->pick('OPNsense/Quagga/bgp'); } } diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/bgp.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/bgp.xml index 37b182e1a6..8cb5f97590 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/bgp.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/bgp.xml @@ -11,6 +11,13 @@ text Your AS Number here + + bgp.distance + + text + true + BGP routes usually have an administrative distance of 20. Here you can adjust these values, e.g. when you want to prefer OSPF learned routes. + bgp.routerid diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml index 4a30acbe78..7b326faecf 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml @@ -169,4 +169,10 @@ dropdown Route-Map for outbound direction + + neighbor.peergroup + + dropdown + Peer Group this neighbor belongs to. + diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPPeergroups.xml b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPPeergroups.xml new file mode 100644 index 0000000000..ea19cf0c05 --- /dev/null +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPPeergroups.xml @@ -0,0 +1,59 @@ +
    + + peergroup.enabled + + checkbox + + + peergroup.name + + text + Specify the name of this peergroup. + + + peergroup.remoteas + + text + Remote AS for tthis peergroup. + + + peergroup.updatesource + + dropdown + FRR documentation for more information.]]> + + + peergroup.nexthopself + + checkbox + + + peergroup.defaultoriginate + + checkbox + + + peergroup.linkedPrefixlistIn + + dropdown + Prefix-List for inbound direction. + + + peergroup.linkedPrefixlistOut + + dropdown + Prefix-List for outbound direction. + + + peergroup.linkedRoutemapIn + + dropdown + Route-Map for inbound direction. + + + peergroup.linkedRoutemapOut + + dropdown + Route-Map for outbound direction. + +
    diff --git a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml index 63f3059630..a7239218ec 100644 --- a/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml +++ b/net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/BGP.xml @@ -1,7 +1,7 @@ //OPNsense/quagga/bgp BGP Routing configuration - 1.0.8 + 1.0.9 0 @@ -13,6 +13,10 @@ 1 4294967295 + + 1 + 255 + N /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ @@ -60,8 +64,6 @@ Y - - Y 1 4294967295 @@ -211,7 +213,19 @@ N N - + + + + + Related Peer Group item not found + N + + @@ -395,5 +409,76 @@ + + + + 1 + Y + + + Y + + + Y + 1 + 4294967295 + + + Y + + /^(?!0).*$/ + /^(?!group).*$/ + + + + + + + + + Related Prefix-List item not found + + + + + + Related Prefix-List item not found + N + N + + + + + + Related Route-Map item not found + + + + + + Related Route-Map item not found + + + diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/bgp.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/bgp.volt index 6fe6af7acf..82e62cfe63 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/bgp.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/bgp.volt @@ -1,6 +1,6 @@ {# -OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. +OPNsense® is Copyright © 2014 – 2024 by Deciso B.V. Copyright (C) 2017 Fabian Franz Copyright (C) 2017 - 2020 Michael Muenz All rights reserved. @@ -35,6 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('Prefix Lists') }}
  • {{ lang._('Community Lists') }}
  • {{ lang._('Route Maps') }}
  • +
  • {{ lang._('Peer Groups') }}
  • @@ -51,13 +52,13 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Enabled') }} - {{ lang._('Description') }} - {{ lang._('Neighbor Address') }} - {{ lang._('Remote AS') }} - {{ lang._('Prefix List inbound') }} - {{ lang._('Prefix List outbound') }} - {{ lang._('Route Map inbound') }} - {{ lang._('Route Map outbound') }} + {{ lang._('Description') }} + {{ lang._('Neighbor Address') }} + {{ lang._('Remote AS') }} + {{ lang._('Prefix List inbound') }} + {{ lang._('Prefix List outbound') }} + {{ lang._('Route Map inbound') }} + {{ lang._('Route Map outbound') }} {{ lang._('ID') }} {{ lang._('Commands') }} @@ -81,10 +82,10 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Enabled') }} - {{ lang._('Description') }} - {{ lang._('Number') }} - {{ lang._('Action') }} - {{ lang._('AS Number') }} + {{ lang._('Description') }} + {{ lang._('Number') }} + {{ lang._('Action') }} + {{ lang._('AS Number') }} {{ lang._('ID') }} {{ lang._('Commands') }} @@ -108,11 +109,11 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Enabled') }} - {{ lang._('Name') }} - {{ lang._('Description') }} - {{ lang._('Sequence Number') }} - {{ lang._('Action') }} - {{ lang._('Network') }} + {{ lang._('Name') }} + {{ lang._('Description') }} + {{ lang._('Sequence Number') }} + {{ lang._('Action') }} + {{ lang._('Network') }} {{ lang._('ID') }} {{ lang._('Commands') }} @@ -136,11 +137,11 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Enabled') }} - {{ lang._('Number') }} - {{ lang._('Description') }} - {{ lang._('Secquence Number') }} - {{ lang._('Action') }} - {{ lang._('Community') }} + {{ lang._('Number') }} + {{ lang._('Description') }} + {{ lang._('Secquence Number') }} + {{ lang._('Action') }} + {{ lang._('Community') }} {{ lang._('ID') }} {{ lang._('Commands') }} @@ -164,14 +165,14 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Enabled') }} - {{ lang._('Name') }} - {{ lang._('Description') }} - {{ lang._('Action') }} - {{ lang._('ID') }} - {{ lang._('AS Path List') }} - {{ lang._('Prefix List') }} - {{ lang._('Community List') }} - {{ lang._('Set') }} + {{ lang._('Name') }} + {{ lang._('Description') }} + {{ lang._('Action') }} + {{ lang._('ID') }} + {{ lang._('AS Path List') }} + {{ lang._('Prefix List') }} + {{ lang._('Community List') }} + {{ lang._('Set') }} {{ lang._('ID') }} {{ lang._('Commands') }} @@ -189,6 +190,35 @@ POSSIBILITY OF SUCH DAMAGE.
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    {{ lang._('Enabled') }}{{ lang._('Name') }}{{ lang._('Next Hop Self') }}{{ lang._('Default Originate') }}{{ lang._('Prefix List inbound') }}{{ lang._('Prefix List outbound') }}{{ lang._('Route Map inbound') }}{{ lang._('Route Map outbound') }}{{ lang._('ID') }}{{ lang._('Commands') }}
    + + +
    +
    @@ -283,3 +323,4 @@ $(document).ready(function() { {{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPPrefixLists,'id':'DialogEditBGPPrefixLists','label':lang._('Edit Prefix Lists')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPCommunityLists,'id':'DialogEditBGPCommunityLists','label':lang._('Edit Community Lists')])}} {{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPRouteMaps,'id':'DialogEditBGPRouteMaps','label':lang._('Edit Route Maps')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditBGPPeergroups,'id':'DialogEditBGPPeergroups','label':lang._('Edit Peer Groups')])}} diff --git a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf index ef975a7f3c..12fc2b9a7a 100644 --- a/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf +++ b/net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf @@ -59,10 +59,65 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if helpers.exists('OPNsense.quagga.bgp.routerid') and OPNsense.quagga.bgp.routerid != '' %} bgp router-id {{ OPNsense.quagga.bgp.routerid }} {% endif %} +{% if helpers.exists('OPNsense.quagga.bgp.distance') and OPNsense.quagga.bgp.distance != '' %} + distance bgp {{ OPNsense.quagga.bgp.distance }} {{ OPNsense.quagga.bgp.distance }} {{ OPNsense.quagga.bgp.distance }} +{% endif %} +{% for peergroup in helpers.toList('OPNsense.quagga.bgp.peergroups.peergroup') %} +{% if peergroup.enabled == '1' %} + neighbor {{ peergroup.name }} peer-group +{% if 'remoteas' in peergroup and peergroup.remoteas != '' %} + neighbor {{ peergroup.name }} remote-as {{ peergroup.remoteas }} +{% endif %} +{% if peergroup.updatesource|default('0') == '1' %} + neighbor {{ peergroup.name }} update-source {{ physical_interface(peergroup.updatesource) }} +{% endif %} + neighbor {{ peergroup.name }} activate +{% if peergroup.nexthopself|default('0') == '1' %} + neighbor {{ peergroup.name }} next-hop-self +{% endif %} +{% if peergroup.defaultoriginate|default('0') == '1' %} + neighbor {{ peergroup.name }} default-originate +{% endif %} +{% if peergroup.linkedPrefixlistIn|default("") != "" %} +{% for prefixlist in peergroup.linkedPrefixlistIn.split(",") %} +{% set prefixlist2_data = helpers.getUUID(prefixlist) %} +{% if prefixlist2_data != {} and prefixlist2_data.enabled == '1' %} + neighbor {{ peergroup.name }} prefix-list {{ prefixlist2_data.name }} in +{% endif %} +{% endfor %} +{% endif %} +{% if peergroup.linkedPrefixlistOut|default("") != "" %} +{% for prefixlist in peergroup.linkedPrefixlistOut.split(",") %} +{% set prefixlist_data = helpers.getUUID(prefixlist) %} +{% if prefixlist_data != {} and prefixlist_data.enabled == '1' %} + neighbor {{ peergroup.name }} prefix-list {{ prefixlist_data.name }} out +{% endif %} +{% endfor %} +{% endif %} +{% if peergroup.linkedRoutemapIn|default("") != "" %} +{% for aspath in peergroup.linkedRoutemapIn.split(",") %} +{% set routemap2_data = helpers.getUUID(aspath) %} +{% if routemap2_data != {} and routemap2_data.enabled == '1' %} + neighbor {{ peergroup.name }} route-map {{ routemap2_data.name }} in +{% endif %} +{% endfor %} +{% endif %} +{% if peergroup.linkedRoutemapOut|default("") != "" %} +{% for aspath in peergroup.linkedRoutemapOut.split(",") %} +{% set routemap_data = helpers.getUUID(aspath) %} +{% if routemap_data != {} and routemap_data.enabled == '1' %} + neighbor {{ peergroup.name }} route-map {{ routemap_data.name }} out +{% endif %} +{% endfor %} +{% endif %} +{% endif %} +{% endfor %} {% if helpers.exists('OPNsense.quagga.bgp.neighbors.neighbor') %} {% for neighbor in helpers.toList('OPNsense.quagga.bgp.neighbors.neighbor') %} {% if neighbor.enabled == '1' %} +{% if 'remoteas' in neighbor and neighbor.remoteas != '' %} neighbor {{ neighbor.address }} remote-as {{ neighbor.remoteas }} +{% endif %} {% if neighbor.bfd|default('') == '1' %} neighbor {{ neighbor.address }} bfd {% endif %} @@ -95,6 +150,10 @@ router bgp {{ OPNsense.quagga.bgp.asnumber }} {% if 'attributeunchanged' in neighbor and neighbor.attributeunchanged != '' %} neighbor {{ neighbor.address }} attribute-unchanged {{ neighbor.attributeunchanged }} {% endif %} +{% if neighbor.peergroup|default('') != '' %} +{% set pgname = helpers.getUUID(neighbor.peergroup) %} + neighbor {{ neighbor.address }} peer-group {{ pgname.name }} +{% endif %} {% endif %} {% endfor %} {% endif %} From 8f2490aa8a1a1d057d1de2a30521d0037cc3c519 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Apr 2024 21:39:57 +0200 Subject: [PATCH 1848/3088] LICENSE/README: sync --- LICENSE | 8 ++++++-- README.md | 3 ++- .../opnsense/mvc/app/views/OPNsense/Quagga/static.volt | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 61caa7c55e..fccf40525f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,6 @@ Copyright (c) 2015-2023 Ad Schellevis Copyright (c) 2022 agh1467 +Copyright (c) 2024 Alex Smith Copyright (c) 2021 Alexander Noack Copyright (c) 2021 Andreas Stuerz Copyright (c) 2021 Axelrtgs @@ -12,7 +13,7 @@ Copyright (c) 2021 Dan Lundqvist Copyright (c) 2021 David Berry Copyright (c) 2017-2018 David Harrigan Copyright (c) 2021 David Hughes -Copyright (c) 2014-2023 Deciso B.V. +Copyright (c) 2014-2024 Deciso B.V. Copyright (c) 2020 devNan0 Copyright (c) 2023 Dmitry Shinkaruk Copyright (c) 2006 Eric Friesen @@ -43,14 +44,17 @@ Copyright (c) 2021 Markus Peter Copyright (c) 2022 Markus Reiter Copyright (c) 2020 Martin Wasley Copyright (c) 2022 Marvo2011 -Copyright (c) 2017-2021 Michael Muenz +Copyright (c) 2017-2024 Michael Muenz +Copyright (c) 2024 Mike Shuey Copyright (c) 2023 Mikhail Kharisov Copyright (c) 2012 mkirbst Copyright (c) 2023 mleinart +Copyright (c) 2024 MVZ Labor Ludwigsburg GbR Copyright (c) 2021 Nicola Pellegrini Copyright (c) 2022 Nikolaj Brinch Jørgensen Copyright (c) 2021 Nim G Copyright (c) 2023 Oliver Hartl +Copyright (c) 2024 realizelol Copyright (c) 2022 Robbert Rijkse Copyright (c) 2023 sattamjh Copyright (c) 2004-2012 Scott Ullrich diff --git a/README.md b/README.md index 460c2f7392..02fc2fb69b 100644 --- a/README.md +++ b/README.md @@ -107,9 +107,10 @@ sysutils/virtualbox -- VirtualBox guest additions sysutils/vmware -- VMware tools sysutils/xen -- Xen guest utilities vendor/sunnyvalley -- Vendor Repository for Zenarmor (a.k.a Sensei, Next Generation Firewall Extensions) +www/OPNProxy -- OPNsense proxy additions www/c-icap -- c-icap connects the web proxy with a virus scanner www/cache -- Webserver cache -www/caddy -- Easy to configure Reverse Proxy based on Caddy with Automatic HTTPS and Dynamic DNS +www/caddy -- Easy to configure Reverse Proxy with Automatic HTTPS and Dynamic DNS www/nginx -- Nginx HTTP server and reverse proxy www/squid -- Squid is a caching proxy for the web www/web-proxy-sso -- Kerberos authentication module diff --git a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/static.volt b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/static.volt index 5de53fc3e8..f699b7d2cd 100644 --- a/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/static.volt +++ b/net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/static.volt @@ -1,6 +1,6 @@ {# # Copyright (c) 2024 Deciso B.V. - # Copyright (c) 2024 by Mike Shuey + # Copyright (c) 2024 Mike Shuey # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, From 7e6bc0ae490a90a195d2b07f5d2a09805be2fab4 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:22:31 +0200 Subject: [PATCH 1849/3088] www/caddy: Fix input validation - allow wildcard domains and base domains at the same time (#3915) * Update Caddy.php - Remove validation that checks for conflicts between wildcard and base domain If a user creates a wildcard domain, the base domain won't be represented under it, so the base domain has to be created additionally. This validation prevented this from happening, even though it's a valid configuration. * Update pkg-descr - included fix --- www/caddy/pkg-descr | 1 + .../mvc/app/models/OPNsense/Caddy/Caddy.php | 37 ------------------- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 452ecabe8d..c3c9030dca 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -37,6 +37,7 @@ Plugin Changelog * Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS. * Add: Simple Load Balancing support with the default random policy, by allowing to add multiple Upstream Domains in Handlers. * Add: Passive Health check for load balancing (Upstream Fail Duration) in Handlers. +* Fix: Input validation so a base domain like "example.com" and a wildcard domain like "*.example.com" can now be created at the same time in domains. 1.5.3 diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php index 953f284fb1..5313912134 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php @@ -107,41 +107,6 @@ private function checkSubdomainsAgainstDomains($subdomains, $domains, $messages) } } - // 4. Check for conflicts between wildcard and base domains - private function checkForWildcardAndBaseDomainConflicts($domains, $messages) - { - $domainList = []; - foreach ($domains as $domain) { - if ((string) $domain->enabled === '1') { - $domainName = (string) $domain->FromDomain; - $domainList[$domainName] = true; - - // Check for wildcard or base domain conflict - if (str_starts_with($domainName, '*.')) { - $baseDomain = substr($domainName, 2); - if (isset($domainList[$baseDomain])) { - $key = $domain->__reference; // Dynamic key based on domain reference - $messages->appendMessage(new Message( - "Invalid domain configuration: Cannot create wildcard domain '$domainName' because base domain '$baseDomain' exists.", - $key . ".FromDomain", // Use dynamic key for message referencing - "WildcardBaseConflict" - )); - } - } else { - $wildcardDomain = '*.' . $domainName; - if (isset($domainList[$wildcardDomain])) { - $key = $domain->__reference; // Dynamic key based on domain reference - $messages->appendMessage(new Message( - "Invalid domain configuration: Cannot create base domain '$domainName' because wildcard domain '$wildcardDomain' exists.", - $key . ".FromDomain", // Use dynamic key for message referencing - "BaseWildcardConflict" - )); - } - } - } - } - } - // Perform the actual validation public function performValidation($validateFullModel = false) { @@ -152,8 +117,6 @@ public function performValidation($validateFullModel = false) $this->checkForUniquePortCombos($this->reverseproxy->subdomain->iterateItems(), $messages, 'subdomain'); // 3. Check that subdomains are under a wildcard or exact domain $this->checkSubdomainsAgainstDomains($this->reverseproxy->subdomain->iterateItems(), $this->reverseproxy->reverse->iterateItems(), $messages); - // 4. Check for conflicts between wildcard and base domains - $this->checkForWildcardAndBaseDomainConflicts($this->reverseproxy->reverse->iterateItems(), $messages); return $messages; } From cca59e7e4ac1611030473d75c5f07e3b1042f0f8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Apr 2024 16:54:23 +0200 Subject: [PATCH 1850/3088] plugins: style sweep --- .../OPNsense/Quagga/Api/StaticController.php | 13 +++++++------ .../OPNsense/Quagga/StaticController.php | 1 + .../mvc/app/models/OPNsense/Quagga/STATICd.php | 2 ++ .../mvc/app/models/OPNsense/Relayd/Relayd.php | 6 +++--- www/OPNProxy/pkg-descr | 1 - www/caddy/pkg-descr | 2 +- .../OPNsense/Caddy/Api/ReverseProxyController.php | 12 ++++++------ .../OPNsense/Caddy/Api/ServiceController.php | 2 +- .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 4 ++-- .../service/templates/OPNsense/Caddy/Caddyfile | 12 ++++++------ 10 files changed, 29 insertions(+), 26 deletions(-) diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php index 802d279834..9a616cdb5f 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/Api/StaticController.php @@ -1,4 +1,5 @@ searchBase('routes.route'); + return $this->searchBase('routes.route'); } public function getRouteAction($uuid = null) { - return $this->getBase('route', 'routes.route', $uuid); + return $this->getBase('route', 'routes.route', $uuid); } public function setRouteAction($uuid) { - return $this->setBase('route', 'routes.route', $uuid); + return $this->setBase('route', 'routes.route', $uuid); } public function addRouteAction() { - return $this->addBase('route', 'routes.route'); + return $this->addBase('route', 'routes.route'); } public function delRouteAction($uuid) { - return $this->delBase('routes.route', $uuid); + return $this->delBase('routes.route', $uuid); } public function toggleRouteAction($uuid) { - return $this->toggleBase('routes.route', $uuid); + return $this->toggleBase('routes.route', $uuid); } } diff --git a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php index 5798e168e5..a6888d4693 100644 --- a/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php +++ b/net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/StaticController.php @@ -1,4 +1,5 @@ expect)) { $messages->appendMessage( - new Message(gettext('Expect Pattern cannot be empty.'), $key . ".expect") + new Message(gettext('Expect Pattern cannot be empty.'), $key . ".expect") ); } break; case 'script': if (empty((string)$node->path)) { $messages->appendMessage( - new Message(gettext('Script path cannot be empty.'), $key . ".path") + new Message(gettext('Script path cannot be empty.'), $key . ".path") ); } break; case 'http': if (empty((string)$node->path)) { $messages->appendMessage( - new Message(gettext('Path cannot be empty.'), $key . ".path") + new Message(gettext('Path cannot be empty.'), $key . ".path") ); } if (empty((string)$node->code) && empty((string)$node->digest)) { diff --git a/www/OPNProxy/pkg-descr b/www/OPNProxy/pkg-descr index c731c51c9f..c5033a435d 100644 --- a/www/OPNProxy/pkg-descr +++ b/www/OPNProxy/pkg-descr @@ -7,4 +7,3 @@ OPNsense proxy additions to support more fine grained access management 1.0.4: * Remove ident support as by default it is denied anyway nowadays - diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index c3c9030dca..e59ec80758 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -34,7 +34,7 @@ Plugin Changelog * Add: HTTP response code and HTTP response message can be set per access list in advanced mode. * Add: Header functionality added. Multiple header manipulations can be set per handler. * Cleanup: Update searchBase() in ReverseProxyController.php for easier maintainability. -* Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS. +* Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS. * Add: Simple Load Balancing support with the default random policy, by allowing to add multiple Upstream Domains in Handlers. * Add: Passive Health check for load balancing (Upstream Fail Duration) in Handlers. * Fix: Input validation so a base domain like "example.com" and a wildcard domain like "*.example.com" can now be created at the same time in domains. diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php index 140330a06b..4dcd01ce6d 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php @@ -41,7 +41,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase /*ReverseProxy Section*/ - public function searchReverseProxyAction($add_empty='0') + public function searchReverseProxyAction($add_empty = '0') { return $this->searchBase("reverseproxy.reverse", null, 'description'); } @@ -74,7 +74,7 @@ public function toggleReverseProxyAction($uuid, $enabled = null) /*Subdomain Section*/ - public function searchSubdomainAction($add_empty='0') + public function searchSubdomainAction($add_empty = '0') { return $this->searchBase("reverseproxy.subdomain", null, 'description'); } @@ -107,7 +107,7 @@ public function toggleSubdomainAction($uuid, $enabled = null) /*Handler Section*/ - public function searchHandleAction($add_empty='0') + public function searchHandleAction($add_empty = '0') { return $this->searchBase("reverseproxy.handle", null, 'description'); } @@ -140,7 +140,7 @@ public function toggleHandleAction($uuid, $enabled = null) /* AccessList Section */ - public function searchAccessListAction($add_empty='0') + public function searchAccessListAction($add_empty = '0') { return $this->searchBase("reverseproxy.accesslist", null, 'description'); } @@ -168,7 +168,7 @@ public function delAccessListAction($uuid) /* BasicAuth Section */ - public function searchBasicAuthAction($add_empty='0') + public function searchBasicAuthAction($add_empty = '0') { return $this->searchBase("reverseproxy.basicauth", null, 'description'); } @@ -216,7 +216,7 @@ public function delBasicAuthAction($uuid) /* Header Section */ - public function searchHeaderAction($add_empty='0') + public function searchHeaderAction($add_empty = '0') { return $this->searchBase("reverseproxy.header", null, 'description'); } diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php index f719a74d9b..e522dc52dd 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ServiceController.php @@ -46,7 +46,7 @@ protected function reconfigureForceRestart() // Caddy can use a reload action instead return 0; } - + public function validateAction() { $backend = new Backend(); diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index acfc075d9e..843e60d75d 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -60,7 +60,7 @@ OPNsense.Caddy.Caddy reverseproxy.accesslist accesslistName,description - %s - %s + %s - %s @@ -124,7 +124,7 @@ OPNsense.Caddy.Caddy reverseproxy.accesslist accesslistName,description - %s - %s + %s - %s diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index 178c3ea781..2e7e7f37e1 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -85,7 +85,7 @@ {# # Section: Dynamic DNS Global Configuration - # Purpose: Sets up global configuration for Dynamic DNS. Caddy needs to be compiled with + # Purpose: Sets up global configuration for Dynamic DNS. Caddy needs to be compiled with # https://github.com/mholt/caddy-dynamicdns and https://github.com/caddy-dns. Otherwise the # generated Caddyfile won't run. Each DNS Provider that is added below has to be compiled in. # Some Providers don't support setting A and AAAA-Records, like acmedns. @@ -284,7 +284,7 @@ {# # Section: HTTP-01 Challenge Redirection -# Purpose: A small premade reverse_proxy section +# Purpose: A small premade reverse_proxy section # that can redirect the HTTP-01 challenge to a different webserver. #} {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} @@ -442,7 +442,7 @@ {# # Macro: header_manipulation -# Purpose: Customizes HTTP headers for requests or responses; to add, remove, or modify headers. +# Purpose: Customizes HTTP headers for requests or responses; to add, remove, or modify headers. # It uses a 'handle' object that specifies which headers to manipulate based on their @UUIDs. # Each handle can have multiple of these HTTP headers assigned. # Parameters: @@ -574,7 +574,7 @@ # Macro: basicauth_configuration # Purpose: Implements basic authentication with a username and password for access. # Parameters: -# @param basicauth_uuids (@string): A comma-separated list of UUIDs, each UUID corresponding to +# @param basicauth_uuids (@string): A comma-separated list of UUIDs, each UUID corresponding to # a specific user credentials (username and password). # - @uuid (@string) # - basicauthuser (@string): The username required for authentication. @@ -595,7 +595,7 @@ {# # Section: Reverse Proxy Configurations -# Purpose: Assembles reverse proxy configurations using predefined macros. +# Purpose: Assembles reverse proxy configurations using predefined macros. # This is the main logic of the whole template, handle with care. # Macros Used: # - tls_configuration @@ -603,7 +603,7 @@ # - access_list_configuration # - reverse_proxy_configuration # - indirect: header_manipulation -# Important Details: +# Important Details: # - Order of Path specific Handles - Prioritizes order of specific path handles over catch-all handles. # - Order of Wildcard Domains and Subdomains: Handles for wildcard domains come after all subdomains. #} From aa1994d4c92378ada61969796817122dd8f35ba6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 17 Apr 2024 13:23:18 +0200 Subject: [PATCH 1851/3088] www/caddy: release as intitial 1.5.4 The devlopment version was also at 1.5.3 in 24.1.5. --- www/caddy/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/www/caddy/Makefile b/www/caddy/Makefile index 208aef7c0d..a2694d60aa 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= caddy PLUGIN_VERSION= 1.5.4 -PLUGIN_REVISION= 1 PLUGIN_DEPENDS= caddy-custom PLUGIN_COMMENT= Easy to configure Reverse Proxy with Automatic HTTPS and Dynamic DNS PLUGIN_MAINTAINER= cedrik@pischem.com From aa92218d6ad59092bf405e07c28146f9ac7ffe96 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 17 Apr 2024 13:27:57 +0200 Subject: [PATCH 1852/3088] net/frr: bump for recent changes changelog is a bit over the place, but looking into this with the next frr release --- net/frr/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/frr/Makefile b/net/frr/Makefile index dc4543e128..cfcb6bb7e8 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= frr PLUGIN_VERSION= 1.39 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= The FRRouting Protocol Suite PLUGIN_DEPENDS= frr8 PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From e7602ec2ad5a0af568526aa9ada142afb19a6ef2 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 17 Apr 2024 16:58:59 +0200 Subject: [PATCH 1853/3088] net/relayd - limit virtual server names to 31 characters, closes https://github.com/opnsense/plugins/issues/3916 --- net/relayd/Makefile | 2 +- .../src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index 6a3a1aba62..2730625558 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= relayd PLUGIN_VERSION= 2.8 -PLUGIN_REVISION= 3 +PLUGIN_REVISION= 4 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com diff --git a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml index 56baf5eed7..59e4e82365 100644 --- a/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml +++ b/net/relayd/src/opnsense/mvc/app/models/OPNsense/Relayd/Relayd.xml @@ -1,6 +1,6 @@ //OPNsense/relayd - 1.0.5 + 1.0.6 Relayd settings @@ -145,8 +145,8 @@ Y - /^([0-9a-zA-Z\._\- ]){1,255}$/u - Should be a string between 1 and 255 characters. Allowed characters are letters and numbers as well as underscore, minus, dot and space. + /^([0-9a-zA-Z\._\- ]){1,31}$/u + Should be a string between 1 and 31 characters. Allowed characters are letters and numbers as well as underscore, minus, dot and space. Virtual server names should be unique. From 1897803d1f8820cde8af05ec261c14e3f411f9bd Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Mon, 22 Apr 2024 08:28:43 +0200 Subject: [PATCH 1854/3088] www/caddy: Create Migration script that fixes issue with Caddy not being able to start. (Regression in 1.5.4) (#3931) * Create M1_1_7.php This migration script empties out "on" and "none" options that were replaced with empty values by this pull request. It fixes the regression that Caddy will refuse to start because invalid values for AutoHttps and DnsProvider will remain stored in the config without a manual config change from the user. Compare to: https://github.com/opnsense/plugins/commit/a628ebfc0682c0f27ec59b6a605dbeff8bd52765 Issue was tracked multiple times: https://forum.opnsense.org/index.php?topic=40075.0 https://github.com/opnsense/plugins/pull/3930 https://github.com/opnsense/plugins/issues/3917#issuecomment-2064230068 * Bump Migration script and Model version to 1.1.8 --- www/caddy/Makefile | 1 + .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 2 +- .../OPNsense/Caddy/Migrations/M1_1_8.php | 71 +++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php diff --git a/www/caddy/Makefile b/www/caddy/Makefile index a2694d60aa..2623a74790 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= caddy PLUGIN_VERSION= 1.5.4 +PLUGIN_REVISION= 1 PLUGIN_DEPENDS= caddy-custom PLUGIN_COMMENT= Easy to configure Reverse Proxy with Automatic HTTPS and Dynamic DNS PLUGIN_MAINTAINER= cedrik@pischem.com diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index 843e60d75d..af002c9ead 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -1,7 +1,7 @@ //Pischem/caddy A GUI model for configuring a reverse proxy in the Caddy web server. - 1.1.7 + 1.1.8 diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php new file mode 100644 index 0000000000..0687d49abc --- /dev/null +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php @@ -0,0 +1,71 @@ +object(); + + // Read and migrate TlsAutoHttps setting if necessary + if (!empty($config->Pischem->caddy->general->TlsAutoHttps)) { + $tlsAutoHttpsValue = (string)$config->Pischem->caddy->general->TlsAutoHttps; + // Check if the current value is 'on' and needs to be migrated + if ($tlsAutoHttpsValue === 'on') { + // Locate the corresponding node in the model + $modelNode = $model->getNodeByReference('general.TlsAutoHttps'); + if ($modelNode != null) { + // Set to empty value in the model, migration from 'on' to '' + $modelNode->setValue(''); + } + } + } + + // Read and migrate TlsDnsProvider setting if necessary + if (!empty($config->Pischem->caddy->general->TlsDnsProvider)) { + $tlsDnsProviderValue = (string)$config->Pischem->caddy->general->TlsDnsProvider; + // Check if the current value is 'none' and needs to be migrated + if ($tlsDnsProviderValue === 'none') { + // Locate the corresponding node in the model + $modelNode = $model->getNodeByReference('general.TlsDnsProvider'); + if ($modelNode != null) { + // Set to empty value in the model, migration from 'none' to '' + $modelNode->setValue(''); + } + } + } + + // Model is saved by 'run_migrations.php' + } +} From 4a39ea0d0c284df16a9234321ccaecb05584077d Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Mon, 22 Apr 2024 09:39:35 +0200 Subject: [PATCH 1855/3088] www/caddy: Change display of domain and port combination in Model Relation Field (#3927) * Update Caddy.xml - Replace ":" with "." in Model Relation Field. Since a stray ":" when leaving the port empty could cause confusion, I have opted to replace it with a "." This adheres to the standard of FQDNs ending with a "DOT" at the end (RFC 1034). Note: This changes only what is displayed, not the stored data itself. This change makes an empty port in the GUI look like this: example.com. And with a port, like this: example.com.443 (Compare to: https://github.com/opnsense/plugins/issues/3917#issuecomment-2064230068 ) * Update Makefile - Bump revision to 1 * Actually just use a space, that one causes the least confusion. * Update www/caddy/Makefile --------- Co-authored-by: Franco Fichtner --- .../src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index af002c9ead..1aa9308fc5 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -163,7 +163,7 @@ OPNsense.Caddy.Caddy reverseproxy.reverse FromDomain,FromPort - %s:%s + %s %s @@ -215,7 +215,7 @@ OPNsense.Caddy.Caddy reverseproxy.reverse FromDomain,FromPort - %s:%s + %s %s @@ -225,7 +225,7 @@ OPNsense.Caddy.Caddy reverseproxy.subdomain FromDomain,FromPort - %s:%s + %s %s From 750465b75b0ee4e25db357ebf2dbf8c7a3d595e6 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 22 Apr 2024 10:55:03 +0200 Subject: [PATCH 1856/3088] net-mgmt/zabbix-proxy: fix syntax error, closes #3921 (#3932) Regression was introduced in 26e6379874d56190e409c07c37cb12a58679c1ff. --- net-mgmt/zabbix-proxy/Makefile | 1 + .../service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net-mgmt/zabbix-proxy/Makefile b/net-mgmt/zabbix-proxy/Makefile index c86a78b96b..4d3916f3cc 100644 --- a/net-mgmt/zabbix-proxy/Makefile +++ b/net-mgmt/zabbix-proxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= zabbix-proxy PLUGIN_VERSION= 1.10 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Zabbix monitoring proxy PLUGIN_MAINTAINER= m.muenz@gmail.com PLUGIN_VARIANTS= zabbix6 zabbix64 zabbix5 diff --git a/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in b/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in index 23d9f5cb3c..80373b0e1e 100644 --- a/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in +++ b/net-mgmt/zabbix-proxy/src/opnsense/service/templates/OPNsense/Zabbixproxy/zabbix_proxy.conf.in @@ -34,7 +34,7 @@ LogFile=/var/log/zabbix/zabbix_proxy.log LogFileSize={{OPNsense.zabbixproxy.general.logFileSize}} {% endif %} {% endif %} -{% if helpers.exists('OPNsense.zabbixproxy.general.debugLevel') +{% if helpers.exists('OPNsense.zabbixproxy.general.debugLevel') %} DebugLevel={{OPNsense.zabbixproxy.general.debugLevel|replace("val_", "")}} {% endif %} PidFile=/var/run/zabbix/zabbix_proxy.pid From 37429a46d2220cadff096f7d2b75e6dee39278ca Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Apr 2024 09:23:48 +0200 Subject: [PATCH 1857/3088] net/relayd: make new version --- net/relayd/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/relayd/Makefile b/net/relayd/Makefile index 2730625558..bb65570d65 100644 --- a/net/relayd/Makefile +++ b/net/relayd/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= relayd -PLUGIN_VERSION= 2.8 -PLUGIN_REVISION= 4 +PLUGIN_VERSION= 2.9 PLUGIN_DEPENDS= relayd PLUGIN_COMMENT= Relayd Load Balancer PLUGIN_MAINTAINER= frank.brendel@eurolog.com From ee0f83169a519c35780b0ae13cd2d911c31aeccb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 24 Apr 2024 09:26:20 +0200 Subject: [PATCH 1858/3088] security/openconnect: fiddle with wording --- security/openconnect/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/openconnect/pkg-descr b/security/openconnect/pkg-descr index 57081e80df..974ae1c81e 100644 --- a/security/openconnect/pkg-descr +++ b/security/openconnect/pkg-descr @@ -8,7 +8,7 @@ Plugin Changelog 1.4.6 -* add allowinsecure +* Add otion to allow insecure ciphers 1.4.5 From 666662ff91d6a81ea6f1d6454bef951beb4a3a4c Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 26 Apr 2024 08:49:52 +0200 Subject: [PATCH 1859/3088] net-mgmt/telegraf (#3777) --- net-mgmt/telegraf/Makefile | 2 +- net-mgmt/telegraf/pkg-descr | 4 +++ .../OPNsense/Telegraf/forms/output.xml | 34 +++++++++++++++++++ .../app/models/OPNsense/Telegraf/Output.xml | 23 +++++++++++++ .../templates/OPNsense/Telegraf/telegraf.conf | 18 ++++++++++ 5 files changed, 80 insertions(+), 1 deletion(-) diff --git a/net-mgmt/telegraf/Makefile b/net-mgmt/telegraf/Makefile index c9cc2cfb21..bfd8b96006 100644 --- a/net-mgmt/telegraf/Makefile +++ b/net-mgmt/telegraf/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= telegraf -PLUGIN_VERSION= 1.12.10 +PLUGIN_VERSION= 1.12.11 PLUGIN_COMMENT= Agent for collecting metrics and data PLUGIN_DEPENDS= telegraf PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net-mgmt/telegraf/pkg-descr b/net-mgmt/telegraf/pkg-descr index 2d83a444a1..33d82d4b0c 100644 --- a/net-mgmt/telegraf/pkg-descr +++ b/net-mgmt/telegraf/pkg-descr @@ -12,6 +12,10 @@ WWW: https://www.influxdata.com/time-series-platform/telegraf/ Plugin Changelog ================ +1.12.11 + +* Add OpenTelemetry output + 1.12.10 * Fix MQTT output and additional UI cleanup (contributed by Pierre Christen) diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml index 4f085287fb..056f64a929 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/controllers/OPNsense/Telegraf/forms/output.xml @@ -327,4 +327,38 @@ dropdown Data format to output. Defaults to "influx". + + + header + + + output.opentelemetry_enable + + checkbox + This will enable OpenTelemetry as output. + + + output.opentelemetry_server + + text + Set the IP and port where metrics shoud be sent to, e.g. 192.168.0.1:4317. + + + output.opentelemetry_compression + + dropdown + Set the compression mode. + + + output.opentelemetry_timeout + + text + Write timeout, formatted as a string. If not provided, will default to 5s. 0s means no timeout (not recommended). + + + output.opentelemetry_insecure_skip_verify + + checkbox + This will skip chain and host verification. + diff --git a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml index 634145ed9a..63ac311e58 100644 --- a/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml +++ b/net-mgmt/telegraf/src/opnsense/mvc/app/models/OPNsense/Telegraf/Output.xml @@ -224,5 +224,28 @@ Wavefront + + 0 + N + + + N + + + 0 + N + + + 5 + N + + + gzip + Y + + gzip + none + + diff --git a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf index a0ac2ca8be..fd5012ae54 100644 --- a/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf +++ b/net-mgmt/telegraf/src/opnsense/service/templates/OPNsense/Telegraf/telegraf.conf @@ -137,6 +137,24 @@ {% endif %} {% endif %} +{% if helpers.exists('OPNsense.telegraf.output.opentelemetry_enable') and OPNsense.telegraf.output.opentelemetry_enable == '1' %} +[[outputs.opentelemetry]] +{% if helpers.exists('OPNsense.telegraf.output.opentelemetry_server') and OPNsense.telegraf.output.opentelemetry_server != '' %} + service_address = {{ OPNsense.telegraf.output.opentelemetry_server }} +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.opentelemetry_timeout') and OPNsense.telegraf.output.opentelemetry_timeout != '' %} + timeout = "{{ OPNsense.telegraf.output.opentelemetry_timeout }}s" +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.opentelemetry_insecure_skip_verify') and OPNsense.telegraf.output.opentelemetry_insecure_skip_verify == '1' %} + insecure_skip_verify = true +{% else %} + insecure_skip_verify = false +{% endif %} +{% if helpers.exists('OPNsense.telegraf.output.opentelemetry_compression') and OPNsense.telegraf.output.opentelemetry_compression != '' %} + compression = "{{ OPNsense.telegraf.output.opentelemetry_compression }}" +{% endif %} +{% endif %} + {% if helpers.exists('OPNsense.telegraf.output.graphite_enable') and OPNsense.telegraf.output.graphite_enable == '1' %} [[outputs.graphite]] {% if helpers.exists('OPNsense.telegraf.output.graphite_server') and OPNsense.telegraf.output.graphite_server != '' %} From 3a559f91f2d0a094531eda8e3ec6e1814ba1a7ac Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:50:40 +0200 Subject: [PATCH 1860/3088] Update caddy_control.py (#3944) Forces the reload even if the config in the Caddyfile is unchanged, using an extra command of the rc.d script, forcing certificates in the filesystem to reload. Fixes: {"info","ts":"2024-04-26T06:13:06Z","msg":"config is unchanged"} Otherwise, if the config is unchanged, and the certificates are replaced, the names of the certificates in the Caddyfile stay the same, thus implying the config has been unchanged. --- www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py index 6598926dc1..c698d82441 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py @@ -67,7 +67,7 @@ def run_service_command(action, action_message): "start": "start", "stop": "stop", "restart": "restart", - "reload": "reload", + "reload": "reloadssl", # Forces the reload even if the config in the Caddyfile is unchanged, using an extra command of the rc.d script, forcing certificates in the filesystem to reload. "validate": "validate" # Validate action } From de94c644f3677d2775d55e990f11c10c0a9a97ab Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:56:16 +0200 Subject: [PATCH 1861/3088] www/caddy: v1.5.5 changelog (#3938) --- www/caddy/Makefile | 3 +-- www/caddy/pkg-descr | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/www/caddy/Makefile b/www/caddy/Makefile index 2623a74790..45d38b923d 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= caddy -PLUGIN_VERSION= 1.5.4 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.5.5 PLUGIN_DEPENDS= caddy-custom PLUGIN_COMMENT= Easy to configure Reverse Proxy with Automatic HTTPS and Dynamic DNS PLUGIN_MAINTAINER= cedrik@pischem.com diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index e59ec80758..6c742f4f5b 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -26,6 +26,13 @@ DOC: https://docs.opnsense.org/manual/how-tos/caddy.html Plugin Changelog ================ +1.5.5 + +* Fix: "Apply" could hang when websockets are in use by clients. A grace period of 10s has been added in General Settings that forces to close all connections on config changes. +* Add: In Reverse Proxy, a new dropdown can select one or multiple domains, filtering the Bootgrids of Domains, Subdomains and Handlers for the selected Domain. +* Add: Global Log Level can be set in Log Settings. +* Fix: "Apply" will always read all certificates from the filesystem, even if the Caddy configuration has remained unchanged. "reload" has been changed to "reloadssl". + 1.5.4 * Fix: When pressing Apply, the Caddy service will be reloaded instead of restarted. This fixes long restart times and service interruptions. From 8ec93bd7c972a062a28ffcfe2026233bee210d90 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Fri, 26 Apr 2024 09:09:53 +0200 Subject: [PATCH 1862/3088] www/caddy: Select global log level (#3941) --- .../controllers/OPNsense/Caddy/forms/logsettings.xml | 6 ++++++ .../opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml | 10 ++++++++++ .../service/templates/OPNsense/Caddy/Caddyfile | 3 +++ 3 files changed, 19 insertions(+) diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/logsettings.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/logsettings.xml index 022ce6ca01..44f616f042 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/logsettings.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/logsettings.xml @@ -1,4 +1,10 @@
    + + caddy.general.LogLevel + + dropdown + + caddy.general.LogCredentials diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index 1aa9308fc5..b311f9556d 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -73,6 +73,16 @@ Please enter a valid number of 1 or larger. Y + + INFO + + DEBUG + WARN + ERROR + PANIC + FATAL + + Please enter a valid URL, starting with http or https. diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index 2e7e7f37e1..81b2a19cf3 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -48,6 +48,9 @@ format json { time_format rfc3339 } + {% if generalSettings.LogLevel %} + level {{ generalSettings.LogLevel }} + {% endif %} } {# From 2ec0eef44012151aa88b02c859803694eca09387 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Fri, 26 Apr 2024 09:41:17 +0200 Subject: [PATCH 1863/3088] www/caddy: Selectpicker that can filter the Domain, Subdomain and Handlers by selected Domain (#3937) * Update reverse_proxy.volt Add a first version of a filter functionality by domain. In this version, only handlers are filtered by domain. A selectpicker with multi selection can choose domains, and the filter function compares these UUIDs to the UUIDs of the "reverse" UUIDs of the model relation fields. Either all domains are shown, or only elements where the UUIDs match. * Update ReverseProxyController.php A new api endpoint for the domain search selectpicker has been created. It returns the ID and a Domain+Port combination. The search function for the Handler now returns all fields if no filter has been set, or only the referenced UUIDs when a filter has been set. * Update ReverseProxyController.php - Add search function to subdomains * Update reverse_proxy.volt - Reference Search Filter in Handlers, Domains and Subdomains * Update ReverseProxyController.php - Add the search function to domains * Update ReverseProxyController.php A little bit of cleanup. $add_empty was unused so it's removed. * Update reverse_proxy.volt - Changed margin to align selectpicker with other options. * Small margin fix to align Selectpicker with other options * Update reverse_proxy.volt - Restrict style to the ID of only the affected selectpicker --- .../Caddy/Api/ReverseProxyController.php | 85 +++++++++++++++--- .../views/OPNsense/Caddy/reverse_proxy.volt | 89 +++++++++++++++++++ 2 files changed, 163 insertions(+), 11 deletions(-) diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php index 4dcd01ce6d..eb94b82e0c 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php @@ -41,9 +41,22 @@ class ReverseProxyController extends ApiMutableModelControllerBase /*ReverseProxy Section*/ - public function searchReverseProxyAction($add_empty = '0') + /*Search Function adjusted for the search filter dropdown*/ + public function searchReverseProxyAction() { - return $this->searchBase("reverseproxy.reverse", null, 'description'); + // Get a comma-separated list of UUIDs from the request + $reverseUuids = $this->request->get('reverseUuids'); + $uuidArray = !empty($reverseUuids) ? explode(',', $reverseUuids) : []; + + // Define the filter function to handle multiple UUIDs + $filterFunction = function ($modelItem) use ($uuidArray) { + $itemUuid = (string)$modelItem->getAttributes()['uuid']; + // Include the item if no UUIDs are provided (empty array) or if it's in the array of UUIDs + return empty($uuidArray) || in_array($itemUuid, $uuidArray, true); + }; + + // Return the search results filtered by the provided UUIDs, if any + return $this->searchBase("reverseproxy.reverse", null, 'description', $filterFunction); } public function setReverseProxyAction($uuid) @@ -70,13 +83,48 @@ public function toggleReverseProxyAction($uuid, $enabled = null) { return $this->toggleBase("reverseproxy.reverse", $uuid, $enabled); } + + /*Function for the search filter dropdown in the bootgrid*/ + public function getAllReverseDomainsAction() + { + $this->sessionClose(); // Close session early for performance + $result = array("rows" => array()); + + $mdlCaddy = new \OPNsense\Caddy\Caddy(); + $reverseNodes = $mdlCaddy->reverseproxy->reverse->iterateItems(); + + foreach ($reverseNodes as $item) { + if (!empty($item->FromDomain)) { + // Conditionally concatenate port if it exists + $domain = (string)$item->FromDomain; + $port = (string)$item->FromPort; + $combinedDomainPort = $domain . (!empty($port) ? ':' . $port : ''); + + $result['rows'][] = array( + 'id' => (string)$item->getAttributes()['uuid'], + 'domainPort' => $combinedDomainPort // Combined domain and port, conditionally adding port + ); + } + } + + return $result; + } /*Subdomain Section*/ - public function searchSubdomainAction($add_empty = '0') + /*Search Function adjusted for the search filter dropdown*/ + public function searchSubdomainAction() { - return $this->searchBase("reverseproxy.subdomain", null, 'description'); + $reverseUuids = $this->request->get('reverseUuids'); + $uuidArray = !empty($reverseUuids) ? explode(',', $reverseUuids) : []; + + $filterFunction = function ($modelItem) use ($uuidArray) { + // Filtering on domain UUIDs referenced by subdomains + return empty($uuidArray) || in_array((string)$modelItem->reverse, $uuidArray, true); + }; + + return $this->searchBase("reverseproxy.subdomain", null, 'description', $filterFunction); } public function setSubdomainAction($uuid) @@ -106,10 +154,25 @@ public function toggleSubdomainAction($uuid, $enabled = null) /*Handler Section*/ - - public function searchHandleAction($add_empty = '0') - { - return $this->searchBase("reverseproxy.handle", null, 'description'); + + /*Search Function adjusted for the search filter dropdown*/ + public function searchHandleAction() + { + $reverseUuids = $this->request->get('reverseUuids'); + $uuidArray = explode(',', $reverseUuids); + + if (empty($reverseUuids)) { + // If no UUIDs are provided, do not apply any filter, return all records + return $this->searchBase("reverseproxy.handle", null, 'description'); + } else { + // Apply the filter only if UUIDs are provided + $filterFunction = function ($modelItem) use ($uuidArray) { + $modelUUID = (string)$modelItem->reverse; + return in_array($modelUUID, $uuidArray, true); + }; + + return $this->searchBase("reverseproxy.handle", null, 'description', $filterFunction); + } } public function setHandleAction($uuid) @@ -140,7 +203,7 @@ public function toggleHandleAction($uuid, $enabled = null) /* AccessList Section */ - public function searchAccessListAction($add_empty = '0') + public function searchAccessListAction() { return $this->searchBase("reverseproxy.accesslist", null, 'description'); } @@ -168,7 +231,7 @@ public function delAccessListAction($uuid) /* BasicAuth Section */ - public function searchBasicAuthAction($add_empty = '0') + public function searchBasicAuthAction() { return $this->searchBase("reverseproxy.basicauth", null, 'description'); } @@ -216,7 +279,7 @@ public function delBasicAuthAction($uuid) /* Header Section */ - public function searchHeaderAction($add_empty = '0') + public function searchHeaderAction() { return $this->searchBase("reverseproxy.header", null, 'description'); } diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt index 5d9ebc4069..ed93146a1c 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/reverse_proxy.volt @@ -26,6 +26,17 @@ + + @@ -671,6 +739,29 @@
    +
    + + + + + + + + + + + + + + + + + +
    {{ lang._('ID') }}{{ lang._('Description') }}{{ lang._('Address') }}{{ lang._('Commands') }}
    + + +
    +
    @@ -695,9 +786,31 @@
    +
    +
    + + +
    + + + + + + +
    + +
    + + +
    +
    +
    +
    - {{ partial("layout_partials/base_dialog",['fields': upstream,'id':'upstreamdlg', 'label':lang._('Edit Upstream')]) }} {{ partial("layout_partials/base_dialog",['fields': upstream_server,'id':'upstreamserverdlg', 'label':lang._('Edit Upstream')]) }} {{ partial("layout_partials/base_dialog",['fields': location,'id':'locationdlg', 'label':lang._('Edit Location')]) }} @@ -716,4 +829,5 @@ {{ partial("layout_partials/base_dialog",['fields': ipacl,'id':'ipacl_dlg', 'label':lang._('Edit IP ACL')]) }} {{ partial("layout_partials/base_dialog",['fields': errorpage,'id':'errorpage_dlg', 'label':lang._('Edit Error Page')]) }} {{ partial("layout_partials/base_dialog",['fields': tls_fingerprint,'id':'tls_fingerprint_dlg', 'label':lang._('Edit TLS Fingerprint')]) }} +{{ partial("layout_partials/base_dialog",['fields': resolver,'id':'resolverdlg', 'label':lang._('Edit Resolver')]) }} {{ partial("layout_partials/base_dialog",['fields': syslog_target,'id':'syslog_target_dlg', 'label':lang._('Edit SYSLOG Target')]) }} diff --git a/www/nginx/src/opnsense/scripts/nginx/list_logs.php b/www/nginx/src/opnsense/scripts/nginx/list_logs.php index 93d78207c8..93c951c348 100755 --- a/www/nginx/src/opnsense/scripts/nginx/list_logs.php +++ b/www/nginx/src/opnsense/scripts/nginx/list_logs.php @@ -68,9 +68,11 @@ function list_logfiles($prefix) $nginx = new Nginx(); $result = []; -// special case: the global error log +// special cases: the global error log and the perm_ban access log if ($server == 'global') { $result = list_logfiles('error.log'); +} elseif ($server == 'perm_ban') { + $result = list_logfiles('perm_ban.access.log'); } else { switch ($mode) { case 'error': diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py b/www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py new file mode 100644 index 0000000000..e96374a7ec --- /dev/null +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 + +# nginx -T shows the config only if the test succeeds +# grab nginx config from file(s) and send to stdout + +import os.path +import glob +import ujson + +result = dict() +nginx_config = [] +nginx_config_root = '/usr/local/etc/nginx/' +nginx_config_file = nginx_config_root + 'nginx.conf' + +def load_config_file(config_path): + """ load config with all inclusions + """ + config_incs = [] + # mimic 'nginx -T' syntax for config files references + nginx_config.append('# configuration file ' + config_path + ':') + for line in open(config_path, 'r').read().split('\n'): + nginx_config.append(line.rstrip()) + line = line.strip() + if line.startswith('include '): + # only '*' mask is supported/used in plugin + if '*' not in line: + # it's a file relative path + incfilepath = nginx_config_root + line.split(' ')[-1][:-1] + if os.path.isfile(incfilepath): + config_incs.append(incfilepath) + else: + # it's a path with a file mask + incdir = nginx_config_root + line.split(' ')[-1][:-1] + for incfilepath in glob.glob(incdir): + config_incs.append(incfilepath) + for inc in list(dict.fromkeys(config_incs)): + load_config_file(inc) + +if os.path.isfile(nginx_config_file): + result['time'] = os.path.getmtime(nginx_config_file) + load_config_file(nginx_config_file) + result['config'] = nginx_config +print(ujson.dumps(result)) + diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_testConfig.sh b/www/nginx/src/opnsense/scripts/nginx/ngx_testConfig.sh new file mode 100644 index 0000000000..8b085a1f09 --- /dev/null +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_testConfig.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# run nginx config test. return error text if any. always exit with 0 +if conf_test_errors=$(nginx -t -q 2>&1); then + echo "config is ok" +else + echo "$conf_test_errors" +fi + +exit 0 diff --git a/www/nginx/src/opnsense/scripts/nginx/read_log.php b/www/nginx/src/opnsense/scripts/nginx/read_log.php index 65f288d60c..ac11b9f1ec 100755 --- a/www/nginx/src/opnsense/scripts/nginx/read_log.php +++ b/www/nginx/src/opnsense/scripts/nginx/read_log.php @@ -68,6 +68,8 @@ // special case: the global error log if ($server == 'global') { $logparser = new ErrorLogParser($log_prefix . 'error' . $log_suffix, $page, $per_page, $query); +} elseif ($server == 'perm_ban') { + $logparser = new AccessLogParser($log_prefix . 'perm_ban.access' . $log_suffix, $page, $per_page, $query); } else { switch ($mode) { case 'error': diff --git a/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf b/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf index 2107624ea9..ce44adf64d 100644 --- a/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf +++ b/www/nginx/src/opnsense/service/conf/actions.d/actions_nginx.conf @@ -67,3 +67,13 @@ type:script command:/usr/local/opnsense/scripts/nginx/vts.php parameters: type:script_output + +[test_config] +command:/usr/local/opnsense/scripts/nginx/ngx_testConfig.sh +parameters: +type:script_output + +[show_config] +command:/usr/local/opnsense/scripts/nginx/ngx_showConfig.py +parameters: +type:script_output diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf index a5470e6da0..86b1586ab1 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/http.conf @@ -14,6 +14,11 @@ log_format main_ext '$remote_addr - $remote_user [$time_local] "$request" ' 'ua="$upstream_addr" us="$upstream_status" ' 'ut="$upstream_response_time" ul="$upstream_response_length" ' 'cs=$upstream_cache_status'; +{% if OPNsense.Nginx.http.log_perm_ban is defined and OPNsense.Nginx.http.log_perm_ban == '1' %} +log_format main_ban '$remote_addr - $remote_user [$time_local] "$scheme://$host$request_uri" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; +{% endif %} log_format handshake '"$http_user_agent" "$ssl_ciphers" "$ssl_curves"'; log_format anonymized ':: - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' @@ -146,7 +151,19 @@ server { {% endif %} {% endif %} {% endif %} +{% if server.resolver is defined and server.resolver != '' %} +{% set resolver = helpers.getUUID(server.resolver) %} +{% if resolver is defined %} + resolver {{ resolver.address.replace(',', ' ') }}{% if resolver.valid is defined and resolver.valid != '' %} valid={{ resolver.valid}}s{% endif %}{% if resolver.ipv4_off is defined and resolver.ipv4_off == '1' %} ipv4=off{% endif %}{% if resolver.ipv6_off is defined and resolver.ipv6_off == '1' %} ipv6=off{% endif %}; +{% if resolver.timeout is defined and resolver.timeout !='' %} + resolver_timeout {{ resolver.timeout }}s; +{% endif %} +{% endif %} +{% endif %} +{% if server.disable_gzip is defined and server.disable_gzip == '1' %} + gzip off; +{% endif %} sendfile {% if server.sendfile is defined and server.sendfile == '1' %}On{% else %}Off{% endif %}; server_name {{ server.servername.replace(',', ' ') }}; {% if server.real_ip_source is defined and server.real_ip_source != '' %} @@ -241,6 +258,9 @@ server { set $naxsi_extensive_log {% if server.naxsi_extensive_log is defined and server.naxsi_extensive_log == '1' %}1{% else %}0{% endif %}; location @permanentban { access_log /var/log/nginx/permanentban.access.log main; +{% if OPNsense.Nginx.http.log_perm_ban is defined and OPNsense.Nginx.http.log_perm_ban == '1' %} + access_log /var/log/nginx/perm_ban.access.log main_ban; +{% endif %} internal; add_header "Content-Type" "text/plain; charset=UTF-8" always; return {% if OPNsense.Nginx.http.ban_response is defined and OPNsense.Nginx.http.ban_response != '403' %}{{OPNsense.Nginx.http.ban_response}}{% else %}403 "You got banned permanently from this server."{% endif %}; @@ -261,19 +281,12 @@ server { } {% endif %} {% if server.disable_bot_protection is not defined or server.disable_bot_protection != '1' %} - # block based on User Agents - stuff I have found over the years in my server log - if ($http_user_agent ~* Python-urllib|Nmap|python-requests|libwww-perl|MJ12bot|Jorgee|fasthttp|libwww|Telesphoreo|A6-Indexer|ltx71|okhttp|ZmEu|sqlmap|LMAO/2.0|l9explore|l9tcpid|Masscan|zgrab|Ronin/2.0|Hakai/2.0) { - return 418; - } - {# MSIE 7 cannot be blocked - used for compatibility mode - https://blogs.msdn.microsoft.com/ieinternals/2013/09/21/internet-explorer-11s-many-user-agent-strings/ #} - if ($http_user_agent ~ "Indy\sLibrary|Morfeus Fucking Scanner|MSIE [0-6]\.\d+") - { - return 418; - } - if ($http_user_agent ~ ^Mozilla/[\d\.]+$) - { - return 418; +{% if OPNsense.Nginx.http.bots_ua is defined and OPNsense.Nginx.http.bots_ua|default("") != "" %} + # block based on User Agents defined in global http settings + if ($http_user_agent ~* {{ OPNsense.Nginx.http.bots_ua|replace(',','|') }}) { + return 418; } +{% endif %} {% endif %} {% if server.ip_acl is defined %} {% set ip_acl = server.ip_acl %} diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf index 35145c75b2..1d0adc6dc3 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf @@ -126,6 +126,10 @@ location {{ location.matchtype }} {{ location.urlpattern }} { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; {% endif %} +{% if location.upstream_keepalive is defined and location.upstream_keepalive == '1' %} + proxy_http_version 1.1; + proxy_set_header Connection ""; +{% endif %} {% if location.proxy_buffer_size is defined and location.proxy_buffer_size != '' %} proxy_buffer_size {{ location.proxy_buffer_size }}k; {% endif %} diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf index 8915f32653..9b696220fa 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/streams.conf @@ -104,6 +104,12 @@ {% if server.proxy_responses is defined and server.proxy_responses != '' %} proxy_responses {{ server.proxy_responses }}; {% endif%} +{% if server.proxy_connect_timeout is defined and server.proxy_connect_timeout != '' %} + proxy_connect_timeout {{ server.proxy_connect_timeout }}s; +{% endif%} +{% if server.proxy_timeout is defined and server.proxy_timeout != '' %} + proxy_timeout {{ server.proxy_timeout }}s; +{% endif%} {% if server.trusted_proxies is defined and server.trusted_proxies != '' and server.proxy_protocol is defined and server.proxy_protocol == '1' %} {% for trusted_proxy in server.trusted_proxies.split(',') %} set_real_ip_from {{ trusted_proxy }}; diff --git a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/upstream.conf b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/upstream.conf index b5226fa908..3f07f37175 100644 --- a/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/upstream.conf +++ b/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/upstream.conf @@ -12,6 +12,15 @@ upstream upstream{{ upstream_uuid.replace('-','') }} { ip_hash; {% endif %} {% endif %} +{% if upstream.keepalive is defined and upstream.keepalive|int > 0 %} +keepalive {{ upstream.keepalive }}; +{% if upstream.keepalive_requests is defined and upstream.keepalive_requests != '' %} +keepalive_requests {{ upstream.keepalive_requests }}; +{% endif %} +{% if upstream.keepalive_timeout is defined and upstream.keepalive_timeout != '' %} +keepalive_timeout {{ upstream.keepalive_timeout }}s; +{% endif %} +{% endif %} {% for upstream_serveruuid in upstream.serverentries.split(',') %} {% set upstream_server = helpers.getUUID(upstream_serveruuid) %} server {% if ':' in upstream_server.server %}[{% endif %}{{ upstream_server.server }}{% if ':' in upstream_server.server %}]{% endif diff --git a/www/nginx/src/opnsense/www/css/nginx/index.css b/www/nginx/src/opnsense/www/css/nginx/index.css new file mode 100644 index 0000000000..a680bfef07 --- /dev/null +++ b/www/nginx/src/opnsense/www/css/nginx/index.css @@ -0,0 +1,88 @@ +/* +* Copyright (C) 2023 A. Kulikov +* Copyright (C) 2017-2018 Fabian Franz +* All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, +* this list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +*/ + +#frm_sni_hostname_mapdlg .col-md-4, +#frm_ipacl_dlg .col-md-4 { + width: 50%; +} +#frm_sni_hostname_mapdlg td > input[type="text"], +#frm_ipacl_dlg td > input[type="text"] { + width: 100%; + max-width: 100%; +} +#frm_sni_hostname_mapdlg .col-md-5, +#frm_ipacl_dlg .col-md-5 { + width: 25%; +} +#row_snihostname\.data .row, +#row_ipacl\.data .row { + padding-top: 5px; +} +#row_snihostname\.data .row div, +#row_ipacl\.data .row div { + padding: 0; +} +#sni_hostname_mapdlg .bootstrap-select, +#frm_ipacl_dlg .bootstrap-select { + width: 100% !important; +} +#nginx_conf_container { + overflow-x: auto; +} +.ngx_conf_table { + white-space: pre-wrap; + color: #333333; + background-color: #f5f5f5; + word-break: break-all; + word-wrap: break-word; +} +.ngx_conf_table_body { + display: grid; + height: 400px; + overflow-y: auto; + font-family: ui-monospace,monospace; + font-size: 13px; +} +.l-number { + position: relative; + width: 1%; + min-width: 50px; + padding-right: 20px; + padding-left: 1px; + text-align: right; + white-space: nowrap; + vertical-align: top; + user-select: none; + filter: brightness(2.0); + filter: contrast(0.3); +} +.placeholdertd { + padding: 10px; +} +#nginx_config_copy { + cursor: pointer; +} diff --git a/www/nginx/src/opnsense/www/css/nginx/vts.css b/www/nginx/src/opnsense/www/css/nginx/vts.css index a63c5e1b20..60f08183af 100644 --- a/www/nginx/src/opnsense/www/css/nginx/vts.css +++ b/www/nginx/src/opnsense/www/css/nginx/vts.css @@ -44,6 +44,7 @@ #monitor thead th { font-size: 1em; padding: .1em .3em; + border: 1px solid; } #monitor tbody th { text-align: left; diff --git a/www/nginx/src/opnsense/www/js/nginx/dist/configuration.min.js b/www/nginx/src/opnsense/www/js/nginx/dist/configuration.min.js index e7c57eb22b..3ef498d006 100644 --- a/www/nginx/src/opnsense/www/js/nginx/dist/configuration.min.js +++ b/www/nginx/src/opnsense/www/js/nginx/dist/configuration.min.js @@ -1 +1 @@ -!function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=27)}({27:function(t,e,n){"use strict";n.r(e);var i=Backbone.View.extend({tagName:"div",attributes:{class:"container-fluid"},child_views:[],createModel:null,upstreamCollection:null,initialize:function(t){this.dataField=$(t.dataField),this.entryclass=t.entryclass,this.createModel=t.createModel,this.upstreamCollection=t.upstreamCollection,this.listenTo(this.collection,"add remove reset",this.render),this.listenTo(this.collection,"change",this.update),this.dataField.after(this.$el)},events:{"click .add":"addEntry"},render:function(){this.child_views.forEach(t=>t.remove()),this.$el.html(""),this.child_views=[],this.update(),this.collection.each(t=>{const e=new this.entryclass({model:t,collection:this.collection,upstreamCollection:this.upstreamCollection});this.child_views.push(e),this.$el.append(e.$el),e.render()}),this.$el.append($('\n
    \n \n
    '))},update:function(){this.dataField.data("data",this.collection.toJSON())},addEntry:function(t){t.preventDefault(),this.collection.add(this.createModel())}});var s=Backbone.Collection.extend({url:"/api/nginx/settings/searchupstream",parse:function(t){return t.rows}});const a=Backbone.View.extend({tagName:"div",attributes:{class:"row"},events:{"keyup .key":function(){this.model.set("hostname",this.key.value)},"change .value":function(){this.model.set("upstream",this.value.value)},"click .delete":"deleteEntry"},key:null,value:null,delBtn:null,first:null,second:null,third:null,upstreamCollection:null,initialize:function(t){this.upstreamCollection=t.upstreamCollection,this.listenTo(this.upstreamCollection,"update reset add remove",this.regenerate_list),this.first=document.createElement("div"),this.first.classList.add("col-sm-5"),this.key=document.createElement("input"),this.first.append(this.key),this.key.type="text",this.key.classList.add("key"),this.key.value=this.model.get("hostname"),this.second=document.createElement("div"),this.second.classList.add("col-sm-5"),this.value=document.createElement("select"),this.second.append(this.value),this.value.classList.add("value"),this.value.classList.add("form-control"),this.value.value=this.model.get("upstream"),this.third=document.createElement("div"),this.third.classList.add("col-sm-2"),this.third.style.textAlign="right",this.delBtn=document.createElement("button"),this.delBtn.classList.add("delete"),this.delBtn.classList.add("btn"),this.delBtn.innerHTML='',this.third.append(this.delBtn),this.model.has("upstream")&&0!==this.upstreamCollection.where({uuid:this.model.get("upstream")}).length||this.upstreamCollection.length>0&&this.model.set("upstream",this.upstreamCollection.at(0).get("uuid")),this.$el.append(this.first).append(this.second).append(this.third)},render:function(){$(this.key).val(this.model.get("hostname")),this.regenerate_list(),$(this.value).val(this.model.get("upstream"))},deleteEntry:function(t){t.preventDefault(),this.collection.remove(this.model)},regenerate_list:function(){const t=$(this.value);t.html(""),this.upstreamCollection.each(e=>t.append(``)),t.val(this.model.get("upstream")),t.selectpicker("refresh")}}),l=Backbone.View.extend({tagName:"div",attributes:{class:"row"},events:{"keyup .key":function(){this.model.set("network",this.key.value)},"change .value":function(){this.model.set("action",this.value.value)},"click .delete":"deleteEntry"},key:null,value:null,delBtn:null,first:null,second:null,third:null,upstreamCollection:null,initialize:function(t){this.upstreamCollection=t.upstreamCollection,this.listenTo(this.upstreamCollection,"update reset add remove",this.regenerate_list),this.first=document.createElement("div"),this.first.classList.add("col-sm-5"),this.key=document.createElement("input"),this.first.append(this.key),this.key.type="text",this.key.classList.add("key"),this.key.value=this.model.get("network"),this.second=document.createElement("div"),this.second.classList.add("col-sm-5"),this.value=document.createElement("select"),this.second.append(this.value),this.value.classList.add("value"),this.value.classList.add("form-control"),this.value.value=this.model.get("action"),this.third=document.createElement("div"),this.third.classList.add("col-sm-2"),this.third.style.textAlign="right",this.delBtn=document.createElement("button"),this.delBtn.classList.add("delete"),this.delBtn.classList.add("btn"),this.delBtn.innerHTML='',this.third.append(this.delBtn),this.$el.append(this.first).append(this.second).append(this.third)},render:function(){$(this.key).val(this.model.get("network")),this.regenerate_list(),$(this.value).val(this.model.get("action"))},deleteEntry:function(t){t.preventDefault(),this.collection.remove(this.model)},regenerate_list:function(){const t=$(this.value);t.html(""),this.upstreamCollection.each(e=>t.append(``)),t.val(this.model.get("action")),t.selectpicker("refresh")}});var o=Backbone.Collection.extend({initialize:function(){let t=this;$("#snihostname\\.data").change(function(){t.regenerateFromView()})},regenerateFromView:function(){let t=$("#snihostname\\.data").data("data");_.isArray(t)||(t=[]),this.reset(t)}}),r=Backbone.Model.extend({}),d=Backbone.Model.extend({}),c=Backbone.Collection.extend({initialize:function(){let t=this;$("#ipacl\\.data").change(function(){t.regenerateFromView()})},regenerateFromView:function(){let t=$("#ipacl\\.data").data("data");_.isArray(t)||(t=[]),this.reset(t)}});const u=new s,h=new Backbone.Collection([{name:"Deny",value:"deny"},{name:"Allow",value:"allow"}]);$(document).ready(function(){mapDataToFormUI({frm_nginx:"/api/nginx/settings/get"}).done(function(){formatTokenizersUI(),$('select[data-allownew="false"]').selectpicker("refresh"),updateServiceControlUI("nginx")}),""!==window.location.hash&&$('a[href="'+window.location.hash+'"]').click(),$(".nav-tabs a").on("shown.bs.tab",function(t){history.pushState(null,null,t.target.hash)}),$(".reload_btn").click(function(){$(".reloadAct_progress").addClass("fa-spin"),ajaxCall("/api/nginx/service/reconfigure",{},function(){$(".reloadAct_progress").removeClass("fa-spin")})}),$('[id*="save_"]').each(function(){$(this).click(function(){let t=$(this).closest("form").attr("id"),e=$(this).closest("form").attr("data-title");saveFormToEndpoint("/api/nginx/settings/set",t,function(){$("#"+t+"_progress").addClass("fa fa-spinner fa-pulse"),ajaxCall("/api/nginx/service/reconfigure",{},function(n,i){$("#"+t+"_progress").removeClass("fa fa-spinner fa-pulse"),void 0===n||"success"===i&&"ok"===n.status?updateServiceControlUI("nginx"):BootstrapDialog.show({type:BootstrapDialog.TYPE_WARNING,title:e,message:JSON.stringify(n),draggable:!0})})})})}),["upstream","upstreamserver","location","credential","userlist","httpserver","streamserver","httprewrite","custompolicy","security_header","ipacl","limit_zone","cache_path","limit_request_connection","snifwd","errorpage","tls_fingerprint","syslog_target","naxsirule"].forEach(function(t){$("#grid-"+t).UIBootgrid({search:"/api/nginx/settings/search"+t,get:"/api/nginx/settings/get"+t+"/",set:"/api/nginx/settings/set"+t+"/",add:"/api/nginx/settings/add"+t+"/",del:"/api/nginx/settings/del"+t+"/",commands:{copy_uuid:{method:function(t){navigator.clipboard.writeText($(this).data("row-id"))}}},options:{selection:!1,multiSelect:!1,formatters:{commands:function(t,e){return' '},response:function(t,e){return"none"==e.response?"unchanged":e.response},statuscodes:function(t,e){const n=[],i=e.statuscodes.split(",");for(let t of i)n.push(t.substr(0,3));return n.join(", ")}}}})}),bind_naxsi_rule_dl_button(),function(){let t=new i({dataField:document.getElementById("snihostname.data"),upstreamCollection:u,entryclass:a,collection:new o,createModel:function(){return new r({hostname:"localhost"})}});window.snifield=t,t.render(),$("#grid-upstream").on("loaded.rs.jquery.bootgrid",function(){u.fetch()}),u.fetch()}();let t=new i({dataField:document.getElementById("ipacl.data"),upstreamCollection:h,entryclass:l,collection:new c,createModel:function(){return new d({network:"::",action:"deny"})}});window.ipaclfield=t,t.render()})}}); \ No newline at end of file +!function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=25)}({25:function(t,e,n){"use strict";n.r(e);var i=Backbone.View.extend({tagName:"div",attributes:{class:"container-fluid"},child_views:[],createModel:null,upstreamCollection:null,initialize:function(t){this.dataField=$(t.dataField),this.entryclass=t.entryclass,this.createModel=t.createModel,this.upstreamCollection=t.upstreamCollection,this.listenTo(this.collection,"add remove reset",this.render),this.listenTo(this.collection,"change",this.update),this.dataField.after(this.$el)},events:{"click .add":"addEntry"},render:function(){this.child_views.forEach(t=>t.remove()),this.$el.html(""),this.child_views=[],this.update(),this.collection.each(t=>{const e=new this.entryclass({model:t,collection:this.collection,upstreamCollection:this.upstreamCollection});this.child_views.push(e),this.$el.append(e.$el),e.render()}),this.$el.append($('\n
    \n \n
    '))},update:function(){this.dataField.data("data",this.collection.toJSON())},addEntry:function(t){t.preventDefault(),this.collection.add(this.createModel())}});var s=Backbone.Collection.extend({url:"/api/nginx/settings/searchupstream",parse:function(t){return t.rows}});const a=Backbone.View.extend({tagName:"div",attributes:{class:"row"},events:{"keyup .key":function(){this.model.set("hostname",this.key.value)},"change .value":function(){this.model.set("upstream",this.value.value)},"click .delete":"deleteEntry"},key:null,value:null,delBtn:null,first:null,second:null,third:null,upstreamCollection:null,initialize:function(t){this.upstreamCollection=t.upstreamCollection,this.listenTo(this.upstreamCollection,"update reset add remove",this.regenerate_list),this.first=document.createElement("div"),this.first.classList.add("col-sm-5"),this.key=document.createElement("input"),this.first.append(this.key),this.key.type="text",this.key.classList.add("key"),this.key.value=this.model.get("hostname"),this.second=document.createElement("div"),this.second.classList.add("col-sm-5"),this.value=document.createElement("select"),this.second.append(this.value),this.value.classList.add("value"),this.value.classList.add("form-control"),this.value.value=this.model.get("upstream"),this.third=document.createElement("div"),this.third.classList.add("col-sm-2"),this.third.style.textAlign="right",this.delBtn=document.createElement("button"),this.delBtn.classList.add("delete"),this.delBtn.classList.add("btn"),this.delBtn.innerHTML='',this.third.append(this.delBtn),this.model.has("upstream")&&0!==this.upstreamCollection.where({uuid:this.model.get("upstream")}).length||this.upstreamCollection.length>0&&this.model.set("upstream",this.upstreamCollection.at(0).get("uuid")),this.$el.append(this.first).append(this.second).append(this.third)},render:function(){$(this.key).val(this.model.get("hostname")),this.regenerate_list(),$(this.value).val(this.model.get("upstream"))},deleteEntry:function(t){t.preventDefault(),this.collection.remove(this.model)},regenerate_list:function(){const t=$(this.value);t.html(""),this.upstreamCollection.each(e=>t.append(``)),t.val(this.model.get("upstream")),t.selectpicker("refresh")}}),l=Backbone.View.extend({tagName:"div",attributes:{class:"row"},events:{"keyup .key":function(){this.model.set("network",this.key.value)},"change .value":function(){this.model.set("action",this.value.value)},"click .delete":"deleteEntry"},key:null,value:null,delBtn:null,first:null,second:null,third:null,upstreamCollection:null,initialize:function(t){this.upstreamCollection=t.upstreamCollection,this.listenTo(this.upstreamCollection,"update reset add remove",this.regenerate_list),this.first=document.createElement("div"),this.first.classList.add("col-sm-5"),this.key=document.createElement("input"),this.first.append(this.key),this.key.type="text",this.key.classList.add("key"),this.key.value=this.model.get("network"),this.second=document.createElement("div"),this.second.classList.add("col-sm-5"),this.value=document.createElement("select"),this.second.append(this.value),this.value.classList.add("value"),this.value.classList.add("form-control"),this.value.value=this.model.get("action"),this.third=document.createElement("div"),this.third.classList.add("col-sm-2"),this.third.style.textAlign="right",this.delBtn=document.createElement("button"),this.delBtn.classList.add("delete"),this.delBtn.classList.add("btn"),this.delBtn.innerHTML='',this.third.append(this.delBtn),this.$el.append(this.first).append(this.second).append(this.third)},render:function(){$(this.key).val(this.model.get("network")),this.regenerate_list(),$(this.value).val(this.model.get("action"))},deleteEntry:function(t){t.preventDefault(),this.collection.remove(this.model)},regenerate_list:function(){const t=$(this.value);t.html(""),this.upstreamCollection.each(e=>t.append(``)),t.val(this.model.get("action")),t.selectpicker("refresh")}});var o=Backbone.Collection.extend({initialize:function(){let t=this;$("#snihostname\\.data").change(function(){t.regenerateFromView()})},regenerateFromView:function(){let t=$("#snihostname\\.data").data("data");_.isArray(t)||(t=[]),this.reset(t)}}),r=Backbone.Model.extend({}),d=Backbone.Model.extend({}),c=Backbone.Collection.extend({initialize:function(){let t=this;$("#ipacl\\.data").change(function(){t.regenerateFromView()})},regenerateFromView:function(){let t=$("#ipacl\\.data").data("data");_.isArray(t)||(t=[]),this.reset(t)}});const u=new s,h=new Backbone.Collection([{name:"Deny",value:"deny"},{name:"Allow",value:"allow"}]);$(document).ready(function(){mapDataToFormUI({frm_nginx:"/api/nginx/settings/get"}).done(function(){formatTokenizersUI(),$('select[data-allownew="false"]').selectpicker("refresh"),updateServiceControlUI("nginx")}),""!==window.location.hash&&$('a[href="'+window.location.hash+'"]').click(),$(".nav-tabs a").on("shown.bs.tab",function(t){history.pushState(null,null,t.target.hash)}),$(".reload_btn").click(function(){$(".reloadAct_progress").addClass("fa-spin"),ajaxCall("/api/nginx/service/reconfigure",{},function(){$(".reloadAct_progress").removeClass("fa-spin")})}),$('[id*="save_"]').each(function(){$(this).click(function(){let t=$(this).closest("form").attr("id"),e=$(this).closest("form").attr("data-title");saveFormToEndpoint("/api/nginx/settings/set",t,function(){$("#"+t+"_progress").addClass("fa fa-spinner fa-pulse"),ajaxCall("/api/nginx/service/reconfigure",{},function(n,i){$("#"+t+"_progress").removeClass("fa fa-spinner fa-pulse"),void 0===n||"success"===i&&"ok"===n.status?updateServiceControlUI("nginx"):BootstrapDialog.show({type:BootstrapDialog.TYPE_WARNING,title:e,message:JSON.stringify(n),draggable:!0})})})})}),["upstream","upstreamserver","location","credential","userlist","httpserver","streamserver","httprewrite","custompolicy","security_header","ipacl","limit_zone","cache_path","limit_request_connection","snifwd","errorpage","tls_fingerprint","resolver","syslog_target","naxsirule"].forEach(function(t){$("#grid-"+t).UIBootgrid({search:"/api/nginx/settings/search"+t,get:"/api/nginx/settings/get"+t+"/",set:"/api/nginx/settings/set"+t+"/",add:"/api/nginx/settings/add"+t+"/",del:"/api/nginx/settings/del"+t+"/",commands:{copy_uuid:{method:function(t){navigator.clipboard.writeText($(this).data("row-id"))}}},options:{selection:!1,multiSelect:!1,formatters:{commands:function(t,e){return' '},response:function(t,e){return"none"==e.response?"unchanged":e.response},statuscodes:function(t,e){const n=[],i=e.statuscodes.split(",");for(let t of i)n.push(t.substr(0,3));return n.join(", ")}}}})}),bind_naxsi_rule_dl_button(),function(){let t=new i({dataField:document.getElementById("snihostname.data"),upstreamCollection:u,entryclass:a,collection:new o,createModel:function(){return new r({hostname:"localhost"})}});window.snifield=t,t.render(),$("#grid-upstream").on("loaded.rs.jquery.bootgrid",function(){u.fetch()}),u.fetch()}();let t=new i({dataField:document.getElementById("ipacl.data"),upstreamCollection:h,entryclass:l,collection:new c,createModel:function(){return new d({network:"::",action:"deny"})}});window.ipaclfield=t,t.render()})}}); \ No newline at end of file diff --git a/www/nginx/src/opnsense/www/js/nginx/src/nginx_config.js b/www/nginx/src/opnsense/www/js/nginx/src/nginx_config.js index c2719990eb..e61a2469be 100644 --- a/www/nginx/src/opnsense/www/js/nginx/src/nginx_config.js +++ b/www/nginx/src/opnsense/www/js/nginx/src/nginx_config.js @@ -70,6 +70,7 @@ function init_grids() { 'snifwd', 'errorpage', 'tls_fingerprint', + 'resolver', 'syslog_target', 'naxsirule'].forEach(function (element) { $("#grid-" + element).UIBootgrid( From 2c7c7b831169a353e89fd0f9ed1c4df757bd9712 Mon Sep 17 00:00:00 2001 From: Violet Shreve Date: Wed, 10 Jul 2024 04:10:08 -0400 Subject: [PATCH 1947/3088] www/nginx: Update help text to clarify https redirect actions (#3776) --- .../mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml | 2 +- .../mvc/app/controllers/OPNsense/Nginx/forms/location.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml index 4c6339d325..b3ad135282 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml @@ -156,7 +156,7 @@ httpserver.https_only checkbox - If you check this box, a TLS encrypted connection is enforced. + If the request scheme is not HTTPS, redirect to use HTTPS for this server.
    httpserver.tls_protocols diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml index f5b832c194..25c998c75d 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml @@ -204,7 +204,7 @@ location.force_https checkbox - Force encrypted connections. + If the request scheme is not HTTPS, redirect to use HTTPS for this location. location.http2_push_preload From d09d3dbaa500b0c918fb67c6c3854a137c467786 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jul 2024 10:17:05 +0200 Subject: [PATCH 1948/3088] www/nginx: fix lint --- www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py | 1 - www/nginx/src/opnsense/scripts/nginx/ngx_testConfig.sh | 0 2 files changed, 1 deletion(-) mode change 100644 => 100755 www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py mode change 100644 => 100755 www/nginx/src/opnsense/scripts/nginx/ngx_testConfig.sh diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py b/www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py old mode 100644 new mode 100755 index e96374a7ec..986cece76f --- a/www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_showConfig.py @@ -41,4 +41,3 @@ def load_config_file(config_path): load_config_file(nginx_config_file) result['config'] = nginx_config print(ujson.dumps(result)) - diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_testConfig.sh b/www/nginx/src/opnsense/scripts/nginx/ngx_testConfig.sh old mode 100644 new mode 100755 From 68a69f0c880230dc968a11dd47e0d3e8b3540f44 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:19:13 +0200 Subject: [PATCH 1949/3088] www/caddy: Update route53 config field names (#4073) Reference: https://github.com/caddy-dns/route53/commit/19e2b6c --- www/caddy/pkg-descr | 1 + .../mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml | 4 ++-- .../service/templates/OPNsense/Caddy/includeDnsProvider | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 7aa3e1d4a6..94e47d2bd7 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -34,6 +34,7 @@ Plugin Changelog * Add: Introduce HTTP version to handler. HTTP/1.1, HTTP/2 and HTTP/3 can be chosen. * Add: HTTP Keepalive can be set in a handler. * Change: Option "tls_trusted_ca_certs" is now "tls_trust_pool". +* Build: Update caddy-dns Cloudflare and Route53. Route53 field names changed due to upstream changes. * Add: TLS can be deactivated in a domain. 1.5.7 diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml index 39d36919c4..87fedb3ca8 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dnsprovider.xml @@ -32,7 +32,7 @@ caddy.general.TlsDnsOptionalField2 text - + caddy.general.TlsDnsOptionalField3 @@ -44,6 +44,6 @@ caddy.general.TlsDnsOptionalField4 text - + diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/includeDnsProvider b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/includeDnsProvider index f962d75120..94df27ca0e 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/includeDnsProvider +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/includeDnsProvider @@ -26,11 +26,11 @@ {% endif %} {% if dnsOptionalField1 %}max_retries {{ dnsOptionalField1 }} {% endif %} - {% if dnsOptionalField2 %}aws_profile {{ dnsOptionalField2 }} + {% if dnsOptionalField2 %}profile {{ dnsOptionalField2 }} {% endif %} {% if dnsOptionalField3 %}region {{ dnsOptionalField3 }} {% endif %} - {% if dnsOptionalField4 %}token {{ dnsOptionalField4 }} + {% if dnsOptionalField4 %}session_token {{ dnsOptionalField4 }} {% endif %} {% elif dnsProvider == 'acmedns' %} {% if dnsApiKey %}username {{ dnsApiKey }} From 50a7a117368cd0fd670b843abd357689acc1e59d Mon Sep 17 00:00:00 2001 From: Jordan Stacy <53239541+jordanstacy@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:28:55 -0700 Subject: [PATCH 1950/3088] dns/bind: Fix multiple select on Recursion field --- .../mvc/app/controllers/OPNsense/Bind/forms/general.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml index 5be009dac0..23e9c92026 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/general.xml @@ -111,7 +111,7 @@ general.recursion - dropdown + select_multiple Define an ACL where you allow which clients can resolve via this service. Usually use your local LAN. From 7967441e431e15f9c97dfb6f9a72865f75df3cac Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jul 2024 10:46:22 +0200 Subject: [PATCH 1951/3088] dns/bind: release new version --- dns/bind/Makefile | 3 +-- dns/bind/pkg-descr | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index 5b8cb64262..b02187266e 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.31 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.32 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind918 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 155d0a82fd..e764e3b888 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -9,11 +9,15 @@ WWW: https://www.isc.org Plugin Changelog ================ +1.32 + +* Fix handling of multiple ACLs in allow-query/allow-transfer (contributed by Nathan Rennie-Waldock) +* Fix multiple select on Recursion field (contributed by Jordan Stacy) + 1.31 * Do not add the update-policy if the zone type is secondary (contributed by Brendan Bank) * Adjust severity log levels (contributed by kulikov-a) -* Fix handling of multiple ACLs in allow-query/allow-transfer (contributed by Nathan Rennie-Waldock) 1.30 From 5ce8679c1057dd683743fff71a3c8a8c9907821f Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:48:40 +0200 Subject: [PATCH 1952/3088] www/caddy: Change this.ajaxGet to this.ajaxCall in Widgets. (#4084) --- www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js | 2 +- www/caddy/src/opnsense/www/js/widgets/CaddyDomain.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js b/www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js index 24b45f44fe..051fc2bc19 100644 --- a/www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js +++ b/www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js @@ -52,7 +52,7 @@ export default class CaddyCertificate extends BaseTableWidget { async onWidgetTick() { // Check if Caddy is enabled - const caddyStatus = await this.ajaxGet('/api/caddy/reverse_proxy/get'); + const caddyStatus = await this.ajaxCall('/api/caddy/reverse_proxy/get'); if (!caddyStatus.caddy.general || caddyStatus.caddy.general.enabled === "0") { this.displayError(`${this.translations.unconfigured}`); return; diff --git a/www/caddy/src/opnsense/www/js/widgets/CaddyDomain.js b/www/caddy/src/opnsense/www/js/widgets/CaddyDomain.js index 552c6a1955..d0e5453152 100644 --- a/www/caddy/src/opnsense/www/js/widgets/CaddyDomain.js +++ b/www/caddy/src/opnsense/www/js/widgets/CaddyDomain.js @@ -51,7 +51,7 @@ export default class CaddyDomain extends BaseTableWidget { async onWidgetTick() { // Check if caddy is enabled - const data = await this.ajaxGet('/api/caddy/reverse_proxy/get'); + const data = await this.ajaxCall('/api/caddy/reverse_proxy/get'); if (!data.caddy.general || data.caddy.general.enabled === "0") { this.displayError(`${this.translations.unconfigured}`); return; From ac485eccea759311428a9a41b2f5ac86f1a0f3c2 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jul 2024 11:00:10 +0200 Subject: [PATCH 1953/3088] dns/ddclient: style --- dns/ddclient/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 21c94f61a2..b16c15dc8d 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= ddclient PLUGIN_VERSION= 1.22 -#PLUGIN_REVISION= 1 PLUGIN_DEPENDS= ddclient py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org From 51211dc9edce57cd16bf30dc199c2b485d1eccb8 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jul 2024 11:01:34 +0200 Subject: [PATCH 1954/3088] dns/dnscrypt-proxy: bump to ship change --- dns/dnscrypt-proxy/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/dns/dnscrypt-proxy/Makefile b/dns/dnscrypt-proxy/Makefile index 8f93604abc..c7e6f14d8c 100644 --- a/dns/dnscrypt-proxy/Makefile +++ b/dns/dnscrypt-proxy/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= dnscrypt-proxy PLUGIN_VERSION= 1.15 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Flexible DNS proxy supporting DNSCrypt and DoH PLUGIN_DEPENDS= dnscrypt-proxy2 PLUGIN_MAINTAINER= m.muenz@gmail.com From 3fea467f858b18067472532cd6dff8a3d1a63e88 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jul 2024 11:03:10 +0200 Subject: [PATCH 1955/3088] security/etpro-telemetry: style --- security/etpro-telemetry/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/security/etpro-telemetry/Makefile b/security/etpro-telemetry/Makefile index e135a3f1dc..c89521644f 100644 --- a/security/etpro-telemetry/Makefile +++ b/security/etpro-telemetry/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= etpro-telemetry PLUGIN_VERSION= 1.7 -#PLUGIN_REVISION= 1 PLUGIN_COMMENT= ET Pro Telemetry Edition PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://docs.opnsense.org/manual/etpro_telemetry.html From 392ba2a0536435fba101bdf68f2ab6280a2aa9d9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jul 2024 11:04:20 +0200 Subject: [PATCH 1956/3088] www/nginx: update version --- www/nginx/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 14950c49ee..0b76a782ff 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.32.2 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.33 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From ee826d32d3f2ba237df00ed0345c6cac46333983 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jul 2024 11:11:44 +0200 Subject: [PATCH 1957/3088] net-mgmt/net-snmp: bump version --- net-mgmt/net-snmp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile index 942edba72e..5983317cc7 100644 --- a/net-mgmt/net-snmp/Makefile +++ b/net-mgmt/net-snmp/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= net-snmp PLUGIN_VERSION= 1.5 -PLUGIN_REVISION= 3 +PLUGIN_REVISION= 4 PLUGIN_COMMENT= Net-SNMP is a daemon for the SNMP protocol PLUGIN_DEPENDS= net-snmp PLUGIN_MAINTAINER= m.muenz@gmail.com From 7a680f60a9cd456f9f0de8bf7eef11a5d5d032a4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Jul 2024 11:12:21 +0200 Subject: [PATCH 1958/3088] net-mgmt/nrpe: bump revision --- net-mgmt/nrpe/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile index abb4f51bd2..42ba8e5c36 100644 --- a/net-mgmt/nrpe/Makefile +++ b/net-mgmt/nrpe/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= nrpe PLUGIN_VERSION= 1.1 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Execute nagios plugins PLUGIN_DEPENDS= nrpe PLUGIN_MAINTAINER= m.muenz@gmail.com From d777a605920921249ec120c8679f0e50215a0266 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:38:46 +0200 Subject: [PATCH 1959/3088] www/caddy: Cleanup model, php (PSR-12), python (PEP 8) and jinja2 files (#4060) * www/caddy: Remove unsused code in validation. * www/caddy: Cleanup Caddyfile template for better readability with improved indentation. * www/caddy: Cleanup rc.conf.d/caddy * www/caddy: Cleanup model. * www/caddy: Cleanup Caddyfile template some more. * www/caddy: Roll back changes to Caddyfile structure, don't fix what ain't broken. * www/caddy: Fix caddy_certs.php style warning. A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. * www/caddy: Ignore php style warnings for migration scripts, since the class names have to ignore PascalCase. * www/caddy: Correct style of php files so that no lines exceed 120 characters. * www/caddy: Refactor caddy_diagnostics.py and caddy_control.py for Python PEP 8. Fix: Shadows name 'action' from outer scope * www/caddy: Changelog add code cleanup. * www/caddy: Fix minor regression in refactored caddy_control.py script. * www/caddy: Fix indentation of Caddyfile template for better code readability. The template gets edited and read a lot so this fix really helps with maintainability. * www/caddy: Add changelog. * www/caddy: Fix caddy_certs.php style issue by removing the declared function and execute logic with side effects directly. * www/caddy: Re-add ValidationMessage to IntegerField because there are custom constraints that are not displayed by the default validation message. * www/caddy: Add error handling to caddy_control.py when action is empty. Make use of service_action and cmd_action clearer. * www/caddy: Remove unnecessary variable in caddy_diagnostics.py * www/caddy: Add validation message since there is a no IP constraint. Add same constraint to subdomains. * www/caddy: Re-add validation message to ToDomain field since multiple are allowed * www/caddy: Re-add validation message to clientIps field since multiple are allowed --- www/caddy/pkg-descr | 6 +- .../Caddy/Api/DiagnosticsController.php | 4 +- .../Caddy/Api/ReverseProxyController.php | 30 +- .../mvc/app/models/OPNsense/Caddy/Caddy.php | 51 ++- .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 60 +--- .../OPNsense/Caddy/Migrations/M1_1_3.php | 2 + .../OPNsense/Caddy/Migrations/M1_1_8.php | 2 + .../scripts/OPNsense/Caddy/caddy_certs.php | 68 ++-- .../scripts/OPNsense/Caddy/caddy_control.py | 51 +-- .../OPNsense/Caddy/caddy_diagnostics.py | 19 +- .../templates/OPNsense/Caddy/Caddyfile | 324 +++++++++--------- .../templates/OPNsense/Caddy/rc.conf.d/caddy | 11 +- 12 files changed, 326 insertions(+), 302 deletions(-) diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 94e47d2bd7..5306352762 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -28,7 +28,11 @@ Plugin Changelog 1.6.0 * Add: New Dashboard widgets for 24.7, showing domain status and certificate validity status. -* Fix: Caddyfile template fixed for IPv6 addresses and custom port. +* Cleanup: PHP files refactored for PSR-12, Python files refactored for PEP-8. +* Cleanup: Templates Caddyfile and rc.conf.d/caddy refactored for maintainability. +* Cleanup: Spurious keys removed from Caddy.xml model. +* Cleanup: Unused code removed from Caddy.php. +* Fix: Caddyfile template fixed when IPv6 addresses and ports are used in Upstream. IPv6 address wraps into brackets now. * Add: forward_auth directive with Authelia as Authz Provider. * Add: Default HTTP and HTTPS ports can be changed in general settings. * Add: Introduce HTTP version to handler. HTTP/1.1, HTTP/2 and HTTP/3 can be chosen. diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/DiagnosticsController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/DiagnosticsController.php index bda64cb5e2..edcb55389e 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/DiagnosticsController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/DiagnosticsController.php @@ -50,7 +50,7 @@ public function configAction() // Decode JSON to PHP array $responseArray = json_decode($response, true); - // Since errors are handled by the caddy_diagnostics script and returned as json, check for an error key in the response + // Errors are handled by the caddy_diagnostics script and returned, check for an error key in the response if (isset($responseArray['error'])) { return ["status" => "failed", "message" => $responseArray['message']]; } @@ -74,7 +74,6 @@ public function caddyfileAction() // Decode JSON to PHP array $responseArray = json_decode($response, true); - // Since errors are handled by the caddy_diagnostics script and returned as json, check for an error key in the response if (isset($responseArray['error'])) { return ["status" => "failed", "message" => $responseArray['message']]; } @@ -94,7 +93,6 @@ public function certificateAction() // Decode JSON to PHP array $responseArray = json_decode($response, true); - // Since errors are handled by the caddy_diagnostics script and returned as json, check for an error key in the response if (isset($responseArray['error'])) { return ["status" => "failed", "message" => $responseArray['message']]; } diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php index 5f32443d00..193aa298bf 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/Api/ReverseProxyController.php @@ -26,7 +26,6 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * */ namespace OPNsense\Caddy\Api; @@ -70,14 +69,15 @@ public function getAllReverseDomainsAction() } /** - * Centralized and generalized helper function for searching across different sections of the reverse proxy setup. + * Generalized helper function for searching across different sections of the reverse proxy setup. * This function mostly helps when model relation fields are used. * It filters entries based on UUIDs provided as an argument. The section or key used for the UUID * can be specified, allowing for direct or indirect UUID referencing. * - * @param string $modelPath The data model path identifier, pointing to the section of the model being searched. - * @param string $uuidSearchBase The request parameter name for the comma-separated list of UUIDs to filter the search results. - * @param string|null $uuidReferenceKey The specific attribute key used to fetch the UUID for filtering. If null, defaults to the item's own UUID. + * @param string $modelPath The data model path identifier, pointing to section of model being searched. + * @param string $uuidSearchBase The request parameter name for the comma-separated list of UUIDs. + * @param string|null $uuidReferenceKey Attribute key used to fetch the UUID for filtering. + * If null, uses item's own UUID. * @return array Filtered search results. */ private function searchActionHelper($modelPath, $uuidSearchBase, $uuidReferenceKey = null) @@ -89,8 +89,12 @@ private function searchActionHelper($modelPath, $uuidSearchBase, $uuidReferenceK // Define a filter function to determine which items to include based on the UUID. $filterFunction = function ($modelItem) use ($uuidArray, $uuidReferenceKey) { - // Extract UUID from the item, using the specified UUID key if provided, otherwise default to direct UUID access. - $modelUUID = ($uuidReferenceKey !== null) ? (string)$modelItem->$uuidReferenceKey : (string)$modelItem->getAttributes()['uuid']; + // Extract UUID from the item, using the specified UUID key if provided, else default to direct UUID access. + if ($uuidReferenceKey !== null) { + $modelUUID = (string)$modelItem->$uuidReferenceKey; + } else { + $modelUUID = (string)$modelItem->getAttributes()['uuid']; + } // Include the item if the UUID array is empty or if the item's UUID is in the array. return empty($uuidArray) || in_array($modelUUID, $uuidArray, true); }; @@ -245,8 +249,10 @@ public function setBasicAuthAction($uuid) { if ($this->request->isPost()) { $postData = $this->request->getPost(); - - if (isset($postData['basicauth']['basicauthpass']) && !empty(trim($postData['basicauth']['basicauthpass']))) { + if ( + isset($postData['basicauth']['basicauthpass']) + && !empty(trim($postData['basicauth']['basicauthpass'])) + ) { $plainPassword = $postData['basicauth']['basicauthpass']; $hashedPassword = password_hash($plainPassword, PASSWORD_BCRYPT); $_POST['basicauth']['basicauthpass'] = $hashedPassword; @@ -260,8 +266,10 @@ public function addBasicAuthAction() { if ($this->request->isPost()) { $postData = $this->request->getPost(); - - if (isset($postData['basicauth']['basicauthpass']) && !empty(trim($postData['basicauth']['basicauthpass']))) { + if ( + isset($postData['basicauth']['basicauthpass']) + && !empty(trim($postData['basicauth']['basicauthpass'])) + ) { $plainPassword = $postData['basicauth']['basicauthpass']; $hashedPassword = password_hash($plainPassword, PASSWORD_BCRYPT); $_POST['basicauth']['basicauthpass'] = $hashedPassword; diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php index 9f76fe20ee..42972f8d1d 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.php @@ -59,9 +59,15 @@ private function checkForUniquePortCombos($items, $messages) if (isset($combos[$comboKey])) { // Use dynamic $key for message referencing $messages->appendMessage(new Message( - sprintf(gettext("Duplicate entry: The combination of '%s' and port '%s' is already used. Each combination of domain and port must be unique."), $fromDomain, $port), - $key . ".FromDomain", // Adjusted to use dynamic key - "DuplicateDomainPort" + sprintf( + gettext( + 'Duplicate entry: The combination of %s and port %s is already used. ' . + 'Each combination of domain and port must be unique.' + ), + $fromDomain, + $port + ), + $key . ".FromDomain" )); } else { $combos[$comboKey] = true; @@ -98,9 +104,14 @@ private function checkSubdomainsAgainstDomains($subdomains, $domains, $messages) if (!$isValid) { $key = $subdomain->__reference; // Dynamic key based on subdomain reference $messages->appendMessage(new Message( - sprintf(gettext("Invalid subdomain configuration: '%s' does not fall under any configured wildcard domain."), $subdomainName), - $key . ".FromDomain", // Use dynamic key for message referencing - "InvalidSubdomain" + sprintf( + gettext( + 'Invalid subdomain configuration: %s does not fall ' . + 'under any configured wildcard domain.' + ), + $subdomainName + ), + $key . ".FromDomain" )); } } @@ -140,7 +151,18 @@ private function checkWebGuiSettings($messages) if (!empty($overlap) && $tlsAutoHttpsSetting !== 'off') { $portOverlap = implode(', ', $overlap); $messages->appendMessage(new Message( - sprintf(gettext('To use "Auto HTTPS", resolve these conflicting ports (%s) that are currently configured for the OPNsense WebGUI. Go to "System - Settings - Administration". To release port 80, enable "Disable web GUI redirect rule". To release port %s, change "TCP port" to a non-standard port, e.g., 8443.'), $portOverlap, $httpsPort), + sprintf( + gettext( + 'To use "Auto HTTPS", resolve these conflicting ports %s ' . + 'that are currently configured for the OPNsense WebGUI. ' . + 'Go to "System - Settings - Administration". ' . + 'To release port 80, enable "Disable web GUI redirect rule". ' . + 'To release port %s, change "TCP port" to a non-standard port, ' . + 'e.g., 8443.' + ), + $portOverlap, + $httpsPort + ), "general.TlsAutoHttps" )); } @@ -193,12 +215,23 @@ private function checkDisableTlsConflicts($messages) public function performValidation($validateFullModel = false) { $messages = parent::performValidation($validateFullModel); + // 1. Check domain-port combinations - $this->checkForUniquePortCombos($this->reverseproxy->reverse->iterateItems(), $messages); + $this->checkForUniquePortCombos( + $this->reverseproxy->reverse->iterateItems(), + $messages + ); + // 2. Check that subdomains are under a wildcard or exact domain - $this->checkSubdomainsAgainstDomains($this->reverseproxy->subdomain->iterateItems(), $this->reverseproxy->reverse->iterateItems(), $messages); + $this->checkSubdomainsAgainstDomains( + $this->reverseproxy->subdomain->iterateItems(), + $this->reverseproxy->reverse->iterateItems(), + $messages + ); + // 3. Check WebGUI conflicts $this->checkWebGuiSettings($messages); + // 4. Check for ACME Email requirement $this->checkAcmeEmailAutoHttps($messages); // 5. Check for TLS conflicts in Domain diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index 2650cb2671..f70f548576 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -10,9 +10,7 @@ - - Please enter a valid email address. - + On (default) @@ -106,9 +104,7 @@ FATAL - - Please enter a valid URL, starting with http or https. - + 1 @@ -150,17 +146,11 @@ Y - Please enter a valid 'from' domain. N - Y Y - N + Please enter a valid domain name. - - Please enter a valid 'from' port number. - Y - N - + @@ -189,10 +179,7 @@ - - Please enter a valid 'to' domain or IP address. - Y - + @@ -213,8 +200,8 @@ Y - Please enter a valid 'from' Subdomain that is based upon the wildcard domain. - N + N + Please enter a valid domain name. @@ -241,10 +228,7 @@ Y - - Please enter a valid 'to' domain or IP address. - Y - + @@ -282,7 +266,7 @@ /^(\/.*)?$/u - Please enter a valid 'Handle Path' that starts with '/'. + Please enter a valid Path that starts with '/'.
    @@ -297,19 +281,14 @@
    Y - Please enter a valid 'to' domain or IP address. - Y , Y + Please enter one or multiple valid IP addresses, hostnames or FQDNs. - - Please enter a valid 'to' port number. - Y - N - + /^(\/.*)?$/u - Please enter a valid 'Backend Path' that starts with '/'. + Please enter a valid Path that starts with '/'. 1 @@ -351,30 +330,21 @@ ca - - Please enter a valid hostname or IP address. - Y - Y - Y - N - + Y
    - + Y - /^([\t\n\v\f\r 0-9a-zA-Z.,_*-\x{00A0}-\x{FFFF}]){1,255}$/u - Please provide a valid Access List Name. Y - Y , Y Y - Please enter valid IP address(es) or network(s), separated by commas. + Please enter one or multiple valid IP addresses or networks. diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php index c103f8d48b..649408dbcf 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_3.php @@ -31,7 +31,9 @@ use OPNsense\Base\BaseModelMigration; use OPNsense\Core\Config; +// @codingStandardsIgnoreStart class M1_1_3 extends BaseModelMigration +// @codingStandardsIgnoreEnd { public function run($model) { diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php index 0687d49abc..c506375a1e 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Migrations/M1_1_8.php @@ -31,7 +31,9 @@ use OPNsense\Base\BaseModelMigration; use OPNsense\Core\Config; +// @codingStandardsIgnoreStart class M1_1_8 extends BaseModelMigration +// @codingStandardsIgnoreEnd { public function run($model) { diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php index 0f6078b466..f65ef168cf 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_certs.php @@ -2,8 +2,7 @@ object(); $temp_dir = '/var/db/caddy/data/caddy/certificates/temp/'; -function extract_and_save_certificates($configObj, $temp_dir) -{ - // Traverse through certificates - foreach ($configObj->cert as $cert) { - $cert_refid = (string)$cert->refid; - $cert_content = base64_decode((string)$cert->crt); - $key_content = base64_decode((string)$cert->prv); - $cert_chain = $cert_content; +// Traverse through certificates +foreach ($configObj->cert as $cert) { + $cert_refid = (string) $cert->refid; + $cert_content = base64_decode((string) $cert->crt); + $key_content = base64_decode((string) $cert->prv); + $cert_chain = $cert_content; - // Handle CA and possible intermediate CA to create a certificate bundle - if (!empty($cert->caref)) { - foreach ($configObj->ca as $ca) { - if ((string)$cert->caref == (string)$ca->refid) { - $ca_content = base64_decode((string)$ca->crt); - $cert_chain .= "\n" . $ca_content; + // Handle CA and possible intermediate CA to create a certificate bundle + if (!empty($cert->caref)) { + foreach ($configObj->ca as $ca) { + if ((string) $cert->caref === (string) $ca->refid) { + $ca_content = base64_decode((string) $ca->crt); + $cert_chain .= "\n" . $ca_content; - if (!empty($ca->caref)) { - foreach ($configObj->ca as $parent_ca) { - if ((string)$ca->caref == (string)$parent_ca->refid) { - $parent_ca_content = base64_decode((string)$parent_ca->crt); - $cert_chain .= "\n" . $parent_ca_content; - break; - } + if (!empty($ca->caref)) { + foreach ($configObj->ca as $parent_ca) { + if ((string) $ca->caref === (string) $parent_ca->refid) { + $parent_ca_content = base64_decode((string) $parent_ca->crt); + $cert_chain .= "\n" . $parent_ca_content; + break; } } } } } - - // Save the certificate chain and private key - file_put_contents($temp_dir . $cert_refid . '.pem', $cert_chain); - file_put_contents($temp_dir . $cert_refid . '.key', $key_content); } - // Traverse through CA certificates and save them - foreach ($configObj->ca as $ca) { - $ca_refid = (string)$ca->refid; - $ca_content = base64_decode((string)$ca->crt); - - // Save the CA certificate - file_put_contents($temp_dir . $ca_refid . '.pem', $ca_content); - } + // Save the certificate chain and private key + file_put_contents($temp_dir . $cert_refid . '.pem', $cert_chain); + file_put_contents($temp_dir . $cert_refid . '.key', $key_content); } -extract_and_save_certificates($configObj, $temp_dir); +// Traverse through CA certificates and save them +foreach ($configObj->ca as $ca) { + $ca_refid = (string) $ca->refid; + $ca_content = base64_decode((string) $ca->crt); + + // Save the CA certificate + file_put_contents($temp_dir . $ca_refid . '.pem', $ca_content); +} diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py index 79e9a8226f..add576358d 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_control.py @@ -30,19 +30,23 @@ import json import sys -def run_service_command(action, action_message): + +def run_service_command(service_action, action_message): result = {"message": action_message} - if action == "validate": + if service_action == "validate": try: # Validate the Caddyfile with explicit --config flag, capturing both stdout and stderr - validation_output = subprocess.check_output(["caddy", "validate", "--config", "/usr/local/etc/caddy/Caddyfile"], stderr=subprocess.STDOUT, text=True) + validation_output = subprocess.check_output( + ["caddy", "validate", "--config", "/usr/local/etc/caddy/Caddyfile"], stderr=subprocess.STDOUT, + text=True) if "Valid configuration" in validation_output: result["status"] = "ok" result["message"] = "Caddy configuration is valid." else: # Search for the specific error message - error_msg = next((line for line in validation_output.split('\n') if line.startswith("Error:")), "Caddy configuration is not valid.") + error_msg = next((line for line in validation_output.split('\n') if line.startswith("Error:")), + "Caddy configuration is not valid.") result["status"] = "failed" result["message"] = error_msg except subprocess.CalledProcessError as e: @@ -52,7 +56,7 @@ def run_service_command(action, action_message): result["message"] = error_msg else: try: - subprocess.run(["service", "caddy", action], check=True) + subprocess.run(["service", "caddy", service_action], check=True) result["status"] = "ok" except subprocess.CalledProcessError as e: result["status"] = "failed" @@ -60,29 +64,36 @@ def run_service_command(action, action_message): return json.dumps(result) -# Updated actions dictionary + +# "cmd_action": "service_action" actions = { "start": "start", "stop": "stop", "restart": "restart", - "reload": "reloadssl", # Forces the reload even if the config in the Caddyfile is unchanged, using an extra command of the rc.d script, forcing certificates in the filesystem to reload. + "reload": "reloadssl", + # Reloadssl reloads even if the config in the Caddyfile is unchanged, using an extra command of the rc.d script, + # forcing certificates in the filesystem to be reloaded. "validate": "validate" # Validate action } if __name__ == "__main__": - action = sys.argv[1] # Get the action from the command-line argument - if action in actions: - service_action = actions[action] - message = f"{action.capitalize()}ing Caddy service" if action != "validate" else "Validating Caddy configuration" + if len(sys.argv) > 1: + action = sys.argv[1] # Get the action from the command-line argument + if action in actions: + cmd_action = action + service_action = actions[action] + message = f"{cmd_action.capitalize()} Caddy service" - # Call setup script for 'validate' and 'reloadssl' actions - # This is needed because the setup script triggers the caddy_certs.php script, which exports all certificates into the filesystem. - # Caddy reloads certificates when reloadssl is used. Because it is a non standard command, the caddy_setup script will not be triggered in /etc/rc.conf.d/caddy. - # The validate command needs it to make sure all certificates are in the filesystem, because otherwise the validation fails. - if service_action in ["validate", "reloadssl"]: - subprocess.run(["/usr/local/opnsense/scripts/OPNsense/Caddy/setup.sh"], check=True) + # Call setup script for 'validate' and 'reloadssl' actions. This is needed because the setup script triggers + # the caddy_certs.php script, which exports all certificates into the filesystem. Caddy reloads certificates + # when reloadssl is used. Because it is a non standard command, the caddy_setup script will not be triggered + # in /etc/rc.conf.d/caddy. The validate command needs it to make sure all certificates are in the filesystem, + # because otherwise the validation fails. + if service_action in ["validate", "reloadssl"]: + subprocess.run(["/usr/local/opnsense/scripts/OPNsense/Caddy/setup.sh"], check=True) - # Continue with the service action - print(run_service_command(service_action, message)) + print(run_service_command(service_action, message)) + else: + print(json.dumps({"status": "failed", "message": f"Unknown action: {action}"})) else: - print(json.dumps({"status": "failed", "message": f"Unknown action: {action}"})) + print(json.dumps({"status": "failed", "message": "No action provided"})) diff --git a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_diagnostics.py b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_diagnostics.py index f42fd60658..ab55778a60 100755 --- a/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_diagnostics.py +++ b/www/caddy/src/opnsense/scripts/OPNsense/Caddy/caddy_diagnostics.py @@ -33,6 +33,7 @@ import asyncio from datetime import datetime + # Function to show the Caddy configuration from a JSON file def show_caddy_config(): config_path = "/var/db/caddy/config/caddy/autosave.json" @@ -48,10 +49,12 @@ def show_caddy_config(): except FileNotFoundError: print(json.dumps({"error": "File not found", "message": "Caddy autosave.json configuration file not found"})) except json.JSONDecodeError: - print(json.dumps({"error": "Invalid JSON", "message": "Error decoding the Caddy autosave.json, the file is not valid JSON"})) + print(json.dumps( + {"error": "Invalid JSON", "message": "Error decoding the Caddy autosave.json, the file is not valid JSON"})) except Exception as e: print(json.dumps({"error": "General Error", "message": str(e)})) + def show_caddyfile(): caddyfile_path = "/usr/local/etc/caddy/Caddyfile" @@ -65,6 +68,7 @@ def show_caddyfile(): except Exception as e: print(json.dumps({"error": "General Error", "message": str(e)})) + # Function to extract certificate information using openssl command async def extract_certificate_info(cert_path): try: @@ -105,6 +109,7 @@ async def extract_certificate_info(cert_path): except Exception as e: raise RuntimeError(f"Error extracting certificate info for {cert_path}: {str(e)}") + # Function to find certificates and create tasks to extract info async def find_certificates(base_dir): tasks = [] @@ -123,6 +128,7 @@ async def find_certificates(base_dir): results = await asyncio.gather(*tasks, return_exceptions=True) return [result for result in results if not isinstance(result, Exception)] + # Function to show certificates, processing all found in the given directory async def show_certificates(): # Function to show certificates, processing all found in the given directory @@ -136,25 +142,26 @@ async def show_certificates(): except Exception as e: print(json.dumps({"error": "General Error", "message": str(e)})) + # Action handler -def perform_action(action): +def perform_action(cmd_action): actions = { "config": show_caddy_config, "caddyfile": show_caddyfile, "certificate": lambda: asyncio.run(show_certificates()) } - action_func = actions.get(action) + action_func = actions.get(cmd_action) if action_func: action_func() else: # Output error details in JSON format if action is unknown - print(json.dumps({"error": "Unknown Action", "message": f"Unknown action: {action}"})) + print(json.dumps({"error": "Unknown Action", "message": f"Unknown action: {cmd_action}"})) + if __name__ == "__main__": if len(sys.argv) > 1: - action = sys.argv[1] - perform_action(action) + perform_action(sys.argv[1]) else: # Output error details in JSON format if no action is specified print(json.dumps({"error": "No Action Specified", "message": "No action specified"})) diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index eb4ce0ad82..c06342fc98 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -37,11 +37,11 @@ #} log { {% if generalSettings.LogAccessPlain|default("0") == "0" %} - {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} - {% if reverse.enabled|default("0") == "1" and reverse.AccessLog|default("0") == "1" %} - include http.log.access.{{ reverse['@uuid'] }} - {% endif %} - {% endfor %} + {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} + {% if reverse.enabled|default("0") == "1" and reverse.AccessLog|default("0") == "1" %} + include http.log.access.{{ reverse['@uuid'] }} + {% endif %} + {% endfor %} {% endif %} output net unixgram//var/caddy/var/run/log { } @@ -49,7 +49,7 @@ time_format rfc3339 } {% if generalSettings.LogLevel %} - level {{ generalSettings.LogLevel }} + level {{ generalSettings.LogLevel }} {% endif %} } @@ -89,10 +89,10 @@ {% if hasAccessList or hasLogCredentials %} servers { {% if hasAccessList %} - trusted_proxies static {{ accessList.clientIps.split(',') | join(' ') }} + trusted_proxies static {{ accessList.clientIps.split(',') | join(' ') }} {% endif %} {% if hasLogCredentials %} - log_credentials + log_credentials {% endif %} } {% endif %} @@ -175,11 +175,11 @@ {% endif %} domains { {% for domain in dynDnsDomains %} - {{ domain }} + {{ domain }} {% endfor %} } {% if dynDnsSimpleHttp %} - ip_source simple_http {{ dynDnsSimpleHttp }} + ip_source simple_http {{ dynDnsSimpleHttp }} {% endif %} {% if dynDnsInterface %} {% set physicalInterfaceNames = [] %} @@ -189,16 +189,16 @@ ip_source interface {{ physicalInterfaceNames | join(',') }} {% endif %} {% if dynDnsCheckInterval %} - check_interval {{ dynDnsCheckInterval }}s + check_interval {{ dynDnsCheckInterval }}s {% endif %} {% if dynDnsIpVersions %} - versions {{ dynDnsIpVersions }} + versions {{ dynDnsIpVersions }} {% endif %} {% if dynDnsTtl %} - ttl {{ dynDnsTtl }}s + ttl {{ dynDnsTtl }}s {% endif %} {% if dynDnsUpdateOnly|default("0") == "1" %} - update_only + update_only {% endif %} } {% endif %} @@ -211,11 +211,11 @@ #} {% set emailValue = helpers.toList('Pischem.caddy.general.TlsEmail') | first %} {% if emailValue %} - email {{ emailValue }} + email {{ emailValue }} {% endif %} {% set autoHttpsValue = helpers.toList('Pischem.caddy.general.TlsAutoHttps') | first %} {% if autoHttpsValue %} - auto_https {{ autoHttpsValue }} + auto_https {{ autoHttpsValue }} {% endif %} {# # Important: Grace Period influences how fast the server can finish reloads with open connections, by forcing termination. @@ -299,8 +299,8 @@ # It uses a 'handle' object that specifies which headers to manipulate based on their @UUIDs. # Each handle can have multiple of these HTTP headers assigned. # Parameters: -# @param handle (@object): -# - @uuid (@string) +# @param handle (object): +# - @uuid (string) # - HeaderUpDown (string): Determines the direction of the header. # - HeaderType (string): Specifies the name of the header. # - HeaderValue (string, optional): The new value to set for the header, if any. @@ -341,15 +341,15 @@ # Purpose: Sets up the handle with the reverse proxy configurations. The TLS Settings are generated here for the Upstream. # Integrated Macros: header_manipulation # Parameters: -# @param handle (@object): -# - @uuid (@string) +# @param handle (object): +# - @uuid (string) # - HandleType (string): Specifies the handling strategy. # - HandlePath (string, optional): The path the handle should match on. # - ToDomain (string): Target domain for the reverse proxy. # - ToPort (string, optional): Target port on the ToDomain. # - ToPath (string, optional): Destination path on the ToDomain. # - HttpTls (boolean, optional): Enable TLS for the connection. -# - HttpNtlm (boolean, optional): Enable NTLM authentication for the connection. +# - HttpNtlm (boolean, optional): Enable NTLM authentication for the connection. Not all HTTP options apply to NTLM. # - HttpTlsInsecureSkipVerify (boolean, optional): If true, the server's SSL certificate is not verified. # - HttpTlsTrustedCaCerts (string, optional): The config extracted name of a CA certificate. # - HttpTlsServerName (string, optional): Specifies the server name for the TLS handshake. @@ -363,7 +363,7 @@ {% include "OPNsense/Caddy/includeAuthProvider" %} {% endif %} {% if handle.ToPath|default("") != "" %} - rewrite * {{ handle.ToPath }}{uri} + rewrite * {{ handle.ToPath }}{uri} {% endif %} reverse_proxy {% for domain in handle.ToDomain.split(',') %} {# Check if the domain is IPv6 and wrap in square brackets if necessary #} @@ -373,22 +373,22 @@ {% endfor %} { {{ header_manipulation(handle) }} {% if handle.PassiveHealthFailDuration|default("") %} - fail_duration {{ handle.PassiveHealthFailDuration }}s + fail_duration {{ handle.PassiveHealthFailDuration }}s {% endif %} {% if handle.HttpTls|default("0") == "1" or handle.HttpTlsInsecureSkipVerify|default("0") == "1" or handle.HttpTlsTrustedCaCerts or handle.HttpTlsServerName or handle.HttpVersion or handle.HttpKeepalive %} {% if handle.HttpNtlm|default("0") == "1" %} transport http_ntlm { {% if handle.HttpTls|default("0") == "1" %} - tls + tls {% endif %} {% if handle.HttpTlsInsecureSkipVerify|default("0") == "1" %} - tls_insecure_skip_verify + tls_insecure_skip_verify {% endif %} {% if handle.HttpTlsTrustedCaCerts %} - tls_trust_pool file /var/db/caddy/data/caddy/certificates/temp/{{ handle.HttpTlsTrustedCaCerts }}.pem + tls_trust_pool file /var/db/caddy/data/caddy/certificates/temp/{{ handle.HttpTlsTrustedCaCerts }}.pem {% endif %} {% if handle.HttpTlsServerName %} - tls_server_name {{ handle.HttpTlsServerName }} + tls_server_name {{ handle.HttpTlsServerName }} {% endif %} } {% else %} @@ -406,16 +406,16 @@ {% endif %} {% endif %} {% if handle.HttpTls|default("0") == "1" %} - tls + tls {% endif %} {% if handle.HttpTlsInsecureSkipVerify|default("0") == "1" %} - tls_insecure_skip_verify + tls_insecure_skip_verify {% endif %} {% if handle.HttpTlsTrustedCaCerts %} - tls_trust_pool file /var/db/caddy/data/caddy/certificates/temp/{{ handle.HttpTlsTrustedCaCerts }}.pem + tls_trust_pool file /var/db/caddy/data/caddy/certificates/temp/{{ handle.HttpTlsTrustedCaCerts }}.pem {% endif %} {% if handle.HttpTlsServerName %} - tls_server_name {{ handle.HttpTlsServerName }} + tls_server_name {{ handle.HttpTlsServerName }} {% endif %} } {% endif %} @@ -431,10 +431,10 @@ # only get to the reverse proxy, when the access list matches. Invert is also possible, to explicitely deny IPs. # The assembly is handled by the "Section: Reverse Proxy Configurations". # Parameters: -# @param accesslist (@object): -# - @uuid (@string) -# - clientIps (@string): A comma-separated list of client IP addresses -# - invert (@boolean): A flag that inverts the logic of the access list +# @param accesslist (object): +# - uuid (string) +# - clientIps (string): A comma-separated list of client IP addresses +# - invert (boolean): A flag that inverts the logic of the access list #} {% macro access_list_configuration(accesslist, invert) %} {% set client_ips = accesslist.clientIps.split(',') %} @@ -448,11 +448,11 @@ # Macro: basicauth_configuration # Purpose: Implements basic authentication with a username and password for access. # Parameters: -# @param basicauth_uuids (@string): A comma-separated list of UUIDs, each UUID corresponding to +# @param basicauth_uuids (string): A comma-separated list of UUIDs, each UUID corresponding to # a specific user credentials (username and password). -# - @uuid (@string) -# - basicauthuser (@string): The username required for authentication. -# - basicauthpass (@string): The password associated with the username. +# - @uuid (string) +# - basicauthuser (string): The username required for authentication. +# - basicauthpass (string): The password associated with the username. #} {% macro basicauth_configuration(basicauth_uuids) %} {% if basicauth_uuids %} @@ -482,139 +482,139 @@ # - Order of Wildcard Domains and Subdomains: Handles for wildcard domains come after all subdomains. #} {% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %} -{% if reverse.enabled|default("0") == "1" %} -# Reverse Proxy Domain: "{{ reverse['@uuid'] }}" -{# The default are encrypted connections, uncencrypted connections have to render http:// #} -{% if reverse.DisableTls|default("0") == "1" %}http://{% endif %}{{ reverse.FromDomain|default("") }}{% if reverse.FromPort %}:{{ reverse.FromPort }}{% endif %} { - {% if reverse.AccessLog|default("0") == "1" %} - {% if generalSettings.LogAccessPlain|default("0") == "0" %} - log {{ reverse['@uuid'] }} - {% else %} - log { - output file /var/log/caddy/access/{{ reverse['@uuid'] }}.log { - roll_keep_for {{ generalSettings.LogAccessPlainKeep|default("10") }}d - } - } - {% endif %} - {% endif %} - {% set customCert = reverse.CustomCertificate|default("") %} - {% set dnsChallenge = reverse.DnsChallenge|default("0") %} - {{ tls_configuration(dnsProvider, dnsApiKey, customCert, dnsChallenge, dnsSecretApiKey, TlsDnsOptionalField1, TlsDnsOptionalField2, TlsDnsOptionalField3, TlsDnsOptionalField4) }} - - {% if not reverse.accesslist %} - {% set basicauth_uuids = reverse.basicauth %} - {{ basicauth_configuration(basicauth_uuids) }} - {% endif %} + {% if reverse.enabled|default("0") == "1" %} + # Reverse Proxy Domain: "{{ reverse['@uuid'] }}" + {# The default are encrypted connections, uncencrypted connections have to render http:// #} + {% if reverse.DisableTls|default("0") == "1" %}http://{% endif %}{{ reverse.FromDomain|default("") }}{% if reverse.FromPort %}:{{ reverse.FromPort }}{% endif %} { + {% if reverse.AccessLog|default("0") == "1" %} + {% if generalSettings.LogAccessPlain|default("0") == "0" %} + log {{ reverse['@uuid'] }} + {% else %} + log { + output file /var/log/caddy/access/{{ reverse['@uuid'] }}.log { + roll_keep_for {{ generalSettings.LogAccessPlainKeep|default("10") }}d + } + } + {% endif %} + {% endif %} + {% set customCert = reverse.CustomCertificate|default("") %} + {% set dnsChallenge = reverse.DnsChallenge|default("0") %} + {{ tls_configuration(dnsProvider, dnsApiKey, customCert, dnsChallenge, dnsSecretApiKey, TlsDnsOptionalField1, TlsDnsOptionalField2, TlsDnsOptionalField3, TlsDnsOptionalField4) }} - {% for subdomain in helpers.toList('Pischem.caddy.reverseproxy.subdomain') %} - {% if subdomain.enabled|default("0") == "1" and subdomain.reverse == reverse['@uuid'] %} - @{{ subdomain['@uuid'] }} { - host {{ subdomain.FromDomain }} - } - handle @{{ subdomain['@uuid'] }} { + {% if not reverse.accesslist %} + {% set basicauth_uuids = reverse.basicauth %} + {{ basicauth_configuration(basicauth_uuids) }} + {% endif %} - {% if not subdomain.accesslist %} - {% set subdomain_basicauth_uuids = subdomain.basicauth %} - {{ basicauth_configuration(subdomain_basicauth_uuids) }} - {% endif %} + {% for subdomain in helpers.toList('Pischem.caddy.reverseproxy.subdomain') %} + {% if subdomain.enabled|default("0") == "1" and subdomain.reverse == reverse['@uuid'] %} + @{{ subdomain['@uuid'] }} { + host {{ subdomain.FromDomain }} + } + handle @{{ subdomain['@uuid'] }} { - {% if subdomain.accesslist %} - {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', subdomain.accesslist) | first %} - {{ access_list_configuration(accesslist, accesslist.accesslistInvert|default("0") == "1") }} - handle @{{ accesslist['@uuid'] }} { + {% if not subdomain.accesslist %} + {% set subdomain_basicauth_uuids = subdomain.basicauth %} + {{ basicauth_configuration(subdomain_basicauth_uuids) }} + {% endif %} - {% set subdomain_basicauth_uuids = subdomain.basicauth %} - {{ basicauth_configuration(subdomain_basicauth_uuids) }} + {% if subdomain.accesslist %} + {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', subdomain.accesslist) | first %} + {{ access_list_configuration(accesslist, accesslist.accesslistInvert|default("0") == "1") }} + handle @{{ accesslist['@uuid'] }} { + + {% set subdomain_basicauth_uuids = subdomain.basicauth %} + {{ basicauth_configuration(subdomain_basicauth_uuids) }} + + {% set subdomain_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('subdomain', 'equalto', subdomain['@uuid']) | list %} + {% for handle in subdomain_handles %} + {% if handle.enabled|default("0") == "1" and handle.HandlePath %} + {{ reverse_proxy_configuration(handle) }} + {% endif %} + {% endfor %} + {% for handle in subdomain_handles %} + {% if handle.enabled|default("0") == "1" and not handle.HandlePath %} + {{ reverse_proxy_configuration(handle) }} + {% endif %} + {% endfor %} + } + {% else %} + {% set subdomain_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('subdomain', 'equalto', subdomain['@uuid']) | list %} + {% for handle in subdomain_handles %} + {% if handle.enabled|default("0") == "1" and handle.HandlePath %} + {{ reverse_proxy_configuration(handle) }} + {% endif %} + {% endfor %} + {% for handle in subdomain_handles %} + {% if handle.enabled|default("0") == "1" and not handle.HandlePath %} + {{ reverse_proxy_configuration(handle) }} + {% endif %} + {% endfor %} + {% endif %} - {% set subdomain_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('subdomain', 'equalto', subdomain['@uuid']) | list %} - {% for handle in subdomain_handles %} - {% if handle.enabled|default("0") == "1" and handle.HandlePath %} - {{ reverse_proxy_configuration(handle) }} - {% endif %} - {% endfor %} - {% for handle in subdomain_handles %} - {% if handle.enabled|default("0") == "1" and not handle.HandlePath %} - {{ reverse_proxy_configuration(handle) }} - {% endif %} + {% if subdomain.accesslist %} + {% if accesslist.HttpResponseCode or accesslist.HttpResponseMessage %} + respond {{ '"' + accesslist.HttpResponseMessage|default('') + '"' if accesslist.HttpResponseMessage else '' }} {{ accesslist.HttpResponseCode|default(403) }} + {% elif Pischem.caddy.general.abort|default("0") == "1" %} + abort + {% endif %} + {% else %} + {% if Pischem.caddy.general.abort|default("0") == "1" %} + abort + {% endif %} + {% endif %} + } + {% endif %} {% endfor %} - } - {% else %} - {% set subdomain_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('subdomain', 'equalto', subdomain['@uuid']) | list %} - {% for handle in subdomain_handles %} - {% if handle.enabled|default("0") == "1" and handle.HandlePath %} - {{ reverse_proxy_configuration(handle) }} - {% endif %} - {% endfor %} - {% for handle in subdomain_handles %} - {% if handle.enabled|default("0") == "1" and not handle.HandlePath %} - {{ reverse_proxy_configuration(handle) }} - {% endif %} - {% endfor %} - {% endif %} - {% if subdomain.accesslist %} - {% if accesslist.HttpResponseCode or accesslist.HttpResponseMessage %} - respond {{ '"' + accesslist.HttpResponseMessage|default('') + '"' if accesslist.HttpResponseMessage else '' }} {{ accesslist.HttpResponseCode|default(403) }} - {% elif Pischem.caddy.general.abort|default("0") == "1" %} - abort - {% endif %} - {% else %} - {% if Pischem.caddy.general.abort|default("0") == "1" %} - abort + {% if reverse.accesslist %} + {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', reverse.accesslist) | first %} + {{ access_list_configuration(accesslist, accesslist.accesslistInvert|default("0") == "1") }} + handle @{{ accesslist['@uuid'] }} { + + {% set basicauth_uuids = reverse.basicauth %} + {{ basicauth_configuration(basicauth_uuids) }} + + {% set wildcard_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('reverse', 'equalto', reverse['@uuid']) | selectattr('subdomain', 'undefined') | list %} + {% for handle in wildcard_handles %} + {% if handle.enabled|default("0") == "1" and handle.HandlePath %} + {{ reverse_proxy_configuration(handle) }} + {% endif %} + {% endfor %} + {% for handle in wildcard_handles %} + {% if handle.enabled|default("0") == "1" and not handle.HandlePath %} + {{ reverse_proxy_configuration(handle) }} + {% endif %} + {% endfor %} + } + {% else %} + {% set wildcard_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('reverse', 'equalto', reverse['@uuid']) | selectattr('subdomain', 'undefined') | list %} + {% for handle in wildcard_handles %} + {% if handle.enabled|default("0") == "1" and handle.HandlePath %} + {{ reverse_proxy_configuration(handle) }} + {% endif %} + {% endfor %} + {% for handle in wildcard_handles %} + {% if handle.enabled|default("0") == "1" and not handle.HandlePath %} + {{ reverse_proxy_configuration(handle) }} + {% endif %} + {% endfor %} {% endif %} - {% endif %} - } - {% endif %} - {% endfor %} - - {% if reverse.accesslist %} - {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', reverse.accesslist) | first %} - {{ access_list_configuration(accesslist, accesslist.accesslistInvert|default("0") == "1") }} - handle @{{ accesslist['@uuid'] }} { - {% set basicauth_uuids = reverse.basicauth %} - {{ basicauth_configuration(basicauth_uuids) }} - - {% set wildcard_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('reverse', 'equalto', reverse['@uuid']) | selectattr('subdomain', 'undefined') | list %} - {% for handle in wildcard_handles %} - {% if handle.enabled|default("0") == "1" and handle.HandlePath %} - {{ reverse_proxy_configuration(handle) }} - {% endif %} - {% endfor %} - {% for handle in wildcard_handles %} - {% if handle.enabled|default("0") == "1" and not handle.HandlePath %} - {{ reverse_proxy_configuration(handle) }} - {% endif %} - {% endfor %} - } - {% else %} - {% set wildcard_handles = helpers.toList('Pischem.caddy.reverseproxy.handle') | selectattr('reverse', 'equalto', reverse['@uuid']) | selectattr('subdomain', 'undefined') | list %} - {% for handle in wildcard_handles %} - {% if handle.enabled|default("0") == "1" and handle.HandlePath %} - {{ reverse_proxy_configuration(handle) }} - {% endif %} - {% endfor %} - {% for handle in wildcard_handles %} - {% if handle.enabled|default("0") == "1" and not handle.HandlePath %} - {{ reverse_proxy_configuration(handle) }} - {% endif %} - {% endfor %} - {% endif %} - - {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', reverse.accesslist) | first %} - {% if accesslist %} - {% if accesslist.HttpResponseCode or accesslist.HttpResponseMessage %} - respond {{ '"' + accesslist.HttpResponseMessage|default('') + '"' if accesslist.HttpResponseMessage else '' }} {{ accesslist.HttpResponseCode|default(403) }} - {% elif Pischem.caddy.general.abort|default("0") == "1" %} - abort - {% endif %} - {% else %} - {% if Pischem.caddy.general.abort|default("0") == "1" %} - abort - {% endif %} + {% set accesslist = helpers.toList('Pischem.caddy.reverseproxy.accesslist') | selectattr('@uuid', 'equalto', reverse.accesslist) | first %} + {% if accesslist %} + {% if accesslist.HttpResponseCode or accesslist.HttpResponseMessage %} + respond {{ '"' + accesslist.HttpResponseMessage|default('') + '"' if accesslist.HttpResponseMessage else '' }} {{ accesslist.HttpResponseCode|default(403) }} + {% elif Pischem.caddy.general.abort|default("0") == "1" %} + abort + {% endif %} + {% else %} + {% if Pischem.caddy.general.abort|default("0") == "1" %} + abort + {% endif %} + {% endif %} + } {% endif %} -} -{% endif %} {% endfor %} import /usr/local/etc/caddy/caddy.d/*.conf diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/rc.conf.d/caddy b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/rc.conf.d/caddy index 503f7da6f0..d8ab2eda2c 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/rc.conf.d/caddy +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/rc.conf.d/caddy @@ -1,13 +1,8 @@ # DO NOT EDIT THIS FILE -- OPNsense auto-generated file -{% if helpers.exists('Pischem.caddy.general.enabled') %} - {%- set general_enabled = helpers.toList('Pischem.caddy.general.enabled') | first %} - {%- if general_enabled == '1' %} +{% set generalSettings = helpers.getNodeByTag('Pischem.caddy.general') %} +{% if generalSettings.enabled|default("0") == "1" %} caddy_enable="YES" -# Path to the Caddy setup script caddy_setup="/usr/local/opnsense/scripts/OPNsense/Caddy/setup.sh" - {%- else %} -caddy_enable="NO" - {%- endif %} -{%- else %} +{% else %} caddy_enable="NO" {% endif %} From e6dfbfd751ace7a42bf03ec04ba3665af14b70f5 Mon Sep 17 00:00:00 2001 From: Jordan Stacy <53239541+jordanstacy@users.noreply.github.com> Date: Wed, 10 Jul 2024 22:03:02 -0700 Subject: [PATCH 1960/3088] dns/bind: fix handling of multiple ACLs in allow-recursion (#4085) Same fix as #4048 but for allow-recursion --- .../src/opnsense/service/templates/OPNsense/Bind/named.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf index 8c02915ed9..d479cfa163 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/named.conf @@ -49,7 +49,7 @@ options { {% if helpers.exists('OPNsense.bind.general.recursion') and OPNsense.bind.general.recursion != '' %} recursion yes; allow-recursion { -{% for acl in helpers.toList('OPNsense.bind.general.recursion') %} +{% for acl in OPNsense.bind.general.recursion.split(',') %} {% set recursion_acl = helpers.getUUID(acl) %} {{ recursion_acl.name }}; {% endfor %} From a5b075f5ebf58b47a4a861128fe007a7d50e6883 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 11 Jul 2024 07:05:14 +0200 Subject: [PATCH 1961/3088] dns/bind: document previous --- dns/bind/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index e764e3b888..fde7fab7c0 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -12,7 +12,7 @@ Plugin Changelog 1.32 * Fix handling of multiple ACLs in allow-query/allow-transfer (contributed by Nathan Rennie-Waldock) -* Fix multiple select on Recursion field (contributed by Jordan Stacy) +* Fix multiple select on Recursion field and resulting multiple ACLs (contributed by Jordan Stacy) 1.31 From 4895e3bb833a60035ad1852f959208c4d7e05d95 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:32:20 +0200 Subject: [PATCH 1962/3088] www/caddy: Fix CaddyCertificate.js not loading (#4091) There were two ajaxGet, and I forgot to rename one into ajaxCall. --- www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js b/www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js index 051fc2bc19..8ad40f3df1 100644 --- a/www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js +++ b/www/caddy/src/opnsense/www/js/widgets/CaddyCertificate.js @@ -59,7 +59,7 @@ export default class CaddyCertificate extends BaseTableWidget { } // Fetch the certificate details - const response = await this.ajaxGet('/api/caddy/diagnostics/certificate'); + const response = await this.ajaxCall('/api/caddy/diagnostics/certificate'); if (response.status !== "success") { this.displayError(`${this.translations.nocerts}`); return; From d226cfcc11070a62bf344a429eb70bb67e981533 Mon Sep 17 00:00:00 2001 From: txr13 Date: Sun, 14 Jul 2024 13:32:23 -0700 Subject: [PATCH 1963/3088] security/acme-client: fix EasyDNS variable assignment (#4068) * fix EasyDNS variable assignment Changes an undeclared constant to a quoted string. Also fixes some (very minor) capitalization. --- .../OPNsense/AcmeClient/forms/dialogValidation.xml | 2 +- .../library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml index 6ec14b57b4..cffde71fd3 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/forms/dialogValidation.xml @@ -1471,7 +1471,7 @@
    validation.dns_easydns_apikey - + password diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php index 59d4a759ad..47f8420ee3 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/DnsEasydns.php @@ -2,6 +2,7 @@ /* * Copyright (C) 2023 mleinart + * Copyright (C) 2024 txr13 * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,7 +40,7 @@ class DnsEasydns extends Base implements LeValidationInterface { public function prepare() { - $this->acme_env[EASYDNS_Key] = (string)$this->config->dns_easydns_apikey; - $this->acme_env[EASYDNS_Token] = (string)$this->config->dns_easydns_apitoken; + $this->acme_env['EASYDNS_Key'] = (string)$this->config->dns_easydns_apikey; + $this->acme_env['EASYDNS_Token'] = (string)$this->config->dns_easydns_apitoken; } } From e3cebacad73374d7fa1603f190d6b0472aefdf40 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 14 Jul 2024 22:56:25 +0200 Subject: [PATCH 1964/3088] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- security/acme-client/pkg-descr | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 8d3f7bf9f7..d4b6e46e62 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 4.3 +PLUGIN_VERSION= 4.4 PLUGIN_COMMENT= ACME Client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon diff --git a/security/acme-client/pkg-descr b/security/acme-client/pkg-descr index 079dd73b07..fc19354bf1 100644 --- a/security/acme-client/pkg-descr +++ b/security/acme-client/pkg-descr @@ -8,6 +8,11 @@ WWW: https://github.com/acmesh-official/acme.sh Plugin Changelog ================ +4.4 + +Fixed: +* fix EasyDNS variable assignment (#4068) + 4.3 Fixed: From 6639e29302a9ba2fa46611d734259d9b2e37fcd4 Mon Sep 17 00:00:00 2001 From: Stephan de Wit Date: Mon, 15 Jul 2024 10:41:13 +0200 Subject: [PATCH 1965/3088] dec-hw: move to new widget implementation --- .../OPNsense/dechw/Api/InfoController.php | 11 +- .../src/opnsense/www/js/widgets/DecHW.js | 100 ++++++++++++++++++ .../www/js/widgets/Metadata/DecHW.xml | 15 +++ .../dec-hw/src/www/widgets/include/dechw.inc | 3 - .../src/www/widgets/widgets/dechw.widget.php | 94 ---------------- 5 files changed, 116 insertions(+), 107 deletions(-) create mode 100644 sysutils/dec-hw/src/opnsense/www/js/widgets/DecHW.js create mode 100644 sysutils/dec-hw/src/opnsense/www/js/widgets/Metadata/DecHW.xml delete mode 100644 sysutils/dec-hw/src/www/widgets/include/dechw.inc delete mode 100644 sysutils/dec-hw/src/www/widgets/widgets/dechw.widget.php diff --git a/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php b/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php index ad0393ba4f..66b819c93b 100644 --- a/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php +++ b/sysutils/dec-hw/src/opnsense/mvc/app/controllers/OPNsense/dechw/Api/InfoController.php @@ -35,20 +35,11 @@ class InfoController extends ApiControllerBase { public function powerStatusAction() { - $result = [ - "status" => "failed", - "status_translated" => gettext("Power status could not be fetched. - This widget is only applicable to Deciso hardware with dual power supplies.") - ]; + $result = ["status" => "failed"]; $status = parse_ini_string((new Backend())->configdRun('dechw power')); if (!empty($status)) { $result["status"] = "OK"; - unset($result["status_translated"]); - - foreach (['pwr1', 'pwr2'] as $key) { - $result[$key . '_translated'] = $status[$key] === '1' ? gettext('On') : gettext('Off'); - } $result = array_merge($result, $status); } diff --git a/sysutils/dec-hw/src/opnsense/www/js/widgets/DecHW.js b/sysutils/dec-hw/src/opnsense/www/js/widgets/DecHW.js new file mode 100644 index 0000000000..a5657599b5 --- /dev/null +++ b/sysutils/dec-hw/src/opnsense/www/js/widgets/DecHW.js @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2024 Deciso B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import BaseWidget from "./BaseWidget.js"; + +export default class DecHW extends BaseWidget { + constructor() { + super(); + } + + getMarkup() { + const styles = ` + #status { + margin: 10px; + } + .power { + margin: 5px; + float: right; + } + .power:hover { + opacity: 0.5; + } + .pwr-container { + margin: 5px; + display: flex; + justify-content: center; + align-items: center; + } + .data-item { + padding: 10px; + border: 1px solid #ddd; + margin: 5px; + width: 50%; + display: inline-block; + } + `; + + const styleSheet = document.createElement("style"); + styleSheet.innerText = styles; + document.head.appendChild(styleSheet); + + return $(` +
    +
    +
    + ${this.translations.powersupply} 1 +
    +
    + ${this.translations.powersupply} 2 +
    +
    + `); + } + + async onWidgetTick() { + $('.power').tooltip('hide'); + let data = await this.ajaxCall('/api/dechw/info/powerStatus'); + + if (!data || data.status === 'failed') { + $('#status').html(`
    ${this.translations.nopower}
    `); + $('.pwr-container').hide(); + return; + } + + $('.power').remove(); + ['pwr1', 'pwr2'].forEach((key) => { + let status = data[key]; + + let $power = $(``); + $power.css('color', status === '1' ? 'blue' : 'red'); + $power.attr('title', status === '1' ? this.translations.poweron : this.translations.poweroff); + $(`#${key}`).append($power); + }); + + $('.power').tooltip({container: 'body'}); + } +} \ No newline at end of file diff --git a/sysutils/dec-hw/src/opnsense/www/js/widgets/Metadata/DecHW.xml b/sysutils/dec-hw/src/opnsense/www/js/widgets/Metadata/DecHW.xml new file mode 100644 index 0000000000..a059d6edb1 --- /dev/null +++ b/sysutils/dec-hw/src/opnsense/www/js/widgets/Metadata/DecHW.xml @@ -0,0 +1,15 @@ + + + DecHW.js + + /api/dechw/info/powerStatus + + + Deciso Hardware Information + Power status could not be fetched. This widget is only applicable to Deciso hardware with dual power supplies. + Power is on + Power is off + Power Supply + + + \ No newline at end of file diff --git a/sysutils/dec-hw/src/www/widgets/include/dechw.inc b/sysutils/dec-hw/src/www/widgets/include/dechw.inc deleted file mode 100644 index 64b6114020..0000000000 --- a/sysutils/dec-hw/src/www/widgets/include/dechw.inc +++ /dev/null @@ -1,3 +0,0 @@ - - - - - - -
    -
    -
    - -
    -
    - -
    -
    From 2478471b2a9ebb9aca8b074512a41a191e949137 Mon Sep 17 00:00:00 2001 From: Stephan de Wit Date: Mon, 15 Jul 2024 10:54:19 +0200 Subject: [PATCH 1966/3088] security/etpro-telemetry - change GET to ajaxCall --- .../src/opnsense/www/js/widgets/ETProTelemetry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/etpro-telemetry/src/opnsense/www/js/widgets/ETProTelemetry.js b/security/etpro-telemetry/src/opnsense/www/js/widgets/ETProTelemetry.js index 8e351a2bbc..98456802f3 100644 --- a/security/etpro-telemetry/src/opnsense/www/js/widgets/ETProTelemetry.js +++ b/security/etpro-telemetry/src/opnsense/www/js/widgets/ETProTelemetry.js @@ -42,7 +42,7 @@ export default class ETProTelemetry extends BaseTableWidget { } async onWidgetTick() { - const data = await this.ajaxGet('/api/diagnostics/proofpoint_et/status'); + const data = await this.ajaxCall('/api/diagnostics/proofpoint_et/status'); if (data['sensor_status'] == 'active') { $('#etpro_sensor_status').text(data['sensor_status']); $('#etpro_event_received').text(data['event_received']); From 46165c9ad7f4d6ac674e92a29b260f70c8c892a6 Mon Sep 17 00:00:00 2001 From: kulikov-a <36099472+kulikov-a@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:17:15 +0300 Subject: [PATCH 1967/3088] www/nginx: 1.34 (#4092) * server handshakes log opt out * http2 server push have been made obsolete from nginx 1.25.1 (https://nginx.org/en/CHANGES) *) Feature: the "http2" directive, which enables HTTP/2 on a per-server basis; the "http2" parameter of the "listen" directive is now deprecated. *) Change: HTTP/2 server push support has been removed. * 'listen ... http2' directive is deprecated migrate to http2 directive * ver bump and descr --- www/nginx/Makefile | 2 +- www/nginx/pkg-descr | 6 ++++++ .../controllers/OPNsense/Nginx/forms/httpserver.xml | 7 +++++++ .../app/controllers/OPNsense/Nginx/forms/location.xml | 6 ------ .../opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml | 10 +++++----- .../service/templates/OPNsense/Nginx/http.conf | 6 ++++-- .../service/templates/OPNsense/Nginx/location.conf | 1 - .../service/templates/OPNsense/Nginx/webgui.conf | 4 ++-- 8 files changed, 25 insertions(+), 17 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index 0b76a782ff..5309f48ac8 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.33 +PLUGIN_VERSION= 1.34 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr index 661bb49eb7..476eb0962f 100644 --- a/www/nginx/pkg-descr +++ b/www/nginx/pkg-descr @@ -10,6 +10,12 @@ WWW: https://nginx.org/ Plugin Changelog ================ +1.34 + +* Add the option to not log TLS handshakes +* Remove obsolete http2_push_preload directive +* Migrate from the deprecated 'listen … http2' directive to the 'http2' directive + 1.33 * Add the "resolver" directive support diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml index b3ad135282..33cf1ce522 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/httpserver.xml @@ -142,6 +142,13 @@ Select Error Log Level. Log levels are listed in the order of increasing verbosity. Setting a certain log level will cause all messages of the specified and more severe log levels to be logged. true
    + + httpserver.log_handshakes + + checkbox + Log TLS handshakes to fill the User Agent fingerprint database and detect MITM attacks. + true + httpserver.enable_acme_support diff --git a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml index 25c998c75d..c5ad998275 100644 --- a/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml +++ b/www/nginx/src/opnsense/mvc/app/controllers/OPNsense/Nginx/forms/location.xml @@ -206,12 +206,6 @@ checkbox If the request scheme is not HTTPS, redirect to use HTTPS for this location. - - location.http2_push_preload - - checkbox - If you check this box, you can use the link header to send resources to the client before they are requested. You can boost your performance with this setting. This requires that your application sets the "Link" header correctly. - location.php_enable diff --git a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml index 81f686682a..6921fbacd9 100644 --- a/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml +++ b/www/nginx/src/opnsense/mvc/app/models/OPNsense/Nginx/Nginx.xml @@ -1,6 +1,6 @@ //OPNsense/Nginx - 1.33 + 1.34 nginx web server, reverse proxy and waf @@ -515,10 +515,6 @@ N 1 - - Y - 0 - Y - N - 1 + 1 Y - - N - + - 86400 + 86400 Y 60 86400 Set a value between 60 and 86400. - 21600 + 21600 Y 60 86400 Set a value between 60 and 86400. - 3600 + 3600 Y 60 86400 Set a value between 60 and 86400. - 3542400 + 3542400 Y 60 10000000 Set a value between 60 and 10000000. - 3600 + 3600 Y 60 86400 Set a value between 60 and 86400. - mail.opnsense.localdomain + mail.opnsense.localdomain Y - opnsense.localdomain + opnsense.localdomain Y diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml index 9935dbae45..72e771fbc8 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/General.xml @@ -4,73 +4,67 @@ 1.0.12 - 0 + 0 Y - 0 + 0 Y - 1 + 1 Y - 0.0.0.0 + 0.0.0.0 , Y Y - :: + :: , Y Y - N ipv4 N - N ipv6 N - N ipv4 N - N ipv6 N - 53530 + 53530 Y , - N Y - 0 + 0 Y - 0 + 0 Y , - N Y - 5 + 5 Y 1 1000 @@ -87,10 +81,10 @@ Dynamic
    Y - info + info - 80 + 80 Y 1 99 @@ -105,7 +99,6 @@ Y - N Choose an ACL. @@ -117,7 +110,6 @@ Y - N @@ -128,48 +120,45 @@ Y - N No Auto - no - N + no Y - 0 + 0 Y - 0 + 0 Y - 0 + 0 Y - 0 + 0 Y - N 1 1000 Choose a value between 1 and 1000. - 0.0.0.0,:: + 0.0.0.0,:: , Y Y Y - hmac-sha256 + hmac-sha256 HMAC-SHA512 HMAC-SHA384 @@ -181,7 +170,7 @@ Y - VxtIzJevSQXqnr7h2qerrcwjnZlMWSGGFBndKeNIDfw= + VxtIzJevSQXqnr7h2qerrcwjnZlMWSGGFBndKeNIDfw= diff --git a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Record.xml b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Record.xml index 2e806041ce..ccb589cbfa 100644 --- a/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Record.xml +++ b/dns/bind/src/opnsense/mvc/app/models/OPNsense/Bind/Record.xml @@ -6,7 +6,7 @@ - 1 + 1 Y @@ -19,12 +19,9 @@ - - - N - + - A + A Y A From 7faded335d3880cac2cffb7ddf4039b75bd5f7b2 Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:09:49 +0200 Subject: [PATCH 2103/3088] www/caddy: Handler and other dialogue form cleanup (#4242) * www/caddy: Cleanup Handle, Domain and Layer4 dialogue. Convert all TLS checkboxes to dropdowns for consistency. * www/caddy: Remove all hints from forms that do not imply a default value. Change the position of some options. Improve some help texts. * www/caddy: Refactor dialogHandler to hide options based on selections or inside advanced mode. * www/caddy: Remove boldness from tabs since it renders strange in some browsers. Change spot of HttpTls in handler. * www/caddy: Add Access header with advanced mode. * www/caddy: Final touches on the improved dialogHandle. * www/caddy: Changelog * www/caddy: Access is inside handler * www/caddy: Caddy Domains widget opens links to domains in new tab. * www/caddy: Improve Domain and Subdomain dialogue, rename Bootgrid options for consistency. * www/caddy: Mark ACME as default. * www/caddy: Last tweaks to dialogDomain. --- www/caddy/Makefile | 3 +- www/caddy/pkg-descr | 7 + .../OPNsense/Caddy/forms/dialogAccessList.xml | 2 - .../OPNsense/Caddy/forms/dialogHandle.xml | 124 +++++++++--------- .../OPNsense/Caddy/forms/dialogHeader.xml | 2 - .../OPNsense/Caddy/forms/dialogLayer4.xml | 32 ++--- .../Caddy/forms/dialogReverseProxy.xml | 59 ++++----- .../OPNsense/Caddy/forms/dialogSubdomain.xml | 29 ++-- .../OPNsense/Caddy/forms/general.xml | 12 +- .../mvc/app/models/OPNsense/Caddy/Caddy.xml | 31 +++-- .../app/views/OPNsense/Caddy/diagnostics.volt | 4 - .../views/OPNsense/Caddy/reverse_proxy.volt | 57 +++++--- .../opnsense/www/js/widgets/CaddyDomain.js | 2 +- 13 files changed, 199 insertions(+), 165 deletions(-) diff --git a/www/caddy/Makefile b/www/caddy/Makefile index 0a0183dace..2581e24c63 100644 --- a/www/caddy/Makefile +++ b/www/caddy/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= caddy -PLUGIN_VERSION= 1.7.0 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.7.1 PLUGIN_DEPENDS= caddy-custom PLUGIN_COMMENT= Modern Reverse Proxy with Automatic HTTPS, Dynamic DNS and Layer4 Routing PLUGIN_MAINTAINER= cedrik@pischem.com diff --git a/www/caddy/pkg-descr b/www/caddy/pkg-descr index 38f7cbb899..8f4f1679f2 100644 --- a/www/caddy/pkg-descr +++ b/www/caddy/pkg-descr @@ -13,6 +13,13 @@ DOC: https://docs.opnsense.org/manual/how-tos/caddy.html Plugin Changelog ================ +1.7.1 + +* Add: Frontend HTTP Version can be selected in General Settings, can be used to disable QUIC protocol +* Change: Caddy Domains widget will now open links to managed websites in new browser tabs +* Cleanup: TLS checkboxes have been converted to dropdowns with http/https for clarity +* Cleanup: Layer4, Domain and Handle dialogues have been cleaned up, some options are now hidden in advanced mode + 1.7.0 * Add: Layer4 protocols: DNS diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogAccessList.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogAccessList.xml index 0d51368f6a..b38f500fdb 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogAccessList.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogAccessList.xml @@ -23,14 +23,12 @@ accesslist.HttpResponseCode text - 403 accesslist.HttpResponseMessage text - Forbidden diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml index 85ac5b0c46..b8402eccac 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml @@ -5,6 +5,16 @@ checkbox + + handle.description + + text + + + + header + + handle.reverse @@ -15,59 +25,80 @@ handle.subdomain dropdown + - - handle.description - - text - - header - - true + + true handle.HandleType - + dropdown - + + true handle.HandlePath - + text - + any + + true header - true + true handle.ForwardAuth checkbox + true header - true + true handle.header - + dropdown select_multiple 5 - + + true header + + handle.HttpVersion + + dropdown + + true + + + handle.HttpKeepalive + + text + 120 + + true + + + handle.HttpTls + + dropdown + + handle.ToDomain @@ -75,7 +106,7 @@ true 192.168.1.1 - + handle.ToPort @@ -88,71 +119,42 @@ handle.ToPath text - + true - - handle.HttpTlsInsecureSkipVerify - - checkbox - - - - header - - true - handle.PassiveHealthFailDuration text + true - header - - true - - - handle.HttpVersion - - dropdown - - - - handle.HttpKeepalive - - text - 120 - - - - header - - true - - - handle.HttpTls - - checkbox - - - - handle.HttpNtlm - + handle.HttpTlsInsecureSkipVerify + checkbox - + + handle.HttpTlsTrustedCaCerts dropdown + handle.HttpTlsServerName text + + + handle.HttpNtlm + + checkbox + + + diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHeader.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHeader.xml index 070e8b6038..df19819f0c 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHeader.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHeader.xml @@ -8,14 +8,12 @@ header.HeaderType - Host text header.HeaderValue - {upstream_hostport} text diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogLayer4.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogLayer4.xml index bbc7d6b308..acac47c8cb 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogLayer4.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogLayer4.xml @@ -5,6 +5,16 @@ checkbox + + layer4.description + + text + + + + header + + layer4.FromDomain @@ -19,6 +29,10 @@ dropdown + + header + + layer4.ToDomain @@ -33,33 +47,19 @@ text - - layer4.description - - text - - - - header - - true - layer4.PassiveHealthFailDuration text - - - header - - true + true layer4.ProxyProtocol dropdown + true header diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogReverseProxy.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogReverseProxy.xml index 56f2562ddf..5cba4c1a26 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogReverseProxy.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogReverseProxy.xml @@ -5,18 +5,28 @@ checkbox + + reverse.description + + text + + + + header + + reverse.DisableTls dropdown - + reverse.FromDomain text example.com - + reverse.FromPort @@ -26,44 +36,31 @@ - reverse.description - - text - - - - header - - true - - - reverse.DynDns - - checkbox - + reverse.CustomCertificate + + dropdown + + - header - - true + reverse.AcmePassthrough + + text + + true reverse.DnsChallenge checkbox - - - - reverse.CustomCertificate - - dropdown - + + - reverse.AcmePassthrough - - text - + reverse.DynDns + + checkbox + header diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogSubdomain.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogSubdomain.xml index 49e3b51a04..8711c4a968 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogSubdomain.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogSubdomain.xml @@ -5,6 +5,16 @@ checkbox + + subdomain.description + + text + + + + header + + subdomain.reverse @@ -16,18 +26,7 @@ text opn.example.com - - - - subdomain.description - - text - - - - header - - true + subdomain.DynDns @@ -35,16 +34,12 @@ checkbox - - header - - true - subdomain.AcmePassthrough text + true header diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/general.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/general.xml index beb0b5ef18..09ef4f2ab7 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/general.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/general.xml @@ -211,6 +211,12 @@ dropdown + + caddy.general.AuthToTls + + dropdown + + caddy.general.AuthToDomain @@ -223,12 +229,6 @@ text - - caddy.general.AuthToTls - - checkbox - - caddy.general.AuthToUri diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index 243b323b06..e489d2f6e0 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -157,7 +157,14 @@ - + + Y + 0 + + http:// + https:// + + /^(\/.*)?$/u Please enter a valid 'URI' that starts with '/'. @@ -199,7 +206,9 @@ - + + ACME (HTTP-01, TLS-ALPN-01) + @@ -207,8 +216,8 @@ Y 0 - HTTPS (default) - HTTP + https:// + http:// @@ -269,8 +278,8 @@ OPNsense.Caddy.Caddy reverseproxy.reverse - FromDomain,FromPort - %s %s + DisableTls,FromDomain,FromPort + %s%s %s @@ -324,10 +333,16 @@ Please enter a value between 1 to 100. - + + Y + 0 + + http:// + https:// + - TLS and NTLM must be enabled at the same time. + HTTPS and NTLM must be enabled at the same time. DependConstraint HttpNtlm diff --git a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/diagnostics.volt b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/diagnostics.volt index 259c6e141f..4d9a3dc9f8 100644 --- a/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/diagnostics.volt +++ b/www/caddy/src/opnsense/mvc/app/views/OPNsense/Caddy/diagnostics.volt @@ -133,10 +133,6 @@