moxie/storage-and-static

Static files & S3

Repository layout

static/
├── public/     # Publicly readable via CDN / S3 policy
└── private/    # Restricted objects (signed URLs or internal use)

Local development

URL pattern Maps to
/static/... static/public/... — production-shaped public paths
/s3/... Bucket root for browsing public and private trees during dev

Examples:

http://localhost:3001/static/public.txt   → static/public/public.txt
http://localhost:3001/s3/public/docs.html → static/public/docs.html

Deployed behavior

  • GitHub Actions workflows sync static/public and static/private to environment-specific buckets on pushes/releases (see Infrastructure).
  • CORS and public read for public/* are defined in Terraform — changing bucket policy requires infra review.

Moxie S3 client

  • Handlers can read/write objects via the S3 client for dynamic static workflows (exports, generated artifacts) — still subject to IAM permissions on the Lambda role.