fix(traefik): remove stale acme.json certificates on domain/app deletion - #4921
Open
scthakuri wants to merge 1 commit into
Open
fix(traefik): remove stale acme.json certificates on domain/app deletion#4921scthakuri wants to merge 1 commit into
scthakuri wants to merge 1 commit into
Conversation
Deleting a domain, application, or preview deployment removed the Traefik routing config but left the Let's Encrypt certificate entry in acme.json, causing Traefik to retry ACME renewal indefinitely for domains that no longer exist. Fixes Dokploy#4920
|
This is really quite an important task. I've been worried about it for a long time because otherwise there’s always so much useless information left over, and it’s really annoying to look at the logs. It would be great if this could be solved. |
|
traefik only reads acme.json at startup, from then on it only writes to the file on changes, it does not read from it, so this would not change anything, it is also advised not to alter this file whilst traefik is running. the recommended path would be to stop traefik, then edit file, then restart traefik. however, i would recommend using dns challenge with a wildcard, this prevents unnecessary ca certificate generation |
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
acme.json, leaving stale Let's Encrypt certificate entries behind.removeAcmeCertificate(host, serverId)inpackages/server/src/utils/traefik/domain.tsthat prunes the matching certificate entry (bydomain.mainor anysans) fromacme.json, safely for both local and remote (SSH) servers, only writing back when something actually changed.Test plan
pnpm --filter=@dokploy/server run typecheckpnpm --filter=dokploy run typecheckbiome checkon all changed filesapps/dokploy/__test__/traefik/acme-certificate.test.ts(5 new tests: host match, SAN match, case-insensitivity, no-op when unrelated, no-op when acme.json is missing)vitest run) — 72 files / 660 tests passingFixes #4920