Repository navigation
Commit 0649409
authored
Complete static-site migration: _headers/_redirects for 18 frontends (#1470)
The frontends moved to the @dfinity/static-site (certified-assets) recipe
but kept their legacy .ic-assets.json5 configs, which certified-assets
ignores — so their security headers were silently dropped and SPA
fallback was gone. Replace them per the static-site skill:
- Delete the 18 dead .ic-assets.json5 files.
- Add frontend/public/_headers: each example's CSP ported verbatim, plus
the skill's baseline hardening (X-Frame-Options, X-Content-Type-Options,
Referrer-Policy) and caching (immutable assets, revalidated HTML).
- Add frontend/public/_redirects with the SPA fallback /* /index.html 200.
- Examples that only had a security_policy preset or X-Frame-Options and
no explicit CSP (ic-pos, basic_vetkd) get the hardening headers only —
no invented CSP, since a default-src 'self' would break ledger/II calls.
- image-classification: its .ic-assets.json5 sat in frontend/assets/ (not
the Vite publicDir), so it never reached dist even on the legacy recipe;
new files go in a real frontend/public/ so its CSP is now effective.
- AGENTS.md: document the _headers/_redirects convention.
Verified locally (encrypted_notes + image-classification): headers land
and are certified, SPA deep-link reload returns the shell.
Part of #1458.1 parent 3b714f7 commit 0649409
55 files changed
Lines changed: 269 additions & 354 deletions
File tree
- hosting/oisy-signer-demo/frontend/public
- motoko
- ic-pos/frontend/public
- vetkeys
- basic_bls_signing/frontend/public
- basic_ibe/frontend/public
- basic_vetkd/frontend/public
- encrypted_notes_app_vetkd/frontend/public
- password_manager_with_metadata/frontend/public
- password_manager/frontend/public
- rust
- image-classification/frontend
- assets
- public
- photo_gallery/frontend/public
- qrcode/frontend/public
- vetkeys
- basic_bls_signing/frontend/public
- basic_ibe/frontend/public
- basic_timelock_ibe/frontend/public
- basic_vetkd/frontend/public
- encrypted_notes_app_vetkd/frontend/public
- password_manager_with_metadata/frontend/public
- password_manager/frontend/public
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
206 | 226 | | |
207 | 227 | | |
208 | 228 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments