Own server on a Cloudflare quick tunnel: no working way to pair a phone, and the typed code says "That code expired"

オープン
#78 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
ios, typescript

調査の方向性

Start by tracing the pairing flow from apps/link-service/install.sh and the server's POST /api/auth/pairing endpoint, then inspect how the desktop Connect from elsewhere screen and iPhone code entry handle missing public addresses. The report also flags PUT /api/mobile/presence returning 403 after pairing, so check whether that is related. Done means quick-tunnel users get a clear supported pairing path and unresolved codes no longer appear expired; confirm behavior across the desktop, server, and iPhone flows.

索引モデルが issue の本文から書いたものです。

説明

What happened

Own server installed with the --cloudflare install line from the desktop app. To pair the iPhone app, Settings > Computer > Connect from elsewhere shows only a 12-character code ("Type it on the other device. Expires in 4 min."). There is no QR code and no link.

Typing that code in the iPhone app ("Enter the code" screen) fails right away with "That code expired. Codes last five minutes. Make a new one on your computer and scan again." It happened with every fresh code. The server shows no attempt to redeem it.

As far as I can tell, the cause is that the installer gives a quick-tunnel server no public address (apps/link-service/install.sh, server_unit: "a quick tunnel's name changes on every restart, so the server names no public address for it"). Asking that server for a code directly:

POST /api/auth/pairing
-> { "url": null, "inviteUrl": null, "serverName": "...",
     "hint": "this server has no public address to put in a link: set DUSK_PUBLIC_URL, or open /pair on the address you use and type the code" }

The desktop screen doesn't show that hint, so it looks like pairing should work. On the phone side, a typed code has no way to find the server, and the app reports that as an expired code, which sends you looking in the wrong place.

What worked: set DUSK_PUBLIC_URL on duskbot.service to a stable address (a tailscale serve HTTPS address here), mint a code with POST /api/auth/pairing, turn the returned inviteUrl (duskbot://pair?address=...&token=...) into a QR code and scan it with the iPhone. That paired.

Possibly related: after pairing that way, the phone's PUT /api/mobile/presence gets 403 {"error":"only a paired phone reports where it is"}, so the server doesn't treat the session as a phone device. Push registration (deviceOf(auth)) presumably fails the same way. I can't tell whether that's because of the pairing path I used.

Suggestions:

  • On Connect from elsewhere, say when the server has no public address, and what to do about it.
  • In the phone app, show "couldn't find this server" or similar instead of "That code expired" when the code can't be resolved.
  • Give own servers on a quick tunnel a supported way to pair a phone (through the relay, or by prompting for DUSK_PUBLIC_URL).
Steps to reproduce
  1. Install on a fresh server with the desktop app's install line (... | sh, Cloudflare quick tunnel).
  2. In the desktop app with that server selected: Settings > Computer > Connect from elsewhere.
  3. Type the code shown into the iPhone app.
  4. The phone says "That code expired".
Version

desktop 0.2.18, server package 0.2.12, iOS app build 2611142024

Platform

Own server (VPS), Debian 13 amd64, paired from iPhone

主要言語
TypeScript
スター
277
フォーク
27
平均マージ
2時間 47分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DuskBotAI/duskbot のほかの issue

DuskBotAI/duskbot の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。