From 2a1e2201fbc0f021f8801cecdf18ea566afc3385 Mon Sep 17 00:00:00 2001 From: kris Date: Thu, 26 Mar 2026 22:20:34 +0800 Subject: [PATCH] fix: disable fnos web cache for live debugging --- deploy/storyforge-fnos-web-v4.compose.yaml | 1 + deploy/storyforge-fnos-web-v4.nginx.conf | 27 ++++++++++++++++++++++ scripts/deploy_fnos_storyforge_web.sh | 1 + 3 files changed, 29 insertions(+) create mode 100644 deploy/storyforge-fnos-web-v4.nginx.conf diff --git a/deploy/storyforge-fnos-web-v4.compose.yaml b/deploy/storyforge-fnos-web-v4.compose.yaml index 4778f55..c925dfe 100644 --- a/deploy/storyforge-fnos-web-v4.compose.yaml +++ b/deploy/storyforge-fnos-web-v4.compose.yaml @@ -7,3 +7,4 @@ services: - "${STORYFORGE_WEB_V4_DEV_PORT:-19192}:80" volumes: - ../../storyforge/web/storyforge-web-v4:/usr/share/nginx/html:ro + - ./storyforge-fnos-web-v4.nginx.conf:/etc/nginx/conf.d/default.conf:ro diff --git a/deploy/storyforge-fnos-web-v4.nginx.conf b/deploy/storyforge-fnos-web-v4.nginx.conf new file mode 100644 index 0000000..494c42c --- /dev/null +++ b/deploy/storyforge-fnos-web-v4.nginx.conf @@ -0,0 +1,27 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location = /index.html { + add_header Cache-Control "no-store"; + try_files $uri =404; + } + + location = /assets/storyforge-runtime-config.js { + add_header Cache-Control "no-store"; + try_files $uri =404; + } + + location /assets/ { + add_header Cache-Control "no-store"; + try_files $uri =404; + } + + location / { + add_header Cache-Control "no-store"; + try_files $uri $uri/ /index.html; + } +} diff --git a/scripts/deploy_fnos_storyforge_web.sh b/scripts/deploy_fnos_storyforge_web.sh index 4e68810..beab644 100755 --- a/scripts/deploy_fnos_storyforge_web.sh +++ b/scripts/deploy_fnos_storyforge_web.sh @@ -94,6 +94,7 @@ echo "[3/6] sync runtime config override" echo "[4/6] sync compose file" "$FNOS_SCP" "$REMOTE_COMPOSE_DIR" "$ROOT/deploy/storyforge-fnos-web-v4.compose.yaml" +"$FNOS_SCP" "$REMOTE_COMPOSE_DIR" "$ROOT/deploy/storyforge-fnos-web-v4.nginx.conf" echo "[5/6] restart fnOS web container" run_remote_sudo "$PASSWORD" "cd $(shell_quote "$REMOTE_COMPOSE_DIR") && STORYFORGE_WEB_V4_DEV_PORT=$(shell_quote "$WEB_PORT") docker compose -f $(shell_quote "$REMOTE_COMPOSE_FILE") up -d --force-recreate storyforge-web-v4-dev && STORYFORGE_WEB_V4_DEV_PORT=$(shell_quote "$WEB_PORT") docker compose -f $(shell_quote "$REMOTE_COMPOSE_FILE") ps"