fix: remove sentinel variable
fix: metrics are disabled by default
This commit is contained in:
parent
768c917a0e
commit
83983bbb32
@ -61,7 +61,7 @@ private function pull_images($schedule)
|
|||||||
{
|
{
|
||||||
$servers = $this->all_servers->where('settings.is_usable', true)->where('settings.is_reachable', true)->where('ip', '!=', '1.2.3.4');
|
$servers = $this->all_servers->where('settings.is_usable', true)->where('settings.is_reachable', true)->where('ip', '!=', '1.2.3.4');
|
||||||
foreach ($servers as $server) {
|
foreach ($servers as $server) {
|
||||||
if (config('coolify.is_sentinel_enabled')) {
|
if ($server->is_metrics_enabled) {
|
||||||
$schedule->job(new PullSentinelImageJob($server))->everyFiveMinutes()->onOneServer();
|
$schedule->job(new PullSentinelImageJob($server))->everyFiveMinutes()->onOneServer();
|
||||||
}
|
}
|
||||||
$schedule->job(new PullHelperImageJob($server))->everyFiveMinutes()->onOneServer();
|
$schedule->job(new PullHelperImageJob($server))->everyFiveMinutes()->onOneServer();
|
||||||
|
@ -50,7 +50,6 @@ public function handle(): void
|
|||||||
}
|
}
|
||||||
if (version_compare($local_version, $version, '<')) {
|
if (version_compare($local_version, $version, '<')) {
|
||||||
StartSentinel::run($this->server, $version, true);
|
StartSentinel::run($this->server, $version, true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ray('Sentinel image is up to date');
|
ray('Sentinel image is up to date');
|
||||||
|
@ -41,19 +41,19 @@ public function uniqueId(): int
|
|||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
if (! $this->server->isServerReady($this->tries)) {
|
if (!$this->server->isServerReady($this->tries)) {
|
||||||
throw new \RuntimeException('Server is not ready.');
|
throw new \RuntimeException('Server is not ready.');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if ($this->server->isFunctional()) {
|
if ($this->server->isFunctional()) {
|
||||||
$this->cleanup(notify: false);
|
$this->cleanup(notify: false);
|
||||||
$this->remove_unnecessary_coolify_yaml();
|
$this->remove_unnecessary_coolify_yaml();
|
||||||
if (config('coolify.is_sentinel_enabled')) {
|
if ($this->server->is_metrics_enabled) {
|
||||||
$this->server->checkSentinel();
|
$this->server->checkSentinel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
send_internal_notification('ServerStatusJob failed with: '.$e->getMessage());
|
send_internal_notification('ServerStatusJob failed with: ' . $e->getMessage());
|
||||||
ray($e->getMessage());
|
ray($e->getMessage());
|
||||||
|
|
||||||
return handleError($e);
|
return handleError($e);
|
||||||
@ -103,7 +103,7 @@ private function remove_unnecessary_coolify_yaml()
|
|||||||
{
|
{
|
||||||
// This will remote the coolify.yaml file from the server as it is not needed on cloud servers
|
// This will remote the coolify.yaml file from the server as it is not needed on cloud servers
|
||||||
if (isCloud() && $this->server->id !== 0) {
|
if (isCloud() && $this->server->id !== 0) {
|
||||||
$file = $this->server->proxyPath().'/dynamic/coolify.yaml';
|
$file = $this->server->proxyPath() . '/dynamic/coolify.yaml';
|
||||||
|
|
||||||
return instant_remote_process([
|
return instant_remote_process([
|
||||||
"rm -f $file",
|
"rm -f $file",
|
||||||
|
@ -14,5 +14,4 @@
|
|||||||
'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper:latest'),
|
'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper:latest'),
|
||||||
'is_horizon_enabled' => env('HORIZON_ENABLED', true),
|
'is_horizon_enabled' => env('HORIZON_ENABLED', true),
|
||||||
'is_scheduler_enabled' => env('SCHEDULER_ENABLED', true),
|
'is_scheduler_enabled' => env('SCHEDULER_ENABLED', true),
|
||||||
'is_sentinel_enabled' => env('SENTINEL_ENABLED', false),
|
|
||||||
];
|
];
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\Server;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('servers', function (Blueprint $table) {
|
||||||
|
$table->boolean('is_metrics_enabled')->default(false)->change();
|
||||||
|
});
|
||||||
|
Server::where('is_metrics_enabled', true)->update(['is_metrics_enabled' => false]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('servers', function (Blueprint $table) {
|
||||||
|
$table->boolean('is_metrics_enabled')->default(true)->change();
|
||||||
|
});
|
||||||
|
Server::where('is_metrics_enabled', false)->update(['is_metrics_enabled' => true]);
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user