Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: change emails to lowercase on init

Andras Bacsaif408d603cff0
diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php
index ccb864e1ff..f90afd2192 100644
--- a/app/Console/Commands/Init.php
+++ b/app/Console/Commands/Init.php
@@ -10,6 +10,7 @@ use App\Models\Environment;
use App\Models\ScheduledDatabaseBackup;
use App\Models\Server;
use App\Models\StandalonePostgresql;
+use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Http;
@@ -41,6 +42,7 @@ class Init extends Command
$this->disable_metrics();
$this->replace_slash_in_environment_name();
$this->restore_coolify_db_backup();
+ $this->update_user_emails();
//
$this->update_traefik_labels();
if (! isCloud() || $this->option('force-cloud')) {
@@ -92,6 +94,11 @@ class Init extends Command
}
}
+ private function update_user_emails()
+ {
+ User::whereRaw('email ~ \'[A-Z]\'')->get()->each(fn (User $user) => $user->update(['email' => strtolower($user->email)]));
+ }
+
private function update_traefik_labels()
{
try {