node-lxc 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 +201 -0
- package/README.md +328 -0
- package/bin/x86_64-linux-gnu/node-lxc.node +0 -0
- package/examples/attach/index.ts +29 -0
- package/examples/attach-streams/index.ts +34 -0
- package/examples/checkpoint/index.ts +34 -0
- package/examples/clone/index.ts +34 -0
- package/examples/concurrent_create/index.ts +30 -0
- package/examples/concurrent_destroy/index.ts +23 -0
- package/examples/concurrent_shutdown/index.ts +28 -0
- package/examples/concurrent_start/index.ts +28 -0
- package/examples/concurrent_stop/index.ts +28 -0
- package/examples/config/index.ts +18 -0
- package/examples/console/index.ts +17 -0
- package/examples/console_async/index.ts +101 -0
- package/examples/create/index.ts +12 -0
- package/examples/create_snapshot/index.ts +10 -0
- package/examples/destroy/index.ts +10 -0
- package/examples/destroy_snapshots/index.ts +10 -0
- package/examples/device_add_remove/index.ts +11 -0
- package/examples/execute/index.ts +10 -0
- package/examples/freeze/index.ts +11 -0
- package/examples/images/index.ts +10 -0
- package/examples/interfaces/index.ts +10 -0
- package/examples/ipaddress/index.ts +12 -0
- package/examples/limit/index.ts +15 -0
- package/examples/list/index.ts +12 -0
- package/examples/list_keys/index.ts +10 -0
- package/examples/list_snapshots/index.ts +9 -0
- package/examples/reboot/index.ts +11 -0
- package/examples/rename/index.ts +11 -0
- package/examples/restore_snapshot/index.ts +11 -0
- package/examples/shutdown/index.ts +19 -0
- package/examples/start/index.ts +11 -0
- package/examples/stats/index.ts +48 -0
- package/examples/stop/index.ts +11 -0
- package/examples/unfreeze/index.ts +11 -0
- package/lib/binding.d.ts +6 -0
- package/lib/binding.js +32 -0
- package/lib/binding.js.map +1 -0
- package/lib/index.d.ts +612 -0
- package/lib/index.js +73 -0
- package/lib/index.js.map +1 -0
- package/lib/types/Image.d.ts +22 -0
- package/lib/types/Image.js +3 -0
- package/lib/types/Image.js.map +1 -0
- package/lib/types/LXC_ATTACH.d.ts +67 -0
- package/lib/types/LXC_ATTACH.js +72 -0
- package/lib/types/LXC_ATTACH.js.map +1 -0
- package/lib/types/LXC_CLONE.d.ts +34 -0
- package/lib/types/LXC_CLONE.js +39 -0
- package/lib/types/LXC_CLONE.js.map +1 -0
- package/lib/types/LXC_CREATE.d.ts +8 -0
- package/lib/types/LXC_CREATE.js +13 -0
- package/lib/types/LXC_CREATE.js.map +1 -0
- package/lib/types/LXC_LOGLEVEL.d.ts +15 -0
- package/lib/types/LXC_LOGLEVEL.js +20 -0
- package/lib/types/LXC_LOGLEVEL.js.map +1 -0
- package/lib/types/LXC_MIGRATE.d.ts +10 -0
- package/lib/types/LXC_MIGRATE.js +15 -0
- package/lib/types/LXC_MIGRATE.js.map +1 -0
- package/lib/types/LXC_MOUNT.d.ts +42 -0
- package/lib/types/LXC_MOUNT.js +45 -0
- package/lib/types/LXC_MOUNT.js.map +1 -0
- package/lib/types/Personality.d.ts +14 -0
- package/lib/types/Personality.js +19 -0
- package/lib/types/Personality.js.map +1 -0
- package/lib/types/bdev_specs.d.ts +48 -0
- package/lib/types/bdev_specs.js +3 -0
- package/lib/types/bdev_specs.js.map +1 -0
- package/lib/types/custom/ConsoleSession.d.ts +23 -0
- package/lib/types/custom/ConsoleSession.js +3 -0
- package/lib/types/custom/ConsoleSession.js.map +1 -0
- package/lib/types/custom/index.d.ts +1 -0
- package/lib/types/custom/index.js +18 -0
- package/lib/types/custom/index.js.map +1 -0
- package/lib/types/index.d.ts +20 -0
- package/lib/types/index.js +37 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/lxc_attach_env_policy.d.ts +8 -0
- package/lib/types/lxc_attach_env_policy.js +13 -0
- package/lib/types/lxc_attach_env_policy.js.map +1 -0
- package/lib/types/lxc_attach_options.d.ts +99 -0
- package/lib/types/lxc_attach_options.js +30 -0
- package/lib/types/lxc_attach_options.js.map +1 -0
- package/lib/types/lxc_clone_options.d.ts +52 -0
- package/lib/types/lxc_clone_options.js +7 -0
- package/lib/types/lxc_clone_options.js.map +1 -0
- package/lib/types/lxc_console_log.d.ts +10 -0
- package/lib/types/lxc_console_log.js +7 -0
- package/lib/types/lxc_console_log.js.map +1 -0
- package/lib/types/lxc_snapshot.d.ts +10 -0
- package/lib/types/lxc_snapshot.js +7 -0
- package/lib/types/lxc_snapshot.js.map +1 -0
- package/lib/types/migrate_opts.d.ts +17 -0
- package/lib/types/migrate_opts.js +7 -0
- package/lib/types/migrate_opts.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ConsoleSession";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ConsoleSession"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/types/custom/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAgC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author A.P.A. Slaa (a.p.a.slaa@projectsource.nl) ProjectSource V.O.F.
|
|
3
|
+
* @date 03-07-2024
|
|
4
|
+
*/
|
|
5
|
+
export * from "./bdev_specs";
|
|
6
|
+
export * from "./LXC_ATTACH";
|
|
7
|
+
export * from "./lxc_attach_env_policy";
|
|
8
|
+
export * from "./lxc_attach_options";
|
|
9
|
+
export * from "./LXC_CLONE";
|
|
10
|
+
export * from "./lxc_clone_options";
|
|
11
|
+
export * from "./lxc_console_log";
|
|
12
|
+
export * from "./LXC_CREATE";
|
|
13
|
+
export * from "./LXC_LOGLEVEL";
|
|
14
|
+
export * from "./LXC_MIGRATE";
|
|
15
|
+
export * from "./LXC_MOUNT";
|
|
16
|
+
export * from "./lxc_snapshot";
|
|
17
|
+
export * from "./migrate_opts";
|
|
18
|
+
export * from "./Personality";
|
|
19
|
+
export * from "./Image";
|
|
20
|
+
export * from "./custom";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author A.P.A. Slaa (a.p.a.slaa@projectsource.nl) ProjectSource V.O.F.
|
|
4
|
+
* @date 03-07-2024
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
__exportStar(require("./bdev_specs"), exports);
|
|
22
|
+
__exportStar(require("./LXC_ATTACH"), exports);
|
|
23
|
+
__exportStar(require("./lxc_attach_env_policy"), exports);
|
|
24
|
+
__exportStar(require("./lxc_attach_options"), exports);
|
|
25
|
+
__exportStar(require("./LXC_CLONE"), exports);
|
|
26
|
+
__exportStar(require("./lxc_clone_options"), exports);
|
|
27
|
+
__exportStar(require("./lxc_console_log"), exports);
|
|
28
|
+
__exportStar(require("./LXC_CREATE"), exports);
|
|
29
|
+
__exportStar(require("./LXC_LOGLEVEL"), exports);
|
|
30
|
+
__exportStar(require("./LXC_MIGRATE"), exports);
|
|
31
|
+
__exportStar(require("./LXC_MOUNT"), exports);
|
|
32
|
+
__exportStar(require("./lxc_snapshot"), exports);
|
|
33
|
+
__exportStar(require("./migrate_opts"), exports);
|
|
34
|
+
__exportStar(require("./Personality"), exports);
|
|
35
|
+
__exportStar(require("./Image"), exports);
|
|
36
|
+
__exportStar(require("./custom"), exports);
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/types/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,+CAA4B;AAC5B,+CAA4B;AAC5B,0DAAuC;AACvC,uDAAoC;AACpC,8CAA2B;AAC3B,sDAAmC;AACnC,oDAAiC;AACjC,+CAA4B;AAC5B,iDAA8B;AAC9B,gDAA6B;AAC7B,8CAA2B;AAC3B,iDAA8B;AAC9B,iDAA8B;AAC9B,gDAA6B;AAC7B,0CAAuB;AAEvB,2CAAwB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author A.P.A. Slaa (a.p.a.slaa@projectsource.nl) ProjectSource V.O.F.
|
|
4
|
+
* @date 03-07-2024
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.lxc_attach_env_policy = void 0;
|
|
8
|
+
var lxc_attach_env_policy;
|
|
9
|
+
(function (lxc_attach_env_policy) {
|
|
10
|
+
lxc_attach_env_policy[lxc_attach_env_policy["LXC_ATTACH_KEEP_ENV"] = 0] = "LXC_ATTACH_KEEP_ENV";
|
|
11
|
+
lxc_attach_env_policy[lxc_attach_env_policy["LXC_ATTACH_CLEAR_ENV"] = 1] = "LXC_ATTACH_CLEAR_ENV";
|
|
12
|
+
})(lxc_attach_env_policy || (exports.lxc_attach_env_policy = lxc_attach_env_policy = {}));
|
|
13
|
+
//# sourceMappingURL=lxc_attach_env_policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lxc_attach_env_policy.js","sourceRoot":"","sources":["../../../lib/types/lxc_attach_env_policy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC7B,+FAAuB,CAAA;IACvB,iGAAwB,CAAA;AAC5B,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author A.P.A. Slaa (a.p.a.slaa@projectsource.nl) ProjectSource V.O.F.
|
|
3
|
+
* @date 03-07-2024
|
|
4
|
+
*/
|
|
5
|
+
import { Personality } from "./Personality";
|
|
6
|
+
import { lxc_attach_env_policy } from "./lxc_attach_env_policy";
|
|
7
|
+
export type lxc_attach_options = ({
|
|
8
|
+
/**
|
|
9
|
+
* If ClearEnv is true, the environment is cleared before running the command.
|
|
10
|
+
*/
|
|
11
|
+
env_policy: lxc_attach_env_policy.LXC_ATTACH_CLEAR_ENV;
|
|
12
|
+
/**
|
|
13
|
+
* EnvToKeep specifies the environment of the process when ClearEnv is true.
|
|
14
|
+
*/
|
|
15
|
+
extra_keep_env: string[];
|
|
16
|
+
} | {
|
|
17
|
+
/**
|
|
18
|
+
* Retain the environment
|
|
19
|
+
*/
|
|
20
|
+
env_policy: lxc_attach_env_policy.LXC_ATTACH_KEEP_ENV;
|
|
21
|
+
}) & {
|
|
22
|
+
/**
|
|
23
|
+
* Any combination of LXC_ATTACH_* flags
|
|
24
|
+
* @link [https://linuxcontainers.org/apidocs](https://linuxcontainers.org/lxc/apidoc/structlxc__attach__options__t.html#a14f47c7faff4c413e05d4b0fa3e2fa6f)
|
|
25
|
+
*/
|
|
26
|
+
attach_flags: number;
|
|
27
|
+
/**
|
|
28
|
+
* Specify the namespaces to attach to, as OR'ed list of clone flags (syscall.CLONE_NEWNS | syscall.CLONE_NEWUTS ...).
|
|
29
|
+
* @link [https://linuxcontainers.org/apidocs](https://linuxcontainers.org/lxc/apidoc/structlxc__attach__options__t.html#a80a7d14f141d44e92cab818a473a51e4)
|
|
30
|
+
*/
|
|
31
|
+
namespaces: number;
|
|
32
|
+
/**
|
|
33
|
+
* Specify the architecture which the kernel should appear to be running as to the command executed.
|
|
34
|
+
* Initial personality (LXC_ATTACH_DETECT_PERSONALITY to autodetect).
|
|
35
|
+
* @warning This may be ignored if lxc is compiled without personality support)
|
|
36
|
+
* @link [https://linuxcontainers.org/apidocs](https://linuxcontainers.org/lxc/apidoc/structlxc__attach__options__t.html#a22232139102062bcf18e1f7ae6aea17d)
|
|
37
|
+
*/
|
|
38
|
+
personality: Personality | -1 | bigint;
|
|
39
|
+
/**
|
|
40
|
+
* If the current directory does not exist in the container, the root directory will be used instead because of kernel defaults.
|
|
41
|
+
* @link [https://linuxcontainers.org/apidocs](https://linuxcontainers.org/lxc/apidoc/structlxc__attach__options__t.html#ab6a000a4ac27f2ec3d861c55499eaff2)
|
|
42
|
+
*/
|
|
43
|
+
initial_cwd?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* UID specifies the user id to run as.
|
|
46
|
+
* @note Set to -1 for default behaviour (init uid for userns containers or 0 (super-user) if detection fails).
|
|
47
|
+
* @link [https://linuxcontainers.org/apidocs](https://linuxcontainers.org/lxc/apidoc/structlxc__attach__options__t.html#a8a62e9318622bc396fdd24ab1a89bf60)
|
|
48
|
+
*/
|
|
49
|
+
uid?: number;
|
|
50
|
+
/**
|
|
51
|
+
* GID specifies the group id to run as.
|
|
52
|
+
* @link [https://linuxcontainers.org/apidocs](https://linuxcontainers.org/lxc/apidoc/structlxc__attach__options__t.html#a7e54d34f03a8a366ff3a64306fd61dfe)
|
|
53
|
+
* @note Set to -1 for default behaviour (init gid for userns containers or 0 (super-user) if detection fails).
|
|
54
|
+
*/
|
|
55
|
+
gid?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Groups specifies the list of additional group ids to run with.
|
|
58
|
+
* The additional group GIDs to run with.
|
|
59
|
+
* If unset all additional groups are dropped.
|
|
60
|
+
* @link [](https://linuxcontainers.org/lxc/apidoc/structlxc__attach__options__t.html#af71a28922efb5b4003c20cec759b68fd)
|
|
61
|
+
*/
|
|
62
|
+
groups?: number[];
|
|
63
|
+
/**
|
|
64
|
+
* [stdinfd, stdoutfd, stderrfd]
|
|
65
|
+
* stdinfd: specifies the fd to read input from.
|
|
66
|
+
* stdoutdf: specifies the fd to write output to.
|
|
67
|
+
* stderrfd: specifies the fd to write error output to.
|
|
68
|
+
*/
|
|
69
|
+
stdio: [number, number, number];
|
|
70
|
+
/**
|
|
71
|
+
* Env specifies the environment of the process.
|
|
72
|
+
*/
|
|
73
|
+
extra_env_vars: string[];
|
|
74
|
+
/**
|
|
75
|
+
* RemountSysProc remounts /sys and /proc for the executed command.
|
|
76
|
+
* This is required to reflect the container (PID) namespace context
|
|
77
|
+
* if the command does not attach to the container's mount namespace.
|
|
78
|
+
*/
|
|
79
|
+
remount_sys_proc: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* ElevatedPrivileges runs the command with elevated privileges.
|
|
82
|
+
* The capabilities, cgroup and security module restrictions of the container are not applied.
|
|
83
|
+
* @WARNING: This may leak privileges into the container.
|
|
84
|
+
*/
|
|
85
|
+
elevated_privileges: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* File descriptor to log output.
|
|
88
|
+
*/
|
|
89
|
+
log_fd: number;
|
|
90
|
+
/**
|
|
91
|
+
* lsm label to set.
|
|
92
|
+
*/
|
|
93
|
+
lsm_label?: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Default attach options to use
|
|
97
|
+
* @link [https://github.com/lxc/lxc](https://github.com/lxc/lxc/blob/main/src/lxc/attach_options.h#L161C9-L161C40)
|
|
98
|
+
*/
|
|
99
|
+
export declare const DEFAULT_ATTACH: lxc_attach_options;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author A.P.A. Slaa (a.p.a.slaa@projectsource.nl) ProjectSource V.O.F.
|
|
4
|
+
* @date 03-07-2024
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DEFAULT_ATTACH = void 0;
|
|
8
|
+
const lxc_attach_env_policy_1 = require("./lxc_attach_env_policy");
|
|
9
|
+
const LXC_ATTACH_1 = require("./LXC_ATTACH");
|
|
10
|
+
/**
|
|
11
|
+
* Default attach options to use
|
|
12
|
+
* @link [https://github.com/lxc/lxc](https://github.com/lxc/lxc/blob/main/src/lxc/attach_options.h#L161C9-L161C40)
|
|
13
|
+
*/
|
|
14
|
+
exports.DEFAULT_ATTACH = {
|
|
15
|
+
attach_flags: LXC_ATTACH_1.LXC_ATTACH.DEFAULT,
|
|
16
|
+
namespaces: -1,
|
|
17
|
+
personality: -1,
|
|
18
|
+
initial_cwd: "/",
|
|
19
|
+
uid: -1,
|
|
20
|
+
gid: -1,
|
|
21
|
+
groups: [],
|
|
22
|
+
env_policy: lxc_attach_env_policy_1.lxc_attach_env_policy.LXC_ATTACH_KEEP_ENV,
|
|
23
|
+
extra_env_vars: [],
|
|
24
|
+
stdio: [process.stdin.fd, process.stdout.fd, process.stderr.fd],
|
|
25
|
+
remount_sys_proc: false,
|
|
26
|
+
elevated_privileges: false,
|
|
27
|
+
log_fd: -1,
|
|
28
|
+
lsm_label: undefined
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=lxc_attach_options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lxc_attach_options.js","sourceRoot":"","sources":["../../../lib/types/lxc_attach_options.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,mEAA8D;AAC9D,6CAAwC;AAgGxC;;;GAGG;AACU,QAAA,cAAc,GAAuB;IAC9C,YAAY,EAAE,uBAAU,CAAC,OAAO;IAChC,UAAU,EAAE,CAAC,CAAC;IACd,WAAW,EAAE,CAAC,CAAC;IACf,WAAW,EAAE,GAAG;IAChB,GAAG,EAAE,CAAC,CAAC;IACP,GAAG,EAAE,CAAC,CAAC;IACP,MAAM,EAAE,EAAE;IACV,UAAU,EAAE,6CAAqB,CAAC,mBAAmB;IACrD,cAAc,EAAE,EAAE;IAClB,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IAC/D,gBAAgB,EAAE,KAAK;IACvB,mBAAmB,EAAE,KAAK;IAC1B,MAAM,EAAE,CAAC,CAAC;IACV,SAAS,EAAE,SAAS;CACvB,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author A.P.A. Slaa (a.p.a.slaa@projectsource.nl) ProjectSource V.O.F.
|
|
3
|
+
* @date 03-07-2024
|
|
4
|
+
*/
|
|
5
|
+
import { LXC_CLONE } from "./LXC_CLONE";
|
|
6
|
+
export type lxc_clone_options = ({
|
|
7
|
+
/**
|
|
8
|
+
* New name for the container.
|
|
9
|
+
*/
|
|
10
|
+
newname: string;
|
|
11
|
+
/**
|
|
12
|
+
* lxcpath in which to create the new container
|
|
13
|
+
* If undefined, the original container's lxcpath will be used.
|
|
14
|
+
* (XXX: should we use the default instead?)
|
|
15
|
+
*/
|
|
16
|
+
lxcpath?: string;
|
|
17
|
+
} | {
|
|
18
|
+
/**
|
|
19
|
+
* New name for the container.
|
|
20
|
+
* If undefined, the same name is used and a new lxcpath MUST be specified.
|
|
21
|
+
*/
|
|
22
|
+
newname?: string;
|
|
23
|
+
/**
|
|
24
|
+
* lxcpath in which to create the new container
|
|
25
|
+
*/
|
|
26
|
+
lxcpath: string;
|
|
27
|
+
}) & {
|
|
28
|
+
/**
|
|
29
|
+
* Additional LXC_CLONE* flags to change the cloning behaviour:
|
|
30
|
+
*/
|
|
31
|
+
flags?: number | LXC_CLONE;
|
|
32
|
+
/**
|
|
33
|
+
* Optionally force the cloned bdevtype to a specified plugin.
|
|
34
|
+
* By default, the original is used (subject to snapshot requirements).
|
|
35
|
+
*/
|
|
36
|
+
bdevtype?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Information about how to create the new storage (i.e. fstype and fsdata).
|
|
39
|
+
*/
|
|
40
|
+
bdevdata?: string;
|
|
41
|
+
/**
|
|
42
|
+
* In case of a block device backing store, an optional size. If 0, the original backing store's size will be used if possible.
|
|
43
|
+
* @note
|
|
44
|
+
* this only applies to the rootfs.
|
|
45
|
+
* For any other filesystems, the original size will be duplicated.
|
|
46
|
+
*/
|
|
47
|
+
newsize?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Additional arguments to pass to the clone hook script.
|
|
50
|
+
*/
|
|
51
|
+
hookargs?: string[];
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lxc_clone_options.js","sourceRoot":"","sources":["../../../lib/types/lxc_clone_options.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lxc_console_log.js","sourceRoot":"","sources":["../../../lib/types/lxc_console_log.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lxc_snapshot.js","sourceRoot":"","sources":["../../../lib/types/lxc_snapshot.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author A.P.A. Slaa (a.p.a.slaa@projectsource.nl) ProjectSource V.O.F.
|
|
3
|
+
* @date 03-07-2024
|
|
4
|
+
*/
|
|
5
|
+
export type migrate_opts = {
|
|
6
|
+
directory: string;
|
|
7
|
+
verbose: boolean;
|
|
8
|
+
stop: boolean;
|
|
9
|
+
predump_dir: string;
|
|
10
|
+
pageserver_address: string;
|
|
11
|
+
pageserver_port: string;
|
|
12
|
+
preserves_inodes: boolean;
|
|
13
|
+
action_script: string;
|
|
14
|
+
disable_skip_in_flight: boolean;
|
|
15
|
+
ghost_limit: bigint | number;
|
|
16
|
+
features_to_check: bigint | number;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate_opts.js","sourceRoot":"","sources":["../../../lib/types/migrate_opts.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "node-lxc",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Node.js native bindings for LXC (Linux Containers) — a complete, production-ready wrapper around liblxc built with N-API",
|
|
5
|
+
"homepage": "https://github.com/SourceRegistry/node-lxc#readme",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/SourceRegistry/node-lxc.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/SourceRegistry/node-lxc/issues"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"lxc",
|
|
15
|
+
"linux-containers",
|
|
16
|
+
"containers",
|
|
17
|
+
"virtualization",
|
|
18
|
+
"liblxc",
|
|
19
|
+
"native",
|
|
20
|
+
"napi",
|
|
21
|
+
"node-addon-api"
|
|
22
|
+
],
|
|
23
|
+
"author": "ProjectSource V.O.F.",
|
|
24
|
+
"license": "Apache-2.0",
|
|
25
|
+
"main": "lib/index.js",
|
|
26
|
+
"types": "lib/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"lib",
|
|
29
|
+
"bin",
|
|
30
|
+
"examples"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"node-addon-api": "^8.5.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
37
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
38
|
+
"@semantic-release/git": "^10.0.1",
|
|
39
|
+
"@semantic-release/github": "^12.0.8",
|
|
40
|
+
"@semantic-release/npm": "^13.1.5",
|
|
41
|
+
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
42
|
+
"@types/mocha": "^10.0.10",
|
|
43
|
+
"@types/node": "^22.15.17",
|
|
44
|
+
"cmake-js": "^7.3.1",
|
|
45
|
+
"mocha": "^11.7.1",
|
|
46
|
+
"node-gyp": "^11.3.0",
|
|
47
|
+
"semantic-release": "^25.0.3",
|
|
48
|
+
"ts-node": "^10.9.2",
|
|
49
|
+
"typedoc": "^0.28.19"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"setup": "./scripts/setup/setup.sh",
|
|
53
|
+
"test": "node --require ts-node/register --test tests/index.ts",
|
|
54
|
+
"test:watch": "node --require ts-node/register --test --watch tests/index.ts",
|
|
55
|
+
"test:build": "npm run build && npm run test",
|
|
56
|
+
"rebuild:dev": "node-gyp rebuild --debug && npx tsc",
|
|
57
|
+
"docs:build": "typedoc lib/index.ts --out generated/docs --name \"node-lxc\" --theme default --excludePrivate --excludeProtected --entryPointStrategy expand",
|
|
58
|
+
"build:dev": "node-gyp build --debug",
|
|
59
|
+
"build:test": "node-gyp build",
|
|
60
|
+
"dev:cpp": "npm run rebuild:dev && node ./tests/async_console.js",
|
|
61
|
+
"build": "./scripts/build/build.sh",
|
|
62
|
+
"clean": "node-gyp clean && npm run configure && npm run build",
|
|
63
|
+
"wipe": "node-gyp clean && npm run configure",
|
|
64
|
+
"configure": "node-gyp configure",
|
|
65
|
+
"preview": "npm run build && mkdir -p ./node_modules/@sourceregistry/node-lxc && cp -r ./package/* ./node_modules/@sourceregistry/node-lxc",
|
|
66
|
+
"package": "./scripts/package/package.sh",
|
|
67
|
+
"example:create": "ts-node examples/create/index.ts",
|
|
68
|
+
"example:console": "ts-node examples/console/index.ts",
|
|
69
|
+
"example:console_async": "ts-node examples/console_async/index.ts",
|
|
70
|
+
"example:attach": "ts-node examples/attach/index.ts",
|
|
71
|
+
"example:attach-streams": "ts-node examples/attach-streams/index.ts",
|
|
72
|
+
"example:checkpoint": "ts-node examples/checkpoint/index.ts",
|
|
73
|
+
"example:clone": "ts-node examples/clone/index.ts",
|
|
74
|
+
"example:concurrent_create": "ts-node examples/concurrent_create/index.ts",
|
|
75
|
+
"example:concurrent_destroy": "ts-node examples/concurrent_destroy/index.ts",
|
|
76
|
+
"example:concurrent_shutdown": "ts-node examples/concurrent_shutdown/index.ts",
|
|
77
|
+
"example:concurrent_start": "ts-node examples/concurrent_start/index.ts",
|
|
78
|
+
"example:concurrent_stop": "ts-node examples/concurrent_stop/index.ts",
|
|
79
|
+
"example:config": "ts-node examples/config/index.ts",
|
|
80
|
+
"example:execute": "ts-node examples/execute/index.ts",
|
|
81
|
+
"example:keys": "ts-node examples/list_keys/index.ts",
|
|
82
|
+
"example:images": "ts-node examples/images/index.ts"
|
|
83
|
+
},
|
|
84
|
+
"engines": {
|
|
85
|
+
"node": "~10 >=10.20 || >=12.17"
|
|
86
|
+
},
|
|
87
|
+
"gypfile": true
|
|
88
|
+
}
|