update
This commit is contained in:
parent
15af5e5b37
commit
bb0554c727
1 changed files with 9 additions and 0 deletions
|
|
@ -62,12 +62,16 @@ public function submit()
|
||||||
$host = $url->getHost();
|
$host = $url->getHost();
|
||||||
$schema = $url->getScheme();
|
$schema = $url->getScheme();
|
||||||
$middlewares = [];
|
$middlewares = [];
|
||||||
|
$tls = [];
|
||||||
$entryPoints = [
|
$entryPoints = [
|
||||||
0 => 'http',
|
0 => 'http',
|
||||||
];
|
];
|
||||||
if ($schema === 'https') {
|
if ($schema === 'https') {
|
||||||
$entryPoints[] = 'https';
|
$entryPoints[] = 'https';
|
||||||
$middlewares[] = 'redirect-to-https@docker';
|
$middlewares[] = 'redirect-to-https@docker';
|
||||||
|
$tls = [
|
||||||
|
'certresolver' => 'letsencrypt',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$traefik_dynamic_conf = [
|
$traefik_dynamic_conf = [
|
||||||
|
|
@ -81,6 +85,7 @@ public function submit()
|
||||||
'service' => 'coolify',
|
'service' => 'coolify',
|
||||||
'rule' => "Host(`{$host}`)",
|
'rule' => "Host(`{$host}`)",
|
||||||
'middlewares' => $middlewares,
|
'middlewares' => $middlewares,
|
||||||
|
'tls' => $tls,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'services' =>
|
'services' =>
|
||||||
|
|
@ -102,6 +107,10 @@ public function submit()
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
$yaml = Yaml::dump($traefik_dynamic_conf);
|
$yaml = Yaml::dump($traefik_dynamic_conf);
|
||||||
|
if (config('app.env') == 'local') {
|
||||||
|
dump($yaml);
|
||||||
|
return;
|
||||||
|
}
|
||||||
$base64 = base64_encode($yaml);
|
$base64 = base64_encode($yaml);
|
||||||
remote_process([
|
remote_process([
|
||||||
"mkdir -p $dynamic_config_path",
|
"mkdir -p $dynamic_config_path",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue