Skip to content

Commit

Permalink
fix: ec2 does not have uptime command lol
Browse files Browse the repository at this point in the history
version++
  • Loading branch information
andrasbacsai committed Feb 15, 2024
1 parent 38d367e commit bba1cb3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 55 deletions.
3 changes: 2 additions & 1 deletion app/Livewire/Boarding/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ public function validateServer()
try {
config()->set('coolify.mux_enabled', false);

instant_remote_process(['uptime'], $this->createdServer, true);
// EC2 does not have `uptime` command, lol
instant_remote_process(['ls'], $this->createdServer, true);

$this->createdServer->settings()->update([
'is_reachable' => true,
Expand Down
3 changes: 2 additions & 1 deletion app/Models/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@ public function validateConnection()
if ($server->skipServer()) {
return false;
}
$uptime = instant_remote_process(['uptime'], $server, false);
// EC2 does not have `uptime` command, lol
$uptime = instant_remote_process(['ls'], $server, false);
if (!$uptime) {
$server->settings()->update([
'is_reachable' => false,
Expand Down
50 changes: 0 additions & 50 deletions bootstrap/helpers/remoteProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,56 +228,6 @@ function refresh_server_connection(?PrivateKey $private_key = null)
}
}

// function validateServer(Server $server, bool $throwError = false)
// {
// try {
// $uptime = instant_remote_process(['uptime'], $server, $throwError);
// if (!$uptime) {
// $server->settings->is_reachable = false;
// $server->team->notify(new Unreachable($server));
// $server->unreachable_notification_sent = true;
// $server->save();
// return [
// "uptime" => null,
// "dockerVersion" => null,
// ];
// }
// $server->settings->is_reachable = true;
// instant_remote_process(["docker ps"], $server, $throwError);
// $dockerVersion = instant_remote_process(["docker version|head -2|grep -i version| awk '{print $2}'"], $server, $throwError);
// if (!$dockerVersion) {
// $dockerVersion = null;
// return [
// "uptime" => $uptime,
// "dockerVersion" => null,
// ];
// }
// $dockerVersion = checkMinimumDockerEngineVersion($dockerVersion);
// if (is_null($dockerVersion)) {
// $server->settings->is_usable = false;
// } else {
// $server->settings->is_usable = true;
// if (data_get($server, 'unreachable_notification_sent') === true) {
// $server->team->notify(new Revived($server));
// $server->unreachable_notification_sent = false;
// $server->save();
// }
// }
// return [
// "uptime" => $uptime,
// "dockerVersion" => $dockerVersion,
// ];
// } catch (\Throwable $e) {
// $server->settings->is_reachable = false;
// $server->settings->is_usable = false;
// throw $e;
// } finally {
// if (data_get($server, 'settings')) {
// $server->settings->save();
// }
// }
// }

function checkRequiredCommands(Server $server)
{
$commands = collect(["jq", "jc"]);
Expand Down
2 changes: 1 addition & 1 deletion config/sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// 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.218',
'release' => '4.0.0-beta.219',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),

Expand Down
2 changes: 1 addition & 1 deletion config/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

return '4.0.0-beta.218';
return '4.0.0-beta.219';
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
"version": "4.0.0-beta.218"
"version": "4.0.0-beta.219"
}
}
}
Expand Down

0 comments on commit bba1cb3

Please sign in to comment.