Commit graph

16 commits

Author SHA1 Message Date
Viktor Barzin
e81e836d3a [setup-tls-secret] Delete deprecated renew.sh with hardcoded Technitium token
## Context
modules/kubernetes/setup_tls_secret/renew.sh is a 2.5-year-old
expect(1) script for manual Let's Encrypt wildcard-cert renewal via
Technitium DNS TXT-record challenges. It hardcodes a 64-char Technitium
API token on line 7 (as an expect variable) and line 27 (inside a
certbot-cleanup heredoc). Both remotes are public, so the token has been
exposed for ~2.5 years.

The script is not invoked by the module's Terraform (main.tf only creates
a kubernetes.io/tls Secret from PEM files); it is a standalone
run-it-yourself tool. grep across the repo confirms nothing references
`renew.sh` — neither the 20+ stacks that consume the `setup_tls_secret`
module, nor any CI pipeline, nor any shell wrapper.

A replacement script `renew2.sh` (4 weeks old) lives alongside it. It
sources the Technitium token from `$TECHNITIUM_API_KEY` env var and also
supports Cloudflare DNS-01 challenges via `$CLOUDFLARE_TOKEN`. It is the
current renewal path.

## This change
- git rm modules/kubernetes/setup_tls_secret/renew.sh

## What is NOT in this change
- Technitium token rotation. The leaked token still works against
  `technitium-web.technitium.svc.cluster.local:5380` until revoked in the
  Technitium admin UI. Rotation is a prerequisite for the upcoming
  git-history scrub, which will remove the token from every commit via
  `git filter-repo --replace-text`.
- renew2.sh is retained as-is (already env-var-sourced; clean).
- The setup_tls_secret module's main.tf is not touched; 20+ consuming
  stacks keep working.

## Test plan
### Automated
  $ grep -rn 'renew\.sh' --include='*.tf' --include='*.hcl' \
       --include='*.yaml' --include='*.yml' --include='*.sh'
  (no output — confirms no consumer)
  $ git grep -n 'e28818f309a9ce7f72f0fcc867a365cf5d57b214751b75e2ef3ea74943ef23be'
  (no output in HEAD after this commit)

### Manual Verification
1. `git show HEAD --stat` shows exactly one deletion:
     modules/kubernetes/setup_tls_secret/renew.sh | 136 ---------
2. `test ! -e modules/kubernetes/setup_tls_secret/renew.sh` returns true.
3. `renew2.sh` still exists and is executable:
     ls -la modules/kubernetes/setup_tls_secret/renew2.sh
4. Next cert-renewal run uses renew2.sh with env-var-sourced token; no
   behavioral regression because renew.sh was never part of the automated
   flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 19:41:08 +00:00
Viktor Barzin
2dcb4b7fa4 fix(renew-tls): clean stale _acme-challenge TXT records before certbot
21+ stale TXT records accumulated from previous runs, causing certbot
DNS-01 challenge to fail. Now deletes all _acme-challenge records
from Cloudflare before certbot creates fresh ones.
2026-03-23 22:32:27 +02:00
Viktor Barzin
26be631088 fix some typos [ci skip] 2025-12-29 20:16:53 +00:00
Viktor Barzin
b792a3cb7b try again fixing renewal script via cf [ci skip] 2025-02-15 15:47:14 +00:00
Viktor Barzin
b79f3ddd58 try again [ci skip] 2025-02-15 15:17:02 +00:00
Viktor Barzin
337a01f6b1 hardcode viktorbarzin.me domain in renewal [ci skip] 2025-02-15 14:42:23 +00:00
Viktor Barzin
cb2ab1596c fix script to properly escape strings [ci skip] 2025-02-15 14:31:39 +00:00
Viktor Barzin
cd5a0f57ca update drone yml to use cloudflare for acme challenge [ci skip] 2025-02-15 14:20:31 +00:00
Viktor Barzin
96bdce0880 update tls cert 2023-10-09 19:57:00 +00:00
Viktor Barzin
f7fdec2032 [ci skip] update tls auto renew script to use technitium 2023-10-09 19:42:10 +00:00
Viktor Barzin
c41eda0fd4 [ci skip] update tls auto renew script to use technitium 2023-10-09 18:08:14 +00:00
viktorbarzin
f0a4645726 update renew expect script v2 [ci skip] 2021-09-07 00:50:28 +01:00
viktorbarzin
81e36cb887 update certbot renew script [CI SKIP] 2021-09-05 20:16:19 +01:00
viktorbarzin
403afc86e9 make sure both LE dns records get cleaned up after finish 2021-02-16 23:00:35 +00:00
viktorbarzin
e140140c3f Add LE renewal pipeline 2021-02-16 22:41:58 +00:00
viktorbarzin
7a7bc34ae3 initial 2021-02-08 20:02:17 +00:00