@dotrino/vaultd 0.158.0 → 0.158.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/bin/dotrino-vault-tui.js +1 -1
- package/bin/sea-entry.js +3 -3
- package/lib/src/atrest.js +2 -2
- package/lib/src/core/libVersion.js +1 -1
- package/package.json +1 -1
package/bin/dotrino-vault-tui.js
CHANGED
|
@@ -23,6 +23,6 @@ if (!process.stdout.isTTY) {
|
|
|
23
23
|
|
|
24
24
|
runTui().catch((e) => {
|
|
25
25
|
// El finally de runTui ya restauró el terminal; aquí solo reportamos.
|
|
26
|
-
console.error('error
|
|
26
|
+
console.error('TUI error:', e?.stack || e?.message || e)
|
|
27
27
|
process.exit(1)
|
|
28
28
|
})
|
package/bin/sea-entry.js
CHANGED
|
@@ -16,11 +16,11 @@ if (argv[0] === '--tui') {
|
|
|
16
16
|
// ni el proxy: habla con el daemon por el dir de datos + señales.
|
|
17
17
|
if (!process.stdout.isTTY) { console.error('la TUI necesita un terminal interactivo (TTY).'); process.exit(2) }
|
|
18
18
|
import('../src/tui/app.js').then(({ runTui }) => runTui())
|
|
19
|
-
.catch((e) => { console.error('error
|
|
19
|
+
.catch((e) => { console.error('TUI error:', e.message); process.exit(1) })
|
|
20
20
|
} else if (argv[0] === '--gui-bridge') {
|
|
21
21
|
// El canal de la ventana de escritorio (JSON por stdin/stdout, ver src/tui/gui.js).
|
|
22
22
|
import('../src/tui/gui.js').then(({ runGuiBridge }) => runGuiBridge()).then(() => process.exit(0))
|
|
23
|
-
.catch((e) => { console.error('
|
|
23
|
+
.catch((e) => { console.error('window bridge error:', e.message); process.exit(1) })
|
|
24
24
|
} else if (argv[0] === '--ctl') {
|
|
25
25
|
// CLI de control: NO toca la identidad ni el proxy; habla con el daemon vía
|
|
26
26
|
// el dir de datos (state.json) y señales (SIGUSR1 para emparejar).
|
|
@@ -29,5 +29,5 @@ if (argv[0] === '--tui') {
|
|
|
29
29
|
} else {
|
|
30
30
|
// Modo daemon (servicio).
|
|
31
31
|
import('../src/daemon.js').then(({ runDaemon }) => runDaemon(argv))
|
|
32
|
-
.catch((e) => { console.error('
|
|
32
|
+
.catch((e) => { console.error('fatal daemon error:', e.message); process.exit(1) })
|
|
33
33
|
}
|
package/lib/src/atrest.js
CHANGED
|
@@ -132,7 +132,7 @@ export function encryptText (plaintext, key) {
|
|
|
132
132
|
|
|
133
133
|
export function decryptText (blob, key) {
|
|
134
134
|
const [magic, iv, ct, tag] = String(blob).split('.')
|
|
135
|
-
if (magic !== MAGIC) throw new Error('at-rest:
|
|
135
|
+
if (magic !== MAGIC) throw new Error('at-rest: unknown format')
|
|
136
136
|
const d = crypto.createDecipheriv('aes-256-gcm', key, Buffer.from(iv, 'base64'))
|
|
137
137
|
d.setAuthTag(Buffer.from(tag, 'base64'))
|
|
138
138
|
return Buffer.concat([d.update(Buffer.from(ct, 'base64')), d.final()]).toString('utf8')
|
|
@@ -176,7 +176,7 @@ export function migrateFile (file, key) {
|
|
|
176
176
|
try { text = fs.readFileSync(file, 'utf8') } catch (_) { return 'sin-archivo' }
|
|
177
177
|
if (isEncrypted(text)) return 'ya-cifrado'
|
|
178
178
|
const blob = encryptText(text, key)
|
|
179
|
-
if (decryptText(blob, key) !== text) throw new Error('at-rest:
|
|
179
|
+
if (decryptText(blob, key) !== text) throw new Error('at-rest: verification failed, the original is untouched')
|
|
180
180
|
const tmp = file + '.atrest.tmp'
|
|
181
181
|
fs.writeFileSync(tmp, blob, { mode: 0o600 })
|
|
182
182
|
fs.renameSync(tmp, file)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/vaultd",
|
|
3
|
-
"version": "0.158.
|
|
3
|
+
"version": "0.158.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": {
|