This commit is contained in:
Andras Bacsai
2025-01-17 14:00:20 +01:00
parent 6e9960c010
commit ca2c66943c
2 changed files with 8 additions and 8 deletions

View File

@@ -35,10 +35,7 @@ class Init extends Command
}
$this->servers = Server::all();
if (isCloud()) {
echo "Running in cloud mode\n";
} else {
echo "Running in self-hosted mode\n";
if (! isCloud()) {
$this->send_alive_signal();
get_public_ips();
}
@@ -64,7 +61,7 @@ class Init extends Command
try {
$this->pullHelperImage();
} catch (\Throwable $e) {
echo "Error pulling helper image: {$e->getMessage()}\n";
//
}
if (isCloud()) {
@@ -125,7 +122,6 @@ class Init extends Command
try {
User::whereRaw('email ~ \'[A-Z]\'')->get()->each(function (User $user) {
$user->update(['email' => strtolower($user->email)]);
$user->update(['email' => strtolower($user->email)]);
});
} catch (\Throwable $e) {
echo "Error in updating user emails: {$e->getMessage()}\n";
@@ -229,7 +225,6 @@ class Init extends Command
private function send_alive_signal()
{
echo "Sending alive signal...\n";
$id = config('app.id');
$version = config('constants.coolify.version');
$settings = instanceSettings();
@@ -255,7 +250,6 @@ class Init extends Command
}
$queued_inprogress_deployments = ApplicationDeploymentQueue::whereIn('status', [ApplicationDeploymentStatus::IN_PROGRESS->value, ApplicationDeploymentStatus::QUEUED->value])->get();
foreach ($queued_inprogress_deployments as $deployment) {
echo "Marking deployment {$deployment->id} as failed\n";
$deployment->status = ApplicationDeploymentStatus::FAILED->value;
$deployment->save();
}

View File

@@ -23,6 +23,12 @@ class ProductionSeeder extends Seeder
{
$user = 'root';
if (isCloud()) {
echo " Running in cloud mode.\n";
} else {
echo " Running in self-hosted mode.\n";
}
if (User::find(0) !== null && Team::find(0) !== null) {
if (DB::table('team_user')->where('user_id', 0)->first() === null) {
DB::table('team_user')->insert([