repos
/ orchard main

orchard

mirror

Every site I host, in one repo, along with the Cloudflare Tunnel and Caddy that front them. It's all Go, Vite, and SQLite, and it runs on a desktop at home with nothing listening on an inbound port.

blogbuncaddycloudflare-tunneldockergogolanghomelabhtml-templatemonorepoself-hostedseosqlitestatic-sitetypstuptime-monitoringviteweb-analytics

538 B · 19 lines · JavaScript Raw History
 1document.addEventListener("DOMContentLoaded", function () {
 2  const form = document.getElementById("is-public-form");
 3  if (!form) return;
 4
 5  form.addEventListener("change", function () {
 6    fetch(form.action, {
 7      method: "POST",
 8      headers: { "Content-Type": "application/json" },
 9    })
10      .then((r) => {
11        if (!r.ok) throw new Error(`${form.action} returned HTTP ${r.status}`);
12        window.location.reload();
13      })
14      .catch((err) => {
15        console.error("public toggle failed:", err);
16      });
17  });
18});