Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .env.development.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ DB_PORT=5432
# DB_WRITE_PASSWORD=
# DB_STICKY=true

# Ray Configuration
# Set to true to enable Ray
RAY_ENABLED=false
# Set custom ray port
# RAY_PORT=

# Enable Laravel Telescope for debugging
TELESCOPE_ENABLED=false

Expand Down
2 changes: 0 additions & 2 deletions app/Actions/Database/StartDatabaseProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|St
)
);

ray("Database proxy for {$database->name} disabled due to non-transient error: {$e->getMessage()}");

return;
}

Expand Down
21 changes: 0 additions & 21 deletions app/Actions/Server/DeleteServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,14 @@ public function handle(int $serverId, bool $deleteFromHetzner = false, ?int $het
);
}

ray($server ? 'Deleting server from Coolify' : 'Server already deleted from Coolify, skipping Coolify deletion');

// If server is already deleted from Coolify, skip this part
if (! $server) {
return; // Server already force deleted from Coolify
}

ray('force deleting server from Coolify', ['server_id' => $server->id]);

try {
$server->forceDelete();
} catch (\Throwable $e) {
ray('Failed to force delete server from Coolify', [
'error' => $e->getMessage(),
'server_id' => $server->id,
]);
logger()->error('Failed to force delete server from Coolify', [
'error' => $e->getMessage(),
'server_id' => $server->id,
Expand All @@ -66,27 +58,14 @@ private function deleteFromHetznerById(int $hetznerServerId, ?int $cloudProvider
}

if (! $token) {
ray('No Hetzner token found for team, skipping Hetzner deletion', [
'team_id' => $teamId,
'hetzner_server_id' => $hetznerServerId,
]);

return;
}

$hetznerService = new HetznerService($token->token);
$hetznerService->deleteServer($hetznerServerId);

ray('Deleted server from Hetzner', [
'hetzner_server_id' => $hetznerServerId,
'team_id' => $teamId,
]);
} catch (\Throwable $e) {
ray('Failed to delete server from Hetzner', [
'error' => $e->getMessage(),
'hetzner_server_id' => $hetznerServerId,
'team_id' => $teamId,
]);

// Log the error but don't prevent the server from being deleted from Coolify
logger()->error('Failed to delete server from Hetzner', [
Expand Down
17 changes: 1 addition & 16 deletions app/Jobs/SendWebhookJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ public function handle(): void
return;
}

if (isDev()) {
ray('Sending webhook notification', [
'url' => $this->webhookUrl,
'payload' => $this->payload,
]);
}

try {
$httpOptions = SafeWebhookUrl::httpClientOptions($this->webhookUrl);
} catch (\RuntimeException $e) {
Expand All @@ -75,14 +68,6 @@ public function handle(): void
return;
}

$response = Http::withOptions($httpOptions)->post($this->webhookUrl, $this->payload);

if (isDev()) {
ray('Webhook response', [
'status' => $response->status(),
'body' => $response->body(),
'successful' => $response->successful(),
]);
}
Http::withOptions($httpOptions)->post($this->webhookUrl, $this->payload);
}
}
1 change: 0 additions & 1 deletion app/Jobs/ServerConnectionCheckJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ private function checkHetznerStatus(): void
$this->server->update(['hetzner_server_status' => $status]);
$this->server->hetzner_server_status = $status;
if ($status === 'off') {
ray('Server is powered off, marking as unreachable');
throw new \Exception('Server is powered off');
}
}
Expand Down
2 changes: 0 additions & 2 deletions app/Livewire/GlobalSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ private function loadSearchableItems()
$cacheKey = self::getCacheKey(auth()->user()->currentTeam()->id);

$this->allSearchableItems = Cache::remember($cacheKey, 300, function () {
ray()->showQueries();
$items = collect();
$team = auth()->user()->currentTeam();

Expand Down Expand Up @@ -530,7 +529,6 @@ private function loadSearchableItems()
'search_text' => strtolower($server->name.' '.$server->ip.' '.$server->description.' server servers'),
];
});
ray($servers);
// Get all projects
$projects = Project::ownedByCurrentTeam()
->withCount(['environments', 'applications', 'services'])
Expand Down
14 changes: 0 additions & 14 deletions app/Livewire/Notifications/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ public function saveModel()
$this->syncData(true);
refreshSession();

if (isDev()) {
ray('Webhook settings saved', [
'webhook_enabled' => $this->settings->webhook_enabled,
'webhook_url' => $this->settings->webhook_url,
]);
}

$this->dispatch('success', 'Settings saved.');
}

Expand All @@ -183,13 +176,6 @@ public function sendTestNotification()
try {
$this->authorize('sendTest', $this->settings);

if (isDev()) {
ray('Sending test webhook notification', [
'team_id' => $this->team->id,
'webhook_url' => $this->settings->webhook_url,
]);
}

$this->team->notify(new Test(channel: 'webhook'));
$this->dispatch('success', 'Test notification sent.');
} catch (\Throwable $e) {
Expand Down
1 change: 0 additions & 1 deletion app/Livewire/Project/Shared/Logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ private function getContainersForServer($server)
}
} catch (\Exception $e) {
// Log error but don't fail the entire operation
ray("Error loading containers for server {$server->name}: ".$e->getMessage());

return [];
}
Expand Down
1 change: 0 additions & 1 deletion app/Models/LocalFileVolume.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ public function isReadOnlyVolume(): bool

return false;
} catch (\Throwable $e) {
ray($e->getMessage(), 'Error checking read-only volume');

return false;
}
Expand Down
1 change: 0 additions & 1 deletion app/Models/LocalPersistentVolume.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ public function isReadOnlyVolume(): bool

return false;
} catch (\Throwable $e) {
ray($e->getMessage(), 'Error checking read-only persistent volume');

return false;
}
Expand Down
2 changes: 0 additions & 2 deletions app/Models/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1523,15 +1523,13 @@ private function disableSshMux(): void
public function generateCaCertificate()
{
try {
ray('Generating CA certificate for server', $this->id);
SslHelper::generateSslCertificate(
commonName: 'Coolify CA Certificate',
serverId: $this->id,
isCaCertificate: true,
validityDays: 10 * 365
);
$caCertificate = $this->sslCertificates()->where('is_ca_certificate', true)->first();
ray('CA certificate generated', $caCertificate);
if ($caCertificate) {
$certificateContent = $caCertificate->ssl_certificate;
$caCertPath = config('constants.coolify.base_config_path').'/ssl/';
Expand Down
1 change: 0 additions & 1 deletion app/Models/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,6 @@ public function saveComposeConfigs()
$envs->push('SERVICE_NAME_'.str($serviceName)->replace('-', '_')->replace('.', '_')->upper().'='.$serviceName);
}
} catch (\Exception $e) {
ray($e->getMessage());
}
}

Expand Down
12 changes: 0 additions & 12 deletions app/Notifications/Channels/WebhookChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,11 @@ public function send($notifiable, Notification $notification): void
$webhookSettings = $notifiable->webhookNotificationSettings;

if (! $webhookSettings || ! $webhookSettings->isEnabled() || ! $webhookSettings->webhook_url) {
if (isDev()) {
ray('Webhook notification skipped - not enabled or no URL configured');
}

return;
}

$payload = $notification->toWebhook();

if (isDev()) {
ray('Dispatching webhook notification', [
'notification' => get_class($notification),
'url' => $webhookSettings->webhook_url,
'payload' => $payload,
]);
}

SendWebhookJob::dispatch($payload, $webhookSettings->webhook_url);
}
}
2 changes: 0 additions & 2 deletions app/Notifications/Server/HetznerDeletionFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function __construct(public int $hetznerServerId, public int $teamId, pub

public function via(object $notifiable): array
{
ray('hello');
ray($notifiable);

return $notifiable->getEnabledChannels('hetzner_deletion_failed');
}
Expand Down
11 changes: 2 additions & 9 deletions app/Services/HetznerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Services;

use App\Exceptions\RateLimitException;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Facades\Http;

class HetznerService
Expand All @@ -24,7 +25,7 @@ private function request(string $method, string $endpoint, array $data = [])
->timeout(30)
->retry(3, function (int $attempt, \Exception $exception) {
// Handle rate limiting (429 Too Many Requests)
if ($exception instanceof \Illuminate\Http\Client\RequestException) {
if ($exception instanceof RequestException) {
$response = $exception->response;

if ($response && $response->status() === 429) {
Expand Down Expand Up @@ -129,17 +130,9 @@ public function uploadSshKey(string $name, string $publicKey): array

public function createServer(array $params): array
{
ray('Hetzner createServer request', [
'endpoint' => '/servers',
'params' => $params,
]);

$response = $this->request('post', '/servers', $params);

ray('Hetzner createServer response', [
'response' => $response,
]);

return $response['server'] ?? [];
}

Expand Down
24 changes: 12 additions & 12 deletions app/Traits/ClearsGlobalSearchCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
namespace App\Traits;

use App\Livewire\GlobalSearch;
use App\Models\Application;
use App\Models\Environment;
use App\Models\Project;
use App\Models\Server;
use App\Models\Service;
use Illuminate\Database\Eloquent\Model;

trait ClearsGlobalSearchCache
Expand All @@ -20,7 +25,6 @@ protected static function bootClearsGlobalSearchCache()
}
} catch (\Throwable $e) {
// Silently fail cache clearing - don't break the save operation
ray('Failed to clear global search cache on saving: '.$e->getMessage());
}
});

Expand All @@ -33,7 +37,6 @@ protected static function bootClearsGlobalSearchCache()
}
} catch (\Throwable $e) {
// Silently fail cache clearing - don't break the create operation
ray('Failed to clear global search cache on creation: '.$e->getMessage());
}
});

Expand All @@ -46,7 +49,6 @@ protected static function bootClearsGlobalSearchCache()
}
} catch (\Throwable $e) {
// Silently fail cache clearing - don't break the delete operation
ray('Failed to clear global search cache on deletion: '.$e->getMessage());
}
});
}
Expand All @@ -58,14 +60,14 @@ private function hasSearchableChanges(): bool
$searchableFields = ['name', 'description'];

// Add model-specific searchable fields
if ($this instanceof \App\Models\Application) {
if ($this instanceof Application) {
$searchableFields[] = 'fqdn';
$searchableFields[] = 'docker_compose_domains';
} elseif ($this instanceof \App\Models\Server) {
} elseif ($this instanceof Server) {
$searchableFields[] = 'ip';
} elseif ($this instanceof \App\Models\Service) {
} elseif ($this instanceof Service) {
// Services don't have direct fqdn, but name and description are covered
} elseif ($this instanceof \App\Models\Project || $this instanceof \App\Models\Environment) {
} elseif ($this instanceof Project || $this instanceof Environment) {
// Projects and environments only have name and description as searchable
}
// Database models only have name and description as searchable
Expand All @@ -81,7 +83,6 @@ private function hasSearchableChanges(): bool
return false;
} catch (\Throwable $e) {
// If checking changes fails, assume changes exist to be safe
ray('Failed to check searchable changes: '.$e->getMessage());

return true;
}
Expand All @@ -91,18 +92,18 @@ private function getTeamIdForCache()
{
try {
// For Project models (has direct team_id)
if ($this instanceof \App\Models\Project) {
if ($this instanceof Project) {
return $this->team_id ?? null;
}

// For Environment models (get team_id through project)
if ($this instanceof \App\Models\Environment) {
if ($this instanceof Environment) {
return $this->project?->team_id;
}

// For database models, team is accessed through environment.project.team
if (method_exists($this, 'team')) {
if ($this instanceof \App\Models\Server) {
if ($this instanceof Server) {
$team = $this->team;
} else {
$team = $this->team();
Expand All @@ -120,7 +121,6 @@ private function getTeamIdForCache()
return null;
} catch (\Throwable $e) {
// If we can't determine team ID, return null
ray('Failed to get team ID for cache: '.$e->getMessage());

return null;
}
Expand Down
1 change: 0 additions & 1 deletion app/Traits/SshRetryable.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ protected function executeWithSshRetry(callable $callback, array $context = [],
$lastErrorMessage = '';
// Randomly fail the command with a key exchange error for testing
// if (random_int(1, 10) === 1) { // 10% chance to fail
// ray('SSH key exchange failed: kex_exchange_identification: read: Connection reset by peer');
// throw new \RuntimeException('SSH key exchange failed: kex_exchange_identification: read: Connection reset by peer');
// }
for ($attempt = 0; $attempt < $maxRetries; $attempt++) {
Expand Down
2 changes: 0 additions & 2 deletions bootstrap/helpers/github.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ function getGithubCommitRangeFiles(?GithubApp $source, string $owner, string $re

return $files->pluck('filename')->filter()->values()->toArray();
} catch (Exception $e) {
ray('Error fetching GitHub commit range files: '.$e->getMessage());

return [];
}
Expand All @@ -302,7 +301,6 @@ function getGithubPullRequestFiles(?GithubApp $source, string $owner, string $re

return $files->pluck('filename')->filter()->values()->toArray();
} catch (Exception $e) {
ray('Error fetching GitHub PR files: '.$e->getMessage());

return [];
}
Expand Down
3 changes: 1 addition & 2 deletions bootstrap/helpers/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ function send_internal_notification(string $message): void
try {
$team = Team::find(0);
$team?->notify(new GeneralNotification($message));
} catch (\Throwable $e) {
ray($e->getMessage());
} catch (Throwable) {
}
}

Expand Down
Loading
Loading