feat: add UUIDs and URLs to webhook notifications

- Add resource UUIDs (application_uuid, database_uuid, server_uuid, task_uuid) to all webhook notifications
- Standardize URL field naming from various formats (resource_url, task_url, server_url) to consistent 'url' field
- Include parent resource UUIDs for scheduled tasks (application_uuid or service_uuid)
- Add direct URLs to Coolify resources for all notification types
- Update UI to show "Webhook URL (POST)" label for clarity

This enables webhook consumers to:
- Uniquely identify resources using UUIDs used throughout Coolify UI
- Directly link back to Coolify resource pages via the url field

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-10-10 18:41:46 +02:00
parent bdffa4704d
commit 0303f529d3
17 changed files with 354 additions and 29 deletions

View File

@@ -10,24 +10,27 @@
Save
</x-forms.button>
@if ($webhookEnabled)
<x-forms.button canGate="sendTest" :canResource="$settings" class="normal-case dark:text-white btn btn-xs no-animation btn-primary"
<x-forms.button canGate="sendTest" :canResource="$settings"
class="normal-case dark:text-white btn btn-xs no-animation btn-primary"
wire:click="sendTestNotification">
Send Test Notification
</x-forms.button>
@else
<x-forms.button canGate="sendTest" :canResource="$settings" disabled class="normal-case dark:text-white btn btn-xs no-animation btn-primary">
<x-forms.button canGate="sendTest" :canResource="$settings" 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-48">
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="instantSaveWebhookEnabled" id="webhookEnabled" label="Enabled" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="instantSaveWebhookEnabled"
id="webhookEnabled" label="Enabled" />
</div>
<div class="flex items-end gap-2">
<span class="px-3 py-2 text-sm font-mono font-semibold rounded btn btn-sm btn-primary no-animation">POST</span>
<x-forms.input canGate="update" :canResource="$settings" type="password"
helper="Enter a valid HTTP or HTTPS URL. Coolify will send POST requests to this endpoint when events occur."
required id="webhookUrl" label="Webhook URL" />
required id="webhookUrl" label="Webhook URL (POST)" />
</div>
</form>
<h2 class="mt-4">Notification Settings</h2>
@@ -38,10 +41,10 @@
<div class="border dark:border-coolgray-300 border-neutral-200 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 canGate="update" :canResource="$settings" instantSave="saveModel" id="deploymentSuccessWebhookNotifications"
label="Deployment Success" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel" id="deploymentFailureWebhookNotifications"
label="Deployment Failure" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="deploymentSuccessWebhookNotifications" label="Deployment Success" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="deploymentFailureWebhookNotifications" label="Deployment Failure" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
helper="Send a notification when a container status changes. It will notify for Stopped and Restarted events of a container."
id="statusChangeWebhookNotifications" label="Container Status Changes" />
@@ -50,36 +53,36 @@
<div class="border dark:border-coolgray-300 border-neutral-200 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 canGate="update" :canResource="$settings" instantSave="saveModel" id="backupSuccessWebhookNotifications"
label="Backup Success" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel" id="backupFailureWebhookNotifications"
label="Backup Failure" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="backupSuccessWebhookNotifications" label="Backup Success" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="backupFailureWebhookNotifications" label="Backup Failure" />
</div>
</div>
<div class="border dark:border-coolgray-300 border-neutral-200 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 canGate="update" :canResource="$settings" instantSave="saveModel" id="scheduledTaskSuccessWebhookNotifications"
label="Scheduled Task Success" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel" id="scheduledTaskFailureWebhookNotifications"
label="Scheduled Task Failure" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="scheduledTaskSuccessWebhookNotifications" label="Scheduled Task Success" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="scheduledTaskFailureWebhookNotifications" label="Scheduled Task Failure" />
</div>
</div>
<div class="border dark:border-coolgray-300 border-neutral-200 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 canGate="update" :canResource="$settings" instantSave="saveModel" id="dockerCleanupSuccessWebhookNotifications"
label="Docker Cleanup Success" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel" id="dockerCleanupFailureWebhookNotifications"
label="Docker Cleanup Failure" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel" id="serverDiskUsageWebhookNotifications"
label="Server Disk Usage" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel" id="serverReachableWebhookNotifications"
label="Server Reachable" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel" id="serverUnreachableWebhookNotifications"
label="Server Unreachable" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel" id="serverPatchWebhookNotifications"
label="Server Patching" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="dockerCleanupSuccessWebhookNotifications" label="Docker Cleanup Success" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="dockerCleanupFailureWebhookNotifications" label="Docker Cleanup Failure" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="serverDiskUsageWebhookNotifications" label="Server Disk Usage" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="serverReachableWebhookNotifications" label="Server Reachable" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="serverUnreachableWebhookNotifications" label="Server Unreachable" />
<x-forms.checkbox canGate="update" :canResource="$settings" instantSave="saveModel"
id="serverPatchWebhookNotifications" label="Server Patching" />
</div>
</div>
</div>