From c6a7fd405b06c10b69c4346a33a93a3bf78d7725 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 30 Apr 2024 15:00:57 +0200 Subject: [PATCH 01/10] Update version numbers to 4.0.0-beta.272 --- config/sentry.php | 2 +- config/version.php | 2 +- versions.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/sentry.php b/config/sentry.php index 15711e651..75705bd93 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ return [ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.271', + 'release' => '4.0.0-beta.272', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index ebbaefd2a..cf5c01c23 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ Date: Tue, 30 Apr 2024 15:06:49 +0200 Subject: [PATCH 02/10] Add backoff property to SendMessageToDiscordJob.php --- app/Jobs/SendMessageToDiscordJob.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Jobs/SendMessageToDiscordJob.php b/app/Jobs/SendMessageToDiscordJob.php index b9255baaa..31f54f6d6 100644 --- a/app/Jobs/SendMessageToDiscordJob.php +++ b/app/Jobs/SendMessageToDiscordJob.php @@ -20,11 +20,12 @@ class SendMessageToDiscordJob implements ShouldQueue, ShouldBeEncrypted * @var int */ public $tries = 5; + public $backoff = 10; /** * The maximum number of unhandled exceptions to allow before failing. */ - public int $maxExceptions = 3; + public int $maxExceptions = 5; public function __construct( public string $text, From 17e81ab6bddab4bd6dd3df02655b79ce030a8c75 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 30 Apr 2024 15:06:53 +0200 Subject: [PATCH 03/10] Refactor setNotificationChannels method in DeploymentSuccess.php --- app/Notifications/Application/DeploymentSuccess.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/Notifications/Application/DeploymentSuccess.php b/app/Notifications/Application/DeploymentSuccess.php index 322df5cec..816dac19d 100644 --- a/app/Notifications/Application/DeploymentSuccess.php +++ b/app/Notifications/Application/DeploymentSuccess.php @@ -43,15 +43,8 @@ class DeploymentSuccess extends Notification implements ShouldQueue public function via(object $notifiable): array { - $channels = setNotificationChannels($notifiable, 'deployments'); - if (isCloud()) { - $channels = array_filter($channels, function ($channel) { - return $channel !== 'App\Notifications\Channels\EmailChannel'; - }); - } - return $channels; + return setNotificationChannels($notifiable, 'deployments'); } - public function toMail(): MailMessage { $mail = new MailMessage(); From 75d77a36482b93c7f48c00127fd328bac05ea1e9 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 2 May 2024 09:21:54 +0200 Subject: [PATCH 04/10] fix: make s3 name and endpoint required --- app/Livewire/Storage/Create.php | 4 ++-- resources/views/livewire/storage/create.blade.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Livewire/Storage/Create.php b/app/Livewire/Storage/Create.php index d1af807d5..1b2510f5d 100644 --- a/app/Livewire/Storage/Create.php +++ b/app/Livewire/Storage/Create.php @@ -16,13 +16,13 @@ class Create extends Component public string $endpoint; public S3Storage $storage; protected $rules = [ - 'name' => 'nullable|min:3|max:255', + 'name' => 'required|min:3|max:255', 'description' => 'nullable|min:3|max:255', 'region' => 'required|max:255', 'key' => 'required|max:255', 'secret' => 'required|max:255', 'bucket' => 'required|max:255', - 'endpoint' => 'nullable|url|max:255', + 'endpoint' => 'required|url|max:255', ]; protected $validationAttributes = [ 'name' => 'Name', diff --git a/resources/views/livewire/storage/create.blade.php b/resources/views/livewire/storage/create.blade.php index 016a6a1b2..a3ccde461 100644 --- a/resources/views/livewire/storage/create.blade.php +++ b/resources/views/livewire/storage/create.blade.php @@ -2,11 +2,11 @@
S3 Storage used to save backups / files.
- +
- +
From d1ab14966b6e89ca91bc4253583602ef1c5d0c63 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 2 May 2024 09:28:29 +0200 Subject: [PATCH 05/10] fix: able to update source path for predefined volumes --- .../views/livewire/project/shared/storages/show.blade.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/views/livewire/project/shared/storages/show.blade.php b/resources/views/livewire/project/shared/storages/show.blade.php index 3a5733701..5cad3a8f4 100644 --- a/resources/views/livewire/project/shared/storages/show.blade.php +++ b/resources/views/livewire/project/shared/storages/show.blade.php @@ -4,8 +4,12 @@ @if ($isFirst) - + + + Update + @else From 139e258664224a9cde0c554d4411e4265a30173d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 2 May 2024 09:49:10 +0200 Subject: [PATCH 06/10] ui: update resource operations view --- .../shared/resource-operations.blade.php | 77 +++++++++---------- 1 file changed, 36 insertions(+), 41 deletions(-) diff --git a/resources/views/livewire/project/shared/resource-operations.blade.php b/resources/views/livewire/project/shared/resource-operations.blade.php index 6419da632..380b5ba91 100644 --- a/resources/views/livewire/project/shared/resource-operations.blade.php +++ b/resources/views/livewire/project/shared/resource-operations.blade.php @@ -1,58 +1,53 @@

Resource Operations

You can easily make different kind of operations on this resource.
-

Clone

-
-
- Clone this resource to another project / environment. -
-
+

Clone

+
To another project / environment on a different server.
+
+
@foreach ($servers->sortBy('id') as $server) -
-
- @foreach ($server->destinations() as $destination) - - -
-
-
{{ $server->name }}
-
{{ $destination->name }}
-
-
-
-
You are about to clone this resource.
-
- @endforeach -
-
+
Server: {{ $server->name }}
+ @foreach ($server->destinations() as $destination) + + +
+
+
Network
+
{{ $destination->name }}
+
+
+
+
You are about to clone this resource.
+
+ @endforeach @endforeach
-

Move

+

Move

+
Between projects / environments.
-
+
This resource is currently in the {{ $resource->environment->project->name }} / {{ $resource->environment->name }} environment.
-
+
@forelse ($projects as $project) -
- @foreach ($project->environments as $environment) - - -
-
-
{{ $project->name }}
-
environment: {{ $environment->name }} -
-
+
Project: {{ $project->name }}
+ + @foreach ($project->environments as $environment) + + +
+
+
Environment
+
{{ $environment->name }}
- -
You are about to move this resource.
- - @endforeach -
+
+
+
You are about to move this resource.
+
+ @endforeach @empty
No projects found to move to
@endforelse From fe22dfc531bd7afc95b20e9c94c25eccebe21962 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 2 May 2024 11:06:12 +0200 Subject: [PATCH 07/10] fix: get logs with non-root user --- app/Livewire/Project/Shared/GetLogs.php | 28 +++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/app/Livewire/Project/Shared/GetLogs.php b/app/Livewire/Project/Shared/GetLogs.php index 996131f37..e14cd6113 100644 --- a/app/Livewire/Project/Shared/GetLogs.php +++ b/app/Livewire/Project/Shared/GetLogs.php @@ -91,15 +91,35 @@ class GetLogs extends Component if ($this->container) { if ($this->showTimeStamps) { if ($this->server->isSwarm()) { - $sshCommand = generateSshCommand($this->server, "docker service logs -n {$this->numberOfLines} -t {$this->container}"); + $command = "docker service logs -n {$this->numberOfLines} -t {$this->container}"; + if ($this->server->isNonRoot()) { + $command = parseCommandsByLineForSudo(collect($command), $this->server); + $command = $command[0]; + } + $sshCommand = generateSshCommand($this->server, $command); } else { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}"); + $command = "docker logs -n {$this->numberOfLines} -t {$this->container}"; + if ($this->server->isNonRoot()) { + $command = parseCommandsByLineForSudo(collect($command), $this->server); + $command = $command[0]; + } + $sshCommand = generateSshCommand($this->server, $command); } } else { if ($this->server->isSwarm()) { - $sshCommand = generateSshCommand($this->server, "docker service logs -n {$this->numberOfLines} {$this->container}"); + $command = "docker service logs -n {$this->numberOfLines} {$this->container}"; + if ($this->server->isNonRoot()) { + $command = parseCommandsByLineForSudo(collect($command), $this->server); + $command = $command[0]; + } + $sshCommand = generateSshCommand($this->server, $command); } else { - $sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} {$this->container}"); + $command = "docker logs -n {$this->numberOfLines} {$this->container}"; + if ($this->server->isNonRoot()) { + $command = parseCommandsByLineForSudo(collect($command), $this->server); + $command = $command[0]; + } + $sshCommand = generateSshCommand($this->server, $command); } } if ($refresh) { From 959a03214aee7254f5f3f15fc5730224c10df9d3 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 2 May 2024 11:45:53 +0200 Subject: [PATCH 08/10] fix: mongo 4.0 db backup --- app/Jobs/DatabaseBackupJob.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index a09ebeada..ed9694536 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -318,10 +318,15 @@ class DatabaseBackupJob implements ShouldQueue, ShouldBeEncrypted private function backup_standalone_mongodb(string $databaseWithCollections): void { try { + ray($this->database->toArray()); $url = $this->database->get_db_url(useInternal: true); if ($databaseWithCollections === 'all') { $commands[] = "mkdir -p " . $this->backup_dir; - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --gzip --archive > $this->backup_location"; + if (str($this->database->image)->startsWith('mongo:4.0')) { + $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --archive > $this->backup_location"; + } else { + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --gzip --archive > $this->backup_location"; + } } else { if (str($databaseWithCollections)->contains(':')) { $databaseName = str($databaseWithCollections)->before(':'); @@ -332,9 +337,17 @@ class DatabaseBackupJob implements ShouldQueue, ShouldBeEncrypted } $commands[] = "mkdir -p " . $this->backup_dir; if ($collectionsToExclude->count() === 0) { - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --archive > $this->backup_location"; + if (str($this->database->image)->startsWith('mongo:4.0')) { + $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --archive > $this->backup_location"; + } else { + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --archive > $this->backup_location"; + } } else { - $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --excludeCollection " . $collectionsToExclude->implode(' --excludeCollection ') . " --archive > $this->backup_location"; + if (str($this->database->image)->startsWith('mongo:4.0')) { + $commands[] = "docker exec $this->container_name mongodump --uri=$url --gzip --excludeCollection " . $collectionsToExclude->implode(' --excludeCollection ') . " --archive > $this->backup_location"; + } else { + $commands[] = "docker exec $this->container_name mongodump --authenticationDatabase=admin --uri=$url --db $databaseName --gzip --excludeCollection " . $collectionsToExclude->implode(' --excludeCollection ') . " --archive > $this->backup_location"; + } } } $this->backup_output = instant_remote_process($commands, $this->server); From 0452a4e1acffc26c495e65fdb9b0dd80d32725fa Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 2 May 2024 12:27:04 +0200 Subject: [PATCH 09/10] feat: the final pricing plan, pay-as-you-go --- config/constants.php | 2 + resources/views/livewire/dashboard.blade.php | 8 +- .../livewire/subscription/actions.blade.php | 36 +++- .../livewire/subscription/index.blade.php | 2 +- .../subscription/pricing-plans-new.blade.php | 120 ------------ .../subscription/pricing-plans-old.blade.php | 67 +++++++ .../subscription/pricing-plans.blade.php | 180 +++++++++++------- 7 files changed, 215 insertions(+), 200 deletions(-) delete mode 100644 resources/views/livewire/subscription/pricing-plans-new.blade.php create mode 100644 resources/views/livewire/subscription/pricing-plans-old.blade.php diff --git a/config/constants.php b/config/constants.php index 091c60996..53f43ae5a 100644 --- a/config/constants.php +++ b/config/constants.php @@ -32,6 +32,7 @@ return [ 'basic' => env('LIMIT_SERVER_BASIC', 2), 'pro' => env('LIMIT_SERVER_PRO', 10), 'ultimate' => env('LIMIT_SERVER_ULTIMATE', 25), + 'dynamic' => env('LIMIT_SERVER_DYNAMIC', 2), ], 'email' => [ 'zero' => true, @@ -39,6 +40,7 @@ return [ 'basic' => true, 'pro' => true, 'ultimate' => true, + 'dynamic' => true, ], ], ]; diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php index 55177d4b7..28850d5e9 100644 --- a/resources/views/livewire/dashboard.blade.php +++ b/resources/views/livewire/dashboard.blade.php @@ -5,14 +5,14 @@

Dashboard

Your self-hosted infrastructure.
@if (request()->query->get('success')) -
+
+ d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /> - Your subscription has been activated! Welcome onboard!
It could take a few seconds before your - subscription is activated.
Please be patient.
+ Your subscription has been activated! Welcome onboard!
It could take a few seconds before your + subscription is activated.
Please be patient.
@endif

Projects

diff --git a/resources/views/livewire/subscription/actions.blade.php b/resources/views/livewire/subscription/actions.blade.php index 013889969..5f9d3789a 100644 --- a/resources/views/livewire/subscription/actions.blade.php +++ b/resources/views/livewire/subscription/actions.blade.php @@ -3,34 +3,50 @@

Your current plan

Tier: {{ data_get(currentTeam(), 'subscription')->type() }}
+ class="dark:text-warning"> + @if (data_get(currentTeam(), 'subscription')->type() == 'dynamic') + Pay-as-you-go + @else + {{ data_get(currentTeam(), 'subscription')->type() }} + @endif + +
@if (currentTeam()->subscription->stripe_cancel_at_period_end) -
Subscription is active but on cancel period.
+
Subscription is active but on cancel period.
@else -
Subscription is active. Last invoice is +
Subscription is active. Last invoice is {{ currentTeam()->subscription->stripe_invoice_paid ? 'paid' : 'not paid' }}.
@endif -
Number of paid servers: {{ $server_limits }}
-
Currently active servers: {{ currentTeam()->servers->count() }}
+
+
Number of paid servers:
+
{{ $server_limits }}
+
+
+
Currently active servers:
+
{{ currentTeam()->servers->count() }}
+
@if (currentTeam()->serverOverflow())
WARNING: You must delete {{ currentTeam()->servers->count() - $server_limits }} servers, or upgrade your subscription. {{ currentTeam()->servers->count() - $server_limits }} servers will be deactivated.
@endif + Change Server Quantity +

Manage your subscription

Cancel, upgrade or downgrade your subscription.
- Go to + Go to - + +
- If you have any problem, please contact us.
@endif @@ -40,7 +56,7 @@ @if (currentTeam()->subscription->lemon_status === 'cancelled')
Subscriptions ends at: {{ getRenewDate() }}
@else diff --git a/resources/views/livewire/subscription/index.blade.php b/resources/views/livewire/subscription/index.blade.php index 4c2a03374..d4525fd32 100644 --- a/resources/views/livewire/subscription/index.blade.php +++ b/resources/views/livewire/subscription/index.blade.php @@ -20,7 +20,7 @@
@endif - @if (config('subscription.provider') !== null) + @if (config('subscription.provider') === 'stripe') @endif
diff --git a/resources/views/livewire/subscription/pricing-plans-new.blade.php b/resources/views/livewire/subscription/pricing-plans-new.blade.php deleted file mode 100644 index e1a9dbfbf..000000000 --- a/resources/views/livewire/subscription/pricing-plans-new.blade.php +++ /dev/null @@ -1,120 +0,0 @@ -
-
-
-
- Payment frequency - - -
-
-
-
Save 10% annually with the yearly plans. -
-
-
-
-
-
-
-
For the detailed list of features, please visit our landing page: coolify.io
-
-
-

Dynamic

-

- - $5 - for the first 2 servers - - - - $4 - /month + VAT - -

-

- - $3 - for any additional - - - - $4 - /month + VAT - -

- - billed monthly (+VAT) - - - billed annually - - - {{ $isTrial ? 'Start Trial' : 'Subscribe' }} - - - {{ $isTrial ? 'Start Trial' : 'Subscribe' }} - -

Begin hosting your own services in the - cloud. -

-
    -
  • - - Connect 2 servers -
  • -
  • - - Included Email System -
  • -
  • - - Email Support -
  • -
  • - - - - - - - + All upcoming features -
  • -
-
-
-
-
-
diff --git a/resources/views/livewire/subscription/pricing-plans-old.blade.php b/resources/views/livewire/subscription/pricing-plans-old.blade.php new file mode 100644 index 000000000..e4a3cc762 --- /dev/null +++ b/resources/views/livewire/subscription/pricing-plans-old.blade.php @@ -0,0 +1,67 @@ + + @if (config('subscription.provider') === 'stripe') + + + {{ $isTrial ? 'Start Trial' : 'Subscribe' }} + + + + {{ $isTrial ? 'Start Trial' : 'Subscribe' }} + + + + + {{ $isTrial ? 'Start Trial' : 'Subscribe' }} + + + {{ $isTrial ? 'Start Trial' : 'Subscribe' }} + + + + + {{ $isTrial ? 'Start Trial' : 'Subscribe' }} + + + {{ $isTrial ? 'Start Trial' : 'Subscribe' }} + + + @endif + @if (config('subscription.provider') === 'paddle') + + @endif + @if (config('subscription.provider') === 'lemon') + + Subscribe + + + Subscribe + + + + Subscribe + + + Subscribe + + + + Subscribe + + + Subscribe + + + @endif + diff --git a/resources/views/livewire/subscription/pricing-plans.blade.php b/resources/views/livewire/subscription/pricing-plans.blade.php index e4a3cc762..200568159 100644 --- a/resources/views/livewire/subscription/pricing-plans.blade.php +++ b/resources/views/livewire/subscription/pricing-plans.blade.php @@ -1,67 +1,117 @@ - - @if (config('subscription.provider') === 'stripe') - - - {{ $isTrial ? 'Start Trial' : 'Subscribe' }} - +
+
+
+
+ Payment frequency + + +
+
+
+
Save 10% annually with the yearly plans. +
+
+
+
+
+
+
+ {{--
For the detailed list of features, please visit our landing page: coolify.io
--}} +
+
+

Pay-as-you-go

+

+ + $5 + for the first 2 + - - {{ $isTrial ? 'Start Trial' : 'Subscribe' }} - - - - - {{ $isTrial ? 'Start Trial' : 'Subscribe' }} - + + $4 + /month + VAT + +

+

+ + $3 + for any additional servers + - {{ $isTrial ? 'Start Trial' : 'Subscribe' }} - - - - - {{ $isTrial ? 'Start Trial' : 'Subscribe' }} - - - {{ $isTrial ? 'Start Trial' : 'Subscribe' }} - - - @endif - @if (config('subscription.provider') === 'paddle') - - @endif - @if (config('subscription.provider') === 'lemon') - - Subscribe - - - Subscribe - - - - Subscribe - - - Subscribe - - - - Subscribe - - - Subscribe - - - @endif - + + $4 + /month + VAT + +

+ + billed monthly (+VAT) + + + billed annually + + + Subscribe + + + Subscribe + +
    +
  • + + Connect unlimited servers +
  • +
  • + + Free Email Notifications +
  • +
  • + + Support by Email +
  • +
  • + + + + + + + + All upcoming features +
  • +
+
+
+
+
+
From d874c71e0b7d1926dddc3205fe93634bff36af58 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 2 May 2024 13:01:10 +0200 Subject: [PATCH 10/10] Update pricing plan details in pricing-plans.blade.php --- .../subscription/pricing-plans.blade.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/views/livewire/subscription/pricing-plans.blade.php b/resources/views/livewire/subscription/pricing-plans.blade.php index 200568159..4ad41f67a 100644 --- a/resources/views/livewire/subscription/pricing-plans.blade.php +++ b/resources/views/livewire/subscription/pricing-plans.blade.php @@ -36,30 +36,30 @@

$5 - for the first 2 + for 2 servers $4 - /month + VAT + for 2 servers

-

+

$3 - for any additional servers + per server from 3+ servers - $4 - /month + VAT + $2.7 + per server from 3+ servers

- billed monthly (+VAT) + billed monthly (+VAT) - billed annually + billed annually (+VAT)