podkeeper 0.7.0 → 0.8.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.
|
Binary file
|
|
Binary file
|
package/lib/genericService.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { setTimeout } from "timers/promises";
|
|
2
2
|
import { WebSocket } from "ws";
|
|
3
3
|
import * as dockerApi from "./dockerApi.js";
|
|
4
|
+
import fs from "fs";
|
|
4
5
|
import path from "path";
|
|
5
6
|
import url from "url";
|
|
6
7
|
const __filename = url.fileURLToPath(import.meta.url);
|
|
@@ -34,6 +35,8 @@ class GenericService {
|
|
|
34
35
|
const entrypoint = ["/deadmanswitch"];
|
|
35
36
|
const command = [metadata.Config.Entrypoint, options.command ?? metadata.Config.Cmd].flat();
|
|
36
37
|
const deadmanswitchName = imageArch === "arm64" ? "deadmanswitch_linux_aarch64" : "deadmanswitch_linux_x86_64";
|
|
38
|
+
const deadmanswitchPath = path.join(__dirname, "..", "deadmanswitch", "bin", deadmanswitchName);
|
|
39
|
+
fs.chmodSync(deadmanswitchPath, 493);
|
|
37
40
|
const usedPorts = new Set((options.ports ?? []).map((port) => port.container));
|
|
38
41
|
let switchPort = 54321;
|
|
39
42
|
while (usedPorts.has(switchPort))
|
|
@@ -43,7 +46,7 @@ class GenericService {
|
|
|
43
46
|
autoRemove: true,
|
|
44
47
|
binds: [
|
|
45
48
|
...options.binds ?? [],
|
|
46
|
-
{ containerPath: "/deadmanswitch", hostPath:
|
|
49
|
+
{ containerPath: "/deadmanswitch", hostPath: deadmanswitchPath }
|
|
47
50
|
],
|
|
48
51
|
ports: [
|
|
49
52
|
...options.ports ?? [],
|