repoburg 1.3.311 → 1.3.313
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/agent-pane/frontend/dist/assets/{TerminalView-CdL80e84.js → TerminalView-Xaq6tVfx.js} +1 -1
- package/agent-pane/frontend/dist/assets/index-B8vQbeJk.js +841 -0
- package/agent-pane/frontend/dist/index.html +1 -1
- package/daemon/dist/api/auth.js +27 -63
- package/daemon/dist/auth/accountServer.js +11 -0
- package/daemon/dist/auth/authManager.js +27 -30
- package/daemon/dist/auth/deviceLogin.js +122 -0
- package/daemon/dist/auth/deviceLogin.spec.js +74 -0
- package/daemon/dist/index.js +0 -3
- package/daemon/dist/middleware/checkRemoteAuth.js +10 -25
- package/daemon/dist/middleware/checkRemoteAuth.spec.js +5 -21
- package/daemon/dist/remote/orchestrator.js +29 -2
- package/daemon/dist/remote/orchestrator.spec.js +49 -2
- package/daemon/dist/remote/provisioner.js +9 -38
- package/daemon/dist/remote/provisioner.spec.js +5 -86
- package/daemon/dist/remote/routes.js +2 -5
- package/daemon/dist/remote/routes.spec.js +1 -8
- package/daemon/dist/remote/tunnel-state.spec.js +0 -2
- package/package.json +1 -1
- package/platform-cli.js +4 -2
- package/tabtape/extension/dist/build-info.json +3 -3
- package/tabtape/extension/dist/manifest.json +1 -1
- package/tabtape/ui/dist/build-info.json +3 -3
- package/agent-pane/frontend/dist/assets/index-NpywVkQl.js +0 -841
- package/daemon/dist/middleware/corsOrigin.js +0 -53
- package/daemon/dist/middleware/corsOrigin.spec.js +0 -46
- package/daemon/dist/remote/access-jwt.js +0 -67
- package/daemon/dist/remote/access-jwt.spec.js +0 -94
- package/daemon/dist/remote/edge-gate-move.js +0 -40
- package/daemon/dist/remote/edge-gate-move.spec.js +0 -44
|
@@ -20,8 +20,6 @@ const STATE = {
|
|
|
20
20
|
hostname: 'zz.repoburg.com',
|
|
21
21
|
accountTunnelId: 'acc-1',
|
|
22
22
|
tunnelToken: 'TUNNELSECRET',
|
|
23
|
-
accessTeamDomain: 'team.cloudflareaccess.com',
|
|
24
|
-
accessAud: 'aud',
|
|
25
23
|
ownerEmail: 'o@x.com',
|
|
26
24
|
installedAt: '2026-01-01T00:00:00Z',
|
|
27
25
|
};
|
|
@@ -45,6 +43,7 @@ function makeDeps(overrides = {}) {
|
|
|
45
43
|
return {
|
|
46
44
|
loadTunnelState: mockedLoad,
|
|
47
45
|
provisionTunnel: jest.fn().mockResolvedValue(STATE),
|
|
46
|
+
isSignedIn: jest.fn().mockResolvedValue(true),
|
|
48
47
|
isInstalled: mockedIsInstalled,
|
|
49
48
|
downloadCloudflared: jest.fn().mockResolvedValue('/bin/cloudflared'),
|
|
50
49
|
installService: jest.fn().mockResolvedValue('/service'),
|
|
@@ -190,3 +189,51 @@ describe('orchestrator: troubleshooting fallback', () => {
|
|
|
190
189
|
expect((0, orchestrator_1.getEnableJob)()).toBeNull();
|
|
191
190
|
});
|
|
192
191
|
});
|
|
192
|
+
describe('orchestrator: sign-in', () => {
|
|
193
|
+
beforeEach(() => {
|
|
194
|
+
jest.clearAllMocks();
|
|
195
|
+
});
|
|
196
|
+
it('stops in needs_login before provisioning when the machine has no account', async () => {
|
|
197
|
+
mockedLoad.mockReturnValue(null);
|
|
198
|
+
mockedConnected.mockResolvedValue(false);
|
|
199
|
+
const deps = makeDeps({
|
|
200
|
+
isSignedIn: jest.fn().mockResolvedValue(false),
|
|
201
|
+
isServiceRunning: jest.fn().mockResolvedValue(false),
|
|
202
|
+
});
|
|
203
|
+
const job = makeJob();
|
|
204
|
+
await (0, orchestrator_1.runEnable)(job, deps);
|
|
205
|
+
expect(job.state).toBe('needs_login');
|
|
206
|
+
expect(job.finishedAt).not.toBeNull();
|
|
207
|
+
expect(deps.provisionTunnel).not.toHaveBeenCalled();
|
|
208
|
+
expect(deps.fetchImpl).not.toHaveBeenCalled(); // no troubleshooting session
|
|
209
|
+
});
|
|
210
|
+
it('stops in needs_login when the account server answers 401', async () => {
|
|
211
|
+
mockedLoad.mockReturnValue(null);
|
|
212
|
+
mockedConnected.mockResolvedValue(false);
|
|
213
|
+
const deps = makeDeps({
|
|
214
|
+
provisionTunnel: jest
|
|
215
|
+
.fn()
|
|
216
|
+
.mockRejectedValue(Object.assign(new Error('Account server: expired'), { statusCode: 401 })),
|
|
217
|
+
isServiceRunning: jest.fn().mockResolvedValue(false),
|
|
218
|
+
});
|
|
219
|
+
const job = makeJob();
|
|
220
|
+
await (0, orchestrator_1.runEnable)(job, deps);
|
|
221
|
+
expect(job.state).toBe('needs_login');
|
|
222
|
+
expect(deps.installService).not.toHaveBeenCalled();
|
|
223
|
+
expect(deps.fetchImpl).not.toHaveBeenCalled();
|
|
224
|
+
});
|
|
225
|
+
it('needs no account to resume a provisioned tunnel', async () => {
|
|
226
|
+
mockedLoad.mockReturnValue(STATE);
|
|
227
|
+
mockedIsInstalled.mockReturnValue(true);
|
|
228
|
+
mockedConnected.mockResolvedValue(true);
|
|
229
|
+
const isSignedIn = jest.fn().mockResolvedValue(false);
|
|
230
|
+
const deps = makeDeps({
|
|
231
|
+
isSignedIn,
|
|
232
|
+
isServiceRunning: jest.fn().mockResolvedValueOnce(false).mockResolvedValue(true),
|
|
233
|
+
});
|
|
234
|
+
const job = makeJob('zz');
|
|
235
|
+
await (0, orchestrator_1.runEnable)(job, deps);
|
|
236
|
+
expect(job.state).toBe('ready');
|
|
237
|
+
expect(isSignedIn).not.toHaveBeenCalled();
|
|
238
|
+
});
|
|
239
|
+
});
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProvisioningError = void 0;
|
|
4
|
-
exports.accountServerUrl = accountServerUrl;
|
|
3
|
+
exports.ProvisioningError = exports.accountServerUrl = void 0;
|
|
5
4
|
exports.provisionTunnel = provisionTunnel;
|
|
6
|
-
exports.moveTunnelToEdgeGate = moveTunnelToEdgeGate;
|
|
7
5
|
exports.listTunnels = listTunnels;
|
|
8
6
|
exports.uninstallTunnel = uninstallTunnel;
|
|
9
7
|
/**
|
|
10
8
|
* Account-server client for tunnel lifecycle. The daemon authenticates with
|
|
11
|
-
* the device JWT from
|
|
9
|
+
* the device JWT from the device login (~/.repoburg/token.jwt): the Remote
|
|
10
|
+
* Access dialog's "Continue with Google" or `repoburg login`.
|
|
12
11
|
*/
|
|
13
12
|
const authManager_1 = require("../auth/authManager");
|
|
13
|
+
const accountServer_1 = require("../auth/accountServer");
|
|
14
|
+
Object.defineProperty(exports, "accountServerUrl", { enumerable: true, get: function () { return accountServer_1.accountServerUrl; } });
|
|
14
15
|
const tunnel_state_1 = require("./tunnel-state");
|
|
15
|
-
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
16
|
-
const DEFAULT_ACCOUNT_SERVER_URL = isDevelopment
|
|
17
|
-
? 'http://localhost:2999'
|
|
18
|
-
: 'https://repoburg.com/api/account';
|
|
19
|
-
function accountServerUrl() {
|
|
20
|
-
return process.env.ACCOUNT_SERVER_URL ?? DEFAULT_ACCOUNT_SERVER_URL;
|
|
21
|
-
}
|
|
22
16
|
class ProvisioningError extends Error {
|
|
23
17
|
constructor(message, statusCode) {
|
|
24
18
|
super(message);
|
|
@@ -27,7 +21,7 @@ class ProvisioningError extends Error {
|
|
|
27
21
|
}
|
|
28
22
|
exports.ProvisioningError = ProvisioningError;
|
|
29
23
|
async function callAccountServer(method, path, token, body) {
|
|
30
|
-
const response = await fetch(`${accountServerUrl()}${path}`, {
|
|
24
|
+
const response = await fetch(`${(0, accountServer_1.accountServerUrl)()}${path}`, {
|
|
31
25
|
method,
|
|
32
26
|
headers: {
|
|
33
27
|
Authorization: `Bearer ${token}`,
|
|
@@ -49,11 +43,10 @@ async function callAccountServer(method, path, token, body) {
|
|
|
49
43
|
async function provisionTunnel(mahlas) {
|
|
50
44
|
const token = await authManager_1.authManager.readToken();
|
|
51
45
|
if (!token) {
|
|
52
|
-
throw new ProvisioningError('Not
|
|
46
|
+
throw new ProvisioningError('Not signed in to a Repoburg account.', 401);
|
|
53
47
|
}
|
|
54
|
-
// `edgeAuth`: this daemon checks the edge gate's tokens
|
|
55
|
-
//
|
|
56
|
-
// the gate ignores it and answers with Access fields, which are kept.
|
|
48
|
+
// `edgeAuth`: this daemon checks the edge gate's tokens (MUH-108). The
|
|
49
|
+
// account server refuses daemons that do not say so (426).
|
|
57
50
|
const result = await callAccountServer('POST', '/device/tunnels', token, { mahlas, edgeAuth: true });
|
|
58
51
|
// The owner email arrives in the same response: the tunnel is gated from
|
|
59
52
|
// birth, and checkRemoteAuth can pin the owner's email.
|
|
@@ -62,34 +55,12 @@ async function provisionTunnel(mahlas) {
|
|
|
62
55
|
hostname: result.hostname,
|
|
63
56
|
accountTunnelId: result.id,
|
|
64
57
|
tunnelToken: result.tunnel_token,
|
|
65
|
-
...(result.accessTeamDomain && result.accessAud
|
|
66
|
-
? { accessTeamDomain: result.accessTeamDomain, accessAud: result.accessAud }
|
|
67
|
-
: {}),
|
|
68
58
|
ownerEmail: result.ownerEmail,
|
|
69
59
|
installedAt: new Date().toISOString(),
|
|
70
60
|
};
|
|
71
61
|
(0, tunnel_state_1.saveTunnelState)(state);
|
|
72
62
|
return state;
|
|
73
63
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Moves a tunnel provisioned behind Cloudflare Access to the edge gate: the
|
|
76
|
-
* account server deletes the Access app, and remote.json drops the Access
|
|
77
|
-
* fields (Access JWTs are no longer accepted). Nothing to do for a tunnel
|
|
78
|
-
* without them. Returns whether it moved; throws when it could not (try again).
|
|
79
|
-
*/
|
|
80
|
-
async function moveTunnelToEdgeGate(home) {
|
|
81
|
-
const state = (0, tunnel_state_1.loadTunnelState)(home);
|
|
82
|
-
if (!state?.accessAud && !state?.accessTeamDomain)
|
|
83
|
-
return false;
|
|
84
|
-
const token = await authManager_1.authManager.readToken();
|
|
85
|
-
if (!token)
|
|
86
|
-
throw new ProvisioningError('Not logged in. Run `repoburg login` first.', 401);
|
|
87
|
-
const result = await callAccountServer('POST', `/device/tunnels/${state.accountTunnelId}/edge-auth`, token);
|
|
88
|
-
const { accessTeamDomain: _domain, accessAud: _aud, ...rest } = state;
|
|
89
|
-
// The pinned email stays as it was; a state from before pinning gets one.
|
|
90
|
-
(0, tunnel_state_1.saveTunnelState)({ ...rest, ownerEmail: state.ownerEmail ?? result.ownerEmail }, home);
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
64
|
/** List this user's machines (used by the pane machine list when local). */
|
|
94
65
|
async function listTunnels() {
|
|
95
66
|
const token = await authManager_1.authManager.readToken();
|
|
@@ -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,58 +39,29 @@ 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).
|
|
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
|
|
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');
|
|
61
|
-
// This daemon checks edge-gate tokens
|
|
58
|
+
// This daemon checks edge-gate tokens.
|
|
62
59
|
expect(JSON.parse(init.body)).toEqual({ mahlas: 'workstation', edgeAuth: true });
|
|
63
60
|
}
|
|
64
61
|
finally {
|
|
65
62
|
os_1.default.homedir = origHomedir;
|
|
66
63
|
}
|
|
67
64
|
});
|
|
68
|
-
it('keeps no Access fields for a tunnel behind the edge gate', async () => {
|
|
69
|
-
mockedReadToken.mockResolvedValue('device-jwt');
|
|
70
|
-
global.fetch = jest.fn(async () => ({
|
|
71
|
-
ok: true,
|
|
72
|
-
status: 201,
|
|
73
|
-
json: async () => ({
|
|
74
|
-
id: 'tunnel-uuid',
|
|
75
|
-
mahlas: 'workstation',
|
|
76
|
-
hostname: 'workstation.repoburg.com',
|
|
77
|
-
tunnel_token: 'connector-token',
|
|
78
|
-
ownerEmail: 'owner@repoburg.com',
|
|
79
|
-
gate: 'repoburg',
|
|
80
|
-
}),
|
|
81
|
-
}));
|
|
82
|
-
const origHomedir = os_1.default.homedir;
|
|
83
|
-
os_1.default.homedir = () => tmpHome;
|
|
84
|
-
try {
|
|
85
|
-
await (0, provisioner_1.provisionTunnel)('workstation');
|
|
86
|
-
const state = (0, tunnel_state_1.loadTunnelState)(tmpHome);
|
|
87
|
-
expect(state).toMatchObject({ hostname: 'workstation.repoburg.com', ownerEmail: 'owner@repoburg.com' });
|
|
88
|
-
expect(state).not.toHaveProperty('accessAud');
|
|
89
|
-
expect(state).not.toHaveProperty('accessTeamDomain');
|
|
90
|
-
}
|
|
91
|
-
finally {
|
|
92
|
-
os_1.default.homedir = origHomedir;
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
65
|
it('refuses to provision when not logged in', async () => {
|
|
96
66
|
mockedReadToken.mockResolvedValue(null);
|
|
97
67
|
await expect((0, provisioner_1.provisionTunnel)('workstation')).rejects.toBeInstanceOf(provisioner_1.ProvisioningError);
|
|
@@ -131,54 +101,3 @@ describe('provisioner', () => {
|
|
|
131
101
|
await expect((0, provisioner_1.listTunnels)()).resolves.toEqual([]);
|
|
132
102
|
});
|
|
133
103
|
});
|
|
134
|
-
describe('moveTunnelToEdgeGate', () => {
|
|
135
|
-
const ACCESS_STATE = {
|
|
136
|
-
mahlas: 'workstation',
|
|
137
|
-
hostname: 'workstation.repoburg.com',
|
|
138
|
-
accountTunnelId: 'tunnel-uuid',
|
|
139
|
-
tunnelToken: 'connector-token',
|
|
140
|
-
accessTeamDomain: 'team.cloudflareaccess.com',
|
|
141
|
-
accessAud: 'aud-tag',
|
|
142
|
-
ownerEmail: 'owner@repoburg.com',
|
|
143
|
-
installedAt: '2026-01-01T00:00:00.000Z',
|
|
144
|
-
};
|
|
145
|
-
const reply = (status, body) => jest.fn(async () => ({ ok: status < 400, status, json: async () => body }));
|
|
146
|
-
it('asks the account server, then drops the Access fields and keeps the pinned email', async () => {
|
|
147
|
-
(0, tunnel_state_1.saveTunnelState)(ACCESS_STATE, tmpHome);
|
|
148
|
-
mockedReadToken.mockResolvedValue('device-jwt');
|
|
149
|
-
const fetchMock = reply(200, { ownerEmail: 'changed@repoburg.com', gate: 'repoburg' });
|
|
150
|
-
global.fetch = fetchMock;
|
|
151
|
-
await expect((0, provisioner_1.moveTunnelToEdgeGate)(tmpHome)).resolves.toBe(true);
|
|
152
|
-
const [url, init] = fetchMock.mock.calls[0];
|
|
153
|
-
expect(url).toBe('http://account-server.test/device/tunnels/tunnel-uuid/edge-auth');
|
|
154
|
-
expect(init.method).toBe('POST');
|
|
155
|
-
expect(init.headers.Authorization).toBe('Bearer device-jwt');
|
|
156
|
-
const { accessTeamDomain: _domain, accessAud: _aud, ...rest } = ACCESS_STATE;
|
|
157
|
-
expect((0, tunnel_state_1.loadTunnelState)(tmpHome)).toEqual(rest);
|
|
158
|
-
});
|
|
159
|
-
it('pins the account server’s email on a state from before pinning', async () => {
|
|
160
|
-
(0, tunnel_state_1.saveTunnelState)({ ...ACCESS_STATE, ownerEmail: undefined }, tmpHome);
|
|
161
|
-
mockedReadToken.mockResolvedValue('device-jwt');
|
|
162
|
-
global.fetch = reply(200, { ownerEmail: 'owner@repoburg.com' });
|
|
163
|
-
await (0, provisioner_1.moveTunnelToEdgeGate)(tmpHome);
|
|
164
|
-
expect((0, tunnel_state_1.loadTunnelState)(tmpHome)?.ownerEmail).toBe('owner@repoburg.com');
|
|
165
|
-
});
|
|
166
|
-
it('has nothing to do without Access fields or without a tunnel', async () => {
|
|
167
|
-
const fetchMock = jest.fn();
|
|
168
|
-
global.fetch = fetchMock;
|
|
169
|
-
await expect((0, provisioner_1.moveTunnelToEdgeGate)(tmpHome)).resolves.toBe(false);
|
|
170
|
-
const { accessTeamDomain: _domain, accessAud: _aud, ...gateState } = ACCESS_STATE;
|
|
171
|
-
(0, tunnel_state_1.saveTunnelState)(gateState, tmpHome);
|
|
172
|
-
await expect((0, provisioner_1.moveTunnelToEdgeGate)(tmpHome)).resolves.toBe(false);
|
|
173
|
-
expect(fetchMock).not.toHaveBeenCalled();
|
|
174
|
-
});
|
|
175
|
-
it('keeps the Access fields when it cannot move (not logged in, server error)', async () => {
|
|
176
|
-
(0, tunnel_state_1.saveTunnelState)(ACCESS_STATE, tmpHome);
|
|
177
|
-
mockedReadToken.mockResolvedValue(null);
|
|
178
|
-
await expect((0, provisioner_1.moveTunnelToEdgeGate)(tmpHome)).rejects.toBeInstanceOf(provisioner_1.ProvisioningError);
|
|
179
|
-
mockedReadToken.mockResolvedValue('device-jwt');
|
|
180
|
-
global.fetch = reply(503, { message: 'Cloudflare API error: denied' });
|
|
181
|
-
await expect((0, provisioner_1.moveTunnelToEdgeGate)(tmpHome)).rejects.toThrow(/denied/);
|
|
182
|
-
expect((0, tunnel_state_1.loadTunnelState)(tmpHome)).toEqual(ACCESS_STATE);
|
|
183
|
-
});
|
|
184
|
-
});
|
|
@@ -45,12 +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
|
-
// Who signs visitors in: the account server's edge gate
|
|
49
|
-
|
|
50
|
-
gate: state ? (state.accessAud ? 'cloudflare-access' : 'repoburg') : null,
|
|
51
|
-
configured: Boolean(state?.accessTeamDomain && state?.accessAud),
|
|
48
|
+
// Who signs visitors in: the account server's edge gate (MUH-108).
|
|
49
|
+
gate: state ? 'repoburg' : null,
|
|
52
50
|
ownerEmail: state?.ownerEmail ?? null,
|
|
53
|
-
teamDomain: state?.accessTeamDomain ?? null,
|
|
54
51
|
},
|
|
55
52
|
publicHealth: { ok: await (0, probes_1.probePublicHealth)() },
|
|
56
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,12 +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
|
-
gate: 'cloudflare-access',
|
|
122
|
-
configured: true,
|
|
123
|
-
ownerEmail: 'owner@repoburg.com',
|
|
124
|
-
teamDomain: 'team.cloudflareaccess.com',
|
|
125
|
-
});
|
|
118
|
+
expect(res.json.access).toEqual({ gate: 'repoburg', ownerEmail: 'owner@repoburg.com' });
|
|
126
119
|
expect(res.json.publicHealth).toEqual({ ok: true });
|
|
127
120
|
});
|
|
128
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
package/platform-cli.js
CHANGED
|
@@ -149,11 +149,12 @@ program
|
|
|
149
149
|
// 2. Initiate login
|
|
150
150
|
console.log(chalk.yellow('Opening your browser to log in...'));
|
|
151
151
|
const initiateResponse = await axios.post(`${DAEMON_BASE_URL}/auth/initiate`);
|
|
152
|
-
const { loginUrl } = initiateResponse.data;
|
|
152
|
+
const { loginUrl, userCode } = initiateResponse.data;
|
|
153
153
|
|
|
154
154
|
if (loginUrl) {
|
|
155
155
|
await open(loginUrl);
|
|
156
156
|
console.log(chalk.green('✓ Please complete the authentication in your browser.'));
|
|
157
|
+
if (userCode) console.log(chalk.cyan(` Approve it only if the page shows the code ${userCode}.`));
|
|
157
158
|
await pollForAuth();
|
|
158
159
|
} else {
|
|
159
160
|
console.error(chalk.red('Could not retrieve login URL from the daemon.'));
|
|
@@ -354,11 +355,12 @@ program
|
|
|
354
355
|
try {
|
|
355
356
|
console.log(chalk.yellow('Opening your browser to log in...'));
|
|
356
357
|
const response = await axios.post(`${DAEMON_BASE_URL}/auth/initiate`);
|
|
357
|
-
const { loginUrl } = response.data;
|
|
358
|
+
const { loginUrl, userCode } = response.data;
|
|
358
359
|
|
|
359
360
|
if (loginUrl) {
|
|
360
361
|
await open(loginUrl);
|
|
361
362
|
console.log(chalk.green('✓ Please complete the authentication in your browser.'));
|
|
363
|
+
if (userCode) console.log(chalk.cyan(` Approve it only if the page shows the code ${userCode}.`));
|
|
362
364
|
} else {
|
|
363
365
|
console.error(chalk.red('Could not retrieve login URL from the daemon.'));
|
|
364
366
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"tree": "3f01773d2dfcfcfee7b73a8c7d7497c15ad692bc",
|
|
3
|
-
"commit": "
|
|
3
|
+
"commit": "292e390c833ac3fa8dd39a54f55dd75c6dd77441",
|
|
4
4
|
"dirty": false,
|
|
5
|
-
"repoburgVersion": "1.3.
|
|
6
|
-
"builtAt": "2026-11-
|
|
5
|
+
"repoburgVersion": "1.3.313",
|
|
6
|
+
"builtAt": "2026-11-09T06:44:47.614Z"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"tree": "3f01773d2dfcfcfee7b73a8c7d7497c15ad692bc",
|
|
3
|
-
"commit": "
|
|
3
|
+
"commit": "292e390c833ac3fa8dd39a54f55dd75c6dd77441",
|
|
4
4
|
"dirty": false,
|
|
5
|
-
"repoburgVersion": "1.3.
|
|
6
|
-
"builtAt": "2026-11-
|
|
5
|
+
"repoburgVersion": "1.3.313",
|
|
6
|
+
"builtAt": "2026-11-09T06:44:47.614Z"
|
|
7
7
|
}
|