repoburg 1.3.310 → 1.3.312

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.
@@ -5,9 +5,9 @@ exports.probeTunnelConnected = probeTunnelConnected;
5
5
  /**
6
6
  * Connectivity probes shared by the /remote routes and the enable
7
7
  * orchestrator. Both signals are needed: the public health probe only proves
8
- * the edge knows the hostname (CF Access answers 302 before the tunnel is
9
- * consulted), while the cloudflared metrics gauge proves live edge
10
- * connections through the tunnel.
8
+ * the edge knows the hostname (the edge gate answers 401, CF Access 302,
9
+ * before the tunnel is consulted), while the cloudflared metrics gauge proves
10
+ * live edge connections through the tunnel.
11
11
  */
12
12
  const tunnel_state_1 = require("./tunnel-state");
13
13
  const cloudflared_1 = require("./cloudflared");
@@ -17,11 +17,11 @@ function publicHealthUrl() {
17
17
  return state ? `https://${state.hostname}/health` : null;
18
18
  }
19
19
  /**
20
- * Edge reachability probe. Behind CF Access an anonymous request gets a 302
21
- * to the login page BEFORE the tunnel is ever consulted — so this can only
22
- * prove the edge knows the hostname, never that the tunnel is connected.
23
- * `redirect: 'manual'` prevents the old false positive where the login
24
- * page's 200 was counted as a healthy daemon.
20
+ * Edge reachability probe. An anonymous request gets the edge gate's 401 (or,
21
+ * behind CF Access, a 302 to its login page) BEFORE the tunnel is ever
22
+ * consulted — so this can only prove the edge knows the hostname, never that
23
+ * the tunnel is connected. `redirect: 'manual'` prevents the old false
24
+ * positive where the login page's 200 was counted as a healthy daemon.
25
25
  */
26
26
  async function probePublicHealth(timeoutMs = HEALTH_CHECK_TIMEOUT_MS) {
27
27
  const url = publicHealthUrl();
@@ -29,7 +29,7 @@ async function probePublicHealth(timeoutMs = HEALTH_CHECK_TIMEOUT_MS) {
29
29
  return false;
30
30
  try {
31
31
  const response = await fetch(url, { redirect: 'manual', signal: AbortSignal.timeout(timeoutMs) });
32
- return response.status >= 200 && response.status < 400;
32
+ return (response.status >= 200 && response.status < 400) || response.status === 401;
33
33
  }
34
34
  catch {
35
35
  return false;
@@ -50,16 +50,16 @@ async function provisionTunnel(mahlas) {
50
50
  if (!token) {
51
51
  throw new ProvisioningError('Not logged in. Run `repoburg login` first.', 401);
52
52
  }
53
- const result = await callAccountServer('POST', '/device/tunnels', token, { mahlas });
54
- // Access config + owner email arrive in the same response: the tunnel is
55
- // email-gated from birth, and checkRemoteAuth can pin the owner's email.
53
+ // `edgeAuth`: this daemon checks the edge gate's tokens (MUH-108). The
54
+ // account server refuses daemons that do not say so (426).
55
+ const result = await callAccountServer('POST', '/device/tunnels', token, { mahlas, edgeAuth: true });
56
+ // The owner email arrives in the same response: the tunnel is gated from
57
+ // birth, and checkRemoteAuth can pin the owner's email.
56
58
  const state = {
57
59
  mahlas: result.mahlas,
58
60
  hostname: result.hostname,
59
61
  accountTunnelId: result.id,
60
62
  tunnelToken: result.tunnel_token,
61
- accessTeamDomain: result.accessTeamDomain,
62
- accessAud: result.accessAud,
63
63
  ownerEmail: result.ownerEmail,
64
64
  installedAt: new Date().toISOString(),
65
65
  };
@@ -30,9 +30,8 @@ describe('provisioner', () => {
30
30
  mahlas: 'workstation',
31
31
  hostname: 'workstation.repoburg.com',
32
32
  tunnel_token: 'connector-token',
33
- accessTeamDomain: 'team.cloudflareaccess.com',
34
- accessAud: 'aud-tag',
35
33
  ownerEmail: 'owner@repoburg.com',
34
+ gate: 'repoburg',
36
35
  }),
37
36
  }));
38
37
  global.fetch = fetchMock;
@@ -40,24 +39,24 @@ describe('provisioner', () => {
40
39
  os_1.default.homedir = () => tmpHome;
41
40
  try {
42
41
  const state = await (0, provisioner_1.provisionTunnel)('workstation');
43
- expect(state).toMatchObject({
42
+ expect(state).toEqual({
44
43
  mahlas: 'workstation',
45
44
  hostname: 'workstation.repoburg.com',
46
45
  accountTunnelId: 'tunnel-uuid',
47
46
  tunnelToken: 'connector-token',
48
- accessTeamDomain: 'team.cloudflareaccess.com',
49
- accessAud: 'aud-tag',
50
47
  ownerEmail: 'owner@repoburg.com',
48
+ installedAt: expect.any(String),
51
49
  });
52
50
  expect((0, tunnel_state_1.loadTunnelState)(tmpHome)).toMatchObject({
53
51
  accountTunnelId: 'tunnel-uuid',
54
- // The Access config arrives with the tunnel — email-gated from birth.
55
- accessAud: 'aud-tag',
52
+ // The owner email arrives with the tunnel — email-pinned from birth.
56
53
  ownerEmail: 'owner@repoburg.com',
57
54
  });
58
55
  const [url, init] = fetchMock.mock.calls[0];
59
56
  expect(url).toBe('http://account-server.test/device/tunnels');
60
57
  expect(init.headers.Authorization).toBe('Bearer device-jwt');
58
+ // This daemon checks edge-gate tokens.
59
+ expect(JSON.parse(init.body)).toEqual({ mahlas: 'workstation', edgeAuth: true });
61
60
  }
62
61
  finally {
63
62
  os_1.default.homedir = origHomedir;
@@ -45,9 +45,9 @@ function createRemoteRouter() {
45
45
  service: { running: await (0, cloudflared_1.isServiceRunning)().catch(() => false) },
46
46
  connection: { ok: await (0, probes_1.probeTunnelConnected)() },
47
47
  access: {
48
- configured: Boolean(state?.accessTeamDomain && state?.accessAud),
48
+ // Who signs visitors in: the account server's edge gate (MUH-108).
49
+ gate: state ? 'repoburg' : null,
49
50
  ownerEmail: state?.ownerEmail ?? null,
50
- teamDomain: state?.accessTeamDomain ?? null,
51
51
  },
52
52
  publicHealth: { ok: await (0, probes_1.probePublicHealth)() },
53
53
  });
@@ -104,8 +104,6 @@ describe('remote routes', () => {
104
104
  it('GET /status aggregates tunnel, cloudflared, service, connection, and access', async () => {
105
105
  mocked.loadTunnelState.mockReturnValue({
106
106
  ...STATE,
107
- accessTeamDomain: 'team.cloudflareaccess.com',
108
- accessAud: 'aud-tag',
109
107
  ownerEmail: 'owner@repoburg.com',
110
108
  });
111
109
  mocked.isInstalled.mockReturnValue(true);
@@ -117,11 +115,7 @@ describe('remote routes', () => {
117
115
  expect(res.json.cloudflared).toEqual({ installed: true });
118
116
  expect(res.json.service).toEqual({ running: true });
119
117
  expect(res.json.connection).toEqual({ ok: true });
120
- expect(res.json.access).toEqual({
121
- configured: true,
122
- ownerEmail: 'owner@repoburg.com',
123
- teamDomain: 'team.cloudflareaccess.com',
124
- });
118
+ expect(res.json.access).toEqual({ gate: 'repoburg', ownerEmail: 'owner@repoburg.com' });
125
119
  expect(res.json.publicHealth).toEqual({ ok: true });
126
120
  });
127
121
  it('GET /status reports connection false when cloudflared metrics show 0 ha connections', async () => {
@@ -15,8 +15,6 @@ describe('tunnel state', () => {
15
15
  hostname: 'workstation.repoburg.com',
16
16
  accountTunnelId: 'tunnel-uuid',
17
17
  tunnelToken: 'connector-token',
18
- accessTeamDomain: 'team.cloudflareaccess.com',
19
- accessAud: 'aud-tag',
20
18
  ownerEmail: 'owner@repoburg.com',
21
19
  };
22
20
  it('round-trips the state to ~/.repoburg/remote.json', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repoburg",
3
- "version": "1.3.310",
3
+ "version": "1.3.312",
4
4
  "description": "A local AI-powered software developer assistant that runs on your own machine.",
5
5
  "author": "Celal Ertug",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "tree": "3f01773d2dfcfcfee7b73a8c7d7497c15ad692bc",
3
- "commit": "4b9a38d23f1519399e75a0ae69db6c1ef9c7f62b",
3
+ "commit": "98373b2b5d9e1ece8cbc7ffe6a38862f0a9a1695",
4
4
  "dirty": false,
5
- "repoburgVersion": "1.3.310",
6
- "builtAt": "2026-11-09T01:40:26.786Z"
5
+ "repoburgVersion": "1.3.312",
6
+ "builtAt": "2026-11-09T03:36:41.034Z"
7
7
  }
@@ -58,5 +58,5 @@
58
58
  ]
59
59
  }
60
60
  ],
61
- "version_name": "0.6.0 (repoburg 1.3.310, 4b9a38d)"
61
+ "version_name": "0.6.0 (repoburg 1.3.312, 98373b2)"
62
62
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "tree": "3f01773d2dfcfcfee7b73a8c7d7497c15ad692bc",
3
- "commit": "4b9a38d23f1519399e75a0ae69db6c1ef9c7f62b",
3
+ "commit": "98373b2b5d9e1ece8cbc7ffe6a38862f0a9a1695",
4
4
  "dirty": false,
5
- "repoburgVersion": "1.3.310",
6
- "builtAt": "2026-11-09T01:40:26.786Z"
5
+ "repoburgVersion": "1.3.312",
6
+ "builtAt": "2026-11-09T03:36:41.034Z"
7
7
  }