@zitadel/server 0.1.0-alpha.8 → 1.0.0-alpha.20
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/bin/zitadel-server.js +18 -0
- package/package.json +6 -6
package/bin/zitadel-server.js
CHANGED
|
@@ -65,6 +65,7 @@ export function ensureExecutable(binaryPath, platform = process.platform) {
|
|
|
65
65
|
export async function main(args = process.argv.slice(2)) {
|
|
66
66
|
const binaryPath = resolveServerBinary();
|
|
67
67
|
const child = spawn(binaryPath, args, { stdio: "inherit" });
|
|
68
|
+
forwardShutdownSignals(child);
|
|
68
69
|
child.on("error", (error) => {
|
|
69
70
|
console.error(error instanceof Error ? error.message : String(error));
|
|
70
71
|
process.exit(1);
|
|
@@ -78,6 +79,23 @@ export async function main(args = process.argv.slice(2)) {
|
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
export function forwardShutdownSignals(child, proc = process) {
|
|
83
|
+
const forward = (signal) => {
|
|
84
|
+
if (child.exitCode !== null || child.signalCode !== null) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
child.kill(signal);
|
|
88
|
+
};
|
|
89
|
+
const onTerm = () => forward("SIGTERM");
|
|
90
|
+
const onInt = () => forward("SIGINT");
|
|
91
|
+
proc.once("SIGTERM", onTerm);
|
|
92
|
+
proc.once("SIGINT", onInt);
|
|
93
|
+
child.once("exit", () => {
|
|
94
|
+
proc.off("SIGTERM", onTerm);
|
|
95
|
+
proc.off("SIGINT", onInt);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
81
99
|
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
82
100
|
try {
|
|
83
101
|
await main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zitadel/server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-alpha.20",
|
|
4
4
|
"description": "Zitadel server binary launcher.",
|
|
5
5
|
"homepage": "https://github.com/zitadel/nextgen#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@zitadel/server-darwin-arm64": "
|
|
27
|
-
"@zitadel/server-
|
|
28
|
-
"@zitadel/server-
|
|
29
|
-
"@zitadel/server-
|
|
30
|
-
"@zitadel/server-linux-arm64": "
|
|
26
|
+
"@zitadel/server-darwin-arm64": "1.0.0-alpha.20",
|
|
27
|
+
"@zitadel/server-linux-x64": "1.0.0-alpha.20",
|
|
28
|
+
"@zitadel/server-win32-x64": "1.0.0-alpha.20",
|
|
29
|
+
"@zitadel/server-darwin-x64": "1.0.0-alpha.20",
|
|
30
|
+
"@zitadel/server-linux-arm64": "1.0.0-alpha.20"
|
|
31
31
|
}
|
|
32
32
|
}
|