@dotrino/vaultd 0.173.0 → 0.174.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/lib/src/core/libVersion.js +1 -1
- package/lib/src/core/transport.js +4 -2
- package/lib/src/core/vault.js +18 -4
- package/lib/src/enroll.js +1 -1
- package/package.json +2 -2
- package/src/ctl.js +1 -1
- package/src/platform.js +3 -0
- package/src/tui/i18n.js +2 -2
- package/src/vaultControl.js +1 -1
|
@@ -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, url = DEFAULT_PROXY, commKey = null, log = () => {}, makeClient = null, announce = null, wakeUrl = null, bluetooth = null, recheckMs = 60_000, patienceMs = 5 * 60_000, reannounceMs = 10 * 60_000 }) {
|
|
39
|
+
export async function createTransport ({ identity, url = DEFAULT_PROXY, commKey = null, log = () => {}, makeClient = null, announce = null, wakeUrl = null, bluetooth = null, lan = false, recheckMs = 60_000, patienceMs = 5 * 60_000, reannounceMs = 10 * 60_000 }) {
|
|
40
40
|
// Import dinámico DESPUÉS de instalar los globals que el paquete usa.
|
|
41
41
|
// `WebSocketProxyClient` (la clase) y NO el helper `getWebSocketProxyClient`:
|
|
42
42
|
// ese es un SINGLETON de proceso, y con multi-perfil el vault necesita una
|
|
@@ -83,7 +83,9 @@ export async function createTransport ({ identity, url = DEFAULT_PROXY, commKey
|
|
|
83
83
|
maxReconnectAttempts: 100000, reconnectDelay: 4000,
|
|
84
84
|
// EL BLUETOOTH (proxy-client docs/bluetooth.md) lo decide la plataforma: el binario en
|
|
85
85
|
// Linux sí; la pestaña y la extensión no pueden. Misma puerta que WebRTC (`inActa`).
|
|
86
|
-
...(bluetooth ? { bluetooth } : {})
|
|
86
|
+
...(bluetooth ? { bluetooth } : {}),
|
|
87
|
+
// LA RED LOCAL (docs/lan.md del pilar): anunciar la invitación por mDNS. Solo el binario.
|
|
88
|
+
...(lan ? { lan: true } : {})
|
|
87
89
|
})
|
|
88
90
|
|
|
89
91
|
await client.connect()
|
package/lib/src/core/vault.js
CHANGED
|
@@ -521,7 +521,7 @@ export async function startVault ({ platform, proxyUrl, log = console.log, onEnr
|
|
|
521
521
|
// la atiende. Lo construye la pieza compartida, porque quien lo busca es la extensión.
|
|
522
522
|
const { client, identify: reidentify, isIdentified, listen } = await createTransport({
|
|
523
523
|
identity, url: proxyUrl, commKey, log, announce: vaultChannel(fp), makeClient: platform.makeClient || null, wakeUrl: platform.wakeUrl || null,
|
|
524
|
-
bluetooth: platform.bluetooth || null
|
|
524
|
+
bluetooth: platform.bluetooth || null, lan: !!platform.lan
|
|
525
525
|
})
|
|
526
526
|
|
|
527
527
|
// El registro público de cadenas de selladores: deposita, si hay a dónde, los eslabones
|
|
@@ -863,6 +863,9 @@ export async function startVault ({ platform, proxyUrl, log = console.log, onEnr
|
|
|
863
863
|
// El mismo módulo lo usan «este dispositivo es bóveda» (@dotrino/vault) y la copia
|
|
864
864
|
// vendorizada del iframe de identidad: un solo sitio donde vive el flujo, y por lo
|
|
865
865
|
// tanto un solo sitio donde se comprueba el código antes de firmar el cert.
|
|
866
|
+
// Los anuncios cerca que siguen abiertos (una invitación sin cerrar): se cortan al apagar la
|
|
867
|
+
// bóveda, o el socket de la red local la sobreviviría.
|
|
868
|
+
const announcing = new Set()
|
|
866
869
|
const desk = createEnrollDesk({
|
|
867
870
|
identity,
|
|
868
871
|
iss: master,
|
|
@@ -908,9 +911,19 @@ export async function startVault ({ platform, proxyUrl, log = console.log, onEnr
|
|
|
908
911
|
markRotationDue(sub).catch((e) => log('[vault] could not rotate after the removal:', e.message))
|
|
909
912
|
},
|
|
910
913
|
defaultScope: [SCOPE.READ],
|
|
911
|
-
// EMPAREJAR CERCA (pairing-protocol.md §1.6): la invitación se anuncia por Bluetooth
|
|
912
|
-
// mientras la sesión vive,
|
|
913
|
-
|
|
914
|
+
// EMPAREJAR CERCA (pairing-protocol.md §1.6): la invitación se anuncia por Bluetooth y por
|
|
915
|
+
// la red local mientras la sesión vive, por los medios que este cliente tenga. Sin ninguno
|
|
916
|
+
// (la pestaña, la extensión, la Lambda), el QR de siempre.
|
|
917
|
+
announce: (kind, data) => {
|
|
918
|
+
if (!client.bluetoothAvailable && !platform.lan) return null
|
|
919
|
+
const started = client.announceNearby(kind, data).catch((e) => {
|
|
920
|
+
log('[vault] could not announce the invitation nearby:', e.message)
|
|
921
|
+
return null
|
|
922
|
+
})
|
|
923
|
+
const stop = () => { announcing.delete(stop); started.then((s) => s?.()) }
|
|
924
|
+
announcing.add(stop)
|
|
925
|
+
return stop
|
|
926
|
+
},
|
|
914
927
|
// DOS APARATOS RESPONDIERON (§1.7): la sesión ya se canceló; aquí se cuenta como incidente.
|
|
915
928
|
onContested: ({ devices }) => {
|
|
916
929
|
announcePairingContested(devices).catch((e) => log('[vault] could not tell the approvers about the contested pairing:', e.message))
|
|
@@ -4738,6 +4751,7 @@ export async function startVault ({ platform, proxyUrl, log = console.log, onEnr
|
|
|
4738
4751
|
return r
|
|
4739
4752
|
},
|
|
4740
4753
|
close () {
|
|
4754
|
+
for (const stop of [...announcing]) { try { stop() } catch (_) {} }
|
|
4741
4755
|
clearInterval(approvalsSweeper)
|
|
4742
4756
|
for (const t of pendingNotices.values()) clearTimeout(t)
|
|
4743
4757
|
pendingNotices.clear()
|
package/lib/src/enroll.js
CHANGED
|
@@ -242,7 +242,7 @@ export function createEnrollDesk ({
|
|
|
242
242
|
const qr = { v: 2, iss, proxy, token, sn, m: mode, ...(acct ? { acct } : {}) }
|
|
243
243
|
const stopAnnounce = announceInvite(qr)
|
|
244
244
|
pending.set(token, { token, exp: Date.now() + PAIRING_TTL_MS, scope, caps, ttlMs, label, sn, mode, account: acct, state: 'AWAITING_ENROLL', stopAnnounce })
|
|
245
|
-
// `nearby`: la invitación también se anuncia por Bluetooth (§1.6), para decirlo en pantalla.
|
|
245
|
+
// `nearby`: la invitación también se anuncia en la red local y por Bluetooth (§1.6), para decirlo en pantalla.
|
|
246
246
|
return { token, qr, expiresInMs: PAIRING_TTL_MS, nearby: !!stopAnnounce }
|
|
247
247
|
}
|
|
248
248
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/vaultd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.174.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.126.2",
|
|
26
26
|
"@dotrino/opaque": "0.1.0",
|
|
27
27
|
"@dotrino/passmanager": "0.18.4",
|
|
28
|
-
"@dotrino/proxy-client": "0.
|
|
28
|
+
"@dotrino/proxy-client": "^0.44.1",
|
|
29
29
|
"@dotrino/roadmap": "0.4.58",
|
|
30
30
|
"@dotrino/store": "0.12.3",
|
|
31
31
|
"@dotrino/update": "0.9.0",
|
package/src/ctl.js
CHANGED
|
@@ -404,7 +404,7 @@ async function cmdPair (args = []) {
|
|
|
404
404
|
console.log(`${R} NO lo compartas con nadie, ni con "soporte". Solo escanéalo en TU dispositivo.${Z}`)
|
|
405
405
|
console.log('\nO abre esta dirección en el dispositivo:\n ' + url)
|
|
406
406
|
console.log('\nO pega este código en vault.dotrino.com/vault :\n ' + b64)
|
|
407
|
-
if (pair.nearby) console.log('\nO, en un teléfono cerca, pulsa «Descubrir»: esta invitación también se anuncia por Bluetooth.')
|
|
407
|
+
if (pair.nearby) console.log('\nO, en un teléfono cerca, pulsa «Descubrir»: esta invitación también se anuncia en tu red y por Bluetooth.')
|
|
408
408
|
|
|
409
409
|
// --save [archivo]: escribe la invitación (.dpair) para transferirla y abrirla en profile.
|
|
410
410
|
const saveIdx = args.indexOf('--save')
|
package/src/platform.js
CHANGED
|
@@ -114,6 +114,9 @@ export function nodePlatform (dir) {
|
|
|
114
114
|
// otro sistema el pilar no encuentra con qué y sigue sin él. Sirve para anunciar cerca la
|
|
115
115
|
// invitación de emparejar (pairing-protocol.md §1.6) y como escalón directo.
|
|
116
116
|
bluetooth: true,
|
|
117
|
+
// LA RED LOCAL (proxy-client docs/lan.md): la misma invitación por mDNS, en Linux, macOS y
|
|
118
|
+
// Windows. No abre ningún puerto: es un anuncio multicast.
|
|
119
|
+
lan: true,
|
|
117
120
|
async openIdentity ({ openKey = null, log = console.log } = {}) {
|
|
118
121
|
// CIFRADO EN REPOSO ligado a esta máquina: ningún archivo del dir queda en claro, así
|
|
119
122
|
// que copiarlos a otro equipo no sirve de nada. La identidad se migra AQUÍ (verificando
|
package/src/tui/i18n.js
CHANGED
|
@@ -471,7 +471,7 @@ const es = {
|
|
|
471
471
|
pairScan: 'Escanéalo, o abre esta dirección en el dispositivo:',
|
|
472
472
|
pairUrl: 'URL: ',
|
|
473
473
|
pairPaste: 'O pega este código en vault.dotrino.com/vault:',
|
|
474
|
-
pairNearby: 'O, en un teléfono cerca, pulsa «Descubrir»: también se anuncia por Bluetooth.',
|
|
474
|
+
pairNearby: 'O, en un teléfono cerca, pulsa «Descubrir»: también se anuncia en tu red y por Bluetooth.',
|
|
475
475
|
pairWarning: '⚠ Este código deja LEER tus datos y FIRMAR con tu identidad. No lo compartas.',
|
|
476
476
|
pairConnected: (id) => `⧗ Se conectó: ${id} — pulsa A y escribe el código que muestra.`,
|
|
477
477
|
pairWaiting: 'Esperando a que el dispositivo se conecte…',
|
|
@@ -991,7 +991,7 @@ const en = {
|
|
|
991
991
|
pairScan: 'Scan it, or open this address on the device:',
|
|
992
992
|
pairUrl: 'URL: ',
|
|
993
993
|
pairPaste: 'Or paste this code into vault.dotrino.com/vault:',
|
|
994
|
-
pairNearby: 'Or, on a phone nearby, tap «Discover»: it is also announced over Bluetooth.',
|
|
994
|
+
pairNearby: 'Or, on a phone nearby, tap «Discover»: it is also announced on your network and over Bluetooth.',
|
|
995
995
|
pairWarning: '⚠ This code lets someone READ your data and SIGN as you. Do not share it.',
|
|
996
996
|
pairConnected: (id) => `⧗ Connected: ${id} — press A and type the code it shows.`,
|
|
997
997
|
pairWaiting: 'Waiting for the device to connect…',
|
package/src/vaultControl.js
CHANGED
|
@@ -846,7 +846,7 @@ export async function startPairing ({ profile, service, label, caps } = {}) {
|
|
|
846
846
|
// `profile`/`profileName`: DE QUÉ CUENTA del vault sale este QR. El vault
|
|
847
847
|
// puede tener varias y el emparejamiento mete al dispositivo en UNA; la TUI
|
|
848
848
|
// y la CLI lo muestran para que no se enrole en la equivocada.
|
|
849
|
-
// `nearby`: la invitación también se anuncia por Bluetooth (pairing-protocol.md §1.6).
|
|
849
|
+
// `nearby`: la invitación también se anuncia en la red local y por Bluetooth (pairing-protocol.md §1.6).
|
|
850
850
|
return { qr: pr.qr, expiresAt: pr.expiresAt, url, payload, code, b64: code, profile: pr.profile || null, profileName: pr.profileName || '', nearby: !!pr.nearby }
|
|
851
851
|
}
|
|
852
852
|
}
|