Skip to content

Commit

Permalink
Check if all specified domains are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
imbrish committed Jun 25, 2018
1 parent e91ab7c commit 1f8df0c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/letsencrypt
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ if (Command::$result != EX_SUCCESS) {
// check, issue and setup certificates

$notifications = [];
$domains = [];

foreach ((array) $config['certificates'] as $certificate) {

Expand All @@ -341,6 +342,8 @@ foreach ((array) $config['certificates'] as $certificate) {
$domainNames = array_keys($domainsMap);
$domainPaths = array_values($domainsMap);

$domains += $domainNames;

// skip if domains omitted in the certificates argument

if ($config['only'] && ! array_intersect($domainNames, $config['only'])) {
Expand Down Expand Up @@ -477,6 +480,11 @@ foreach ((array) $config['certificates'] as $certificate) {
}
}

if ($missing = implode(', ', array_diff($config['only'], $domains))) {
$climate->to('error')->error("No certificates configured for domains: $missing!");
exit(EX_CONFIG_INVALID);
}

if ($notifications) {
sendNotification('New certificates were issued and/or installed.', implode(PHP_EOL, $notifications));
}
Expand Down

0 comments on commit 1f8df0c

Please sign in to comment.