mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Merge pull request #1546 from billgertz/patch-2
security/acme-client: Add support for --debug 2/ 3
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@
|
||||
<id>acmeclient.settings.logLevel</id>
|
||||
<label>Log Level</label>
|
||||
<type>dropdown</type>
|
||||
<help><![CDATA[Specifies the log level for acme.sh, default is "normal". All other log levels add information for debug purposes, but be aware that this will break the log formatting in the GUI.]]></help>
|
||||
<help><![CDATA[Specifies the log level for acme.sh, default is "normal". All other log levels add information for debug purposes, but be aware that this will break the log formatting in the GUI. Levels "debug 2" and "debug 3" log successively deeper log messages from the acme.sh including messages from DNS-01 DNSAPI scripts.]]></help>
|
||||
<advanced>true</advanced>
|
||||
</field>
|
||||
</form>
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
<normal>normal</normal>
|
||||
<extended>extended</extended>
|
||||
<debug>debug</debug>
|
||||
<debug2>debug 2</debug2>
|
||||
<debug3>debug 3</debug3>
|
||||
</OptionValues>
|
||||
</logLevel>
|
||||
</settings>
|
||||
|
||||
@@ -328,8 +328,18 @@ function eval_optional_acme_args()
|
||||
$acme_args[] = isset($options["S"]) ? "--staging" : null; // for debug purpose
|
||||
|
||||
// Set log level
|
||||
$acme_args[] = $configObj->OPNsense->AcmeClient->settings->logLevel == "normal" ? "--log-level 1" : "--log-level 2";
|
||||
$acme_args[] = $configObj->OPNsense->AcmeClient->settings->logLevel == "debug" ? "--debug" : null;
|
||||
switch($configObj->OPNsense->AcmeClient->settings->logLevel) {
|
||||
case "extended":
|
||||
$acme_args[] = "--log-level 2";
|
||||
case "debug":
|
||||
$acme_args[] = "--debug";
|
||||
case "debug2":
|
||||
$acme_args[] = "--debug 2";
|
||||
case "debug3":
|
||||
$acme_args[] = "--debug 3";
|
||||
default:
|
||||
$acme_args[] = "--log-level 1";
|
||||
}
|
||||
|
||||
// Remove empty and duplicate elements from array
|
||||
return(array_unique(array_filter($acme_args)));
|
||||
|
||||
Reference in New Issue
Block a user