@edgible-team/cli 1.2.11 → 1.2.13
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/dist/commands/agent/install.d.ts +4 -0
- package/dist/commands/agent/install.d.ts.map +1 -1
- package/dist/commands/agent/install.js +155 -129
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +4 -0
- package/dist/commands/ai/helpers.d.ts.map +1 -1
- package/dist/commands/ai/helpers.js +10 -5
- package/dist/commands/debug.d.ts.map +1 -1
- package/dist/commands/debug.js +7 -3
- package/dist/services/DependencyInstaller.d.ts +2 -9
- package/dist/services/DependencyInstaller.d.ts.map +1 -1
- package/dist/services/DependencyInstaller.js +5 -30
- package/dist/services/application/ApplicationService.d.ts +3 -0
- package/dist/services/application/ApplicationService.d.ts.map +1 -1
- package/dist/services/application/ApplicationService.js +3 -0
- package/dist/types/ApiRequests.d.ts +8 -0
- package/dist/types/ApiRequests.d.ts.map +1 -1
- package/dist/types/models/ApplicationData.d.ts +22 -0
- package/dist/types/models/ApplicationData.d.ts.map +1 -1
- package/dist/types/models/OrganizationData.d.ts +2 -0
- package/dist/types/models/OrganizationData.d.ts.map +1 -1
- package/dist/types/validation/schemas.d.ts +24 -6
- package/dist/types/validation/schemas.d.ts.map +1 -1
- package/dist/types/validation/schemas.js +20 -0
- package/dist/utils/run-as-user.d.ts +24 -0
- package/dist/utils/run-as-user.d.ts.map +1 -0
- package/dist/utils/run-as-user.js +42 -0
- package/package.json +1 -1
|
@@ -7,5 +7,9 @@ export declare function handleAgentInstall(options: {
|
|
|
7
7
|
type?: string;
|
|
8
8
|
dev?: boolean;
|
|
9
9
|
local?: boolean;
|
|
10
|
+
noInteractive?: boolean;
|
|
11
|
+
deviceId?: string;
|
|
12
|
+
devicePassword?: string;
|
|
13
|
+
autoInstallDeps?: boolean;
|
|
10
14
|
}, logger: Logger, configManager: ConfigManager, edgibleService: EdgibleService, authService: AuthService, agentManager: LocalAgentManager): Promise<void>;
|
|
11
15
|
//# sourceMappingURL=install.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/install.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAU9D,wBAAsB,kBAAkB,CACtC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/install.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAU9D,wBAAsB,kBAAkB,CACtC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,EAC1J,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,iBAAiB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA6af"}
|
|
@@ -56,6 +56,9 @@ async function handleAgentInstall(options, logger, configManager, edgibleService
|
|
|
56
56
|
requireAuth: true,
|
|
57
57
|
requireOrganization: true,
|
|
58
58
|
});
|
|
59
|
+
const noInteractive = options.noInteractive === true;
|
|
60
|
+
const deviceIdFromEnv = process.env['EDGIBLE_DEVICE_ID'];
|
|
61
|
+
const devicePasswordFromEnv = process.env['EDGIBLE_DEVICE_PASSWORD'];
|
|
59
62
|
console.log(chalk_1.default.blue.bold('\n═══════════════════════════════════════════'));
|
|
60
63
|
console.log(chalk_1.default.blue.bold(' Edgible Agent Installation'));
|
|
61
64
|
console.log(chalk_1.default.blue.bold('═══════════════════════════════════════════\n'));
|
|
@@ -68,144 +71,157 @@ async function handleAgentInstall(options, logger, configManager, edgibleService
|
|
|
68
71
|
console.log(chalk_1.default.yellow('⚠ ' + PlatformDetector_1.PlatformDetector.getRootRequirementMessage()));
|
|
69
72
|
console.log(chalk_1.default.gray(' Some installation options require elevated privileges.\n'));
|
|
70
73
|
}
|
|
71
|
-
// Step 2: Device Selection (
|
|
74
|
+
// Step 2: Device Selection (or use flags/env in non-interactive)
|
|
72
75
|
const config = configManager.getConfig();
|
|
73
|
-
let deviceId = config.deviceId;
|
|
74
|
-
let devicePassword = config.devicePassword;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
76
|
+
let deviceId = options.deviceId ?? deviceIdFromEnv ?? config.deviceId;
|
|
77
|
+
let devicePassword = options.devicePassword ?? devicePasswordFromEnv ?? config.devicePassword;
|
|
78
|
+
if (noInteractive) {
|
|
79
|
+
if (!deviceId || !devicePassword) {
|
|
80
|
+
throw new Error('Non-interactive install requires device credentials. Set --device-id and --device-password, or EDGIBLE_DEVICE_ID and EDGIBLE_DEVICE_PASSWORD, or run interactively once to save config.');
|
|
81
|
+
}
|
|
82
|
+
if (!options.type) {
|
|
83
|
+
throw new Error('Non-interactive install requires --type (e.g. --type launchd on macOS).');
|
|
84
|
+
}
|
|
85
|
+
console.log(chalk_1.default.blue('📱 Device (non-interactive)'));
|
|
86
|
+
console.log(chalk_1.default.gray(`Using device: ${deviceId}\n`));
|
|
87
|
+
configManager.updateConfig({ deviceId, devicePassword, deviceType: 'serving' });
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
console.log(chalk_1.default.blue('📱 Device Selection'));
|
|
91
|
+
console.log(chalk_1.default.gray('Select which serving device this agent should represent:\n'));
|
|
92
|
+
try {
|
|
93
|
+
// Fetch available serving devices
|
|
94
|
+
const servingDevicesResp = await edgibleService.listServingDevices();
|
|
95
|
+
const servingDevices = servingDevicesResp?.devices || [];
|
|
96
|
+
if (servingDevices.length > 0) {
|
|
97
|
+
// Show list of devices to select from
|
|
98
|
+
const deviceChoices = servingDevices.map((d) => {
|
|
99
|
+
const isCurrentDevice = config.deviceId === d.id;
|
|
100
|
+
const displayName = `${d.name || d.id}${d.description ? ` - ${d.description}` : ''}${isCurrentDevice ? chalk_1.default.gray(' (current)') : ''}`;
|
|
101
|
+
return {
|
|
102
|
+
name: displayName,
|
|
103
|
+
value: d.id
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
// Add option to create new device
|
|
107
|
+
deviceChoices.push({
|
|
108
|
+
name: chalk_1.default.cyan('➕ Create new serving device'),
|
|
109
|
+
value: '__create_new__'
|
|
110
|
+
});
|
|
111
|
+
const { selectedDeviceId } = await inquirer_1.default.prompt([{
|
|
112
|
+
type: 'list',
|
|
113
|
+
name: 'selectedDeviceId',
|
|
114
|
+
message: 'Select serving device:',
|
|
115
|
+
choices: deviceChoices,
|
|
116
|
+
default: config.deviceId || undefined
|
|
117
|
+
}]);
|
|
118
|
+
if (selectedDeviceId === '__create_new__') {
|
|
119
|
+
// Create new device
|
|
120
|
+
const deviceNameAnswer = await inquirer_1.default.prompt([{
|
|
121
|
+
type: 'input',
|
|
122
|
+
name: 'deviceName',
|
|
123
|
+
message: 'Enter a name for this device:',
|
|
124
|
+
default: `${os.hostname()}-${os.platform()}`,
|
|
125
|
+
validate: (input) => {
|
|
126
|
+
if (!input.trim()) {
|
|
127
|
+
return 'Device name is required';
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}]);
|
|
132
|
+
const descriptionAnswer = await inquirer_1.default.prompt([{
|
|
133
|
+
type: 'input',
|
|
134
|
+
name: 'description',
|
|
135
|
+
message: 'Enter device description (optional):',
|
|
136
|
+
default: `Serving device: ${deviceNameAnswer.deviceName}`
|
|
137
|
+
}]);
|
|
138
|
+
console.log(chalk_1.default.gray('\nCreating device...'));
|
|
139
|
+
const createResponse = await edgibleService.createServingDevice({
|
|
140
|
+
name: deviceNameAnswer.deviceName.trim(),
|
|
141
|
+
description: descriptionAnswer.description.trim()
|
|
142
|
+
});
|
|
143
|
+
deviceId = createResponse.device.id;
|
|
144
|
+
devicePassword = createResponse.device.password;
|
|
145
|
+
console.log(chalk_1.default.green(`✓ Device created: ${deviceId}`));
|
|
146
|
+
console.log(chalk_1.default.yellow(`\n⚠ Device Password: ${devicePassword}`));
|
|
147
|
+
console.log(chalk_1.default.yellow('⚠ Please save this password securely!\n'));
|
|
148
|
+
// Verify device credentials
|
|
149
|
+
if (devicePassword && deviceId) {
|
|
150
|
+
console.log(chalk_1.default.gray('Verifying device credentials...'));
|
|
151
|
+
try {
|
|
152
|
+
const isValid = await authService.verifyDeviceCredentials(deviceId, devicePassword);
|
|
153
|
+
if (isValid) {
|
|
154
|
+
console.log(chalk_1.default.green('✓ Device credentials verified\n'));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch (verifyError) {
|
|
158
|
+
console.log(chalk_1.default.yellow('⚠ Could not verify device credentials\n'));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// Save device credentials to config
|
|
162
|
+
configManager.updateConfig({
|
|
163
|
+
deviceId: deviceId,
|
|
164
|
+
deviceName: deviceNameAnswer.deviceName.trim(),
|
|
165
|
+
devicePassword: devicePassword,
|
|
166
|
+
deviceType: 'serving'
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
// Use existing device - need to fetch full details to get password
|
|
171
|
+
deviceId = selectedDeviceId;
|
|
172
|
+
if (!deviceId) {
|
|
173
|
+
throw new Error('No device selected');
|
|
174
|
+
}
|
|
175
|
+
console.log(chalk_1.default.gray('Retrieving device credentials...\n'));
|
|
176
|
+
// Fetch device details to get the plaintext password
|
|
177
|
+
const deviceResponse = await edgibleService.getDevice(deviceId);
|
|
178
|
+
devicePassword = deviceResponse.device?.password || '';
|
|
179
|
+
if (!devicePassword) {
|
|
180
|
+
throw new Error('Could not retrieve device password from API');
|
|
181
|
+
}
|
|
182
|
+
// Save device credentials to config
|
|
183
|
+
configManager.updateConfig({
|
|
184
|
+
deviceId,
|
|
185
|
+
devicePassword,
|
|
186
|
+
deviceType: 'serving'
|
|
187
|
+
});
|
|
188
|
+
console.log(chalk_1.default.green(`✓ Using device: ${deviceId}\n`));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// No devices exist, must create one
|
|
193
|
+
console.log(chalk_1.default.yellow('No serving devices found. Creating a new one...\n'));
|
|
105
194
|
const deviceNameAnswer = await inquirer_1.default.prompt([{
|
|
106
195
|
type: 'input',
|
|
107
196
|
name: 'deviceName',
|
|
108
197
|
message: 'Enter a name for this device:',
|
|
109
198
|
default: `${os.hostname()}-${os.platform()}`,
|
|
110
|
-
validate: (input) =>
|
|
111
|
-
if (!input.trim()) {
|
|
112
|
-
return 'Device name is required';
|
|
113
|
-
}
|
|
114
|
-
return true;
|
|
115
|
-
}
|
|
199
|
+
validate: (input) => input.trim().length > 0 || 'Device name is required'
|
|
116
200
|
}]);
|
|
117
|
-
const descriptionAnswer = await inquirer_1.default.prompt([{
|
|
118
|
-
type: 'input',
|
|
119
|
-
name: 'description',
|
|
120
|
-
message: 'Enter device description (optional):',
|
|
121
|
-
default: `Serving device: ${deviceNameAnswer.deviceName}`
|
|
122
|
-
}]);
|
|
123
|
-
console.log(chalk_1.default.gray('\nCreating device...'));
|
|
124
201
|
const createResponse = await edgibleService.createServingDevice({
|
|
125
202
|
name: deviceNameAnswer.deviceName.trim(),
|
|
126
|
-
description:
|
|
203
|
+
description: `Serving device: ${deviceNameAnswer.deviceName}`
|
|
127
204
|
});
|
|
128
205
|
deviceId = createResponse.device.id;
|
|
129
206
|
devicePassword = createResponse.device.password;
|
|
130
207
|
console.log(chalk_1.default.green(`✓ Device created: ${deviceId}`));
|
|
131
208
|
console.log(chalk_1.default.yellow(`\n⚠ Device Password: ${devicePassword}`));
|
|
132
209
|
console.log(chalk_1.default.yellow('⚠ Please save this password securely!\n'));
|
|
133
|
-
// Verify device credentials
|
|
134
|
-
if (devicePassword && deviceId) {
|
|
135
|
-
console.log(chalk_1.default.gray('Verifying device credentials...'));
|
|
136
|
-
try {
|
|
137
|
-
const isValid = await authService.verifyDeviceCredentials(deviceId, devicePassword);
|
|
138
|
-
if (isValid) {
|
|
139
|
-
console.log(chalk_1.default.green('✓ Device credentials verified\n'));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
catch (verifyError) {
|
|
143
|
-
console.log(chalk_1.default.yellow('⚠ Could not verify device credentials\n'));
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
// Save device credentials to config
|
|
147
|
-
configManager.updateConfig({
|
|
148
|
-
deviceId: deviceId,
|
|
149
|
-
deviceName: deviceNameAnswer.deviceName.trim(),
|
|
150
|
-
devicePassword: devicePassword,
|
|
151
|
-
deviceType: 'serving'
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
// Use existing device - need to fetch full details to get password
|
|
156
|
-
deviceId = selectedDeviceId;
|
|
157
|
-
if (!deviceId) {
|
|
158
|
-
throw new Error('No device selected');
|
|
159
|
-
}
|
|
160
|
-
console.log(chalk_1.default.gray('Retrieving device credentials...\n'));
|
|
161
|
-
// Fetch device details to get the plaintext password
|
|
162
|
-
const deviceResponse = await edgibleService.getDevice(deviceId);
|
|
163
|
-
devicePassword = deviceResponse.device?.password || '';
|
|
164
|
-
if (!devicePassword) {
|
|
165
|
-
throw new Error('Could not retrieve device password from API');
|
|
166
|
-
}
|
|
167
|
-
// Save device credentials to config
|
|
168
210
|
configManager.updateConfig({
|
|
169
211
|
deviceId,
|
|
212
|
+
deviceName: deviceNameAnswer.deviceName.trim(),
|
|
170
213
|
devicePassword,
|
|
171
214
|
deviceType: 'serving'
|
|
172
215
|
});
|
|
173
|
-
console.log(chalk_1.default.green(`✓ Using device: ${deviceId}\n`));
|
|
174
216
|
}
|
|
175
217
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
name: 'deviceName',
|
|
182
|
-
message: 'Enter a name for this device:',
|
|
183
|
-
default: `${os.hostname()}-${os.platform()}`,
|
|
184
|
-
validate: (input) => input.trim().length > 0 || 'Device name is required'
|
|
185
|
-
}]);
|
|
186
|
-
const createResponse = await edgibleService.createServingDevice({
|
|
187
|
-
name: deviceNameAnswer.deviceName.trim(),
|
|
188
|
-
description: `Serving device: ${deviceNameAnswer.deviceName}`
|
|
189
|
-
});
|
|
190
|
-
deviceId = createResponse.device.id;
|
|
191
|
-
devicePassword = createResponse.device.password;
|
|
192
|
-
console.log(chalk_1.default.green(`✓ Device created: ${deviceId}`));
|
|
193
|
-
console.log(chalk_1.default.yellow(`\n⚠ Device Password: ${devicePassword}`));
|
|
194
|
-
console.log(chalk_1.default.yellow('⚠ Please save this password securely!\n'));
|
|
195
|
-
configManager.updateConfig({
|
|
196
|
-
deviceId,
|
|
197
|
-
deviceName: deviceNameAnswer.deviceName.trim(),
|
|
198
|
-
devicePassword,
|
|
199
|
-
deviceType: 'serving'
|
|
200
|
-
});
|
|
218
|
+
catch (error) {
|
|
219
|
+
logger.error('Error during device selection', error);
|
|
220
|
+
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
221
|
+
console.error(chalk_1.default.red('Error during device selection:'), errorMessage);
|
|
222
|
+
throw error;
|
|
201
223
|
}
|
|
202
224
|
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
logger.error('Error during device selection', error);
|
|
205
|
-
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
206
|
-
console.error(chalk_1.default.red('Error during device selection:'), errorMessage);
|
|
207
|
-
throw error;
|
|
208
|
-
}
|
|
209
225
|
// Verify we have device credentials
|
|
210
226
|
if (!deviceId || !devicePassword) {
|
|
211
227
|
throw new Error('Device credentials are required');
|
|
@@ -224,16 +240,20 @@ async function handleAgentInstall(options, logger, configManager, edgibleService
|
|
|
224
240
|
return;
|
|
225
241
|
}
|
|
226
242
|
let selectedType;
|
|
227
|
-
if (options.type) {
|
|
243
|
+
if (options.type || noInteractive) {
|
|
244
|
+
const typeToUse = options.type ?? (noInteractive ? 'launchd' : undefined);
|
|
245
|
+
if (!typeToUse) {
|
|
246
|
+
throw new Error('Installation type is required in non-interactive mode (e.g. --type launchd).');
|
|
247
|
+
}
|
|
228
248
|
// Type specified via flag - validate it's a supported daemon type
|
|
229
249
|
const supportedTypes = ['systemd', 'launchd', 'windows-service'];
|
|
230
|
-
if (!supportedTypes.includes(
|
|
231
|
-
console.error(chalk_1.default.red(`✗ Installation type '${
|
|
250
|
+
if (!supportedTypes.includes(typeToUse)) {
|
|
251
|
+
console.error(chalk_1.default.red(`✗ Installation type '${typeToUse}' is not supported`));
|
|
232
252
|
console.error(chalk_1.default.yellow(` Only daemon installations are supported: ${supportedTypes.join(', ')}`));
|
|
233
253
|
console.error(chalk_1.default.yellow(` Docker and Podman installations are no longer available`));
|
|
234
254
|
return;
|
|
235
255
|
}
|
|
236
|
-
selectedType =
|
|
256
|
+
selectedType = typeToUse;
|
|
237
257
|
const option = availableOptions.find(opt => opt.type === selectedType);
|
|
238
258
|
if (!option) {
|
|
239
259
|
console.error(chalk_1.default.red(`✗ Installation type '${selectedType}' not available on this platform`));
|
|
@@ -279,11 +299,12 @@ async function handleAgentInstall(options, logger, configManager, edgibleService
|
|
|
279
299
|
console.log(chalk_1.default.blue('🔍 Checking System Dependencies'));
|
|
280
300
|
console.log(chalk_1.default.gray('Verifying required tools are installed...\n'));
|
|
281
301
|
const dependencyInstaller = new DependencyInstaller_1.DependencyInstaller();
|
|
302
|
+
const autoInstallDeps = options.autoInstallDeps === true || (noInteractive && options.autoInstallDeps !== false);
|
|
282
303
|
try {
|
|
283
304
|
await dependencyInstaller.checkAndInstallDependencies({
|
|
284
305
|
includeWireGuardGo: false, // Use kernel WireGuard by default
|
|
285
306
|
includeIptables: platform === 'linux', // Only check iptables on Linux
|
|
286
|
-
autoInstall:
|
|
307
|
+
autoInstall: autoInstallDeps
|
|
287
308
|
});
|
|
288
309
|
console.log(chalk_1.default.green('✓ Dependencies verified\n'));
|
|
289
310
|
}
|
|
@@ -292,16 +313,21 @@ async function handleAgentInstall(options, logger, configManager, edgibleService
|
|
|
292
313
|
console.error(chalk_1.default.red(` ${error instanceof Error ? error.message : String(error)}`));
|
|
293
314
|
console.log(chalk_1.default.yellow('\n⚠ Some dependencies are missing. The agent may not function correctly.'));
|
|
294
315
|
console.log(chalk_1.default.yellow(' You can install them manually or run: edgible agent setup --auto-install\n'));
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
316
|
+
if (noInteractive) {
|
|
317
|
+
console.log(chalk_1.default.yellow('Non-interactive: continuing anyway.\n'));
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
// Ask if user wants to continue anyway
|
|
321
|
+
const { continueAnyway } = await inquirer_1.default.prompt([{
|
|
322
|
+
type: 'confirm',
|
|
323
|
+
name: 'continueAnyway',
|
|
324
|
+
message: 'Continue with installation anyway?',
|
|
325
|
+
default: false
|
|
326
|
+
}]);
|
|
327
|
+
if (!continueAnyway) {
|
|
328
|
+
console.log(chalk_1.default.gray('Installation cancelled.'));
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
305
331
|
}
|
|
306
332
|
}
|
|
307
333
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmJzD"}
|
package/dist/commands/agent.js
CHANGED
|
@@ -29,6 +29,10 @@ function setupAgentCommands(program) {
|
|
|
29
29
|
.option('--type <type>', 'Installation type (systemd|launchd|windows-service)')
|
|
30
30
|
.option('--dev', 'Run in development mode (foreground, no daemon)')
|
|
31
31
|
.option('--local', 'Use local agent build from agent-v2/dist/ (development only)')
|
|
32
|
+
.option('--no-interactive', 'Non-interactive mode for CI/VMs: use config or --device-id/--device-password, skip prompts')
|
|
33
|
+
.option('--device-id <id>', 'Serving device ID (non-interactive); can use EDGIBLE_DEVICE_ID')
|
|
34
|
+
.option('--device-password <password>', 'Serving device password (non-interactive); can use EDGIBLE_DEVICE_PASSWORD')
|
|
35
|
+
.option('--auto-install-deps', 'Install missing dependencies (WireGuard, Caddy, etc.) without prompting')
|
|
32
36
|
.action((0, command_wrapper_1.wrapCommand)(async (options) => {
|
|
33
37
|
await (0, install_1.handleAgentInstall)(options, instances_1.logger, instances_1.configManager, instances_1.edgibleService, instances_1.authService, instances_1.localAgentManager);
|
|
34
38
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/helpers.ts"],"names":[],"mappings":"AASA,OAAO,EAA4B,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAiBxG,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,GAClB,CAAC;AAEF,iBAAe,WAAW,CACxB,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,YAAY,EAAE,kBAAkB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAmKjB;AAED;;GAEG;AACH,iBAAe,gBAAgB,CAAC,OAAO,EAAE;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB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B,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA6B7F;AAqID;;GAEG;AACH,iBAAe,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAoBpE;AAED;;GAEG;AACH,iBAAe,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAoB9D"}
|
|
@@ -66,6 +66,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
66
66
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
67
67
|
const child_process_1 = require("child_process");
|
|
68
68
|
const os = __importStar(require("os"));
|
|
69
|
+
const run_as_user_1 = require("../../utils/run-as-user");
|
|
69
70
|
const path = __importStar(require("path"));
|
|
70
71
|
const fs = __importStar(require("fs"));
|
|
71
72
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
@@ -447,6 +448,7 @@ async function setupPlatformIntegration(options) {
|
|
|
447
448
|
const webUIResult = await createOpenWebUIApplication({
|
|
448
449
|
ollamaUrl: ollamaUrl,
|
|
449
450
|
deviceId: deviceId,
|
|
451
|
+
ollamaAppId: createdOllamaApp.id,
|
|
450
452
|
configManager: instances_1.configManager,
|
|
451
453
|
applicationService: instances_1.applicationService,
|
|
452
454
|
gatewayService: instances_1.gatewayService,
|
|
@@ -524,10 +526,10 @@ async function installOllama() {
|
|
|
524
526
|
});
|
|
525
527
|
}
|
|
526
528
|
else if (platform === 'darwin') {
|
|
527
|
-
// macOS - check for Homebrew
|
|
529
|
+
// macOS - check for Homebrew; run as real user so brew installs under user not root (e.g. when CLI was started with sudo)
|
|
528
530
|
try {
|
|
529
|
-
(0,
|
|
530
|
-
(0,
|
|
531
|
+
(0, run_as_user_1.execAsRealUser)('brew --version', { encoding: 'utf8', timeout: 2000, stdio: 'ignore' });
|
|
532
|
+
(0, run_as_user_1.execAsRealUser)('brew install ollama', {
|
|
531
533
|
encoding: 'utf8',
|
|
532
534
|
stdio: 'inherit',
|
|
533
535
|
});
|
|
@@ -1368,7 +1370,9 @@ async function createOllamaApplication(config) {
|
|
|
1368
1370
|
};
|
|
1369
1371
|
}
|
|
1370
1372
|
/**
|
|
1371
|
-
* Create Open WebUI application on Edgible platform
|
|
1373
|
+
* Create Open WebUI application on Edgible platform.
|
|
1374
|
+
* When ollamaAppId is provided, open-webui is created with a dependency on the ollama application
|
|
1375
|
+
* so it stays suspended until ollama is deployed (ADR-0004).
|
|
1372
1376
|
*/
|
|
1373
1377
|
async function createOpenWebUIApplication(config) {
|
|
1374
1378
|
// Always use the same device as Ollama (same device as agent)
|
|
@@ -1398,7 +1402,8 @@ async function createOpenWebUIApplication(config) {
|
|
|
1398
1402
|
'isWorking': true,
|
|
1399
1403
|
'deleteVolumesOnDeletion': true // Delete volumes when application is deleted
|
|
1400
1404
|
},
|
|
1401
|
-
requireOrgAuth: true // Enable authentication - X-Auth-Email header already passed by auth system
|
|
1405
|
+
requireOrgAuth: true, // Enable authentication - X-Auth-Email header already passed by auth system
|
|
1406
|
+
dependsOnApplicationIds: config.ollamaAppId ? [config.ollamaAppId] : undefined,
|
|
1402
1407
|
});
|
|
1403
1408
|
return {
|
|
1404
1409
|
app: result,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/commands/debug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/commands/debug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkmBzD"}
|
package/dist/commands/debug.js
CHANGED
|
@@ -58,7 +58,8 @@ function setupDebugCommands(program) {
|
|
|
58
58
|
debugCommand
|
|
59
59
|
.command('full-cycle')
|
|
60
60
|
.description('Full debug cycle for customer issue troubleshooting')
|
|
61
|
-
.
|
|
61
|
+
.option('--local', 'Use local agent build from agent-v2/dist/ (development only)')
|
|
62
|
+
.action((0, command_wrapper_1.wrapCommand)(async (options) => {
|
|
62
63
|
if (!(0, sudo_checker_1.checkSudoPermissions)()) {
|
|
63
64
|
console.log(chalk_1.default.redBright("Please run this command with administrator privileges (i.e. sudo)"));
|
|
64
65
|
return;
|
|
@@ -120,10 +121,13 @@ function setupDebugCommands(program) {
|
|
|
120
121
|
console.log(chalk_1.default.blue.bold('\n[Step 3/9] Installing Agent\n'));
|
|
121
122
|
const platform = PlatformDetector_1.PlatformDetector.getPlatform();
|
|
122
123
|
const installationType = platform === 'darwin' ? 'launchd' : 'systemd';
|
|
123
|
-
|
|
124
|
+
if (options.local) {
|
|
125
|
+
console.log(chalk_1.default.cyan('Using local agent build from agent-v2/dist/\n'));
|
|
126
|
+
}
|
|
127
|
+
await (0, install_1.handleAgentInstall)({ type: installationType, dev: false, local: options.local || false }, instances_1.logger, instances_1.configManager, instances_1.edgibleService, instances_1.authService, instances_1.localAgentManager);
|
|
124
128
|
debugSections.push({
|
|
125
129
|
title: 'Agent Installation',
|
|
126
|
-
content: `Agent installed successfully (${installationType} on ${platform})`
|
|
130
|
+
content: `Agent installed successfully (${installationType} on ${platform})${options.local ? ' [LOCAL BUILD]' : ''}`
|
|
127
131
|
});
|
|
128
132
|
// Step 4: Wait 2 minutes for startup
|
|
129
133
|
console.log(chalk_1.default.blue.bold('\n[Step 4/9] Waiting 2 Minutes for Agent Startup\n'));
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
export declare class DependencyInstaller {
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
private getSudoUser;
|
|
7
|
-
/**
|
|
8
|
-
* Execute a command, running as the original user if executed via sudo
|
|
9
|
-
* This is particularly important for Homebrew, which refuses to run as root
|
|
10
|
-
* @param command The command to execute
|
|
11
|
-
* @returns The stdout from execSync
|
|
3
|
+
* Execute a command, running as the original user if executed via sudo.
|
|
4
|
+
* Delegates to shared run-as-user util (important for Homebrew on macOS).
|
|
12
5
|
*/
|
|
13
6
|
private execAsRealUser;
|
|
14
7
|
checkAndInstallDependencies(options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DependencyInstaller.d.ts","sourceRoot":"","sources":["../../src/services/DependencyInstaller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DependencyInstaller.d.ts","sourceRoot":"","sources":["../../src/services/DependencyInstaller.ts"],"names":[],"mappings":"AASA,qBAAa,mBAAmB;IAC9B;;;OAGG;IACH,OAAO,CAAC,cAAc;IAIhB,2BAA2B,CAAC,OAAO,GAAE;QAAE,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YA2CpI,qBAAqB;YAYrB,oBAAoB;YA6CpB,oBAAoB;YAkBpB,gBAAgB;YAkBhB,gBAAgB;YAuChB,YAAY;YAuCZ,kBAAkB;YAkBlB,cAAc;YAmCd,sBAAsB;YAkBtB,kBAAkB;YA2ClB,mBAAmB;YAoBnB,eAAe;CAgC9B"}
|
|
@@ -41,43 +41,18 @@ const child_process_1 = require("child_process");
|
|
|
41
41
|
const os = __importStar(require("os"));
|
|
42
42
|
const chalk_1 = __importDefault(require("chalk"));
|
|
43
43
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
44
|
+
const run_as_user_1 = require("../utils/run-as-user");
|
|
44
45
|
class DependencyInstaller {
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
getSudoUser() {
|
|
50
|
-
const uid = process.getuid ? process.getuid() : undefined;
|
|
51
|
-
const sudoUser = process.env['SUDO_USER'];
|
|
52
|
-
// Only return SUDO_USER if we're actually running as root (uid 0)
|
|
53
|
-
if (uid === 0 && sudoUser) {
|
|
54
|
-
return sudoUser;
|
|
55
|
-
}
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Execute a command, running as the original user if executed via sudo
|
|
60
|
-
* This is particularly important for Homebrew, which refuses to run as root
|
|
61
|
-
* @param command The command to execute
|
|
62
|
-
* @returns The stdout from execSync
|
|
47
|
+
* Execute a command, running as the original user if executed via sudo.
|
|
48
|
+
* Delegates to shared run-as-user util (important for Homebrew on macOS).
|
|
63
49
|
*/
|
|
64
50
|
execAsRealUser(command) {
|
|
65
|
-
|
|
66
|
-
if (sudoUser) {
|
|
67
|
-
// Running under sudo - execute as the original user
|
|
68
|
-
// Use 'sudo -u' to run the command as the original user
|
|
69
|
-
// Pass through the HOME environment variable to ensure Homebrew works correctly
|
|
70
|
-
const wrappedCommand = `sudo -u ${sudoUser} HOME=$(eval echo ~${sudoUser}) ${command}`;
|
|
71
|
-
return (0, child_process_1.execSync)(wrappedCommand);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
// Not running under sudo - execute normally
|
|
75
|
-
return (0, child_process_1.execSync)(command);
|
|
76
|
-
}
|
|
51
|
+
return (0, run_as_user_1.execAsRealUser)(command);
|
|
77
52
|
}
|
|
78
53
|
async checkAndInstallDependencies(options = {}) {
|
|
79
54
|
console.log('Checking dependencies...');
|
|
80
|
-
const sudoUser =
|
|
55
|
+
const sudoUser = (0, run_as_user_1.getSudoUser)();
|
|
81
56
|
if (sudoUser) {
|
|
82
57
|
console.log(chalk_1.default.gray(`Running under sudo - package manager commands will execute as user: ${sudoUser}`));
|
|
83
58
|
}
|
|
@@ -26,6 +26,8 @@ export interface ApplicationService {
|
|
|
26
26
|
authModes?: Array<'none' | 'org' | 'api-key'>;
|
|
27
27
|
requireOrgAuth?: boolean;
|
|
28
28
|
allowedOrganizations?: string[];
|
|
29
|
+
/** Application IDs this application depends on (e.g. open-webui depends on ollama-api). */
|
|
30
|
+
dependsOnApplicationIds?: string[];
|
|
29
31
|
}): Promise<unknown>;
|
|
30
32
|
listApiKeys(applicationId: string): Promise<any[]>;
|
|
31
33
|
createApiKey(applicationId: string, name: string, expiresAt?: string): Promise<any>;
|
|
@@ -63,6 +65,7 @@ export declare class ApplicationServiceImpl implements ApplicationService {
|
|
|
63
65
|
authModes?: Array<'none' | 'org' | 'api-key'>;
|
|
64
66
|
requireOrgAuth?: boolean;
|
|
65
67
|
allowedOrganizations?: string[];
|
|
68
|
+
dependsOnApplicationIds?: string[];
|
|
66
69
|
}): Promise<unknown>;
|
|
67
70
|
/**
|
|
68
71
|
* List API keys for an application
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationService.d.ts","sourceRoot":"","sources":["../../../src/services/application/ApplicationService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,CACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,EAC1C,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAAC;IACxB,eAAe,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1C,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,iCAAiC,CAAC,MAAM,EAAE;QACxC,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC;QAC3C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,OAAO,EAAE,mBAAmB,GAAG,gBAAgB,GAAG,SAAS,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;QACnG,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACxC,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,CAAC;QAC9C,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ApplicationService.d.ts","sourceRoot":"","sources":["../../../src/services/application/ApplicationService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,CACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,Q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MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWvE;;OAEG;IACG,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAY3D;;OAEG;IACG,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAY9G;;OAEG;IACG,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAYxF;;OAEG;IACG,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAU5E"}
|
|
@@ -290,6 +290,9 @@ class ApplicationServiceImpl {
|
|
|
290
290
|
if (params.allowedOrganizations !== undefined && params.allowedOrganizations.length > 0) {
|
|
291
291
|
createRequest.allowedOrganizations = params.allowedOrganizations;
|
|
292
292
|
}
|
|
293
|
+
if (params.dependsOnApplicationIds !== undefined && params.dependsOnApplicationIds.length > 0) {
|
|
294
|
+
createRequest.dependsOnApplicationIds = params.dependsOnApplicationIds;
|
|
295
|
+
}
|
|
293
296
|
console.log(`application: ${params}`);
|
|
294
297
|
const response = await this.apiClient.createApplication(createRequest);
|
|
295
298
|
return response.application;
|
|
@@ -3,6 +3,7 @@ export interface CreateOrganizationRequest {
|
|
|
3
3
|
rootUserEmail: string;
|
|
4
4
|
description?: string;
|
|
5
5
|
billingOrganizationId?: string;
|
|
6
|
+
urlAlias?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface DeleteOrganizationRequest {
|
|
8
9
|
organizationId: string;
|
|
@@ -127,6 +128,10 @@ export interface CreateApplicationRequest {
|
|
|
127
128
|
allowedOrganizations?: string[];
|
|
128
129
|
/** Custom headers to add to requests before forwarding to the application */
|
|
129
130
|
customHeaders?: Record<string, string>;
|
|
131
|
+
/** Target state of the application - 'running' or 'suspended' */
|
|
132
|
+
targetState?: 'running' | 'suspended';
|
|
133
|
+
/** Application IDs this application depends on. If any are not deployed, target state is set to suspended. */
|
|
134
|
+
dependsOnApplicationIds?: string[];
|
|
130
135
|
}
|
|
131
136
|
export interface DeleteApplicationRequest {
|
|
132
137
|
applicationId: string;
|
|
@@ -136,6 +141,9 @@ export interface UpdateApplicationRequest {
|
|
|
136
141
|
name?: string;
|
|
137
142
|
description?: string;
|
|
138
143
|
allowedSourceIPs?: string[];
|
|
144
|
+
targetState?: 'running' | 'suspended';
|
|
145
|
+
/** Application IDs this application depends on. If any are not deployed, target state is set to suspended. */
|
|
146
|
+
dependsOnApplicationIds?: string[];
|
|
139
147
|
}
|
|
140
148
|
export interface GetApplicationRequest {
|
|
141
149
|
applicationId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiRequests.d.ts","sourceRoot":"","sources":["../../src/types/ApiRequests.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ApiRequests.d.ts","sourceRoot":"","sources":["../../src/types/ApiRequests.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,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M,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,mCAAmC;IAClD,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -20,6 +20,28 @@ export interface ApplicationData {
|
|
|
20
20
|
gatewayIds: string[];
|
|
21
21
|
devicePoolId?: string;
|
|
22
22
|
subtype: 'local-preexisting' | 'managed-docker' | 'systemd' | 'docker-compose' | 'managed-process';
|
|
23
|
+
/**
|
|
24
|
+
* Target state of the application.
|
|
25
|
+
* - 'running': Application should be deployed and running on assigned devices
|
|
26
|
+
* - 'suspended': Application config/networking initialized but not started
|
|
27
|
+
*
|
|
28
|
+
* Agents will initialize suspended apps (WireGuard, routes, firewall) but won't start
|
|
29
|
+
* the actual process/service. This allows fast resume and maintains tracking.
|
|
30
|
+
*
|
|
31
|
+
* Defaults to 'running' if not specified (for backward compatibility).
|
|
32
|
+
*/
|
|
33
|
+
targetState?: 'running' | 'suspended';
|
|
34
|
+
/**
|
|
35
|
+
* Application IDs this application depends on (e.g. API depends on database).
|
|
36
|
+
* When any dependency is not deployed, this app's target state is set to suspended.
|
|
37
|
+
* When all dependencies become deployed, this app's target state is set to running.
|
|
38
|
+
*/
|
|
39
|
+
dependsOnApplicationIds?: string[];
|
|
40
|
+
/**
|
|
41
|
+
* Application IDs that depend on this application (inverse of dependsOnApplicationIds).
|
|
42
|
+
* Maintained by the backend when other applications set or change their dependsOnApplicationIds.
|
|
43
|
+
*/
|
|
44
|
+
dependentApplicationIds?: string[];
|
|
23
45
|
deviceApplicationConfigs?: Record<string, DeviceApplicationConfig>;
|
|
24
46
|
/**
|
|
25
47
|
* IP addresses or CIDR blocks that are allowed to access this application.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationData.d.ts","sourceRoot":"","sources":["../../../src/types/models/ApplicationData.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,mBAAmB,GAAG,gBAAgB,GAAG,SAAS,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;IACnG,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IACnE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC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AC3E,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAE;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IAGF,YAAY,CAAC,EAAE;QACb,gBAAgB,EAAE,OAAO,CAAC;QAC1B,cAAc,EAAE,OAAO,CAAC;QACxB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB"}
|
|
1
|
+
{"version":3,"file":"ApplicationData.d.ts","sourceRoot":"","sources":["../../../src/types/models/ApplicationData.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,E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,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gBAAgB,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC1C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC9C,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -4,26 +4,32 @@ export declare const CreateOrganizationSchema: z.ZodObject<{
|
|
|
4
4
|
rootUserEmail: z.ZodString;
|
|
5
5
|
description: z.ZodOptional<z.ZodString>;
|
|
6
6
|
billingOrganizationId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
urlAlias: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
7
8
|
}, "strip", z.ZodTypeAny, {
|
|
8
9
|
name: string;
|
|
9
10
|
rootUserEmail: string;
|
|
10
11
|
description?: string | undefined;
|
|
11
12
|
billingOrganizationId?: string | undefined;
|
|
13
|
+
urlAlias?: string | undefined;
|
|
12
14
|
}, {
|
|
13
15
|
name: string;
|
|
14
16
|
rootUserEmail: string;
|
|
15
17
|
description?: string | undefined;
|
|
16
18
|
billingOrganizationId?: string | undefined;
|
|
19
|
+
urlAlias?: string | undefined;
|
|
17
20
|
}>;
|
|
18
21
|
export declare const UpdateOrganizationSchema: z.ZodObject<{
|
|
19
22
|
name: z.ZodOptional<z.ZodString>;
|
|
20
23
|
description: z.ZodOptional<z.ZodString>;
|
|
24
|
+
urlAlias: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
21
25
|
}, "strip", z.ZodTypeAny, {
|
|
22
26
|
name?: string | undefined;
|
|
23
27
|
description?: string | undefined;
|
|
28
|
+
urlAlias?: string | undefined;
|
|
24
29
|
}, {
|
|
25
30
|
name?: string | undefined;
|
|
26
31
|
description?: string | undefined;
|
|
32
|
+
urlAlias?: string | undefined;
|
|
27
33
|
}>;
|
|
28
34
|
export declare const GetOrganizationSchema: z.ZodObject<{
|
|
29
35
|
organizationId: z.ZodString;
|
|
@@ -119,6 +125,8 @@ export declare const CreateApplicationSchema: z.ZodObject<{
|
|
|
119
125
|
requireOrgAuth: z.ZodOptional<z.ZodBoolean>;
|
|
120
126
|
allowedOrganizations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
121
127
|
customHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
128
|
+
targetState: z.ZodDefault<z.ZodEnum<["running", "suspended"]>>;
|
|
129
|
+
dependsOnApplicationIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
122
130
|
}, "strip", z.ZodTypeAny, {
|
|
123
131
|
organizationId: string;
|
|
124
132
|
name: string;
|
|
@@ -137,6 +145,7 @@ export declare const CreateApplicationSchema: z.ZodObject<{
|
|
|
137
145
|
subtype: "systemd" | "local-preexisting" | "managed-docker" | "docker-compose" | "managed-process";
|
|
138
146
|
environment: "development" | "staging" | "prod";
|
|
139
147
|
deviceIds: string[];
|
|
148
|
+
targetState: "running" | "suspended";
|
|
140
149
|
description?: string | undefined;
|
|
141
150
|
gatewayIds?: string[] | undefined;
|
|
142
151
|
hostnames?: string[] | undefined;
|
|
@@ -145,6 +154,7 @@ export declare const CreateApplicationSchema: z.ZodObject<{
|
|
|
145
154
|
requireOrgAuth?: boolean | undefined;
|
|
146
155
|
allowedOrganizations?: string[] | undefined;
|
|
147
156
|
customHeaders?: Record<string, string> | undefined;
|
|
157
|
+
dependsOnApplicationIds?: string[] | undefined;
|
|
148
158
|
}, {
|
|
149
159
|
organizationId: string;
|
|
150
160
|
name: string;
|
|
@@ -171,6 +181,8 @@ export declare const CreateApplicationSchema: z.ZodObject<{
|
|
|
171
181
|
requireOrgAuth?: boolean | undefined;
|
|
172
182
|
allowedOrganizations?: string[] | undefined;
|
|
173
183
|
customHeaders?: Record<string, string> | undefined;
|
|
184
|
+
targetState?: "running" | "suspended" | undefined;
|
|
185
|
+
dependsOnApplicationIds?: string[] | undefined;
|
|
174
186
|
}>;
|
|
175
187
|
export declare const UpdateApplicationSchema: z.ZodObject<{
|
|
176
188
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -180,6 +192,8 @@ export declare const UpdateApplicationSchema: z.ZodObject<{
|
|
|
180
192
|
authModes: z.ZodOptional<z.ZodArray<z.ZodEnum<["none", "org", "api-key"]>, "many">>;
|
|
181
193
|
allowedOrganizations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
182
194
|
customHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
195
|
+
targetState: z.ZodOptional<z.ZodEnum<["running", "suspended"]>>;
|
|
196
|
+
dependsOnApplicationIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
183
197
|
}, "strip", z.ZodTypeAny, {
|
|
184
198
|
name?: string | undefined;
|
|
185
199
|
description?: string | undefined;
|
|
@@ -187,6 +201,8 @@ export declare const UpdateApplicationSchema: z.ZodObject<{
|
|
|
187
201
|
authModes?: ("none" | "org" | "api-key")[] | undefined;
|
|
188
202
|
allowedOrganizations?: string[] | undefined;
|
|
189
203
|
customHeaders?: Record<string, string> | undefined;
|
|
204
|
+
targetState?: "running" | "suspended" | undefined;
|
|
205
|
+
dependsOnApplicationIds?: string[] | undefined;
|
|
190
206
|
allowedSourceIPs?: string[] | undefined;
|
|
191
207
|
}, {
|
|
192
208
|
name?: string | undefined;
|
|
@@ -195,6 +211,8 @@ export declare const UpdateApplicationSchema: z.ZodObject<{
|
|
|
195
211
|
authModes?: ("none" | "org" | "api-key")[] | undefined;
|
|
196
212
|
allowedOrganizations?: string[] | undefined;
|
|
197
213
|
customHeaders?: Record<string, string> | undefined;
|
|
214
|
+
targetState?: "running" | "suspended" | undefined;
|
|
215
|
+
dependsOnApplicationIds?: string[] | undefined;
|
|
198
216
|
allowedSourceIPs?: string[] | undefined;
|
|
199
217
|
}>;
|
|
200
218
|
export declare const GetApplicationSchema: z.ZodObject<{
|
|
@@ -286,7 +304,7 @@ export declare const UpdateDeviceSchema: z.ZodObject<{
|
|
|
286
304
|
ipAddress: z.ZodOptional<z.ZodString>;
|
|
287
305
|
}, "strip", z.ZodTypeAny, {
|
|
288
306
|
name?: string | undefined;
|
|
289
|
-
status?: "
|
|
307
|
+
status?: "suspended" | "active" | "inactive" | "pending" | undefined;
|
|
290
308
|
type?: "gateway" | "laptop" | "desktop" | "mobile" | "tablet" | "server" | undefined;
|
|
291
309
|
description?: string | undefined;
|
|
292
310
|
os?: string | undefined;
|
|
@@ -296,7 +314,7 @@ export declare const UpdateDeviceSchema: z.ZodObject<{
|
|
|
296
314
|
isTrusted?: boolean | undefined;
|
|
297
315
|
}, {
|
|
298
316
|
name?: string | undefined;
|
|
299
|
-
status?: "
|
|
317
|
+
status?: "suspended" | "active" | "inactive" | "pending" | undefined;
|
|
300
318
|
type?: "gateway" | "laptop" | "desktop" | "mobile" | "tablet" | "server" | undefined;
|
|
301
319
|
description?: string | undefined;
|
|
302
320
|
os?: string | undefined;
|
|
@@ -497,7 +515,7 @@ export declare const CreateResourceSchema: z.ZodObject<{
|
|
|
497
515
|
name: string;
|
|
498
516
|
resourceType: string;
|
|
499
517
|
organizationId?: string | undefined;
|
|
500
|
-
status?: "
|
|
518
|
+
status?: "running" | "pending" | "stopped" | "error" | undefined;
|
|
501
519
|
type?: string | undefined;
|
|
502
520
|
description?: string | undefined;
|
|
503
521
|
region?: string | undefined;
|
|
@@ -509,7 +527,7 @@ export declare const CreateResourceSchema: z.ZodObject<{
|
|
|
509
527
|
name: string;
|
|
510
528
|
resourceType: string;
|
|
511
529
|
organizationId?: string | undefined;
|
|
512
|
-
status?: "
|
|
530
|
+
status?: "running" | "pending" | "stopped" | "error" | undefined;
|
|
513
531
|
type?: string | undefined;
|
|
514
532
|
description?: string | undefined;
|
|
515
533
|
region?: string | undefined;
|
|
@@ -527,14 +545,14 @@ export declare const UpdateResourceSchema: z.ZodObject<{
|
|
|
527
545
|
region: z.ZodOptional<z.ZodString>;
|
|
528
546
|
}, "strip", z.ZodTypeAny, {
|
|
529
547
|
name?: string | undefined;
|
|
530
|
-
status?: "
|
|
548
|
+
status?: "running" | "pending" | "stopped" | "error" | undefined;
|
|
531
549
|
description?: string | undefined;
|
|
532
550
|
region?: string | undefined;
|
|
533
551
|
tags?: string[] | undefined;
|
|
534
552
|
cost?: number | undefined;
|
|
535
553
|
}, {
|
|
536
554
|
name?: string | undefined;
|
|
537
|
-
status?: "
|
|
555
|
+
status?: "running" | "pending" | "stopped" | "error" | undefined;
|
|
538
556
|
description?: string | undefined;
|
|
539
557
|
region?: string | undefined;
|
|
540
558
|
tags?: string[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/types/validation/schemas.ts"],"names":[],"mappings":"AAGE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","s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AAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAC3F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0CAA0C,CAAC,CAAC"}
|
|
@@ -4,16 +4,32 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.CreateLifecycleEventSchema = exports.PostDevicePoolTrafficSchema = exports.CheckApplicationReachabilitySchema = exports.GetResourceSchema = exports.UpdateResourceSchema = exports.CreateResourceSchema = exports.CreateDeviceWithOrphanedOrganizationSchema = exports.GetChallengeSessionSchema = exports.ForceChangePasswordSchema = exports.RefreshTokenSchema = exports.AuthenticateSchema = exports.LinkOrganizationSchema = exports.UpdateResourceLimitsSchema = exports.CreateBillingOrganizationSchema = exports.AdoptOrganizationSchema = exports.CancelInviteSchema = exports.DeclineInviteSchema = exports.AcceptInviteSchema = exports.CreateOrganizationInviteSchema = exports.GetDeviceSchema = exports.UpdateDeviceSchema = exports.CreateDeviceSchema = exports.RefreshCertificatePathSchema = exports.GetCertificatePathSchema = exports.GetCertificatesPathSchema = exports.GetApplicationSchema = exports.UpdateApplicationSchema = exports.CreateApplicationSchema = exports.GetUserSchema = exports.UpdateUserSchema = exports.CreateUserSchema = exports.GetOrganizationSchema = exports.UpdateOrganizationSchema = exports.CreateOrganizationSchema = void 0;
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
|
+
// Reserved URL aliases that cannot be used
|
|
8
|
+
const RESERVED_ALIASES = [
|
|
9
|
+
'api', 'www', 'admin', 'app', 'apps', 'gateway', 'gateways',
|
|
10
|
+
'device', 'devices', 'user', 'users', 'auth', 'login', 'signup',
|
|
11
|
+
'dashboard', 'console', 'portal', 'system', 'internal', 'staging',
|
|
12
|
+
'prod', 'production', 'dev', 'development', 'test', 'testing',
|
|
13
|
+
'v1', 'v2', 'v3', 'static', 'cdn', 'assets', 'public'
|
|
14
|
+
];
|
|
15
|
+
// URL alias validation: lowercase alphanumeric + hyphens, 3-30 chars
|
|
16
|
+
const UrlAliasSchema = zod_1.z.string()
|
|
17
|
+
.min(3, 'URL alias must be at least 3 characters')
|
|
18
|
+
.max(30, 'URL alias must be 30 characters or less')
|
|
19
|
+
.regex(/^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$/, 'URL alias must be lowercase alphanumeric with hyphens, cannot start/end with hyphen')
|
|
20
|
+
.refine((val) => !RESERVED_ALIASES.includes(val), 'This alias is reserved and cannot be used');
|
|
7
21
|
// Organization validation schemas
|
|
8
22
|
exports.CreateOrganizationSchema = zod_1.z.object({
|
|
9
23
|
name: zod_1.z.string().min(1, 'Name is required').max(100, 'Name must be 100 characters or less'),
|
|
10
24
|
rootUserEmail: zod_1.z.string().email('Invalid email format'),
|
|
11
25
|
description: zod_1.z.string().max(500, 'Description must be 500 characters or less').optional(),
|
|
12
26
|
billingOrganizationId: zod_1.z.string().min(1, 'Billing organization ID must be provided if specified').optional(),
|
|
27
|
+
urlAlias: UrlAliasSchema.optional(),
|
|
13
28
|
});
|
|
14
29
|
exports.UpdateOrganizationSchema = zod_1.z.object({
|
|
15
30
|
name: zod_1.z.string().min(1).max(100).optional(),
|
|
16
31
|
description: zod_1.z.string().max(500).optional(),
|
|
32
|
+
urlAlias: UrlAliasSchema.optional(),
|
|
17
33
|
});
|
|
18
34
|
exports.GetOrganizationSchema = zod_1.z.object({
|
|
19
35
|
organizationId: zod_1.z.string().min(1, 'Organization ID is required'),
|
|
@@ -74,6 +90,8 @@ exports.CreateApplicationSchema = zod_1.z.object({
|
|
|
74
90
|
requireOrgAuth: zod_1.z.boolean().optional(), // deprecated, use authModes
|
|
75
91
|
allowedOrganizations: zod_1.z.array(zod_1.z.string()).optional(),
|
|
76
92
|
customHeaders: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
93
|
+
targetState: zod_1.z.enum(['running', 'suspended']).default('running'),
|
|
94
|
+
dependsOnApplicationIds: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
77
95
|
});
|
|
78
96
|
// IP address or CIDR block validation
|
|
79
97
|
const IPOrCIDRSchema = zod_1.z.string().regex(/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\/(?:[0-9]|[1-2][0-9]|3[0-2]))?$/, 'Invalid IP address or CIDR block (e.g., 192.168.1.0/24 or 10.0.0.1)');
|
|
@@ -85,6 +103,8 @@ exports.UpdateApplicationSchema = zod_1.z.object({
|
|
|
85
103
|
authModes: zod_1.z.array(zod_1.z.enum(['none', 'org', 'api-key'])).optional(),
|
|
86
104
|
allowedOrganizations: zod_1.z.array(zod_1.z.string()).optional(),
|
|
87
105
|
customHeaders: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
106
|
+
targetState: zod_1.z.enum(['running', 'suspended']).optional(),
|
|
107
|
+
dependsOnApplicationIds: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
88
108
|
});
|
|
89
109
|
exports.GetApplicationSchema = zod_1.z.object({
|
|
90
110
|
applicationId: zod_1.z.string().min(1, 'Application ID is required'),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ExecSyncOptions } from 'child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Utilities to run commands as the real (non-root) user when the process was
|
|
4
|
+
* started with sudo. Ensures tools like Homebrew install under the user's
|
|
5
|
+
* account rather than root.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Get the original user when running under sudo.
|
|
9
|
+
* @returns SUDO_USER if process is root via sudo, otherwise undefined
|
|
10
|
+
*/
|
|
11
|
+
export declare function getSudoUser(): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Execute a command as the original user when executed via sudo.
|
|
14
|
+
* Uses: sudo -u ${SUDO_USER} HOME=$(eval echo ~${SUDO_USER}) <command>
|
|
15
|
+
*
|
|
16
|
+
* Important for Homebrew on macOS: brew refuses to run as root and installs
|
|
17
|
+
* should go to the user's prefix (e.g. /opt/homebrew or ~/.local) not root's.
|
|
18
|
+
*
|
|
19
|
+
* @param command The command to execute
|
|
20
|
+
* @param options Optional execSync options (e.g. stdio: 'inherit' for interactive)
|
|
21
|
+
* @returns Result of execSync
|
|
22
|
+
*/
|
|
23
|
+
export declare function execAsRealUser(command: string, options?: ExecSyncOptions): Buffer | string;
|
|
24
|
+
//# sourceMappingURL=run-as-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-as-user.d.ts","sourceRoot":"","sources":["../../src/utils/run-as-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAE,MAAM,eAAe,CAAC;AAE1D;;;;GAIG;AAEH;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAShD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,MAAM,CAS1F"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSudoUser = getSudoUser;
|
|
4
|
+
exports.execAsRealUser = execAsRealUser;
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
/**
|
|
7
|
+
* Utilities to run commands as the real (non-root) user when the process was
|
|
8
|
+
* started with sudo. Ensures tools like Homebrew install under the user's
|
|
9
|
+
* account rather than root.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Get the original user when running under sudo.
|
|
13
|
+
* @returns SUDO_USER if process is root via sudo, otherwise undefined
|
|
14
|
+
*/
|
|
15
|
+
function getSudoUser() {
|
|
16
|
+
const uid = process.getuid ? process.getuid() : undefined;
|
|
17
|
+
const sudoUser = process.env['SUDO_USER'];
|
|
18
|
+
if (uid === 0 && sudoUser) {
|
|
19
|
+
return sudoUser;
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Execute a command as the original user when executed via sudo.
|
|
25
|
+
* Uses: sudo -u ${SUDO_USER} HOME=$(eval echo ~${SUDO_USER}) <command>
|
|
26
|
+
*
|
|
27
|
+
* Important for Homebrew on macOS: brew refuses to run as root and installs
|
|
28
|
+
* should go to the user's prefix (e.g. /opt/homebrew or ~/.local) not root's.
|
|
29
|
+
*
|
|
30
|
+
* @param command The command to execute
|
|
31
|
+
* @param options Optional execSync options (e.g. stdio: 'inherit' for interactive)
|
|
32
|
+
* @returns Result of execSync
|
|
33
|
+
*/
|
|
34
|
+
function execAsRealUser(command, options) {
|
|
35
|
+
const sudoUser = getSudoUser();
|
|
36
|
+
if (sudoUser) {
|
|
37
|
+
const wrappedCommand = `sudo -u ${sudoUser} HOME=$(eval echo ~${sudoUser}) ${command}`;
|
|
38
|
+
return (0, child_process_1.execSync)(wrappedCommand, options);
|
|
39
|
+
}
|
|
40
|
+
return (0, child_process_1.execSync)(command, options);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=run-as-user.js.map
|