@dotrino/vaultd 0.154.0 → 0.154.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/package.json +2 -2
- package/src/transport.js +15 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/vaultd",
|
|
3
|
-
"version": "0.154.
|
|
3
|
+
"version": "0.154.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Certificador personal de Dotrino: daemon headless que custodia la clave maestra y delega capacidades a tus dispositivos por el proxy. Tu CA propia.",
|
|
6
6
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@dotrino/identity": "^0.111.0",
|
|
26
26
|
"@dotrino/opaque": "0.1.0",
|
|
27
27
|
"@dotrino/passmanager": "0.17.0",
|
|
28
|
-
"@dotrino/proxy-client": "^0.32.
|
|
28
|
+
"@dotrino/proxy-client": "^0.32.2",
|
|
29
29
|
"@dotrino/roadmap": "0.3.19",
|
|
30
30
|
"@dotrino/store": "0.11.0",
|
|
31
31
|
"@dotrino/update": "0.5.1",
|
package/src/transport.js
CHANGED
|
@@ -36,7 +36,7 @@ export async function masterPubkeyOf (identity) {
|
|
|
36
36
|
* @param {string} [opts.url] URL del proxy (default wss://proxy.dotrino.com).
|
|
37
37
|
* @returns {Promise<{ client, token:string, identify():Promise<void> }>}
|
|
38
38
|
*/
|
|
39
|
-
export async function createTransport ({ identity, dir, url = DEFAULT_PROXY, commKey = null, log = () => {}, makeClient = null, announce = null, recheckMs = 60_000, reannounceMs = 10 * 60_000 }) {
|
|
39
|
+
export async function createTransport ({ identity, dir, url = DEFAULT_PROXY, commKey = null, log = () => {}, makeClient = null, announce = null, recheckMs = 60_000, patienceMs = 5 * 60_000, reannounceMs = 10 * 60_000 }) {
|
|
40
40
|
installNodeGlobals(dir)
|
|
41
41
|
// Import dinámico DESPUÉS de instalar los globals que el paquete usa.
|
|
42
42
|
// `WebSocketProxyClient` (la clase) y NO el helper `getWebSocketProxyClient`:
|
|
@@ -222,21 +222,33 @@ export async function createTransport ({ identity, dir, url = DEFAULT_PROXY, com
|
|
|
222
222
|
* nada.
|
|
223
223
|
*/
|
|
224
224
|
const RECHECK_MS = recheckMs
|
|
225
|
-
const PATIENCE_MS =
|
|
225
|
+
const PATIENCE_MS = patienceMs
|
|
226
226
|
const REANNOUNCE_MS = reannounceMs // la mitad de lo que el proxio guarda una entrada
|
|
227
227
|
let downSince = 0
|
|
228
228
|
let saidDown = false
|
|
229
229
|
client.on('disconnect', ({ code, reason } = {}) => {
|
|
230
|
+
// Sin socket no hay nadie atado al proxio: lo que se identificó era la conexión anterior.
|
|
231
|
+
identificado = false
|
|
230
232
|
if (!downSince) downSince = Date.now()
|
|
231
233
|
if (saidDown) return
|
|
232
234
|
saidDown = true
|
|
233
235
|
log(`[vault] off the proxy (${code || '?'}${reason ? ': ' + reason : ''}) — nobody can reach this vault while this lasts`)
|
|
234
236
|
})
|
|
237
|
+
// LOS INTENTOS SE VEN. El 2026-10-15 la bóveda pasó hora y media fuera y no quedó ni una
|
|
238
|
+
// línea de si el transporte estaba reintentando o no; en el proxio no llegó ninguno. El
|
|
239
|
+
// primero se dice, y luego uno de cada 15 (un minuto con el retardo de 4 s).
|
|
240
|
+
client.on('reconnecting', (attempt) => {
|
|
241
|
+
if (attempt === 1 || attempt % 15 === 0) log(`[vault] reconnecting to the proxy (attempt ${attempt})`)
|
|
242
|
+
})
|
|
235
243
|
client.on('reconnect_failed', (attempts) => {
|
|
236
244
|
log(`[vault] the transport gave up reconnecting after ${attempts} attempt(s) — this vault is unreachable until it is restarted`)
|
|
237
245
|
})
|
|
238
246
|
const watchdog = setInterval(async () => {
|
|
239
|
-
|
|
247
|
+
// CONECTADO DE VERDAD, no «tengo un token». El token es el de la última conexión y no se
|
|
248
|
+
// borra al caerse, así que mirarlo daba la bóveda por vuelta con el socket cerrado: el
|
|
249
|
+
// 2026-10-15 dijo «back on the proxy after 50s», no volvió a marcar nunca y pasó hora y
|
|
250
|
+
// media fuera, avisando cada 10 minutos de que no podía anunciarse.
|
|
251
|
+
if (identificado && client.isConnected && client.token) {
|
|
240
252
|
if (downSince) log(`[vault] back on the proxy after ${Math.round((Date.now() - downSince) / 1000)}s`)
|
|
241
253
|
downSince = 0; saidDown = false
|
|
242
254
|
// EL ANUNCIO CADUCA: el proxio borra una entrada de canal a los 20 minutos de publicada.
|