@coffre/vault 0.4.0 → 0.4.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/dist/node.js +1 -0
- package/package.json +3 -3
- package/src/node.ts +6 -0
package/dist/node.js
CHANGED
|
@@ -88,6 +88,7 @@ async function serveVault(config) {
|
|
|
88
88
|
reply(500, { error: error instanceof Error ? error.message : "the vault failed" });
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
+
server.keepAliveTimeout = 0;
|
|
91
92
|
if (existsSync(config.socket)) {
|
|
92
93
|
if (!lstatSync(config.socket).isSocket()) throw new Error(`${config.socket} exists and is not a socket`);
|
|
93
94
|
rmSync(config.socket);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffre/vault",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "coffre's vault: keys, grants and members, in the database the app uses, as a Cloudflare Worker or on Node.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"drizzle-orm": "0.45.2",
|
|
39
|
-
"@coffre/core": "0.4.
|
|
40
|
-
"@coffre/db": "0.4.
|
|
39
|
+
"@coffre/core": "0.4.1",
|
|
40
|
+
"@coffre/db": "0.4.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "26.1.1",
|
package/src/node.ts
CHANGED
|
@@ -79,6 +79,12 @@ export async function serveVault(config: NodeVaultConfig & { socket: string }):
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
+
// The server's agent keeps its connections open for its next calls, so
|
|
83
|
+
// the vault never ends an idle one. Node's default did, after five seconds
|
|
84
|
+
// and one more, racing the server's next call on it, which then failed
|
|
85
|
+
// with ECONNRESET: "coffre cannot check who you are right now".
|
|
86
|
+
server.keepAliveTimeout = 0;
|
|
87
|
+
|
|
82
88
|
// A socket file left by a vault that did not stop cleanly would make
|
|
83
89
|
// listen fail; anything else at that path is not ours to remove.
|
|
84
90
|
if (existsSync(config.socket)) {
|