From d1ab14966b6e89ca91bc4253583602ef1c5d0c63 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 2 May 2024 09:28:29 +0200 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 4/5] 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 5/5] 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 +
  • +
+
+
+
+
+