Repository navigation
fix(acme): make renewal scheduling lifetime-aware and retry-safe - #86
Merged
Merged
Conversation
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 of 13 tasks
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
Fixes #76 (A4-01).
Short-lived ACME certificates were due almost immediately because the controller used a minimum 30-day renewal window while the UI used a different formula. A six-hour scheduler also missed shorter retry deadlines, and manual renewal could clear stored backoff.
Solution and architecture
Tests
The complete local check passed (format, lint, typecheck, migration validation, 726 Bun tests including PostgreSQL/Redis integration, clippy and both production builds). After the final counter correction, all 131 Rust tests, clippy and format checks passed again; 36 real Caddy proxy checks; 40 real certificate/HTTP-01/DNS-01 checks; 11 upstream TLS checks. 29 appliance/backup/restore/legacy-upgrade checks also passed. The tests cover lifetime boundaries, persistent retry/restart, manual import/retry, account/environment isolation, legacy indexes and RBAC/runtime contracts. ACME tests use pinned Pebble fixtures, never production issuance.
The real certificate smoke checks denied retries before and after restart. To test eventual success without a 30-minute sleep it changes only the stopped disposable fixture's persisted deadline; no production retry-bypass endpoint is added.
Migration
Existing Alpha 3 certificate indexes and retryAfter timestamps remain readable. The optional acmeRetryUntil map holds shared account cooldowns. The controller continues using the existing state backup; no database migration or proxy snapshot version change is required by this issue. Rollback restores the pre-upgrade backup with the old image.
Security
Retry checks remain inside the existing certificate operation lease boundary. RBAC and the typed Caddy runtime architecture are unchanged. CA transport remains HTTPS-only and does not follow redirects. No credentials, private certificates or production data are included.
Screenshots
Not applicable: this change corrects status timing without changing the layout.
No alpha.4 tag or GitHub release is published by this PR.