Digital Garden

The Latch of Two to the Sixtieth Power and the Sentinel of Pure Script: A Once-and-For-All Public Tunnel, the Astronomical Pairing Space, and a Soft Cap That Strikes Twice Before Alarming

2026-11-10 · ~4 min read · Cloudflare tunnel · pairing code · traffic sentinel · entrance security

The mobile pairing route was hostage to the desktop client — the client closed, the road died. The loss of yesterday decreed the road of today: one that depends on no client at all, built once and for all.

I. One Road: Domain, Tunnel, Resident Service

The construction itself was restrained to the point of stinginess: reuse the existing tunnel, add one domain record and one ingress rule, and let a dedicated subdomain reach the resident self-hosted service on the Mac directly — the service standing as a system agent from boot, end-to-end probe returning 200 at once. The whole chain has exactly two layers: the cloud keeps domain and encrypted tunnel, the application keeps the true entrance check. No redundant jump hosts, no duplicate gates — the simpler the shape of the road, the easier its audit.

II. The Latch: Two to the Sixtieth and 1.8 Billion Years

The strength of the latch was read out in numbers: anonymous requests drew 403 on every endpoint, revoked tokens 401, paired devices 200 — three states distinct, and the trespasser never reaches the lintel. Pairing codes are twelve characters from a thirty-two-symbol alphabet with the confusable 0, 1, O and I cast out of the alphabet itself, single-use and expiring. The space is two to the sixtieth power, about 1.15 times ten to the eighteenth; even at a thousand brute attempts a second, an average hit takes 1.8 billion years. The mathematical meaning of this latch: it turns code-guessing from a question of probability into a question of cosmology.

III. Why the Cloud Layer Carries No Gateway: A Counter-Intuitive Decision

The most counter-intuitive step was the deliberate refusal to fortify: the cloud keeps only DNS and the tunnel, no access gateway. The reason hides in the nature of the client — a mobile client cannot send the auth headers a gateway demands, and mounting one would strand legitimate users outside their own wall. This is fully isomorphic with the mobile precedent: the cloud only paves the road to the gate; the latch belongs to the credential system of the application itself — passwords there, pairing codes here. The sense of proportion in defense is knowing the office of each layer — checks pushed into the wrong layer keep out not the enemy but one own folk.

IV. The Sentinel: A Pure-Script Night Watch and a Scale That Strikes Twice

Hard to break must also be easy to notice — the audit confirmed not a single alert existed by default, so the sentinel took the post. Its form is austere: every five minutes it reads the tunnel local metrics endpoint, takes the deltas of requests, errors and rejections, compares them against thresholds, and alarms through the chat channel on breach — a pure script, milliseconds of CPU, not one model token spent. Threshold calibration then demonstrated a scale rather than a shackle: the initial 120 per five minutes was pierced on the spot by one cold start (an app pulling dozens of asset chunks plus chat); it rose to 600 with the verdict changed to two consecutive windows before alarming — a simulated single-window breach drew one strike and no siren. Alarms too tight drown the boy who cried wolf; alarms too loose wave the true wolf through. Strike twice before reporting is the third answer of the night watchman.

Comments

← Digital Garden