From 1c80cbfa03ec50001c9f32d14a568472d9cd87e5 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Thu, 19 Mar 2026 01:00:20 -0500 Subject: [PATCH] Add Litestream retention policy to limit R2 storage growth Without retention settings, Litestream keeps all WAL segments and snapshots indefinitely. This caused the R2 bucket to grow to ~2.5GB despite the database being under 200MB. Co-Authored-By: Claude Opus 4.6 (1M context) --- deploy/ansible/roles/wpcomposer/templates/litestream.yml.j2 | 2 ++ litestream.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/deploy/ansible/roles/wpcomposer/templates/litestream.yml.j2 b/deploy/ansible/roles/wpcomposer/templates/litestream.yml.j2 index ec57b7d..a8468e7 100644 --- a/deploy/ansible/roles/wpcomposer/templates/litestream.yml.j2 +++ b/deploy/ansible/roles/wpcomposer/templates/litestream.yml.j2 @@ -7,3 +7,5 @@ dbs: access-key-id: ${R2_ACCESS_KEY_ID} secret-access-key: ${R2_SECRET_ACCESS_KEY} force-path-style: true + retention: 24h + snapshot-interval: 24h diff --git a/litestream.yml b/litestream.yml index c2db392..a13f187 100644 --- a/litestream.yml +++ b/litestream.yml @@ -8,3 +8,5 @@ dbs: access-key-id: ${R2_ACCESS_KEY_ID} secret-access-key: ${R2_SECRET_ACCESS_KEY} force-path-style: true + retention: 24h + snapshot-interval: 24h