witnora 0.20.5 → 0.20.6
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/cli.js +10 -2
- package/dist/gateway-service.js +7 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -41,7 +41,7 @@ import { inspectRepository } from "./onboard.js";
|
|
|
41
41
|
import { renderReleaseEvaluation, runReleaseEvaluation } from "./release-evaluation.js";
|
|
42
42
|
import { runPrivateCapabilityDiscovery } from "./private-discovery.js";
|
|
43
43
|
import { configureManagedWorkflowHarness, doctorCustomerGateway, initializeCustomerGateway, isGatewayDoctorReady, readManagedCustomerGatewayLogs, renderGatewayDoctor, renderManagedGatewayStatus, restartManagedCustomerGateway, runCustomerGateway, startManagedCustomerGateway, statusManagedCustomerGateway, stopManagedCustomerGateway, superviseManagedCustomerGateway, } from "./gateway.js";
|
|
44
|
-
import { installCurrentGatewayService, uninstallCurrentGatewayService } from "./gateway-service.js";
|
|
44
|
+
import { installCurrentGatewayService, stopCurrentGatewayOwners, uninstallCurrentGatewayService } from "./gateway-service.js";
|
|
45
45
|
import { verifyEvidencePacketV02 } from "./evidence-v02.js";
|
|
46
46
|
process.on("uncaughtException", reportFatalError);
|
|
47
47
|
process.on("unhandledRejection", reportFatalError);
|
|
@@ -265,7 +265,15 @@ else if (command === "gateway") {
|
|
|
265
265
|
await superviseManagedCustomerGateway({ repository: readFlag("--repo") ?? process.cwd(), dir: readFlag("--dir"), configHome: readFlag("--config-home"), serviceLeasePath: readFlag("--service-lease"), serviceGeneration: readFlag("--service-generation"), output: (message) => process.stdout.write(message) });
|
|
266
266
|
}
|
|
267
267
|
else if (action === "stop") {
|
|
268
|
-
const
|
|
268
|
+
const repository = readFlag("--repo") ?? process.cwd();
|
|
269
|
+
const dir = readFlag("--dir");
|
|
270
|
+
const configHome = readFlag("--config-home");
|
|
271
|
+
const result = await stopCurrentGatewayOwners({
|
|
272
|
+
repository,
|
|
273
|
+
gatewayDirectory: dir,
|
|
274
|
+
cliEntry: fileURLToPath(import.meta.url),
|
|
275
|
+
configHome,
|
|
276
|
+
}, () => stopManagedCustomerGateway({ repository, dir, configHome }));
|
|
269
277
|
process.stdout.write(readBoolFlag("--json") ? `${JSON.stringify(result, null, 2)}\n` : renderManagedGatewayStatus(result));
|
|
270
278
|
}
|
|
271
279
|
else if (action === "run") {
|
package/dist/gateway-service.js
CHANGED
|
@@ -78,6 +78,13 @@ export async function stopCurrentGatewayService(options) {
|
|
|
78
78
|
}
|
|
79
79
|
return plan;
|
|
80
80
|
}
|
|
81
|
+
export async function stopCurrentGatewayOwners(options, stopManagedGateway) {
|
|
82
|
+
await stopCurrentGatewayService(options);
|
|
83
|
+
const result = await stopManagedGateway();
|
|
84
|
+
if (result.healthy)
|
|
85
|
+
throw new Error("The customer-owned Gateway remained healthy after its operating-system supervisor was stopped.");
|
|
86
|
+
return result.stopped ? result : { ...result, stopped: true };
|
|
87
|
+
}
|
|
81
88
|
export function createGatewayServicePlan(input) {
|
|
82
89
|
const suffix = createHash("sha256").update(`${input.repository}\n${input.gatewayDirectory}`).digest("hex").slice(0, 12);
|
|
83
90
|
const id = `witnora-gateway-${suffix}`;
|