feat: some more notification settings and better defaults

- add reachable and unreachable notifications
- add docker cleanup notifications
- better defaults
This commit is contained in:
peaklabs-dev
2024-12-09 13:11:12 +01:00
parent 060c8262bc
commit 0c08e11b53
7 changed files with 30 additions and 15 deletions

View File

@@ -33,12 +33,15 @@ return new class extends Migration
$table->boolean('deployment_success_email_notifications')->default(false);
$table->boolean('deployment_failure_email_notifications')->default(true);
$table->boolean('status_change_email_notifications')->default(false);
$table->boolean('backup_success_email_notifications')->default(false);
$table->boolean('backup_failure_email_notifications')->default(true);
$table->boolean('scheduled_task_success_email_notifications')->default(false);
$table->boolean('scheduled_task_failure_email_notifications')->default(true);
$table->boolean('status_change_email_notifications')->default(false);
$table->boolean('docker_cleanup_email_notifications')->default(false);
$table->boolean('server_disk_usage_email_notifications')->default(true);
$table->boolean('server_reachable_email_notifications')->default(false);
$table->boolean('server_unreachable_email_notifications')->default(true);
$table->unique(['team_id']);
});

View File

@@ -20,12 +20,15 @@ return new class extends Migration
$table->boolean('deployment_success_discord_notifications')->default(false);
$table->boolean('deployment_failure_discord_notifications')->default(true);
$table->boolean('status_change_discord_notifications')->default(false);
$table->boolean('backup_success_discord_notifications')->default(false);
$table->boolean('backup_failure_discord_notifications')->default(true);
$table->boolean('scheduled_task_success_discord_notifications')->default(false);
$table->boolean('scheduled_task_failure_discord_notifications')->default(true);
$table->boolean('status_change_discord_notifications')->default(false);
$table->boolean('docker_cleanup_discord_notifications')->default(false);
$table->boolean('server_disk_usage_discord_notifications')->default(true);
$table->boolean('server_reachable_discord_notifications')->default(false);
$table->boolean('server_unreachable_discord_notifications')->default(true);
$table->unique(['team_id']);
});

View File

@@ -21,21 +21,27 @@ return new class extends Migration
$table->boolean('deployment_success_telegram_notifications')->default(false);
$table->boolean('deployment_failure_telegram_notifications')->default(true);
$table->boolean('status_change_telegram_notifications')->default(false);
$table->boolean('backup_success_telegram_notifications')->default(false);
$table->boolean('backup_failure_telegram_notifications')->default(true);
$table->boolean('scheduled_task_success_telegram_notifications')->default(false);
$table->boolean('scheduled_task_failure_telegram_notifications')->default(true);
$table->boolean('status_change_telegram_notifications')->default(false);
$table->boolean('docker_cleanup_telegram_notifications')->default(false);
$table->boolean('server_disk_usage_telegram_notifications')->default(true);
$table->boolean('server_reachable_telegram_notifications')->default(false);
$table->boolean('server_unreachable_telegram_notifications')->default(true);
$table->text('telegram_notifications_deployment_success_topic_id')->nullable();
$table->text('telegram_notifications_deployment_failure_topic_id')->nullable();
$table->text('telegram_notifications_status_change_topic_id')->nullable();
$table->text('telegram_notifications_backup_success_topic_id')->nullable();
$table->text('telegram_notifications_backup_failure_topic_id')->nullable();
$table->text('telegram_notifications_scheduled_task_success_topic_id')->nullable();
$table->text('telegram_notifications_scheduled_task_failure_topic_id')->nullable();
$table->text('telegram_notifications_status_change_topic_id')->nullable();
$table->text('telegram_notifications_docker_cleanup_topic_id')->nullable();
$table->text('telegram_notifications_server_disk_usage_topic_id')->nullable();
$table->text('telegram_notifications_server_reachable_topic_id')->nullable();
$table->text('telegram_notifications_server_unreachable_topic_id')->nullable();
$table->unique(['team_id']);
});

View File

@@ -28,13 +28,13 @@ return new class extends Migration
'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 ?? 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 ?? 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 ?? 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' => true,
'server_disk_usage_email_notifications' => $team->smtp_notifications_server_disk_usage ?? true,
]);
}

View File

@@ -20,11 +20,11 @@ return new class extends Migration
'discord_enabled' => $team->discord_enabled ?? false,
'discord_webhook_url' => $team->discord_webhook_url,
'deployment_success_discord_notifications' => $team->discord_notifications_deployments ?? false,
'deployment_failure_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 ?? 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 ?? 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,
]);

View File

@@ -19,11 +19,11 @@ return new class extends Migration
'telegram_chat_id' => $team->telegram_chat_id,
'deployment_success_telegram_notifications' => $team->telegram_notifications_deployments ?? false,
'deployment_failure_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 ?? 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 ?? 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,

View File

@@ -20,12 +20,15 @@ return new class extends Migration
$table->boolean('deployment_success_slack_notifications')->default(false);
$table->boolean('deployment_failure_slack_notifications')->default(true);
$table->boolean('status_change_slack_notifications')->default(false);
$table->boolean('backup_success_slack_notifications')->default(false);
$table->boolean('backup_failure_slack_notifications')->default(true);
$table->boolean('scheduled_task_success_slack_notifications')->default(false);
$table->boolean('scheduled_task_failure_slack_notifications')->default(true);
$table->boolean('status_change_slack_notifications')->default(false);
$table->boolean('docker_cleanup_slack_notifications')->default(false);
$table->boolean('server_disk_usage_slack_notifications')->default(true);
$table->boolean('server_reachable_slack_notifications')->default(false);
$table->boolean('server_unreachable_slack_notifications')->default(true);
$table->unique(['team_id']);
});