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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: ui + migrations
Andras Bacsai1257ab6ff46c
diff --git a/app/Livewire/Notifications/Email.php b/app/Livewire/Notifications/Email.phpindex 83debb6fff..dc5a35d669 100644--- a/app/Livewire/Notifications/Email.php+++ b/app/Livewire/Notifications/Email.php@@ -12,6 +12,8 @@ use Livewire\Component;class Email extends Component{+ protected $listeners = ['refresh' => '$refresh'];+public Team $team;public EmailNotificationSettings $settings;@@ -141,9 +143,8 @@ class Email extends Component$this->settings->server_disk_usage_email_notifications = $this->serverDiskUsageEmailNotifications;$this->settings->server_reachable_email_notifications = $this->serverReachableEmailNotifications;$this->settings->server_unreachable_email_notifications = $this->serverUnreachableEmailNotifications;-$this->settings->save();- refreshSession();+} else {$this->smtpEnabled = $this->settings->smtp_enabled;$this->smtpFromAddress = $this->settings->smtp_from_address;@@ -173,7 +174,6 @@ class Email extends Component$this->serverDiskUsageEmailNotifications = $this->settings->server_disk_usage_email_notifications;$this->serverReachableEmailNotifications = $this->settings->server_reachable_email_notifications;$this->serverUnreachableEmailNotifications = $this->settings->server_unreachable_email_notifications;-}}@@ -190,7 +190,6 @@ class Email extends Componentpublic function saveModel(){$this->syncData(true);- refreshSession();$this->dispatch('success', 'Email notifications settings updated.');}@@ -218,6 +217,8 @@ class Email extends Component}return handleError($e, $this);+ } finally {+ $this->dispatch('refresh');}}@@ -261,7 +262,6 @@ class Email extends Component$this->settings->smtp_timeout = $this->smtpTimeout;$this->settings->save();- refreshSession();$this->dispatch('success', 'SMTP settings updated.');} catch (\Throwable $e) {$this->smtpEnabled = false;@@ -297,7 +297,6 @@ class Email extends Component$this->settings->smtp_from_name = $this->smtpFromName;$this->settings->save();- refreshSession();$this->dispatch('success', 'Resend settings updated.');} catch (\Throwable $e) {return handleError($e, $this);diff --git a/database/migrations/2024_12_05_212546_migrate_email_notification_settings_from_teams_table.php b/database/migrations/2024_12_05_212546_migrate_email_notification_settings_from_teams_table.phpindex da635d32de..f9d5ad0b49 100644--- a/database/migrations/2024_12_05_212546_migrate_email_notification_settings_from_teams_table.php+++ b/database/migrations/2024_12_05_212546_migrate_email_notification_settings_from_teams_table.php@@ -13,35 +13,39 @@ return new class extends Migration$teams = DB::table('teams')->get();foreach ($teams as $team) {- DB::table('email_notification_settings')->updateOrInsert(- ['team_id' => $team->id],- [- 'smtp_enabled' => $team->smtp_enabled ?? false,- 'smtp_from_address' => Crypt::encryptString($team->smtp_from_address),- 'smtp_from_name' => Crypt::encryptString($team->smtp_from_name),- 'smtp_recipients' => Crypt::encryptString($team->smtp_recipients),- 'smtp_host' => Crypt::encryptString($team->smtp_host),- 'smtp_port' => $team->smtp_port,- 'smtp_encryption' => $team->smtp_encryption,- 'smtp_username' => Crypt::encryptString($team->smtp_username),- 'smtp_password' => $team->smtp_password,- 'smtp_timeout' => $team->smtp_timeout,+ try {+ DB::table('email_notification_settings')->updateOrInsert(+ ['team_id' => $team->id],+ [+ 'smtp_enabled' => $team->smtp_enabled ?? false,+ 'smtp_from_address' => Crypt::encryptString($team->smtp_from_address),+ 'smtp_from_name' => Crypt::encryptString($team->smtp_from_name),+ 'smtp_recipients' => Crypt::encryptString($team->smtp_recipients),+ 'smtp_host' => Crypt::encryptString($team->smtp_host),+ 'smtp_port' => $team->smtp_port,+ 'smtp_encryption' => $team->smtp_encryption,+ 'smtp_username' => Crypt::encryptString($team->smtp_username),+ 'smtp_password' => $team->smtp_password,+ 'smtp_timeout' => $team->smtp_timeout,- 'use_instance_email_settings' => $team->use_instance_email_settings ?? false,+ 'use_instance_email_settings' => $team->use_instance_email_settings ?? false,- 'resend_enabled' => $team->resend_enabled ?? false,- 'resend_api_key' => $team->resend_api_key,+ 'resend_enabled' => $team->resend_enabled ?? false,+ 'resend_api_key' => $team->resend_api_key,- 'deployment_success_email_notifications' => $team->smtp_notifications_deployments ?? false,- 'deployment_failure_email_notifications' => $team->smtp_notifications_deployments ?? true,- 'backup_success_email_notifications' => $team->smtp_notifications_database_backups ?? false,- 'backup_failure_email_notifications' => $team->smtp_notifications_database_backups ?? true,- 'scheduled_task_success_email_notifications' => $team->smtp_notifications_scheduled_tasks ?? false,- 'scheduled_task_failure_email_notifications' => $team->smtp_notifications_scheduled_tasks ?? true,- 'status_change_email_notifications' => $team->smtp_notifications_status_changes ?? false,- 'server_disk_usage_email_notifications' => $team->smtp_notifications_server_disk_usage ?? true,- ]- );+ 'deployment_success_email_notifications' => $team->smtp_notifications_deployments ?? false,+ 'deployment_failure_email_notifications' => $team->smtp_notifications_deployments ?? true,+ 'backup_success_email_notifications' => $team->smtp_notifications_database_backups ?? false,+ 'backup_failure_email_notifications' => $team->smtp_notifications_database_backups ?? true,+ 'scheduled_task_success_email_notifications' => $team->smtp_notifications_scheduled_tasks ?? false,+ 'scheduled_task_failure_email_notifications' => $team->smtp_notifications_scheduled_tasks ?? true,+ 'status_change_email_notifications' => $team->smtp_notifications_status_changes ?? false,+ 'server_disk_usage_email_notifications' => $team->smtp_notifications_server_disk_usage ?? true,+ ]+ );+ } catch (Exception $e) {+ \Log::error('Error migrating email notification settings from teams table: '.$e->getMessage());+ }}Schema::table('teams', function (Blueprint $table) {@@ -97,30 +101,34 @@ return new class extends Migration$settings = DB::table('email_notification_settings')->get();foreach ($settings as $setting) {- DB::table('teams')- ->where('id', $setting->team_id)- ->update([- 'smtp_enabled' => $setting->smtp_enabled,- 'smtp_from_address' => Crypt::decryptString($setting->smtp_from_address),- 'smtp_from_name' => Crypt::decryptString($setting->smtp_from_name),- 'smtp_recipients' => Crypt::decryptString($setting->smtp_recipients),- 'smtp_host' => Crypt::decryptString($setting->smtp_host),- 'smtp_port' => $setting->smtp_port,- 'smtp_encryption' => $setting->smtp_encryption,- 'smtp_username' => Crypt::decryptString($setting->smtp_username),- 'smtp_password' => $setting->smtp_password,- 'smtp_timeout' => $setting->smtp_timeout,+ try {+ DB::table('teams')+ ->where('id', $setting->team_id)+ ->update([+ 'smtp_enabled' => $setting->smtp_enabled,+ 'smtp_from_address' => $setting->smtp_from_address ? Crypt::decryptString($setting->smtp_from_address) : null,+ 'smtp_from_name' => $setting->smtp_from_name ? Crypt::decryptString($setting->smtp_from_name) : null,+ 'smtp_recipients' => $setting->smtp_recipients ? Crypt::decryptString($setting->smtp_recipients) : null,+ 'smtp_host' => $setting->smtp_host ? Crypt::decryptString($setting->smtp_host) : null,+ 'smtp_port' => $setting->smtp_port,+ 'smtp_encryption' => $setting->smtp_encryption,+ 'smtp_username' => $setting->smtp_username ? Crypt::decryptString($setting->smtp_username) : null,+ 'smtp_password' => $setting->smtp_password,+ 'smtp_timeout' => $setting->smtp_timeout,- 'use_instance_email_settings' => $setting->use_instance_email_settings,+ 'use_instance_email_settings' => $setting->use_instance_email_settings,- 'resend_enabled' => $setting->resend_enabled,- 'resend_api_key' => $setting->resend_api_key,+ 'resend_enabled' => $setting->resend_enabled,+ 'resend_api_key' => $setting->resend_api_key,- 'smtp_notifications_deployments' => $setting->deployment_success_email_notifications || $setting->deployment_failure_email_notifications,- 'smtp_notifications_database_backups' => $setting->backup_success_email_notifications || $setting->backup_failure_email_notifications,- 'smtp_notifications_scheduled_tasks' => $setting->scheduled_task_success_email_notifications || $setting->scheduled_task_failure_email_notifications,- 'smtp_notifications_status_changes' => $setting->status_change_email_notifications,- ]);+ 'smtp_notifications_deployments' => $setting->deployment_success_email_notifications || $setting->deployment_failure_email_notifications,+ 'smtp_notifications_database_backups' => $setting->backup_success_email_notifications || $setting->backup_failure_email_notifications,+ 'smtp_notifications_scheduled_tasks' => $setting->scheduled_task_success_email_notifications || $setting->scheduled_task_failure_email_notifications,+ 'smtp_notifications_status_changes' => $setting->status_change_email_notifications,+ ]);+ } catch (Exception $e) {+ \Log::error('Error migrating email notification settings from teams table: '.$e->getMessage());+ }}}};diff --git a/database/migrations/2024_12_05_212631_migrate_discord_notification_settings_from_teams_table.php b/database/migrations/2024_12_05_212631_migrate_discord_notification_settings_from_teams_table.phpindex 228691acb8..ed9e9af82a 100644--- a/database/migrations/2024_12_05_212631_migrate_discord_notification_settings_from_teams_table.php+++ b/database/migrations/2024_12_05_212631_migrate_discord_notification_settings_from_teams_table.php@@ -16,22 +16,26 @@ return new class extends Migration$teams = DB::table('teams')->get();foreach ($teams as $team) {- DB::table('discord_notification_settings')->updateOrInsert(- ['team_id' => $team->id],- [- 'discord_enabled' => $team->discord_enabled ?? false,- 'discord_webhook_url' => Crypt::encryptString($team->discord_webhook_url),+ try {+ DB::table('discord_notification_settings')->updateOrInsert(+ ['team_id' => $team->id],+ [+ 'discord_enabled' => $team->discord_enabled ?? false,+ 'discord_webhook_url' => $team->discord_webhook_url ? Crypt::encryptString($team->discord_webhook_url) : null,- 'deployment_success_discord_notifications' => $team->discord_notifications_deployments ?? false,- 'deployment_failure_discord_notifications' => $team->discord_notifications_deployments ?? true,- 'backup_success_discord_notifications' => $team->discord_notifications_database_backups ?? false,- 'backup_failure_discord_notifications' => $team->discord_notifications_database_backups ?? true,- 'scheduled_task_success_discord_notifications' => $team->discord_notifications_scheduled_tasks ?? false,- 'scheduled_task_failure_discord_notifications' => $team->discord_notifications_scheduled_tasks ?? true,- 'status_change_discord_notifications' => $team->discord_notifications_status_changes ?? false,- 'server_disk_usage_discord_notifications' => $team->discord_notifications_server_disk_usage ?? true,- ]- );+ 'deployment_success_discord_notifications' => $team->discord_notifications_deployments ?? false,+ 'deployment_failure_discord_notifications' => $team->discord_notifications_deployments ?? true,+ 'backup_success_discord_notifications' => $team->discord_notifications_database_backups ?? false,+ 'backup_failure_discord_notifications' => $team->discord_notifications_database_backups ?? true,+ 'scheduled_task_success_discord_notifications' => $team->discord_notifications_scheduled_tasks ?? false,+ 'scheduled_task_failure_discord_notifications' => $team->discord_notifications_scheduled_tasks ?? true,+ 'status_change_discord_notifications' => $team->discord_notifications_status_changes ?? false,+ 'server_disk_usage_discord_notifications' => $team->discord_notifications_server_disk_usage ?? true,+ ]+ );+ } catch (Exception $e) {+ \Log::error('Error migrating discord notification settings from teams table: '.$e->getMessage());+ }}Schema::table('teams', function (Blueprint $table) {@@ -67,18 +71,22 @@ return new class extends Migration$settings = DB::table('discord_notification_settings')->get();foreach ($settings as $setting) {- DB::table('teams')- ->where('id', $setting->team_id)- ->update([- 'discord_enabled' => $setting->discord_enabled,- 'discord_webhook_url' => Crypt::decryptString($setting->discord_webhook_url),+ try {+ DB::table('teams')+ ->where('id', $setting->team_id)+ ->update([+ 'discord_enabled' => $setting->discord_enabled,+ 'discord_webhook_url' => Crypt::decryptString($setting->discord_webhook_url),- 'discord_notifications_deployments' => $setting->deployment_success_discord_notifications || $setting->deployment_failure_discord_notifications,- 'discord_notifications_status_changes' => $setting->status_change_discord_notifications,- 'discord_notifications_database_backups' => $setting->backup_success_discord_notifications || $setting->backup_failure_discord_notifications,- 'discord_notifications_scheduled_tasks' => $setting->scheduled_task_success_discord_notifications || $setting->scheduled_task_failure_discord_notifications,- 'discord_notifications_server_disk_usage' => $setting->server_disk_usage_discord_notifications,- ]);+ 'discord_notifications_deployments' => $setting->deployment_success_discord_notifications || $setting->deployment_failure_discord_notifications,+ 'discord_notifications_status_changes' => $setting->status_change_discord_notifications,+ 'discord_notifications_database_backups' => $setting->backup_success_discord_notifications || $setting->backup_failure_discord_notifications,+ 'discord_notifications_scheduled_tasks' => $setting->scheduled_task_success_discord_notifications || $setting->scheduled_task_failure_discord_notifications,+ 'discord_notifications_server_disk_usage' => $setting->server_disk_usage_discord_notifications,+ ]);+ } catch (Exception $e) {+ \Log::error('Error migrating discord notification settings from teams table: '.$e->getMessage());+ }}}};diff --git a/database/migrations/2024_12_05_212705_migrate_telegram_notification_settings_from_teams_table.php b/database/migrations/2024_12_05_212705_migrate_telegram_notification_settings_from_teams_table.phpindex d9d4d6b16b..c93569aef5 100644--- a/database/migrations/2024_12_05_212705_migrate_telegram_notification_settings_from_teams_table.php+++ b/database/migrations/2024_12_05_212705_migrate_telegram_notification_settings_from_teams_table.php@@ -13,31 +13,35 @@ return new class extends Migration$teams = DB::table('teams')->get();foreach ($teams as $team) {- DB::table('telegram_notification_settings')->updateOrInsert(- ['team_id' => $team->id],- [- 'telegram_enabled' => $team->telegram_enabled ?? false,- 'telegram_token' => Crypt::encryptString($team->telegram_token),- 'telegram_chat_id' => Crypt::encryptString($team->telegram_chat_id),+ try {+ DB::table('telegram_notification_settings')->updateOrInsert(+ ['team_id' => $team->id],+ [+ 'telegram_enabled' => $team->telegram_enabled ?? false,+ 'telegram_token' => $team->telegram_token ? Crypt::encryptString($team->telegram_token) : null,+ 'telegram_chat_id' => $team->telegram_chat_id ? Crypt::encryptString($team->telegram_chat_id) : null,- 'deployment_success_telegram_notifications' => $team->telegram_notifications_deployments ?? false,- 'deployment_failure_telegram_notifications' => $team->telegram_notifications_deployments ?? true,- 'backup_success_telegram_notifications' => $team->telegram_notifications_database_backups ?? false,- 'backup_failure_telegram_notifications' => $team->telegram_notifications_database_backups ?? true,- 'scheduled_task_success_telegram_notifications' => $team->telegram_notifications_scheduled_tasks ?? false,- 'scheduled_task_failure_telegram_notifications' => $team->telegram_notifications_scheduled_tasks ?? true,- 'status_change_telegram_notifications' => $team->telegram_notifications_status_changes ?? false,- 'server_disk_usage_telegram_notifications' => $team->telegram_notifications_server_disk_usage ?? true,+ 'deployment_success_telegram_notifications' => $team->telegram_notifications_deployments ?? false,+ 'deployment_failure_telegram_notifications' => $team->telegram_notifications_deployments ?? true,+ 'backup_success_telegram_notifications' => $team->telegram_notifications_database_backups ?? false,+ 'backup_failure_telegram_notifications' => $team->telegram_notifications_database_backups ?? true,+ 'scheduled_task_success_telegram_notifications' => $team->telegram_notifications_scheduled_tasks ?? false,+ 'scheduled_task_failure_telegram_notifications' => $team->telegram_notifications_scheduled_tasks ?? true,+ 'status_change_telegram_notifications' => $team->telegram_notifications_status_changes ?? false,+ 'server_disk_usage_telegram_notifications' => $team->telegram_notifications_server_disk_usage ?? true,- 'telegram_notifications_deployment_success_topic_id' => Crypt::encryptString($team->telegram_notifications_deployments_message_thread_id),- 'telegram_notifications_deployment_failure_topic_id' => Crypt::encryptString($team->telegram_notifications_deployments_message_thread_id),- 'telegram_notifications_backup_success_topic_id' => Crypt::encryptString($team->telegram_notifications_database_backups_message_thread_id),- 'telegram_notifications_backup_failure_topic_id' => Crypt::encryptString($team->telegram_notifications_database_backups_message_thread_id),- 'telegram_notifications_scheduled_task_success_topic_id' => Crypt::encryptString($team->telegram_notifications_scheduled_tasks_thread_id),- 'telegram_notifications_scheduled_task_failure_topic_id' => Crypt::encryptString($team->telegram_notifications_scheduled_tasks_thread_id),- 'telegram_notifications_status_change_topic_id' => Crypt::encryptString($team->telegram_notifications_status_changes_message_thread_id),- ]- );+ 'telegram_notifications_deployment_success_topic_id' => $team->telegram_notifications_deployments_message_thread_id ? Crypt::encryptString($team->telegram_notifications_deployments_message_thread_id) : null,+ 'telegram_notifications_deployment_failure_topic_id' => $team->telegram_notifications_deployments_message_thread_id ? Crypt::encryptString($team->telegram_notifications_deployments_message_thread_id) : null,+ 'telegram_notifications_backup_success_topic_id' => $team->telegram_notifications_database_backups_message_thread_id ? Crypt::encryptString($team->telegram_notifications_database_backups_message_thread_id) : null,+ 'telegram_notifications_backup_failure_topic_id' => $team->telegram_notifications_database_backups_message_thread_id ? Crypt::encryptString($team->telegram_notifications_database_backups_message_thread_id) : null,+ 'telegram_notifications_scheduled_task_success_topic_id' => $team->telegram_notifications_scheduled_tasks_thread_id ? Crypt::encryptString($team->telegram_notifications_scheduled_tasks_thread_id) : null,+ 'telegram_notifications_scheduled_task_failure_topic_id' => $team->telegram_notifications_scheduled_tasks_thread_id ? Crypt::encryptString($team->telegram_notifications_scheduled_tasks_thread_id) : null,+ 'telegram_notifications_status_change_topic_id' => $team->telegram_notifications_status_changes_message_thread_id ? Crypt::encryptString($team->telegram_notifications_status_changes_message_thread_id) : null,+ ]+ );+ } catch (Exception $e) {+ \Log::error('Error migrating telegram notification settings from teams table: '.$e->getMessage());+ }}Schema::table('teams', function (Blueprint $table) {@@ -83,24 +87,28 @@ return new class extends Migration$settings = DB::table('telegram_notification_settings')->get();foreach ($settings as $setting) {- DB::table('teams')- ->where('id', $setting->team_id)- ->update([- 'telegram_enabled' => $setting->telegram_enabled,- 'telegram_token' => Crypt::decryptString($setting->telegram_token),- 'telegram_chat_id' => Crypt::decryptString($setting->telegram_chat_id),+ try {+ DB::table('teams')+ ->where('id', $setting->team_id)+ ->update([+ 'telegram_enabled' => $setting->telegram_enabled,+ 'telegram_token' => Crypt::decryptString($setting->telegram_token),+ 'telegram_chat_id' => Crypt::decryptString($setting->telegram_chat_id),- 'telegram_notifications_deployments' => $setting->deployment_success_telegram_notifications || $setting->deployment_failure_telegram_notifications,- 'telegram_notifications_status_changes' => $setting->status_change_telegram_notifications,- 'telegram_notifications_database_backups' => $setting->backup_success_telegram_notifications || $setting->backup_failure_telegram_notifications,- 'telegram_notifications_scheduled_tasks' => $setting->scheduled_task_success_telegram_notifications || $setting->scheduled_task_failure_telegram_notifications,- 'telegram_notifications_server_disk_usage' => $setting->server_disk_usage_telegram_notifications,+ 'telegram_notifications_deployments' => $setting->deployment_success_telegram_notifications || $setting->deployment_failure_telegram_notifications,+ 'telegram_notifications_status_changes' => $setting->status_change_telegram_notifications,+ 'telegram_notifications_database_backups' => $setting->backup_success_telegram_notifications || $setting->backup_failure_telegram_notifications,+ 'telegram_notifications_scheduled_tasks' => $setting->scheduled_task_success_telegram_notifications || $setting->scheduled_task_failure_telegram_notifications,+ 'telegram_notifications_server_disk_usage' => $setting->server_disk_usage_telegram_notifications,- 'telegram_notifications_deployments_message_thread_id' => Crypt::decryptString($setting->telegram_notifications_deployment_success_topic_id),- 'telegram_notifications_status_changes_message_thread_id' => Crypt::decryptString($setting->telegram_notifications_status_change_topic_id),- 'telegram_notifications_database_backups_message_thread_id' => Crypt::decryptString($setting->telegram_notifications_backup_success_topic_id),- 'telegram_notifications_scheduled_tasks_thread_id' => Crypt::decryptString($setting->telegram_notifications_scheduled_task_success_topic_id),- ]);+ 'telegram_notifications_deployments_message_thread_id' => Crypt::decryptString($setting->telegram_notifications_deployment_success_topic_id),+ 'telegram_notifications_status_changes_message_thread_id' => Crypt::decryptString($setting->telegram_notifications_status_change_topic_id),+ 'telegram_notifications_database_backups_message_thread_id' => Crypt::decryptString($setting->telegram_notifications_backup_success_topic_id),+ 'telegram_notifications_scheduled_tasks_thread_id' => Crypt::decryptString($setting->telegram_notifications_scheduled_task_success_topic_id),+ ]);+ } catch (Exception $e) {+ \Log::error('Error migrating telegram notification settings from teams table: '.$e->getMessage());+ }}}};diff --git a/database/migrations/2024_12_10_122142_encrypt_instance_settings_email_columns.php b/database/migrations/2024_12_10_122142_encrypt_instance_settings_email_columns.phpindex 618b8df90d..8ccbcb4f69 100644--- a/database/migrations/2024_12_10_122142_encrypt_instance_settings_email_columns.php+++ b/database/migrations/2024_12_10_122142_encrypt_instance_settings_email_columns.php@@ -15,22 +15,26 @@ return new class extends Migration{if (DB::table('instance_settings')->exists()) {Schema::table('instance_settings', function (Blueprint $table) {- $table->text('smtp_from_address')->change();- $table->text('smtp_from_name')->change();- $table->text('smtp_recipients')->change();- $table->text('smtp_host')->change();- $table->text('smtp_username')->change();+ $table->text('smtp_from_address')->nullable()->change();+ $table->text('smtp_from_name')->nullable()->change();+ $table->text('smtp_recipients')->nullable()->change();+ $table->text('smtp_host')->nullable()->change();+ $table->text('smtp_username')->nullable()->change();});$settings = DB::table('instance_settings')->get();foreach ($settings as $setting) {- DB::table('instance_settings')->where('id', $setting->id)->update([- 'smtp_from_address' => Crypt::encryptString($setting->smtp_from_address),- 'smtp_from_name' => Crypt::encryptString($setting->smtp_from_name),- 'smtp_recipients' => Crypt::encryptString($setting->smtp_recipients),- 'smtp_host' => Crypt::encryptString($setting->smtp_host),- 'smtp_username' => Crypt::encryptString($setting->smtp_username),- ]);+ try {+ DB::table('instance_settings')->where('id', $setting->id)->update([+ 'smtp_from_address' => $setting->smtp_from_address ? Crypt::encryptString($setting->smtp_from_address) : null,+ 'smtp_from_name' => $setting->smtp_from_name ? Crypt::encryptString($setting->smtp_from_name) : null,+ 'smtp_recipients' => $setting->smtp_recipients ? Crypt::encryptString($setting->smtp_recipients) : null,+ 'smtp_host' => $setting->smtp_host ? Crypt::encryptString($setting->smtp_host) : null,+ 'smtp_username' => $setting->smtp_username ? Crypt::encryptString($setting->smtp_username) : null,+ ]);+ } catch (Exception $e) {+ \Log::error('Error encrypting instance settings email columns: '.$e->getMessage());+ }}}}@@ -51,13 +55,17 @@ return new class extends Migrationif (DB::table('instance_settings')->exists()) {$settings = DB::table('instance_settings')->get();foreach ($settings as $setting) {- DB::table('instance_settings')->where('id', $setting->id)->update([- 'smtp_from_address' => Crypt::decryptString($setting->smtp_from_address),- 'smtp_from_name' => Crypt::decryptString($setting->smtp_from_name),- 'smtp_recipients' => Crypt::decryptString($setting->smtp_recipients),- 'smtp_host' => Crypt::decryptString($setting->smtp_host),- 'smtp_username' => Crypt::decryptString($setting->smtp_username),- ]);+ try {+ DB::table('instance_settings')->where('id', $setting->id)->update([+ 'smtp_from_address' => $setting->smtp_from_address ? Crypt::decryptString($setting->smtp_from_address) : null,+ 'smtp_from_name' => $setting->smtp_from_name ? Crypt::decryptString($setting->smtp_from_name) : null,+ 'smtp_recipients' => $setting->smtp_recipients ? Crypt::decryptString($setting->smtp_recipients) : null,+ 'smtp_host' => $setting->smtp_host ? Crypt::decryptString($setting->smtp_host) : null,+ 'smtp_username' => $setting->smtp_username ? Crypt::decryptString($setting->smtp_username) : null,+ ]);+ } catch (Exception $e) {+ \Log::error('Error decrypting instance settings email columns: '.$e->getMessage());+ }}}}diff --git a/resources/views/livewire/notifications/discord.blade.php b/resources/views/livewire/notifications/discord.blade.phpindex 7a00df6ead..189f2f490e 100644--- a/resources/views/livewire/notifications/discord.blade.php+++ b/resources/views/livewire/notifications/discord.blade.php@@ -14,6 +14,10 @@wire:click="sendTestNotification">Send Test Notification</x-forms.button>+ @else+ <x-forms.button disabled class="normal-case dark:text-white btn btn-xs no-animation btn-primary">+ Send Test Notification+ </x-forms.button>@endif</div><div class="w-32">@@ -23,44 +27,53 @@helper="Generate a webhook in Discord.<br>Example: https://discord.com/api/webhooks/...." requiredid="discordWebhookUrl" label="Webhook" /></form>- @if ($discordEnabled)- <h2 class="mt-8 mb-4">Notification Settings</h2>- <p class="mb-4">- Select events for which you would like to receive Discord notifications.- </p>- <div class="flex flex-col gap-4 max-w-2xl">- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Deployments</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="deploymentSuccessDiscordNotifications" label="Deployment Success" />- <x-forms.checkbox instantSave="saveModel" id="deploymentFailureDiscordNotifications" label="Deployment Failure" />- {{-- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when a container status changes. It will notify for Stopped and Restarted events of a container." id="statusChangeDiscordNotifications" label="Container Status Changes" /> --}}- </div>+ <h2 class="mt-4">Notification Settings</h2>+ <p class="mb-4">+ Select events for which you would like to receive Discord notifications.+ </p>+ <div class="flex flex-col gap-4 max-w-2xl">+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Deployments</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="deploymentSuccessDiscordNotifications"+ label="Deployment Success" />+ <x-forms.checkbox instantSave="saveModel" id="deploymentFailureDiscordNotifications"+ label="Deployment Failure" />+ {{-- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when a container status changes. It will notify for Stopped and Restarted events of a container." id="statusChangeDiscordNotifications" label="Container Status Changes" /> --}}</div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Backups</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="backupSuccessDiscordNotifications" label="Backup Success" />- <x-forms.checkbox instantSave="saveModel" id="backupFailureDiscordNotifications" label="Backup Failure" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Backups</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="backupSuccessDiscordNotifications"+ label="Backup Success" />+ <x-forms.checkbox instantSave="saveModel" id="backupFailureDiscordNotifications"+ label="Backup Failure" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Scheduled Tasks</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessDiscordNotifications" label="Scheduled Task Success" />- <x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureDiscordNotifications" label="Scheduled Task Failure" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Scheduled Tasks</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessDiscordNotifications"+ label="Scheduled Task Success" />+ <x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureDiscordNotifications"+ label="Scheduled Task Failure" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Server</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when Docker Cleanup is run on a server." id="dockerCleanupSuccessDiscordNotifications" label="Docker Cleanup Success" />- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when Docker Cleanup fails on a server." id="dockerCleanupFailureDiscordNotifications" label="Docker Cleanup Failure" />- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when server disk usage is high." id="serverDiskUsageDiscordNotifications" label="Server Disk Usage" />- <x-forms.checkbox instantSave="saveModel" id="serverReachableDiscordNotifications" label="Server Reachable" />- <x-forms.checkbox instantSave="saveModel" id="serverUnreachableDiscordNotifications" label="Server Unreachable" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Server</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="dockerCleanupSuccessDiscordNotifications"+ label="Docker Cleanup Success" />+ <x-forms.checkbox instantSave="saveModel" id="dockerCleanupFailureDiscordNotifications"+ label="Docker Cleanup Failure" />+ <x-forms.checkbox instantSave="saveModel" id="serverDiskUsageDiscordNotifications"+ label="Server Disk Usage" />+ <x-forms.checkbox instantSave="saveModel" id="serverReachableDiscordNotifications"+ label="Server Reachable" />+ <x-forms.checkbox instantSave="saveModel" id="serverUnreachableDiscordNotifications"+ label="Server Unreachable" /></div>- </div>- @endif+ </div>+ </div></div>diff --git a/resources/views/livewire/notifications/email.blade.php b/resources/views/livewire/notifications/email.blade.phpindex 980525cce3..37bfac0e0f 100644--- a/resources/views/livewire/notifications/email.blade.php+++ b/resources/views/livewire/notifications/email.blade.php@@ -1,48 +1,58 @@<div><x-slot:title>Notifications | Coolify- </x-slot>- <x-notification.navbar />- <form wire:submit='submit' class="flex flex-col gap-4 pb-4">- <div class="flex items-center gap-2">- <h2>Email</h2>- <x-forms.button type="submit">- Save- </x-forms.button>- @if ($team->isNotificationEnabled('email') && auth()->user()->isAdminFromSession())- <x-modal-input buttonTitle="Send Test Email" title="Send Test Email">- <form wire:submit.prevent="sendTestEmail" class="flex flex-col w-full gap-2">- <x-forms.input wire:model="testEmailAddress" placeholder="[email protected]" id="testEmailAddress" label="Recipients" required />- <x-forms.button type="submit" @click="modalOpen=false">- Send Email- </x-forms.button>- </form>- </x-modal-input>- @endif- @if (isInstanceAdmin() && !$useInstanceEmailSettings)- <x-forms.button wire:click='copyFromInstanceSettings'>- Copy from Instance Settings- </x-forms.button>+ </x-slot>+ <x-notification.navbar />+ <form wire:submit='submit' class="flex flex-col gap-4 pb-4">+ <div class="flex items-center gap-2">+ <h2>Email</h2>+ <x-forms.button type="submit">+ Save+ </x-forms.button>+ @if (auth()->user()->isAdminFromSession())+ @if ($team->isNotificationEnabled('email'))+ <x-modal-input buttonTitle="Send Test Email" title="Send Test Email">+ <form wire:submit.prevent="sendTestEmail" class="flex flex-col w-full gap-2">+ <x-forms.input wire:model="testEmailAddress" placeholder="[email protected]"+ id="testEmailAddress" label="Recipients" required />+ <x-forms.button type="submit" @click="modalOpen=false">+ Send Email+ </x-forms.button>+ </form>+ </x-modal-input>+ @else+ <x-forms.button disabled class="normal-case dark:text-white btn btn-xs no-animation btn-primary">+ Send Test Email+ </x-forms.button>@endif- </div>- @if (!isCloud())+ @endif+ </div>+ @if (!isCloud())<div class="w-96">- <x-forms.checkbox instantSave="instantSave()" id="useInstanceEmailSettings" label="Use system wide (transactional) email settings" />+ <x-forms.checkbox instantSave="instantSave()" id="useInstanceEmailSettings"+ label="Use system wide (transactional) email settings" /></div>- @endif- @if (!$useInstanceEmailSettings)+ @endif+ @if (!$useInstanceEmailSettings)<div class="flex gap-4"><x-forms.input required id="smtpFromName" helper="Name used in emails." label="From Name" />- <x-forms.input required id="smtpFromAddress" helper="Email address used in emails." label="From Address" />+ <x-forms.input required id="smtpFromAddress" helper="Email address used in emails."+ label="From Address" /></div>+ @if (isInstanceAdmin() && !$useInstanceEmailSettings)+ <x-forms.button wire:click='copyFromInstanceSettings'>+ Copy from Instance Settings+ </x-forms.button>@endif- </form>- @if (isCloud())+ @endif+ </form>+ @if (isCloud())<div class="w-64 py-4">- <x-forms.checkbox instantSave="instantSave()" id="useInstanceEmailSettings" label="Use Hosted Email Service" />+ <x-forms.checkbox instantSave="instantSave()" id="useInstanceEmailSettings"+ label="Use Hosted Email Service" /></div>- @endif- @if (!$useInstanceEmailSettings)+ @endif+ @if (!$useInstanceEmailSettings)<div class="flex flex-col gap-4"><form wire:submit='submitSmtp' class="p-4 border dark:border-coolgray-300 flex flex-col gap-2"><div class="flex items-center gap-2">@@ -52,7 +62,8 @@</x-forms.button></div><div class="w-32">- <x-forms.checkbox wire:model="smtpEnabled" instantSave="instantSave('SMTP')" id="smtpEnabled" label="Enabled" />+ <x-forms.checkbox wire:model="smtpEnabled" instantSave="instantSave('SMTP')" id="smtpEnabled"+ label="Enabled" /></div><div class="flex flex-col"><div class="flex flex-col gap-4">@@ -68,7 +79,8 @@<div class="flex flex-col w-full gap-2 xl:flex-row"><x-forms.input id="smtpUsername" label="SMTP Username" /><x-forms.input id="smtpPassword" type="password" label="SMTP Password" />- <x-forms.input id="smtpTimeout" helper="Timeout value for sending emails." label="Timeout" />+ <x-forms.input id="smtpTimeout" helper="Timeout value for sending emails."+ label="Timeout" /></div></div></div>@@ -81,56 +93,68 @@</x-forms.button></div><div class="w-32">- <x-forms.checkbox wire:model="resendEnabled" instantSave="instantSave('Resend')" id="resendEnabled" label="Enabled" />+ <x-forms.checkbox wire:model="resendEnabled" instantSave="instantSave('Resend')" id="resendEnabled"+ label="Enabled" /></div><div class="flex flex-col"><div class="flex flex-col gap-4"><div class="flex flex-col w-full gap-2 xl:flex-row">- <x-forms.input required type="password" id="resendApiKey" placeholder="API key" label="API Key" />+ <x-forms.input required type="password" id="resendApiKey" placeholder="API key"+ label="API Key" /></div></div></div></form></div>- @endif- @if ($team->isNotificationEnabled('email') || $useInstanceEmailSettings)- <h2 class="mt-8 mb-4">Notification Settings</h2>- <p class="mb-4">- Select events for which you would like to receive email notifications.- </p>- <div class="flex flex-col gap-4 max-w-2xl">- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Deployments</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="deploymentSuccessEmailNotifications" label="Deployment Success" />- <x-forms.checkbox instantSave="saveModel" id="deploymentFailureEmailNotifications" label="Deployment Failure" />- {{-- <x-forms.checkbox instantSave="saveModel" helper="Send an email when a container status changes. It will send and email for Stopped and Restarted events of a container." id="statusChangeEmailNotifications" label="Container Status Changes" /> --}}- </div>+ @endif+ <h2 class="mt-4">Notification Settings</h2>+ <p class="mb-4">+ Select events for which you would like to receive email notifications.+ </p>+ <div class="flex flex-col gap-4 max-w-2xl">+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Deployments</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="deploymentSuccessEmailNotifications"+ label="Deployment Success" />+ <x-forms.checkbox instantSave="saveModel" id="deploymentFailureEmailNotifications"+ label="Deployment Failure" />+ {{-- <x-forms.checkbox instantSave="saveModel" helper="Send an email when a container status changes. It will send and email for Stopped and Restarted events of a container." id="statusChangeEmailNotifications" label="Container Status Changes" /> --}}</div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Backups</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="backupSuccessEmailNotifications" label="Backup Success" />- <x-forms.checkbox instantSave="saveModel" id="backupFailureEmailNotifications" label="Backup Failure" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Backups</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="backupSuccessEmailNotifications" label="Backup Success" />+ <x-forms.checkbox instantSave="saveModel" id="backupFailureEmailNotifications"+ label="Backup Failure" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Scheduled Tasks</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessEmailNotifications" label="Scheduled Task Success" />- <x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureEmailNotifications" label="Scheduled Task Failure" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Scheduled Tasks</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessEmailNotifications"+ label="Scheduled Task Success" />+ <x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureEmailNotifications"+ label="Scheduled Task Failure" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Server</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" helper="Send an email when Docker Cleanup is run on a server." id="dockerCleanupSuccessEmailNotifications" label="Docker Cleanup Success" />- <x-forms.checkbox instantSave="saveModel" helper="Send an email when Docker Cleanup fails on a server." id="dockerCleanupFailureEmailNotifications" label="Docker Cleanup Failure" />- <x-forms.checkbox instantSave="saveModel" helper="Send an email when server disk usage is high." id="serverDiskUsageEmailNotifications" label="Server Disk Usage" />- <x-forms.checkbox instantSave="saveModel" id="serverReachableEmailNotifications" label="Server Reachable" />- <x-forms.checkbox instantSave="saveModel" id="serverUnreachableEmailNotifications" label="Server Unreachable" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Server</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel"+ helper="Send an email when Docker Cleanup is run on a server."+ id="dockerCleanupSuccessEmailNotifications" label="Docker Cleanup Success" />+ <x-forms.checkbox instantSave="saveModel"+ helper="Send an email when Docker Cleanup fails on a server."+ id="dockerCleanupFailureEmailNotifications" label="Docker Cleanup Failure" />+ <x-forms.checkbox instantSave="saveModel" helper="Send an email when server disk usage is high."+ id="serverDiskUsageEmailNotifications" label="Server Disk Usage" />+ <x-forms.checkbox instantSave="saveModel" id="serverReachableEmailNotifications"+ label="Server Reachable" />+ <x-forms.checkbox instantSave="saveModel" id="serverUnreachableEmailNotifications"+ label="Server Unreachable" /></div></div>- @endif+ </div></div>diff --git a/resources/views/livewire/notifications/slack.blade.php b/resources/views/livewire/notifications/slack.blade.phpindex b1d58d72bb..9ed28d4ec2 100644--- a/resources/views/livewire/notifications/slack.blade.php+++ b/resources/views/livewire/notifications/slack.blade.php@@ -3,7 +3,7 @@Notifications | Coolify</x-slot><x-notification.navbar />- <form wire:submit='submit' class="flex flex-col gap-4">+ <form wire:submit='submit' class="flex flex-col gap-4 pb-4"><div class="flex items-center gap-2"><h2>Slack</h2><x-forms.button type="submit">@@ -14,6 +14,10 @@wire:click="sendTestNotification">Send Test Notification</x-forms.button>+ @else+ <x-forms.button disabled class="normal-case dark:text-white btn btn-xs no-animation btn-primary">+ Send Test Notification+ </x-forms.button>@endif</div><div class="w-32">@@ -23,44 +27,51 @@helper="Generate a webhook in Slack.<br>Example: https://hooks.slack.com/services/...." requiredid="slackWebhookUrl" label="Webhook" /></form>- @if ($slackEnabled)- <h2 class="mt-8 mb-4">Notification Settings</h2>- <p class="mb-4">- Select events for which you would like to receive Slack notifications.- </p>- <div class="flex flex-col gap-4 max-w-2xl">- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Deployments</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="deploymentSuccessSlackNotifications" label="Deployment Success" />- <x-forms.checkbox instantSave="saveModel" id="deploymentFailureSlackNotifications" label="Deployment Failure" />- {{-- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when a container status changes. It will notify for Stopped and Restarted events of a container." id="statusChangeSlackNotifications" label="Container Status Changes" /> --}}- </div>+ <h2 class="mt-4">Notification Settings</h2>+ <p class="mb-4">+ Select events for which you would like to receive Slack notifications.+ </p>+ <div class="flex flex-col gap-4 max-w-2xl">+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Deployments</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="deploymentSuccessSlackNotifications"+ label="Deployment Success" />+ <x-forms.checkbox instantSave="saveModel" id="deploymentFailureSlackNotifications"+ label="Deployment Failure" />+ {{-- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when a container status changes. It will notify for Stopped and Restarted events of a container." id="statusChangeSlackNotifications" label="Container Status Changes" /> --}}</div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Backups</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="backupSuccessSlackNotifications" label="Backup Success" />- <x-forms.checkbox instantSave="saveModel" id="backupFailureSlackNotifications" label="Backup Failure" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Backups</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="backupSuccessSlackNotifications" label="Backup Success" />+ <x-forms.checkbox instantSave="saveModel" id="backupFailureSlackNotifications" label="Backup Failure" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Scheduled Tasks</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessSlackNotifications" label="Scheduled Task Success" />- <x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureSlackNotifications" label="Scheduled Task Failure" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Scheduled Tasks</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessSlackNotifications"+ label="Scheduled Task Success" />+ <x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureSlackNotifications"+ label="Scheduled Task Failure" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="font-medium mb-3">Server</h3>- <div class="flex flex-col gap-1.5 pl-1">- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when Docker Cleanup is run on a server." id="dockerCleanupSuccessSlackNotifications" label="Docker Cleanup Success" />- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when Docker Cleanup fails on a server." id="dockerCleanupFailureSlackNotifications" label="Docker Cleanup Failure" />- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when server disk usage is high." id="serverDiskUsageSlackNotifications" label="Server Disk Usage" />- <x-forms.checkbox instantSave="saveModel" id="serverReachableSlackNotifications" label="Server Reachable" />- <x-forms.checkbox instantSave="saveModel" id="serverUnreachableSlackNotifications" label="Server Unreachable" />- </div>+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="font-medium mb-3">Server</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <x-forms.checkbox instantSave="saveModel" id="dockerCleanupSuccessSlackNotifications"+ label="Docker Cleanup Success" />+ <x-forms.checkbox instantSave="saveModel" id="dockerCleanupFailureSlackNotifications"+ label="Docker Cleanup Failure" />+ <x-forms.checkbox instantSave="saveModel" id="serverDiskUsageSlackNotifications"+ label="Server Disk Usage" />+ <x-forms.checkbox instantSave="saveModel" id="serverReachableSlackNotifications"+ label="Server Reachable" />+ <x-forms.checkbox instantSave="saveModel" id="serverUnreachableSlackNotifications"+ label="Server Unreachable" /></div></div>- @endif-</div>\ No newline at end of file+ </div>+</div>diff --git a/resources/views/livewire/notifications/telegram.blade.php b/resources/views/livewire/notifications/telegram.blade.phpindex ff60673b09..f1d2cb540a 100644--- a/resources/views/livewire/notifications/telegram.blade.php+++ b/resources/views/livewire/notifications/telegram.blade.php@@ -1,122 +1,162 @@<div><x-slot:title>Notifications | Coolify- </x-slot>- <x-notification.navbar />- <form wire:submit='submit' class="flex flex-col gap-4">- <div class="flex items-center gap-2">- <h2>Telegram</h2>- <x-forms.button type="submit">- Save+ </x-slot>+ <x-notification.navbar />+ <form wire:submit='submit' class="flex flex-col gap-4 pb-4">+ <div class="flex items-center gap-2">+ <h2>Telegram</h2>+ <x-forms.button type="submit">+ Save+ </x-forms.button>+ @if ($telegramEnabled)+ <x-forms.button class="normal-case dark:text-white btn btn-xs no-animation btn-primary"+ wire:click="sendTestNotification">+ Send Test Notification</x-forms.button>- @if ($telegramEnabled)- <x-forms.button class="normal-case dark:text-white btn btn-xs no-animation btn-primary" wire:click="sendTestNotification">+ @else+ <x-forms.button disabled class="normal-case dark:text-white btn btn-xs no-animation btn-primary">Send Test Notification</x-forms.button>- @endif- </div>- <div class="w-32">- <x-forms.checkbox instantSave="instantSaveTelegramEnabled" id="telegramEnabled" label="Enabled" />- </div>- <div class="flex gap-2">- <x-forms.input type="password" autocomplete="new-password" helper="Get it from the <a class='inline-block underline dark:text-white' href='https://t.me/botfather' target='_blank'>BotFather Bot</a> on Telegram." required id="telegramToken" label="Token" />- <x-forms.input helper="Recommended to add your bot to a group chat and add its Chat ID here." required id="telegramChatId" label="Chat ID" />+ @endif+ </div>+ <div class="w-32">+ <x-forms.checkbox instantSave="instantSaveTelegramEnabled" id="telegramEnabled" label="Enabled" />+ </div>+ <div class="flex gap-2">+ <x-forms.input type="password" autocomplete="new-password"+ helper="Get it from the <a class='inline-block underline dark:text-white' href='https://t.me/botfather' target='_blank'>BotFather Bot</a> on Telegram."+ required id="telegramToken" label="Token" />+ <x-forms.input helper="Recommended to add your bot to a group chat and add its Chat ID here." required+ id="telegramChatId" label="Chat ID" />+ </div>+ </form>+ <h2 class="mt-4">Notification Settings</h2>+ <p class="mb-4">+ Select events for which you would like to receive Telegram notifications.+ </p>+ <div class="flex flex-col gap-4 ">+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="text-lg font-medium mb-3">Deployments</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="deploymentSuccessTelegramNotifications"+ label="Deployment Success" />+ </div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsDeploymentSuccessTopicId" />+ </div>+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="deploymentFailureTelegramNotifications"+ label="Deployment Failure" />+ </div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsDeploymentFailureTopicId" />+ </div>+ {{-- <h4 class="font-medium mt-3">Container Status Changes</h4>+ <div class="pl-1">+ <x-forms.checkbox instantSave="saveModel" id="statusChangeTelegramNotifications" label="Enabled" helper="Send a notification when a container status changes. It will send a notification for Stopped and Restarted events of a container." />+ <x-forms.input helper="Topic ID for container status notifications" id="telegramNotificationsStatusChangeTopicId" label="Container Status Topic ID" />+ </div> --}}</div>- @if ($telegramEnabled)- <h2 class="mt-8 mb-4">Notification Settings</h2>- <p class="mb-4">- Select events for which you would like to receive Telegram notifications.- </p>- <div class="flex flex-col gap-4 max-w-2xl">- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="text-lg font-medium mb-3">Deployment</h3>- <div class="flex flex-col gap-1.5 pl-1">- <h4 class="font-medium mt-2">Deployment Success</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="deploymentSuccessTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for deployment success notifications" id="telegramNotificationsDeploymentSuccessTopicId" label="Success Topic ID" />- </div>- <h4 class="font-medium mt-3">Deployment Failure</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="deploymentFailureTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for deployment failure notifications" id="telegramNotificationsDeploymentFailureTopicId" label="Failure Topic ID" />- </div>- {{-- <h4 class="font-medium mt-3">Container Status Changes</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="statusChangeTelegramNotifications" label="Enabled" helper="Send a notification when a container status changes. It will send a notification for Stopped and Restarted events of a container." />- <x-forms.input helper="Topic ID for container status notifications" id="telegramNotificationsStatusChangeTopicId" label="Container Status Topic ID" />- </div> --}}+ </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="text-lg font-medium mb-3">Backups</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="backupSuccessTelegramNotifications"+ label="Backup Success" />+ </div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsBackupSuccessTopicId" />+ </div>++ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="backupFailureTelegramNotifications"+ label="Backup Failure" /></div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsBackupFailureTopicId" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="text-lg font-medium mb-3">Backups</h3>- <div class="flex flex-col gap-1.5 pl-1">- <h4 class="font-medium mt-2">Backup Success</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="backupSuccessTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for backup success notifications" id="telegramNotificationsBackupSuccessTopicId" label="Success Topic ID" />- </div>+ </div>+ </div>- <h4 class="font-medium mt-3">Backup Failure</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="backupFailureTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for backup failure notifications" id="telegramNotificationsBackupFailureTopicId" label="Failure Topic ID" />- </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="text-lg font-medium mb-3">Scheduled Tasks</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessTelegramNotifications"+ label="Scheduled Task Success" /></div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsScheduledTaskSuccessTopicId" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="text-lg font-medium mb-3">Scheduled Tasks</h3>- <div class="flex flex-col gap-1.5 pl-1">- <h4 class="font-medium mt-2">Scheduled Task Success</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for scheduled task success notifications" id="telegramNotificationsScheduledTaskSuccessTopicId" label="Success Topic ID" />- </div>+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureTelegramNotifications"+ label="Scheduled Task Failure" />+ </div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsScheduledTaskFailureTopicId" />+ </div>+ </div>+ </div>- <h4 class="font-medium mt-3">Scheduled Task Failure</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for scheduled task failure notifications" id="telegramNotificationsScheduledTaskFailureTopicId" label="Failure Topic ID" />- </div>+ <div class="border dark:border-coolgray-300 p-4 rounded-lg">+ <h3 class="text-lg font-medium mb-3">Server</h3>+ <div class="flex flex-col gap-1.5 pl-1">+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="dockerCleanupSuccessTelegramNotifications"+ label="Docker Cleanup Success" /></div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsDockerCleanupSuccessTopicId" /></div>- <div class="border dark:border-coolgray-300 p-4 rounded-lg">- <h3 class="text-lg font-medium mb-3">Server</h3>- <div class="flex flex-col gap-1.5 pl-1">- <h4 class="font-medium mt-2">Docker Cleanup Success</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when Docker Cleanup is run on a server." id="dockerCleanupSuccessTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for Docker cleanup success notifications" id="telegramNotificationsDockerCleanupSuccessTopicId" label="Docker Cleanup Success Topic ID" />- </div>+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="dockerCleanupFailureTelegramNotifications"+ label="Docker Cleanup Failure" />+ </div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsDockerCleanupFailureTopicId" />+ </div>- <h4 class="font-medium mt-3">Docker Cleanup Failure</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" helper="Send a notification when Docker Cleanup fails on a server." id="dockerCleanupFailureTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for Docker cleanup failure notifications" id="telegramNotificationsDockerCleanupFailureTopicId" label="Docker Cleanup Failure Topic ID" />- </div>+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="serverDiskUsageTelegramNotifications"+ label="Server Disk Usage" />+ </div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsServerDiskUsageTopicId" />+ </div>- <h4 class="font-medium mt-3">Server Disk Usage</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="serverDiskUsageTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for disk usage notifications" id="telegramNotificationsServerDiskUsageTopicId" label="Disk Usage Topic ID" />- </div>+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="serverReachableTelegramNotifications"+ label="Server Reachable" />+ </div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsServerReachableTopicId" />+ </div>- <h4 class="font-medium mt-3">Server Reachable</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="serverReachableTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for server reachable notifications" id="telegramNotificationsServerReachableTopicId" label="Server Reachable Topic ID" />- </div>- <h4 class="font-medium mt-3">Server Unreachable</h4>- <div class="pl-1">- <x-forms.checkbox instantSave="saveModel" id="serverUnreachableTelegramNotifications" label="Enabled" />- <x-forms.input helper="Topic ID for server unreachable notifications" id="telegramNotificationsServerUnreachableTopicId" label="Server Unreachable Topic ID" />- </div>+ <div class="pl-1 flex gap-2">+ <div class="w-96">+ <x-forms.checkbox instantSave="saveModel" id="serverUnreachableTelegramNotifications"+ label="Server Unreachable" /></div>+ <x-forms.input type="password" placeholder="Custom Telegram Topic ID"+ id="telegramNotificationsServerUnreachableTopicId" /></div></div>- @endif- </form>+ </div>+ </div></div>diff --git a/scripts/run b/scripts/runindex 8764ef23f4..466b045306 100755--- a/scripts/run+++ b/scripts/run@@ -32,18 +32,18 @@ function sync:bunny {}function db:reset {- bash spin exec -u webuser coolify php artisan migrate:fresh --seed+ bash spin exec -u www-data coolify php artisan migrate:fresh --seed}function db:reset-prod {- bash spin exec -u webuser coolify php artisan migrate:fresh --force --seed --seeder=ProductionSeeder ||+ bash spin exec -u www-data coolify php artisan migrate:fresh --force --seed --seeder=ProductionSeeder ||php artisan migrate:fresh --force --seed --seeder=ProductionSeeder}function coolify {- bash spin exec -u webuser coolify bash+ bash spin exec -u www-data coolify sh}function coolify:root {- bash spin exec coolify bash+ bash spin exec coolify sh}function coolify:proxy {docker exec -ti coolify-proxy sh@@ -58,7 +58,7 @@ function vite {}function tinker {- bash spin exec -u webuser coolify php artisan tinker+ bash spin exec -u www-data coolify php artisan tinker}function default {@@ -66,4 +66,4 @@ function default {}TIMEFORMAT="Task completed in %3lR"-time "${@:-default}"\ No newline at end of file+time "${@:-default}"