oc-phone-link 2.3.0 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,8 @@ release digests, not the server version.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.3.3] - 2026-11-29
10
+
9
11
  ## 2.0.11
10
12
 
11
13
  - A targeted `revoke(id)` fails closed. Keys with no device association,
package/README.md CHANGED
@@ -10,30 +10,45 @@
10
10
 
11
11
  ## Install
12
12
 
13
- Add the plugin to `~/.config/opencode/opencode.jsonc` and restart OpenCode:
13
+ Use the published [PC plugin 2.3.0](https://www.npmjs.com/package/oc-phone-link/v/2.3.0). Add `oc-phone-link` to `~/.config/opencode/opencode.jsonc` and restart OpenCode:
14
14
 
15
15
  ```json
16
16
  { "plugins": ["oc-phone-link"] }
17
17
  ```
18
18
 
19
- The plugin starts the beacon during setup and stops it when the session disposes. There is no tray app, no separate service and no QR code: the beacon is a keyed reverse proxy in front of the OpenCode server your PC already runs.
19
+ The PC plugin and Android app use separate version numbers. The plugin starts the beacon during setup and stops it when the session disposes. There is no tray app, no separate service and no QR code: the beacon is a keyed reverse proxy in front of the OpenCode server your PC already runs.
20
20
 
21
- ## Pair a phone
21
+ ## First use
22
22
 
23
- 1. Open `https://localhost:41338` on the PC. That page is the beacon's own control panel.
24
- 2. Set an 8-digit PIN there. The phone enters it once, and only after the fingerprint check below.
25
- 3. Open the phone app. It finds the beacon over UDP port 41337 on the local network and shows a short TLS fingerprint.
26
- 4. Compare that short fingerprint with the Verify line on the PC page, then enter the PIN.
27
- 5. The phone receives a device key: valid for 90 days, rotated after 45, and one of at most 16 keys the beacon will hold.
23
+ 1. Connect the PC and Android phone to the same Wi-Fi.
24
+ 2. Install the [Android 2.2.0 APK](https://github.com/nathwn12/oc-collections/releases/tag/oc-phone-link%402.3.0) (`oc-phone-link-v2.2.0.apk`) on the phone.
25
+ 3. Open `https://localhost:41338` on the PC. That page is the beacon's own control panel. Set an 8-digit PIN there.
26
+ 4. Open the phone app. It finds the beacon over UDP port 41337 on the local network and shows a short TLS fingerprint.
27
+ 5. Compare that short fingerprint with the Verify line on the PC page. Enter the PIN only after the fingerprints match.
28
+ 6. The phone receives a device key: valid for 90 days, rotated after 45, and one of at most 16 keys the beacon will hold.
28
29
 
29
30
  The PC page also lists paired devices with issue date, last use and last IP, and can revoke one device, revoke all of them, or reset the PIN.
30
31
 
31
- ## Use it
32
-
33
32
  Once paired, the phone sends its requests to the beacon on port 41340, which checks the device key and forwards to OpenCode on its own port (28894 by default). The beacon also keeps a loopback port on 41339 for the PC itself and an exposed port on 41341 for setup actions, which it refuses when the request did not come from the local machine.
34
33
 
35
34
  The phone drives the same server session the PC does. Nothing is uploaded anywhere: discovery, pairing and proxying all stay on your network.
36
35
 
36
+ ## Troubleshooting
37
+
38
+ - **The phone cannot find the beacon.** Confirm both devices are on the same Wi-Fi and that UDP port 41337 can reach the PC. `OC_PHONE_LINK_NO_UDP=1` disables discovery for pair-by-address setups.
39
+ - **The TLS fingerprints differ.** Do not enter the PIN. Confirm the phone is showing this PC's beacon and compare its short fingerprint with the Verify line on the PC page before trying again.
40
+ - **The Android app cannot pair.** The old Android 1.4.1 APK is not compatible with this PC plugin. Install the 2.2.0 APK linked above.
41
+ - **The control panel does not open.** Confirm the plugin loaded after the OpenCode restart. If a port is taken, set `OC_PHONE_LINK_PORT_BASE` to shift the fixed port block.
42
+
43
+ ## Development
44
+
45
+ ```text
46
+ node --test packages/oc-phone-link/beacon.test.mjs
47
+ node packages/oc-phone-link/probe-bench.mjs
48
+ ```
49
+
50
+ The test file covers PIN derivation, key revoke and rotation, discovery and the proxy gate. The bench script measures UDP discovery and the first proxied response on loopback through the public startBeacon seam.
51
+
37
52
  ## Security
38
53
 
39
54
  - **PIN**: exactly 8 digits, stretched with PBKDF2-SHA256 at 600,000 iterations and stored salted and hashed. Only the owner's own networks may claim the first PIN.
@@ -55,15 +70,6 @@ The beacon reads these environment variables and nothing else:
55
70
  - `OC_PHONE_LINK_UPSTREAM` - upstream port override when OpenCode is not on 28894.
56
71
  - `OC_PHONE_LINK_TRANSPORT` - set to `tunnel` to use the tunnel transport instead of the local network.
57
72
 
58
- ## Development
59
-
60
- ```text
61
- node --test packages/oc-phone-link/beacon.test.mjs
62
- node packages/oc-phone-link/probe-bench.mjs
63
- ```
64
-
65
- The test file covers PIN derivation, key revoke and rotation, discovery and the proxy gate. The bench script measures UDP discovery and the first proxied response on loopback through the public startBeacon seam.
66
-
67
73
  ## Requirements
68
74
 
69
75
  - OpenCode V2.
package/beacon.mjs CHANGED
@@ -663,7 +663,7 @@ function cors(req) {
663
663
  }
664
664
 
665
665
  function json(req, res, code, obj, extra) {
666
- res.writeHead(code, { ...cors(req), ...(extra || {}), "Content-Type": "application/json", "Referrer-Policy": "no-referrer" });
666
+ res.writeHead(code, { ...cors(req), ...extra, "Content-Type": "application/json", "Referrer-Policy": "no-referrer" });
667
667
  res.end(JSON.stringify(obj));
668
668
  }
669
669
 
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "oc-phone-link",
3
- "version": "2.3.0",
3
+ "version": "2.3.3",
4
4
  "description": "Drive OpenCode from an Android phone on the same Wi-Fi: in-server beacon, pinned TLS, one PIN, no tray, no QR.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "exports": {
8
8
  ".": "./index.js"
9
9
  },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/nathwn12/oc-collections.git",
13
+ "directory": "packages/oc-phone-link"
14
+ },
15
+ "homepage": "https://github.com/nathwn12/oc-collections/tree/main/packages/oc-phone-link",
16
+ "bugs": "https://github.com/nathwn12/oc-collections/issues",
10
17
  "files": [
11
18
  "index.js",
12
19
  "beacon.mjs",