@auxiora/tailscale 1.0.0
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/LICENSE +191 -0
- package/dist/__tests__/tailscale.test.d.ts +2 -0
- package/dist/__tests__/tailscale.test.d.ts.map +1 -0
- package/dist/__tests__/tailscale.test.js +184 -0
- package/dist/__tests__/tailscale.test.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/manager.d.ts +29 -0
- package/dist/manager.d.ts.map +1 -0
- package/dist/manager.js +137 -0
- package/dist/manager.js.map +1 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +25 -0
- package/src/__tests__/tailscale.test.ts +224 -0
- package/src/index.ts +9 -0
- package/src/manager.ts +179 -0
- package/src/types.ts +52 -0
- package/tsconfig.json +11 -0
- package/tsconfig.tsbuildinfo +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2026 Auxiora Contributors
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailscale.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/tailscale.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
+
import { TailscaleManager } from '../manager.js';
|
|
3
|
+
function makeMockRunner() {
|
|
4
|
+
const responses = new Map();
|
|
5
|
+
let defaultResponse = { stdout: '', stderr: '', exitCode: 0 };
|
|
6
|
+
const calls = [];
|
|
7
|
+
return {
|
|
8
|
+
calls,
|
|
9
|
+
setResponse(stdout, stderr = '', exitCode = 0) {
|
|
10
|
+
defaultResponse = { stdout, stderr, exitCode };
|
|
11
|
+
},
|
|
12
|
+
setResponseForArgs(args, stdout, stderr = '', exitCode = 0) {
|
|
13
|
+
responses.set(args.join(' '), { stdout, stderr, exitCode });
|
|
14
|
+
},
|
|
15
|
+
async run(command, args) {
|
|
16
|
+
calls.push({ command, args });
|
|
17
|
+
const key = args.join(' ');
|
|
18
|
+
return responses.get(key) ?? defaultResponse;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const TAILSCALE_STATUS_JSON = JSON.stringify({
|
|
23
|
+
BackendState: 'Running',
|
|
24
|
+
Self: {
|
|
25
|
+
HostName: 'my-machine',
|
|
26
|
+
DNSName: 'my-machine.tail1234.ts.net.',
|
|
27
|
+
TailscaleIPs: ['100.64.0.1', 'fd7a:115c::1'],
|
|
28
|
+
},
|
|
29
|
+
CurrentTailnet: {
|
|
30
|
+
Name: 'tail1234.ts.net',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
describe('TailscaleManager', () => {
|
|
34
|
+
let runner;
|
|
35
|
+
let manager;
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
runner = makeMockRunner();
|
|
38
|
+
manager = new TailscaleManager({ enabled: true, localPort: 3000 }, runner);
|
|
39
|
+
});
|
|
40
|
+
it('requires a CommandExecutor', () => {
|
|
41
|
+
expect(() => new TailscaleManager()).toThrow('CommandExecutor is required');
|
|
42
|
+
});
|
|
43
|
+
describe('detect', () => {
|
|
44
|
+
it('returns true when tailscale CLI is found', async () => {
|
|
45
|
+
runner.setResponse('1.62.0\n go1.22');
|
|
46
|
+
const result = await manager.detect();
|
|
47
|
+
expect(result).toBe(true);
|
|
48
|
+
expect(runner.calls[0]).toEqual({ command: 'tailscale', args: ['version'] });
|
|
49
|
+
});
|
|
50
|
+
it('returns false when tailscale CLI is not found', async () => {
|
|
51
|
+
runner.setResponse('', 'command not found', 127);
|
|
52
|
+
const result = await manager.detect();
|
|
53
|
+
expect(result).toBe(false);
|
|
54
|
+
expect(manager.getStatus()).toBe('not-installed');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
describe('getInfo', () => {
|
|
58
|
+
it('returns not-installed if tailscale is missing', async () => {
|
|
59
|
+
runner.setResponse('', 'not found', 127);
|
|
60
|
+
const info = await manager.getInfo();
|
|
61
|
+
expect(info.status).toBe('not-installed');
|
|
62
|
+
});
|
|
63
|
+
it('returns not-running if status command fails', async () => {
|
|
64
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
65
|
+
runner.setResponseForArgs(['status', '--json'], '', 'daemon not running', 1);
|
|
66
|
+
const info = await manager.getInfo();
|
|
67
|
+
expect(info.status).toBe('not-running');
|
|
68
|
+
});
|
|
69
|
+
it('returns ready with machine info when running', async () => {
|
|
70
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
71
|
+
runner.setResponseForArgs(['status', '--json'], TAILSCALE_STATUS_JSON, '', 0);
|
|
72
|
+
const info = await manager.getInfo();
|
|
73
|
+
expect(info.status).toBe('ready');
|
|
74
|
+
expect(info.hostname).toBe('my-machine');
|
|
75
|
+
expect(info.tailnet).toBe('tail1234.ts.net');
|
|
76
|
+
expect(info.ipAddress).toBe('100.64.0.1');
|
|
77
|
+
});
|
|
78
|
+
it('returns not-logged-in when backend needs login', async () => {
|
|
79
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
80
|
+
runner.setResponseForArgs(['status', '--json'], JSON.stringify({ BackendState: 'NeedsLogin' }), '', 0);
|
|
81
|
+
const info = await manager.getInfo();
|
|
82
|
+
expect(info.status).toBe('not-logged-in');
|
|
83
|
+
});
|
|
84
|
+
it('returns error on invalid JSON', async () => {
|
|
85
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
86
|
+
runner.setResponseForArgs(['status', '--json'], 'not-json', '', 0);
|
|
87
|
+
const info = await manager.getInfo();
|
|
88
|
+
expect(info.status).toBe('error');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
describe('serve', () => {
|
|
92
|
+
it('starts tailscale serve and returns info', async () => {
|
|
93
|
+
runner.setResponseForArgs(['serve', 'https://localhost:3000'], '', '', 0);
|
|
94
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
95
|
+
runner.setResponseForArgs(['status', '--json'], TAILSCALE_STATUS_JSON, '', 0);
|
|
96
|
+
const info = await manager.serve();
|
|
97
|
+
expect(info.status).toBe('serving');
|
|
98
|
+
expect(info.serveUrl).toBe('https://my-machine.tail1234.ts.net');
|
|
99
|
+
expect(manager.getActiveMode()).toBe('serve');
|
|
100
|
+
});
|
|
101
|
+
it('uses custom port', async () => {
|
|
102
|
+
runner.setResponseForArgs(['serve', 'https://localhost:8080'], '', '', 0);
|
|
103
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
104
|
+
runner.setResponseForArgs(['status', '--json'], TAILSCALE_STATUS_JSON, '', 0);
|
|
105
|
+
await manager.serve(8080);
|
|
106
|
+
expect(runner.calls[0]).toEqual({
|
|
107
|
+
command: 'tailscale',
|
|
108
|
+
args: ['serve', 'https://localhost:8080'],
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
it('throws on failure', async () => {
|
|
112
|
+
runner.setResponse('', 'access denied', 1);
|
|
113
|
+
await expect(manager.serve()).rejects.toThrow('Tailscale serve failed: access denied');
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
describe('funnel', () => {
|
|
117
|
+
it('starts tailscale funnel and returns info', async () => {
|
|
118
|
+
runner.setResponseForArgs(['funnel', 'https://localhost:3000'], '', '', 0);
|
|
119
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
120
|
+
runner.setResponseForArgs(['status', '--json'], TAILSCALE_STATUS_JSON, '', 0);
|
|
121
|
+
const info = await manager.funnel();
|
|
122
|
+
expect(info.status).toBe('serving');
|
|
123
|
+
expect(info.publicUrl).toBe('https://my-machine.tail1234.ts.net');
|
|
124
|
+
expect(manager.getActiveMode()).toBe('funnel');
|
|
125
|
+
});
|
|
126
|
+
it('throws on failure', async () => {
|
|
127
|
+
runner.setResponse('', 'funnel not enabled', 1);
|
|
128
|
+
await expect(manager.funnel()).rejects.toThrow('Tailscale funnel failed: funnel not enabled');
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
describe('stop', () => {
|
|
132
|
+
it('does nothing when no active mode', async () => {
|
|
133
|
+
await manager.stop();
|
|
134
|
+
expect(runner.calls).toHaveLength(0);
|
|
135
|
+
});
|
|
136
|
+
it('stops active serve', async () => {
|
|
137
|
+
runner.setResponseForArgs(['serve', 'https://localhost:3000'], '', '', 0);
|
|
138
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
139
|
+
runner.setResponseForArgs(['status', '--json'], TAILSCALE_STATUS_JSON, '', 0);
|
|
140
|
+
await manager.serve();
|
|
141
|
+
runner.calls.length = 0;
|
|
142
|
+
runner.setResponse('', '', 0);
|
|
143
|
+
await manager.stop();
|
|
144
|
+
expect(runner.calls[0]).toEqual({
|
|
145
|
+
command: 'tailscale',
|
|
146
|
+
args: ['serve', '--remove'],
|
|
147
|
+
});
|
|
148
|
+
expect(manager.getActiveMode()).toBeNull();
|
|
149
|
+
expect(manager.getStatus()).toBe('ready');
|
|
150
|
+
});
|
|
151
|
+
it('stops active funnel', async () => {
|
|
152
|
+
runner.setResponseForArgs(['funnel', 'https://localhost:3000'], '', '', 0);
|
|
153
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
154
|
+
runner.setResponseForArgs(['status', '--json'], TAILSCALE_STATUS_JSON, '', 0);
|
|
155
|
+
await manager.funnel();
|
|
156
|
+
runner.calls.length = 0;
|
|
157
|
+
runner.setResponse('', '', 0);
|
|
158
|
+
await manager.stop();
|
|
159
|
+
expect(runner.calls[0]).toEqual({
|
|
160
|
+
command: 'tailscale',
|
|
161
|
+
args: ['funnel', '--remove'],
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
describe('config', () => {
|
|
166
|
+
it('uses http when https is disabled', async () => {
|
|
167
|
+
const mgr = new TailscaleManager({ https: false, localPort: 3000 }, runner);
|
|
168
|
+
runner.setResponse('', '', 0);
|
|
169
|
+
runner.setResponseForArgs(['version'], '1.62.0', '', 0);
|
|
170
|
+
runner.setResponseForArgs(['status', '--json'], TAILSCALE_STATUS_JSON, '', 0);
|
|
171
|
+
await mgr.serve();
|
|
172
|
+
expect(runner.calls[0]).toEqual({
|
|
173
|
+
command: 'tailscale',
|
|
174
|
+
args: ['serve', 'http://localhost:3000'],
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
it('returns a copy of config', () => {
|
|
178
|
+
const config = manager.getConfig();
|
|
179
|
+
expect(config.localPort).toBe(3000);
|
|
180
|
+
expect(config.enabled).toBe(true);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
//# sourceMappingURL=tailscale.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailscale.test.js","sourceRoot":"","sources":["../../src/__tests__/tailscale.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,SAAS,cAAc;IAKrB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAgE,CAAC;IAC1F,IAAI,eAAe,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC9D,MAAM,KAAK,GAA+C,EAAE,CAAC;IAE7D,OAAO;QACL,KAAK;QACL,WAAW,CAAC,MAAc,EAAE,MAAM,GAAG,EAAE,EAAE,QAAQ,GAAG,CAAC;YACnD,eAAe,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QACjD,CAAC;QACD,kBAAkB,CAAC,IAAc,EAAE,MAAc,EAAE,MAAM,GAAG,EAAE,EAAE,QAAQ,GAAG,CAAC;YAC1E,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG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AE,CAAC;YACnC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TailscaleConfig, TailscaleInfo, TailscaleMode, TailscaleStatus, CommandExecutor } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Manages Tailscale Serve and Funnel for exposing Auxiora
|
|
4
|
+
* to the local tailnet or the public internet.
|
|
5
|
+
*/
|
|
6
|
+
export declare class TailscaleManager {
|
|
7
|
+
private config;
|
|
8
|
+
private runner;
|
|
9
|
+
private currentStatus;
|
|
10
|
+
private activeMode;
|
|
11
|
+
constructor(config?: Partial<TailscaleConfig>, runner?: CommandExecutor);
|
|
12
|
+
/** Detect whether the Tailscale CLI is installed and reachable. */
|
|
13
|
+
detect(): Promise<boolean>;
|
|
14
|
+
/** Get detailed status information from Tailscale. */
|
|
15
|
+
getInfo(): Promise<TailscaleInfo>;
|
|
16
|
+
/** Start Tailscale Serve — expose Auxiora on the local tailnet. */
|
|
17
|
+
serve(port?: number): Promise<TailscaleInfo>;
|
|
18
|
+
/** Start Tailscale Funnel — expose Auxiora to the public internet. */
|
|
19
|
+
funnel(port?: number): Promise<TailscaleInfo>;
|
|
20
|
+
/** Stop any active Tailscale Serve or Funnel. */
|
|
21
|
+
stop(): Promise<void>;
|
|
22
|
+
/** Get the current status. */
|
|
23
|
+
getStatus(): TailscaleStatus;
|
|
24
|
+
/** Get the active mode (serve, funnel, or null). */
|
|
25
|
+
getActiveMode(): TailscaleMode | null;
|
|
26
|
+
/** Get the current config. */
|
|
27
|
+
getConfig(): TailscaleConfig;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,eAAe,EAChB,MAAM,YAAY,CAAC;AAKpB;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,UAAU,CAA8B;gBAEpC,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,EAAE,eAAe;IAQvE,mEAAmE;IAC7D,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAWhC,sDAAsD;IAChD,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;IAwDvC,mEAAmE;IAC7D,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAqBlD,sEAAsE;IAChE,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAqBnD,iDAAiD;IAC3C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB3B,8BAA8B;IAC9B,SAAS,IAAI,eAAe;IAI5B,oDAAoD;IACpD,aAAa,IAAI,aAAa,GAAG,IAAI;IAIrC,8BAA8B;IAC9B,SAAS,IAAI,eAAe;CAG7B"}
|
package/dist/manager.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { getLogger } from '@auxiora/logger';
|
|
2
|
+
import { DEFAULT_TAILSCALE_CONFIG } from './types.js';
|
|
3
|
+
const logger = getLogger('tailscale');
|
|
4
|
+
/**
|
|
5
|
+
* Manages Tailscale Serve and Funnel for exposing Auxiora
|
|
6
|
+
* to the local tailnet or the public internet.
|
|
7
|
+
*/
|
|
8
|
+
export class TailscaleManager {
|
|
9
|
+
config;
|
|
10
|
+
runner;
|
|
11
|
+
currentStatus = 'not-installed';
|
|
12
|
+
activeMode = null;
|
|
13
|
+
constructor(config, runner) {
|
|
14
|
+
this.config = { ...DEFAULT_TAILSCALE_CONFIG, ...config };
|
|
15
|
+
if (!runner) {
|
|
16
|
+
throw new Error('CommandExecutor is required — use ProcessCommandRunner for production');
|
|
17
|
+
}
|
|
18
|
+
this.runner = runner;
|
|
19
|
+
}
|
|
20
|
+
/** Detect whether the Tailscale CLI is installed and reachable. */
|
|
21
|
+
async detect() {
|
|
22
|
+
const result = await this.runner.run('tailscale', ['version']);
|
|
23
|
+
if (result.exitCode !== 0) {
|
|
24
|
+
this.currentStatus = 'not-installed';
|
|
25
|
+
logger.debug('Tailscale CLI not found');
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
logger.info('Tailscale CLI detected', { version: result.stdout.trim().split('\n')[0] });
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
/** Get detailed status information from Tailscale. */
|
|
32
|
+
async getInfo() {
|
|
33
|
+
const installed = await this.detect();
|
|
34
|
+
if (!installed) {
|
|
35
|
+
return { status: 'not-installed' };
|
|
36
|
+
}
|
|
37
|
+
const result = await this.runner.run('tailscale', ['status', '--json']);
|
|
38
|
+
if (result.exitCode !== 0) {
|
|
39
|
+
this.currentStatus = 'not-running';
|
|
40
|
+
return { status: 'not-running' };
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const status = JSON.parse(result.stdout);
|
|
44
|
+
if (status.BackendState !== 'Running') {
|
|
45
|
+
this.currentStatus = status.BackendState === 'NeedsLogin' ? 'not-logged-in' : 'not-running';
|
|
46
|
+
return { status: this.currentStatus };
|
|
47
|
+
}
|
|
48
|
+
const hostname = status.Self?.HostName;
|
|
49
|
+
const dnsName = status.Self?.DNSName;
|
|
50
|
+
const tailnet = status.CurrentTailnet?.Name;
|
|
51
|
+
const ipAddress = status.Self?.TailscaleIPs?.[0];
|
|
52
|
+
this.currentStatus = this.activeMode ? 'serving' : 'ready';
|
|
53
|
+
const info = {
|
|
54
|
+
status: this.currentStatus,
|
|
55
|
+
hostname,
|
|
56
|
+
tailnet,
|
|
57
|
+
ipAddress,
|
|
58
|
+
};
|
|
59
|
+
if (dnsName && this.activeMode === 'serve') {
|
|
60
|
+
info.serveUrl = `https://${dnsName.replace(/\.$/, '')}`;
|
|
61
|
+
}
|
|
62
|
+
if (dnsName && this.activeMode === 'funnel') {
|
|
63
|
+
info.publicUrl = `https://${dnsName.replace(/\.$/, '')}`;
|
|
64
|
+
}
|
|
65
|
+
return info;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
this.currentStatus = 'error';
|
|
69
|
+
return { status: 'error' };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Start Tailscale Serve — expose Auxiora on the local tailnet. */
|
|
73
|
+
async serve(port) {
|
|
74
|
+
const targetPort = port ?? this.config.localPort;
|
|
75
|
+
logger.info('Starting Tailscale Serve', { port: targetPort });
|
|
76
|
+
const proto = this.config.https ? 'https' : 'http';
|
|
77
|
+
const result = await this.runner.run('tailscale', [
|
|
78
|
+
'serve',
|
|
79
|
+
`${proto}://localhost:${targetPort}`,
|
|
80
|
+
]);
|
|
81
|
+
if (result.exitCode !== 0) {
|
|
82
|
+
logger.error('Failed to start Tailscale Serve', { error: new Error(result.stderr) });
|
|
83
|
+
throw new Error(`Tailscale serve failed: ${result.stderr}`);
|
|
84
|
+
}
|
|
85
|
+
this.activeMode = 'serve';
|
|
86
|
+
this.currentStatus = 'serving';
|
|
87
|
+
logger.info('Tailscale Serve started');
|
|
88
|
+
return this.getInfo();
|
|
89
|
+
}
|
|
90
|
+
/** Start Tailscale Funnel — expose Auxiora to the public internet. */
|
|
91
|
+
async funnel(port) {
|
|
92
|
+
const targetPort = port ?? this.config.localPort;
|
|
93
|
+
logger.info('Starting Tailscale Funnel', { port: targetPort });
|
|
94
|
+
const proto = this.config.https ? 'https' : 'http';
|
|
95
|
+
const result = await this.runner.run('tailscale', [
|
|
96
|
+
'funnel',
|
|
97
|
+
`${proto}://localhost:${targetPort}`,
|
|
98
|
+
]);
|
|
99
|
+
if (result.exitCode !== 0) {
|
|
100
|
+
logger.error('Failed to start Tailscale Funnel', { error: new Error(result.stderr) });
|
|
101
|
+
throw new Error(`Tailscale funnel failed: ${result.stderr}`);
|
|
102
|
+
}
|
|
103
|
+
this.activeMode = 'funnel';
|
|
104
|
+
this.currentStatus = 'serving';
|
|
105
|
+
logger.info('Tailscale Funnel started');
|
|
106
|
+
return this.getInfo();
|
|
107
|
+
}
|
|
108
|
+
/** Stop any active Tailscale Serve or Funnel. */
|
|
109
|
+
async stop() {
|
|
110
|
+
if (!this.activeMode) {
|
|
111
|
+
logger.debug('No active Tailscale serve/funnel to stop');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
logger.info('Stopping Tailscale serve/funnel', { mode: this.activeMode });
|
|
115
|
+
const command = this.activeMode === 'funnel' ? 'funnel' : 'serve';
|
|
116
|
+
const result = await this.runner.run('tailscale', [command, '--remove']);
|
|
117
|
+
if (result.exitCode !== 0) {
|
|
118
|
+
logger.warn('Failed to cleanly stop Tailscale', { error: new Error(result.stderr) });
|
|
119
|
+
}
|
|
120
|
+
this.activeMode = null;
|
|
121
|
+
this.currentStatus = 'ready';
|
|
122
|
+
logger.info('Tailscale stopped');
|
|
123
|
+
}
|
|
124
|
+
/** Get the current status. */
|
|
125
|
+
getStatus() {
|
|
126
|
+
return this.currentStatus;
|
|
127
|
+
}
|
|
128
|
+
/** Get the active mode (serve, funnel, or null). */
|
|
129
|
+
getActiveMode() {
|
|
130
|
+
return this.activeMode;
|
|
131
|
+
}
|
|
132
|
+
/** Get the current config. */
|
|
133
|
+
getConfig() {
|
|
134
|
+
return { ...this.config };
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;AAEtC;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAkB;IACxB,MAAM,CAAkB;IACxB,aAAa,GAAoB,eAAe,CAAC;IACjD,UAAU,GAAyB,IAAI,CAAC;IAEhD,YAAY,MAAiC,EAAE,MAAwB;QACrE,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,wBAAwB,EAAE,GAAG,MAAM,EAAE,CAAC;QACzD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;QAC3F,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,mEAAmE;IACnE,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,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B,SAAS;QACP,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,oDAAoD;IACpD,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,8BAA8B;IAC9B,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Tailscale exposure mode. */
|
|
2
|
+
export type TailscaleMode = 'serve' | 'funnel';
|
|
3
|
+
/** Configuration for Tailscale integration. */
|
|
4
|
+
export interface TailscaleConfig {
|
|
5
|
+
/** Whether Tailscale integration is enabled. */
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
/** Exposure mode: serve (local tailnet) or funnel (public internet). */
|
|
8
|
+
mode: TailscaleMode;
|
|
9
|
+
/** Custom hostname for the Tailscale machine (optional). */
|
|
10
|
+
hostname?: string;
|
|
11
|
+
/** Local port to proxy traffic to. */
|
|
12
|
+
localPort: number;
|
|
13
|
+
/** Whether to use HTTPS on the Tailscale side. */
|
|
14
|
+
https: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULT_TAILSCALE_CONFIG: TailscaleConfig;
|
|
17
|
+
/** Status of the Tailscale integration. */
|
|
18
|
+
export type TailscaleStatus = 'not-installed' | 'not-running' | 'not-logged-in' | 'ready' | 'serving' | 'error';
|
|
19
|
+
/** Information about the current Tailscale state. */
|
|
20
|
+
export interface TailscaleInfo {
|
|
21
|
+
status: TailscaleStatus;
|
|
22
|
+
/** The Tailscale hostname (e.g., "my-machine"). */
|
|
23
|
+
hostname?: string;
|
|
24
|
+
/** The tailnet domain (e.g., "tail1234.ts.net"). */
|
|
25
|
+
tailnet?: string;
|
|
26
|
+
/** The public URL when serving via funnel. */
|
|
27
|
+
publicUrl?: string;
|
|
28
|
+
/** The local tailnet URL when serving via serve. */
|
|
29
|
+
serveUrl?: string;
|
|
30
|
+
/** The Tailscale IP address. */
|
|
31
|
+
ipAddress?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Interface for running CLI commands (injectable for testing). */
|
|
34
|
+
export interface CommandExecutor {
|
|
35
|
+
run(command: string, args: string[]): Promise<{
|
|
36
|
+
stdout: string;
|
|
37
|
+
stderr: string;
|
|
38
|
+
exitCode: number;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/C,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,IAAI,EAAE,aAAa,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,wBAAwB,EAAE,eAKtC,CAAC;AAEF,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GACvB,eAAe,GACf,aAAa,GACb,eAAe,GACf,OAAO,GACP,SAAS,GACT,OAAO,CAAC;AAEZ,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mEAAmE;A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