Merge branch 'next' into feat-db-ssl
This commit is contained in:
@@ -43,8 +43,18 @@ class S3Storage extends BaseModel
|
||||
public function testConnection(bool $shouldSave = false)
|
||||
{
|
||||
try {
|
||||
set_s3_target($this);
|
||||
Storage::disk('custom-s3')->files();
|
||||
$disk = Storage::build([
|
||||
'driver' => 's3',
|
||||
'region' => $this['region'],
|
||||
'key' => $this['key'],
|
||||
'secret' => $this['secret'],
|
||||
'bucket' => $this['bucket'],
|
||||
'endpoint' => $this['endpoint'],
|
||||
'use_path_style_endpoint' => true,
|
||||
]);
|
||||
// Test the connection by listing files with ListObjectsV2 (S3)
|
||||
$disk->files();
|
||||
|
||||
$this->unusable_email_sent = false;
|
||||
$this->is_usable = true;
|
||||
} catch (\Throwable $e) {
|
||||
@@ -53,13 +63,14 @@ class S3Storage extends BaseModel
|
||||
$mail = new MailMessage;
|
||||
$mail->subject('Coolify: S3 Storage Connection Error');
|
||||
$mail->view('emails.s3-connection-error', ['name' => $this->name, 'reason' => $e->getMessage(), 'url' => route('storage.show', ['storage_uuid' => $this->uuid])]);
|
||||
$users = collect([]);
|
||||
$members = $this->team->members()->get();
|
||||
foreach ($members as $user) {
|
||||
if ($user->isAdmin()) {
|
||||
$users->push($user);
|
||||
}
|
||||
}
|
||||
|
||||
// Load the team with its members and their roles explicitly
|
||||
$team = $this->team()->with(['members' => function ($query) {
|
||||
$query->withPivot('role');
|
||||
}])->first();
|
||||
|
||||
// Get admins directly from the pivot relationship for this specific team
|
||||
$users = $team->members()->wherePivotIn('role', ['admin', 'owner'])->get(['users.id', 'users.email']);
|
||||
foreach ($users as $user) {
|
||||
send_user_an_email($mail, $user->email);
|
||||
}
|
||||
|
||||
@@ -1341,4 +1341,11 @@ $schema://$host {
|
||||
throw new \Exception('Invalid proxy type.');
|
||||
}
|
||||
}
|
||||
|
||||
public function isEmpty()
|
||||
{
|
||||
return $this->applications()->count() == 0 &&
|
||||
$this->databases()->count() == 0 &&
|
||||
$this->services()->count() == 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user