Refactor EditDomain.php and shared.php to improve DockerCompose parsing logic
This commit is contained in:
parent
3935a3c885
commit
8164610105
@ -41,7 +41,7 @@ public function submit()
|
|||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
} finally {
|
} finally {
|
||||||
$this->dispatch('generateDockerCompose');
|
$this->application->service->parse();
|
||||||
$this->dispatch('refresh');
|
$this->dispatch('refresh');
|
||||||
$this->dispatch('configurationChanged');
|
$this->dispatch('configurationChanged');
|
||||||
}
|
}
|
||||||
|
@ -980,15 +980,18 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Caddy needs exact port in some cases.
|
// Caddy needs exact port in some cases.
|
||||||
ray($predefinedPort);
|
|
||||||
if ($predefinedPort && !$key->endsWith("_{$predefinedPort}")) {
|
if ($predefinedPort && !$key->endsWith("_{$predefinedPort}")) {
|
||||||
|
$fqdns_exploded = str($savedService->fqdn)->explode(',');
|
||||||
|
if ($fqdns_exploded->count() > 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ($resource->server->proxyType() === 'CADDY') {
|
if ($resource->server->proxyType() === 'CADDY') {
|
||||||
$env = EnvironmentVariable::where([
|
$env = EnvironmentVariable::where([
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'service_id' => $resource->id,
|
'service_id' => $resource->id,
|
||||||
])->first();
|
])->first();
|
||||||
ray($env);
|
|
||||||
if ($env) {
|
if ($env) {
|
||||||
|
|
||||||
$env_url = Url::fromString($savedService->fqdn);
|
$env_url = Url::fromString($savedService->fqdn);
|
||||||
$env_port = $env_url->getPort();
|
$env_port = $env_url->getPort();
|
||||||
if ($env_port !== $predefinedPort) {
|
if ($env_port !== $predefinedPort) {
|
||||||
@ -1050,6 +1053,10 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
}
|
}
|
||||||
// Caddy needs exact port in some cases.
|
// Caddy needs exact port in some cases.
|
||||||
if ($predefinedPort && !$key->endsWith("_{$predefinedPort}") && $command?->value() === 'FQDN' && $resource->server->proxyType() === 'CADDY') {
|
if ($predefinedPort && !$key->endsWith("_{$predefinedPort}") && $command?->value() === 'FQDN' && $resource->server->proxyType() === 'CADDY') {
|
||||||
|
$fqdns_exploded = str($savedService->fqdn)->explode(',');
|
||||||
|
if ($fqdns_exploded->count() > 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$env = EnvironmentVariable::where([
|
$env = EnvironmentVariable::where([
|
||||||
'key' => $key,
|
'key' => $key,
|
||||||
'service_id' => $resource->id,
|
'service_id' => $resource->id,
|
||||||
|
Loading…
Reference in New Issue
Block a user