Browse Source

adding #45

master
Björn 4 years ago
parent
commit
fc523207af
1 changed files with 13 additions and 2 deletions
  1. +13
    -2
      app/Factories/NginxVhostFactory.php

+ 13
- 2
app/Factories/NginxVhostFactory.php View File

@ -136,11 +136,22 @@ class NginxVhostFactory
->addMenuItem($checkbox) ->addMenuItem($checkbox)
->addLineBreak('-'); ->addLineBreak('-');
if ($vhost['ssl']) {
if ($vhost['ssl'] === true) {
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 {
$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('-'); $builder->addLineBreak('-');


Loading…
Cancel
Save