summaryrefslogtreecommitdiff
path: root/crates/wipfel/build-release.sh
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-30 08:42:39 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-30 08:42:39 +0100
commitdbc0fd52a8497c5002e8311eb1728050a4e97c7a (patch)
tree21d38cb830faf347390d2bdd2a141c3f90fcd97e /crates/wipfel/build-release.sh
parent34377db6b5c8e563dca18f72cc8174a5df2dd92e (diff)
web: ship a Content-Security-Policy as meta tag
Self-contained hardening, no server config required: default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; img-src 'self' blob: data:; connect-src 'self' blob: data:; style-src 'self' 'unsafe-inline' - script-src needs 'wasm-unsafe-eval' for WebAssembly compilation (the scoped exception; plain 'unsafe-eval' stays forbidden) and no inline script is allowed, so the module loader moved from an inline <script> to loader.js - style-src keeps 'unsafe-inline' because the Yew views position the find-peak popup and size the compass strip via style attributes - blob: in img-src/connect-src for createImageBitmap and blob reads; data: for inline assets Size budget note: unchanged (~550 KB gzipped total, well under the 1.5 MB plan budget).
Diffstat (limited to 'crates/wipfel/build-release.sh')
-rwxr-xr-xcrates/wipfel/build-release.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/wipfel/build-release.sh b/crates/wipfel/build-release.sh
index 1ee09b7..4375491 100755
--- a/crates/wipfel/build-release.sh
+++ b/crates/wipfel/build-release.sh
@@ -15,7 +15,7 @@ mkdir -p "$DIST"
wasm-bindgen --remove-name-section --target web --out-dir "$DIST" target/wasm32-unknown-unknown/release/wipfel.wasm
# the loader page (not the trunk entry point, which is dev-only)
rm -f "$DIST"/wipfel.d.ts "$DIST"/wipfel_bg.wasm.d.ts
-cp crates/wipfel/www/index.html crates/wipfel/www/style.css "$DIST/"
+cp crates/wipfel/www/index.html crates/wipfel/www/style.css crates/wipfel/www/loader.js "$DIST/"
gzip -9 -n -c gipfel.dat > "$DIST/gipfel.dat.gz"
echo "site assembled in $DIST ($(du -sh "$DIST" | cut -f1)):"
ls "$DIST"