Skip to content

Commit 5fc50ce

Browse files
committed
docs: comprehensive R2_ARCHIVE_ENABLED documentation
Add clear documentation that R2 archival is ENABLED BY DEFAULT and how to disable it if needed. New Documentation: - docs/CONFIGURATION.md - Complete environment variables guide - All variables explained (ENVIRONMENT, AI_GATEWAY_ID, R2_ARCHIVE_ENABLED) - How to override via dashboard vs wrangler.jsonc - When to enable/disable each feature - Bindings configuration reference Updated Documentation: - README.md - Added "R2 archival ENABLED BY DEFAULT" warning - Clear instructions to disable (dashboard or wrangler.jsonc) - When you might want to disable archival - docs/R2_STORAGE.md - New section "Enabling/Disabling R2 Archival" - Step-by-step disable instructions (2 options) - When to disable archival (quota, testing, diagnostics) - Updated emergency procedures - Simplified pre-implementation checklist Key Points Documented: ✅ R2_ARCHIVE_ENABLED=true by default in wrangler.jsonc ✅ Two ways to disable (dashboard preferred, no redeploy) ✅ When to disable (approaching quota, testing, etc.) ✅ How to re-enable archival ✅ Monitoring via /api/archive endpoint This ensures users understand R2 is active by default and know how to control it without confusion.
1 parent 8423197 commit 5fc50ce

3 files changed

Lines changed: 444 additions & 8 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ npx wrangler kv namespace create CACHE --preview
7676

7777
# 7. (Optional) Enable R2 Storage for archival
7878
# ⚠️ R2 REQUIRES BILLING ACCOUNT - See docs/R2_STORAGE.md
79+
# NOTE: R2 archival is ENABLED BY DEFAULT (R2_ARCHIVE_ENABLED=true in wrangler.jsonc)
80+
# To disable: Set R2_ARCHIVE_ENABLED=false in Cloudflare Dashboard or wrangler.jsonc
81+
#
7982
# Go to Cloudflare Dashboard → R2 → Purchase R2 (free tier available)
8083
# Add payment method (required even for free tier)
8184
# Create bucket: npx wrangler r2 bucket create threat-intel-archive
@@ -298,11 +301,26 @@ terminal: {
298301

299302
**R2 Storage requires an active billing account and payment method**, even for the free tier. While the free tier is generous (10GB storage, 1M writes, 10M reads per month), **you WILL be charged for overages**.
300303

304+
**⚙️ R2 Archival is ENABLED BY DEFAULT** (`R2_ARCHIVE_ENABLED=true` in `wrangler.jsonc`)
305+
306+
**To disable R2 archival:**
307+
```bash
308+
# Option 1: Via Cloudflare Dashboard (no redeploy needed)
309+
# Workers & Pages → your-worker → Settings → Variables
310+
# Add: R2_ARCHIVE_ENABLED = false
311+
312+
# Option 2: Edit wrangler.jsonc and redeploy
313+
"vars": {
314+
"R2_ARCHIVE_ENABLED": "false" // Change to false
315+
}
316+
```
317+
301318
**Safety measures implemented:**
302319
- Hard limit at 80% of free tier (8GB, 800K operations)
303320
- KV-based quota tracking prevents accidental overages
304321
- Monthly archival cron job (automatic on 1st of month)
305322
- Conservative 90-day archive threshold
323+
- Can be disabled via environment variable
306324

307325
**See** [`docs/R2_STORAGE.md`](./docs/R2_STORAGE.md) for complete billing requirements, quota protection, and emergency procedures.
308326

0 commit comments

Comments
 (0)