-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Summary
Add Cloudflare Pages Direct Upload as an optional publishing destination, similar to the existing SSH rsync support.
User Input (minimal — 3 values)
- Account ID — from Cloudflare dashboard URL
- API Token — with
Cloudflare Pages:Editpermission - Project Name — the Cloudflare Pages project name
Model Changes (MyPlanetModel.swift)
Add 4 properties:
@Published var cloudflareEnabled: Bool? = false
@Published var cloudflareAccountID: String?
@Published var cloudflareAPIToken: String?
@Published var cloudflareProjectName: String?Boilerplate touchpoints in MyPlanetModel.swift:
- Add 4 properties
-
CodingKeysenum — add 4 cases -
init(from decoder:)— 4decodeIfPresentcalls -
encode(to:)— 4encodeIfPresentcalls -
hash(into:)— 4hasher.combinecalls -
==operator — 4 comparisons -
importBackup— restore the 4 properties from backup
Publish Flow
In publish(), add a Cloudflare Pages path similar to the SSH rsync pattern:
- Check
cloudflareEnabledflag - Validate account ID, API token, and project name are present
- Use Cloudflare Pages Direct Upload API:
POST /accounts/{account_id}/pages/projects/{project_name}/deploymentswith files frompublicBasePathas multipart upload - Auto-create the Pages project if it doesn't exist
UI Changes
- Add a "Cloudflare Pages" section in the Publishing settings tab (alongside the existing SSH rsync and IPNS toggles)
- Toggle + 3 text fields (Account ID, API Token, Project Name)
Notes
- The Direct Upload API accepts files as multipart form data — no need for Wrangler CLI
- Pattern follows existing integrations (Filebase, SSH rsync, etc.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels