allow localhost connections for update service in CSP

This commit is contained in:
2026-09-26 12:07:52 -07:00
parent c416f17e81
commit 76296cc7c2
3 changed files with 8 additions and 4 deletions

View File

@@ -376,7 +376,8 @@ async function start() {
let waitLoops = 0;
while (userDecision === null) {
if (!tempServer && waitLoops > 400) {
if (waitLoops > 24000) {
debugLog("Update decision timed out after 10 minutes, defaulting to skip.");
userDecision = false;
break;
}

View File

@@ -9,7 +9,7 @@
"app": {
"withGlobalTauri": true,
"security": {
"csp": "default-src 'self' http://localhost:4890 http://127.0.0.1:4890; script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:4890 http://127.0.0.1:4890 https://esm.sh; style-src 'self' 'unsafe-inline' http://localhost:4890 http://127.0.0.1:4890; img-src 'self' data: https: http://localhost:4890 http://127.0.0.1:4890; font-src 'self' data: http://localhost:4890 http://127.0.0.1:4890; connect-src 'self' http://localhost: http://127.0.0.1:"
"csp": "default-src 'self' http://localhost:4890 http://127.0.0.1:4890; script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:4890 http://127.0.0.1:4890 https://esm.sh; style-src 'self' 'unsafe-inline' http://localhost:4890 http://127.0.0.1:4890; img-src 'self' data: https: http://localhost:4890 http://127.0.0.1:4890; font-src 'self' data: http://localhost:4890 http://127.0.0.1:4890; connect-src 'self' http://localhost:* http://127.0.0.1:*"
}
},
"bundle": {
@@ -45,4 +45,4 @@
"../node_modules/**/*"
]
}
}
}

View File

@@ -605,7 +605,10 @@ void main() {
btnYes.addEventListener("click", () => {
if (actionsEl) actionsEl.style.display = "none";
setStatus("Starting update installation...");
fetch("http://127.0.0.1:4891/update/yes", { method: "POST" }).catch(() => { });
fetch("http://127.0.0.1:4891/update/yes", { method: "POST" }).catch((err) => {
setStatus("Failed to reach update service. Retrying...", "#fca5a5");
showDebug(err.message);
});
});
btnNo.addEventListener("click", () => {