mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
security/acme-client: avoid including interfaces.inc in MVC, use proper function/flow
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
PLUGIN_NAME= acme-client
|
||||
PLUGIN_VERSION= 3.19
|
||||
PLUGIN_REVISION= 1
|
||||
PLUGIN_COMMENT= ACME Client
|
||||
PLUGIN_MAINTAINER= opnsense@moov.de
|
||||
PLUGIN_DEPENDS= acme.sh py${PLUGIN_PYTHON}-dns-lexicon
|
||||
|
||||
+4
-5
@@ -28,8 +28,6 @@
|
||||
|
||||
namespace OPNsense\AcmeClient\LeValidation;
|
||||
|
||||
require_once("interfaces.inc");
|
||||
|
||||
use OPNsense\AcmeClient\LeValidationInterface;
|
||||
use OPNsense\AcmeClient\LeUtils;
|
||||
use OPNsense\Core\Config;
|
||||
@@ -74,9 +72,10 @@ class HttpOpnsense extends Base implements LeValidationInterface
|
||||
|
||||
// Add IP address from chosen interface
|
||||
if (!empty((string)$this->config->http_opn_interface)) {
|
||||
$interface_ip = get_interface_ip((string)$this->config->http_opn_interface);
|
||||
if (!empty($interface_ip)) {
|
||||
$iplist[] = $interface_ip;
|
||||
$backend = new \OPNsense\Core\Backend();
|
||||
$response = $backend->configdpRun('interface address', [(string)$this->config->http_opn_interface]);
|
||||
if (!empty($response['address'])) {
|
||||
$iplist[] = $response['address'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -28,8 +28,6 @@
|
||||
|
||||
namespace OPNsense\AcmeClient\LeValidation;
|
||||
|
||||
require_once("interfaces.inc");
|
||||
|
||||
use OPNsense\AcmeClient\LeValidationInterface;
|
||||
use OPNsense\AcmeClient\LeUtils;
|
||||
use OPNsense\Core\Config;
|
||||
@@ -75,9 +73,10 @@ class TlsalpnAcme extends Base implements LeValidationInterface
|
||||
|
||||
// Add IP address from chosen interface
|
||||
if (!empty((string)$this->config->tlsalpn_acme_interface)) {
|
||||
$interface_ip = get_interface_ip((string)$this->config->tlsalpn_acme_interface);
|
||||
if (!empty($interface_ip)) {
|
||||
$iplist[] = $interface_ip;
|
||||
$backend = new \OPNsense\Core\Backend();
|
||||
$response = $backend->configdpRun('interface address', [(string)$this->config->tlsalpn_acme_interface]);
|
||||
if (!empty($response['address'])) {
|
||||
$iplist[] = $response['address'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user