coolify/app/Models/DiscordNotificationSettings.php
Andras Bacsai 8c77c63043 feat(proxy): add Traefik version tracking with notifications and dismissible UI warnings
- Add automated Traefik version checking job running weekly on Sundays
- Implement version detection from running containers and comparison with versions.json
- Add notifications across all channels (Email, Discord, Slack, Telegram, Pushover, Webhook) for outdated versions
- Create dismissible callout component with localStorage persistence
- Display cross-branch upgrade warnings (e.g., v3.5 -> v3.6) with changelog links
- Show patch update notifications within same branch
- Add warning icon that appears when callouts are dismissed
- Prevent duplicate notifications during proxy restart by adding restarting parameter
- Fix notification spam with transition-based logic for status changes
- Enable system email settings by default in development mode
- Track last saved/applied proxy settings to detect configuration drift
2025-11-14 11:35:22 +01:00

70 lines
2.2 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class DiscordNotificationSettings extends Model
{
use Notifiable;
public $timestamps = false;
protected $fillable = [
'team_id',
'discord_enabled',
'discord_webhook_url',
'deployment_success_discord_notifications',
'deployment_failure_discord_notifications',
'status_change_discord_notifications',
'backup_success_discord_notifications',
'backup_failure_discord_notifications',
'scheduled_task_success_discord_notifications',
'scheduled_task_failure_discord_notifications',
'docker_cleanup_discord_notifications',
'server_disk_usage_discord_notifications',
'server_reachable_discord_notifications',
'server_unreachable_discord_notifications',
'server_patch_discord_notifications',
'traefik_outdated_discord_notifications',
'discord_ping_enabled',
];
protected $casts = [
'discord_enabled' => 'boolean',
'discord_webhook_url' => 'encrypted',
'deployment_success_discord_notifications' => 'boolean',
'deployment_failure_discord_notifications' => 'boolean',
'status_change_discord_notifications' => 'boolean',
'backup_success_discord_notifications' => 'boolean',
'backup_failure_discord_notifications' => 'boolean',
'scheduled_task_success_discord_notifications' => 'boolean',
'scheduled_task_failure_discord_notifications' => 'boolean',
'docker_cleanup_discord_notifications' => 'boolean',
'server_disk_usage_discord_notifications' => 'boolean',
'server_reachable_discord_notifications' => 'boolean',
'server_unreachable_discord_notifications' => 'boolean',
'server_patch_discord_notifications' => 'boolean',
'traefik_outdated_discord_notifications' => 'boolean',
'discord_ping_enabled' => 'boolean',
];
public function team()
{
return $this->belongsTo(Team::class);
}
public function isEnabled()
{
return $this->discord_enabled;
}
public function isPingEnabled()
{
return $this->discord_ping_enabled;
}
}