Skip to content

Commit 2185000

Browse files
marc0oloclaude
andauthored
chore(hosting): drop the photo-storage example (#1478)
* chore(hosting): drop the photo-storage example The example demonstrated programmatic, end-user-facing uploads via AssetManager from @icp-sdk/canisters/assets — an API only the legacy asset canister provides. We no longer want to advertise the asset canister as programmatic storage, so the example is retired rather than reworked or kept on the legacy recipe. Rework was not viable: certified-assets exposes no runtime-upload API (mutations go exclusively through the recipe's sync plugin on `icp deploy`), and repurposing it onto a purpose-built backend canister would duplicate rust/photo_gallery. photo-storage was also the only example still pinned to @dfinity/asset-canister, so all frontends in the repo now run on @dfinity/static-site (certified-assets). Removed alongside the example directory: - .github/workflows/hosting-photo-storage-example.yml - its CODEOWNERS entry - both hosting/README.md entries, including the "one deliberate exception" note about the legacy recipe - the photo-storage reference in the AGENTS.md ICP Ninja eligibility rules (genericized; the controller-only-setup rule itself stands) Closes the long-term decision left open in #1459; resolves item 1 of #1458. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs: disambiguate the retired asset canister from certified-assets The retired asset canister's source lives in dfinity/sdk under src/canisters/frontend (ic-frontend-canister is the wasm; ic-certified-assets the library it wraps; ic-asset the upload/sync library holding security_policy.rs). Its crate is *also* named `ic-certified-assets`, so an agent told "use certified-assets, not the legacy asset canister" can search GitHub, land in the sdk crate, and read the wrong source with full confidence. AGENTS.md now names both locations at the point where the legacy config is banned. hosting/README.md linked "asset canister" at docs.internetcomputer.org/guides/frontends/asset-canister. That page is still live but wholly legacy — it teaches `.ic-assets.json5` SPA routing, AssetManager programmatic uploads, and `http://<canister-id>.localhost:8000` URLs, i.e. the three things these examples no longer do. Keeping the orienting clause but dropping the link, so readers aren't sent to a page that contradicts every example it introduces. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent b4fe175 commit 2185000

22 files changed

Lines changed: 3 additions & 2309 deletions

‎.github/CODEOWNERS‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
/hosting/godot-html5-template/ @dfinity/sdk
55
/hosting/my_crypto_blog/ @dfinity/ninja-devs
6-
/hosting/photo-storage/ @dfinity/sdk
76
/hosting/react/ @dfinity/ninja-devs
87
/hosting/oisy-signer-demo/ @dfinity/ninja-devs
98
/hosting/static-website/ @dfinity/sdk

‎.github/workflows/hosting-photo-storage-example.yml‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Frontends use the `@dfinity/static-site` recipe (the certified-assets canister).
222222
```
223223
- `_redirects` — SPA fallback so deep-link reloads don't 404: `/* /index.html 200` (a `200` rewrite, not a redirect).
224224

225-
Do **not** use `.ic-assets.json5` — that is the legacy asset-canister config; certified-assets ignores it (it gets served as a dead asset). No HSTS in the baseline: `_headers` apply in local dev too, and a canister-served `Strict-Transport-Security` would force HTTPS on `http://…localhost`. Consult the `static-site` skill before changing these (reserved-header list, `_headers` matches the asset key not the URL, etc.).
225+
Do **not** use `.ic-assets.json5` — that is the dfx-era asset-canister config; certified-assets ignores it (it gets served as a dead asset). Don't confuse the two canisters when reading source: the retired one is [`dfinity/sdk/src/canisters/frontend`](https://github.com/dfinity/sdk/tree/master/src/canisters/frontend) — whose crate is *also* called `ic-certified-assets` — while the one this repo uses is the separate [`dfinity/certified-assets`](https://github.com/dfinity/certified-assets) repo. No HSTS in the baseline: `_headers` apply in local dev too, and a canister-served `Strict-Transport-Security` would force HTTPS on `http://…localhost`. Consult the `static-site` skill before changing these (reserved-header list, `_headers` matches the asset key not the URL, etc.).
226226

227227
---
228228

@@ -441,7 +441,7 @@ Rust: `icp build backend && candid-extractor target/wasm32-unknown-unknown/relea
441441

442442
- **No canister factory.** The example must not create canisters at runtime (e.g. `actor class` sub-canisters, `create_canister` + `install_code`).
443443
- **At most 2 canisters in the `ic` environment.** Count the `ic` environment's canister list, not the local one (an example may deploy extra canisters locally — mock ledgers, pre-built infra — while restricting `ic` to `backend`+`frontend`). If a helper canister is only needed locally (e.g. a test subject, a mock ledger), restrict it to `local` via the `environments` block so `ic`/Ninja deploys only the real thing.
444-
- **Deployable in Ninja's no-terminal environment.** No custom build scripts beyond the standard recipe build; no controller-only setup step a Ninja user can't perform (e.g. `photo-storage` needs an `authorize` call from a controller, so it is excluded despite being a single canister).
444+
- **Deployable in Ninja's no-terminal environment.** No custom build scripts beyond the standard recipe build; no controller-only setup step a Ninja user can't perform (e.g. an `authorize` call that only a controller can make — such an example is excluded even if it is a single canister).
445445
- **Demonstrable, not just deployable.** A user must be able to do something meaningful with a *fresh* deploy — the core method returns a real result (compute, an HTTPS/inter-canister call, a CRUD round-trip, canister logs, a derived address/key), **or** the README gives a clear path to make it meaningful using resources the user can obtain themselves (II login, faucet **TESTICP**/**TESTICRC1** tokens, passing a canister principal). Exclude examples whose headline function returns nothing without state the user can't supply — e.g. `candid_type_generation`'s `list_neurons` returns only neurons the caller controls, which a fresh canister has none of, so it always comes back empty.
446446

447447
For token examples, the `ic` environment should use the **TESTICP**/**TESTICRC1** test ledgers (not the real ICP ledger) so users can exercise transfers with free faucet tokens — and the README should point at the [faucet](https://faucet.internetcomputer.org) and the steps to use it.

‎hosting/README.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Frontend-only examples that run entirely on the Internet Computer — static sites, web apps, and game builds served on-chain with no custom backend. Each example is self-contained: follow its README to deploy it locally with `icp-cli`.
44

5-
These examples use the `@dfinity/static-site` recipe, which deploys the [certified-assets canister](https://github.com/dfinity/certified-assets) — the successor of the legacy [asset canister](https://docs.internetcomputer.org/guides/frontends/asset-canister) going forward, adding response certification, clean-URL canonicalization, and `_headers`/`_redirects` configuration. The one deliberate exception is [`photo-storage`](photo-storage/): it demonstrates programmatic uploads via `AssetManager`, an API only the legacy asset canister provides.
5+
These examples use the `@dfinity/static-site` recipe, which deploys the [certified-assets canister](https://github.com/dfinity/certified-assets) — the successor to the dfx-era asset canister, adding response certification, clean-URL canonicalization, and `_headers`/`_redirects` configuration.
66

77
**New to ICP?** Start with [`static-website`](static-website/), the smallest possible deployment, then [`react`](react/) for a typical single-page app setup.
88

@@ -12,7 +12,6 @@ Prerequisites and dev-container setup are covered in the [repository README](../
1212

1313
- [`static-website`](static-website/) — deploy a plain HTML/CSS website on ICP.
1414
- [`react`](react/) — a minimal React single-page application hosted fully on-chain.
15-
- [`photo-storage`](photo-storage/) — store and manage photos programmatically with `AssetManager` from `@icp-sdk/canisters/assets` (runs on the legacy asset canister).
1615
- [`godot-html5-template`](godot-html5-template/) — deploy a Godot HTML5 game build.
1716
- [`unity-webgl-template`](unity-webgl-template/) — deploy a Unity WebGL game build.
1817
- [`oisy-signer-demo`](oisy-signer-demo/) — connect to the OISY wallet signer, fetch token balances, and perform ICRC transfers.

‎hosting/photo-storage/README.md‎

Lines changed: 0 additions & 61 deletions
This file was deleted.

‎hosting/photo-storage/icp.yaml‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎hosting/photo-storage/index.html‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)