commit 377776db54ded9a439a1bc1b474a4340368a2277
parent 9f790c041477c078cc34731790c0bfe3a4490b63
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 17 Nov 2026 14:21:36 -0500
headed Connects: docs and changelog
OPERATING.md's /cookies section says where a Connect window's display comes
from and what the refusal means; the DISPLAY row in the env registry names
headedDisplay.ts (ENVIRONMENT.md regenerated); an editor CHANGELOG bullet.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/ENVIRONMENT.md b/ENVIRONMENT.md
@@ -182,7 +182,7 @@ The publish pipeline sets these for a process it spawns. Listed so a reader know
|---|---|---|---|
| `SITE_ID` | — | Which site a compose or an export build is for. The build stage (`archilyzer publish build <id>`) sets it for its children; `compose site`, `build site` and `deploy site` fall back to it when no id is given. | common/bin/compose-site.ts, export/app/lib/site.ts |
| `INSTANCE_MODE` | a site | `hub` makes the export build the hub. Set by `archilyzer build hub`. | export/app/lib/mode.ts, common/lib/archive/contract.ts |
-| `DISPLAY` | set by `xvfb-run` | record-live's browser fallback (path B) opens the page HEADED when a display is set — the caller runs it under `xvfb-run -a`, because Rumble's Cloudflare refuses a headless Chromium — and headless otherwise. | common/ytdlp/liveSniff.mjs |
+| `DISPLAY` | set by `xvfb-run`; for a Connect window, the desktop's | record-live's browser fallback (path B) opens the page HEADED when a display is set — the caller runs it under `xvfb-run -a`, because Rumble's Cloudflare refuses a headless Chromium — and headless otherwise. A Connect window (X, archive.today, a forum) opens on the process's own `DISPLAY` / `WAYLAND_DISPLAY` / `XAUTHORITY` when set, else the user session's (`systemctl --user show-environment`), else a display socket on disk (`/tmp/.X11-unix/X<n>`, `$XDG_RUNTIME_DIR/wayland-<n>`), looked for at each press and handed to that browser only; none found, the press is refused with a sentence. | common/ytdlp/liveSniff.mjs, common/social/headedDisplay.ts |
| `BUILD_ARCHIVES` | on | `0` skips archive-zip generation for one build (`--skip-archives`). | common/bin/compose-site.ts, common/bin/build-archives.ts |
| `REPORTS_ALLOW_MISSING_MEDIA` | off | `1` lets a report citation whose evidence media was not prepared through compose (`--allow-missing-media`): its moment page renders without a clip. Off, compose fails with the list. | common/bin/compose-site.ts |
| `ARCHIVES_READONLY` | off | `1` inside a docker-mode build container: materialize archives, never write the shared cache. | common/bin/compose-site.ts |
diff --git a/OPERATING.md b/OPERATING.md
@@ -177,6 +177,12 @@ pnpm ops get cookies fresh # the same, the browser's cookie store read again
**Refresh cookies**. Rumble, YouTube and Odysee: open the site in the browser the row names, then **Check
again** (one request, as `recheck-service`). archive.today and each forum host: **Connect**, which opens a window
on the editor's machine, not on the phone you pressed it from.
+- A Connect window (X, archive.today, a forum) opens on the editor's machine's desktop. That desktop is found at each
+ press: the editor's own DISPLAY / WAYLAND_DISPLAY, else the user session's (`systemctl --user show-environment`),
+ else the display sockets on disk. So an editor service started at boot, before anyone logged in, still finds the
+ desktop that came later, with no restart. The log line `Opening the window on DISPLAY=:0 … (from the user session)`
+ names the display used and where it came from. No desktop session at all: the press is refused with a sentence
+ before any browser starts. Log in to that machine's desktop, then press Connect again.
- A second press while one runs is refused with a sentence, from any tab and from the dashboard's or
/settings' buttons too. The row's "last result" is the last press's answer (`actions` in
`transcripts/.service-cookies.json`).
diff --git a/common/lib/envVars.ts b/common/lib/envVars.ts
@@ -189,7 +189,7 @@ const DECLARED: EnvVarDecl[] = [
// ── internal: the pipeline sets these for a process it spawns ──────────
{ name: "SITE_ID", audience: "internal", default: "—", readBy: "common/bin/compose-site.ts, export/app/lib/site.ts", doc: "Which site a compose or an export build is for. The build stage (`archilyzer publish build <id>`) sets it for its children; `compose site`, `build site` and `deploy site` fall back to it when no id is given." },
{ name: "INSTANCE_MODE", audience: "internal", default: "a site", readBy: "export/app/lib/mode.ts, common/lib/archive/contract.ts", doc: "`hub` makes the export build the hub. Set by `archilyzer build hub`." },
- { name: "DISPLAY", audience: "internal", default: "set by `xvfb-run`", readBy: "common/ytdlp/liveSniff.mjs", doc: "record-live's browser fallback (path B) opens the page HEADED when a display is set — the caller runs it under `xvfb-run -a`, because Rumble's Cloudflare refuses a headless Chromium — and headless otherwise." },
+ { name: "DISPLAY", audience: "internal", default: "set by `xvfb-run`; for a Connect window, the desktop's", readBy: "common/ytdlp/liveSniff.mjs, common/social/headedDisplay.ts", doc: "record-live's browser fallback (path B) opens the page HEADED when a display is set — the caller runs it under `xvfb-run -a`, because Rumble's Cloudflare refuses a headless Chromium — and headless otherwise. A Connect window (X, archive.today, a forum) opens on the process's own `DISPLAY` / `WAYLAND_DISPLAY` / `XAUTHORITY` when set, else the user session's (`systemctl --user show-environment`), else a display socket on disk (`/tmp/.X11-unix/X<n>`, `$XDG_RUNTIME_DIR/wayland-<n>`), looked for at each press and handed to that browser only; none found, the press is refused with a sentence." },
{ name: "BUILD_ARCHIVES", audience: "internal", default: "on", readBy: "common/bin/compose-site.ts, common/bin/build-archives.ts", doc: "`0` skips archive-zip generation for one build (`--skip-archives`)." },
{ name: "REPORTS_ALLOW_MISSING_MEDIA", audience: "internal", default: "off", readBy: "common/bin/compose-site.ts", doc: "`1` lets a report citation whose evidence media was not prepared through compose (`--allow-missing-media`): its moment page renders without a clip. Off, compose fails with the list." },
{ name: "ARCHIVES_READONLY", audience: "internal", default: "off", readBy: "common/bin/compose-site.ts", doc: "`1` inside a docker-mode build container: materialize archives, never write the shared cache." },
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,14 @@
# Changelog
## [Unreleased]
+- **Connect X account, Connect archive session and Connect forum session open their window even when the editor
+ started before the desktop.** The editor runs as a user service that starts at boot, so it had no display, and every
+ Connect failed with "launched a headed browser without having a XServer running" until a restart. Each press now looks
+ for the desktop's display: the editor's own environment, then the user session's (`systemctl --user
+ show-environment`), then the display sockets on disk. The log says which display it used and where it found it, and
+ so does X's result. With no desktop session, the press is refused before any browser starts: "The window opens on
+ the editor's machine, and no desktop session was found there: log in to that machine's desktop, then press Connect
+ again." A launch that still meets the missing-X-server error gives the same sentence; the raw error goes to the log.
- **/cookies now has every cookie and session control /settings has, and logging in to X is one press away.** Each
row still starts with its status and its one button, and the whole session block now sits under it:
- X: login source, Check, the cookie-age limit, Connect X account, Refresh cookies, Forget session and where X posts