certbot: `renew --once` exits 0 when the renewed hook fails
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 64/100
Línea de trabajo
Comienza en dstack/certbot/src/bot.rs, siguiendo cómo renew_and_run_hook informa de los fallos del hook de renovación, y después sigue la ruta --once en cli/src/main.rs. Conserva el comportamiento actual del bucle del daemon de registrar y continuar, pero haz que --once devuelva un código de salida distinto de cero cuando el hook no se ejecute o termine sin éxito. Verifica ambas semánticas con las rutas de comandos de certbot relevantes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Follow-up to #924.
certbot renew --once is the cron/one-shot entry point. #924 made it invoke the renewed_hook (correct — a one-shot renewal that skips the reload hook leaves the serving process on the old cert), but hook failures are only logged:
// dstack/certbot/src/bot.rs
match std::process::Command::new("/bin/sh").arg("-c").arg(hook).status() {
Ok(status) if status.success() => {}
Ok(status) => error!("renewed hook failed with status: {status}"),
Err(error) => error!("failed to run renewed hook: {error:?}"),
}
Ok(true)
So renew_and_run_hook returns Ok(true) regardless, and certbot renew --once exits 0 even when the hook never ran or exited non-zero. A cron job or systemd OneShot unit wrapping this sees success while the certificate on disk is new and the serving process is still holding the old one — exactly the failure that is supposed to be visible.
Swallowing the error is right for the daemon (the next interval retries), wrong for --once (there is no next interval).
Proposal
Split the two semantics. Options, roughly in order of preference:
- Have
renew_and_run_hookreturn the hook outcome (e.g.Result<Outcome>carryinghook_failed) and let the--oncepath incli/src/main.rsturn a hook failure into a non-zero exit, whilerun()keeps logging and continuing. - Add a
fail_on_hook_error: boolparameter, set from theonceflag.
Either way the daemon loop must keep its current behaviour: a failing hook should not abort the loop.
- Lenguaje dominante
- Rust
- Estrellas
- 546
- Forks
- 96
- Merge medio
- 19 h 22 min
- PR fusionados (30 d)
- 109
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Dstack-TEE/dstack
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
Dstack-TEE/dstack#1301 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Dstack-TEE/dstack#1300 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Dstack-TEE/dstack#1299 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Dstack-TEE/dstack#1298 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Dstack-TEE/dstack#1297 ·
Todos los issues de Dstack-TEE/dstack
Issues similares
-
risk:low runtime status:in-progress type:test
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
EricSpencer00/Resilient#4835 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
bisq-network/bisq-musig#204 ·
-
agent:ready documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
cesarferreira/stax#890 ·