pki: add per-CA configurable maintenance_interval and renewal_window_ratio#7479
Merged
francislavoie merged 2 commits intocaddyserver:masterfrom Feb 15, 2026
Conversation
…ratio - Add MaintenanceInterval and RenewalWindowRatio to CA struct (JSON + Caddyfile). - Run one maintenance goroutine per CA using its own interval. - needsRenewal uses per-CA RenewalWindowRatio; invalid/zero ratio falls back to defaults. - Caddyfile: maintenance_interval duration, renewal_window_ratio <0-1>. - Tests: TestCA_needsRenewal, TestParsePKIApp for new options. Fixes caddyserver#7475
francislavoie
approved these changes
Feb 15, 2026
Member
francislavoie
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks!
Member
|
Ah, there's a minor code style lint issue |
maintenance_interval and renewal_window_ratio
This was referenced Feb 20, 2026
4 tasks
francislavoie
added a commit
to caddyserver/website
that referenced
this pull request
Feb 22, 2026
francislavoie
added a commit
to caddyserver/website
that referenced
this pull request
Feb 23, 2026
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
Adds per-CA configuration for certificate maintenance interval and renewal window ratio, as agreed in #7475.
Changes
modules/caddypki/ca.go): New fieldsmaintenance_interval(duration) andrenewal_window_ratio(float in (0, 1]). Defaults: 10m and 0.2. Invalid ratio is clamped to default in Provision.modules/caddypki/maintain.go): One goroutine per CA (maintenanceForCA) with that CA’s interval.needsRenewalis a method on*CAand uses the CA’s ratio (with fallback for zero/invalid).modules/caddypki/pki.go): StartsmaintenanceForCA(ca)for each CA instead of a single globalmaintenance().caddyconfig/httpcaddyfile/pkiapp.go): New options insidepki { ca { ... } }:maintenance_interval <duration>(e.g.5m,1h)renewal_window_ratio <ratio>(e.g.0.15); must be in (0, 1]Fixes #7475