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:Edit permission
- 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:
Publish Flow
In publish(), add a Cloudflare Pages path similar to the SSH rsync pattern:
UI Changes
Notes
- The Direct Upload API accepts files as multipart form data — no need for Wrangler CLI
- Pattern follows existing integrations (Filebase, SSH rsync, etc.)
Summary
Add Cloudflare Pages Direct Upload as an optional publishing destination, similar to the existing SSH rsync support.
User Input (minimal — 3 values)
Cloudflare Pages:EditpermissionModel Changes (
MyPlanetModel.swift)Add 4 properties:
Boilerplate touchpoints in
MyPlanetModel.swift:CodingKeysenum — add 4 casesinit(from decoder:)— 4decodeIfPresentcallsencode(to:)— 4encodeIfPresentcallshash(into:)— 4hasher.combinecalls==operator — 4 comparisonsimportBackup— restore the 4 properties from backupPublish Flow
In
publish(), add a Cloudflare Pages path similar to the SSH rsync pattern:cloudflareEnabledflagPOST /accounts/{account_id}/pages/projects/{project_name}/deploymentswith files frompublicBasePathas multipart uploadUI Changes
Notes