feat(ops): replace Cloudflare Pages with Workers for frontend hosting
This commit is contained in:
1 parent
9ac1a8b79d
commit
9e56ff7859
16 files changed
+214
-283
No files matched your search
+10
-15
@@ -188,14 +188,14 @@ flowchart LR
|
||||
|
||||
## Cloudflare
|
||||
|
||||
Use this section for full edge setup (DNS, Pages, cache, security, and monitoring).
|
||||
Use this section for full edge setup (DNS, Workers, cache, security, and monitoring).
|
||||
|
||||
Execution tracker: `docs/operations/cloudflare-uptimerobot-checklist.md`.
|
||||
|
||||
### 1. DNS Setup
|
||||
|
||||
1. Add apex record for `linearvoid.tv` pointing to Cloudflare Pages target.
|
||||
2. Add `www` CNAME to Cloudflare Pages and configure redirect to `https://linearvoid.tv`.
|
||||
1. Add apex record for `linearvoid.tv` pointing to the Cloudflare Worker.
|
||||
2. Add `www` CNAME to the Cloudflare Worker and configure redirect to `https://linearvoid.tv`.
|
||||
3. Add `media.linearvoid.tv` for split-domain HLS delivery.
|
||||
4. Keep all records proxied (orange cloud) unless troubleshooting requires DNS-only mode.
|
||||
|
||||
@@ -230,26 +230,21 @@ Configure Cloudflare Cache Rules:
|
||||
|
||||
Reference: [cache-rules](../docs/infrastructure/cloudflare/cache-rules.md).
|
||||
|
||||
### 4. Cloudflare Pages
|
||||
### 4. Cloudflare Workers
|
||||
|
||||
Also see [the automated Gitea Actions deployment guide](./operations/gitea-cloudflare-pages.md).
|
||||
Also see [the automated Gitea Actions deployment guide](./operations/gitea-cloudflare-workers.md).
|
||||
|
||||
Manual setup:
|
||||
|
||||
1. Connect Gitea repository to Cloudflare Pages.
|
||||
2. Build command:
|
||||
1. Create a Cloudflare Worker for the static SPA (Workers & Pages → Create → Worker).
|
||||
2. Build the frontend:
|
||||
|
||||
```bash
|
||||
cd frontend && npm run build
|
||||
```
|
||||
|
||||
3. Output directory:
|
||||
|
||||
```text
|
||||
frontend/dist
|
||||
```
|
||||
|
||||
4. Configure production domain to `linearvoid.tv`.
|
||||
3. Bind the build output (`frontend/dist`) as Worker static assets.
|
||||
4. Configure production domain `linearvoid.tv` on the Worker.
|
||||
|
||||
### 5. Tiered Cache
|
||||
|
||||
@@ -306,7 +301,7 @@ Create external monitors:
|
||||
### 10. Verification Checklist
|
||||
|
||||
1. DNS resolves for `linearvoid.tv`, `www.linearvoid.tv`, and `media.linearvoid.tv`.
|
||||
2. Pages serves frontend for apex and `www` redirects correctly.
|
||||
2. Workers serve frontend for apex and `www` redirects correctly.
|
||||
3. HLS segments are cacheable long-term, manifests refresh every ~2s.
|
||||
4. Admin paths are rate-limited and WAF events are visible.
|
||||
5. HTTPS and WSS both succeed with valid certificates.
|
||||
|
||||
Reference in new issue
Block a user