@archships/dim-pair
v0.1.3
Published
QR pairing for DIM mobile SSH connections
Readme
DIM remote SSH pairing
Company-owned QR pairing package for DimRemote. All rights reserved.
This package is maintained directly in packages/remote/pairing and has no
imports or build dependencies on the mobile terminal UI or external repositories.
Usage
Requires Node.js 18+ and npm. Run on the computer you want to connect to:
npx --yes @archships/[email protected]Open DimRemote > Terminal > + > SSH QR pairing and confirm the computer. Only the phone's public SSH key is installed. Existing authorized keys are preserved. Stop the temporary HTTPS pairing listener with Ctrl+C. One DIM-only QR advertises usable assigned LAN/Tailscale/public IPv4/public IPv6 addresses. A single network only asks for pairing confirmation; multiple usable networks offer a choice. Existing Tailscale is detected without installing, starting or logging in to it. The public command has no network flags.
On macOS/Linux, enable SSH and install Python 3.9+, OpenSSL and tmux. The launcher creates a private Python environment and installs qrcode 8.2 from the configured Python package index. Windows uses PowerShell and prepares WSL2/Ubuntu, SSH and tmux; setup and forwarding may request system administrator approval. That connection targets Linux inside WSL2. Existing services on occupied ports are never replaced automatically.
Sources
bin/dim-pair.mjs: npm executable and platform selection.src/pair.sh,src/pair.py: Unix startup and temporary HTTPS pairing server.src/pair.ps1,src/wsl-host.sh: Windows/WSL2 setup and forwarding.src/start_pairing.py,src/render_qr.py: forwarded endpoint validation and QR rendering.
Sources ship directly in the npm archive. There is no runtime script download,
external source refresh, encoded source bundle or generated Python copy.
The QR uses dimremote-pair://v1 with shared port/pin/token/expiry and at least one
of lanHost, tailscaleHost, publicIPv4Host or publicIPv6Host. IPv6 is a native numeric address without brackets or zone IDs; its colons remain literal in the QR. Unknown fields and obsolete formats are rejected.
Unix listeners bind only the advertised assigned addresses, with IPv6-only sockets for IPv6. One certificate, token, acceptance lock, port and expiry are shared by all addresses. No external IP lookup, overlay installation, wildcard public listener or firewall-default change is performed. Windows uses address-specific v4tov4/v6tov4 forwarding, scoped owned firewall rules and the existing temporary lease cleanup. Public endpoints require the host network/firewall to permit inbound SSH and temporary pairing traffic. Windows validates
each restricted forwarding endpoint before exposing its QR; temporary pairing
leases close together while the owned SSH forwarding remains available.
Development
From this directory run npm test. It checks the packed artifact, offline npm
installation, help/version, argument validation and, on Unix, a temporary HTTPS
pairing flow with isolated keys and storage. The test needs Python, OpenSSL and
tmux; it never modifies the user's real authorized_keys.
Release only after reviewing the packed archive and explicit publication approval:
npm pack --dry-run
npm publish --access public --registry=https://registry.npmjs.org/