Plugins base (#613)

* wip

* wip

* cleanup

* notification channels

* phpstan

* services

* remove server types

* refactoring

* refactoring
This commit is contained in:
Saeed Vaziry
2025-06-14 14:35:18 +02:00
committed by GitHub
parent adc0653d15
commit 131b828807
311 changed files with 3976 additions and 2660 deletions

View File

@ -0,0 +1,5 @@
#[core]
import access_log {{ $site->domain }}
import compression
import security_headers
#[/core]

View File

@ -0,0 +1,5 @@
#[force-ssl]
@if ($site->activeSsl && $site->force_ssl)
redir @http https://{host}{uri} permanent
@endif
#[/force-ssl]

View File

@ -0,0 +1,23 @@
#[load-balancer]
reverse_proxy {
@if ($site->loadBalancerServers()->count() > 0)
@foreach($site->loadBalancerServers as $server)
to {{ $server->ip }}:{{ $server->port }}
@endforeach
@else
to 127.0.0.1
@endif
@switch($site->type_data['method'] ?? LoadBalancerMethod::ROUND_ROBIN)
@case(LoadBalancerMethod::LEAST_CONNECTIONS)
lb_policy least_conn
@break
@case(LoadBalancerMethod::IP_HASH)
lb_policy ip_hash
@break
@default
lb_policy round_robin
@endswitch
header_up Host {host}
header_up X-Real-IP {remote}
}
#[/load-balancer]

View File

@ -0,0 +1,12 @@
#[php]
root * {{ $site->getWebDirectoryPath() }}
@php
$phpSocket = "unix//var/run/php/php{$site->php_version}-fpm.sock";
if ($site->isIsolated()) {
$phpSocket = "unix//run/php/php{$site->php_version}-fpm-{$site->user}.sock";
}
@endphp
try_files {path} {path}/ /index.php?{query}
php_fastcgi {{ $phpSocket }}
file_server
#[/php]

View File

@ -0,0 +1,5 @@
#[port]
@if ($site->activeSsl)
tls {{ $site->activeSsl->certificate_path }} {{ $site->activeSsl->pk_path }}
@endif
#[/port]

View File

@ -0,0 +1,7 @@
#[redirects]
@foreach($site->activeRedirects as $redirect)
location = {{ $redirect->from }} {
return {{ $redirect->mode }} {{ $redirect->to }};
}
@endforeach
#[/redirects]