Merge pull request #1502 from coollabsio/next

v4.0.0-beta.149
This commit is contained in:
Andras Bacsai 2023-11-29 17:05:28 +01:00 committed by GitHub
commit db4a4c74fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 46 additions and 38 deletions

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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) {

View File

@ -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,

View File

@ -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'),

View File

@ -1,3 +1,3 @@
<?php
return '4.0.0-beta.148';
return '4.0.0-beta.149';

View File

@ -21,8 +21,11 @@ class="sr-only">
</label>
</fieldset>
</div>
<div class="py-2 text-center"><span class="font-bold text-warning">{{ config('constants.limits.trial_period') }}
days trial</span> included on all plans, without credit card details.</div>
@if (config('constants.limits.trial_period') > 0)
<div class="py-2 text-center"><span
class="font-bold text-warning">{{ config('constants.limits.trial_period') }}
days trial</span> included on all plans, without credit card details.</div>
@endif
<div x-show="selected === 'monthly'" class="flex justify-center h-10 mt-3 text-sm leading-6 ">
<div>Save <span class="font-bold text-warning">10%</span> annually with the yearly plans.
</div>
@ -255,8 +258,8 @@ class="grid max-w-sm grid-cols-1 -mt-16 divide-y divide-coolgray-500 isolate gap
<div class="flex items-start gap-4 text-xl tracking-tight">Need official support for
your self-hosted instance?
<x-forms.button>
<a class="font-bold text-white hover:no-underline"
href="{{ config('coolify.docs') }}">Contact Us</a>
<a class="font-bold text-white hover:no-underline" href="{{ config('coolify.docs') }}">Contact
Us</a>
</x-forms.button>
</div>
</div>

View File

@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
"version": "4.0.0-beta.148"
"version": "4.0.0-beta.149"
}
}
}