Documentation
¶
Overview ¶
Package qrcode generates a pairing QR code + connection info for the rmoted daemon. The QR encodes a JSON payload understood by compatible clients: {"ip","port","token"}. Scanning it pre-fills the server profile fields (host, port, auth token) — the fastest is the fastest path from "daemon installed" to "client connected".
The token is ALSO printed as plain text so users who can't scan a QR (terminal over SSH, no camera) can copy-paste it. This matches the Mac server's QR + manual-token pairing flow.
CLI entry: `rmoted qrcode`.
Index ¶
Constants ¶
const LongHelp = `` /* 669-byte string literal not displayed */
const ShortHelp = "Print a pairing QR code for iOS (host + port + secret)"
usage strings for the CLI help text. Kept here so the qrcode logic + its help description live together.
Variables ¶
This section is empty.
Functions ¶
func Print ¶
Print renders the QR + connection info to the given writer. Used by the `rmoted qrcode` subcommand. Prints:
- The QR code (Unicode half-blocks).
- The connection info (IP, port).
- The raw token (for manual copy when QR scanning isn't available).
The token is printed in full — the user is already authenticated on the host (they ran the command), and the token is only useful for pairing iOS to THIS daemon. Printing it is the explicit purpose of the command.
Types ¶
type Payload ¶
Payload is the stable pairing JSON shape:
ip — the host's LAN IP (or Tailscale IP if that's all that's up) port — the daemon's listen port (17783) token — the 64-hex-char bearer from ~/.rmote/agent/secret
func Generate ¶
Generate reads the daemon secret + detects the host's primary LAN IP, builds the pairing payload, and renders a terminal QR code. Returns the QR string, the payload (for display), or an error if the secret can't be read or no usable IP is found.
The QR uses Unicode half-block characters (▀▄█) for compactness — fits in ~45 terminal columns. Quiet-zone padding is included by the library.