Browse Source

adding #45

master
Björn 4 years ago
parent
commit
11806d2cfd
2 changed files with 5 additions and 12 deletions
  1. +5
    -2
      app/Factories/NginxVhostFactory.php
  2. +0
    -10
      resources/nginx/templates/layouts/ssl.blade.php

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

@ -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']);
} }
}); });
} }


+ 0
- 10
resources/nginx/templates/layouts/ssl.blade.php View File

@ -31,16 +31,6 @@ server {
include /etc/nginx/snippets/ssl-params.conf; include /etc/nginx/snippets/ssl-params.conf;
include /etc/nginx/snippets/secure-headers.conf; include /etc/nginx/snippets/secure-headers.conf;
add_header Content-Security-Policy "
default-src 'self';
font-src 'self';
style-src 'self';
img-src 'self';
base-uri 'self';
form-action 'self';
frame-ancestors 'self';
";
@include('partials.default', ['domain' => $domain]) @include('partials.default', ['domain' => $domain])
@yield('server') @yield('server')

Loading…
Cancel
Save