|
|
@ -136,11 +136,22 @@ class NginxVhostFactory |
|
|
|
->addMenuItem($checkbox) |
|
|
|
->addLineBreak('-'); |
|
|
|
|
|
|
|
if ($vhost['ssl']) { |
|
|
|
if ($vhost['ssl'] === true) { |
|
|
|
if ($vhost['ssl_certificate_exists']) { |
|
|
|
$builder->addStaticItem('expired_at: '.$vhost['ssl_certificate_expired_at']); |
|
|
|
} else { |
|
|
|
$builder->addStaticItem('no certificate'); |
|
|
|
$builder->addItem('add certificate', function(CliMenu $menu) { |
|
|
|
$result = $menu->askText() |
|
|
|
->setPromptText('Enter E-Mail') |
|
|
|
->ask(); |
|
|
|
|
|
|
|
$email = $result->fetch(); |
|
|
|
$this->call('lets-encrypt:add', [ 'email' => $email, 'domain' => $vhost['domain'] ]); |
|
|
|
|
|
|
|
if ($vhost['redirect_www'] === true) { |
|
|
|
$this->call('lets-encrypt:add', [ 'email' => $email, 'domain' => 'www.'.$vhost['domain'] ]); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
$builder->addLineBreak('-'); |
|
|
|