fix: only enable Sentinel for new servers

This commit is contained in:
Andras Bacsai
2024-10-17 10:04:38 +02:00
parent 8c53af088e
commit f600c1b37d
2 changed files with 9 additions and 1 deletions

View File

@@ -55,6 +55,14 @@ class ServerSetting extends Model
'docker_cleanup_threshold' => 'integer',
'sentinel_token' => 'encrypted',
];
protected static function booted()
{
static::creating(function ($setting) {
$setting->is_sentinel_enabled = true;
});
}
public function server()
{
return $this->belongsTo(Server::class);

View File

@@ -17,7 +17,7 @@ return new class extends Migration
$table->dropColumn('metrics_history_days');
$table->dropColumn('is_server_api_enabled');
$table->boolean('is_sentinel_enabled')->default(true);
$table->boolean('is_sentinel_enabled')->default(false);
$table->text('sentinel_token')->nullable();
$table->integer('sentinel_metrics_refresh_rate_seconds')->default(10);
$table->integer('sentinel_metrics_history_days')->default(7);