[{"data":1,"prerenderedAt":530},["ShallowReactive",2],{"selaras-docs-navigation":3,"selaras-docs:\u002Fdeploy\u002Fcloudflare":82},[4,26,43,65],{"title":5,"order":6,"icon":7,"collapse":8,"navBadges":7,"path":9,"stem":10,"children":11,"page":8},"Guide",1,null,false,"\u002Fguide","guide",[12,16,21],{"title":13,"path":14,"stem":15,"order":6,"icon":7,"collapse":8,"navBadges":7},"Getting started","\u002Fguide\u002Fgetting-started","guide\u002Fgetting-started",{"title":17,"path":18,"stem":19,"order":20,"icon":7,"collapse":8,"navBadges":7},"Connect an agent","\u002Fguide\u002Fconnect-an-agent","guide\u002Fconnect-an-agent",2,{"title":22,"path":23,"stem":24,"order":25,"icon":7,"collapse":8,"navBadges":7},"Organize and share","\u002Fguide\u002Fworkspace","guide\u002Fworkspace",3,{"title":27,"order":20,"icon":7,"collapse":8,"navBadges":7,"path":28,"stem":29,"children":30,"page":8},"Authoring","\u002Fauthoring","authoring",[31,35,39],{"title":32,"path":33,"stem":34,"order":6,"icon":7,"collapse":8,"navBadges":7},"Overview","\u002Fauthoring\u002Foverview","authoring\u002Foverview",{"title":36,"path":37,"stem":38,"order":20,"icon":7,"collapse":8,"navBadges":7},"Markdown","\u002Fauthoring\u002Fmarkdown","authoring\u002Fmarkdown",{"title":40,"path":41,"stem":42,"order":25,"icon":7,"collapse":8,"navBadges":7},"HTML and bundles","\u002Fauthoring\u002Fhtml","authoring\u002Fhtml",{"title":44,"order":25,"icon":7,"collapse":8,"navBadges":7,"path":45,"stem":46,"children":47,"page":8},"Deploy","\u002Fdeploy","deploy",[48,52,56,60],{"title":49,"path":50,"stem":51,"order":6,"icon":7,"collapse":8,"navBadges":7},"Docker","\u002Fdeploy\u002Fdocker","deploy\u002Fdocker",{"title":53,"path":54,"stem":55,"order":20,"icon":7,"collapse":8,"navBadges":7},"Cloudflare Workers","\u002Fdeploy\u002Fcloudflare","deploy\u002Fcloudflare",{"title":57,"path":58,"stem":59,"order":25,"icon":7,"collapse":8,"navBadges":7},"Turso and Vercel","\u002Fdeploy\u002Fturso","deploy\u002Fturso",{"title":61,"path":62,"stem":63,"order":64,"icon":7,"collapse":8,"navBadges":7},"Backup and restore","\u002Fdeploy\u002Fbackup","deploy\u002Fbackup",4,{"title":66,"order":64,"icon":7,"collapse":8,"navBadges":7,"path":67,"stem":68,"children":69,"page":8},"Reference","\u002Freference","reference",[70,74,78],{"title":71,"path":72,"stem":73,"order":6,"icon":7,"collapse":8,"navBadges":7},"MCP","\u002Freference\u002Fmcp","reference\u002Fmcp",{"title":75,"path":76,"stem":77,"order":20,"icon":7,"collapse":8,"navBadges":7},"REST API","\u002Freference\u002Frest-api","reference\u002Frest-api",{"title":79,"path":80,"stem":81,"order":25,"icon":7,"collapse":8,"navBadges":7},"Configuration","\u002Freference\u002Fconfiguration","reference\u002Fconfiguration",{"id":83,"title":53,"aside":84,"body":85,"collapse":8,"description":525,"editLink":84,"extension":526,"icon":7,"issueLink":84,"meta":527,"navBadges":7,"navigation":7,"order":20,"path":54,"prevNext":84,"seo":528,"stem":55,"toc":84,"__hash__":529},"docs\u002Fdeploy\u002Fcloudflare.md",true,{"type":86,"value":87,"toc":514},"minimark",[88,92,101,106,193,196,200,203,229,237,241,283,287,298,356,368,372,375,379,386,390,393,428,431,435,442],[89,90,53],"h1",{"id":91},"cloudflare-workers",[93,94,95,96,100],"p",{},"Serangkai runs on Cloudflare Workers from ",[97,98,99],"strong",{},"your own fork"," of the repository.\nCloudflare builds the fork, and you update by syncing it on GitHub. You need a\nGitHub account and a Cloudflare account; no terminal is required.",[102,103,105],"h2",{"id":104},"choose-a-combination","Choose a combination",[107,108,109,128],"table",{},[110,111,112],"thead",{},[113,114,115,119,122,125],"tr",{},[116,117,118],"th",{},"Database",[116,120,121],{},"File storage",[116,123,124],{},"Deploy command",[116,126,127],{},"Created on first deploy",[129,130,131,149,164,179],"tbody",{},[113,132,133,137,140,146],{},[134,135,136],"td",{},"D1",[134,138,139],{},"R2",[134,141,142],{},[143,144,145],"code",{},"bun run deploy",[134,147,148],{},"D1 database and R2 bucket",[113,150,151,153,156,161],{},[134,152,136],{},[134,154,155],{},"Backblaze B2",[134,157,158],{},[143,159,160],{},"bun run deploy:b2",[134,162,163],{},"D1 database",[113,165,166,169,171,176],{},[134,167,168],{},"Turso",[134,170,139],{},[134,172,173],{},[143,174,175],{},"bun run deploy:turso",[134,177,178],{},"R2 bucket",[113,180,181,183,185,190],{},[134,182,168],{},[134,184,155],{},[134,186,187],{},[143,188,189],{},"bun run deploy:turso-b2",[134,191,192],{},"Nothing",[93,194,195],{},"D1 + R2 keeps everything inside Cloudflare and is the simplest choice. R2 must\nbe enabled once in your Cloudflare account, which asks for a payment method\neven on the free tier.",[102,197,199],{"id":198},"prepare-outside-providers","Prepare outside providers",[93,201,202],{},"Skip this for D1 + R2.",[204,205,206,220],"ul",{},[207,208,209,211,212,215,216,219],"li",{},[97,210,168],{},": create a database and a read\u002Fwrite ",[97,213,214],{},"database token"," (not a\nplatform API token). Keep its ",[143,217,218],{},"libsql:\u002F\u002F"," URL and the token.",[207,221,222,224,225,228],{},[97,223,155],{},": create a private bucket and an application key scoped to it\nwith read, write, delete, and list permissions. Note the S3 endpoint\n(",[143,226,227],{},"https:\u002F\u002Fs3.\u003Cregion>.backblazeb2.com","), region, bucket, key ID, and key.",[230,231,234],"s-callout",{"title":232,"type":233},"Backblaze keeps old file versions","warning",[93,235,236],{},"B2 retains replaced objects by default. Add a lifecycle rule with an empty\nprefix that keeps only the last version, or replaced files keep counting toward\nyour B2 storage.",[102,238,240],{"id":239},"fork-and-import","Fork and import",[242,243,244,263,270,277,280],"ol",{},[207,245,246,247,254,255,258,259,262],{},"Open ",[248,249,253],"a",{"href":250,"rel":251},"https:\u002F\u002Fgithub.com\u002Fsewadahapp\u002Fserangkai",[252],"nofollow","sewadahapp\u002Fserangkai",", click\n",[97,256,257],{},"Fork",", and keep the name ",[143,260,261],{},"serangkai",".",[207,264,265,266,269],{},"In Cloudflare, open ",[97,267,268],{},"Workers & Pages → Create → Import a repository"," and\npick your fork.",[207,271,272,273,262],{},"Keep the project name ",[97,274,275],{},[143,276,261],{},[207,278,279],{},"Leave the build command empty, set the deploy command from the table above,\nand turn preview builds off. Preview builds would run other branches against\nyour real data.",[207,281,282],{},"Deploy. The first deploy creates the database and bucket your combination\nneeds; later deploys reuse them.",[102,284,286],{"id":285},"add-the-secrets","Add the secrets",[93,288,289,290,293,294,297],{},"In the Worker, open ",[97,291,292],{},"Settings → Variables and Secrets"," and add each value as\na ",[97,295,296],{},"Secret",". Saving a secret applies it right away.",[204,299,300,310,327,337],{},[207,301,302,305,306,309],{},[143,303,304],{},"ADMIN_USERNAME"," and a strong ",[143,307,308],{},"ADMIN_PASSWORD"," (at least 8 characters)",[207,311,312,315,316,319,320,323,324],{},[143,313,314],{},"JWT_SECRET",", ",[143,317,318],{},"SHARE_SECRET",", and ",[143,321,322],{},"NUXT_APP_SECRET",": three different random\nvalues from a password manager's generator (32+ characters) or\n",[143,325,326],{},"openssl rand -base64 32",[207,328,329,330,333,334],{},"Turso only: ",[143,331,332],{},"TURSO_DATABASE_URL"," and ",[143,335,336],{},"TURSO_AUTH_TOKEN",[207,338,339,340,315,343,315,346,315,349,352,353],{},"B2 only: ",[143,341,342],{},"S3_ENDPOINT",[143,344,345],{},"S3_REGION",[143,347,348],{},"S3_BUCKET",[143,350,351],{},"S3_ACCESS_KEY_ID",", and\n",[143,354,355],{},"S3_SECRET_ACCESS_KEY",[93,357,358,359,361,362,364,365,367],{},"Keep the random values stable. Changing ",[143,360,314],{}," or ",[143,363,322],{}," signs\neveryone out, and changing ",[143,366,318],{}," breaks existing share links.",[102,369,371],{"id":370},"check-it-works","Check it works",[93,373,374],{},"Sign in, create a rangka, and upload a file. The health endpoint alone checks\nneither the database nor file storage.",[102,376,378],{"id":377},"updating","Updating",[93,380,381,382,385],{},"Open your fork on GitHub and click ",[97,383,384],{},"Sync fork → Update branch",". Cloudflare\nredeploys with the new version; your data, secrets, and domain stay as they\nare.",[102,387,389],{"id":388},"moving-from-a-deploy-button-copy","Moving from a Deploy button copy",[93,391,392],{},"Earlier versions used Cloudflare's Deploy button, which copies the repository\ninstead of forking it, so the copy never receives updates. To switch:",[242,394,395,404,418,425],{},[207,396,397,398,401,402,262],{},"Rename your copy on GitHub (for example to ",[143,399,400],{},"serangkai-old","), then fork\nSerangkai as ",[143,403,261],{},[207,405,289,406,409,410,413,414,417],{},[97,407,408],{},"Settings → Build",", click ",[97,411,412],{},"Disconnect",", then\n",[97,415,416],{},"Connect"," your fork.",[207,419,420,421,424],{},"Set the build settings as above. B2 and Turso copies use their ",[143,422,423],{},"deploy:*","\ncommand.",[207,426,427],{},"Sync or redeploy, check your rangka and files are there, then delete the old\ncopy.",[93,429,430],{},"The Worker keeps its secrets, domain, database, and bucket.",[102,432,434],{"id":433},"deploy-from-a-terminal","Deploy from a terminal",[93,436,437,438,441],{},"From a clone of the repository, set each secret with\n",[143,439,440],{},"bunx --bun wrangler secret put NAME --config \u003Cconfig>",", then run:",[107,443,444,456],{},[110,445,446],{},[113,447,448,451,453],{},[116,449,450],{},"Combination",[116,452,79],{},[116,454,455],{},"Command",[129,457,458,472,486,500],{},[113,459,460,463,468],{},[134,461,462],{},"D1 + R2",[134,464,465],{},[143,466,467],{},"wrangler.jsonc",[134,469,470],{},[143,471,145],{},[113,473,474,477,482],{},[134,475,476],{},"D1 + B2",[134,478,479],{},[143,480,481],{},"wrangler.b2.jsonc",[134,483,484],{},[143,485,160],{},[113,487,488,491,496],{},[134,489,490],{},"Turso + R2",[134,492,493],{},[143,494,495],{},"wrangler.turso.jsonc",[134,497,498],{},[143,499,175],{},[113,501,502,505,510],{},[134,503,504],{},"Turso + B2",[134,506,507],{},[143,508,509],{},"wrangler.turso-b2.jsonc",[134,511,512],{},[143,513,189],{},{"title":515,"searchDepth":25,"depth":25,"links":516},"",[517,518,519,520,521,522,523,524],{"id":104,"depth":20,"text":105},{"id":198,"depth":20,"text":199},{"id":239,"depth":20,"text":240},{"id":285,"depth":20,"text":286},{"id":370,"depth":20,"text":371},{"id":377,"depth":20,"text":378},{"id":388,"depth":20,"text":389},{"id":433,"depth":20,"text":434},"Deploy to Cloudflare with D1 or Turso, and R2 or Backblaze B2.","md",{},{"title":53,"description":525},"l1iQzax8d_UxJRbmPoArlYnr9-d4E88v83Dl8KNBiQg",1795580564113]