void 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/{account-cmd-CjyxcGkM.mjs → account-cmd-C84Ee8cO.mjs} +4 -4
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-CZuiVsFh.mjs → auth-CCjt0hcq.mjs} +1 -1
- package/dist/{auth-DLNN0D3Z.mjs → auth-CSkdO2Bb.mjs} +4 -47
- package/dist/{auth-link-BLO4ptzo.mjs → auth-link-CioEg6uY.mjs} +4 -4
- package/dist/{auth-router-ZUg9MF_U.mjs → auth-router-BsR981d4.mjs} +4 -4
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-BxR5FROK.mjs → build-cmd-LzvNJORH.mjs} +17 -5
- package/dist/{cache-D0sWhgKI.mjs → cache-C4MvnrMH.mjs} +2 -2
- package/dist/{cancel-deploy-D4NUqFbi.mjs → cancel-deploy-abUxpP2n.mjs} +2 -2
- package/dist/{cf-build-output-BJ6yGEIS.mjs → cf-build-output-BPqOT964.mjs} +2 -1
- package/dist/cf-build-output-_0HNWysu.mjs +2 -0
- package/dist/cli/cli.mjs +80 -455
- package/dist/cli/{cf-compat.mjs → cloudflare-operation-process.mjs} +442 -421
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-Cu7jWiF1.mjs +2 -0
- package/dist/{client-BTZ3XkrB.mjs → client-RV8NVeB8.mjs} +140 -21
- package/dist/{cloudflare-auth-DQkqoMYa.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -38
- package/dist/{cloudflare-cmd-BKlfGHAy.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +5 -5
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-Ctmrw579.mjs → cloudflare-connect-B8uPZ4nx.mjs} +3 -3
- package/dist/{cloudflare-operations-BT6OWFBk.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
- package/dist/{cloudflare-operations-B9tzgjmf.mjs → cloudflare-operations-fxHb-byx.mjs} +116 -172
- package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
- package/dist/{config-VavjpDnp.d.mts → config-BMHb8RCj.d.mts} +1 -0
- package/dist/config-C_XRIPx2.mjs +89 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-Dg-WkW-C.mjs → connect-Bd4kJd9U.mjs} +5 -5
- package/dist/{create-project-DdoqwFLF.mjs → create-project-Boczwj5r.mjs} +1 -1
- package/dist/{create-project-l9J7pbtm.mjs → create-project-bMf6ffLZ.mjs} +2 -2
- package/dist/{db-gp2sCXyN.mjs → db-8uG64XLl.mjs} +21 -21
- package/dist/{delete-TTedbH6B.mjs → delete-NvbiyeJf.mjs} +2 -2
- package/dist/{deploy-CH-o2CaZ.mjs → deploy-DzAIwqNU.mjs} +908 -582
- package/dist/{deploy-B19L2Bra.mjs → deploy-bjXdFCtn.mjs} +1 -1
- package/dist/{domain-JRF59P_r.mjs → domain-y5Tvydvo.mjs} +3 -3
- package/dist/{email-Bo6G9LOZ.mjs → email-B3umsW75.mjs} +13 -28
- package/dist/{env-BYOrWQnv.mjs → env-BS6qYHDb.mjs} +4 -4
- package/dist/{env-public-BxU_0yTL.d.mts → env-public-BX_r8HR6.d.mts} +1 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
- package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
- package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
- package/dist/{gen-sCtlCOdA.mjs → gen-B580--vC.mjs} +2 -2
- package/dist/gen-BVaUUumi.mjs +2 -0
- package/dist/{github-cmd-0-7PexDq.mjs → github-cmd-v45BdfKX.mjs} +2 -2
- package/dist/{handler-HEcZsaij.d.mts → handler-CZ4nAylQ.d.mts} +1 -1
- package/dist/help-DofyZuY7.mjs +2 -0
- package/dist/{help-GKtwl07I.mjs → help-daGKjXGk.mjs} +229 -747
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +288 -1502
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-FZx3Elvz.mjs → init-Bvy7zrBo.mjs} +46 -15
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-BrQfb_CU.mjs → link-CDqqCjFl.mjs} +3 -3
- package/dist/{list-D44jmIAM.mjs → list-CZj0dzKY.mjs} +3 -3
- package/dist/{live-CKJlvlNp.d.mts → live-Chw1eIMv.d.mts} +1 -1
- package/dist/{local-d1-Bg9OzEEO.mjs → local-d1-2CMnpuW_.mjs} +2 -2
- package/dist/login-DYt_An22.mjs +2 -0
- package/dist/{login-CAsAsQ-_.mjs → login-UZKFM_u7.mjs} +3 -3
- package/dist/{logs-BjKvFnVM.mjs → logs-CUZ6t9t3.mjs} +3 -3
- package/dist/migrate-8_2u55MD.mjs +2 -0
- package/dist/{migrate-BPITvDJN.mjs → migrate-DHul7PRV.mjs} +2 -1
- package/dist/{node-Dt7z256D.mjs → node-BkyRWRx8.mjs} +1 -1
- package/dist/operator-args-CLgKGlwU.mjs +690 -0
- package/dist/{operator-cmd-BK5CCiT9.mjs → operator-cmd-DBA6dl0m.mjs} +68 -22
- package/dist/pages/client.d.mts +34 -2
- package/dist/pages/client.mjs +59 -3
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -308
- package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
- package/dist/plan-D1Q5rf-r.mjs +2 -0
- package/dist/plan-NPpwZ_kc.mjs +58 -0
- package/dist/platform-args-BJdRtlLq.mjs +506 -0
- package/dist/platform-args-D3RXyR6h.mjs +2 -0
- package/dist/{platform-auth-config-BlN8xTdD.mjs → platform-auth-config-B56E9YP1.mjs} +3 -3
- package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BDWO_aER.mjs} +2 -2
- package/dist/{platform-auth-recovery-Dxij8ZbR.mjs → platform-auth-recovery-1gg4CSRe.mjs} +3 -3
- package/dist/{platform-cmd-E0FuL212.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
- package/dist/{platform-cmd-B3hwKrFK.mjs → platform-cmd-DMcQStSc.mjs} +24 -3
- package/dist/{platform-domain-D6Xcy9ZX.mjs → platform-domain-BNkcz0OB.mjs} +2 -2
- package/dist/{platform-lifecycle-k0E0xoxx.mjs → platform-lifecycle-9OyBALhH.mjs} +327 -215
- package/dist/{platform-lifecycle-DMh_qrry.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
- package/dist/{platform-management-Brz_BDiT.mjs → platform-management-CjwLVQwN.mjs} +6 -3
- package/dist/{platform-management-DOtss0BN.mjs → platform-management-CnyTdcWX.mjs} +1 -1
- package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
- package/dist/{platform-recovery-BvtcXON5.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-C-6YZyyg.mjs → prepare-B5Mkic5u.mjs} +1 -1
- package/dist/{prepare-CRhJbVrG.mjs → prepare-DOsL0CC9.mjs} +4 -20
- package/dist/prepare-cgvDMtSb.mjs +2 -0
- package/dist/{project-cmd-BZLCqOqw.mjs → project-cmd-CNzrqvBv.mjs} +16 -16
- package/dist/{project-team-BvgM0WoX.mjs → project-team-DQOWPfQT.mjs} +2 -2
- package/dist/{project-token-l5DqK6Az.mjs → project-token-CTDYU0Cc.mjs} +2 -2
- package/dist/{project-zero-trust-v6Mvpp8y.mjs → project-zero-trust-BNAkW-_0.mjs} +2 -2
- package/dist/{protocol-BBa6cstI.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
- package/dist/protocol-U7bfjHmA.mjs +331 -0
- package/dist/{provision-Fr9pRqce.mjs → provision-C4ORE7G7.mjs} +1 -1
- package/dist/{provision-C4IGqkBf.mjs → provision-CJFgTZY8.mjs} +89 -198
- package/dist/{requests-DN-BbNiM.mjs → requests-MhxYnau8.mjs} +2 -2
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-D7rzSaZM.mjs → rollback-CJ6iSDoU.mjs} +3 -3
- package/dist/route-url-CG7U-cRN.mjs +15 -0
- package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
- package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
- package/dist/runtime/ai.d.mts +12 -8
- package/dist/runtime/ai.mjs +84 -17
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/durable.d.mts +3 -1
- package/dist/runtime/durable.mjs +4 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/kv.mjs +0 -1
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +2 -0
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +25 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +62 -42
- package/dist/runtime/route-url.d.mts +4 -0
- package/dist/runtime/route-url.mjs +2 -0
- package/dist/runtime/routing.d.mts +180 -0
- package/dist/runtime/routing.mjs +1082 -0
- package/dist/runtime/sandbox-container.d.mts +1 -1
- package/dist/runtime/sandbox-container.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +3 -3
- package/dist/runtime/sandbox.mjs +75 -45
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +4 -2
- package/dist/runtime/ws-server.mjs +27 -2
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/runtime/ws.mjs +8 -6
- package/dist/{sandbox-qpNBT8a3.d.mts → sandbox-XZAqzFlG.d.mts} +11 -8
- package/dist/{sandbox-container-DdNEBfCc.d.mts → sandbox-container-Bo0eiFKz.d.mts} +2 -1
- package/dist/{sandbox-container-4fdqLnyb.mjs → sandbox-container-C6ItmVuN.mjs} +4 -2
- package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
- package/dist/{secret-BOtOl_cb.mjs → secret-Dli5fP0B.mjs} +4 -4
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/validate-Dq_L3s0S.mjs +2 -0
- package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
- package/dist/{wrangler-DQF1vKyf.mjs → wrangler-7K-bW_DL.mjs} +8 -239
- package/dist/{ws-BoY7vQML.d.mts → ws-CL1w7GXU.d.mts} +13 -2
- package/package.json +15 -8
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +50 -135
- package/skills/void/docs/guide/ai.md +94 -84
- package/skills/void/docs/guide/app-types.md +3 -32
- package/skills/void/docs/guide/auth.md +12 -116
- package/skills/void/docs/guide/database/d1.md +9 -54
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +5 -26
- package/skills/void/docs/guide/database.md +23 -75
- package/skills/void/docs/guide/deployment.md +27 -113
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +3 -47
- package/skills/void/docs/guide/edge/prerendering.md +5 -20
- package/skills/void/docs/guide/edge/redirects.md +11 -64
- package/skills/void/docs/guide/edge/revalidation.md +5 -18
- package/skills/void/docs/guide/edge/rewrites.md +56 -284
- package/skills/void/docs/guide/edge/static-assets.md +22 -72
- package/skills/void/docs/guide/email/domains.md +112 -0
- package/skills/void/docs/guide/email/receiving.md +139 -0
- package/skills/void/docs/guide/email/sending.md +231 -0
- package/skills/void/docs/guide/email.md +13 -619
- package/skills/void/docs/guide/env-migration.md +11 -11
- package/skills/void/docs/guide/env-vars.md +9 -29
- package/skills/void/docs/guide/index.md +0 -15
- package/skills/void/docs/guide/jobs.md +3 -18
- package/skills/void/docs/guide/kv.md +5 -11
- package/skills/void/docs/guide/live.md +5 -56
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
- package/skills/void/docs/guide/pages-routing/head.md +10 -10
- package/skills/void/docs/guide/pages-routing/islands.md +6 -36
- package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
- package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
- package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
- package/skills/void/docs/guide/pages-routing/overview.md +7 -17
- package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -4
- package/skills/void/docs/guide/platform/administration/email.md +35 -8
- package/skills/void/docs/guide/platform/administration/operations.md +26 -4
- package/skills/void/docs/guide/platform/administration/plans.md +126 -0
- package/skills/void/docs/guide/platform/administration/projects.md +5 -2
- package/skills/void/docs/guide/platform/administration/zero-trust.md +23 -152
- package/skills/void/docs/guide/platform/development/runtime.md +3 -13
- package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
- package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
- package/skills/void/docs/guide/platform/installation/domains.md +30 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +2 -0
- package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +20 -15
- package/skills/void/docs/guide/platform/installation/setup.md +9 -5
- package/skills/void/docs/guide/platform-administration.md +1 -0
- package/skills/void/docs/guide/queues.md +7 -9
- package/skills/void/docs/guide/quickstart.md +38 -37
- package/skills/void/docs/guide/remote-dev.md +4 -9
- package/skills/void/docs/guide/sandboxes.md +29 -21
- package/skills/void/docs/guide/server-routing.md +9 -72
- package/skills/void/docs/guide/sse.md +4 -18
- package/skills/void/docs/guide/ssg.md +3 -15
- package/skills/void/docs/guide/ssr.md +14 -62
- package/skills/void/docs/guide/storage.md +9 -4
- package/skills/void/docs/guide/type-safety.md +3 -14
- package/skills/void/docs/guide/typed-fetch.md +3 -7
- package/skills/void/docs/guide/websockets.md +68 -40
- package/skills/void/docs/integrations/agents.md +3 -3
- package/skills/void/docs/integrations/cloudflare.md +85 -316
- package/skills/void/docs/integrations/frameworks/analog.md +5 -64
- package/skills/void/docs/integrations/frameworks/astro.md +4 -73
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
- package/skills/void/docs/integrations/frameworks/overview.md +11 -54
- package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
- package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
- package/skills/void/docs/reference/api/auth.md +156 -0
- package/skills/void/docs/reference/api/client.md +87 -0
- package/skills/void/docs/reference/api/database.md +95 -0
- package/skills/void/docs/reference/api/durable.md +46 -0
- package/skills/void/docs/reference/api/env.md +50 -0
- package/skills/void/docs/reference/api/handlers.md +254 -0
- package/skills/void/docs/reference/api/pages.md +241 -0
- package/skills/void/docs/reference/api/plugin.md +39 -0
- package/skills/void/docs/reference/api/resources.md +109 -0
- package/skills/void/docs/reference/api/rewrites.md +76 -0
- package/skills/void/docs/reference/api/types.md +92 -0
- package/skills/void/docs/reference/api.md +56 -1218
- package/skills/void/docs/reference/cli/auth.md +88 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +85 -0
- package/skills/void/docs/reference/cli/domains.md +41 -0
- package/skills/void/docs/reference/cli/email.md +129 -0
- package/skills/void/docs/reference/cli/generate.md +116 -0
- package/skills/void/docs/reference/cli/github.md +189 -0
- package/skills/void/docs/reference/cli/platform-config.md +92 -0
- package/skills/void/docs/reference/cli/platform-email.md +81 -0
- package/skills/void/docs/reference/cli/platform-installation.md +127 -0
- package/skills/void/docs/reference/cli/platform-operations.md +90 -0
- package/skills/void/docs/reference/cli/platform-users.md +89 -0
- package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
- package/skills/void/docs/reference/cli/platform.md +70 -0
- package/skills/void/docs/reference/cli/project.md +214 -0
- package/skills/void/docs/reference/cli/secrets.md +76 -0
- package/skills/void/docs/reference/cli/setup.md +70 -0
- package/skills/void/docs/reference/cli.md +32 -1682
- package/skills/void/docs/reference/config.md +12 -18
- package/skills/void/docs/reference/resource-inference.md +3 -58
- package/skills/void/docs/reference/structure.md +14 -41
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/client-Czz8o5jP.mjs +0 -2
- package/dist/gen-CNJ62MM7.mjs +0 -2
- package/dist/help-CmZzxUba.mjs +0 -2
- package/dist/login-CGcRKEoi.mjs +0 -2
- package/dist/migrate-CYfbKkXh.mjs +0 -2
- package/dist/plan-BEZ8VJW0.mjs +0 -256
- package/dist/plan-DpuOr14e.mjs +0 -2
- package/dist/prepare-Bm3iq-u4.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
|
@@ -19,13 +19,15 @@ If nameservers, certificates, or project Zero Trust protection are pending, foll
|
|
|
19
19
|
|
|
20
20
|
Use `--installation <id>` to select an installation explicitly, `--zone example.com` for an app domain such as `apps.example.com`, or `--dedicated-zone` for catch-all routing on a dedicated zone. Nested domains still need the wildcard certificate described below. This command adds the first domain; replacing an existing application domain is not currently supported. It uses the installed runtime and does not require `--runtime` or an app redeploy.
|
|
21
21
|
|
|
22
|
+
Choose an application domain whose wildcard leaves existing Worker Custom Domains reachable. Existing more-specific routes covering all requests can preserve those hostnames. If Void reports a conflict, choose another application domain; for a new installation, you can start with `void platform install --workers-dev` and add a suitable domain later.
|
|
23
|
+
|
|
22
24
|
Browser login sessions are specific to each origin. Apps using their own OAuth providers may need to register their new callback URLs. Void's built-in auth uses the request origin automatically unless the app overrides that configuration.
|
|
23
25
|
|
|
24
26
|
### What Changes in Testing Mode?
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
In testing mode, each app gets a `workers.dev` URL. These URLs continue working after you add a domain; new apps then use the domain.
|
|
27
29
|
|
|
28
|
-
Testing
|
|
30
|
+
Testing URLs support WebSockets, SSE, and shared ISR storage, but skip the extra edge response cache. Their forwarding Workers remain for manual cleanup after uninstall. Platform disablement and project suspension still block their traffic.
|
|
29
31
|
|
|
30
32
|
## Other Domain Options
|
|
31
33
|
|
|
@@ -49,6 +51,32 @@ The management token needs **SSL and Certificates: Read** (or Edit) on that zone
|
|
|
49
51
|
|
|
50
52
|
:::
|
|
51
53
|
|
|
54
|
+
## Optional Dashboard
|
|
55
|
+
|
|
56
|
+
The API's `/admin/` pages are included in the core installation. You can deploy
|
|
57
|
+
the optional user dashboard separately and configure its HTTPS origin during
|
|
58
|
+
installation with `--dashboard-url https://dash.example.com`.
|
|
59
|
+
|
|
60
|
+
For an existing installation, preview and apply the configuration with:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
void platform repair <installation-id> --dashboard-url https://dash.example.com --plan
|
|
64
|
+
void platform repair <installation-id> --dashboard-url https://dash.example.com --yes
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The origin must contain no credentials, path, query, or fragment. Void saves it
|
|
68
|
+
for login callbacks and keeps it across upgrades and repairs. The command does
|
|
69
|
+
not create a dashboard Worker or DNS records; deploy that app separately. Omit
|
|
70
|
+
the option to keep the saved origin. The dashboard provides sign-in, linked
|
|
71
|
+
login methods, and sign-out; use the CLI for user project and team management.
|
|
72
|
+
|
|
73
|
+
If Access protects the platform, its application must cover this dashboard
|
|
74
|
+
origin too. Configure the origin when installing protection. To change it on an
|
|
75
|
+
already protected platform, deliberately remove protection through authentication
|
|
76
|
+
configuration, apply the origin, then enable protection again. Choose a separate
|
|
77
|
+
admission rule first if signup depends on the Access gate. Maintenance stops if
|
|
78
|
+
the configured origin is outside the active coverage.
|
|
79
|
+
|
|
52
80
|
## Cloudflare footprint
|
|
53
81
|
|
|
54
82
|
New platform resources use deterministic `void-<installation-name>-<role>` names where Cloudflare allows them, such as `void-team-api`. Choose an unused installation name in the account; Void stops on an unowned name conflict instead of replacing that resource. Existing installations keep their recorded names, including older names with suffixes.
|
|
@@ -21,6 +21,8 @@ void deploy --platform void --project my-first-app
|
|
|
21
21
|
|
|
22
22
|
`void connect` validates the platform and signs you in when needed. Confirm project creation when deploy asks. To use a project that already exists, run `void project link` instead. An app already linked to another platform keeps its existing destination; use a fresh app directory for your first test.
|
|
23
23
|
|
|
24
|
+
Once accepted by the platform, a deployment continues independently of the CLI connection. The CLI reconnects automatically after a connection failure. Use `void project status` to inspect a deployment after closing the CLI, or `void project cancel` to request cancellation.
|
|
25
|
+
|
|
24
26
|
The CLI stores login credentials in your system keychain, separately for each platform URL. With no URL, `void connect` offers Cloudflare or a Void platform; `void connect --platform void` offers saved platforms and an option to enter another URL.
|
|
25
27
|
|
|
26
28
|
For CI, create a bounded, project-scoped deploy credential while signed in as
|
|
@@ -56,6 +56,8 @@ Repair recreates missing infrastructure that the installer owns. It does not res
|
|
|
56
56
|
|
|
57
57
|
### Upgrade the platform
|
|
58
58
|
|
|
59
|
+
Keep the platform runtime current when updating the Void CLI. If a developer's CLI reports that project lookup requires an upgrade, upgrade the platform before retrying.
|
|
60
|
+
|
|
59
61
|
Use the installed CLI's packaged runtime to upgrade:
|
|
60
62
|
|
|
61
63
|
```sh
|
|
@@ -80,7 +82,7 @@ Database migrations only move forward. Void checks compatibility before upgradin
|
|
|
80
82
|
|
|
81
83
|
Upgrades automatically enable managed Sandboxes. The platform runtime token needs Account / Containers: Edit and Account / Cloudchamber: Edit, and the Cloudflare account must use Workers Paid before its first Sandbox application deploy. The upgrade itself does not probe Containers access, so platforms that do not deploy Sandbox applications need no additional plan or permissions.
|
|
82
84
|
|
|
83
|
-
When upgrading from a release that used tenant-owned Sandbox containers, the upgrade may first ask you to finish the legacy cleanup. Follow the [`sandbox-drain` instructions](
|
|
85
|
+
When upgrading from a release that used tenant-owned Sandbox containers, the upgrade may first ask you to finish the legacy cleanup. Follow the [`sandbox-drain` instructions](../../../reference/cli/platform-operations.md#operator-system), then rerun the upgrade. Administrator login remains available during that maintenance step.
|
|
84
86
|
|
|
85
87
|
After a successful upgrade, you can restore a declared-compatible earlier runtime without reversing migrations:
|
|
86
88
|
|
|
@@ -4,11 +4,16 @@ outline: deep
|
|
|
4
4
|
|
|
5
5
|
# Prerequisites
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
To run a Void platform, you need:
|
|
8
|
+
|
|
9
|
+
- A Cloudflare account with Workers for Platforms and R2 enabled.
|
|
10
|
+
- An empty hosted PostgreSQL database.
|
|
11
|
+
- An account with your chosen login provider. GitHub is the default; Google, OIDC, and Cloudflare Access are also supported.
|
|
12
|
+
- A domain for your apps, or `workers.dev` for testing. You can [add a domain later](/guide/platform/installation/domains#adding-a-domain).
|
|
8
13
|
|
|
9
14
|
Void creates the Workers, storage, queues, routing, and database tables through the CLI.
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
Workers for Platforms requires a paid plan. Your database and Cloudflare usage are billed separately.
|
|
12
17
|
|
|
13
18
|
## Prepare Your Cloudflare Account and Domain
|
|
14
19
|
|
|
@@ -31,15 +36,7 @@ pnpm add --global void
|
|
|
31
36
|
void platform install --plan
|
|
32
37
|
```
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
The installer first offers these choices, with the domain option selected:
|
|
37
|
-
|
|
38
|
-
```text
|
|
39
|
-
Where should your apps live?
|
|
40
|
-
Use a domain — recommended
|
|
41
|
-
Use workers.dev for testing — add a domain later
|
|
42
|
-
```
|
|
39
|
+
Sign in to Cloudflare when prompted, then choose an installation name and account. `--plan` previews the resources without changing them or requiring runtime secrets.
|
|
43
40
|
|
|
44
41
|
For a domain installation, use these answers. Testing mode skips the application domain, zone, and catch-all questions:
|
|
45
42
|
|
|
@@ -52,9 +49,9 @@ For a domain installation, use these answers. Testing mode skips the application
|
|
|
52
49
|
| Optional custom API hostname | Leave empty to use `workers.dev` |
|
|
53
50
|
| Dedicate all unmatched traffic to Void? | Yes only if this whole zone belongs to the platform |
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
Choose an unused installation name in your account. For example, `team` creates resources such as `void-team-api` and `void-team-proxy`.
|
|
56
53
|
|
|
57
|
-
The preview
|
|
54
|
+
The preview includes your login callback URL and links for creating credentials. Keep it open while following [Credentials](/guide/platform/installation/credentials), then run the install command printed at the end.
|
|
58
55
|
|
|
59
56
|
You can select either path directly:
|
|
60
57
|
|
|
@@ -69,7 +66,7 @@ void platform install --workers-dev --plan
|
|
|
69
66
|
|
|
70
67
|
Use an empty PostgreSQL database dedicated to this platform. It stores users, projects, and deployments; individual apps can still use D1. Void creates the tables and the Hyperdrive connection, but does not provision the PostgreSQL server.
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
Use any PostgreSQL provider that accepts connections from your computer and Cloudflare:
|
|
73
70
|
|
|
74
71
|
1. Create a fresh database or project dedicated to the platform, with no existing application tables. Use a database role that can create and manage its tables and schemas.
|
|
75
72
|
2. Open the provider's connection details and select the primary database. Use a direct connection or a session-mode pooler, not transaction pooling. The connection must work from both your computer and Cloudflare.
|
|
@@ -85,4 +82,12 @@ For a dedicated Supabase project, [disable the Data API](https://supabase.com/do
|
|
|
85
82
|
|
|
86
83
|
Once installation claims the database, continue using that same database for resume and maintenance commands. Uninstall never deletes external PostgreSQL.
|
|
87
84
|
|
|
88
|
-
|
|
85
|
+
### Use an existing Hyperdrive
|
|
86
|
+
|
|
87
|
+
The installer can create Hyperdrive for you or use one you manage separately. For an existing configuration:
|
|
88
|
+
|
|
89
|
+
1. Point it at the dedicated platform database using a runtime user, and disable SQL result caching.
|
|
90
|
+
2. Select it in the installer and confirm the database, host, port, and runtime user.
|
|
91
|
+
3. Supply a database owner connection at the PostgreSQL URL prompt so Void can apply migrations.
|
|
92
|
+
|
|
93
|
+
To create one first, choose **Set up a separately managed Hyperdrive** and follow the printed instructions or [Cloudflare’s setup guide](https://developers.cloudflare.com/hyperdrive/get-started/). Rerun the installer once it is ready. Void leaves its configuration under your control. For unattended setup, use the Hyperdrive variables in [Install from CI](/guide/platform/installation/ci).
|
|
@@ -29,7 +29,7 @@ void platform install
|
|
|
29
29
|
|
|
30
30
|
:::
|
|
31
31
|
|
|
32
|
-
After `--plan`, run the
|
|
32
|
+
After reviewing `--plan`, run the command printed under **Next step: run this command to install**. It carries your choices into installation. Confirm the plan, then follow the credential prompts. Void opens the relevant setup pages and provides fallback links in the terminal. It reuses values you have already supplied.
|
|
33
33
|
|
|
34
34
|
## Choose login methods
|
|
35
35
|
|
|
@@ -131,7 +131,9 @@ ID, and secret, without a `cloudflareAccess` block or Cloudflare management toke
|
|
|
131
131
|
Follow Cloudflare's [OIDC application guide](https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/saas-apps/generic-oidc-saas/)
|
|
132
132
|
and register the exact callback printed by Void.
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
### GitHub
|
|
135
|
+
|
|
136
|
+
For GitHub login:
|
|
135
137
|
|
|
136
138
|
1. The installer opens [GitHub's new OAuth App form](https://github.com/settings/applications/new) when it needs OAuth credentials. Sign in as the account that will own the login integration.
|
|
137
139
|
2. Set **Application name** to your platform's display name and **Homepage URL** to the API URL Void just printed.
|
|
@@ -140,9 +142,11 @@ For the default GitHub-only setup:
|
|
|
140
142
|
|
|
141
143
|
This OAuth App handles sign-in.
|
|
142
144
|
|
|
143
|
-
|
|
145
|
+
## Finish installation
|
|
146
|
+
|
|
147
|
+
The installer collects your runtime token, PostgreSQL URL, login-provider credentials, R2 credentials, and signing and encryption keys. It masks secret values and saves setup progress encrypted through your system keychain. Keep a password-manager copy for recovery on another machine.
|
|
144
148
|
|
|
145
|
-
|
|
149
|
+
Once installation finishes, open the printed admin dashboard link. For GitHub-only setup, sign in as the administrator selected during installation. For configurable login, use the one-time `/setup` code to confirm the administrator’s identity. Use the printed API URL to [connect and deploy an app](/guide/platform/installation/first-deployment).
|
|
146
150
|
|
|
147
151
|
Remove the management token from the shell when finished:
|
|
148
152
|
|
|
@@ -162,7 +166,7 @@ void platform install --resume --name <installation-id>
|
|
|
162
166
|
|
|
163
167
|
Keep the management token available for any remaining DNS changes. When using a source build, also pass the same `--runtime` directory. Resume uses the saved checkpoint and original secrets; do not start a second installation or generate replacement keys. If setup failed before a checkpoint was saved, rerun the original command.
|
|
164
168
|
|
|
165
|
-
|
|
169
|
+
You can also rerun `void platform install` and choose **Continue setup** for an unfinished installation. For non-interactive recovery, use `--resume --name <id>`. Manage completed platforms with `platform status`, `repair`, or `upgrade`.
|
|
166
170
|
|
|
167
171
|
If Cloudflare rejects a saved runtime token during continued credential setup, Void opens the token page and asks for a replacement in the same run. Network or service failures do not discard saved tokens. Tokens supplied through the environment must be corrected there instead.
|
|
168
172
|
|
|
@@ -12,6 +12,7 @@ The operator commands for users, projects, deployments, and system status requir
|
|
|
12
12
|
|
|
13
13
|
- [Sign-in and Access](/guide/platform/administration/access)
|
|
14
14
|
- [Users and Projects](/guide/platform/administration/projects)
|
|
15
|
+
- [Plans and Limits](/guide/platform/administration/plans)
|
|
15
16
|
- [Project Zero Trust](/guide/platform/administration/zero-trust)
|
|
16
17
|
- [Email](/guide/platform/administration/email)
|
|
17
18
|
- [Operations](/guide/platform/administration/operations)
|
|
@@ -8,13 +8,11 @@ Use queues to process work asynchronously, such as sending emails or handling up
|
|
|
8
8
|
|
|
9
9
|
## Defining queues
|
|
10
10
|
|
|
11
|
-
Create
|
|
11
|
+
Create a consumer in `queues/`. TypeScript and JavaScript files are supported (`.ts`, `.mts`, `.js`, `.mjs`). Its path determines the queue name: `queues/emails.ts` creates `emails`, and `queues/order/notifications.ts` creates `order-notifications`. Each queue must have a unique name.
|
|
12
12
|
|
|
13
13
|
The resulting name must follow Cloudflare's queue naming rules: 1–63 characters, only letters, digits, and `-`, beginning and ending with a letter or digit.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Each queue file should export a default handler wrapped with [`defineQueue`](../reference/api.md#definequeue-t-handler). The generic `<T>` parameter defines the message body type. That is the type of each `msg.body` in the batch, and it is also used by the typed `queues` proxy for `send()` calls.
|
|
15
|
+
Export a default handler wrapped with [`defineQueue<T>`](../reference/api/handlers.md#definequeue-t-handler). `T` defines the message body for both the consumer and calls to `send()`:
|
|
18
16
|
|
|
19
17
|
```ts
|
|
20
18
|
// queues/emails.ts
|
|
@@ -56,8 +54,6 @@ export const POST = defineHandler(async (c) => {
|
|
|
56
54
|
});
|
|
57
55
|
```
|
|
58
56
|
|
|
59
|
-
The binding name is derived automatically: `QUEUE_` + queue name uppercased with non-alphanumeric characters replaced by `_`. For example, `queues/emails.ts` creates binding `QUEUE_EMAILS`, while `queues/order/notifications.ts` creates binding `QUEUE_ORDER_NOTIFICATIONS`.
|
|
60
|
-
|
|
61
57
|
## Per-message acknowledgment
|
|
62
58
|
|
|
63
59
|
Each message in the batch has `ack()` and `retry()` methods matching the [Cloudflare Queues API](https://developers.cloudflare.com/queues/configuration/consumer-concurrency/):
|
|
@@ -111,12 +107,14 @@ export default defineQueue<Message>(async (batch, env) => {
|
|
|
111
107
|
|
|
112
108
|
- `maxBatchSize`: maximum number of messages per batch (default `10`)
|
|
113
109
|
- `maxBatchTimeout`: maximum seconds to wait before delivering an incomplete batch (default `5`)
|
|
114
|
-
- `maxRetries`: maximum number of retries before
|
|
110
|
+
- `maxRetries`: maximum number of retries before delivery is exhausted (default `3`)
|
|
115
111
|
- `retryDelay`: seconds to wait between retries (default `0`)
|
|
116
112
|
|
|
117
|
-
|
|
113
|
+
Void-managed queues do not configure a dead-letter queue. Cloudflare permanently
|
|
114
|
+
deletes messages that exhaust their retries without one; see
|
|
115
|
+
[Cloudflare's dead-letter queue guide](https://developers.cloudflare.com/queues/configuration/dead-letter-queues/).
|
|
118
116
|
|
|
119
|
-
|
|
117
|
+
Void provisions queues and connects their producers and consumers when you deploy.
|
|
120
118
|
|
|
121
119
|
## Local development
|
|
122
120
|
|
|
@@ -56,36 +56,9 @@ Void asks you to choose Vite+ or Vite, a UI framework, a starter, and a deployme
|
|
|
56
56
|
|
|
57
57
|
With pnpm, you can start with `pnpm create void my-app`. It configures native build permissions before installing Void.
|
|
58
58
|
|
|
59
|
-
If a manual pnpm install reports blocked build scripts, run `pnpm approve-builds` for `esbuild`, `sharp`, and `workerd`. Set `better-sqlite3: false` in `pnpm-workspace.yaml`'s `allowBuilds`; Void uses its bundled binaries. Setup updates the pnpm lockfile, including in CI. Later installs can use `pnpm install --frozen-lockfile`.
|
|
60
|
-
|
|
61
59
|
The examples below use `void` for brevity. Outside package scripts, run the local binary with `npx void`, `pnpm void`, `yarn void`, or `bunx void`. Keep Void installed in the project so the CLI and app use the same version.
|
|
62
60
|
|
|
63
|
-
##
|
|
64
|
-
|
|
65
|
-
`void init` detects your coding agent and installs its instructions and skills. If detection fails, choose an agent when prompted. In agents that support it, load the `/void` skill and describe the app you want to build. See [Coding Agents](../integrations/agents) for setup details.
|
|
66
|
-
|
|
67
|
-
## Meta Frameworks
|
|
68
|
-
|
|
69
|
-
Use Void's [Pages routing](./pages-routing/overview) or keep a framework such as TanStack Start, React Router, or SvelteKit. Follow the [framework guides](../integrations/frameworks/overview) for setup.
|
|
70
|
-
|
|
71
|
-
## Adding to an Existing Vite App
|
|
72
|
-
|
|
73
|
-
Install Void using the package manager command [above](#start-in-an-empty-directory).
|
|
74
|
-
|
|
75
|
-
Enable the plugin in `vite.config.ts`:
|
|
76
|
-
|
|
77
|
-
```ts
|
|
78
|
-
import { defineConfig } from 'vite';
|
|
79
|
-
import { voidPlugin } from 'void';
|
|
80
|
-
|
|
81
|
-
export default defineConfig({
|
|
82
|
-
plugins: [voidPlugin()],
|
|
83
|
-
});
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Then run `void init` with your package manager to configure the remaining project files. Existing compatibility dates are preserved; new projects use Void's tested Workers compatibility date.
|
|
87
|
-
|
|
88
|
-
## Once You Have a Working App
|
|
61
|
+
## Run and deploy
|
|
89
62
|
|
|
90
63
|
### 1. Edit the generated API route
|
|
91
64
|
|
|
@@ -110,32 +83,60 @@ Then visit:
|
|
|
110
83
|
- App: `http://localhost:5173`
|
|
111
84
|
- API route: `http://localhost:5173/api/hello`
|
|
112
85
|
|
|
113
|
-
### 3.
|
|
86
|
+
### 3. Deploy
|
|
114
87
|
|
|
115
|
-
If you chose a deployment target during setup,
|
|
88
|
+
If you chose a deployment target during setup, run:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
void deploy
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If you skipped deployment setup, select your Cloudflare account for the first deploy:
|
|
116
95
|
|
|
117
96
|
```sh
|
|
118
97
|
void deploy --platform cloudflare
|
|
119
98
|
```
|
|
120
99
|
|
|
121
|
-
Void opens your browser to sign in when needed. To use your team's platform, connect using the API URL from your administrator:
|
|
100
|
+
Void opens your browser to sign in when needed. To use your team's platform, connect using the API URL from your administrator, then link a project and deploy:
|
|
122
101
|
|
|
123
102
|
```sh
|
|
124
103
|
void connect https://platform.example.com
|
|
125
104
|
void project link
|
|
105
|
+
void deploy
|
|
126
106
|
```
|
|
127
107
|
|
|
128
|
-
|
|
108
|
+
Void builds the app, provisions its resources, applies pending migrations, and prints the deployed URL. If a production secret is missing, [set it](./env-vars.md) and deploy again. Later deploys use the saved target.
|
|
129
109
|
|
|
130
|
-
|
|
110
|
+
See [Deployment](./deployment.md) for CI setup and rollback.
|
|
131
111
|
|
|
132
|
-
|
|
133
|
-
|
|
112
|
+
## Using with Coding Agents
|
|
113
|
+
|
|
114
|
+
`void init` detects your coding agent and installs its instructions and skills. If no agent is detected, use the bundled docs linked in `AGENTS.md`. In agents that support it, load the `/void` skill and describe the app you want to build. See [Coding Agents](../integrations/agents) for setup details.
|
|
115
|
+
|
|
116
|
+
## Meta Frameworks
|
|
117
|
+
|
|
118
|
+
Use Void's [Pages routing](./pages-routing/overview) or keep a framework such as TanStack Start, React Router, or SvelteKit. Follow the [framework guides](../integrations/frameworks/overview) for setup.
|
|
119
|
+
|
|
120
|
+
## Adding to an Existing Vite App
|
|
121
|
+
|
|
122
|
+
Install Void using the package manager command [above](#start-in-an-empty-directory).
|
|
123
|
+
|
|
124
|
+
Enable the plugin in `vite.config.ts`:
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
import { defineConfig } from 'vite';
|
|
128
|
+
import { voidPlugin } from 'void';
|
|
129
|
+
|
|
130
|
+
export default defineConfig({
|
|
131
|
+
plugins: [voidPlugin()],
|
|
132
|
+
});
|
|
134
133
|
```
|
|
135
134
|
|
|
136
|
-
|
|
135
|
+
Then run `void init` with your package manager to configure the remaining project files.
|
|
136
|
+
|
|
137
|
+
## Troubleshooting pnpm installs
|
|
137
138
|
|
|
138
|
-
|
|
139
|
+
If a manual pnpm install reports blocked build scripts, run `pnpm approve-builds` for `esbuild`, `sharp`, and `workerd`. Set `better-sqlite3: false` in `pnpm-workspace.yaml`'s `allowBuilds`; Void uses its bundled binaries.
|
|
139
140
|
|
|
140
141
|
## Next steps
|
|
141
142
|
|
|
@@ -42,13 +42,9 @@ VOID_REMOTE=1 vite dev
|
|
|
42
42
|
| R2 | Local file-backed R2 | Remote R2 bucket |
|
|
43
43
|
| AI | Always proxied | Always proxied |
|
|
44
44
|
|
|
45
|
-
AI
|
|
45
|
+
AI requests use your platform’s account and allowance in both local and remote mode. There is no local AI simulator.
|
|
46
46
|
|
|
47
|
-
##
|
|
48
|
-
|
|
49
|
-
In remote mode, binding calls go through your platform's proxy, authenticated with your login token. The proxy uses the linked project's configuration to choose the D1 database, KV namespace, or R2 bucket.
|
|
50
|
-
|
|
51
|
-
You don't need to change any code. Imports like `import { db } from "void/db"` and direct binding access via `c.env.KV` both work transparently.
|
|
47
|
+
## Checking Remote Mode
|
|
52
48
|
|
|
53
49
|
When the dev server starts with remote mode active, it prints:
|
|
54
50
|
|
|
@@ -63,7 +59,6 @@ When the dev server starts with remote mode active, it prints:
|
|
|
63
59
|
|
|
64
60
|
- **Network latency:** each binding call makes a network request, so responses may be slower than local development.
|
|
65
61
|
- **R2 multipart uploads:** `createMultipartUpload()` and `resumeMultipartUpload()` are not supported in remote mode.
|
|
66
|
-
- **R2 conditional writes:** `put(..., { onlyIf })` requires a current Void platform and an active deployment with the native remote-binding handler. Update the platform and redeploy the project if this operation is unavailable. Failed preconditions return `null
|
|
62
|
+
- **R2 conditional writes:** `put(..., { onlyIf })` requires a current Void platform and an active deployment with the native remote-binding handler. Update the platform and redeploy the project if this operation is unavailable. Failed preconditions return `null`.
|
|
67
63
|
- **D1 dump:** `db.dump()` is not supported in remote mode.
|
|
68
|
-
- **D1
|
|
69
|
-
- **Writes affect real data:** remote mode connects to your actual deployed resources. Inserts, updates, and deletes are real, so use it carefully or point it at a staging project.
|
|
64
|
+
- **D1 batches:** `db.batch()` requires an updated platform and project deployment.
|
|
@@ -12,13 +12,13 @@ import { getSandbox } from 'void/sandbox';
|
|
|
12
12
|
|
|
13
13
|
export const POST = defineHandler(async (c) => {
|
|
14
14
|
const sandbox = await getSandbox('default');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
return sandbox.run(['node', '--version']).match({
|
|
16
|
+
ok: (result) =>
|
|
17
|
+
c.json({
|
|
18
|
+
exitCode: result.exitCode,
|
|
19
|
+
stdout: new TextDecoder().decode(result.stdout),
|
|
20
|
+
}),
|
|
21
|
+
limited: (limit) => limit.response({ message: 'Execution is temporarily unavailable.' }),
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
```
|
|
@@ -27,7 +27,7 @@ Importing from `void/sandbox` enables the required resources. Local development,
|
|
|
27
27
|
|
|
28
28
|
## Configuration
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
The default environment provides Node.js 24 on Debian Trixie. Local development and native deploys need Docker running. Managed platform deploys use Cloudflare's managed Node.js image.
|
|
31
31
|
|
|
32
32
|
Use `void.config.ts` when you need a custom image or container size:
|
|
33
33
|
|
|
@@ -62,7 +62,7 @@ WORKDIR /workspace
|
|
|
62
62
|
CMD ["sleep", "infinity"]
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
For a managed platform, push your custom image to that platform account's Cloudflare registry and set `platformImage` to its digest-pinned reference. If `image` is already a Cloudflare registry reference, it also becomes the default `platformImage`. External
|
|
65
|
+
For a managed platform, push your custom image to that platform account's Cloudflare registry and set `platformImage` to its digest-pinned reference. If `image` is already a Cloudflare registry reference, it also becomes the default `platformImage`. External registries and mutable tags are not supported. See [Cloudflare's image management guide](https://developers.cloudflare.com/containers/guides/image-management/#push-images-to-the-cloudflare-registry).
|
|
66
66
|
|
|
67
67
|
## Runtime API
|
|
68
68
|
|
|
@@ -75,37 +75,45 @@ const sandbox = await getSandbox(`user-${user.id}`, {
|
|
|
75
75
|
inactivityTimeoutMs: 10 * 60 * 1000,
|
|
76
76
|
enableInternet: false,
|
|
77
77
|
});
|
|
78
|
-
await sandbox
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
const response = await sandbox
|
|
79
|
+
.run(['node', '--version'], {
|
|
80
|
+
signal: AbortSignal.timeout(5_000),
|
|
81
|
+
})
|
|
82
|
+
.match({
|
|
83
|
+
ok: (result) => Response.json({ exitCode: result.exitCode }),
|
|
84
|
+
limited: (limit) => limit.response(),
|
|
85
|
+
});
|
|
84
86
|
```
|
|
85
87
|
|
|
86
88
|
Commands take an executable and arguments as an array. For shell syntax, explicitly run `['sh', '-c', command]`. Execution options include `cwd` (default `/workspace`), `env`, `user`, `signal`, `pty`, `stdin`, `stdout`, and `stderr`.
|
|
87
89
|
|
|
88
|
-
`
|
|
90
|
+
`run()` collects command output and handles limits throughout execution with one required `.match({ ok, limited })`. Both handlers are required. Other failures still reject.
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
`exec()` returns a lazy operation yielding a process through its `ok` handler. Use `output()` to collect `stdout` and `stderr` as `ArrayBuffer`s with the exit code, or read the streams and match `exitCode`. Both `output()` and `exitCode` require their own `.match({ ok, limited })`. Matching `exitCode` keeps a long command active during pauses in its output; unattended background commands can stop when the Sandbox becomes idle.
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
Use `stdin: 'pipe'` for a writable input stream. `kill(signal?)` stops a process, and `resize(cols, rows)` resizes its terminal.
|
|
95
|
+
|
|
96
|
+
File operations live under `sandbox.files`: `readFile`, `writeFile`, `stat`, `lstat`, `readDirectory`, `mkdir`, `rename`, and `remove`. Each file operation requires `.match({ ok, limited })`. `readFile()` yields a streaming `Response` to `ok`; use `.text()`, `.arrayBuffer()`, or `.body`. `writeFile()` accepts text, binary data, or a byte stream. Relative file paths require an explicit `cwd` option.
|
|
97
|
+
|
|
98
|
+
To reach a server inside the container, call `sandbox.fetch(port, new Request(url)).match({ ok, limited })`. `sandbox.running()` checks whether the container is running; `sandbox.destroy()` stops it.
|
|
93
99
|
|
|
94
100
|
`getSandbox()` options include `inactivityTimeoutMs` (default ten minutes, maximum six hours), `enableInternet` (default `false`), and string `labels`. Internet access and labels take effect on the next container start. `binding` selects a custom native binding; managed platforms use the configured binding.
|
|
95
101
|
|
|
96
102
|
For code that runs on both deployment targets, use `getSandbox()`. Direct access through `c.env.SANDBOX` is available only on local and native Cloudflare deployments.
|
|
97
103
|
|
|
104
|
+
The `limited` handler receives `resource: 'sandbox'`, a `reason` of `concurrency` or `runtime_budget`, and `response({ message })` for a structured HTTP 429. Keep user input available so it can be retried. Resolving a Sandbox, checking `running()`, stopping a process, and `destroy()` do not need a quota handler; cleanup remains available after a limit.
|
|
105
|
+
|
|
98
106
|
## State persistence
|
|
99
107
|
|
|
100
108
|
`getSandbox(id)` selects the same Durable Object for that ID within a deployment. Native Cloudflare deployments preserve that namespace across Worker versions. Each managed platform deployment has its own namespace; rolling back to a retained deployment reconnects to that deployment's namespace.
|
|
101
109
|
|
|
102
|
-
Files, running processes, and listening servers last only as long as the container. It can stop after inactivity, crash, or restart. Save anything you need to keep in your database, KV, or R2.
|
|
110
|
+
Files, running processes, and listening servers last only as long as the container. It can stop after inactivity, crash, or restart. Save anything you need to keep in your database, KV, or R2. Deleting a project on a Void platform removes both its Durable Objects and containers.
|
|
103
111
|
|
|
104
112
|
## Deployment
|
|
105
113
|
|
|
106
|
-
Sandboxes require [Workers Paid](https://dash.cloudflare.com/?to=/:account/workers/plans) and Containers access.
|
|
114
|
+
Sandboxes require [Workers Paid](https://dash.cloudflare.com/?to=/:account/workers/plans) and Containers access. A managed platform's runtime token needs Account / Containers: Edit and Account / Cloudchamber: Edit.
|
|
107
115
|
|
|
108
|
-
`void deploy --platform cloudflare` builds native images and deploys the Sandbox alongside the application. `void deploy` on a connected Void Platform
|
|
116
|
+
`void deploy --platform cloudflare` builds native images and deploys the Sandbox alongside the application. `void deploy` on a connected Void Platform applies the platform's Sandbox concurrency and runtime limits. Upgrade the platform before deploying an application built with this Sandbox API.
|
|
109
117
|
|
|
110
118
|
## Moving from Sandbox SDK 0.x
|
|
111
119
|
|