diff --git a/sysutils/hw-probe/Makefile b/sysutils/hw-probe/Makefile new file mode 100644 index 000000000..8ce8dff66 --- /dev/null +++ b/sysutils/hw-probe/Makefile @@ -0,0 +1,8 @@ +PLUGIN_NAME= hw-probe +PLUGIN_VERSION= 0.1 +PLUGIN_COMMENT= Collect hardware diagnostics +PLUGIN_DEPENDS= hw-probe +PLUGIN_MAINTAINER= m.muenz@gmail.com +PLUGIN_DEVEL= yes + +.include "../../Mk/plugins.mk" diff --git a/sysutils/hw-probe/pkg-descr b/sysutils/hw-probe/pkg-descr new file mode 100644 index 000000000..efb1be1a1 --- /dev/null +++ b/sysutils/hw-probe/pkg-descr @@ -0,0 +1 @@ +Send anonymized hardware diagnostics to https://bsd-hardware.info \ No newline at end of file diff --git a/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/Api/GeneralController.php b/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/Api/GeneralController.php new file mode 100644 index 000000000..41096f3bb --- /dev/null +++ b/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/Api/GeneralController.php @@ -0,0 +1,37 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Hwprobe\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class GeneralController extends ApiMutableModelControllerBase +{ + protected static $internalModelClass = '\OPNsense\Hwprobe\General'; + protected static $internalModelName = 'general'; +} diff --git a/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/Api/ServiceController.php b/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/Api/ServiceController.php new file mode 100644 index 000000000..8fd5e8d39 --- /dev/null +++ b/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/Api/ServiceController.php @@ -0,0 +1,51 @@ + + * 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\Hwprobe\Api; + +use OPNsense\Base\ApiMutableServiceControllerBase; +use OPNsense\Core\Backend; + +class ServiceController extends ApiMutableServiceControllerBase +{ + protected static $internalServiceClass = '\OPNsense\Hwprobe\General'; + protected static $internalServiceTemplate = 'OPNsense/Hwprobe'; + protected static $internalServiceEnabled = 'enabled'; + protected static $internalServiceName = 'hwprobe'; + + /** + * generate report + * @return array + */ + public function reportAction() + { + $backend = new Backend(); + $response = $backend->configdRun("hwprobe report"); + return array("response" => $response); + } +} diff --git a/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/GeneralController.php b/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/GeneralController.php new file mode 100644 index 000000000..1c9c039da --- /dev/null +++ b/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/GeneralController.php @@ -0,0 +1,38 @@ + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +namespace OPNsense\Hwprobe; + +class GeneralController extends \OPNsense\Base\IndexController +{ + public function indexAction() + { + $this->view->generalForm = $this->getForm('general'); + $this->view->pick('OPNsense/Hwprobe/general'); + } +} diff --git a/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/forms/general.xml b/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/forms/general.xml new file mode 100644 index 000000000..6b7782611 --- /dev/null +++ b/sysutils/hw-probe/src/opnsense/mvc/app/controllers/OPNsense/Hwprobe/forms/general.xml @@ -0,0 +1,8 @@ +
diff --git a/sysutils/hw-probe/src/opnsense/mvc/app/models/OPNsense/Hwprobe/ACL/ACL.xml b/sysutils/hw-probe/src/opnsense/mvc/app/models/OPNsense/Hwprobe/ACL/ACL.xml new file mode 100644 index 000000000..6e3f60689 --- /dev/null +++ b/sysutils/hw-probe/src/opnsense/mvc/app/models/OPNsense/Hwprobe/ACL/ACL.xml @@ -0,0 +1,9 @@ +