diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php index 8f55d2e5c..79994b132 100644 --- a/app/Console/Commands/Init.php +++ b/app/Console/Commands/Init.php @@ -37,14 +37,14 @@ public function handle() $this->cleanup_in_progress_application_deployments(); $this->cleanup_stucked_helper_containers(); } - private function cleanup_stucked_helper_containers() { + private function cleanup_stucked_helper_containers() + { $servers = Server::all(); foreach ($servers as $server) { if ($server->isFunctional()) { CleanupHelperContainersJob::dispatch($server); } } - } private function alive() { @@ -66,7 +66,7 @@ private function alive() // private function cleanup_ssh() // { - // TODO: it will cleanup id.root@host.docker.internal + // TODO: it will cleanup id.root@host.docker.internal // try { // $files = Storage::allFiles('ssh/keys'); // foreach ($files as $file) { @@ -101,15 +101,15 @@ private function cleanup_stucked_resources() $applications = Application::all(); foreach ($applications as $application) { if (!data_get($application, 'environment')) { - ray('Application without environment', $application->name); + echo 'Application without environment' . $application->name . 'deleting\n'; $application->delete(); } if (!$application->destination()) { - ray('Application without destination', $application->name); + echo 'Application without destination' . $application->name . 'deleting\n'; $application->delete(); } if (!data_get($application, 'destination.server')) { - ray('Application without server', $application->name); + echo 'Application without server' . $application->name . 'deleting\n'; $application->delete(); } } @@ -120,15 +120,15 @@ private function cleanup_stucked_resources() $postgresqls = StandalonePostgresql::all(); foreach ($postgresqls as $postgresql) { if (!data_get($postgresql, 'environment')) { - ray('Postgresql without environment', $postgresql->name); + echo 'Postgresql without environment' . $postgresql->name . 'deleting\n'; $postgresql->delete(); } if (!$postgresql->destination()) { - ray('Postgresql without destination', $postgresql->name); + echo 'Postgresql without destination' . $postgresql->name . 'deleting\n'; $postgresql->delete(); } if (!data_get($postgresql, 'destination.server')) { - ray('Postgresql without server', $postgresql->name); + echo 'Postgresql without server' . $postgresql->name . 'deleting\n'; $postgresql->delete(); } } @@ -139,15 +139,15 @@ private function cleanup_stucked_resources() $redis = StandaloneRedis::all(); foreach ($redis as $redis) { if (!data_get($redis, 'environment')) { - ray('Redis without environment', $redis->name); + echo 'Redis without environment' . $redis->name . 'deleting\n'; $redis->delete(); } if (!$redis->destination()) { - ray('Redis without destination', $redis->name); + echo 'Redis without destination' . $redis->name . 'deleting\n'; $redis->delete(); } if (!data_get($redis, 'destination.server')) { - ray('Redis without server', $redis->name); + echo 'Redis without server' . $redis->name . 'deleting\n'; $redis->delete(); } } @@ -159,15 +159,15 @@ private function cleanup_stucked_resources() $mongodbs = StandaloneMongodb::all(); foreach ($mongodbs as $mongodb) { if (!data_get($mongodb, 'environment')) { - ray('Mongodb without environment', $mongodb->name); + echo 'Mongodb without environment' . $mongodb->name . 'deleting\n'; $mongodb->delete(); } if (!$mongodb->destination()) { - ray('Mongodb without destination', $mongodb->name); + echo 'Mongodb without destination' . $mongodb->name . 'deleting\n'; $mongodb->delete(); } if (!data_get($mongodb, 'destination.server')) { - ray('Mongodb without server', $mongodb->name); + echo 'Mongodb without server' . $mongodb->name . 'deleting\n'; $mongodb->delete(); } } @@ -179,15 +179,15 @@ private function cleanup_stucked_resources() $mysqls = StandaloneMysql::all(); foreach ($mysqls as $mysql) { if (!data_get($mysql, 'environment')) { - ray('Mysql without environment', $mysql->name); + echo 'Mysql without environment' . $mysql->name . 'deleting\n'; $mysql->delete(); } if (!$mysql->destination()) { - ray('Mysql without destination', $mysql->name); + echo 'Mysql without destination' . $mysql->name . 'deleting\n'; $mysql->delete(); } if (!data_get($mysql, 'destination.server')) { - ray('Mysql without server', $mysql->name); + echo 'Mysql without server' . $mysql->name . 'deleting\n'; $mysql->delete(); } } @@ -199,15 +199,15 @@ private function cleanup_stucked_resources() $mariadbs = StandaloneMariadb::all(); foreach ($mariadbs as $mariadb) { if (!data_get($mariadb, 'environment')) { - ray('Mariadb without environment', $mariadb->name); + echo 'Mariadb without environment' . $mariadb->name . 'deleting\n'; $mariadb->delete(); } if (!$mariadb->destination()) { - ray('Mariadb without destination', $mariadb->name); + echo 'Mariadb without destination' . $mariadb->name . 'deleting\n'; $mariadb->delete(); } if (!data_get($mariadb, 'destination.server')) { - ray('Mariadb without server', $mariadb->name); + echo 'Mariadb without server' . $mariadb->name . 'deleting\n'; $mariadb->delete(); } } @@ -219,15 +219,15 @@ private function cleanup_stucked_resources() $services = Service::all(); foreach ($services as $service) { if (!data_get($service, 'environment')) { - ray('Service without environment', $service->name); + echo 'Service without environment' . $service->name . 'deleting\n'; $service->delete(); } if (!$service->destination()) { - ray('Service without destination', $service->name); + echo 'Service without destination' . $service->name . 'deleting\n'; $service->delete(); } if (!data_get($service, 'server')) { - ray('Service without server', $service->name); + echo 'Service without server' . $service->name . 'deleting\n'; $service->delete(); } } @@ -238,7 +238,7 @@ private function cleanup_stucked_resources() $serviceApplications = ServiceApplication::all(); foreach ($serviceApplications as $service) { if (!data_get($service, 'service')) { - ray('ServiceApplication without service', $service->name); + echo 'ServiceApplication without service' . $service->name . 'deleting\n'; $service->delete(); } } @@ -249,7 +249,7 @@ private function cleanup_stucked_resources() $serviceDatabases = ServiceDatabase::all(); foreach ($serviceDatabases as $service) { if (!data_get($service, 'service')) { - ray('ServiceDatabase without service', $service->name); + echo 'ServiceDatabase without service' . $service->name . 'deleting\n'; $service->delete(); } } diff --git a/app/Http/Livewire/Subscription/PricingPlans.php b/app/Http/Livewire/Subscription/PricingPlans.php index 77c550d1e..07ee7c792 100644 --- a/app/Http/Livewire/Subscription/PricingPlans.php +++ b/app/Http/Livewire/Subscription/PricingPlans.php @@ -11,6 +11,9 @@ class PricingPlans extends Component public bool $isTrial = false; public function mount() { $this->isTrial = !data_get(currentTeam(),'subscription.stripe_trial_already_ended'); + if (config('constants.limits.trial_period') == 0) { + $this->isTrial = false; + } } public function subscribeStripe($type) { @@ -63,6 +66,7 @@ public function subscribeStripe($type) ]; if (!data_get($team,'subscription.stripe_trial_already_ended')) { + if (config('constants.limits.trial_period') > 0) { $payload['subscription_data'] = [ 'trial_period_days' => config('constants.limits.trial_period'), 'trial_settings' => [ @@ -71,6 +75,7 @@ public function subscribeStripe($type) ] ], ]; + } $payload['payment_method_collection'] = 'if_required'; } $customer = currentTeam()->subscription?->stripe_customer_id ?? null; diff --git a/app/Jobs/CheckLogDrainContainerJob.php b/app/Jobs/CheckLogDrainContainerJob.php index e315728ec..e66a0c08a 100644 --- a/app/Jobs/CheckLogDrainContainerJob.php +++ b/app/Jobs/CheckLogDrainContainerJob.php @@ -47,7 +47,7 @@ public function handle(): void if (!$this->server->isServerReady()) { return; }; - $containers = instant_remote_process(["docker container ls -q"], $this->server); + $containers = instant_remote_process(["docker container ls -q"], $this->server, false); if (!$containers) { return; } diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.php index b99681455..1f20bb264 100644 --- a/app/Jobs/ContainerStatusJob.php +++ b/app/Jobs/ContainerStatusJob.php @@ -47,7 +47,7 @@ public function handle() $containerReplicase = instant_remote_process(["docker service ls --format '{{json .}}'"], $this->server, false); } else { // Precheck for containers - $containers = instant_remote_process(["docker container ls -q"], $this->server); + $containers = instant_remote_process(["docker container ls -q"], $this->server, false); if (!$containers) { return; } @@ -95,7 +95,6 @@ public function handle() $uuid = data_get($labels, 'coolify.name'); } else { $labels = data_get($container, 'Config.Labels'); - $uuid = data_get($labels, 'com.docker.compose.service'); } $containerStatus = data_get($container, 'State.Status'); $containerHealth = data_get($container, 'State.Health.Status', 'unhealthy'); @@ -131,6 +130,7 @@ public function handle() } } } else { + $uuid = data_get($labels, 'com.docker.compose.service'); if ($uuid) { $database = $databases->where('uuid', $uuid)->first(); if ($database) { diff --git a/config/constants.php b/config/constants.php index 4febbf043..7bab10a56 100644 --- a/config/constants.php +++ b/config/constants.php @@ -22,7 +22,7 @@ 'official' => 'https://cdn.coollabs.io/coolify/service-templates.json', ], 'limits' => [ - 'trial_period' => 7, + 'trial_period' => 0, 'server' => [ 'zero' => 0, 'self-hosted' => 999999999999, diff --git a/config/sentry.php b/config/sentry.php index 8acf3d588..207b43867 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -3,11 +3,11 @@ return [ // @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/ - 'dsn' => 'https://396748153b19c469f5ceff50f1664323@o1082494.ingest.sentry.io/4505347448045568', + 'dsn' => 'https://bea22abf110618b07252032aa2e07859@o1082494.ingest.sentry.io/4505347448045568', // 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.148', + 'release' => '4.0.0-beta.149', // 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 b2be1df08..b0a4751e4 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ -
{{ config('constants.limits.trial_period') }} - days trial included on all plans, without credit card details.
+ @if (config('constants.limits.trial_period') > 0) +
{{ config('constants.limits.trial_period') }} + days trial included on all plans, without credit card details.
+ @endif
Save 10% annually with the yearly plans.
@@ -255,8 +258,8 @@ class="grid max-w-sm grid-cols-1 -mt-16 divide-y divide-coolgray-500 isolate gap
Need official support for your self-hosted instance? - Contact Us + Contact + Us
diff --git a/versions.json b/versions.json index 661a44a35..0210ff223 100644 --- a/versions.json +++ b/versions.json @@ -4,7 +4,7 @@ "version": "3.12.36" }, "v4": { - "version": "4.0.0-beta.148" + "version": "4.0.0-beta.149" } } }