fix(coolify-webhook): surface deprecation prompt in Settings UI#64
Merged
Conversation
The legacy HMAC route logs a deprecation warning per hit but never surfaced to the user — so users who hit it kept hitting it. Now: - Track legacy-route hits via new nullable column users.coolify_webhook_legacy_hit_at. - Set it from the legacy route on successful HMAC auth (fire-and-forget). - Clear it in rotateUserCoolifyWebhookSecret — rotating to the new URL-token format migrates the user. - Expose legacy_in_use + legacy_hit_at on GET /api/account/coolify-webhook-secret. - Amber banner above the Rotate URL button in Settings → Coolify Webhook telling the user to re-rotate to migrate; banner clears optimistically after successful rotate. Legacy route still works — this is a nudge, not a break. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[coolify-webhook] DEPRECATED legacy HMAC route hit ...per legacy-route hit, but the user never saw it — so users on the pre-URL-token format kept hitting the legacy route silently.users.coolify_webhook_legacy_hit_at(nullable TIMESTAMPTZ). The legacy route stamps it on successful HMAC auth;rotateUserCoolifyWebhookSecretclears it (rotating IS the migration).GET /api/account/coolify-webhook-secretnow returnslegacy_in_use: boolean+legacy_hit_at: string | null. Settings → Coolify Webhook renders an amber callout above the Rotate URL button whenlegacy_in_useis true. After a successful rotate, the banner clears optimistically client-side.Files
hub/src/db/schema.sql— idempotentALTER TABLE users ADD COLUMN IF NOT EXISTS coolify_webhook_legacy_hit_at TIMESTAMPTZ(plain ALTER, no DO block — sidesteps the known migrate.ts parser bug).hub/src/db/dal.ts—markUserCoolifyWebhookLegacyHit,getUserCoolifyWebhookStatusnow returns{ configured, legacy_in_use, legacy_hit_at },rotateUserCoolifyWebhookSecretalso clearscoolify_webhook_legacy_hit_atin the same UPDATE.hub/src/api/coolify-webhook.ts— legacy route callsmarkUserCoolifyWebhookLegacyHitafter HMAC verifies (fire-and-forget, never blocks the webhook).hub/src/api/account.ts— secret status endpoint surfaceslegacy_in_use+legacy_hit_at.web/src/components/SettingsPage.tsx— amber callout above the Rotate URL button whenlegacy_in_use; clears state on rotate success.hub/test/coolify-webhook.test.ts— assertsmarkUserCoolifyWebhookLegacyHitIS called on valid legacy HMAC and IS NOT called on bad signature.docs/coolify-webhook-migration.md— documents the newlegacy_in_usefield + the in-UI banner contract.Test plan
cd hub && bun test test/coolify-webhook.test.ts— passes (added 1 new test, 19 pass / 7 skip).cd hub && bun test— 283 pass / 5 fail; the 5 failures (insertRunV2 started_at safety,insertDeploymentRun started_at safety) pre-exist onorigin/mainand are unrelated.cd web && bun run build— clean tsc + vite build.🤖 Generated with Claude Code