This commit is contained in:
Andras Bacsai 2023-05-26 11:01:50 +02:00
parent 0e26731b75
commit 2b5bf56153

View File

@ -66,8 +66,11 @@ class Form extends Component
[ [
'routers' => 'routers' =>
[ [
'coolify' => 'coolify-http' =>
[ [
'entryPoints' => [
0 => 'http',
],
'service' => 'coolify', 'service' => 'coolify',
'rule' => "Host(`{$host}`)", 'rule' => "Host(`{$host}`)",
], ],
@ -90,26 +93,25 @@ class Form extends Component
], ],
], ],
]; ];
$traefik_dynamic_conf['http']['routers']['coolify']['entryPoints'] = [
0 => 'http',
];
if ($schema === 'https') { if ($schema === 'https') {
$traefik_dynamic_conf['http']['routers']['coolify']['entryPoints'][] = 'https'; $traefik_dynamic_conf['http']['routers']['coolify-http']['middlewares'] = [
$traefik_dynamic_conf['http']['routers']['coolify']['tls'] = [
'certresolver' => 'letsencrypt',
];
$traefik_dynamic_conf['http']['routers']['coolify']['middlewares'] = [
0 => 'redirect-to-https@docker', 0 => 'redirect-to-https@docker',
]; ];
} else { $traefik_dynamic_conf['http']['routers']['coolify-https'] = [
$traefik_dynamic_conf['http']['routers']['coolify']['entryPoints'] = [ 'entryPoints' => [
0 => 'http', 0 => 'https',
],
'service' => 'coolify',
'rule' => "Host(`{$host}`)",
'tls' => [
'certresolver' => 'letsencrypt',
],
]; ];
} }
$yaml = Yaml::dump($traefik_dynamic_conf); $yaml = Yaml::dump($traefik_dynamic_conf, 12, 2);
if (config('app.env') == 'local') { if (config('app.env') == 'local') {
dump($yaml); dump($yaml);
return;
} }
$base64 = base64_encode($yaml); $base64 = base64_encode($yaml);
remote_process([ remote_process([