* refactor: move lighthouse audits to dataforseo (#43) * refactor: move lighthouse audits to dataforseo * chore: remove obsolete audit settings modal * refactor: rename psi flows to lighthouse * save * refactor: simplify audit lighthouse storage flow * fix: separate lighthouse metrics from actionable audits * refactor: remove redundant audit project inputs * feat: redesign lighthouse issues screen with score gauges and table layout Replace flat score cards with circular SVG gauges, condense metrics into a compact grid, and switch issue list from cards to an expandable table with fixed column widths. * test: harden lighthouse regression coverage * fix: restore project-scoped audit inputs * refactor: simplify lighthouse payload handling * refactor: inline lighthouse server handlers * refactor: share audit workflow types * refactor: simplify lighthouse payload flows * save * refactor: drop project pagespeed api key * fix: restore lighthouse issues loading with resilient project context * fix: restore audit issues back navigation * refactor: simplify project context and lighthouse error handling * fix: tolerate DataForSEO lighthouse payload drift * refactor: route audit lighthouse through dataforseo client --------- * refactor: move DataForSEO response cache from KV to R2 KV TTL-based expiry is imprecise for cache freshness. Switch to R2 with soft TTL via custom metadata (expiresAt) and a 7-day lifecycle rule for cleanup. Cache objects live under the `dataforseo-cache/` prefix, separate from durable audit payloads in `site-audit/`. * refactor: use Workers crypto for R2 cache keys Keep the cache helper aligned with the Cloudflare runtime and avoid pulling Worker bindings into Vitest. Also clarify that R2 lifecycle cleanup is optional but recommended to control storage growth. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.0 KiB
Cloudflare Self-Hosting
This guide covers:
- Initial setup after clicking Deploy to Cloudflare
- How to update to the latest OpenSEO version
- How to add teammates
Initial setup
1) Deploy from GitHub
Click the deploy button, there are lots of fields on the deploy form, but you only need to do the below steps.
- Connect your Git provider (GitHub/GitLab).
- Leave the resource naming fields as default unless you have a reason to change them.
- Click
Create and Deploy. - Wait 1-2 minutes for deployment to finish.
2) Configure authentication and secrets
In the Cloudflare dashboard:
- Go to
Compute->Workers & Pages-> your OpenSEO Worker. - Open
Settings. - In
Domains & Routes, enableCloudflare Accessfor theworkers.devroute. - Save the values shown by Cloudflare Access.
- In
Variables & Secrets, add:POLICY_AUD(from Access setup)TEAM_DOMAIN(domain fromJWKS_URL, for examplehttps://your-team.cloudflareaccess.com)DATAFORSEO_API_KEY
3) Optional: add an R2 lifecycle rule
DataForSEO API responses are cached in R2 under the dataforseo-cache/ prefix. This step is optional, but recommended to automatically clean up expired cache objects:
npx wrangler r2 bucket lifecycle add open-seo dataforseo-cache-expiry dataforseo-cache/ --expire-days 7
If you changed the R2 bucket name during deploy, replace open-seo with your bucket name.
Without a lifecycle rule, cached objects under dataforseo-cache/ will accumulate indefinitely and increase storage costs over time.
4) Validate setup
- Open your Worker URL again.
- Sign in with Cloudflare Access.
- OpenSEO should load after login.
If login fails, re-check the three secrets and Access toggle.
How to update to the latest OpenSEO version
If your repo was created from the Cloudflare Deploy button, use this flow.
One-time setup
Run this once in your local repo:
git remote add upstream https://github.com/every-app/open-seo.git
git fetch upstream
Update steps (use every time)
git fetch upstream
cp wrangler.jsonc wrangler.local.backup.jsonc
git checkout main
git reset --hard upstream/main
cp wrangler.local.backup.jsonc wrangler.jsonc
git add wrangler.jsonc
git commit -m "restore Cloudflare settings" || true
git push --force-with-lease origin main
Why this is needed:
wrangler.jsonchas your Cloudflare resource IDs.- The update step keeps your IDs while pulling the newest OpenSEO code.
Give teammates access to OpenSEO
To let teammates sign in to OpenSEO, update your Cloudflare Access policy.
- Open Cloudflare Zero Trust.
- Go to Access -> Applications.
- Open your OpenSEO application.
- Edit the
Allowpolicy. - Add teammate emails (or your company email domain / group).
- Save.
After saving, teammates can open your OpenSEO URL and sign in through Cloudflare Access.