fix: add game-assets, maptiles, mapcache static mounts + frame-src CSP

Without /game-assets mount the game iframes loaded 404.
Without /maptiles mount the map tiles didn't render.
frame-src 'self' CSP directive needed for iframe sandboxing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
SITO 2026-05-02 21:22:03 +02:00
parent 5717204716
commit bb2d7acfd9

View file

@ -50,7 +50,19 @@ module.exports = ({ host, port, middleware, allowHost }) => {
});
app.use(mount("/assets", assets));
const maptiles = new Koa();
maptiles.use(koaStatic(join(__dirname, "..", "maps", "tiles")));
app.use(mount("/maptiles", maptiles));
const mapcache = new Koa();
mapcache.use(koaStatic(join(__dirname, "..", "maps", "cache")));
app.use(mount("/mapcache", mapcache));
const gamesStatic = new Koa();
gamesStatic.use(koaStatic(join(__dirname, "..", "games")));
app.use(mount("/game-assets", gamesStatic));
// pdf viewer
app.use(mount("/js", koaStatic(path.join(__dirname, 'public/js'))));
app.use(koaStatic(path.join(__dirname, 'public')));
@ -66,6 +78,7 @@ module.exports = ({ host, port, middleware, allowHost }) => {
"img-src 'self'",
"media-src 'self' blob:",
"worker-src 'self' blob:",
"frame-src 'self'",
"form-action 'self'",
"object-src 'none'",
"base-uri 'none'",