Skip to content

Commit 9e90daf

Browse files
authored
Merge pull request coollabsio#3393 from coollabsio/next
v4.0.0-beta.334
2 parents c9a52c5 + 420f1df commit 9e90daf

File tree

15 files changed

+591
-66
lines changed

15 files changed

+591
-66
lines changed

.env.development.example

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ APP_PORT=8000
88
APP_DEBUG=true
99
MUX_ENABLED=false
1010

11-
# Enable Laravel Telescope for debugging
12-
TELESCOPE_ENABLED=false
13-
14-
# Selenium Driver URL for Dusk
15-
DUSK_DRIVER_URL=http://selenium:4444
16-
1711
# PostgreSQL Database Configuration
1812
DB_DATABASE=coolify
1913
DB_USERNAME=coolify
@@ -27,6 +21,16 @@ RAY_ENABLED=false
2721
# Set custom ray port
2822
RAY_PORT=
2923

24+
# Clockwork Configuration
25+
CLOCKWORK_ENABLED=false
26+
CLOCKWORK_QUEUE_COLLECT=true
27+
28+
# Enable Laravel Telescope for debugging
29+
TELESCOPE_ENABLED=false
30+
31+
# Selenium Driver URL for Dusk
32+
DUSK_DRIVER_URL=http://selenium:4444
33+
3034
# Special Keys for Andras
3135
# For cache purging
3236
BUNNY_API_KEY=

.github/workflows/pr-build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ env:
1616
jobs:
1717
amd64:
1818
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
attestations: write
23+
id-token: write
1924
steps:
2025
- uses: actions/checkout@v4
2126
- name: Login to ghcr.io
@@ -37,6 +42,8 @@ jobs:
3742
permissions:
3843
contents: read
3944
packages: write
45+
attestations: write
46+
id-token: write
4047
steps:
4148
- uses: actions/checkout@v4
4249
- name: Login to ghcr.io
@@ -58,6 +65,8 @@ jobs:
5865
permissions:
5966
contents: read
6067
packages: write
68+
attestations: write
69+
id-token: write
6170
needs: [amd64, aarch64]
6271
steps:
6372
- name: Checkout

RELEASE.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Coolify Release Guide
2+
3+
This guide outlines the release process for Coolify, intended for developers and those interested in understanding how releases are managed and deployed.
4+
5+
## Release Process
6+
7+
1. **Development on `next` or separate branches**
8+
- Changes, fixes and new features are developed on the `next` or even separate branches.
9+
10+
2. **Merging to `main`**
11+
- Once changes are ready, they are merged from `next` into the `main` branch.
12+
13+
3. **Building the release**
14+
- After merging to `main`, a new release is built.
15+
- Note: A push to `main` does not automatically mean a new version is released.
16+
17+
4. **Creating a GitHub release**
18+
- A new release is created on GitHub with the new version details.
19+
20+
5. **Updating the CDN**
21+
- The final step is updating the version information on the CDN:
22+
[https://cdn.coollabs.io/coolify/versions.json](https://cdn.coollabs.io/coolify/versions.json)
23+
24+
> [!NOTE]
25+
> The CDN update may not occur immediately after the GitHub release. It can happen hours or even days later due to additional testing, stability checks, or potential hotfixes.
26+
27+
28+
## Version Availability
29+
30+
It's important to understand that a new version released on GitHub may not immediately become available for users to update (through manual or auto-update).
31+
32+
> [!IMPORTANT]
33+
> If you see a new release on GitHub but haven't received the update, it's likely because the CDN hasn't been updated yet. This is intentional and ensures stability and allows for hotfixes before the new version is officially released.
34+
35+
## Manually Update to Specific Versions
36+
37+
> [!CAUTION]
38+
> Updating to unreleased versions is not recommended and may cause issues. Use at your own risk!
39+
40+
To update your Coolify instance to a specific (unreleased) version, use the following command:
41+
42+
```bash
43+
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash -s <version>
44+
```
45+
-> Replace `<version>` with the version you want to update to (for example `4.0.0-beta.332`).

app/Jobs/DatabaseBackupJob.php

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Illuminate\Queue\Middleware\WithoutOverlapping;
2626
use Illuminate\Queue\SerializesModels;
2727
use Illuminate\Support\Str;
28-
use App\Models\InstanceSettings;
28+
use Visus\Cuid2\Cuid2;
2929

3030
class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue
3131
{
@@ -399,6 +399,7 @@ private function backup_standalone_postgresql(string $database): void
399399
$backupCommand .= " $this->container_name pg_dump --format=custom --no-acl --no-owner --username {$this->database->postgres_user} $database > $this->backup_location";
400400

401401
$commands[] = $backupCommand;
402+
ray($commands);
402403
$this->backup_output = instant_remote_process($commands, $this->server);
403404
$this->backup_output = trim($this->backup_output);
404405
if ($this->backup_output === '') {
@@ -480,6 +481,7 @@ private function remove_old_backups(): void
480481
private function upload_to_s3(): void
481482
{
482483
try {
484+
ray($this->backup_location);
483485
if (is_null($this->s3)) {
484486
return;
485487
}
@@ -489,62 +491,20 @@ private function upload_to_s3(): void
489491
$bucket = $this->s3->bucket;
490492
$endpoint = $this->s3->endpoint;
491493
$this->s3->testConnection(shouldSave: true);
492-
if (data_get($this->backup, 'database_type') === 'App\Models\ServiceDatabase') {
493-
$network = $this->database->service->destination->network;
494-
} else {
495-
$network = $this->database->destination->network;
496-
}
497-
498-
$this->ensureHelperImageAvailable();
494+
$configName = new Cuid2;
499495

500-
$fullImageName = $this->getFullImageName();
501-
$commands[] = "docker run -d --network {$network} --name backup-of-{$this->backup->uuid} --rm -v $this->backup_location:$this->backup_location:ro {$fullImageName}";
502-
$commands[] = "docker exec backup-of-{$this->backup->uuid} mc config host add temporary {$endpoint} $key $secret";
503-
$commands[] = "docker exec backup-of-{$this->backup->uuid} mc cp $this->backup_location temporary/$bucket{$this->backup_dir}/";
496+
$s3_copy_dir = str($this->backup_location)->replace(backup_dir(), '/var/www/html/storage/app/backups/');
497+
$commands[] = "docker exec coolify bash -c 'mc config host add {$configName} {$endpoint} $key $secret'";
498+
$commands[] = "docker exec coolify bash -c 'mc cp $s3_copy_dir {$configName}/{$bucket}{$this->backup_dir}/'";
504499
instant_remote_process($commands, $this->server);
505500
$this->add_to_backup_output('Uploaded to S3.');
506501
} catch (\Throwable $e) {
507502
$this->add_to_backup_output($e->getMessage());
508503
throw $e;
509504
} finally {
510-
$command = "docker rm -f backup-of-{$this->backup->uuid}";
511-
instant_remote_process([$command], $this->server);
512-
}
513-
}
514-
515-
private function ensureHelperImageAvailable(): void
516-
{
517-
$fullImageName = $this->getFullImageName();
518-
519-
$imageExists = $this->checkImageExists($fullImageName);
520-
521-
if (!$imageExists) {
522-
$this->pullHelperImage($fullImageName);
505+
$removeConfigCommands[] = "docker exec coolify bash -c 'mc config remove {$configName}'";
506+
$removeConfigCommands[] = "docker exec coolify bash -c 'mc alias rm {$configName}'";
507+
instant_remote_process($removeConfigCommands, $this->server, false);
523508
}
524509
}
525-
526-
private function checkImageExists(string $fullImageName): bool
527-
{
528-
$result = instant_remote_process(["docker image inspect {$fullImageName} >/dev/null 2>&1 && echo 'exists' || echo 'not exists'"], $this->server, false);
529-
return trim($result) === 'exists';
530-
}
531-
532-
private function pullHelperImage(string $fullImageName): void
533-
{
534-
try {
535-
instant_remote_process(["docker pull {$fullImageName}"], $this->server);
536-
} catch (\Exception $e) {
537-
$errorMessage = "Failed to pull helper image: " . $e->getMessage();
538-
$this->add_to_backup_output($errorMessage);
539-
throw new \RuntimeException($errorMessage);
540-
}
541-
}
542-
543-
private function getFullImageName(): string
544-
{
545-
$settings = InstanceSettings::get();
546-
$helperImage = config('coolify.helper_image');
547-
$latestVersion = $settings->helper_version;
548-
return "{$helperImage}:{$latestVersion}";
549-
}
550510
}

app/Models/StandaloneKeydb.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function type(): string
209209
protected function internalDbUrl(): Attribute
210210
{
211211
return new Attribute(
212-
get: fn () => "redis://{$this->keydb_password}@{$this->uuid}:6379/0",
212+
get: fn () => "redis://:{$this->keydb_password}@{$this->uuid}:6379/0",
213213
);
214214
}
215215

@@ -218,7 +218,7 @@ protected function externalDbUrl(): Attribute
218218
return new Attribute(
219219
get: function () {
220220
if ($this->is_public && $this->public_port) {
221-
return "redis://{$this->keydb_password}@{$this->destination->server->getIp}:{$this->public_port}/0";
221+
return "redis://:{$this->keydb_password}@{$this->destination->server->getIp}:{$this->public_port}/0";
222222
}
223223

224224
return null;

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"zircote/swagger-php": "^4.10"
4949
},
5050
"require-dev": {
51+
"itsgoingd/clockwork": "^5.2",
5152
"fakerphp/faker": "^v1.21.0",
5253
"laravel/dusk": "^v8.0",
5354
"laravel/pint": "^1.16",
@@ -110,4 +111,4 @@
110111
},
111112
"minimum-stability": "stable",
112113
"prefer-stable": true
113-
}
114+
}

composer.lock

Lines changed: 76 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)