docs: fix filename typo and add Cloudflare Pages deploy details across docs
This commit is contained in:
1 parent
7be66a703c
commit
1019972e25
13 files changed
+393
-403
No files matched your search
@@ -11,14 +11,14 @@ Both are managed under **Workers & Pages** in the Cloudflare dashboard.
|
||||
|
||||
## Dashboard URLs
|
||||
|
||||
| Resource | URL |
|
||||
| ------------------------ | ---------------------------------------------------------------------------------------------- |
|
||||
| Workers & Pages overview | `https://dash.cloudflare.com/{accountId}/workers-and-pages` |
|
||||
| Worker: linearvoid | `https://dash.cloudflare.com/{accountId}/workers/services/view/linearvoid/production/settings` |
|
||||
| Pages project | `https://dash.cloudflare.com/{accountId}/pages/view/linearvoid` |
|
||||
| API tokens | <https://dash.cloudflare.com/profile/api-tokens> |
|
||||
| Resource | URL |
|
||||
| ------------------------ | ------------------------------------------------------------------------------------------------------------------- |
|
||||
| Workers & Pages overview | `https://dash.cloudflare.com/deb11491c54ec53a24772e98ac6d8128/workers-and-pages` |
|
||||
| Worker: linearvoid | `https://dash.cloudflare.com/deb11491c54ec53a24772e98ac6d8128/workers/services/view/linearvoid/production/settings` |
|
||||
| Pages project | `https://dash.cloudflare.com/deb11491c54ec53a24772e98ac6d8128/pages/view/linearvoid` |
|
||||
| API tokens | <https://dash.cloudflare.com/profile/api-tokens> |
|
||||
|
||||
## 1) Worker: `linearvoid` (edge cache headers)
|
||||
## Worker: `linearvoid` (edge cache headers)
|
||||
|
||||
The Worker at `infrastructure/cloudflare/worker.js` runs on the `linearvoid` Workers service. It intercepts requests and adds immutable `Cache-Control` headers to `.m4s` segment files.
|
||||
|
||||
@@ -30,31 +30,34 @@ npx wrangler deploy infrastructure/cloudflare/worker.js
|
||||
|
||||
Or paste into the Workers dashboard at the URL above (Quick Edit).
|
||||
|
||||
## 2) Pages: Static frontend
|
||||
## Pages: Static frontend
|
||||
|
||||
Two approaches — pick one:
|
||||
|
||||
### Option A: Git integration (recommended)
|
||||
|
||||
Connect the Gitea repository directly in Cloudflare Pages:
|
||||
|
||||
1. Pages → Create a project → Connect to Git
|
||||
2. Link `git.allucanget.biz/zwitschi/linearvoid`
|
||||
3. Build command: `cd frontend && npm run build`
|
||||
4. Output directory: `frontend/dist`
|
||||
5. Add custom domain: `linearvoid.tv`
|
||||
|
||||
Cloudflare handles builds and deploys automatically on push.
|
||||
|
||||
> **Naming:** If `linearvoid` is already used by the Worker service, name the Pages project `linearvoid-site` (or similar). Workers and Pages share a namespace.
|
||||
|
||||
### Option B: Direct Upload via Gitea Actions
|
||||
### Direct Upload via Gitea Actions
|
||||
|
||||
Use `.gitea/workflows/pages-deploy.yml` to build in Gitea Actions and upload via the Cloudflare API.
|
||||
|
||||
See [gitea-cloudflare-pages.md](./gitea-cloudflare-pages.md) for the workflow.
|
||||
|
||||
## 3) Custom domains
|
||||
### Variables and secrets
|
||||
|
||||
On Cloudflare pages, set the following environment variables (needed to run the frontend)
|
||||
|
||||
| Type | Name | Value |
|
||||
| --------- | -------------------------------------- | ----------------------------------------------- |
|
||||
| Secret | ADMIN_PASSWORD | `not-a-real-admin-password` |
|
||||
| Plaintext | ADMIN_SESSION_TTL_HOURS | `12` |
|
||||
| Plaintext | ADMIN_USERNAME | `boogers` |
|
||||
| Plaintext | HLS_SEGMENT_DURATION | `6` |
|
||||
| Plaintext | HLS_WINDOW_SIZE | `24` |
|
||||
| Plaintext | PLAYLIST_PATH | `/app/playlist/playlist.txt` |
|
||||
| Plaintext | VITE_PUBLIC_ADMIN_DEFAULT_MODERATOR | `boogers` |
|
||||
| Plaintext | VITE_PUBLIC_ADMIN_DEFAULT_ROOM | `main` |
|
||||
| Plaintext | VITE_PUBLIC_ADMIN_MODERATION_LOG_LIMIT | `50` |
|
||||
| Plaintext | VITE_PUBLIC_APP_URL | `https://linearvoid.tv` |
|
||||
| Plaintext | VITE_PUBLIC_HLS_URL | `https://media.linearvoid.tv/hls/playlist.m3u8` |
|
||||
| Plaintext | VITE_PUBLIC_WS_URL | `wss://linearvoid.tv/ws` |
|
||||
|
||||
## Custom domains
|
||||
|
||||
- `linearvoid.tv` → Pages project
|
||||
- `www.linearvoid.tv` → redirect to `linearvoid.tv`
|
||||
|
||||
Reference in new issue
Block a user