Onboarding: rely on https cookie redirect, remove DietPi mentions

This commit is contained in:
Aaron
2025-12-13 14:13:51 -05:00
parent 357453eed4
commit 471e242427

View File

@@ -21,7 +21,7 @@
<div class="badges">
<span class="badge"><span class="dot"></span> Local-only traffic</span>
<span class="badge"><span class="dot"></span> Works for Pi-Kit & DietPi dashboards</span>
<span class="badge"><span class="dot"></span> Covers the Pi-Kit dashboard</span>
<span class="badge"><span class="dot"></span> HTTPS ready once trusted</span>
</div>
@@ -35,7 +35,7 @@
<section class="steps">
<h3>Why switch to HTTPS?</h3>
<ul>
<li>Encrypts traffic on your LAN so no one can snoop your Pi-Kit or DietPi dashboards.</li>
<li>Encrypts traffic on your LAN so no one can snoop your Pi-Kit dashboard.</li>
<li>Stops mixed-content / “not secure” browser warnings.</li>
<li>Needed for some browser features (clipboard, notifications, service workers).</li>
</ul>
@@ -52,7 +52,7 @@
<section class="steps">
<h3>Install the Pi-Kit CA (recommended, one-time)</h3>
<p>This removes future warnings for both Pi-Kit and DietPi dashboards.</p>
<p>This removes future warnings for the Pi-Kit dashboard.</p>
<details>
<summary>Windows</summary>
<p>Run <strong>mmc</strong> → Add/Remove Snap-in → Certificates (Computer) → Trusted Root CAs → Import <em>pikit-ca.crt</em>.</p>
@@ -89,18 +89,7 @@
<script>
(function () {
const target = `https://${location.hostname}`;
const log = (m) => console.log("[pikit onboarding]", m);
async function probe() {
try {
await fetch(`${target}/api/status`, { mode: "no-cors", cache: "no-store" });
log("HTTPS reachable, redirecting");
document.cookie = "pikit_https_ok=1; Path=/; Max-Age=2592000; SameSite=Lax";
window.location = target;
} catch (e) {
log("HTTPS probe failed; staying on onboarding page");
}
}
const hasCookie = document.cookie.includes("pikit_https_ok=1");
document.getElementById("continueBtn").addEventListener("click", () => {
window.location = target;
@@ -144,7 +133,9 @@
});
});
probe();
if (hasCookie) {
window.location = target;
}
})();
</script>
</body>