Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ var (
revokeArg = revokeCmd.Arg("certificate-id-or-path", "Certificate ID to revoke").String()

accountThumbprintCmd = kingpin.Command("account-thumbprint", "Prints account thumbprints")


forceRenewFlag = kingpin.Flag("forceRenew", "Force renewal of certificate").Bool()
)

const reconcileHelp = `Reconcile ACME state, idempotently requesting and renewing certificates to satisfy configured targets.
Expand Down Expand Up @@ -151,6 +154,10 @@ func Main() {
log.Errore(err, "cannot load response file, continuing anyway")
}

if *forceRenewFlag {
storageops.ForceRenew = true
}

switch cmd {
case "reconcile":
cmdReconcile()
Expand Down
2 changes: 1 addition & 1 deletion storageops/reconcile-util.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func CertificateNeedsRenewing(c *storage.Certificate, t *storage.Target) bool {
}

renewTime := renewTime(cc.NotBefore, cc.NotAfter, t)
needsRenewing := !InternalClock.Now().Before(renewTime)
needsRenewing := !InternalClock.Now().Before(renewTime) || ForceRenew

log.Debugf("%v needsRenewing=%v notAfter=%v", c, needsRenewing, cc.NotAfter)
return needsRenewing
Expand Down
2 changes: 2 additions & 0 deletions storageops/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ var InternalClock = clock.Default()
// Internal use only. Used for testing purposes. Do not change.
var InternalHTTPClient *http.Client

var ForceRenew = false

// Optional configuration for the Reconcile operation.
type ReconcileConfig struct {
// If non-empty, a set of target names/paths to limit reconciliation to.
Expand Down