fix letsencrypt for aliases & blank php deployment fix (#204)

This commit is contained in:
Saeed Vaziry
2024-05-13 00:37:51 +02:00
committed by GitHub
parent 88223a61f9
commit 30ef8ad5eb
9 changed files with 19 additions and 40 deletions

View File

@ -117,9 +117,16 @@ public function changePHPVersion(Site $site, $version): void
*/
public function setupSSL(Ssl $ssl): void
{
$domains = '-d '.$ssl->site->domain;
if ($ssl->site->aliases) {
foreach ($ssl->site->aliases as $alias) {
$domains .= ' -d '.$alias;
}
}
$command = $this->getScript('nginx/create-letsencrypt-ssl.sh', [
'email' => $ssl->site->server->creator->email,
'domain' => $ssl->site->domain,
'domains' => $domains,
'web_directory' => $ssl->site->getWebDirectoryPath(),
]);
if ($ssl->type == 'custom') {

View File

@ -1,3 +1,3 @@
if ! sudo certbot certonly --force-renewal --nginx --noninteractive --agree-tos --cert-name __domain__ -m __email__ -d __domain__ --verbose; then
if ! sudo certbot certonly --force-renewal --nginx --noninteractive --agree-tos --cert-name __domain__ -m __email__ __domains__ --verbose; then
echo 'VITO_SSH_ERROR' && exit 1
fi

View File

@ -1,10 +1,9 @@
server {
listen 80;
listen 443 ssl;
server_name __domain__ www.__domain__;
server_name __domain__ __aliases__;
root __path__/__web_directory__;
ssl on;
ssl_certificate __certificate__;
ssl_certificate_key __private_key__;

View File

@ -1,6 +1,6 @@
server {
listen 80;
server_name __domain__ www.__domain__;
server_name __domain__ __aliases__;
root __path__/__web_directory__;
add_header X-Frame-Options "SAMEORIGIN";

View File

@ -1,31 +0,0 @@
server {
listen __port__;
server_name _;
root /home/vito/phpmyadmin;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php__php_version__-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}

View File

@ -4,7 +4,6 @@ server {
server_name __domain__ __aliases__;
root __path__;
ssl on;
ssl_certificate __certificate__;
ssl_certificate_key __private_key__;

View File

@ -4,7 +4,6 @@ server {
server_name __domain__ __aliases__;
root __path__/__web_directory__;
ssl on;
ssl_certificate __certificate__;
ssl_certificate_key __private_key__;