From 506787f8fcdfa55a50e75d21e3739f3ff6d3ad41 Mon Sep 17 00:00:00 2001 From: Vlad Doloman Date: Sat, 15 Aug 2026 04:51:59 +0300 Subject: [PATCH] Add design doc for configurable certificate lifetime CERT_DAYS setting, --days CLI flag, and a Days field in the TUI cert form. "default"/"" inherit EasyRSA's own EASYRSA_CERT_EXPIRE so that deploying this cannot silently shorten certs on an existing PKI. Records why --days=N beats exporting EASYRSA_CERT_EXPIRE, and why the local rejection of 0 is a fast-fail mirror of EasyRSA's own gate rather than a substitute for it. Co-Authored-By: Claude Opus 5 --- .../specs/2026-08-15-cert-days-design.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 docs/superpowers/specs/2026-08-15-cert-days-design.md 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 `