diff --git a/docs/superpowers/specs/2026-08-15-cert-days-design.md b/docs/superpowers/specs/2026-08-15-cert-days-design.md new file mode 100644 index 0000000..64cbfa5 --- /dev/null +++ b/docs/superpowers/specs/2026-08-15-cert-days-design.md @@ -0,0 +1,122 @@ +# Configurable Certificate Lifetime — Design + +**Goal:** Let the operator choose how long an issued certificate is valid — as a setting (`CERT_DAYS`), a CLI flag (`--days`), and a field in the TUI cert form — while leaving today's behaviour untouched for anyone who doesn't set it. + +**Status:** approved 2026-08-15, ready for an implementation plan. + +## Background + +`build_client_full()` passes nothing about validity to EasyRSA today, so every certificate inherits `EASYRSA_CERT_EXPIRE` from the `vars` file (365 days on the deployment that prompted this). There is no way to issue a shorter-lived cert without editing `vars`, which changes it for every tool that touches the PKI. + +## Decisions + +### The setting + +```python +CERT_DAYS = "default" # lifetime of certs this tool issues, in days. + # "default" or "" = leave it to EasyRSA (your vars' + # EASYRSA_CERT_EXPIRE). A positive integer overrides + # it — e.g. 90. +``` + +`"default"` and `""` both mean *inherit*. This is deliberate: deploying the new version must not silently shorten certificates on an existing PKI. Anyone who wants a fixed lifetime sets a number. + +`CERT_DAYS` joins `_OVERRIDABLE_SETTINGS`, so an external `.conf` can set it like any other setting. The repo ships no sample `.conf` (`CONFIG_PATH` defaults to `