refactor: server limit

remove envs from constants related to server limit
This commit is contained in:
Andras Bacsai
2024-12-28 14:10:26 +01:00
parent 7c4e62ec67
commit 2b8c559662
2 changed files with 2 additions and 34 deletions

View File

@@ -120,22 +120,10 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, Sen
return Attribute::make( return Attribute::make(
get: function () { get: function () {
if (config('constants.coolify.self_hosted') || $this->id === 0) { if (config('constants.coolify.self_hosted') || $this->id === 0) {
$subscription = 'self-hosted'; return 999999999999;
} else {
$subscription = data_get($this, 'subscription');
if (is_null($subscription)) {
$subscription = 'zero';
} else {
$subscription = $subscription->type();
}
}
if ($this->custom_server_limit) {
$serverLimit = $this->custom_server_limit;
} else {
$serverLimit = config('constants.limits.server')[strtolower($subscription)];
} }
return $serverLimit ?? 2; return $this->custom_server_limit ?? 2;
} }
); );
} }

View File

@@ -65,26 +65,6 @@ return [
], ],
], ],
'limits' => [
'trial_period' => 0,
'server' => [
'zero' => 0,
'self-hosted' => 999999999999,
'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,
'self-hosted' => true,
'basic' => true,
'pro' => true,
'ultimate' => true,
'dynamic' => true,
],
],
'sentry' => [ 'sentry' => [
'sentry_dsn' => env('SENTRY_DSN'), 'sentry_dsn' => env('SENTRY_DSN'),
], ],