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.

resale license check needs to be updated

Andras Bacsaia0031efce098
diff --git a/app/Actions/License/CheckResaleLicense.php b/app/Actions/License/CheckResaleLicense.php
index 8dd456ccd6..12202b13e9 100644
--- a/app/Actions/License/CheckResaleLicense.php
+++ b/app/Actions/License/CheckResaleLicense.php
@@ -4,26 +4,26 @@ namespace App\Actions\License;
use App\Models\InstanceSettings;
use Illuminate\Support\Facades\Http;
+use Lorisleiva\Actions\Concerns\AsAction;
+
class CheckResaleLicense
{
- public function __invoke()
+ use AsAction;
+ public function handle()
{
try {
$settings = InstanceSettings::get();
- $settings->update([
- 'is_resale_license_active' => false,
- ]);
if (isDev()) {
+ $settings->update([
+ 'is_resale_license_active' => true,
+ ]);
return;
}
- if (!$settings->resale_license) {
- return;
- }
+ // if (!$settings->resale_license) {
+ // return;
+ // }
$base_url = config('coolify.license_url');
- if (isDev()) {
- $base_url = 'http://host.docker.internal:8787';
- }
$instance_id = config('app.id');
ray("Checking license key against $base_url/lemon/validate");
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index b627d6729d..c39cb626a9 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -23,7 +23,7 @@ class Kernel extends ConsoleKernel
// Instance Jobs
$schedule->command('horizon:snapshot')->everyMinute();
$schedule->job(new CleanupInstanceStuffsJob)->everyMinute()->onOneServer();
-
+ // $schedule->job(new CheckResaleLicenseJob)->hourly()->onOneServer();
// Server Jobs
$this->check_scheduled_backups($schedule);
$this->check_resources($schedule);
diff --git a/app/Http/Livewire/CheckLicense.php b/app/Http/Livewire/CheckLicense.php
index 3c5d1b8f23..3c2933bfc9 100644
--- a/app/Http/Livewire/CheckLicense.php
+++ b/app/Http/Livewire/CheckLicense.php
@@ -32,7 +32,7 @@ class CheckLicense extends Component
$this->settings->save();
if ($this->settings->resale_license) {
try {
- resolve(CheckResaleLicense::class)();
+ CheckResaleLicense::run();
$this->emit('reloadWindow');
} catch (\Throwable $e) {
session()->flash('error', 'Something went wrong. Please contact support. <br>Error: ' . $e->getMessage());
diff --git a/app/Jobs/CheckResaleLicenseJob.php b/app/Jobs/CheckResaleLicenseJob.php
index 08530aeae1..fbc9515797 100644
--- a/app/Jobs/CheckResaleLicenseJob.php
+++ b/app/Jobs/CheckResaleLicenseJob.php
@@ -21,7 +21,7 @@ class CheckResaleLicenseJob implements ShouldQueue, ShouldBeEncrypted
public function handle(): void
{
try {
- resolve(CheckResaleLicense::class)();
+ CheckResaleLicense::run();
} catch (\Throwable $e) {
send_internal_notification('CheckResaleLicenseJob failed with: ' . $e->getMessage());
ray($e);
diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.php
index 545d92bd5c..163f4449d2 100644
--- a/app/Jobs/ContainerStatusJob.php
+++ b/app/Jobs/ContainerStatusJob.php
@@ -25,7 +25,6 @@ class ContainerStatusJob implements ShouldQueue, ShouldBeEncrypted
public function __construct(public Server $server)
{
- $this->handle();
}
public function middleware(): array
{