Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Merge remote-tracking branch 'origin/release/v4.5' into automation/sync-main-to-release-v4.5

Andras Bacsaib4ad8fa0f8de
diff --cc config/constants.php
index 894e2d4db6,657d393ab6..28b36469e2
--- a/config/constants.php
+++ b/config/constants.php
@@@ -5,9 -5,9 +5,9 @@@ $sshCommandTimeout = (int) env('SSH_COM
return [
'coolify' => [
- 'version' => env('COOLIFY_VERSION') ?: '4.4.2',
+ 'version' => env('COOLIFY_VERSION') ?: '4.4.3',
- 'helper_version' => '1.0.17',
- 'railpack_version' => '0.23.0',
+ 'helper_version' => '1.0.18',
+ 'railpack_version' => '0.40.1',
'self_hosted' => env('SELF_HOSTED', true),
'autoupdate' => env('AUTOUPDATE'),
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),
diff --cc tests/Feature/Api/ApplicationSettingsApiTest.php
index 71064711c5,daa60ea77f..14cf1e1c1a
--- a/tests/Feature/Api/ApplicationSettingsApiTest.php
+++ b/tests/Feature/Api/ApplicationSettingsApiTest.php
@@@ -267,34 -267,35 +267,63 @@@ test('http basic auth updates preserve
expect(base64_decode($this->application->fresh()->custom_labels))->toBe('sentinel-label=true');
});
+test('nested base64 custom labels are stored in canonical form', function () {
+ $labels = "traefik.enable=true\ntraefik.http.routers.web.rule=Host(`example.com`)";
+
+ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))
+ ->patchJson("/api/v1/applications/{$this->application->uuid}", [
+ 'custom_labels' => base64_encode(base64_encode($labels)),
+ ])
+ ->assertOk();
+
+ expect($this->application->fresh()->custom_labels)->toBe(base64_encode($labels));
+});
+
+test('deployment parsing repairs historically nested custom labels', function () {
+ $labels = "traefik.enable=true\ntraefik.http.routers.web.rule=Host(`example.com`)";
+ $this->application->update(['custom_labels' => base64_encode(base64_encode($labels))]);
+
+ expect($this->application->parseContainerLabels())->toBe($labels)
+ ->and($this->application->fresh()->custom_labels)->toBe(base64_encode($labels));
+});
+
+test('deployment parsing keeps commas in raw custom label values', function () {
+ $labels = "traefik.enable=true\ntraefik.http.routers.web.middlewares=gzip,redirect-to-https";
+ $this->application->update(['custom_labels' => $labels]);
+
+ expect($this->application->parseContainerLabels())->toBe($labels)
+ ->and($this->application->fresh()->custom_labels)->toBe(base64_encode($labels));
+});
+
+ test('http basic auth hash settings are saved and applied to managed labels', function () {
+ $this->application->update([
+ 'fqdn' => 'https://app.example.com',
+ 'is_http_basic_auth_enabled' => true,
+ 'http_basic_auth_username' => 'api-user',
+ 'http_basic_auth_password' => 'api-password',
+ ]);
+
+ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))
+ ->patchJson("/api/v1/applications/{$this->application->uuid}", ['http_basic_auth_bcrypt_cost' => 4])
+ ->assertOk();
+
+ expect($this->application->fresh()->parseContainerLabels())->toContain('.basicauth.users=api-user:$2y$04$');
+ });
+
+ test('rejects http basic auth settings that are not supported', function (string $field, mixed $value) {
+ $this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))
+ ->patchJson("/api/v1/applications/{$this->application->uuid}", [$field => $value])
+ ->assertUnprocessable()
+ ->assertJsonValidationErrors($field);
+ })->with([
+ 'Argon2id on a proxy without it' => ['http_basic_auth_hash_algorithm', 'argon2id'],
+ 'unknown algorithm' => ['http_basic_auth_hash_algorithm', 'md5'],
+ 'bcrypt cost above 14' => ['http_basic_auth_bcrypt_cost', 15],
+ 'Argon2id memory above 256 MiB' => ['http_basic_auth_argon2id_memory_cost', 262145],
+ 'Argon2id iterations above 12' => ['http_basic_auth_argon2id_time_cost', 13],
+ 'password longer than 72 characters' => ['http_basic_auth_password', str_repeat('a', 73)],
+ ]);
+
test('rejects invalid boolean application settings', function () {
$this->withHeaders(applicationSettingsApiHeaders($this->bearerToken))
->patchJson("/api/v1/applications/{$this->application->uuid}", [