Merge pull request #5258 from coollabsio/next

v4.0.0-beta.397
This commit is contained in:
Andras Bacsai
2025-02-28 20:28:56 +01:00
committed by GitHub
7 changed files with 77 additions and 99 deletions

View File

@@ -217,7 +217,7 @@ class StripeProcessJob implements ShouldQueue
'stripe_plan_id' => $planId,
'stripe_cancel_at_period_end' => $cancelAtPeriodEnd,
]);
if ($status === 'paused' || $status === 'incomplete_expired') {
if ($status === 'paused' || $status === 'incomplete_expired' || $status === 'past_due') {
if ($subscription->stripe_subscription_id === $subscriptionId) {
$subscription->update([
'stripe_invoice_paid' => false,

View File

@@ -569,7 +569,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
if ($shouldGenerateLabelsExactly) {
switch ($application->destination->server->proxyType()) {
case ProxyTypes::TRAEFIK->value:
$proxyLabels = fqdnLabelsForTraefik(
$labels = $labels->merge(fqdnLabelsForTraefik(
uuid: $appUuid,
domains: $domains,
onlyPort: $onlyPort,
@@ -577,11 +577,10 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled(),
redirect_direction: $application->redirect
);
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
));
break;
case ProxyTypes::CADDY->value:
$proxyLabels = fqdnLabelsForCaddy(
$labels = $labels->merge(fqdnLabelsForCaddy(
network: $application->destination->network,
uuid: $appUuid,
domains: $domains,
@@ -590,12 +589,11 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled(),
redirect_direction: $application->redirect
);
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
));
break;
}
} else {
$proxyLabels = fqdnLabelsForTraefik(
$labels = $labels->merge(fqdnLabelsForTraefik(
uuid: $appUuid,
domains: $domains,
onlyPort: $onlyPort,
@@ -603,9 +601,8 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled(),
redirect_direction: $application->redirect
);
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
$proxyLabels = fqdnLabelsForCaddy(
));
$labels = $labels->merge(fqdnLabelsForCaddy(
network: $application->destination->network,
uuid: $appUuid,
domains: $domains,
@@ -614,8 +611,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled(),
redirect_direction: $application->redirect
);
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
));
}
}
} else {
@@ -628,18 +624,17 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
if ($shouldGenerateLabelsExactly) {
switch ($application->destination->server->proxyType()) {
case ProxyTypes::TRAEFIK->value:
$proxyLabels = fqdnLabelsForTraefik(
$labels = $labels->merge(fqdnLabelsForTraefik(
uuid: $appUuid,
domains: $domains,
onlyPort: $onlyPort,
is_force_https_enabled: $application->isForceHttpsEnabled(),
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled()
);
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
));
break;
case ProxyTypes::CADDY->value:
$proxyLabels = fqdnLabelsForCaddy(
$labels = $labels->merge(fqdnLabelsForCaddy(
network: $application->destination->network,
uuid: $appUuid,
domains: $domains,
@@ -647,21 +642,19 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
is_force_https_enabled: $application->isForceHttpsEnabled(),
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled()
);
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
));
break;
}
} else {
$proxyLabels = fqdnLabelsForTraefik(
$labels = $labels->merge(fqdnLabelsForTraefik(
uuid: $appUuid,
domains: $domains,
onlyPort: $onlyPort,
is_force_https_enabled: $application->isForceHttpsEnabled(),
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled()
);
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
$proxyLabels = fqdnLabelsForCaddy(
));
$labels = $labels->merge(fqdnLabelsForCaddy(
network: $application->destination->network,
uuid: $appUuid,
domains: $domains,
@@ -669,13 +662,9 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
is_force_https_enabled: $application->isForceHttpsEnabled(),
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled()
);
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
));
}
}
$labels = $labels->map(function ($value, $key) {
return "$key=$value";
})->values();
return $labels->all();
}

View File

@@ -748,6 +748,7 @@ function parseCommandFromMagicEnvVariable(Str|string $key): Stringable
{
$value = str($key);
$count = substr_count($value->value(), '_');
$command = null;
if ($count === 2) {
if ($value->startsWith('SERVICE_FQDN') || $value->startsWith('SERVICE_URL')) {
// SERVICE_FQDN_UMAMI
@@ -1476,7 +1477,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
$serviceNetworks = collect(data_get($service, 'networks', []));
$serviceVariables = collect(data_get($service, 'environment', []));
$serviceLabels = collect(data_get($service, 'labels', []));
$serviceLabels = convertToKeyValueCollection($serviceLabels);
$hasHostNetworkMode = data_get($service, 'network_mode') === 'host' ? true : false;
if ($serviceLabels->count() > 0) {
$removedLabels = collect([]);
@@ -2005,7 +2005,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
if ($shouldGenerateLabelsExactly) {
switch ($resource->server->proxyType()) {
case ProxyTypes::TRAEFIK->value:
$proxyLabels = fqdnLabelsForTraefik(
$serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik(
uuid: $resource->uuid,
domains: $fqdns,
is_force_https_enabled: true,
@@ -2014,12 +2014,10 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
is_stripprefix_enabled: $savedService->isStripprefixEnabled(),
service_name: $serviceName,
image: data_get($service, 'image')
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
));
break;
case ProxyTypes::CADDY->value:
$proxyLabels = fqdnLabelsForCaddy(
$serviceLabels = $serviceLabels->merge(fqdnLabelsForCaddy(
network: $resource->destination->network,
uuid: $resource->uuid,
domains: $fqdns,
@@ -2029,13 +2027,11 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
is_stripprefix_enabled: $savedService->isStripprefixEnabled(),
service_name: $serviceName,
image: data_get($service, 'image')
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
));
break;
}
} else {
$proxyLabels = fqdnLabelsForTraefik(
$serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik(
uuid: $resource->uuid,
domains: $fqdns,
is_force_https_enabled: true,
@@ -2044,9 +2040,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
is_stripprefix_enabled: $savedService->isStripprefixEnabled(),
service_name: $serviceName,
image: data_get($service, 'image')
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
$proxyLabels = fqdnLabelsForCaddy(
));
$serviceLabels = $serviceLabels->merge(fqdnLabelsForCaddy(
network: $resource->destination->network,
uuid: $resource->uuid,
domains: $fqdns,
@@ -2056,8 +2051,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
is_stripprefix_enabled: $savedService->isStripprefixEnabled(),
service_name: $serviceName,
image: data_get($service, 'image')
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
));
}
}
}
@@ -2206,7 +2200,6 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
$serviceVariables = collect(data_get($service, 'environment', []));
$serviceDependencies = collect(data_get($service, 'depends_on', []));
$serviceLabels = collect(data_get($service, 'labels', []));
$serviceLabels = convertToKeyValueCollection($serviceLabels);
$serviceBuildVariables = collect(data_get($service, 'build.args', []));
$serviceVariables = $serviceVariables->merge($serviceBuildVariables);
if ($serviceLabels->count() > 0) {
@@ -2780,7 +2773,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
if ($shouldGenerateLabelsExactly) {
switch ($server->proxyType()) {
case ProxyTypes::TRAEFIK->value:
$proxyLabels = fqdnLabelsForTraefik(
$serviceLabels = $serviceLabels->merge(
fqdnLabelsForTraefik(
uuid: $resource->uuid,
domains: $fqdns,
serviceLabels: $serviceLabels,
@@ -2789,38 +2783,11 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
is_force_https_enabled: $resource->isForceHttpsEnabled(),
is_gzip_enabled: $resource->isGzipEnabled(),
is_stripprefix_enabled: $resource->isStripprefixEnabled(),
)
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
break;
case ProxyTypes::CADDY->value:
$proxyLabels = fqdnLabelsForCaddy(
network: $resource->destination->network,
uuid: $resource->uuid,
domains: $fqdns,
serviceLabels: $serviceLabels,
image: data_get($service, 'image'),
is_force_https_enabled: $resource->isForceHttpsEnabled(),
is_gzip_enabled: $resource->isGzipEnabled(),
is_stripprefix_enabled: $resource->isStripprefixEnabled(),
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
break;
}
} else {
$proxyLabels = fqdnLabelsForTraefik(
uuid: $resource->uuid,
domains: $fqdns,
serviceLabels: $serviceLabels,
generate_unique_uuid: $resource->build_pack === 'dockercompose',
image: data_get($service, 'image'),
is_force_https_enabled: $resource->isForceHttpsEnabled(),
is_gzip_enabled: $resource->isGzipEnabled(),
is_stripprefix_enabled: $resource->isStripprefixEnabled(),
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
$proxyLabels =
$serviceLabels = $serviceLabels->merge(
fqdnLabelsForCaddy(
network: $resource->destination->network,
uuid: $resource->uuid,
@@ -2830,8 +2797,35 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
is_force_https_enabled: $resource->isForceHttpsEnabled(),
is_gzip_enabled: $resource->isGzipEnabled(),
is_stripprefix_enabled: $resource->isStripprefixEnabled(),
)
);
break;
}
} else {
$serviceLabels = $serviceLabels->merge(
fqdnLabelsForTraefik(
uuid: $resource->uuid,
domains: $fqdns,
serviceLabels: $serviceLabels,
generate_unique_uuid: $resource->build_pack === 'dockercompose',
image: data_get($service, 'image'),
is_force_https_enabled: $resource->isForceHttpsEnabled(),
is_gzip_enabled: $resource->isGzipEnabled(),
is_stripprefix_enabled: $resource->isStripprefixEnabled(),
)
);
$serviceLabels = $serviceLabels->merge(
fqdnLabelsForCaddy(
network: $resource->destination->network,
uuid: $resource->uuid,
domains: $fqdns,
serviceLabels: $serviceLabels,
image: data_get($service, 'image'),
is_force_https_enabled: $resource->isForceHttpsEnabled(),
is_gzip_enabled: $resource->isGzipEnabled(),
is_stripprefix_enabled: $resource->isStripprefixEnabled(),
)
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
}
}
}
@@ -2846,7 +2840,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
pull_request_id: $pull_request_id,
type: 'application'
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($defaultLabels));
$serviceLabels = $serviceLabels->merge($defaultLabels);
if ($server->isLogDrainEnabled()) {
if ($resource instanceof Application && $resource->isLogDrainEnabled()) {
@@ -3186,7 +3180,6 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
$use_network_mode = data_get($service, 'network_mode') !== null;
$depends_on = collect(data_get($service, 'depends_on', []));
$labels = collect(data_get($service, 'labels', []));
$labels = convertToKeyValueCollection($labels);
$environment = collect(data_get($service, 'environment', []));
$ports = collect(data_get($service, 'ports', []));
$buildArgs = collect(data_get($service, 'build.args', []));
@@ -3699,7 +3692,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
return $value;
});
}
$serviceLabels = $labels->merge(convertToKeyValueCollection($defaultLabels));
$serviceLabels = $labels->merge($defaultLabels);
if ($serviceLabels->count() > 0) {
if ($isApplication) {
$isContainerLabelEscapeEnabled = data_get($resource, 'settings.is_container_label_escape_enabled');
@@ -3731,7 +3724,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
if ($shouldGenerateLabelsExactly) {
switch ($server->proxyType()) {
case ProxyTypes::TRAEFIK->value:
$proxyLabels = fqdnLabelsForTraefik(
$serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik(
uuid: $uuid,
domains: $fqdns,
is_force_https_enabled: true,
@@ -3740,38 +3733,35 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
is_stripprefix_enabled: $originalResource->isStripprefixEnabled(),
service_name: $serviceName,
image: $image
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
));
break;
case ProxyTypes::CADDY->value:
$proxyLabels = fqdnLabelsForCaddy(
network: $network,
uuid: $uuid,
domains: $fqdns,
is_force_https_enabled: true,
serviceLabels: $serviceLabels,
is_gzip_enabled: $originalResource->isGzipEnabled(),
is_stripprefix_enabled: $originalResource->isStripprefixEnabled(),
service_name: $serviceName,
image: $image,
predefinedPort: $predefinedPort
);
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
break;
}
} else {
$proxyLabels = fqdnLabelsForTraefik(
uuid: $uuid,
domains: $fqdns,
is_force_https_enabled: true,
serviceLabels: $serviceLabels,
is_gzip_enabled: $originalResource->isGzipEnabled(),
is_stripprefix_enabled: $originalResource->isStripprefixEnabled(),
service_name: $serviceName,
image: $image
);
$proxyLabels = $proxyLabels->merge(fqdnLabelsForCaddy(
$serviceLabels = $serviceLabels->merge(fqdnLabelsForCaddy(
network: $network,
uuid: $uuid,
domains: $fqdns,
is_force_https_enabled: true,
serviceLabels: $serviceLabels,
is_gzip_enabled: $originalResource->isGzipEnabled(),
is_stripprefix_enabled: $originalResource->isStripprefixEnabled(),
service_name: $serviceName,
image: $image,
predefinedPort: $predefinedPort
));
break;
}
} else {
$serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik(
uuid: $uuid,
domains: $fqdns,
is_force_https_enabled: true,
serviceLabels: $serviceLabels,
is_gzip_enabled: $originalResource->isGzipEnabled(),
is_stripprefix_enabled: $originalResource->isStripprefixEnabled(),
service_name: $serviceName,
image: $image
));
$serviceLabels = $serviceLabels->merge(fqdnLabelsForCaddy(
network: $network,
uuid: $uuid,
domains: $fqdns,
@@ -3783,7 +3773,6 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
image: $image,
predefinedPort: $predefinedPort
));
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
}
}
if ($isService) {

View File

@@ -2,7 +2,7 @@
return [
'coolify' => [
'version' => '4.0.0-beta.396',
'version' => '4.0.0-beta.397',
'helper_version' => '1.0.7',
'realtime_version' => '1.0.6',
'self_hosted' => env('SELF_HOSTED', true),

View File

@@ -61,7 +61,7 @@ services:
retries: 10
timeout: 2s
soketi:
image: 'ghcr.io/coollabsio/coolify-realtime:1.0.5'
image: 'ghcr.io/coollabsio/coolify-realtime:1.0.6'
ports:
- "${SOKETI_PORT:-6001}:6001"
- "6002:6002"

View File

@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.382"
"version": "4.0.0-beta.397"
},
"nightly": {
"version": "4.0.0-beta.383"
"version": "4.0.0-beta.398"
},
"helper": {
"version": "1.0.7"

View File

@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.396"
"version": "4.0.0-beta.397"
},
"nightly": {
"version": "4.0.0-beta.397"
"version": "4.0.0-beta.398"
},
"helper": {
"version": "1.0.7"