fix
This commit is contained in:
@@ -61,19 +61,6 @@ class Form extends Component
|
|||||||
$url = Url::fromString($this->settings->fqdn);
|
$url = Url::fromString($this->settings->fqdn);
|
||||||
$host = $url->getHost();
|
$host = $url->getHost();
|
||||||
$schema = $url->getScheme();
|
$schema = $url->getScheme();
|
||||||
$middlewares = [];
|
|
||||||
$tls = [];
|
|
||||||
$entryPoints = [
|
|
||||||
0 => 'http',
|
|
||||||
];
|
|
||||||
if ($schema === 'https') {
|
|
||||||
$entryPoints[] = 'https';
|
|
||||||
$middlewares[] = 'redirect-to-https@docker';
|
|
||||||
$tls = [
|
|
||||||
'certresolver' => 'letsencrypt',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$traefik_dynamic_conf = [
|
$traefik_dynamic_conf = [
|
||||||
'http' =>
|
'http' =>
|
||||||
[
|
[
|
||||||
@@ -81,11 +68,8 @@ class Form extends Component
|
|||||||
[
|
[
|
||||||
'coolify' =>
|
'coolify' =>
|
||||||
[
|
[
|
||||||
'entryPoints' => $entryPoints,
|
|
||||||
'service' => 'coolify',
|
'service' => 'coolify',
|
||||||
'rule' => "Host(`{$host}`)",
|
'rule' => "Host(`{$host}`)",
|
||||||
'middlewares' => $middlewares,
|
|
||||||
'tls' => $tls,
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'services' =>
|
'services' =>
|
||||||
@@ -106,6 +90,22 @@ class Form extends Component
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
$traefik_dynamic_conf['http']['routers']['coolify']['entryPoints'] = [
|
||||||
|
0 => 'http',
|
||||||
|
];
|
||||||
|
if ($schema === 'https') {
|
||||||
|
$traefik_dynamic_conf['http']['routers']['coolify']['entryPoints'][] = 'https';
|
||||||
|
$traefik_dynamic_conf['http']['routers']['coolify']['tls'] = [
|
||||||
|
'certresolver' => 'letsencrypt',
|
||||||
|
];
|
||||||
|
$traefik_dynamic_conf['http']['routers']['coolify']['middlewares'] = [
|
||||||
|
0 => 'redirect-to-https@docker',
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$traefik_dynamic_conf['http']['routers']['coolify']['entryPoints'] = [
|
||||||
|
0 => 'http',
|
||||||
|
];
|
||||||
|
}
|
||||||
$yaml = Yaml::dump($traefik_dynamic_conf);
|
$yaml = Yaml::dump($traefik_dynamic_conf);
|
||||||
if (config('app.env') == 'local') {
|
if (config('app.env') == 'local') {
|
||||||
dump($yaml);
|
dump($yaml);
|
||||||
|
|||||||
Reference in New Issue
Block a user