mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
security/acme-client: check if BIND plugin is installed, refs #1491
This commit is contained in:
+18
@@ -390,4 +390,22 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check wether the BIND plugin is installed.
|
||||
* @return array status action
|
||||
*/
|
||||
public function getBindPluginStatusAction()
|
||||
{
|
||||
$result = array("result" => "0");
|
||||
|
||||
$mdlAcme = $this->getModel();
|
||||
|
||||
// Check if the required plugin is installed
|
||||
if ((string)$mdlAcme->isPluginInstalled('bind') == "1") {
|
||||
$result['result'] = "1";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-5
@@ -717,10 +717,6 @@
|
||||
<type>header</type>
|
||||
<style>table_dns table_dns_opnsense</style>
|
||||
</field>
|
||||
<field>
|
||||
<label>Please manually install and configure the bind plugin.</label>
|
||||
<type>info</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>validation.dns_opnsense_host</id>
|
||||
<label>OPNSense Server (FQDN)</label>
|
||||
@@ -730,7 +726,7 @@
|
||||
<id>validation.dns_opnsense_port</id>
|
||||
<label>OPNSense Server Port</label>
|
||||
<type>text</type>
|
||||
</field>
|
||||
</field>
|
||||
<field>
|
||||
<id>validation.dns_opnsense_key</id>
|
||||
<label>User API key </label>
|
||||
@@ -747,6 +743,15 @@
|
||||
<type>checkbox</type>
|
||||
<help>Uncheck this box if you have a valid certificate for your OPNsense interface.</help>
|
||||
</field>
|
||||
<field>
|
||||
<label>Action required</label>
|
||||
<type>header</type>
|
||||
<style>table_dns table_dns_opnsense bind_plugin_warning</style>
|
||||
</field>
|
||||
<field>
|
||||
<label><![CDATA[Please manually install the plugin "os-bind" to enable support for it.]]></label>
|
||||
<type>info</type>
|
||||
</field>
|
||||
<field>
|
||||
<label>OVH</label>
|
||||
<type>header</type>
|
||||
|
||||
@@ -381,7 +381,7 @@
|
||||
<dns_netcup>netcup DNS API</dns_netcup>
|
||||
<dns_nsone>NS1.com API</dns_nsone>
|
||||
<dns_nsupdate>nsupdate (RFC 2136)</dns_nsupdate>
|
||||
<dns_opnsense>OPNsense Bind Plugin</dns_opnsense>
|
||||
<dns_opnsense>OPNsense BIND Plugin</dns_opnsense>
|
||||
<dns_ovh>OVH, kimsufi, soyoustart and runabove API</dns_ovh>
|
||||
<dns_pdns>PowerDNS.com API</dns_pdns>
|
||||
<dns_selectel>selectel.com / selectel.ru domain API</dns_selectel>
|
||||
|
||||
@@ -62,6 +62,12 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
$(".gcloud_plugin_warning").hide();
|
||||
}
|
||||
});
|
||||
// Show a warning if the BIND plugin is missing.
|
||||
ajaxCall(url="/api/acmeclient/settings/getBindPluginStatus", sendData={}, callback=function(data,status) {
|
||||
if (data['result'] != 0) {
|
||||
$(".bind_plugin_warning").hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#validation\\.http_service").change(function(){
|
||||
var service_id = 'table_http_' + $(this).val();
|
||||
|
||||
@@ -829,6 +829,11 @@ function run_acme_validation($certObj, $valObj, $acctObj)
|
||||
$proc_env['NSUPDATE_SERVER'] = (string)$valObj->dns_nsupdate_server;
|
||||
break;
|
||||
case 'dns_opnsense':
|
||||
# BIND plugin must be installed.
|
||||
if ((string)$modelObj->isPluginInstalled('bind') != "1") {
|
||||
log_error("AcmeClient: BIND plugin is NOT installed. Please install os-bind.");
|
||||
return(1);
|
||||
}
|
||||
$proc_env['OPNs_Host'] = (string)$valObj->dns_opnsense_host;
|
||||
$proc_env['OPNs_Port'] = (string)$valObj->dns_opnsense_port;
|
||||
$proc_env['OPNs_Key'] = (string)$valObj->dns_opnsense_key;
|
||||
|
||||
Reference in New Issue
Block a user