Skip to content

Commit 5fa136c

Browse files
committed
Clarify forced ACME renewals
1 parent 1e088d7 commit 5fa136c

3 files changed

Lines changed: 32 additions & 13 deletions

File tree

docs/certificate-renewal.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,17 @@ fluxheim --config /etc/fluxheim/fluxheim.toml acme-renew
156156
```
157157

158158
By default the command observes the managed certificate files and attempts only
159-
missing or due certificates. Use `--all` to force every configured ACME vhost:
159+
missing or due certificates. If nothing needs renewal, it exits successfully
160+
with `acme attempted: 0` and a status message saying no certificates are due.
161+
Use `--force-renew` only for first issuance testing or deliberate emergency
162+
rotation; repeated forced renewals can hit issuer rate limits:
160163

161164
```bash
162-
fluxheim --config /etc/fluxheim/fluxheim.toml acme-renew --all
165+
fluxheim --config /etc/fluxheim/fluxheim.toml acme-renew --force-renew
163166
```
164167

168+
`--all` is accepted as a backward-compatible alias for `--force-renew`.
169+
165170
The official `1.1.x` RPM and container images include `acme-client` by default.
166171
If you compile from source with a custom feature list, include it explicitly:
167172

@@ -206,7 +211,7 @@ the renewal command:
206211
```bash
207212
sudo systemctl daemon-reload
208213
sudo systemctl restart fluxheim
209-
sudo fluxheim --config /etc/fluxheim/fluxheim.toml acme-renew --all
214+
sudo fluxheim --config /etc/fluxheim/fluxheim.toml acme-renew --force-renew
210215
```
211216

212217
## Packaged Actalis Credentials

docs/config-reference.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,10 @@ You can also invoke the renewal command explicitly:
588588
fluxheim --config /etc/fluxheim/fluxheim.toml acme-renew
589589
```
590590

591-
By default the command renews missing or due certificates only. `--all` attempts
592-
every configured ACME vhost.
591+
By default the command renews missing or due certificates only. `--force-renew`
592+
attempts every configured ACME vhost even when certificates are still valid;
593+
use it sparingly because repeated forced renewals can hit issuer rate limits.
594+
`--all` is accepted as a backward-compatible alias.
593595

594596
```toml
595597
[tls.acme]

src/cli.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ pub enum CliCommand {
6969

7070
/// Run ACME issuance/renewal once for all configured ACME vhosts.
7171
AcmeRenew {
72-
/// Confirm that all configured ACME vhosts should be attempted.
73-
#[arg(long)]
72+
/// Force renewal for every configured ACME vhost, even when certificates are not due.
73+
#[arg(long, alias = "all")]
74+
force_renew: bool,
75+
/// Deprecated alias for --force-renew.
76+
#[arg(long, hide = true)]
7477
all: bool,
7578
},
7679

@@ -255,7 +258,9 @@ fn run_command(
255258
}
256259
Ok(())
257260
}
258-
CliCommand::AcmeRenew { all } => run_acme_renew_command(config_path, *all),
261+
CliCommand::AcmeRenew { force_renew, all } => {
262+
run_acme_renew_command(config_path, *force_renew || *all)
263+
}
259264
CliCommand::AcmeInit {
260265
issuer,
261266
email,
@@ -302,7 +307,7 @@ struct AcmeInitOptions {
302307
#[cfg(feature = "acme-client")]
303308
fn run_acme_renew_command(
304309
config_path: Option<&std::path::Path>,
305-
all: bool,
310+
force_renew: bool,
306311
) -> Result<(), Box<dyn Error + Send + Sync>> {
307312
crate::tls::install_rustls_crypto_provider();
308313

@@ -352,15 +357,20 @@ fn run_acme_renew_command(
352357
}
353358
}
354359

355-
let run = if all {
360+
let run = if force_renew {
356361
runtime.block_on(crate::acme::renew_all_instant_acme_targets(&config, now))?
357362
} else {
358363
runtime.block_on(crate::acme::renew_due_instant_acme_targets(&config, now))?
359364
};
360365

361366
println!("acme attempted: {}", run.attempted);
362-
if all && !targets.is_empty() && run.attempted == 0 {
363-
return Err("ACME renewal planner produced targets, but --all attempted none".into());
367+
if force_renew && !targets.is_empty() && run.attempted == 0 {
368+
return Err(
369+
"ACME renewal planner produced targets, but --force-renew attempted none".into(),
370+
);
371+
}
372+
if !force_renew && run.attempted == 0 {
373+
println!("acme status: no certificates are missing or due for renewal");
364374
}
365375
for outcome in &run.renewed {
366376
println!(
@@ -455,7 +465,9 @@ fn run_acme_init_command(options: AcmeInitOptions) -> Result<(), Box<dyn Error +
455465
}
456466
println!("next: add [vhosts.tls.acme] to each vhost that should receive a managed certificate");
457467
println!("next: run `systemctl daemon-reload` if a systemd drop-in was created");
458-
println!("next: run `fluxheim --config /etc/fluxheim/fluxheim.toml acme-renew --all`");
468+
println!(
469+
"next: run `fluxheim --config /etc/fluxheim/fluxheim.toml acme-renew --force-renew` for first issuance"
470+
);
459471
Ok(())
460472
}
461473

0 commit comments

Comments
 (0)