|
@ -140,17 +140,20 @@ class NginxVhostFactory |
|
|
if ($vhost['ssl_certificate_exists']) { |
|
|
if ($vhost['ssl_certificate_exists']) { |
|
|
$builder->addStaticItem('expired_at: '.$vhost['ssl_certificate_expired_at']); |
|
|
$builder->addStaticItem('expired_at: '.$vhost['ssl_certificate_expired_at']); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
// add certificate
|
|
|
$builder->addItem('add certificate', function(CliMenu $menu) { |
|
|
$builder->addItem('add certificate', function(CliMenu $menu) { |
|
|
$result = $menu->askText() |
|
|
$result = $menu->askText() |
|
|
->setPromptText('Enter E-Mail') |
|
|
->setPromptText('Enter E-Mail') |
|
|
->ask(); |
|
|
->ask(); |
|
|
|
|
|
|
|
|
$email = $result->fetch(); |
|
|
$email = $result->fetch(); |
|
|
$this->call('lets-encrypt:add', [ 'email' => $email, 'domain' => $vhost['domain'] ]); |
|
|
|
|
|
|
|
|
system(base_path().' php mcp lets-encrypt:add '.$email.' '.$vhost['domain']); |
|
|
|
|
|
|
|
|
if ($vhost['redirect_www'] === true) { |
|
|
if ($vhost['redirect_www'] === true) { |
|
|
$this->call('lets-encrypt:add', [ 'email' => $email, 'domain' => 'www.'.$vhost['domain'] ]); |
|
|
|
|
|
|
|
|
system(base_path().' php mcp lets-encrypt:add '.$email.' www.'.$vhost['domain']); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|