v4.0.0-beta.420 (#6008)

* chore(version): update coolify-realtime to version 1.0.9 in docker-compose and versions files

* feat(migration): add is_sentinel_enabled column to server_settings with default true

* fix(migration): update default value handling for is_sentinel_enabled column in server_settings

* feat(seeder): dispatch StartProxy action for each server in ProductionSeeder

* feat(seeder): add CheckAndStartSentinelJob dispatch for each server in ProductionSeeder

* fix(seeder): conditionally dispatch CheckAndStartSentinelJob based on server's sentinel status

* feat(seeder): conditionally dispatch StartProxy action based on proxy check result

* refactor(ui): terminal

* refactor(ui): remove terminal header from execute-container-command view

* refactor(ui): remove unnecessary padding from deployment, backup, and logs sections

* fix(service): disable healthcheck logging for Gotenberg (#6005)

* fix(service): Joplin volume name (#5930)

* chore(version): update coolify version to 4.0.0-beta.420 and nightly version to 4.0.0-beta.421

* fix(server): update sentinelUpdatedAt assignment to use server's sentinel_updated_at property

* feat(service): update Changedetection template (#5937)

* chore(service): changedetection remove unused code

* fix(service): audiobookshelf healthcheck command (#5993)

* refactor(service): update Hoarder to their new name karakeep (#5964)

* fix(service): downgrade Evolution API phone version (#5977)

* feat(service): add Miniflux service (#5843)

* refactor(service): karakeep naming and formatting

* refactor(service): improve miniflux

- improve DB url
- add depends_on
- formatting, naming & order

* feat(service): add Pingvin Share service (#5969)

* fix(service): pingvinshare-with-clamav

- add platform to make clamav work
- formatting

* feat(auth): Add Discord OAuth Provider (#5552)

* feat(auth): Add Clerk OAuth Provider (#5553)

* feat(auth): add Zitadel OAuth Provider (#5490)

* Update composer.lock

* fix(ssh): scp requires square brackets for ipv6 (#6001)

* refactor(core): rename API rate limit ENV

* refactor(ui): simplify container selection form in execute-container-command view

* chore(service): Update Evolution API image to the official one (#6031)

* chore(versions): bump coolify versions to v4.0.0-beta.420 and v4.0.0-beta.421

* fix(github): changing github app breaks the webhook. it does not anymore

* feat(service): enhance service status handling and UI updates

* fix(parser): improve FQDN generation and update environment variable handling

* fix(ui):  enhance status refresh buttons with loading indicators

* fix(ui): update confirmation button text for stopping database and service

* fix(routes): update middleware for deploy route to use 'api.ability:deploy'

* fix(ui): refine API token creation form and update helper text for clarity

* fix(ui): adjust layout of deployments section for improved alignment

* chore(dependencies): update composer dependencies to latest versions including resend-laravel to ^0.19.0 and aws-sdk-php to 3.347.0

* refactor(email): streamline SMTP and resend settings logic for improved clarity

* fix(ui): adjust project grid layout and refine server border styling for better visibility

* fix(ui): update border styling for consistency across components and enhance loading indicators

* feat(cleanup): add functionality to delete teams with no members or servers in CleanupStuckedResources command

* refactor(invitation): rename methods for consistency and enhance invitation deletion logic

* refactor(user): streamline user deletion process and enhance team management logic

* fix(ui): add padding to section headers in settings views for improved spacing

* fix(ui): reduce gap between input fields in email settings for better alignment

* fix(docker): conditionally enable gzip compression in Traefik labels based on configuration

* fix(parser): enable gzip compression conditionally for Pocketbase images and streamline service creation logic

* fix(ui): update padding for trademarks policy and enhance spacing in advanced settings section

* feat(ui): add heart icon and enhance popup messaging for sponsorship support

* feat(settings): add sponsorship popup toggle and corresponding database migration

* fix(ui): correct closing tag for sponsorship link in layout popups

* fix(ui): refine wording in sponsorship donation prompt in layout popups

* fix(ui): update navbar icon color and enhance popup layout for sponsorship support

* Update resources/views/livewire/project/shared/health-checks.blade.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update app/Livewire/Subscription/Index.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix(ui): add target="_blank" to sponsorship links in layout popups for improved user experience

* fix(models): refine comment wording in User model for clarity on user deletion criteria

* Update app/Providers/RouteServiceProvider.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix(models): improve user deletion logic in User model to handle team member roles and prevent deletion if user is alone in root team

* fix(ui): update wording in sponsorship prompt for clarity and engagement

---------

Co-authored-by: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com>
Co-authored-by: Khiet Tam Nguyen <86177399+nktnet1@users.noreply.github.com>
Co-authored-by: Carsten <BanditsBacon@users.noreply.github.com>
Co-authored-by: Alberto Rizzi <48057685+albertorizzi@users.noreply.github.com>
Co-authored-by: Jonas Klesen <deklesen@gmail.com>
Co-authored-by: Stew Night. <22344601+stewnight@users.noreply.github.com>
Co-authored-by: Jeffer Marcelino <jeffersunde72@gmail.com>
Co-authored-by: Lucas Eduardo <lucas59356@gmail.com>
Co-authored-by: CrazyTim71 <118295691+CrazyTim71@users.noreply.github.com>
Co-authored-by: Yassir Elmarissi <yassir.elmarissi@hm.edu>
Co-authored-by: Hauke Schnau <hauke@schnau-lilienthal.de>
Co-authored-by: Darren Sisson <74752850+djsisson@users.noreply.github.com>
Co-authored-by: Alkesh Das <67038642+smad-bro@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
🏔️ Peak
2025-06-26 12:23:08 +02:00
committed by GitHub
parent e0f16e9539
commit d3f85d777c
110 changed files with 1134 additions and 562 deletions

View File

@@ -41,6 +41,6 @@ class StartService
}
}
return remote_process($commands, $service->server, type_uuid: $service->uuid);
return remote_process($commands, $service->server, type_uuid: $service->uuid, callEventOnFinish: 'ServiceStatusChanged');
}
}

View File

@@ -20,6 +20,7 @@ use App\Models\StandaloneMongodb;
use App\Models\StandaloneMysql;
use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
use App\Models\Team;
use Illuminate\Console\Command;
class CleanupStuckedResources extends Command
@@ -36,6 +37,12 @@ class CleanupStuckedResources extends Command
private function cleanup_stucked_resources()
{
try {
$teams = Team::all()->filter(function ($team) {
return $team->members()->count() === 0 && $team->servers()->count() === 0;
});
foreach ($teams as $team) {
$team->delete();
}
$servers = Server::all()->filter(function ($server) {
return $server->isFunctional();
});

View File

@@ -103,7 +103,11 @@ class SshMultiplexingHelper
}
$scp_command .= self::getCommonSshOptions($server, $sshKeyLocation, config('constants.ssh.connection_timeout'), config('constants.ssh.server_interval'), isScp: true);
$scp_command .= "{$source} {$server->user}@{$server->ip}:{$dest}";
if ($server->isIpv6()) {
$scp_command .= "{$source} {$server->user}@[{$server->ip}]:{$dest}";
} else {
$scp_command .= "{$source} {$server->user}@{$server->ip}:{$dest}";
}
return $scp_command;
}

View File

@@ -144,7 +144,7 @@ class Controller extends BaseController
}
}
public function revoke_invitation()
public function revokeInvitation()
{
$invitation = TeamInvitation::whereUuid(request()->route('uuid'))->firstOrFail();
$user = User::whereEmail($invitation->email)->firstOrFail();

View File

@@ -1381,8 +1381,8 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
if (is_object($this->source) && $this->source->getMorphClass() === \App\Models\GithubApp::class && $this->source->is_public === false) {
$repository = githubApi($this->source, "repos/{$this->customRepository}");
$data = data_get($repository, 'data');
if (isset($data->id)) {
$repository_project_id = $data->id;
$repository_project_id = data_get($data, 'id');
if (isset($repository_project_id)) {
if (blank($this->application->repository_project_id) || $this->application->repository_project_id !== $repository_project_id) {
$this->application->repository_project_id = $repository_project_id;
$this->application->save();

View File

@@ -254,10 +254,9 @@ class Email extends Component
'smtpEncryption.required' => 'Encryption type is required.',
]);
$this->settings->resend_enabled = false;
$this->settings->use_instance_email_settings = false;
$this->resendEnabled = false;
$this->useInstanceEmailSettings = false;
if ($this->smtpEnabled) {
$this->settings->resend_enabled = $this->resendEnabled = false;
}
$this->settings->smtp_enabled = $this->smtpEnabled;
$this->settings->smtp_from_address = $this->smtpFromAddress;
@@ -293,11 +292,9 @@ class Email extends Component
'smtpFromAddress.email' => 'Please enter a valid email address.',
'smtpFromName.required' => 'From Name is required.',
]);
$this->settings->smtp_enabled = false;
$this->settings->use_instance_email_settings = false;
$this->smtpEnabled = false;
$this->useInstanceEmailSettings = false;
if ($this->resendEnabled) {
$this->settings->smtp_enabled = $this->smtpEnabled = false;
}
$this->settings->resend_enabled = $this->resendEnabled;
$this->settings->resend_api_key = $this->resendApiKey;

View File

@@ -111,8 +111,19 @@ class Source extends Component
$this->application->update([
'source_id' => $sourceId,
'source_type' => $sourceType,
'repository_project_id' => null,
]);
['repository' => $customRepository] = $this->application->customRepository();
$repository = githubApi($this->application->source, "repos/{$customRepository}");
$data = data_get($repository, 'data');
$repository_project_id = data_get($data, 'id');
if (isset($repository_project_id)) {
if ($this->application->repository_project_id !== $repository_project_id) {
$this->application->repository_project_id = $repository_project_id;
$this->application->save();
}
}
$this->application->refresh();
$this->getSources();
$this->dispatch('success', 'Source updated!');

View File

@@ -6,7 +6,6 @@ use App\Actions\Docker\GetContainersStatus;
use App\Actions\Service\StartService;
use App\Actions\Service\StopService;
use App\Enums\ProcessStatus;
use App\Events\ServiceStatusChanged;
use App\Models\Service;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
@@ -96,7 +95,7 @@ class Heading extends Component
public function start()
{
$activity = StartService::run($this->service, pullLatestImages: true);
$this->dispatch('activityMonitor', $activity->id, ServiceStatusChanged::class);
$this->dispatch('activityMonitor', $activity->id);
}
public function forceDeploy()
@@ -112,7 +111,7 @@ class Heading extends Component
$activity->save();
}
$activity = StartService::run($this->service, pullLatestImages: true, stopBeforeStart: true);
$this->dispatch('activityMonitor', $activity->id, ServiceStatusChanged::class);
$this->dispatch('activityMonitor', $activity->id);
} catch (\Exception $e) {
$this->dispatch('error', $e->getMessage());
}
@@ -136,7 +135,7 @@ class Heading extends Component
return;
}
$activity = StartService::run($this->service, stopBeforeStart: true);
$this->dispatch('activityMonitor', $activity->id, ServiceStatusChanged::class);
$this->dispatch('activityMonitor', $activity->id);
}
public function pullAndRestartEvent()
@@ -148,7 +147,7 @@ class Heading extends Component
return;
}
$activity = StartService::run($this->service, pullLatestImages: true, stopBeforeStart: true);
$this->dispatch('activityMonitor', $activity->id, ServiceStatusChanged::class);
$this->dispatch('activityMonitor', $activity->id);
}
public function render()

View File

@@ -19,7 +19,15 @@ class Proxy extends Component
public ?string $redirect_url = null;
protected $listeners = ['saveConfiguration' => 'submit'];
public function getListeners()
{
$teamId = auth()->user()->currentTeam()->id;
return [
'saveConfiguration' => 'submit',
"echo-private:team.{$teamId},ProxyStatusChangedUI" => '$refresh',
];
}
protected $rules = [
'server.settings.generate_exact_labels' => 'required|boolean',

View File

@@ -69,6 +69,7 @@ class Patches extends Component
{
if (! $this->packageManager || ! $this->osId) {
$this->dispatch('error', message: 'Run “Check for updates” first.');
return;
}

View File

@@ -176,7 +176,7 @@ class Show extends Component
$this->sentinelCustomUrl = $this->server->settings->sentinel_custom_url;
$this->isSentinelEnabled = $this->server->settings->is_sentinel_enabled;
$this->isSentinelDebugEnabled = $this->server->settings->is_sentinel_debug_enabled;
$this->sentinelUpdatedAt = $this->server->settings->updated_at;
$this->sentinelUpdatedAt = $this->server->sentinel_updated_at;
$this->serverTimezone = $this->server->settings->server_timezone;
}
}

View File

@@ -68,6 +68,9 @@ class Index extends Component
#[Validate('boolean')]
public bool $disable_two_step_confirmation;
#[Validate('boolean')]
public bool $is_sponsorship_popup_enabled;
public function render()
{
return view('livewire.settings.index');
@@ -96,6 +99,7 @@ class Index extends Component
$this->update_check_frequency = $this->settings->update_check_frequency;
$this->instance_timezone = $this->settings->instance_timezone;
$this->disable_two_step_confirmation = $this->settings->disable_two_step_confirmation;
$this->is_sponsorship_popup_enabled = $this->settings->is_sponsorship_popup_enabled;
}
}
@@ -134,6 +138,7 @@ class Index extends Component
$this->settings->update_check_frequency = $this->update_check_frequency;
$this->settings->disable_two_step_confirmation = $this->disable_two_step_confirmation;
$this->settings->instance_timezone = $this->instance_timezone;
$this->settings->is_sponsorship_popup_enabled = $this->is_sponsorship_popup_enabled;
if ($isSave) {
$this->settings->save();
$this->dispatch('success', 'Settings updated!');

View File

@@ -3,7 +3,6 @@
namespace App\Livewire\Team;
use App\Models\InstanceSettings;
use App\Models\Team;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
@@ -53,30 +52,12 @@ class AdminView extends Component
}
}
private function finalizeDeletion(User $user, Team $team)
{
$servers = $team->servers;
foreach ($servers as $server) {
$resources = $server->definedResources();
foreach ($resources as $resource) {
$resource->forceDelete();
}
$server->forceDelete();
}
$projects = $team->projects;
foreach ($projects as $project) {
$project->forceDelete();
}
$team->members()->detach($user->id);
$team->delete();
}
public function delete($id, $password)
{
if (! isInstanceAdmin()) {
return redirect()->route('dashboard');
}
if (! data_get(InstanceSettings::get(), 'disable_two_step_confirmation')) {
if (! Hash::check($password, Auth::user()->password)) {
$this->addError('password', 'The provided password is incorrect.');
@@ -84,52 +65,22 @@ class AdminView extends Component
return;
}
}
if (! auth()->user()->isInstanceAdmin()) {
return $this->dispatch('error', 'You are not authorized to delete users');
}
$user = User::find($id);
$teams = $user->teams;
foreach ($teams as $team) {
$user_alone_in_team = $team->members->count() === 1;
if ($team->id === 0) {
if ($user_alone_in_team) {
return $this->dispatch('error', 'User is alone in the root team, cannot delete');
}
}
if ($user_alone_in_team) {
$this->finalizeDeletion($user, $team);
continue;
}
if ($user->isOwner()) {
$found_other_owner_or_admin = $team->members->filter(function ($member) {
return $member->pivot->role === 'owner' || $member->pivot->role === 'admin';
})->where('id', '!=', $user->id)->first();
if ($found_other_owner_or_admin) {
$team->members()->detach($user->id);
continue;
} else {
$found_other_member_who_is_not_owner = $team->members->filter(function ($member) {
return $member->pivot->role === 'member';
})->first();
if ($found_other_member_who_is_not_owner) {
$found_other_member_who_is_not_owner->pivot->role = 'owner';
$found_other_member_who_is_not_owner->pivot->save();
$team->members()->detach($user->id);
} else {
$this->finalizeDeletion($user, $team);
}
continue;
}
} else {
$team->members()->detach($user->id);
}
if (! $user) {
return $this->dispatch('error', 'User not found');
}
try {
$user->delete();
$this->getUsers();
} catch (\Exception $e) {
return $this->dispatch('error', $e->getMessage());
}
$user->delete();
$this->getUsers();
}
public function render()

View File

@@ -3,6 +3,7 @@
namespace App\Livewire\Team;
use App\Models\TeamInvitation;
use App\Models\User;
use Livewire\Component;
class Invitations extends Component
@@ -14,8 +15,13 @@ class Invitations extends Component
public function deleteInvitation(int $invitation_id)
{
try {
$initiation_found = TeamInvitation::ownedByCurrentTeam()->findOrFail($invitation_id);
$initiation_found->delete();
$invitation = TeamInvitation::ownedByCurrentTeam()->findOrFail($invitation_id);
$user = User::whereEmail($invitation->email)->first();
if (filled($user)) {
$user->deleteIfNotVerifiedAndForcePasswordReset();
}
$invitation->delete();
$this->refreshInvitations();
$this->dispatch('success', 'Invitation revoked.');
} catch (\Exception) {

View File

@@ -29,15 +29,15 @@ class InviteLink extends Component
public function viaEmail()
{
$this->generate_invite_link(sendEmail: true);
$this->generateInviteLink(sendEmail: true);
}
public function viaLink()
{
$this->generate_invite_link(sendEmail: false);
$this->generateInviteLink(sendEmail: false);
}
private function generate_invite_link(bool $sendEmail = false)
private function generateInviteLink(bool $sendEmail = false)
{
try {
$this->validate();

View File

@@ -27,6 +27,7 @@ class OauthSetting extends Model
case 'azure':
return filled($this->client_id) && filled($this->client_secret) && filled($this->tenant);
case 'authentik':
case 'clerk':
return filled($this->client_id) && filled($this->client_secret) && filled($this->base_url);
default:
return filled($this->client_id) && filled($this->client_secret);

View File

@@ -2,6 +2,7 @@
namespace App\Models;
use App\Enums\ProcessStatus;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -9,6 +10,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Storage;
use OpenApi\Attributes as OA;
use Spatie\Activitylog\Models\Activity;
use Spatie\Url\Url;
use Visus\Cuid2\Cuid2;
@@ -116,6 +118,18 @@ class Service extends BaseModel
return (bool) str($this->status)->contains('exited');
}
public function isStarting(): bool
{
try {
$activity = Activity::where('properties->type_uuid', $this->uuid)->latest()->first();
$status = data_get($activity, 'properties.status');
return $status === ProcessStatus::QUEUED->value || $status === ProcessStatus::IN_PROGRESS->value;
} catch (\Throwable) {
return false;
}
}
public function type()
{
return 'service';
@@ -159,6 +173,10 @@ class Service extends BaseModel
public function getStatusAttribute()
{
if ($this->isStarting()) {
return 'starting:unhealthy';
}
$applications = $this->applications;
$databases = $this->databases;

View File

@@ -33,6 +33,10 @@ class TeamInvitation extends Model
return true;
} else {
$this->delete();
$user = User::whereEmail($this->email)->first();
if (filled($user)) {
$user->deleteIfNotVerifiedAndForcePasswordReset();
}
return false;
}

View File

@@ -72,6 +72,93 @@ class User extends Authenticatable implements SendsEmail
$new_team = Team::create($team);
$user->teams()->attach($new_team, ['role' => 'owner']);
});
static::deleting(function (User $user) {
\DB::transaction(function () use ($user) {
$teams = $user->teams;
foreach ($teams as $team) {
$user_alone_in_team = $team->members->count() === 1;
// Prevent deletion if user is alone in root team
if ($team->id === 0 && $user_alone_in_team) {
throw new \Exception('User is alone in the root team, cannot delete');
}
if ($user_alone_in_team) {
static::finalizeTeamDeletion($user, $team);
// Delete any pending team invitations for this user
TeamInvitation::whereEmail($user->email)->delete();
continue;
}
// Load the user's role for this team
$userRole = $team->members->where('id', $user->id)->first()?->pivot?->role;
if ($userRole === 'owner') {
$found_other_owner_or_admin = $team->members->filter(function ($member) use ($user) {
return ($member->pivot->role === 'owner' || $member->pivot->role === 'admin') && $member->id !== $user->id;
})->first();
if ($found_other_owner_or_admin) {
$team->members()->detach($user->id);
continue;
} else {
$found_other_member_who_is_not_owner = $team->members->filter(function ($member) {
return $member->pivot->role === 'member';
})->first();
if ($found_other_member_who_is_not_owner) {
$found_other_member_who_is_not_owner->pivot->role = 'owner';
$found_other_member_who_is_not_owner->pivot->save();
$team->members()->detach($user->id);
} else {
static::finalizeTeamDeletion($user, $team);
}
continue;
}
} else {
$team->members()->detach($user->id);
}
}
});
});
}
/**
* Finalize team deletion by cleaning up all associated resources
*/
private static function finalizeTeamDeletion(User $user, Team $team)
{
$servers = $team->servers;
foreach ($servers as $server) {
$resources = $server->definedResources();
foreach ($resources as $resource) {
$resource->forceDelete();
}
$server->forceDelete();
}
$projects = $team->projects;
foreach ($projects as $project) {
$project->forceDelete();
}
$team->members()->detach($user->id);
$team->delete();
}
/**
* Delete the user if they are not verified and have a force password reset.
* This is used to clean up users that have been invited, did not accept the invitation (and did not verify their email and have a force password reset).
*/
public function deleteIfNotVerifiedAndForcePasswordReset()
{
if ($this->hasVerifiedEmail() === false && $this->force_password_reset === true) {
$this->delete();
}
}
public function recreate_personal_team()

View File

@@ -9,9 +9,12 @@ use Illuminate\Foundation\Events\MaintenanceModeEnabled;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use SocialiteProviders\Authentik\AuthentikExtendSocialite;
use SocialiteProviders\Azure\AzureExtendSocialite;
use SocialiteProviders\Clerk\ClerkExtendSocialite;
use SocialiteProviders\Discord\DiscordExtendSocialite;
use SocialiteProviders\Google\GoogleExtendSocialite;
use SocialiteProviders\Infomaniak\InfomaniakExtendSocialite;
use SocialiteProviders\Manager\SocialiteWasCalled;
use SocialiteProviders\Zitadel\ZitadelExtendSocialite;
class EventServiceProvider extends ServiceProvider
{
@@ -25,8 +28,11 @@ class EventServiceProvider extends ServiceProvider
SocialiteWasCalled::class => [
AzureExtendSocialite::class.'@handle',
AuthentikExtendSocialite::class.'@handle',
ClerkExtendSocialite::class.'@handle',
DiscordExtendSocialite::class.'@handle',
GoogleExtendSocialite::class.'@handle',
InfomaniakExtendSocialite::class.'@handle',
ZitadelExtendSocialite::class.'@handle',
],
];

View File

@@ -49,7 +49,7 @@ class RouteServiceProvider extends ServiceProvider
return Limit::perMinute(1000)->by($request->user()?->id ?: $request->ip());
}
return Limit::perMinute(config('api.throttle'))->by($request->user()?->id ?: $request->ip());
return Limit::perMinute((int) config('api.rate_limit'))->by($request->user()?->id ?: $request->ip());
});
RateLimiter::for('5', function (Request $request) {
return Limit::perMinute(5)->by($request->user()?->id ?: $request->ip());