diff --git a/scripts/update-template-refs.sh b/scripts/update-template-refs.sh index 077c193..a8b6bd6 100755 --- a/scripts/update-template-refs.sh +++ b/scripts/update-template-refs.sh @@ -4,14 +4,14 @@ # # scripts/update-template-refs.sh [owner/repo] # scripts/update-template-refs.sh v0.1.0 -# scripts/update-template-refs.sh v0.1.0 myorg/spin-sandboxes +# scripts/update-template-refs.sh v0.1.0 myorg/spin-code-sandbox # # Downloads each released *.wasm, computes its digest, and updates the templates in place. # Review with `git diff templates/` afterwards. set -euo pipefail VERSION="${1:?usage: $0 [owner/repo]}" -REPO="${2:-fermyon/spin-sandboxes}" +REPO="${2:-spinframework/spin-code-sandbox}" ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" sha256() { diff --git a/templates/README.md b/templates/README.md index 55777e5..6da35dd 100644 --- a/templates/README.md +++ b/templates/README.md @@ -32,7 +32,7 @@ npm" capability is isolated from the "run untrusted code" capability. spin templates install --dir . --upgrade # or straight from git -spin templates install --git https://github.com/fermyon/spin-sandboxes --upgrade +spin templates install --git https://github.com/spinframework/spin-code-sandbox --upgrade ``` ## Use @@ -82,17 +82,19 @@ await py.run(code, { lang: "python" }); // application-owned policy, see sdk/REA 2. Point the templates at the new release (fills in real `sha256` digests): ```bash - scripts/update-template-refs.sh vX.Y.Z # uses fermyon/spin-sandboxes + scripts/update-template-refs.sh vX.Y.Z # uses spinframework/spin-code-sandbox scripts/update-template-refs.sh vX.Y.Z myorg/repo # or specify your fork git diff templates/ # review, then commit ``` -## Placeholders to set before first release +## Current release pin -The templates ship with placeholder digests (`sha256:0000…0000`) and point at a `v0.1.0` -release of `fermyon/spin-sandboxes`. `update-template-refs.sh` fills in the real -digests after the first release; until then, `spin up` on a generated app fails digest -verification. Forks pass their own `owner/repo` to the script. +Until the first versioned release, the templates point at the rolling `canary` +prerelease of `spinframework/spin-code-sandbox`. Every Release workflow run rebuilds the +`canary` assets, which changes their digests, so `spin up` on a generated app fails +digest verification until you re-run `scripts/update-template-refs.sh canary`. Once a +`vX.Y.Z` tag exists, pin the templates to it instead; versioned assets never change. +Forks pass their own `owner/repo` to the script. The prebuilt `wasm32-wasi` Python packages are committed in `py-sandbox/wasi-deps`, so the CI and release workflows need no extra repo, submodule, or secret. diff --git a/templates/sandbox-app/content/README.md b/templates/sandbox-app/content/README.md index a85e5d5..aaf17d5 100644 --- a/templates/sandbox-app/content/README.md +++ b/templates/sandbox-app/content/README.md @@ -15,7 +15,7 @@ const py = new Interpreter({ baseUrl: "http://py-sandbox.spin.internal" }); await py.run("print(6 * 7)", { lang: "python" }); ``` -See [examples/ai-code-executor](https://github.com/fermyon/spin-sandboxes/tree/main/examples/ai-code-executor) for a complete caller. Set `allowedHosts`, `kvEnabled`, and `identity` from application code, never from model output. +See [examples/ai-code-executor](https://github.com/spinframework/spin-code-sandbox/tree/main/examples/ai-code-executor) for a complete caller. Set `allowedHosts`, `kvEnabled`, and `identity` from application code, never from model output. ## Security model @@ -23,4 +23,4 @@ The trust boundary is the Wasm component (no filesystem; egress gated by Spin). Each component's `allowed_outbound_hosts` in `spin.toml` starts empty, so user code cannot make outbound requests. Add the hosts it may reach there (for example `["https://api.example.com"]`); a request's `allowedHosts` can then only narrow that list. -To modify or rebuild the components, see [spin-sandboxes](https://github.com/fermyon/spin-sandboxes). +To modify or rebuild the components, see [spin-code-sandbox](https://github.com/spinframework/spin-code-sandbox). diff --git a/templates/sandbox-app/content/spin.toml b/templates/sandbox-app/content/spin.toml index 919f856..dbd4674 100644 --- a/templates/sandbox-app/content/spin.toml +++ b/templates/sandbox-app/content/spin.toml @@ -8,7 +8,7 @@ version = "0.1.0" authors = ["{{authors}}"] description = "{{project-description}}" -# Both components are prebuilt and pulled from the spin-sandboxes GitHub releases. +# Both components are prebuilt and pulled from the spin-code-sandbox GitHub releases. # To move to a newer release, update each source URL and digest. # Both components are PRIVATE (no public route): they run untrusted code and are reachable @@ -25,7 +25,7 @@ route = { private = true } component = "ts-sandbox" [component.ts-sandbox] -source = { url = "https://github.com/fermyon/spin-sandboxes/releases/download/v0.1.0/ts-sandbox.wasm", digest = "sha256:0000000000000000000000000000000000000000000000000000000000000000" } +source = { url = "https://github.com/spinframework/spin-code-sandbox/releases/download/canary/ts-sandbox.wasm", digest = "sha256:5c815217be184d01ad9b1697273ae41dba22c8d1bb6fd47d831a2ebaf04fe30b" } # Single shared KV store; the component scopes keys per sandbox id. key_value_stores = ["default"] # Outbound HTTP is denied until you list hosts here, e.g. ["https://api.example.com"]. Each @@ -43,7 +43,7 @@ route = { private = true } component = "py-sandbox" [component.py-sandbox] -source = { url = "https://github.com/fermyon/spin-sandboxes/releases/download/v0.1.0/py-sandbox.wasm", digest = "sha256:0000000000000000000000000000000000000000000000000000000000000000" } +source = { url = "https://github.com/spinframework/spin-code-sandbox/releases/download/canary/py-sandbox.wasm", digest = "sha256:9ab0826b16a066106caf0ef36823a901576eab2f0beb484c8e325deca79c4ad2" } key_value_stores = ["default"] # Outbound HTTP is denied until you list hosts here, e.g. ["https://api.example.com"]. Each # request's `allowedHosts` can only narrow this list, and it always refuses private and diff --git a/templates/sandbox-py/content/spin.toml b/templates/sandbox-py/content/spin.toml index aab6ee5..a02e838 100644 --- a/templates/sandbox-py/content/spin.toml +++ b/templates/sandbox-py/content/spin.toml @@ -21,9 +21,9 @@ route = { private = true } component = "{{project-name | kebab_case}}" [component.{{project-name | kebab_case}}] -# Prebuilt component from the spin-sandboxes GitHub releases. To move to a +# Prebuilt component from the spin-code-sandbox GitHub releases. To move to a # newer release, update the source URL and digest. -source = { url = "https://github.com/fermyon/spin-sandboxes/releases/download/v0.1.0/py-sandbox.wasm", digest = "sha256:0000000000000000000000000000000000000000000000000000000000000000" } +source = { url = "https://github.com/spinframework/spin-code-sandbox/releases/download/canary/py-sandbox.wasm", digest = "sha256:9ab0826b16a066106caf0ef36823a901576eab2f0beb484c8e325deca79c4ad2" } # The component scopes KV keys per sandboxId. key_value_stores = ["default"] # Outbound HTTP is denied until you list hosts here, e.g. ["https://api.example.com"]. Each diff --git a/templates/sandbox-py/metadata/snippets/component.txt b/templates/sandbox-py/metadata/snippets/component.txt index 5f739a3..91d87e0 100644 --- a/templates/sandbox-py/metadata/snippets/component.txt +++ b/templates/sandbox-py/metadata/snippets/component.txt @@ -10,7 +10,7 @@ route = { private = true } component = "{{project-name | kebab_case}}" [component.{{project-name | kebab_case}}] -source = { url = "https://github.com/fermyon/spin-sandboxes/releases/download/v0.1.0/py-sandbox.wasm", digest = "sha256:0000000000000000000000000000000000000000000000000000000000000000" } +source = { url = "https://github.com/spinframework/spin-code-sandbox/releases/download/canary/py-sandbox.wasm", digest = "sha256:9ab0826b16a066106caf0ef36823a901576eab2f0beb484c8e325deca79c4ad2" } key_value_stores = ["default"] # Outbound HTTP is denied until you list hosts here, e.g. ["https://api.example.com"]. Each # request's `allowedHosts` can only narrow this list, and guard-io always refuses private and diff --git a/templates/sandbox-ts/content/spin.toml b/templates/sandbox-ts/content/spin.toml index 23ed202..57b13fa 100644 --- a/templates/sandbox-ts/content/spin.toml +++ b/templates/sandbox-ts/content/spin.toml @@ -31,9 +31,9 @@ route = { private = true } component = "{{project-name | kebab_case}}" [component.{{project-name | kebab_case}}] -# Prebuilt components from the spin-sandboxes GitHub releases. To move to a +# Prebuilt components from the spin-code-sandbox GitHub releases. To move to a # newer release, update each source URL and digest. -source = { url = "https://github.com/fermyon/spin-sandboxes/releases/download/v0.1.0/ts-sandbox.wasm", digest = "sha256:0000000000000000000000000000000000000000000000000000000000000000" } +source = { url = "https://github.com/spinframework/spin-code-sandbox/releases/download/canary/ts-sandbox.wasm", digest = "sha256:5c815217be184d01ad9b1697273ae41dba22c8d1bb6fd47d831a2ebaf04fe30b" } key_value_stores = ["default"] # Outbound HTTP is denied until you list hosts here, e.g. ["https://api.example.com"]. Each # request's `allowedHosts` can only narrow this list, and guard-io always refuses private and @@ -48,7 +48,7 @@ route = { private = true } component = "{{project-name | kebab_case}}-bundler" [component.{{project-name | kebab_case}}-bundler] -source = { url = "https://github.com/fermyon/spin-sandboxes/releases/download/v0.1.0/bundler.wasm", digest = "sha256:0000000000000000000000000000000000000000000000000000000000000000" } +source = { url = "https://github.com/spinframework/spin-code-sandbox/releases/download/canary/bundler.wasm", digest = "sha256:d9f9bfde7a3d24033937cb2af0fe346e0a8a1c47ccdd09f4bfd316ff49480033" } # The bundler's only egress is the esm.sh server named by esm_base_url (trusted build infra). allowed_outbound_hosts = ["{% raw %}{{ esm_base_url }}{% endraw %}"] [component.{{project-name | kebab_case}}-bundler.variables] diff --git a/templates/sandbox-ts/metadata/snippets/component.txt b/templates/sandbox-ts/metadata/snippets/component.txt index a48a9c1..43dbdbb 100644 --- a/templates/sandbox-ts/metadata/snippets/component.txt +++ b/templates/sandbox-ts/metadata/snippets/component.txt @@ -21,7 +21,7 @@ route = { private = true } component = "{{project-name | kebab_case}}" [component.{{project-name | kebab_case}}] -source = { url = "https://github.com/fermyon/spin-sandboxes/releases/download/v0.1.0/ts-sandbox.wasm", digest = "sha256:0000000000000000000000000000000000000000000000000000000000000000" } +source = { url = "https://github.com/spinframework/spin-code-sandbox/releases/download/canary/ts-sandbox.wasm", digest = "sha256:5c815217be184d01ad9b1697273ae41dba22c8d1bb6fd47d831a2ebaf04fe30b" } key_value_stores = ["default"] # Outbound HTTP is denied until you list hosts here, e.g. ["https://api.example.com"]. Each # request's `allowedHosts` can only narrow this list, and guard-io always refuses private and @@ -39,5 +39,5 @@ route = { private = true } component = "{{project-name | kebab_case}}-bundler" [component.{{project-name | kebab_case}}-bundler] -source = { url = "https://github.com/fermyon/spin-sandboxes/releases/download/v0.1.0/bundler.wasm", digest = "sha256:0000000000000000000000000000000000000000000000000000000000000000" } +source = { url = "https://github.com/spinframework/spin-code-sandbox/releases/download/canary/bundler.wasm", digest = "sha256:d9f9bfde7a3d24033937cb2af0fe346e0a8a1c47ccdd09f4bfd316ff49480033" } allowed_outbound_hosts = ["https://esm.sh"]