@owear/cli 0.1.2 → 0.1.4
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 +10 -8
- package/src/ow.js +548 -25
- package/template/README.md +34 -28
- package/template/app/main.ts +273 -4
- package/template/index.html +117 -28
- package/template/package.json +1 -1
- package/template/public/favicon.svg +4 -0
- package/template/src/assets/dancing-script.woff2 +0 -0
- package/template/src/assets/jetbrains-mono.woff2 +0 -0
- package/template/src/ow.d.ts +9 -1
- package/template/src/renderer.ts +489 -1
- package/template/src/style.css +280 -56
- package/template-installer/README.md +38 -0
- package/template-installer/app/main.ts +22 -0
- package/template-installer/index.html +70 -0
- package/template-installer/package.json +22 -0
- package/template-installer/src/assets/dancing-script.woff2 +0 -0
- package/template-installer/src/assets/jetbrains-mono.woff2 +0 -0
- package/template-installer/src/installer.ts +171 -0
- package/template-installer/src/style.css +442 -0
- package/template-installer/tsconfig.json +13 -0
- package/template-installer/uninstaller/app/main.ts +16 -0
- package/template-installer/uninstaller/index.html +54 -0
- package/template-installer/uninstaller/package.json +22 -0
- package/template-installer/uninstaller/src/uninstaller.ts +101 -0
- package/template-installer/uninstaller/vite.config.ts +10 -0
- package/template-installer/vite.config.ts +15 -0
- package/tools/owear-installer.mjs +86 -0
- package/tools/owear-linux.mjs +158 -0
- package/tools/owear-msi.mjs +113 -0
- package/tools/owear-pack.mjs +93 -0
- package/tools/owear-sign.mjs +204 -0
- package/tools/owear-update.mjs +150 -0
- package/LICENSE +0 -201
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Copyright 2026 Owear Contributors
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
// tools/owear-sign.mjs — firma de artefactos de Owear.
|
|
6
|
+
//
|
|
7
|
+
// Dos mecanismos, combinables:
|
|
8
|
+
//
|
|
9
|
+
// 1. Authenticode (Windows PE, .exe/.msi): firma del binario con un
|
|
10
|
+
// certificado (PFX/P12). Requiere `osslsigncode` (Linux/macOS) o
|
|
11
|
+
// `signtool` (Windows). Da confianza de **editor** ante el SO
|
|
12
|
+
// (SmartScreen, "Unknown publisher").
|
|
13
|
+
//
|
|
14
|
+
// 2. Ed25519 desprendida (cualquier plataforma): escribe `<file>.sig` con la
|
|
15
|
+
// firma del fichero completo. La clave pública (misma que el updater)
|
|
16
|
+
// permite verificar el artefacto de forma independiente del feed.
|
|
17
|
+
//
|
|
18
|
+
// Nunca rompe un build: si no hay material de firma o falta la herramienta,
|
|
19
|
+
// omite con un aviso (salvo `--require`, que lo convierte en error).
|
|
20
|
+
//
|
|
21
|
+
// Uso:
|
|
22
|
+
// node tools/owear-sign.mjs --file release/MiApp \
|
|
23
|
+
// [--ed25519-key owear-signing.pem] \
|
|
24
|
+
// [--pfx cert.p12 --pfx-password-env OW_PFX_PASS] \
|
|
25
|
+
// [--timestamp http://timestamp.digicert.com] \
|
|
26
|
+
// [--name "Mi App" --url https://miapp.dev] \
|
|
27
|
+
// [--require] [--dry-run]
|
|
28
|
+
//
|
|
29
|
+
import * as fs from 'node:fs'
|
|
30
|
+
import * as path from 'node:path'
|
|
31
|
+
import * as crypto from 'node:crypto'
|
|
32
|
+
import { spawnSync } from 'node:child_process'
|
|
33
|
+
import { fileURLToPath } from 'node:url'
|
|
34
|
+
|
|
35
|
+
const C = { reset: '\x1b[0m', dim: '\x1b[2m', green: '\x1b[32m', yellow: '\x1b[33m', red: '\x1b[31m' }
|
|
36
|
+
const info = (m) => console.log(`${C.dim}[owear-sign]${C.reset} ${m}`)
|
|
37
|
+
const warn = (m) => console.warn(`${C.yellow}[owear-sign] ⚠${C.reset} ${m}`)
|
|
38
|
+
const fail = (m) => console.error(`${C.red}[owear-sign] ✗${C.reset} ${m}`)
|
|
39
|
+
|
|
40
|
+
const isPE = (file) => {
|
|
41
|
+
try {
|
|
42
|
+
const fd = fs.openSync(file, 'r')
|
|
43
|
+
const b = Buffer.alloc(2)
|
|
44
|
+
fs.readSync(fd, b, 0, 2, 0)
|
|
45
|
+
fs.closeSync(fd)
|
|
46
|
+
return b[0] === 0x4d && b[1] === 0x5a // "MZ"
|
|
47
|
+
} catch {
|
|
48
|
+
return false
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const PE_EXT = new Set(['.exe', '.dll', '.msi', '.sys', '.ocx', '.scr'])
|
|
53
|
+
|
|
54
|
+
/** ¿Es un PE/MSI firmable con Authenticode? (por extensión o cabecera MZ). */
|
|
55
|
+
export function isAuthenticodeTarget(file) {
|
|
56
|
+
if (PE_EXT.has(path.extname(file).toLowerCase())) return true
|
|
57
|
+
return isPE(file)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Comando de firma Authenticode según la herramienta disponible. */
|
|
61
|
+
export function buildAuthenticodeInvocation({ tool, file, pfx, password, timestamp, name, url }) {
|
|
62
|
+
if (tool === 'osslsigncode') {
|
|
63
|
+
const args = ['sign', '-pkcs12', pfx, '-in', file, '-out', `${file}.signed`]
|
|
64
|
+
if (password) args.push('-pass', password)
|
|
65
|
+
if (name) args.push('-n', name)
|
|
66
|
+
if (url) args.push('-i', url)
|
|
67
|
+
if (timestamp) args.push('-t', timestamp)
|
|
68
|
+
return { cmd: 'osslsigncode', args, out: `${file}.signed`, inPlace: true }
|
|
69
|
+
}
|
|
70
|
+
if (tool === 'signtool') {
|
|
71
|
+
const args = ['sign', '/f', pfx, '/fd', 'SHA256', '/d', name || path.basename(file)]
|
|
72
|
+
if (password) args.push('/p', password)
|
|
73
|
+
if (timestamp) args.push('/tr', timestamp, '/td', 'SHA256')
|
|
74
|
+
args.push(file)
|
|
75
|
+
return { cmd: 'signtool', args, out: file, inPlace: false }
|
|
76
|
+
}
|
|
77
|
+
throw new Error(`herramienta de firma desconocida: ${tool}`)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** ¿Está la herramienta en el PATH? */
|
|
81
|
+
export function hasTool(cmd) {
|
|
82
|
+
const probe = process.platform === 'win32' ? 'where' : 'which'
|
|
83
|
+
return spawnSync(probe, [cmd], { stdio: 'ignore' }).status === 0
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Firma Ed25519 desprendida: escribe `<file>.sig` (base64) y devuelve la firma. */
|
|
87
|
+
export function signEd25519(file, keyPath) {
|
|
88
|
+
const data = fs.readFileSync(file)
|
|
89
|
+
const key = crypto.createPrivateKey(fs.readFileSync(keyPath))
|
|
90
|
+
const sig = crypto.sign(null, data, key)
|
|
91
|
+
fs.writeFileSync(`${file}.sig`, sig.toString('base64') + '\n')
|
|
92
|
+
return sig
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Verifica una firma Ed25519 desprendida contra `pub` (PEM o SPKI base64). */
|
|
96
|
+
export function verifyEd25519(file, sigPath, pub) {
|
|
97
|
+
const key = pub.includes('BEGIN')
|
|
98
|
+
? crypto.createPublicKey(pub)
|
|
99
|
+
: crypto.createPublicKey({ key: Buffer.from(pub, 'base64'), format: 'der', type: 'spki' })
|
|
100
|
+
const data = fs.readFileSync(file)
|
|
101
|
+
const sig = Buffer.from(fs.readFileSync(sigPath, 'utf8').trim(), 'base64')
|
|
102
|
+
return crypto.verify(null, data, key, sig)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Firma Authenticode (in-place si es posible). Devuelve 'signed'|'skipped'|'failed'. */
|
|
106
|
+
export function signAuthenticode({ file, pfx, password, timestamp, name, url, require = false }) {
|
|
107
|
+
const tool = hasTool('osslsigncode') ? 'osslsigncode' : hasTool('signtool') ? 'signtool' : null
|
|
108
|
+
if (!tool) {
|
|
109
|
+
const msg = 'ni osslsigncode ni signtool están en el PATH'
|
|
110
|
+
if (require) throw new Error(msg)
|
|
111
|
+
warn(`${msg} — Authenticode omitido`)
|
|
112
|
+
return 'skipped'
|
|
113
|
+
}
|
|
114
|
+
if (!pfx || !fs.existsSync(pfx)) {
|
|
115
|
+
const msg = `certificado no encontrado: ${pfx ?? '(sin --pfx)'}`
|
|
116
|
+
if (require) throw new Error(msg)
|
|
117
|
+
warn(`${msg} — Authenticode omitido`)
|
|
118
|
+
return 'skipped'
|
|
119
|
+
}
|
|
120
|
+
const inv = buildAuthenticodeInvocation({ tool, file, pfx, password, timestamp, name, url })
|
|
121
|
+
const r = spawnSync(inv.cmd, inv.args, { stdio: 'inherit' })
|
|
122
|
+
if (r.status !== 0) {
|
|
123
|
+
if (require) throw new Error(`${inv.cmd} falló (${r.status})`)
|
|
124
|
+
warn(`${inv.cmd} falló (${r.status})`)
|
|
125
|
+
return 'failed'
|
|
126
|
+
}
|
|
127
|
+
if (inv.inPlace) {
|
|
128
|
+
fs.renameSync(inv.out, file)
|
|
129
|
+
info(`Authenticode OK (${tool})`)
|
|
130
|
+
} else {
|
|
131
|
+
info(`Authenticode OK (${tool})`)
|
|
132
|
+
}
|
|
133
|
+
return 'signed'
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function main() {
|
|
137
|
+
const argv = process.argv.slice(2)
|
|
138
|
+
const arg = (n, def = null) => (argv.includes(n) ? argv[argv.indexOf(n) + 1] : def)
|
|
139
|
+
const flag = (n) => argv.includes(n)
|
|
140
|
+
|
|
141
|
+
const file = arg('--file')
|
|
142
|
+
if (!file) {
|
|
143
|
+
fail('--file es obligatorio')
|
|
144
|
+
process.exit(1)
|
|
145
|
+
}
|
|
146
|
+
if (!fs.existsSync(file)) {
|
|
147
|
+
fail(`no existe: ${file}`)
|
|
148
|
+
process.exit(1)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const edKey = arg('--ed25519-key')
|
|
152
|
+
const pfx = arg('--pfx')
|
|
153
|
+
const pwEnv = arg('--pfx-password-env')
|
|
154
|
+
const password = arg('--password', pwEnv ? process.env[pwEnv] ?? '' : '')
|
|
155
|
+
const timestamp = arg('--timestamp')
|
|
156
|
+
const name = arg('--name')
|
|
157
|
+
const url = arg('--url')
|
|
158
|
+
const require = flag('--require')
|
|
159
|
+
const dryRun = flag('--dry-run')
|
|
160
|
+
const isWin = process.platform === 'win32'
|
|
161
|
+
|
|
162
|
+
let did = 0
|
|
163
|
+
|
|
164
|
+
// 1) Authenticode (solo PE/MSI y solo en Windows o con osslsigncode)
|
|
165
|
+
if (pfx) {
|
|
166
|
+
if (!isAuthenticodeTarget(file)) {
|
|
167
|
+
info(`${path.basename(file)} no es PE/MSI — Authenticode no aplica`)
|
|
168
|
+
} else if (dryRun) {
|
|
169
|
+
const tool = hasTool('osslsigncode') ? 'osslsigncode' : 'signtool'
|
|
170
|
+
const inv = buildAuthenticodeInvocation({ tool, file, pfx, password, timestamp, name, url })
|
|
171
|
+
console.log(JSON.stringify({ authenticode: { cmd: inv.cmd, args: inv.args } }))
|
|
172
|
+
did++
|
|
173
|
+
} else {
|
|
174
|
+
if (signAuthenticode({ file, pfx, password, timestamp, name, url, require }) === 'signed') did++
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// 2) Ed25519 desprendida (siempre disponible)
|
|
179
|
+
if (edKey) {
|
|
180
|
+
if (!fs.existsSync(edKey)) {
|
|
181
|
+
fail(`clave no encontrada: ${edKey}`)
|
|
182
|
+
process.exit(1)
|
|
183
|
+
}
|
|
184
|
+
if (dryRun) {
|
|
185
|
+
console.log(JSON.stringify({ ed25519: { file, key: edKey, out: `${file}.sig` } }))
|
|
186
|
+
} else {
|
|
187
|
+
signEd25519(file, edKey)
|
|
188
|
+
info(`Ed25519 OK → ${path.basename(file)}.sig`)
|
|
189
|
+
did++
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (!did) {
|
|
194
|
+
if (require) {
|
|
195
|
+
fail('no se firmó nada (--require)')
|
|
196
|
+
process.exit(1)
|
|
197
|
+
}
|
|
198
|
+
warn('sin material de firma (--ed25519-key / --pfx) — nada que hacer')
|
|
199
|
+
}
|
|
200
|
+
void isWin
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Ejecuta main solo como script (permite importarlo en tests).
|
|
204
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) main()
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Copyright 2026 Owear Contributors
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
//
|
|
5
|
+
// tools/owear-update.mjs — publica un update de Owear: calcula el blockmap
|
|
6
|
+
// (delta por bloques), genera el manifiesto YAML del canal y lo firma con
|
|
7
|
+
// Ed25519.
|
|
8
|
+
//
|
|
9
|
+
// Salidas (en --out-dir, por defecto junto al artefacto):
|
|
10
|
+
// <file>.blockmap { blockSize, size, blocks:[sha256…] }
|
|
11
|
+
// <channel>.yml manifiesto YAML (version, sha256, sha512, blockSize,
|
|
12
|
+
// blockmap, path, releaseDate, notes, signature)
|
|
13
|
+
//
|
|
14
|
+
// El SDK (autoUpdater) verifica `signature` con la clave pública del bridge
|
|
15
|
+
// (Ed25519 sobre "<version>:<sha256>") y descarga solo los bloques cambiados.
|
|
16
|
+
//
|
|
17
|
+
// Uso:
|
|
18
|
+
// node tools/owear-update.mjs --file release/MiApp-1.4.0 --version 1.4.0 \
|
|
19
|
+
// --channel latest --url https://up.miapp.dev --key private.pem \
|
|
20
|
+
// [--notes "…"|--notes @notes.md] [--block-size 262144] [--mandatory] \
|
|
21
|
+
// [--out-dir release]
|
|
22
|
+
//
|
|
23
|
+
// # claves (una vez):
|
|
24
|
+
// node tools/owear-update.mjs --gen-key ./owear-signing
|
|
25
|
+
// → owear-signing.pem (privada, Ed25519 PKCS8)
|
|
26
|
+
// owear-signing.pub.b64 (pública SPKI base64 — va en el bridge)
|
|
27
|
+
//
|
|
28
|
+
import * as fs from 'node:fs'
|
|
29
|
+
import * as path from 'node:path'
|
|
30
|
+
import * as crypto from 'node:crypto'
|
|
31
|
+
|
|
32
|
+
function die(m) {
|
|
33
|
+
console.error(`[owear-update] ✗ ${m}`)
|
|
34
|
+
process.exit(1)
|
|
35
|
+
}
|
|
36
|
+
const argv = process.argv.slice(2)
|
|
37
|
+
const arg = (n, def = null) => (argv.includes(n) ? argv[argv.indexOf(n) + 1] : def)
|
|
38
|
+
const flag = (n) => argv.includes(n)
|
|
39
|
+
|
|
40
|
+
// ── generación de claves ────────────────────────────────────────────────────
|
|
41
|
+
const genKey = arg('--gen-key')
|
|
42
|
+
if (genKey) {
|
|
43
|
+
if (fs.existsSync(`${genKey}.pem`)) die(`ya existe ${genKey}.pem`)
|
|
44
|
+
const { publicKey, privateKey } = crypto.generateKeyPairSync('ed25519')
|
|
45
|
+
fs.writeFileSync(`${genKey}.pem`, privateKey.export({ format: 'pem', type: 'pkcs8' }), { mode: 0o600 })
|
|
46
|
+
fs.writeFileSync(`${genKey}.pub.b64`, publicKey.export({ format: 'der', type: 'spki' }).toString('base64'))
|
|
47
|
+
console.log(`[owear-update] ✓ clave privada: ${genKey}.pem`)
|
|
48
|
+
console.log(`[owear-update] ✓ clave pública: ${genKey}.pub.b64 (ponla en el bridge: updater.publicKey)`)
|
|
49
|
+
process.exit(0)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ── validación de argumentos ────────────────────────────────────────────────
|
|
53
|
+
const file = arg('--file')
|
|
54
|
+
const version = arg('--version')
|
|
55
|
+
if (!file || !version) die('--file y --version son obligatorios (o usa --gen-key)')
|
|
56
|
+
if (!fs.existsSync(file)) die(`no existe el artefacto: ${file}`)
|
|
57
|
+
if (!/^\d+\.\d+\.\d+/.test(version)) die(`versión inválida: ${version} (semver esperado)`)
|
|
58
|
+
|
|
59
|
+
const channel = arg('--channel', 'latest')
|
|
60
|
+
const blockSize = parseInt(arg('--block-size', '262144'), 10)
|
|
61
|
+
if (!Number.isFinite(blockSize) || blockSize <= 0) die('--block-size inválido')
|
|
62
|
+
const baseUrl = (arg('--url', '') || '').replace(/\/+$/, '')
|
|
63
|
+
const outDir = arg('--out-dir', path.dirname(file))
|
|
64
|
+
const keyPath = arg('--key')
|
|
65
|
+
const mandatory = flag('--mandatory')
|
|
66
|
+
|
|
67
|
+
let notes = arg('--notes', '')
|
|
68
|
+
if (notes.startsWith('@')) {
|
|
69
|
+
const nf = notes.slice(1)
|
|
70
|
+
if (!fs.existsSync(nf)) die(`no existe el fichero de notas: ${nf}`)
|
|
71
|
+
notes = fs.readFileSync(nf, 'utf8').trimEnd()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ── integridad + blockmap ───────────────────────────────────────────────────
|
|
75
|
+
const data = fs.readFileSync(file)
|
|
76
|
+
const sha256 = crypto.createHash('sha256').update(data).digest('hex')
|
|
77
|
+
const sha512 = crypto.createHash('sha512').update(data).digest('hex')
|
|
78
|
+
|
|
79
|
+
const blocks = []
|
|
80
|
+
for (let off = 0; off < data.length; off += blockSize) {
|
|
81
|
+
blocks.push(crypto.createHash('sha256').update(data.subarray(off, Math.min(off + blockSize, data.length))).digest('hex'))
|
|
82
|
+
}
|
|
83
|
+
if (data.length === 0) blocks.push(crypto.createHash('sha256').update(Buffer.alloc(0)).digest('hex'))
|
|
84
|
+
|
|
85
|
+
fs.mkdirSync(outDir, { recursive: true })
|
|
86
|
+
const artifactName = path.basename(file)
|
|
87
|
+
const blockmapPath = path.join(outDir, `${artifactName}.blockmap`)
|
|
88
|
+
fs.writeFileSync(blockmapPath, JSON.stringify({ blockSize, size: data.length, sha256, blocks }))
|
|
89
|
+
|
|
90
|
+
// ── firma Ed25519 (del manifiesto y del binario) ────────────────────────────
|
|
91
|
+
// signature: sobre "<version>:<sha256>" (autentica metadata)
|
|
92
|
+
// binarySig: sobre los bytes del artefacto (autentica el payload)
|
|
93
|
+
let signature = ''
|
|
94
|
+
let binarySig = ''
|
|
95
|
+
if (keyPath) {
|
|
96
|
+
if (!fs.existsSync(keyPath)) die(`no existe la clave: ${keyPath}`)
|
|
97
|
+
const privateKey = crypto.createPrivateKey(fs.readFileSync(keyPath))
|
|
98
|
+
signature = crypto
|
|
99
|
+
.sign(null, Buffer.from(`${version}:${sha256}`), privateKey)
|
|
100
|
+
.toString('base64')
|
|
101
|
+
binarySig = crypto.sign(null, data, privateKey).toString('base64')
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ── manifiesto YAML ─────────────────────────────────────────────────────────
|
|
105
|
+
const blockmapUrl = baseUrl ? `${baseUrl}/${path.basename(blockmapPath)}` : path.basename(blockmapPath)
|
|
106
|
+
const releaseDate = new Date().toISOString()
|
|
107
|
+
const yamlEscape = (s) => (/[:#'"@|>{}\[\],&*!?%`-]|^\s|\s$|\n/.test(s) ? `'${s.replace(/'/g, "''")}'` : s)
|
|
108
|
+
// las notas van como bloque literal
|
|
109
|
+
const notesBlock = notes
|
|
110
|
+
? `notes: |\n${notes
|
|
111
|
+
.split('\n')
|
|
112
|
+
.map((l) => ` ${l}`)
|
|
113
|
+
.join('\n')}\n`
|
|
114
|
+
: ''
|
|
115
|
+
|
|
116
|
+
const manifest = [
|
|
117
|
+
`version: ${version}`,
|
|
118
|
+
`releaseDate: '${releaseDate}'`,
|
|
119
|
+
`path: ${yamlEscape(artifactName)}`,
|
|
120
|
+
// hashes y firmas se citan siempre: un valor "numérico" (p. ej. un hash solo
|
|
121
|
+
// de dígitos) no debe reinterpretarse como número al parsear el YAML.
|
|
122
|
+
`sha256: '${sha256}'`,
|
|
123
|
+
`sha512: '${sha512}'`,
|
|
124
|
+
`size: ${data.length}`,
|
|
125
|
+
`blockSize: ${blockSize}`,
|
|
126
|
+
`blockmap: ${yamlEscape(blockmapUrl)}`,
|
|
127
|
+
mandatory ? 'mandatory: true' : null,
|
|
128
|
+
signature ? `signature: '${signature}'` : null,
|
|
129
|
+
binarySig ? `binarySig: '${binarySig}'` : null,
|
|
130
|
+
notesBlock || null,
|
|
131
|
+
'',
|
|
132
|
+
]
|
|
133
|
+
.filter((l) => l !== null)
|
|
134
|
+
.join('\n')
|
|
135
|
+
|
|
136
|
+
const manifestPath = path.join(outDir, `${channel}.yml`)
|
|
137
|
+
fs.writeFileSync(manifestPath, manifest)
|
|
138
|
+
|
|
139
|
+
// ── resumen ─────────────────────────────────────────────────────────────────
|
|
140
|
+
const mb = (n) => (n / 1024 / 1024).toFixed(1)
|
|
141
|
+
console.log(`[owear-update] ✓ artefacto ${artifactName} ${mb(data.length)} MB`)
|
|
142
|
+
console.log(`[owear-update] ✓ blockmap ${path.basename(blockmapPath)} (${blocks.length} bloques × ${(blockSize / 1024).toFixed(0)} KiB)`)
|
|
143
|
+
console.log(`[owear-update] ✓ manifiesto ${manifestPath}`)
|
|
144
|
+
console.log(`[owear-update] ${signature ? '✓ firmado' : '⚠ sin firma (--key)'} sha256=${sha256.slice(0, 16)}…`)
|
|
145
|
+
if (baseUrl) {
|
|
146
|
+
console.log(`[owear-update] feed: ${baseUrl}`)
|
|
147
|
+
console.log(`[owear-update] ${baseUrl}/${channel}.yml`)
|
|
148
|
+
console.log(`[owear-update] ${baseUrl}/${artifactName}`)
|
|
149
|
+
console.log(`[owear-update] ${baseUrl}/${path.basename(blockmapPath)}`)
|
|
150
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|