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: make pushover settings more clear
peaklabs-dev92fec9582cfe
diff --git a/app/Livewire/Notifications/Pushover.php b/app/Livewire/Notifications/Pushover.phpindex 7a3b294a2b..2e8205f5e7 100644--- a/app/Livewire/Notifications/Pushover.php+++ b/app/Livewire/Notifications/Pushover.php@@ -18,10 +18,10 @@ class Pushover extends Componentpublic bool $pushoverEnabled = false;#[Validate(['string', 'nullable'])]- public ?string $pushoverToken = null;-+ public ?string $pushoverUserKey = null;+#[Validate(['string', 'nullable'])]- public ?string $pushoverUser = null;+ public ?string $pushoverApiToken = null;#[Validate(['boolean'])]public bool $deploymentSuccessPushoverNotifications = false;@@ -59,7 +59,6 @@ class Pushover extends Component#[Validate(['boolean'])]public bool $serverUnreachablePushoverNotifications = true;-public function mount(){try {@@ -76,8 +75,8 @@ class Pushover extends Componentif ($toModel) {$this->validate();$this->settings->pushover_enabled = $this->pushoverEnabled;- $this->settings->pushover_user = $this->pushoverUser;- $this->settings->pushover_token = $this->pushoverToken;+ $this->settings->pushover_user_key_key = $this->pushoverUserKey;+ $this->settings->pushover_api_token = $this->pushoverApiToken;$this->settings->deployment_success_pushover_notifications = $this->deploymentSuccessPushoverNotifications;$this->settings->deployment_failure_pushover_notifications = $this->deploymentFailurePushoverNotifications;@@ -96,8 +95,8 @@ class Pushover extends ComponentrefreshSession();} else {$this->pushoverEnabled = $this->settings->pushover_enabled;- $this->pushoverUser = $this->settings->pushover_user;- $this->pushoverToken = $this->settings->pushover_token;+ $this->pushoverUserKey = $this->settings->pushover_user_key_key;+ $this->pushoverApiToken = $this->settings->pushover_api_token;$this->deploymentSuccessPushoverNotifications = $this->settings->deployment_success_pushover_notifications;$this->deploymentFailurePushoverNotifications = $this->settings->deployment_failure_pushover_notifications;@@ -118,11 +117,11 @@ class Pushover extends Component{try {$this->validate([- 'pushoverUser' => 'required',- 'pushoverToken' => 'required',+ 'pushoverUserKey' => 'required',+ 'pushoverApiToken' => 'required',], [- 'pushoverUser.required' => 'Pushover User is required.',- 'pushoverToken.required' => 'Pushover Token is required.',+ 'pushoverUserKey.required' => 'Pushover User Key is required.',+ 'pushoverApiToken.required' => 'Pushover API Token is required.',]);$this->saveModel();} catch (\Throwable $e) {diff --git a/app/Models/PushoverNotificationSettings.php b/app/Models/PushoverNotificationSettings.phpindex 7576a60405..7deeadedc9 100644--- a/app/Models/PushoverNotificationSettings.php+++ b/app/Models/PushoverNotificationSettings.php@@ -15,8 +15,8 @@ class PushoverNotificationSettings extends Model'team_id','pushover_enabled',- 'pushover_user',- 'pushover_token',+ 'pushover_user_key_key',+ 'pushover_api_token','deployment_success_pushover_notifications','deployment_failure_pushover_notifications',@@ -29,12 +29,12 @@ class PushoverNotificationSettings extends Model'server_disk_usage_pushover_notifications','server_reachable_pushover_notifications','server_unreachable_pushover_notifications',- ];+ ];protected $casts = ['pushover_enabled' => 'boolean',- 'pushover_user' => 'encrypted',- 'pushover_token' => 'encrypted',+ 'pushover_user_key_key' => 'encrypted',+ 'pushover_api_token' => 'encrypted','deployment_success_pushover_notifications' => 'boolean','deployment_failure_pushover_notifications' => 'boolean',diff --git a/app/Models/Team.php b/app/Models/Team.phpindex fc10892a4c..1741378407 100644--- a/app/Models/Team.php+++ b/app/Models/Team.php@@ -4,8 +4,8 @@ namespace App\Models;use App\Notifications\Channels\SendsDiscord;use App\Notifications\Channels\SendsEmail;-use App\Notifications\Channels\SendsSlack;use App\Notifications\Channels\SendsPushover;+use App\Notifications\Channels\SendsSlack;use App\Traits\HasNotificationSettings;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Model;@@ -33,7 +33,7 @@ use OpenApi\Attributes as OA;])]-class Team extends Model implements SendsDiscord, SendsEmail, SendsSlack, SendsPushover+class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, SendsSlack{use HasNotificationSettings, Notifiable;@@ -156,12 +156,12 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsSlack, SendsP{return data_get($this, 'slack_webhook_url', null);}-+public function routeNotificationForPushover(){return [- 'user' => data_get($this, 'pushover_user', null),- 'token' => data_get($this, 'pushover_token', null),+ 'user' => data_get($this, 'pushover_user_key_key', null),+ 'token' => data_get($this, 'pushover_api_token', null),];}@@ -287,7 +287,7 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsSlack, SendsP{return $this->hasOne(SlackNotificationSettings::class);}-+public function pushoverNotificationSettings(){return $this->hasOne(PushoverNotificationSettings::class);diff --git a/app/Notifications/Channels/PushoverChannel.php b/app/Notifications/Channels/PushoverChannel.phpindex 56d3cb03db..3d3728d01f 100644--- a/app/Notifications/Channels/PushoverChannel.php+++ b/app/Notifications/Channels/PushoverChannel.php@@ -7,15 +7,15 @@ use Illuminate\Notifications\Notification;class PushoverChannel{- public function send(SendsPushover $notifiable, Notification $notification): void- {- $message = $notification->toPushover();- $pushoverSettings = $notifiable->pushoverNotificationSettings;+ public function send(SendsPushover $notifiable, Notification $notification): void+ {+ $message = $notification->toPushover();+ $pushoverSettings = $notifiable->pushoverNotificationSettings;- if (! $pushoverSettings || ! $pushoverSettings->isEnabled() || ! $pushoverSettings->pushover_user || ! $pushoverSettings->pushover_token) {- return;- }+ if (! $pushoverSettings || ! $pushoverSettings->isEnabled() || ! $pushoverSettings->pushover_user_key || ! $pushoverSettings->pushover_api_token) {+ return;+ }- SendMessageToPushoverJob::dispatch($message, $pushoverSettings->pushover_token, $pushoverSettings->pushover_user);- }+ SendMessageToPushoverJob::dispatch($message, $pushoverSettings->pushover_api_token, $pushoverSettings->pushover_user_key);+ }}diff --git a/database/migrations/2024_12_11_135026_create_pushover_notification_settings_table.php b/database/migrations/2024_12_11_135026_create_pushover_notification_settings_table.phpindex 907f7a052f..8c317d9974 100644--- a/database/migrations/2024_12_11_135026_create_pushover_notification_settings_table.php+++ b/database/migrations/2024_12_11_135026_create_pushover_notification_settings_table.php@@ -16,8 +16,8 @@ return new class extends Migration$table->foreignId('team_id')->constrained()->cascadeOnDelete();$table->boolean('pushover_enabled')->default(false);- $table->text('pushover_user')->nullable();- $table->text('pushover_token')->nullable();+ $table->text('pushover_user_key')->nullable();+ $table->text('pushover_api_token')->nullable();$table->boolean('deployment_success_pushover_notifications')->default(false);$table->boolean('deployment_failure_pushover_notifications')->default(true);@@ -44,4 +44,3 @@ return new class extends MigrationSchema::dropIfExists('pushover_notification_settings');}};-diff --git a/resources/views/livewire/notifications/pushover.blade.php b/resources/views/livewire/notifications/pushover.blade.phpindex 28a55516d4..271af53673 100644--- a/resources/views/livewire/notifications/pushover.blade.php+++ b/resources/views/livewire/notifications/pushover.blade.php@@ -23,12 +23,12 @@<div class="w-32"><x-forms.checkbox instantSave="instantSavePushoverEnabled" id="pushoverEnabled" label="Enabled" /></div>- <x-forms.input type="text"- helper="Get your user key in Pushover.<br><a href='https://pushover.net' target='_blank'>Pushover</a>" required- id="pushoverUser" label="User" /><x-forms.input type="password"- helper="Generate a token in Pushover.<br>Example: https://pushover.net/apps/build/...." required- id="pushoverToken" label="Token" />+ helper="Get your User Key in Pushover. You need to be logged in to Pushover to see your user key in the top right corner. <br><a class='inline-block underline dark:text-white' href='https://pushover.net/' target='_blank'>Pushover Dashboard</a>" required+ id="pushoverUserKey" label="User Key" />+ <x-forms.input type="password"+ helper="Generate an API Token/Key in Pushover by creating a new application. <br><a class='inline-block underline dark:text-white' href='https://pushover.net/apps/build' target='_blank'>Create Pushover Application</a>" required+ id="pushoverApiToken" label="API Token" /></form><h2 class="mt-4">Notification Settings</h2><p class="mb-4">