@loopsy/deploy-relay
v1.0.53
Published
One-command Cloudflare Workers deploy for the Loopsy relay
Maintainers
Readme
@loopsy/deploy-relay
One-command Cloudflare Workers deploy for the Loopsy relay.
What it does
Deploys a Loopsy relay Worker (with Durable Object for device sessions) to your own Cloudflare account on the free tier. Generates a fresh PAIR_TOKEN_SECRET and saves the relay URL to ~/.loopsy/relay.json so the daemon can find it.
Usage
npx @loopsy/deploy-relayThat's it. The CLI will:
- Prompt for a worker name (default:
loopsy-relay-<random>). - Optionally prompt for a custom domain (zone must already be on your CF account).
- Run
wrangler deploy— opens your browser for OAuth on first run. - Set the
PAIR_TOKEN_SECRET(piped via stdin so it never lands on your clipboard). - Save the deployed URL to
~/.loopsy/relay.json.
Non-interactive
npx @loopsy/deploy-relay --worker-name my-relay --domain relay.example.com -yAfter deploy
# On your Mac:
loopsy relay configure https://my-relay.<your-cf-subdomain>.workers.dev
loopsy mobile pair --ttl 600
# On your phone:
# open https://my-relay.<your-cf-subdomain>.workers.dev/app
# scan the QR shown in the terminal, enter the 4-digit codeCost
Free. Cloudflare Workers free tier covers 100k requests/day; a single user typically uses far fewer. SQLite-backed Durable Objects are also free-tier eligible.
If you exceed the free tier, Cloudflare will email you before charging.
Security notes
- The
PAIR_TOKEN_SECRETis generated fresh per deploy withcrypto.randomBytes(32). - It is set via
wrangler secret putwith stdin piping — the secret never appears in process args or shell history. - The config file at
~/.loopsy/relay.jsonis writtenchmod 600. - See SECURITY.md in the main repo for the full threat model.
License
Apache-2.0
