Add file permission change for LocalFileVolume.php and add service_name parameter to fqdnLabelsForTraefik() function
This commit is contained in:
@@ -57,6 +57,7 @@ class LocalFileVolume extends BaseModel
|
|||||||
if ($content) {
|
if ($content) {
|
||||||
$content = base64_encode($content);
|
$content = base64_encode($content);
|
||||||
$commands->push("echo '$content' | base64 -d > $path");
|
$commands->push("echo '$content' | base64 -d > $path");
|
||||||
|
$commands->push("chmod +x $path");
|
||||||
}
|
}
|
||||||
} else if ($isDir == 'NOK' && $fileVolume->is_directory) {
|
} else if ($isDir == 'NOK' && $fileVolume->is_directory) {
|
||||||
$commands->push("mkdir -p $path > /dev/null 2>&1 || true");
|
$commands->push("mkdir -p $path > /dev/null 2>&1 || true");
|
||||||
|
@@ -212,7 +212,7 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource,
|
|||||||
}
|
}
|
||||||
return $payload;
|
return $payload;
|
||||||
}
|
}
|
||||||
function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_https_enabled = false, $onlyPort = null, ?Collection $serviceLabels = null, ?bool $is_gzip_enabled = true)
|
function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_https_enabled = false, $onlyPort = null, ?Collection $serviceLabels = null, ?bool $is_gzip_enabled = true, ?string $service_name = null)
|
||||||
{
|
{
|
||||||
$labels = collect([]);
|
$labels = collect([]);
|
||||||
$labels->push('traefik.enable=true');
|
$labels->push('traefik.enable=true');
|
||||||
@@ -264,6 +264,10 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
|
|||||||
}
|
}
|
||||||
$http_label = "http-{$loop}-{$uuid}";
|
$http_label = "http-{$loop}-{$uuid}";
|
||||||
$https_label = "https-{$loop}-{$uuid}";
|
$https_label = "https-{$loop}-{$uuid}";
|
||||||
|
if ($service_name) {
|
||||||
|
$http_label = "http-{$loop}-{$uuid}-{$service_name}";
|
||||||
|
$https_label = "https-{$loop}-{$uuid}-{$service_name}";
|
||||||
|
}
|
||||||
|
|
||||||
if ($schema === 'https') {
|
if ($schema === 'https') {
|
||||||
// Set labels for https
|
// Set labels for https
|
||||||
|
@@ -974,12 +974,13 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
'is_preview' => false,
|
'is_preview' => false,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if (!$isDatabase) {
|
// if (!$isDatabase) {
|
||||||
if ($command->value() === 'FQDN' && is_null($savedService->fqdn)) {
|
// ray($savedService,$fqdn);
|
||||||
$savedService->fqdn = $fqdn;
|
// if ($command->value() === 'FQDN' && is_null($savedService->fqdn)) {
|
||||||
$savedService->save();
|
// $savedService->fqdn = $fqdn;
|
||||||
}
|
// $savedService->save();
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
$generatedValue = generateEnvValue($command);
|
$generatedValue = generateEnvValue($command);
|
||||||
if (!$foundEnv) {
|
if (!$foundEnv) {
|
||||||
@@ -1039,7 +1040,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
|||||||
$serviceLabels = $serviceLabels->merge($defaultLabels);
|
$serviceLabels = $serviceLabels->merge($defaultLabels);
|
||||||
if (!$isDatabase && $fqdns->count() > 0) {
|
if (!$isDatabase && $fqdns->count() > 0) {
|
||||||
if ($fqdns) {
|
if ($fqdns) {
|
||||||
$serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik($resource->uuid, $fqdns, true, serviceLabels: $serviceLabels, is_gzip_enabled: $savedService->isGzipEnabled()));
|
$serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik($resource->uuid, $fqdns, true, serviceLabels: $serviceLabels, is_gzip_enabled: $savedService->isGzipEnabled(), service_name: $serviceName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($resource->server->isLogDrainEnabled() && $savedService->isLogDrainEnabled()) {
|
if ($resource->server->isLogDrainEnabled() && $savedService->isLogDrainEnabled()) {
|
||||||
|
Reference in New Issue
Block a user