feat: add QR code display on ppg serve startup#121
Conversation
Add `ppg serve` command that starts an HTTPS server with self-signed TLS certificates and displays a pairing QR code for iOS device connectivity. - Generate self-signed EC certs (prime256v1) stored in .ppg/certs/ - Encode pairing URL: ppg://connect?host=...&port=...&ca=...&token=... - Include CA SHA-256 fingerprint for certificate pinning - Print auth token to stdout at generation time - Render QR code via qrcode-terminal (small mode) - Only display QR in interactive terminal (skip in --daemon mode) - Support --json for machine-readable output - Add qrcode-terminal to dependencies Closes #88
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Critical: use crypto.timingSafeEqual for bearer token comparison instead of string equality to prevent timing side-channel attacks - High: extract TLS logic to core/tls.ts, use execa with argument arrays instead of execSync with shell string interpolation - High: add unit tests for buildPairingUrl, getLocalIp, verifyToken - Medium: use requireManifest() instead of manual fs.access check - Medium: use fs.mkdtemp for temp key files instead of predictable PID-based paths - Medium: replace sync fs and child_process with async equivalents - Low: remove redundant default fallbacks (Commander provides them)
Summary
ppg servecommand that starts an HTTPS server with auto-generated self-signed TLS certificatesppg://connect?host=...&port=...&ca=...&token=...--daemonmode)--jsonfor machine-readable output with all pairing detailsCloses #88
Test plan
ppg servein an interactive terminal and verify QR code is displayedppg serve --daemonand verify QR code is not displayedppg serve --jsonand verify JSON output includes token, fingerprint, and pairingUrlppg serve --port 8080and verify server binds to correct port.ppg/certs/on first run and reused on subsequent runsnpm run typecheck— passes (pre-existing spawn.test.ts issue unrelated)npm test— all 218 tests pass