edhoc 1.1.1 → 1.2.1
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 +21 -0
- package/README.md +2 -2
- package/dist/crypto.d.ts +7 -7
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +9 -9
- package/dist/x509credentials.d.ts +1 -1
- package/dist/x509credentials.d.ts.map +1 -1
- package/dist/x509credentials.js +1 -1
- package/package.json +19 -7
- package/patches/prebuildify-cross+5.1.1.patch +26 -0
- package/prebuilds/darwin-arm64/edhoc.node +0 -0
- package/prebuilds/darwin-x64/edhoc.node +0 -0
- package/prebuilds/win32-ia32/edhoc.node +0 -0
- package/prebuilds/win32-x64/edhoc.node +0 -0
- package/patches/@vweevers+docker-pull+1.1.1.patch +0 -13
- package/patches/docker-run+3.1.0.patch +0 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Marek Serafin <marek@serafin.email>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Node
|
|
1
|
+
# EDHOC for Node.js
|
|
2
2
|
|
|
3
3
|
A TypeScript Node.js library implemented as a native addon, built on top of the C library [`libedhoc`](https://github.com/kamil-kielbasa/libedhoc/). It provides an efficient and lightweight way to use the Ephemeral Diffie-Hellman Over COSE (EDHOC) protocol, as specified in [RFC 9528](https://datatracker.ietf.org/doc/rfc9528/).
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ EDHOC is designed for lightweight communication and is particularly suitable for
|
|
|
17
17
|
Install the package via npm:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install
|
|
20
|
+
npm install edhoc
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage Examples
|
package/dist/crypto.d.ts
CHANGED
|
@@ -6,18 +6,18 @@ export declare class DefaultEdhocCryptoManager implements EdhocCryptoManager {
|
|
|
6
6
|
addKey(keyID: Buffer, key: Buffer): void;
|
|
7
7
|
importKey(edhoc: EDHOC, keyType: EdhocKeyType, key: Buffer): Promise<Buffer>;
|
|
8
8
|
destroyKey(edhoc: EDHOC, keyID: Buffer): boolean;
|
|
9
|
-
makeKeyPair(edhoc: EDHOC, keyID: Buffer,
|
|
9
|
+
makeKeyPair(edhoc: EDHOC, keyID: Buffer, _privateKeySize: number, _publicKeySize: number): {
|
|
10
10
|
privateKey: Buffer;
|
|
11
11
|
publicKey: Buffer;
|
|
12
12
|
};
|
|
13
|
-
keyAgreement(edhoc: EDHOC, keyID: Buffer, publicKey: Buffer,
|
|
14
|
-
sign(edhoc: EDHOC, keyID: Buffer, input: Buffer,
|
|
13
|
+
keyAgreement(edhoc: EDHOC, keyID: Buffer, publicKey: Buffer, _privateKeySize: number): Buffer;
|
|
14
|
+
sign(edhoc: EDHOC, keyID: Buffer, input: Buffer, _signatureSize: number): Buffer;
|
|
15
15
|
verify(edhoc: EDHOC, keyID: Buffer, input: Buffer, signature: Buffer): Promise<boolean>;
|
|
16
|
-
extract(edhoc: EDHOC, keyID: Buffer, salt: Buffer,
|
|
16
|
+
extract(edhoc: EDHOC, keyID: Buffer, salt: Buffer, _keySize: number): Buffer;
|
|
17
17
|
expand(edhoc: EDHOC, keyID: Buffer, info: Buffer, keySize: number): Buffer;
|
|
18
|
-
encrypt(edhoc: EDHOC, keyID: Buffer, nonce: Buffer, aad: Buffer, plaintext: Buffer,
|
|
19
|
-
decrypt(edhoc: EDHOC, keyID: Buffer, nonce: Buffer, aad: Buffer, ciphertext: Buffer,
|
|
20
|
-
hash(
|
|
18
|
+
encrypt(edhoc: EDHOC, keyID: Buffer, nonce: Buffer, aad: Buffer, plaintext: Buffer, _size: number): Buffer;
|
|
19
|
+
decrypt(edhoc: EDHOC, keyID: Buffer, nonce: Buffer, aad: Buffer, ciphertext: Buffer, _size: number): Buffer;
|
|
20
|
+
hash(_edhoc: EDHOC, data: Buffer, _hashSize: number): Promise<Buffer>;
|
|
21
21
|
private getKey;
|
|
22
22
|
private formatToBeSigned;
|
|
23
23
|
private formatPublicKey;
|
package/dist/crypto.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../lib/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAc,MAAM,SAAS,CAAC;AAoB9E,qBAAa,yBAA0B,YAAW,kBAAkB;IAEhE,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,aAAa,CAAgB;;IAM9B,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKlC,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM;IAsBhE,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;IAStC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../lib/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAc,MAAM,SAAS,CAAC;AAoB9E,qBAAa,yBAA0B,YAAW,kBAAkB;IAEhE,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,aAAa,CAAgB;;IAM9B,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKlC,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM;IAsBhE,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM;IAStC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;;;;IAcxF,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;IAQpF,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAiBjE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAa7F,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAKnE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAMjE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAmBjG,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAiB5F,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAIzD,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;CAiBvB"}
|
package/dist/crypto.js
CHANGED
|
@@ -26,10 +26,10 @@ class DefaultEdhocCryptoManager {
|
|
|
26
26
|
switch (keyType) {
|
|
27
27
|
case edhoc_1.EdhocKeyType.KeyAgreement:
|
|
28
28
|
case edhoc_1.EdhocKeyType.MakeKeyPair:
|
|
29
|
-
this.keys[keyID] = key.byteLength > 0 ? Buffer.from(key) : curveKE.utils.randomPrivateKey();
|
|
29
|
+
this.keys[keyID] = key.byteLength > 0 ? Buffer.from(key) : Buffer.from(curveKE.utils.randomPrivateKey());
|
|
30
30
|
break;
|
|
31
31
|
case edhoc_1.EdhocKeyType.Signature:
|
|
32
|
-
this.keys[keyID] = key.byteLength > 0 ? Buffer.from(key) : curveSIG.utils.randomPrivateKey();
|
|
32
|
+
this.keys[keyID] = key.byteLength > 0 ? Buffer.from(key) : Buffer.from(curveSIG.utils.randomPrivateKey());
|
|
33
33
|
break;
|
|
34
34
|
default:
|
|
35
35
|
this.keys[keyID] = Buffer.from(key);
|
|
@@ -44,7 +44,7 @@ class DefaultEdhocCryptoManager {
|
|
|
44
44
|
delete this.keys[kid];
|
|
45
45
|
return true;
|
|
46
46
|
}
|
|
47
|
-
makeKeyPair(edhoc, keyID,
|
|
47
|
+
makeKeyPair(edhoc, keyID, _privateKeySize, _publicKeySize) {
|
|
48
48
|
const key = this.getKey(keyID);
|
|
49
49
|
try {
|
|
50
50
|
const curveKE = this.getCurveForKeyAgreement(edhoc.selectedSuite);
|
|
@@ -57,14 +57,14 @@ class DefaultEdhocCryptoManager {
|
|
|
57
57
|
throw new Error(`Wrong key type`);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
keyAgreement(edhoc, keyID, publicKey,
|
|
60
|
+
keyAgreement(edhoc, keyID, publicKey, _privateKeySize) {
|
|
61
61
|
const key = this.getKey(keyID);
|
|
62
62
|
const curveKE = this.getCurveForKeyAgreement(edhoc.selectedSuite);
|
|
63
63
|
const publicKeyBuffer = this.formatPublicKey(curveKE, publicKey);
|
|
64
64
|
const sharedSecrect = Buffer.from(curveKE.getSharedSecret(key, new Uint8Array(publicKeyBuffer)));
|
|
65
65
|
return sharedSecrect.subarray(curveKE === p256_1.p256 ? 1 : 0);
|
|
66
66
|
}
|
|
67
|
-
sign(edhoc, keyID, input,
|
|
67
|
+
sign(edhoc, keyID, input, _signatureSize) {
|
|
68
68
|
const key = this.getKey(keyID);
|
|
69
69
|
const curveSIG = this.getCurveForSignature(edhoc.selectedSuite);
|
|
70
70
|
const payload = this.formatToBeSigned(curveSIG, input);
|
|
@@ -89,7 +89,7 @@ class DefaultEdhocCryptoManager {
|
|
|
89
89
|
}
|
|
90
90
|
return true;
|
|
91
91
|
}
|
|
92
|
-
extract(edhoc, keyID, salt,
|
|
92
|
+
extract(edhoc, keyID, salt, _keySize) {
|
|
93
93
|
const key = this.getKey(keyID);
|
|
94
94
|
return Buffer.from((0, hkdf_1.extract)(sha256_1.sha256, new Uint8Array(key), new Uint8Array(salt)));
|
|
95
95
|
}
|
|
@@ -98,7 +98,7 @@ class DefaultEdhocCryptoManager {
|
|
|
98
98
|
const expanded = Buffer.from((0, hkdf_1.expand)(sha256_1.sha256, new Uint8Array(key), new Uint8Array(info), keySize));
|
|
99
99
|
return expanded;
|
|
100
100
|
}
|
|
101
|
-
encrypt(edhoc, keyID, nonce, aad, plaintext,
|
|
101
|
+
encrypt(edhoc, keyID, nonce, aad, plaintext, _size) {
|
|
102
102
|
const key = this.getKey(keyID);
|
|
103
103
|
const algorithm = this.getAlgorithm(edhoc.selectedSuite);
|
|
104
104
|
const options = {
|
|
@@ -114,7 +114,7 @@ class DefaultEdhocCryptoManager {
|
|
|
114
114
|
]);
|
|
115
115
|
return encrypted;
|
|
116
116
|
}
|
|
117
|
-
decrypt(edhoc, keyID, nonce, aad, ciphertext,
|
|
117
|
+
decrypt(edhoc, keyID, nonce, aad, ciphertext, _size) {
|
|
118
118
|
const key = this.getKey(keyID);
|
|
119
119
|
const tagLength = this.getTagLength(edhoc.selectedSuite);
|
|
120
120
|
const algorithm = this.getAlgorithm(edhoc.selectedSuite);
|
|
@@ -126,7 +126,7 @@ class DefaultEdhocCryptoManager {
|
|
|
126
126
|
decipher.final();
|
|
127
127
|
return decrypted;
|
|
128
128
|
}
|
|
129
|
-
async hash(
|
|
129
|
+
async hash(_edhoc, data, _hashSize) {
|
|
130
130
|
return Buffer.from((0, sha256_1.sha256)(data));
|
|
131
131
|
}
|
|
132
132
|
getKey(keyID) {
|
|
@@ -11,7 +11,7 @@ export declare class X509CertificateCredentialManager implements EdhocCredential
|
|
|
11
11
|
addTrustedCA(certificate: X509Certificate | Buffer): void;
|
|
12
12
|
private convertAndValidateCredentials;
|
|
13
13
|
private convertAndValidateSingleCredential;
|
|
14
|
-
fetch(
|
|
14
|
+
fetch(_edhoc: EDHOC): Promise<EdhocCredentials>;
|
|
15
15
|
verify(edhoc: EDHOC, credentials: EdhocCredentials): Promise<EdhocCredentials>;
|
|
16
16
|
private verifyCertificateChain;
|
|
17
17
|
private verifyAgainstTrustRoots;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x509credentials.d.ts","sourceRoot":"","sources":["../lib/x509credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,sBAAsB,EAA+G,MAAM,SAAS,CAAC;AAC/M,OAAO,EAAc,eAAe,EAAE,MAAM,QAAQ,CAAC;AAErD,qBAAa,gCAAiC,YAAW,sBAAsB;IAE3E,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,UAAU,CAAyB;IAC3C,OAAO,CAAC,WAAW,CAAS;IAE5B,WAAW,EAAE,sBAAsB,CAAkC;gBAEzD,WAAW,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM;IAK1E,kBAAkB,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM;IAIxD,YAAY,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM;IAIlD,OAAO,CAAC,6BAA6B;IAIrC,OAAO,CAAC,kCAAkC;IAUpC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"x509credentials.d.ts","sourceRoot":"","sources":["../lib/x509credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,sBAAsB,EAA+G,MAAM,SAAS,CAAC;AAC/M,OAAO,EAAc,eAAe,EAAE,MAAM,QAAQ,CAAC;AAErD,qBAAa,gCAAiC,YAAW,sBAAsB;IAE3E,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,UAAU,CAAyB;IAC3C,OAAO,CAAC,WAAW,CAAS;IAE5B,WAAW,EAAE,sBAAsB,CAAkC;gBAEzD,WAAW,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM;IAK1E,kBAAkB,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM;IAIxD,YAAY,CAAC,WAAW,EAAE,eAAe,GAAG,MAAM;IAIlD,OAAO,CAAC,6BAA6B;IAIrC,OAAO,CAAC,kCAAkC;IAUpC,KAAK,CAAC,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAmC/C,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,gBAAgB;IAwCxD,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,gBAAgB;CAY3B"}
|
package/dist/x509credentials.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edhoc",
|
|
3
3
|
"description": "A Node.js implementation of EDHOC (Ephemeral Diffie-Hellman Over COSE) protocol for lightweight authenticated key exchange in IoT and other constrained environments.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"author": "Marek Serafin <marek@serafin.email>",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/stoprocent/node-edhoc.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/stoprocent/node-edhoc",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"edhoc",
|
|
15
|
+
"cose",
|
|
16
|
+
"iot",
|
|
17
|
+
"constrained",
|
|
18
|
+
"authentication",
|
|
19
|
+
"key exchange",
|
|
20
|
+
"coap"
|
|
21
|
+
],
|
|
6
22
|
"scripts": {
|
|
7
23
|
"debug": "npx node-gyp build --debug",
|
|
8
24
|
"install": "node-gyp-build",
|
|
@@ -22,13 +38,11 @@
|
|
|
22
38
|
"@noble/curves": "^1.4.0",
|
|
23
39
|
"bindings": "^1.5.0",
|
|
24
40
|
"cbor": "^9.0.2",
|
|
25
|
-
"chalk": "^5.3.0",
|
|
26
41
|
"coap": "^1.3.0",
|
|
27
42
|
"colors": "^1.4.0",
|
|
28
43
|
"node-addon-api": "^8.0.0",
|
|
29
44
|
"node-gyp-build": "^4.8.1",
|
|
30
|
-
"patch-package": "^8.0.0"
|
|
31
|
-
"wtfnode": "^0.9.3"
|
|
45
|
+
"patch-package": "^8.0.0"
|
|
32
46
|
},
|
|
33
47
|
"devDependencies": {
|
|
34
48
|
"@commitlint/cli": "^19.3.0",
|
|
@@ -44,10 +58,8 @@
|
|
|
44
58
|
"@types/node": "^22.13.4",
|
|
45
59
|
"eslint": "^8.57.0",
|
|
46
60
|
"jest": "^29.7.0",
|
|
47
|
-
"mocha": "^10.7.0",
|
|
48
|
-
"nyc": "^17.0.0",
|
|
49
61
|
"prebuildify": "^6.0.1",
|
|
50
|
-
"prebuildify-cross": "^5.1.
|
|
62
|
+
"prebuildify-cross": "^5.1.1",
|
|
51
63
|
"semantic-release": "^24.0.0",
|
|
52
64
|
"ts-jest": "^29.2.5",
|
|
53
65
|
"typescript": "^5.5.4",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
diff --git a/node_modules/prebuildify-cross/guest.js b/node_modules/prebuildify-cross/guest.js
|
|
2
|
+
index dfd9eb7..c660f86 100644
|
|
3
|
+
--- a/node_modules/prebuildify-cross/guest.js
|
|
4
|
+
+++ b/node_modules/prebuildify-cross/guest.js
|
|
5
|
+
@@ -10,18 +10,12 @@ const files = JSON.parse(process.env.PREBUILDIFY_CROSS_FILES)
|
|
6
|
+
const argv = process.argv.slice(2)
|
|
7
|
+
|
|
8
|
+
// Copy host files to working directory
|
|
9
|
+
-for (const file of files) {
|
|
10
|
+
- const a = path.join('/input', file)
|
|
11
|
+
- const b = path.join(cwd, file)
|
|
12
|
+
+fs.cpSync("/input", cwd, { recursive: true })
|
|
13
|
+
|
|
14
|
+
- fs.mkdirSync(path.dirname(b), { recursive: true })
|
|
15
|
+
- fs.copyFileSync(a, b, fs.constants.COPYFILE_EXCL)
|
|
16
|
+
- fs.chmodSync(b, 0o644)
|
|
17
|
+
+if (fs.existsSync(cwd + "/build")) {
|
|
18
|
+
+ fs.rmSync(cwd + "/build", { recursive: true, })
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
-// Use node_modules of host to avoid a second install step
|
|
22
|
+
-fs.symlinkSync('/input/node_modules', path.join(cwd, 'node_modules'))
|
|
23
|
+
-
|
|
24
|
+
const stdio = ['ignore', 2, 2]
|
|
25
|
+
const res = cp.spawnSync('npx', ['--no-install', 'prebuildify', ...argv], { cwd, stdio })
|
|
26
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/@vweevers/docker-pull/index.js b/node_modules/@vweevers/docker-pull/index.js
|
|
2
|
-
index 67b3e73..bac4a84 100644
|
|
3
|
-
--- a/node_modules/@vweevers/docker-pull/index.js
|
|
4
|
-
+++ b/node_modules/@vweevers/docker-pull/index.js
|
|
5
|
-
@@ -12,7 +12,7 @@ var pull = function (image, opts, cb) {
|
|
6
|
-
image = parse(image)
|
|
7
|
-
if (!image) throw new Error('Invalid image')
|
|
8
|
-
|
|
9
|
-
- var request = docker({host: opts.host, version: opts.version || 'v1.21'})
|
|
10
|
-
+ var request = docker({host: opts.host, version: opts.version || 'v1.24'})
|
|
11
|
-
var that = new events.EventEmitter()
|
|
12
|
-
var layers = {}
|
|
13
|
-
var progress = {}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/docker-run/index.js b/node_modules/docker-run/index.js
|
|
2
|
-
index ea7fc0d..1f08702 100644
|
|
3
|
-
--- a/node_modules/docker-run/index.js
|
|
4
|
-
+++ b/node_modules/docker-run/index.js
|
|
5
|
-
@@ -14,7 +14,7 @@ var endsWith = function(str, suffix) {
|
|
6
|
-
var run = function(image, opts) {
|
|
7
|
-
if (!opts) opts = {}
|
|
8
|
-
|
|
9
|
-
- var request = docker(opts.host, {version:'v1.14'})
|
|
10
|
-
+ var request = docker(opts.host, {version:'v1.24'})
|
|
11
|
-
var that = new events.EventEmitter()
|
|
12
|
-
var tty = !!opts.tty
|
|
13
|
-
|