From f7f191a1359233bbd0d7dcfa7f5df00f60470219 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Mon, 23 Mar 2026 22:31:43 +0100 Subject: [PATCH] bug-fixes --- package-lock.json | 4 ++-- package.json | 2 +- scripts/build-and-push-prod.sh | 14 ++++++++++++-- src/PageManager.tsx | 8 ++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 67f4f81f..1af8b32f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "jumble-imwald", - "version": "19.3.3", + "version": "19.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jumble-imwald", - "version": "19.3.3", + "version": "19.3.4", "license": "MIT", "dependencies": { "@asciidoctor/core": "^3.0.4", diff --git a/package.json b/package.json index 03108a21..2b7a4081 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jumble-imwald", - "version": "19.3.3", + "version": "19.3.4", "description": "A user-friendly Nostr client focused on relay feed browsing and relay discovery, forked from Jumble", "private": true, "type": "module", diff --git a/scripts/build-and-push-prod.sh b/scripts/build-and-push-prod.sh index 89fffcce..faf63769 100755 --- a/scripts/build-and-push-prod.sh +++ b/scripts/build-and-push-prod.sh @@ -2,6 +2,9 @@ # Build main app and NIP-66 monitor images locally; push to silberengel/imwald-jumble and silberengel/imwald-jumble-nip66-monitor as :latest and :. # Then create git tag v and push it. # Run from repo root. Requires: docker, docker login, git. +# +# Optional env: JUMBLE_PROXY_SERVER_URL — passed as Docker build-arg VITE_PROXY_SERVER (default site origin). +# Must match Apache: ProxyPass /sites/ → OG backend; the app requests https:///sites/?url=… set -e REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" @@ -12,8 +15,15 @@ GIT_TAG="v${VERSION}" IMAGE_APP="silberengel/imwald-jumble" IMAGE_MONITOR="silberengel/imwald-jumble-nip66-monitor" -echo "Building main app (version: $VERSION)" -docker build -t "$IMAGE_APP:latest" -t "$IMAGE_APP:$VERSION" . +# OG / link-preview HTML: VITE_PROXY_SERVER is baked into the client bundle at image build time (not runtime). +# Use public origin only (no /proxy path): web.service builds /sites/?url=… +# Override: JUMBLE_PROXY_SERVER_URL=https://other.example ./scripts/build-and-push-prod.sh +JUMBLE_PROXY_SERVER_URL="${JUMBLE_PROXY_SERVER_URL:-https://jumble.imwald.eu}" + +echo "Building main app (version: $VERSION, VITE_PROXY_SERVER=$JUMBLE_PROXY_SERVER_URL)" +docker build \ + --build-arg "VITE_PROXY_SERVER=$JUMBLE_PROXY_SERVER_URL" \ + -t "$IMAGE_APP:latest" -t "$IMAGE_APP:$VERSION" . echo "Building NIP-66 monitor (version: $VERSION)" docker build -t "$IMAGE_MONITOR:latest" -t "$IMAGE_MONITOR:$VERSION" ./nip66-cron diff --git a/src/PageManager.tsx b/src/PageManager.tsx index d01e0611..9503225a 100644 --- a/src/PageManager.tsx +++ b/src/PageManager.tsx @@ -799,6 +799,14 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) { '/notes' + window.location.pathname + window.location.search + window.location.hash ) } + // OG HTML proxy (`VITE_PROXY_SERVER`, e.g. https://host/proxy) must be reverse-proxied to the + // fetch service. If /proxy is routed to this SPA, normalize to / so we don't push an unknown URL. + { + const proxyPath = window.location.pathname.split('?')[0].split('#')[0] + if (proxyPath === '/proxy' || proxyPath.startsWith('/proxy/')) { + window.history.replaceState(null, '', '/') + } + } window.history.pushState(null, '', window.location.href) if (window.location.pathname !== '/') { const url = window.location.pathname + window.location.search + window.location.hash