pmcf 2.10.0 → 2.10.2
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/package.json +2 -2
- package/src/host-utils.mjs +5 -2
- package/src/services/dhcp.mjs +1 -1
- package/src/subnet.mjs +21 -3
- package/types/subnet.d.mts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"npm-pkgbuild": "^
|
|
41
|
+
"npm-pkgbuild": "^18.0.0",
|
|
42
42
|
"pacc": "^3.3.0",
|
|
43
43
|
"pkg-dir": "^8.0.0"
|
|
44
44
|
},
|
package/src/host-utils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeFile, mkdir, copyFile, glob, chmod } from "node:fs/promises";
|
|
1
|
+
import { writeFile, mkdir, copyFile, glob, chmod, stat } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { writeLines, sectionLines } from "../src/utils.mjs";
|
|
4
4
|
import { addHook } from "./hooks.mjs";
|
|
@@ -142,8 +142,11 @@ export async function copySshKeys(host, packageData) {
|
|
|
142
142
|
await copyFile(join(host.directory, file), destinationFileName);
|
|
143
143
|
await chmod(
|
|
144
144
|
destinationFileName,
|
|
145
|
-
destinationFileName.endsWith(".pub") ?
|
|
145
|
+
destinationFileName.endsWith(".pub") ? 0o644 : 0o600
|
|
146
146
|
);
|
|
147
|
+
|
|
148
|
+
const s = await stat(destinationFileName);
|
|
149
|
+
console.log(destinationFileName,s.mode)
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
|
package/src/services/dhcp.mjs
CHANGED
package/src/subnet.mjs
CHANGED
|
@@ -61,10 +61,24 @@ export class Subnet extends Base {
|
|
|
61
61
|
return isIPv6Address(this.address);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
get addressRange()
|
|
65
|
-
{
|
|
64
|
+
get addressRange() {
|
|
66
65
|
const l = this.prefixLength;
|
|
67
|
-
return l === 24
|
|
66
|
+
return l === 24
|
|
67
|
+
? [this.prefix + ".0", this.prefix + ".255"]
|
|
68
|
+
: [this.prefix + ".0.0", this.prefix + ".255.255"];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get longPrefix() {
|
|
72
|
+
const prefix = this.prefix;
|
|
73
|
+
|
|
74
|
+
switch (this.prefixLength) {
|
|
75
|
+
case 24:
|
|
76
|
+
return prefix + ".0";
|
|
77
|
+
case 16:
|
|
78
|
+
return prefix + ".0.0";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return prefix;
|
|
68
82
|
}
|
|
69
83
|
|
|
70
84
|
get prefix() {
|
|
@@ -83,6 +97,10 @@ export class Subnet extends Base {
|
|
|
83
97
|
return this.name;
|
|
84
98
|
}
|
|
85
99
|
|
|
100
|
+
get longAddress() {
|
|
101
|
+
return `${this.longPrefix}/${this.prefixLength}`;
|
|
102
|
+
}
|
|
103
|
+
|
|
86
104
|
_traverse(...args) {
|
|
87
105
|
if (super._traverse(...args)) {
|
|
88
106
|
for (const network of this.networks) {
|
package/types/subnet.d.mts
CHANGED
|
@@ -31,9 +31,11 @@ export class Subnet extends Base {
|
|
|
31
31
|
get isIPv4(): boolean;
|
|
32
32
|
get isIPv6(): boolean;
|
|
33
33
|
get addressRange(): string[];
|
|
34
|
+
get longPrefix(): string;
|
|
34
35
|
get prefix(): string;
|
|
35
36
|
get prefixLength(): number;
|
|
36
37
|
get address(): string;
|
|
38
|
+
get longAddress(): string;
|
|
37
39
|
_traverse(...args: any[]): boolean;
|
|
38
40
|
}
|
|
39
41
|
import { Base } from "./base.mjs";
|