From b6faffbd470eb797de120d8822f59092a749f014 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Mon, 19 Oct 2026 12:34:01 +0000 Subject: [PATCH] Add pit.world global footer, trim site footer, move ad off the footer The site is static HTML behind Caddy, so a small Bun process (scripts/pit-footer.mjs, started by start.sh) fetches https://pit.world/snippets/footer.html?site=tronbrowser.dev at boot and hourly (3s timeout) and writes it into a slot before on every page. Failure keeps the last good copy, or nothing. Home footer is one row: copyright, Store, Sign in, Privacy, GitHub, Releases; dropped the @profullstack/footer embed and its webring. Store footers lose the trailing tagline. The CrawlProof text-link unit that sat directly above the footer now sits at the top of main. Co-Authored-By: Claude Opus 5.5 --- Dockerfile | 1 + apps/extensions/public/extension.html | 3 +- apps/extensions/public/index.html | 3 +- apps/extensions/public/install-guide.html | 3 +- apps/extensions/public/submit.html | 3 +- apps/web/public/404.html | 1 + apps/web/public/dns.html | 1 + apps/web/public/ext-callback.html | 1 + apps/web/public/index.html | 29 +++++++------ apps/web/public/login.html | 1 + apps/web/public/privacy.html | 1 + apps/web/public/push.html | 1 + apps/web/public/settings.html | 1 + scripts/pit-footer.mjs | 51 +++++++++++++++++++++++ start.sh | 3 ++ 15 files changed, 84 insertions(+), 19 deletions(-) create mode 100644 scripts/pit-footer.mjs diff --git a/Dockerfile b/Dockerfile index a7d0c417..7c1f7c83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -92,6 +92,7 @@ RUN for f in /api/migrations-pg/*.sql; do \ head -1 "$f" | grep -q '^-- TronBrowser Postgres schema:' \ || { echo "not a Postgres migration: $f" >&2; exit 1; }; \ done +COPY scripts/pit-footer.mjs /pit-footer.mjs COPY start.sh /start.sh RUN chmod +x /start.sh CMD ["/start.sh"] diff --git a/apps/extensions/public/extension.html b/apps/extensions/public/extension.html index 4bab9e41..13da12df 100644 --- a/apps/extensions/public/extension.html +++ b/apps/extensions/public/extension.html @@ -27,9 +27,10 @@ + diff --git a/apps/extensions/public/index.html b/apps/extensions/public/index.html index dbfbcf57..d364259d 100644 --- a/apps/extensions/public/index.html +++ b/apps/extensions/public/index.html @@ -37,9 +37,10 @@

Browser extensions, without the gatekeepers.

+ diff --git a/apps/extensions/public/install-guide.html b/apps/extensions/public/install-guide.html index d4dcd712..62b6f777 100644 --- a/apps/extensions/public/install-guide.html +++ b/apps/extensions/public/install-guide.html @@ -84,9 +84,10 @@

Publishing via a PR (alternative to the upload form)

+ diff --git a/apps/extensions/public/submit.html b/apps/extensions/public/submit.html index 4cff70ff..eb47f87d 100644 --- a/apps/extensions/public/submit.html +++ b/apps/extensions/public/submit.html @@ -79,9 +79,10 @@

5 · Pay the $1 listing fee

+ diff --git a/apps/web/public/404.html b/apps/web/public/404.html index c79dbda5..875cc8ef 100644 --- a/apps/web/public/404.html +++ b/apps/web/public/404.html @@ -18,5 +18,6 @@

404

That page isn't here. Try the homepage.

+ diff --git a/apps/web/public/dns.html b/apps/web/public/dns.html index 37618241..171a57c6 100644 --- a/apps/web/public/dns.html +++ b/apps/web/public/dns.html @@ -82,5 +82,6 @@

How to apply

+ diff --git a/apps/web/public/ext-callback.html b/apps/web/public/ext-callback.html index 992bf0aa..e8382e86 100644 --- a/apps/web/public/ext-callback.html +++ b/apps/web/public/ext-callback.html @@ -23,4 +23,5 @@

Connecting your account…

surface — the token never reaches the server (it's in the fragment). If you landed here outside TronBrowser, nothing happens. --> + diff --git a/apps/web/public/index.html b/apps/web/public/index.html index ce4a819d..c2c36ef0 100644 --- a/apps/web/public/index.html +++ b/apps/web/public/index.html @@ -165,6 +165,8 @@ .faq h3 { color: var(--cyan); font-size: 16px; margin: 22px 0 6px; } .faq p { margin: 0; color: var(--fg); } .site-foot { text-align: center; margin-top: 64px; color: var(--muted); } + .foot-links { font-size: 14px; } + .foot-links a { color: var(--muted); } .onion { margin-top: 12px; font-size: 13px; } .onion a { color: var(--muted); word-break: break-all; } .onion .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; @@ -184,6 +186,16 @@

TronBrowser — privacy-first, AI-native browser

+ +

TronBrowser is an open-source, privacy-first, AI-native web browser built on Ungoogled Chromium. No telemetry, no ads, no sponsored tabs — @@ -248,29 +260,16 @@

How do I install it?

then tron <url>. Windows builds are on the releases page.

- -
- -
-
-
+
- + diff --git a/apps/web/public/login.html b/apps/web/public/login.html index 2462bd8d..56fb847f 100644 --- a/apps/web/public/login.html +++ b/apps/web/public/login.html @@ -45,4 +45,5 @@ ← back to tronbrowser.dev + diff --git a/apps/web/public/privacy.html b/apps/web/public/privacy.html index f2e7478d..edc9db45 100644 --- a/apps/web/public/privacy.html +++ b/apps/web/public/privacy.html @@ -46,5 +46,6 @@

Contact

TronBrowser is published by Profullstack, Inc.

TronBrowser is free and open source under the MIT License.

+ diff --git a/apps/web/public/push.html b/apps/web/public/push.html index 226f1a2e..9eac0616 100644 --- a/apps/web/public/push.html +++ b/apps/web/public/push.html @@ -68,5 +68,6 @@

The protocol, for a self-hosted service

Browser calls carry Authorization: Bearer <device secret>. The source is in services/api/src/push.

+ diff --git a/apps/web/public/settings.html b/apps/web/public/settings.html index 3024efa2..00ebf85e 100644 --- a/apps/web/public/settings.html +++ b/apps/web/public/settings.html @@ -133,4 +133,5 @@

Import / export OP + diff --git a/scripts/pit-footer.mjs b/scripts/pit-footer.mjs new file mode 100644 index 00000000..1d9fecba --- /dev/null +++ b/scripts/pit-footer.mjs @@ -0,0 +1,51 @@ +// The pit.world global footer for the static site Caddy serves from /srv. +// Runs beside Caddy (start.sh): fetches the snippet server-side at boot and then +// hourly, and writes it between the markers each page carries +// just before . Any failure keeps the last good copy (or nothing), so a +// pit.world outage never breaks a page. Writes are temp-file + rename (atomic). +import { readdir, readFile, rename, writeFile } from "node:fs/promises"; +import { join } from "node:path"; + +const URL = "https://pit.world/snippets/footer.html?site=tronbrowser.dev"; +const ROOT = process.env.PIT_FOOTER_ROOT || "/srv"; +const EVERY_MS = 60 * 60 * 1000; +const MARKERS = /[\s\S]*?/; + +async function htmlFiles(dir) { + const out = []; + for (const entry of await readdir(dir, { withFileTypes: true })) { + const path = join(dir, entry.name); + if (entry.isDirectory()) out.push(...(await htmlFiles(path))); + else if (entry.name.endsWith(".html")) out.push(path); + } + return out; +} + +async function refresh() { + let snippet; + try { + const res = await fetch(URL, { signal: AbortSignal.timeout(3000) }); + if (!res.ok) throw new Error(`HTTP ${res.status}`); + snippet = (await res.text()).trim(); + if (!snippet.includes("data-pit-footer")) throw new Error("no data-pit-footer"); + } catch (err) { + console.error(`[pit-footer] fetch failed, keeping last copy: ${err.message}`); + return; + } + const block = `${snippet}`; + for (const file of await htmlFiles(ROOT)) { + try { + const html = await readFile(file, "utf8"); + if (!MARKERS.test(html)) continue; + const next = html.replace(MARKERS, () => block); + if (next === html) continue; + await writeFile(`${file}.pit-tmp`, next); + await rename(`${file}.pit-tmp`, file); + } catch (err) { + console.error(`[pit-footer] ${file}: ${err.message}`); + } + } +} + +await refresh(); +if (!process.argv.includes("--once")) setInterval(refresh, EVERY_MS); diff --git a/start.sh b/start.sh index b6f01e1f..76bf3a1d 100644 --- a/start.sh +++ b/start.sh @@ -6,6 +6,9 @@ set -e # a transient DB hiccup shouldn't block the whole service from starting. MIGRATIONS_DIR=/api/migrations-pg bun /api/db-migrate.mjs || echo "[migrate] FAILED — continuing" PORT=8090 bun /api/dist/index.js & +# pit.world global footer: fetched server-side at boot and hourly, written into +# each page's slot. Never blocks or breaks serving. +bun /pit-footer.mjs & # --- Tor v3 hidden service --------------------------------------------------- # Expose the site over a stable .onion. Tor forwards onion:80 -> Caddy on $PORT