Skip to content

Check connectivity against ping.omacom.io and fix the captive portal sign-in flow - #16186

Merged
dhh merged 20 commits into
quattrofrom
worktree-captive-portal-help
Oct 22, 2026
Merged

dhh merged 20 commits into
quattrofrom
worktree-captive-portal-help

Conversation

@dhh

@dhh dhh commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

The network panel's captive-portal flow leaned on Arch's connectivity endpoint, couldn't actually reach a sign-in page, broke with a Tailscale exit node, and showed noise while signed out. This moves the check to Omarchy's own endpoint and fixes the flow.

  • Own connectivity endpoint. A new etc/NetworkManager/conf.d/omarchy-connectivity.conf points NetworkManager at http://ping.omacom.io/nm-check.txt with an empty response=, overriding Arch's ping.archlinux.org. The panel's sign-in button ("Sign into network") opens the same URL, and a test keeps the two in sync. A migration reloads NetworkManager's config on existing installs and stays pending if the reload fails.
  • Signing in works with a Tailscale exit node, and the panel notices within ~2s. The button now runs omarchy-network-captive-portal <url>. If an exit node is active, it pauses it through tailscaled's own toggle (set-use-exit-node-enabled, the one Tailscale's apps use, which remembers the node, auto:any included). It then opens the portal in a floating web app window (900×760, centered, like macOS's sign-in sheet; rule in default/hypr/apps/captive-portal.lua) and asks NetworkManager to re-check every 2s for 5 minutes, then every 15s, until connectivity is full. At that point it closes the window, so a portal's post-login advert page never lingers, and restores the exit node. Each exit-node step sends a notification with the Tailscale mark, which is newly added to the Omarchy icon font at U+E90F; the menu's Install and Remove Tailscale entries use it too, in place of a generic cube. Toasts now draw glyphs in U+E900–E9FF with the omarchy icon font, as the menu does with iconFont: the Nerd Font's devicons cover U+E700–E958, so without that every Omarchy mark rendered as a devicon. A second click only reopens the portal while the first keeps the pause. With the exit node on, the portal's sign-in page was going into a tunnel the portal blocks, and the panel's own 10s timer made finishing feel slow.
  • No help line under the sign-in button, and no "SIGN-IN REQUIRED" line under the network name. The network.captivePortalHelp string is removed from every locale and the translation manifest.
  • Ping and Packet Loss read "--" while the internet is out of reach (captive portal, limited, offline) instead of "Timeout" and "100%". On a working connection, lost pings still show.

Why omacom.io

A captive portal can only intercept plain HTTP, so the button's URL must never be upgraded to HTTPS by the browser:

  • archlinux.org is on the browser HSTS preload list with includeSubdomains. Every major browser has therefore always forced ping.archlinux.org to HTTPS, so the button as shipped today can't show a sign-in page in any browser.
  • omarchy.org sends HSTS with includeSubDomains (180 days), so any browser that has visited it would force ping.omarchy.org to HTTPS too.
  • omacom.io is registered in our Cloudflare account, has never sent HSTS (neither the zone nor the GitHub Pages apex), isn't preloaded, and is old enough to avoid newly-registered-domain blocking. learn.omacom.io sends includeSubDomains, but that only covers its own subdomains, not ping.omacom.io. The drop-in notes that omacom.io must never turn HSTS on.

ping.omacom.io (already live, not in this repo)

A Cloudflare Worker (omarchy-ping) on a custom domain. NetworkManager gets an empty 204 with X-NetworkManager-Status: online. A browser that reaches it (once a portal lets you through, often by sending you back to this URL after sign-in) is redirected to https://omarchy.org/, so nobody sees a blank page or "NetworkManager is online". omacom.io's zone needed no changes. The zone changes tried on omarchy.org for an earlier ping.omarchy.org are fully reverted.

Known gaps

  • China. omarchy.cn isn't on Cloudflare, so there's no China-specific endpoint yet, and everyone uses ping.omacom.io for now.
  • Icon font release. The Tailscale glyph ships with the font in omarchy-settings, so until that release the notifications and menu entries show no icon on installed systems.

Testing

  • network-test.sh, network-captive-portal-test.sh, the new network-captive-portal-command-test.sh (stubbed Tailscale, NetworkManager, browser and notifications) and ./test/cli pass.
  • NetworkManager --print-config shows the drop-in overriding Arch's URI.
  • Validated live at a hotel portal (Mandarin Oriental, rejoined with a random MAC to force a fresh session): NetworkManager reported portal through ping.omacom.io, the button paused the Tailscale exit node (tailscaled logged InternalExitNodePrior set), the sign-in page loaded, and 16 seconds later NetworkManager reported full and the same exit node was restored. That run used a browser tab; the floating window was then checked separately on the desktop (floats centered at 900×760, closes by class).
  • Checked the live endpoint with curl: a NetworkManager-style request gets the 204, a browser-style request gets the redirect, and no HSTS is sent over http or https.
  • Reviewed with Codex in two passes. The first found that lost pings were hidden on working connections, that the migration swallowed reload failures, and the HSTS problem (all fixed, the last by moving to omacom.io). The second found, in the sign-in command, a timeout that turned the exit node back on mid-sign-in, competing watchers from repeated clicks, and checks that could stretch the window far past its limit (all fixed).
  • A final Codex review of the whole branch found one issue, fixed: the exit-node notifications embedded English, which failed i18n-check; they now go through omarchy-i18n with tailscale.exitNode* keys in cli.json, and scripts/i18n-sync.py extract-scan --check passes. It found the endpoint references consistent, no leftovers from earlier iterations, and the migration, icon-font wiring and locale cleanup correct.
  • The sign-in button now reads "Sign into network" (Wi-Fi and wired portals alike), and the hero's "SIGN-IN REQUIRED" line is gone (checked in a rendered preview of the panel's portal state).
  • ./test/all has failures in unrelated suites (agent usage, backgrounds, default apps, provisioning, t3code, and i18n-test.sh on a Danish menu key that's already broken on quattro).

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest change appears safe to merge and addresses the previous launch-failure finding.

Summary

The PR moves connectivity checks to ping.omacom.io and adds a captive-portal window that pauses and restores a Tailscale exit node.

  • The network panel opens a sign-in window and waits for internet access.
  • The network panel hides ping readings when internet access is unavailable.
  • The portal button gives the sign-in instruction without extra status text.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[User opens sign-in] --> B[Pause active exit node]
  B --> C[Launch portal window]
  C --> D{Connectivity full?}
  D -->|No| E{Launcher failed?}
  E -->|No| D
  E -->|Yes| F[Exit and restore exit node]
  D -->|Yes| G[Close portal window]
  G --> F
Loading

Reviews (10) · Last reviewed commit: "Keep a freshly started browser's failure..." · Reviewed by Greptile

Comment thread bin/omarchy-network-captive-portal Resolved
Comment thread bin/omarchy-network-captive-portal Resolved
@dhh dhh changed the title Check connectivity against ping.omarchy.org and tidy the captive portal panel Check connectivity against ping.omacom.io and fix the captive portal sign-in flow Oct 22, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The classification of this pull request is unsettled, so it carries no class label yet and waits on the maintainer. Claude Opus 5.5 read it as a bug fix: the "Open Captive Portal" button could not reach a sign-in page because ping.archlinux.org is HSTS-preloaded, and an active Tailscale exit node blocks the portal. Codex Medium, classifying from the pull request alone, read it as an enhancement: a new command, a new connectivity endpoint, and deliberate changes to what the panel shows (the help line removed, ping and packet loss reading "--" while offline). Both readings hold for parts of it, which is the reason they differ.

Because the class is unsettled, nothing was run on a worker and no full review was done this pass. Two things were checked:

  • CI's i18n-check is red on a7ba5732e, failing no embedded English literals await extraction. The cause is the three omarchy-notification-send calls in bin/omarchy-network-captive-portal (paused, restored, couldn't restore), which carry English text directly; docs/i18n.md asks for them as keys in default/i18n/en/cli.json read through omarchy-i18n.
  • Greptile's P1 about a translated full does not hold on current NetworkManager. With nmcli 1.58.1 and LANGUAGE=de, nmcli networking connectivity still prints full, while nmcli general status prints vollständig in the same environment, so the == "full" comparison in wait_until_online is not affected by the session language. LC_ALL=C would cost nothing as a guard against a future nmcli changing that, but it is not a live bug.

xdanger pushed a commit to xdanger/omarchy-site that referenced this pull request Oct 22, 2026
The registry check counted every omarchy-* Worker in the account as a
language edition. omarchy-ping, created on 2026-10-21 to serve
ping.omarchy.org for omacom/omarchy#16186, is not one, so every
translation run since 18:53 UTC has stopped at this step and no edition
has deployed.

Count a Worker as an edition only when its name is omarchy- plus a code
that check-translations.mjs accepts (two or three letters, then any
subtags), lowercased the way deploy-locale.mjs names it. Against the
live account that still audits all 37 edition Workers, skips only
omarchy-ping, and fails as before when a deployed edition is dropped
from locales.json. The keys pending in open PRs (kk, ru, ka, pt-BR,
azb) also stay covered.
Comment thread bin/omarchy-network-captive-portal Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again at df064b5bb, after the floating sign-in window and the Tailscale glyph were added. The class is still unsettled, so it carries no class label and waits on the maintainer. Claude Opus 5.5 read it as a bug fix again. The second opinion (Codex Medium) did not classify it this time. It answers omabot review --ping, but today's review budget is spent, so this pass is Claude Opus 5.5's reading alone. Nothing was run on a worker.

  • The sign-in command can block on the window it opens. open_portal_window runs omarchy-launch-webapp in the foreground. That only returns quickly when omarchy-cmd-browser-handoff reaches a running Chromium-family browser. When it does not, omarchy-launch-webapp falls back to exec setsid uwsm-app -- <browser> --app=.... Called from a script, that stays in the foreground until the browser exits: setsid forks only for a process-group leader, and uwsm-app waits on its scope (checked with bash -c 'setsid uwsm-app -- sleep 3', which returned after 3s). The fallback is taken when no such browser is running, which is likely for anyone whose default browser is Firefox, or when the flags file carries extra flags. In that case wait_until_online never starts while the user signs in. There is no 2s re-check and no auto-close, and the exit node stays paused until the user closes the window. The other callers that must not wait background it (setsid omarchy-launch-webapp ... & in omarchy-install-service-spotify and omarchy-install-gaming-xbox-cloud). The command test stubs omarchy-launch-webapp to return at once, so it does not catch this.
  • Greptile's new note on close_portal_window holds, but only in a narrow case. If connectivity is already full on the first check, before Chromium has mapped the window, the first hyprctl clients finds nothing and the loop stops, leaving the window open. That needs the portal to have let the machine through before the click, so it matters less than the point above.
  • i18n-check is still red at this head, for the same reason as before. The three notification strings in bin/omarchy-network-captive-portal are English literals rather than cli.json keys.

Comment thread default/i18n/en/shell.json Resolved
Comment thread migrations/1792507034.sh Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again at 405b8b711. The class is still unsettled, so it carries no class label and waits on the maintainer. Claude Opus 5.5 read it as a bug fix again; the second opinion (Codex Medium) answers omabot review --ping but was not consulted, because today's review budget is spent. This pass is Claude Opus 5.5's reading alone, and nothing was run on a worker.

  • Addressed since the last look: i18n-check is green, with the exit-node notifications now read from cli.json. The connectivity check reads nmcli in the C locale. close_portal_window waits for a window that maps late. The button reads "Sign into network" for wired portals too. The migration has a stubbed test covering reload, failed reload and a stopped NetworkManager.
  • Still open: open_portal_window (bin/omarchy-network-captive-portal:40-41) still runs omarchy-launch-webapp in the foreground. When no Chromium-family browser is running to take the handoff, omarchy-launch-webapp execs setsid uwsm-app -- <browser>, which stays in the foreground until that browser exits. Until the user closes the window, there is then no 2s re-check, no auto-close, and the exit node stays paused. This is the same point as in the previous comment, and nothing in the new commits changes it.

@dhh

dhh commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in the latest commit: open_portal_window now launches with setsid omarchy-launch-webapp ... &, like the other callers that mustn't wait, so the 2s re-check, the auto-close and the exit-node restore all run while the browser stays open. A new case in network-captive-portal-command-test.sh has the launcher stay in the foreground the way the fallback does; with the old foreground call that test fails. The close_portal_window race and the i18n-check failure were fixed earlier, and LC_ALL=C stays as the harmless guard you described.

Comment thread bin/omarchy-network-captive-portal Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again at b56544c7b. The class is still unsettled, so it carries no class label and waits on the maintainer. Claude Opus 5.5 read it as a bug fix again. The second opinion (Codex Medium) answers omabot review --ping, but today's review budget is spent, so it was not consulted. This pass is Claude Opus 5.5's reading alone, and nothing from the branch was run on a worker. CI (i18n-check, Greptile) is green.

  • Addressed: open_portal_window now starts omarchy-launch-webapp in the background, so the 2s re-check, the auto-close and the exit-node restore run while the browser is open. That was the point left open last time.
  • New, minor: portal_window_failed cannot fire against the real launcher (bin/omarchy-network-captive-portal:45-63). The outer setsid makes the launcher a session leader. When the handoff fails, omarchy-launch-webapp runs exec setsid uwsm-app -- ..., and setsid forks when it is already a group leader. Its parent then exits 0 at once, whatever happens to the browser. When the handoff succeeds, the launcher also exits 0. So the launcher's status is 0 on both paths. The new "gives up when the portal window fails to open" test passes only because its stub exits 1 directly. I checked this on the coordinator with a stand-in command rather than the branch: bash -c 'setsid bash -c "exec setsid false" & wait $!' reports 0, and the same call without the outer setsid reports 1. This is no regression: a browser that fails to start leaves the exit node paused until the network is online, as before this commit. But the check and its comment ("one still running is that browser") describe something that does not happen. Dropping the outer setsid would let a failure through. It would also leave the launcher running for as long as the browser does when no browser takes the handoff, which is what the check already expects. Either way, that choice is yours.

@dhh

dhh commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Your b56544c7b finding is fixed in fe0156a553, the way you suggested: open_portal_window no longer wraps the launcher in setsid, so the fallback's setsid uwsm-app -- <browser> execs in place and the launcher's exit status is the browser's. portal_window_failed can now see a browser that fails to start. When no browser takes the handoff, the launcher stays running as long as the browser does, which the check already expects. A new case in network-captive-portal-command-test.sh models that real fallback (exec setsid of a failing browser) rather than a stub that exits 1 directly. It fails with the outer setsid put back. Greptile now rates the head 5/5 with no findings.

@dhh
dhh merged commit 3357f90 into quattro Oct 22, 2026
2 checks passed
@dhh
dhh deleted the worktree-captive-portal-help branch October 22, 2026 12:27
@omarchybot

Copy link
Copy Markdown
Collaborator

Looked at this again at fe0156a55. The class is still unsettled, so it carries no class label and waits on the maintainer: Claude Opus 5.5 read it as a bug fix, because the portal's sign-in page could not be reached through the HSTS-preloaded ping.archlinux.org, and the second opinion, Codex Medium, read it as an enhancement, since it also adds behaviour such as pausing the exit node, the auto-closing floating sign-in window, the Tailscale glyph and the -- ping rows. Codex Medium only classified it. The rest of this pass is Claude Opus 5.5's reading alone, and nothing was run on a worker.

  • Addressed since the last look: open_portal_window no longer wraps the launcher in setsid, so the point in the previous comment is gone. A backgrounded child of a non-interactive script is not a process group leader. That means omarchy-launch-webapp's fallback exec setsid uwsm-app creates its new session in place, keeps the PID, and a failed browser start now reaches wait in portal_window_failed. I checked this on the coordinator with a standalone command, not the PR's code: a backgrounded exec setsid false gives status 1 to wait, and the process keeps its PID in a new session. The browser still ends up in a session of its own, and the panel starts the command with Quickshell.execDetached, so nothing reaps it when the script exits. The new stub test covers that path.
  • Nothing new found in the delta. CI (i18n-check, Greptile) is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants