Skip to content

Comments

fix: clean up ACME certs when resources are deleted#2523

Open
shreyaspapi wants to merge 2 commits intofosrl:mainfrom
shreyaspapi:fix/2382-cleanup-certs-on-resource-deletion
Open

fix: clean up ACME certs when resources are deleted#2523
shreyaspapi wants to merge 2 commits intofosrl:mainfrom
shreyaspapi:fix/2382-cleanup-certs-on-resource-deletion

Conversation

@shreyaspapi
Copy link

@shreyaspapi shreyaspapi commented Feb 23, 2026

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Fixes #2382

What's wrong

When you delete a resource, Traefik keeps its certificate in acme.json and keeps renewing it forever. The deleteResource handler only removes the DB row — it never touches the ACME storage.

What this does

  • After deleting a resource, checks if any other resource still uses the same domain
  • If not, removes that domain's certificate from acme.json so Traefik stops renewing it
  • Adds a configurable acme_json_path option (defaults to /app/config/letsencrypt/acme.json)
  • The cleanup is best-effort — if it fails for any reason, the delete still succeeds

How to test?

  1. Create a resource with a custom domain that gets a Let's Encrypt cert
  2. Delete that resource
  3. Verify the domain's cert is removed from acme.json
  4. Verify that domains shared by other resources are NOT removed

@shreyaspapi shreyaspapi force-pushed the fix/2382-cleanup-certs-on-resource-deletion branch from ba7c3d3 to 9f31532 Compare February 23, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pangolin requests certificates for domains of deleted resources

1 participant