mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
www/caddy: Validation - When Auto HTTPS is enabled, an ACME Email address is required since caddy >=v2.8.0
This commit is contained in:
committed by
Franco Fichtner
parent
9329907cab
commit
fd067f3a36
@@ -141,6 +141,19 @@ class Caddy extends BaseModel
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Check for ACME Email being required when Auto HTTPS on
|
||||
private function checkAcmeEmailAutoHttps($messages) {
|
||||
$tlsAutoHttpsSetting = (string)$this->general->TlsAutoHttps;
|
||||
$tlsEmail = (string)$this->general->TlsEmail;
|
||||
|
||||
if (empty($tlsEmail) && $tlsAutoHttpsSetting !== 'off') {
|
||||
$messages->appendMessage(new Message(
|
||||
gettext('To use "Auto HTTPS", an email address is required.'),
|
||||
"general.TlsEmail"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Perform the actual validation
|
||||
public function performValidation($validateFullModel = false)
|
||||
{
|
||||
@@ -153,6 +166,8 @@ class Caddy extends BaseModel
|
||||
$this->checkSubdomainsAgainstDomains($this->reverseproxy->subdomain->iterateItems(), $this->reverseproxy->reverse->iterateItems(), $messages);
|
||||
// 4. Check WebGUI conflicts
|
||||
$this->checkWebGuiSettings($messages);
|
||||
// 5. Check for ACME Email requirement
|
||||
$this->checkAcmeEmailAutoHttps($messages);
|
||||
|
||||
return $messages;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user