havre: /open uses the key you gave Havre
A small script, loaded first on /open/, copies Havre's key (this tab's, or the remembered one) into openvenice's own session slot when openvenice has none yet. The page is the same origin, so nothing leaves the browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQqGFv54JJTw7p3rgGjP7C
This commit is contained in:
1 parent
d3970e4731
commit
c56b6e43b4
1 file changed
+13
@@ -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|<head>|<head><script src="/open/havre-key.js"></script>|' open/index.html && rm -f open/index.html.bak
|
||||
grep -q havre-key.js open/index.html
|
||||
cat > open/LICENSE.txt <<EOF
|
||||
openvenice by nikshepsvn, MIT License: https://github.com/nikshepsvn/openvenice
|
||||
Built into Havre at /open/ from commit $OV_REF, unchanged.
|
||||
|
||||
Reference in new issue
Block a user