check dns for lets encrypt when adding/editing domains and via cron; fixes #971
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -24,6 +24,7 @@ class DomainsTest extends TestCase
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
$data = [
|
||||
'domain' => 'TEST.local',
|
||||
@@ -425,4 +426,25 @@ class DomainsTest extends TestCase
|
||||
'domainname' => 'उदाहरण.भारत'
|
||||
])->delete();
|
||||
}
|
||||
|
||||
public function testAdminDomainsAddDnsLetsEncryptFail()
|
||||
{
|
||||
global $admin_userdata;
|
||||
// get customer
|
||||
$json_result = Customers::getLocal($admin_userdata, array(
|
||||
'loginname' => 'test1'
|
||||
))->get();
|
||||
Settings::Set('system.le_domain_dnscheck', 1);
|
||||
$customer_userdata = json_decode($json_result, true)['data'];
|
||||
$data = [
|
||||
'domain' => 'no-dns.local',
|
||||
'customerid' => $customer_userdata['customerid'],
|
||||
'letsencrypt' => 1,
|
||||
'description' => 'no dns domain'
|
||||
];
|
||||
|
||||
$this->expectExceptionCode(400);
|
||||
$this->expectExceptionMessage('The domains DNS does not include any of the chosen IP addresses. Let\'s Encrypt certificate generation not possible.');
|
||||
Domains::getLocal($admin_userdata, $data)->add();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user