diff --git a/ventures/havre/tools/open.sh b/ventures/havre/tools/open.sh index 74efd73..9cff705 100644 --- a/ventures/havre/tools/open.sh +++ b/ventures/havre/tools/open.sh @@ -10,6 +10,19 @@ git -C "$src" checkout -q "$OV_REF" (cd "$src" && npm ci --silent --no-audit --no-fund >/dev/null && npx vite build --base=/open/ >/dev/null) rm -rf open cp -R "$src/dist" open +# Havre's key, handed to openvenice: same origin, so it's only a copy between two storage slots in this browser +cat > open/havre-key.js <<'EOF' +(function () { + try { + if (sessionStorage.getItem("venice-auth")) return; + var raw = sessionStorage.getItem("havre.key") || localStorage.getItem("havre.key"); + var key = raw ? JSON.parse(raw) : ""; + if (typeof key === "string" && key) sessionStorage.setItem("venice-auth", key); + } catch (e) { /* no key then */ } +})(); +EOF +sed -i.bak 's|||' open/index.html && rm -f open/index.html.bak +grep -q havre-key.js open/index.html cat > open/LICENSE.txt <