Use Allure Report Storage as a Cloudflare Worker.
- Learn more about Allure Report at https://allurereport.org
- π Documentation β discover official documentation for Allure Report
- β Questions and Support β get help from the team and community
- π’ Official annoucements β be in touch with the latest updates
- π¬ General Discussion β engage in casual conversations, share insights and ideas with the community
- Cloudflare account with a D1 database and an R2 bucket
wrangler.tomlupdated with your D1database_id- The R2 bucket name must match
bucket_nameinwrangler.toml(allure-report-storage) or be updated there - Worker vars or secrets:
ACCESS_TOKENandSECRET
The Worker uses D1 + R2 by default. S3-compatible storage is an alternative backend for report files/assets.
-
Create the Cloudflare resources:
corepack enable yarn dlx wrangler d1 create allure-report-storage yarn dlx wrangler r2 bucket create allure-report-storage -
Update
database_idinwrangler.toml. -
Set
ACCESS_TOKENandSECRETas vars or Worker secrets. -
Keep or adjust the scheduled cron in
wrangler.toml; it runs report retention cleanup for Workers. -
Deploy the Worker:
corepack enable yarn dlx wrangler deploy -
Start locally if needed:
corepack enable yarn dlx wrangler dev
Use STORAGE_BACKEND=s3 instead of filesystem storage.
Required vars: S3_BUCKET, S3_REGION, S3_ENDPOINT, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_FORCE_PATH_STYLE.
If S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEY are not set, the AWS SDK default credential provider chain is used.
Optional vars: S3_PREFIX, S3_REPORTS_PREFIX, S3_ASSETS_PREFIX, S3_SESSION_TOKEN.
Cloudflare R2 example:
STORAGE_BACKEND=s3
S3_BUCKET=allure-report-storage
S3_REGION=auto
S3_ENDPOINT=https://<cloudflare-account-id>.r2.cloudflarestorage.com
S3_ACCESS_KEY_ID=<access-key>
S3_SECRET_ACCESS_KEY=<secret-key>
S3_FORCE_PATH_STYLE=falseBucket-specific R2 endpoints are normalized internally.
Automated retention can delete old reports to reduce R2 storage costs. It is disabled by default and enabled only when at least one Worker var is set:
REPORT_RETENTION_MAX_REPORTS_PER_BRANCH=20
REPORT_RETENTION_MAX_REPORT_AGE_DAYS=30REPORT_RETENTION_MAX_REPORTS_PER_BRANCH: keep newest completed reports per branch up to this positive integer limit, delete older ones.REPORT_RETENTION_MAX_REPORT_AGE_DAYS: delete reports older than this positive number of days. The newest completed report per branch is always preserved.
Both strategies can be enabled together. The Worker runs retention after report completion and through the scheduled cron in wrangler.toml. Retention does not change public history download limits or manual delete behavior.
curl https://<your-worker-domain>/api/ping