From 03764dfc7419a2c69f5e79c74018e79519fc67e9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 28 Jul 2020 10:50:57 +0200 Subject: [PATCH] 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 b88f03b56..069d562f9 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 815b7c406..334c3b760 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 9ae4e6a7a..b50db1add 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 b12f8cf3d..000000000 --- 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 908838464..000000000 --- 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 e729939f6..000000000 --- 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 5e9878820..000000000 --- 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 66fa74857..000000000 --- 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 882e2aae9..000000000 --- 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 25bdb9e63..000000000 --- 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 6fd6fc607..000000000 --- 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 899ceb390..000000000 --- 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 181f635fd..000000000 --- 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 b8bd973ef..000000000 --- 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 5b537c08f..000000000 --- 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 32261d1a2..000000000 --- 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 9cc112378..000000000 --- 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 1ae1f590a..000000000 --- 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 eb53cf0e6..000000000 --- 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 dda6369f2..000000000 --- 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 f933ad687..000000000 --- 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 e354a4e12..000000000 --- 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 1166df58a..000000000 --- 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 a47edf32f..000000000 --- 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 8837f8fd7..000000000 --- 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 947a52761..000000000 --- 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 849bf8b10..000000000 --- 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 925e665f7..000000000 --- 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 4a7c54423..000000000 --- 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 adda8e3aa..000000000 --- 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 66848b2f3..000000000 --- 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 24ea3d3e1..000000000 --- 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 5a548e1a1..000000000 --- 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 993181556..000000000 --- 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 7ebe7351c..000000000 --- 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 da534b536..000000000 --- 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 782e5c9d8..000000000 --- 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 e4f037a79..000000000 --- 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 993181556..000000000 --- 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 b6b0d2dfb..000000000 --- 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 65a52c852..000000000 --- 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 fc66ffa68..000000000 --- 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 66e6d55d1..000000000 --- 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 993181556..000000000 --- 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 4c373668b..000000000 --- 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 43ec42644..000000000 --- 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); - } ?> -
-
-
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - -
- -
- -
-  () -
- - -
- - -
  - " /> - - - -
-
-
-
-
-
-
-
-