mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-14 06:07:23 -05:00
feat: add signed Windows launcher self-updates with SHA-256 verification
This commit is contained in:
@@ -43,7 +43,12 @@ function canonicalManifest(manifest) {
|
||||
const c = manifest.components[name];
|
||||
return `${name}:${c.file}:${c.sha256}:${c.id}:${c.size}`;
|
||||
});
|
||||
return ['vyla-manifest-v2', normalizeTag(manifest.version), manifest.sha256, ...parts].join('\n');
|
||||
const lines = ['vyla-manifest-v2', normalizeTag(manifest.version), manifest.sha256, ...parts];
|
||||
if (manifest.installer) {
|
||||
const i = manifest.installer;
|
||||
lines.push(`installer:${i.file}:${i.sha256}:${i.size}:${normalizeTag(i.version)}`);
|
||||
}
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
function verifyManifest(manifest) {
|
||||
@@ -381,11 +386,25 @@ class UpdateClient {
|
||||
components[name] = { url: link.url, sha256: c.sha256, id: c.id, size: c.size };
|
||||
}
|
||||
|
||||
let installer = null;
|
||||
if (manifest.installer) {
|
||||
const installerLink = links.find((a) => a.name === manifest.installer.file);
|
||||
if (installerLink) {
|
||||
installer = {
|
||||
url: installerLink.url,
|
||||
sha256: manifest.installer.sha256,
|
||||
size: manifest.installer.size,
|
||||
version: manifest.installer.version
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const out = {
|
||||
version: release.tag_name,
|
||||
sha256: manifest.sha256 || null,
|
||||
manifest,
|
||||
components
|
||||
components,
|
||||
installer
|
||||
};
|
||||
this.writeCache({ checkedAt: now, etag: result.etag || null, release: out });
|
||||
return out;
|
||||
|
||||
Reference in New Issue
Block a user