Loading...
FastStaq stores uploads (support attachments, live-chat files, avatars, blog media, and GDPR exports) in an S3-compatible bucket. Cloudflare R2 is recommended for its zero egress fees, but any S3-compatible provider works.
Uploads are off until S3_BUCKET, S3_ACCESS_KEY, and S3_SECRET_KEY are all set. Until then, upload features are inactive.
server/.env:S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
S3_REGION=auto
S3_BUCKET=your-bucket-name
S3_ACCESS_KEY=your-r2-access-key
S3_SECRET_KEY=your-r2-secret-key
S3_PUBLIC_URL=https://pub-xxxx.r2.dev # or your custom domain
MAX_FILE_SIZE=5242880 # 5 MiB default
S3_PUBLIC_URL is required for correct public links. When it is unset the code falls back to S3_ENDPOINT, which does not serve private buckets.
So Next.js image and CSP rules allow your bucket, set in client/.env:
NEXT_PUBLIC_STORAGE_URL=https://pub-xxxx.r2.dev
Every upload is validated server-side before it reaches the bucket: MIME and extension allowlist, size and count limits, magic-byte sniffing, and filename sanitization. Archives and macro-enabled documents are blocked by default; only enable ATTACHMENT_ALLOW_ARCHIVES=true after wiring an antivirus scanner via ANTIVIRUS_SCAN_URL.
Open a support ticket if uploads fail or links 404.
Sign in to leave feedback on this article.