Skip to content

Commit 8ec13aa

Browse files
authored
Merge pull request #4234 from coollabsio/next
v4.0.0-beta.365
2 parents 83f3d86 + 0ce6168 commit 8ec13aa

File tree

13 files changed

+76
-137
lines changed

13 files changed

+76
-137
lines changed

app/Actions/Server/UpdateCoolify.php

+7-13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\Jobs\PullHelperImageJob;
66
use App\Models\Server;
7+
use Illuminate\Support\Sleep;
78
use Lorisleiva\Actions\Concerns\AsAction;
89

910
class UpdateCoolify
@@ -18,6 +19,11 @@ class UpdateCoolify
1819

1920
public function handle($manual_update = false)
2021
{
22+
if (isDev()) {
23+
Sleep::for(10)->seconds();
24+
25+
return;
26+
}
2127
$settings = instanceSettings();
2228
$this->server = Server::find(0);
2329
if (! $this->server) {
@@ -44,19 +50,7 @@ public function handle($manual_update = false)
4450

4551
private function update()
4652
{
47-
if (isDev()) {
48-
remote_process([
49-
'sleep 10',
50-
], $this->server);
51-
52-
return;
53-
}
54-
55-
$all_servers = Server::all();
56-
$servers = $all_servers->where('settings.is_usable', true)->where('settings.is_reachable', true)->where('ip', '!=', '1.2.3.4');
57-
foreach ($servers as $server) {
58-
PullHelperImageJob::dispatch($server);
59-
}
53+
PullHelperImageJob::dispatch($this->server);
6054

6155
instant_remote_process(["docker pull -q ghcr.io/coollabsio/coolify:{$this->latestVersion}"], $this->server, false);
6256

app/Livewire/Upgrade.php

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ public function checkUpdate()
2323
try {
2424
$this->latestVersion = get_latest_version_of_coolify();
2525
$this->isUpgradeAvailable = data_get(InstanceSettings::get(), 'new_version_available', false);
26+
if (isDev()) {
27+
$this->isUpgradeAvailable = true;
28+
}
2629
} catch (\Throwable $e) {
2730
return handleError($e, $this);
2831
}

app/Models/Server.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected static function booted()
6464
$server->forceFill($payload);
6565
});
6666
static::saved(function ($server) {
67-
if ($server->privateKey->isDirty()) {
67+
if ($server->privateKey?->isDirty()) {
6868
refresh_server_connection($server->privateKey);
6969
}
7070
});

config/sentry.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// The release version of your application
99
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
10-
'release' => '4.0.0-beta.364',
10+
'release' => '4.0.0-beta.365',
1111

1212
// When left empty or `null` the Laravel environment will be used
1313
'environment' => config('app.env'),

config/subscription.php

-14
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,7 @@
66
// Stripe
77
'stripe_api_key' => env('STRIPE_API_KEY', null),
88
'stripe_webhook_secret' => env('STRIPE_WEBHOOK_SECRET', null),
9-
'stripe_price_id_basic_monthly' => env('STRIPE_PRICE_ID_BASIC_MONTHLY', null),
10-
'stripe_price_id_basic_yearly' => env('STRIPE_PRICE_ID_BASIC_YEARLY', null),
11-
'stripe_price_id_pro_monthly' => env('STRIPE_PRICE_ID_PRO_MONTHLY', null),
12-
'stripe_price_id_pro_yearly' => env('STRIPE_PRICE_ID_PRO_YEARLY', null),
13-
'stripe_price_id_ultimate_monthly' => env('STRIPE_PRICE_ID_ULTIMATE_MONTHLY', null),
14-
'stripe_price_id_ultimate_yearly' => env('STRIPE_PRICE_ID_ULTIMATE_YEARLY', null),
159
'stripe_excluded_plans' => env('STRIPE_EXCLUDED_PLANS', null),
16-
17-
'stripe_price_id_basic_monthly_old' => env('STRIPE_PRICE_ID_BASIC_MONTHLY_OLD', null),
18-
'stripe_price_id_basic_yearly_old' => env('STRIPE_PRICE_ID_BASIC_YEARLY_OLD', null),
19-
'stripe_price_id_pro_monthly_old' => env('STRIPE_PRICE_ID_PRO_MONTHLY_OLD', null),
20-
'stripe_price_id_pro_yearly_old' => env('STRIPE_PRICE_ID_PRO_YEARLY_OLD', null),
21-
'stripe_price_id_ultimate_monthly_old' => env('STRIPE_PRICE_ID_ULTIMATE_MONTHLY_OLD', null),
22-
'stripe_price_id_ultimate_yearly_old' => env('STRIPE_PRICE_ID_ULTIMATE_YEARLY_OLD', null),
23-
2410
'stripe_price_id_dynamic_monthly' => env('STRIPE_PRICE_ID_DYNAMIC_MONTHLY', null),
2511
'stripe_price_id_dynamic_yearly' => env('STRIPE_PRICE_ID_DYNAMIC_YEARLY', null),
2612
];

config/version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
return '4.0.0-beta.364';
3+
return '4.0.0-beta.365';

docker-compose.prod.yml

+1-21
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ services:
2929
- REDIS_HOST
3030
- REDIS_PASSWORD
3131
- HORIZON_BALANCE
32+
- HORIZON_MIN_PROCESSES
3233
- HORIZON_MAX_PROCESSES
3334
- HORIZON_BALANCE_MAX_SHIFT
3435
- HORIZON_BALANCE_COOLDOWN
@@ -50,29 +51,8 @@ services:
5051
- TERMINAL_HOST
5152
- TERMINAL_PORT
5253
- AUTOUPDATE
53-
- SELF_HOSTED
5454
- SSH_MUX_ENABLED
5555
- SSH_MUX_PERSIST_TIME
56-
- FEEDBACK_DISCORD_WEBHOOK
57-
- WAITLIST
58-
- SUBSCRIPTION_PROVIDER
59-
- STRIPE_API_KEY
60-
- STRIPE_WEBHOOK_SECRET
61-
- STRIPE_PRICE_ID_BASIC_MONTHLY
62-
- STRIPE_PRICE_ID_BASIC_YEARLY
63-
- STRIPE_PRICE_ID_PRO_MONTHLY
64-
- STRIPE_PRICE_ID_PRO_YEARLY
65-
- STRIPE_PRICE_ID_ULTIMATE_MONTHLY
66-
- STRIPE_PRICE_ID_ULTIMATE_YEARLY
67-
- STRIPE_PRICE_ID_DYNAMIC_MONTHLY
68-
- STRIPE_PRICE_ID_DYNAMIC_YEARLY
69-
- STRIPE_PRICE_ID_BASIC_MONTHLY_OLD
70-
- STRIPE_PRICE_ID_BASIC_YEARLY_OLD
71-
- STRIPE_PRICE_ID_PRO_MONTHLY_OLD
72-
- STRIPE_PRICE_ID_PRO_YEARLY_OLD
73-
- STRIPE_PRICE_ID_ULTIMATE_MONTHLY_OLD
74-
- STRIPE_PRICE_ID_ULTIMATE_YEARLY_OLD
75-
- STRIPE_EXCLUDED_PLANS
7656
ports:
7757
- "${APP_PORT:-8000}:80"
7858
expose:

other/nightly/docker-compose.prod.yml

+2-22
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ services:
2929
- REDIS_HOST
3030
- REDIS_PASSWORD
3131
- HORIZON_BALANCE
32+
- HORIZON_MIN_PROCESSES
3233
- HORIZON_MAX_PROCESSES
3334
- HORIZON_BALANCE_MAX_SHIFT
3435
- HORIZON_BALANCE_COOLDOWN
@@ -50,29 +51,8 @@ services:
5051
- TERMINAL_HOST
5152
- TERMINAL_PORT
5253
- AUTOUPDATE
53-
- SELF_HOSTED
5454
- SSH_MUX_ENABLED
5555
- SSH_MUX_PERSIST_TIME
56-
- FEEDBACK_DISCORD_WEBHOOK
57-
- WAITLIST
58-
- SUBSCRIPTION_PROVIDER
59-
- STRIPE_API_KEY
60-
- STRIPE_WEBHOOK_SECRET
61-
- STRIPE_PRICE_ID_BASIC_MONTHLY
62-
- STRIPE_PRICE_ID_BASIC_YEARLY
63-
- STRIPE_PRICE_ID_PRO_MONTHLY
64-
- STRIPE_PRICE_ID_PRO_YEARLY
65-
- STRIPE_PRICE_ID_ULTIMATE_MONTHLY
66-
- STRIPE_PRICE_ID_ULTIMATE_YEARLY
67-
- STRIPE_PRICE_ID_DYNAMIC_MONTHLY
68-
- STRIPE_PRICE_ID_DYNAMIC_YEARLY
69-
- STRIPE_PRICE_ID_BASIC_MONTHLY_OLD
70-
- STRIPE_PRICE_ID_BASIC_YEARLY_OLD
71-
- STRIPE_PRICE_ID_PRO_MONTHLY_OLD
72-
- STRIPE_PRICE_ID_PRO_YEARLY_OLD
73-
- STRIPE_PRICE_ID_ULTIMATE_MONTHLY_OLD
74-
- STRIPE_PRICE_ID_ULTIMATE_YEARLY_OLD
75-
- STRIPE_EXCLUDED_PLANS
7656
ports:
7757
- "${APP_PORT:-8000}:80"
7858
expose:
@@ -113,7 +93,7 @@ services:
11393
retries: 10
11494
timeout: 2s
11595
soketi:
116-
image: 'ghcr.io/coollabsio/coolify-realtime:1.0.3'
96+
image: 'ghcr.io/coollabsio/coolify-realtime:1.0.4'
11797
ports:
11898
- "${SOKETI_PORT:-6001}:6001"
11999
- "6002:6002"

other/nightly/upgrade.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/bash
22
## Do not modify this file. You will lose the ability to autoupdate!
33

4-
VERSION="1.2"
4+
VERSION="13"
55
CDN="https://cdn.coollabs.io/coolify-nightly"
66
LATEST_IMAGE=${1:-latest}
77
LATEST_HELPER_VERSION=${2:-latest}
8+
89
DATE=$(date +%Y-%m-%d-%H-%M-%S)
10+
LOGFILE="/data/coolify/source/upgrade-${DATE}.log"
911

1012
curl -fsSL $CDN/docker-compose.yml -o /data/coolify/source/docker-compose.yml
1113
curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml
@@ -32,8 +34,8 @@ docker network create --attachable coolify 2>/dev/null
3234
# docker network create --attachable --driver=overlay coolify-overlay 2>/dev/null
3335

3436
if [ -f /data/coolify/source/docker-compose.custom.yml ]; then
35-
echo "docker-compose.custom.yml detected."
36-
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/coollabsio/coolify-helper:${LATEST_HELPER_VERSION:-latest} bash -c "LATEST_IMAGE=${1:-} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml -f /data/coolify/source/docker-compose.custom.yml up -d --remove-orphans --force-recreate --wait --wait-timeout 60" > /data/coolify/source/upgrade-${DATE}.log 2>&1
37+
echo "docker-compose.custom.yml detected." >> $LOGFILE
38+
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/coollabsio/coolify-helper:${LATEST_HELPER_VERSION} bash -c "LATEST_IMAGE=${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml -f /data/coolify/source/docker-compose.custom.yml up -d --remove-orphans --force-recreate --wait --wait-timeout 60" >> $LOGFILE 2>&1
3739
else
38-
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/coollabsio/coolify-helper:${LATEST_HELPER_VERSION:-latest} bash -c "LATEST_IMAGE=${1:-} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --remove-orphans --force-recreate --wait --wait-timeout 60" > /data/coolify/source/upgrade-${DATE}.log 2>&1
40+
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock --rm ghcr.io/coollabsio/coolify-helper:${LATEST_HELPER_VERSION} bash -c "LATEST_IMAGE=${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --remove-orphans --force-recreate --wait --wait-timeout 60" >> $LOGFILE 2>&1
3941
fi

other/nightly/versions.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"coolify": {
33
"v4": {
4-
"version": "4.0.0-beta.363"
4+
"version": "4.0.0-beta.365"
55
},
66
"nightly": {
7-
"version": "4.0.0-beta.364"
7+
"version": "4.0.0-beta.366"
88
},
99
"helper": {
1010
"version": "1.0.3"
@@ -16,4 +16,4 @@
1616
"version": "0.0.15"
1717
}
1818
}
19-
}
19+
}

resources/views/livewire/upgrade.blade.php

+42-50
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,29 @@
22
x-init="$wire.checkUpdate" x-data="upgradeModal">
33
@if ($isUpgradeAvailable)
44
<div :class="{ 'z-40': modalOpen }" class="relative w-auto h-auto">
5-
<button class="menu-item" @click="modalOpen=true">
6-
@if ($showProgress)
7-
<svg xmlns="http://www.w3.org/2000/svg"
8-
class="w-6 h-6 text-pink-500 transition-colors hover:text-pink-300 lds-heart" viewBox="0 0 24 24"
9-
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
10-
stroke-linejoin="round">
11-
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
12-
<path d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
13-
</svg>
14-
In progress
15-
@else
16-
<svg xmlns="http://www.w3.org/2000/svg"
17-
class="w-6 h-6 text-pink-500 transition-colors hover:text-pink-300" viewBox="0 0 24 24"
18-
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
19-
stroke-linejoin="round">
20-
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
21-
<path
22-
d="M9 12h-3.586a1 1 0 0 1 -.707 -1.707l6.586 -6.586a1 1 0 0 1 1.414 0l6.586 6.586a1 1 0 0 1 -.707 1.707h-3.586v3h-6v-3z" />
23-
<path d="M9 21h6" />
24-
<path d="M9 18h6" />
25-
</svg>
26-
Upgrade
27-
@endif
5+
<button class="menu-item" @click="modalOpen=true" x-show="showProgress">
6+
<svg xmlns="http://www.w3.org/2000/svg"
7+
class="w-6 h-6 text-pink-500 transition-colors hover:text-pink-300 lds-heart" viewBox="0 0 24 24"
8+
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
9+
stroke-linejoin="round">
10+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
11+
<path d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
12+
</svg>
13+
In progress
14+
</button>
15+
<button class="menu-item" @click="modalOpen=true" x-show="!showProgress">
16+
<svg xmlns="http://www.w3.org/2000/svg"
17+
class="w-6 h-6 text-pink-500 transition-colors hover:text-pink-300" viewBox="0 0 24 24"
18+
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
19+
stroke-linejoin="round">
20+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
21+
<path
22+
d="M9 12h-3.586a1 1 0 0 1 -.707 -1.707l6.586 -6.586a1 1 0 0 1 1.414 0l6.586 6.586a1 1 0 0 1 -.707 1.707h-3.586v3h-6v-3z" />
23+
<path d="M9 21h6" />
24+
<path d="M9 18h6" />
25+
</svg>
26+
Upgrade
2827
</button>
29-
3028
<template x-teleport="body">
3129
<div x-show="modalOpen"
3230
class="fixed top-0 lg:pt-10 left-0 z-[99] flex items-start justify-center w-screen h-screen"
@@ -45,15 +43,13 @@ class="absolute inset-0 w-full h-full bg-black bg-opacity-20 backdrop-blur-sm"><
4543
class="relative w-full py-6 border rounded min-w-full lg:min-w-[36rem] max-w-fit bg-neutral-100 border-neutral-400 dark:bg-base px-7 dark:border-coolgray-300">
4644
<div class="flex items-center justify-between pb-3">
4745
<h3 class="text-lg font-semibold">Upgrade confirmation</h3>
48-
@if (!$showProgress)
49-
<button @click="modalOpen=false"
50-
class="absolute top-0 right-0 flex items-center justify-center w-8 h-8 mt-5 mr-5 text-gray-600 rounded-full hover:text-gray-800 hover:bg-gray-50">
51-
<svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none"
52-
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
53-
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
54-
</svg>
55-
</button>
56-
@endif
46+
<button x-show="!showProgress" @click="modalOpen=false"
47+
class="absolute top-0 right-0 flex items-center justify-center w-8 h-8 mt-5 mr-5 text-gray-600 rounded-full hover:text-gray-800 hover:bg-gray-50">
48+
<svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none"
49+
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
50+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
51+
</svg>
52+
</button>
5753
</div>
5854
<div class="relative w-auto pb-8">
5955
<p>Are you sure you would like to upgrade your instance to {{ $latestVersion }}?</p>
@@ -65,22 +61,18 @@ class="absolute top-0 right-0 flex items-center justify-center w-8 h-8 mt-5 mr-5
6561
<a class="font-bold underline dark:text-white" href="https://coolify.io/docs/upgrade"
6662
target="_blank">guide</a> on what to do.
6763
</p>
68-
@if ($showProgress)
69-
<div class="flex flex-col pt-4">
70-
<h2>Progress <x-loading /></h2>
71-
<div x-html="currentStatus"></div>
72-
</div>
73-
@endif
64+
<div class="flex flex-col pt-4" x-show="showProgress">
65+
<h2>Progress <x-loading /></h2>
66+
<div x-html="currentStatus"></div>
67+
</div>
7468
</div>
75-
<div class="flex gap-4">
76-
@if (!$showProgress)
77-
<x-forms.button @click="modalOpen=false"
78-
class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">Cancel
79-
</x-forms.button>
80-
<div class="flex-1"></div>
81-
<x-forms.button @click="confirmed" class="w-24" isHighlighted type="button">Continue
82-
</x-forms.button>
83-
@endif
69+
<div class="flex gap-4" x-show="!showProgress">
70+
<x-forms.button @click="modalOpen=false"
71+
class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">Cancel
72+
</x-forms.button>
73+
<div class="flex-1"></div>
74+
<x-forms.button @click="confirmed" class="w-24" isHighlighted type="button">Continue
75+
</x-forms.button>
8476
</div>
8577
</div>
8678
</div>
@@ -93,12 +85,12 @@ class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">Cancel
9385
document.addEventListener('alpine:init', () => {
9486
Alpine.data('upgradeModal', () => ({
9587
modalOpen: false,
96-
showProgress: @js($showProgress),
88+
showProgress: false,
9789
currentStatus: '',
9890
confirmed() {
91+
this.showProgress = true;
9992
this.$wire.$call('upgrade')
10093
this.upgrade();
101-
this.$wire.showProgress = true;
10294
window.addEventListener('beforeunload', (event) => {
10395
event.preventDefault();
10496
event.returnValue = '';

0 commit comments

Comments
 (0)