Publish branch server bundles for thin desktop builds

This commit is contained in:
Simos Mikelatos
2026-06-19 07:08:19 +00:00
parent 5be100ea1b
commit 25ab273b05
5 changed files with 59 additions and 3 deletions

View File

@@ -35,6 +35,7 @@ export class ServerInstaller {
arch = process.arch,
installRoot = process.env.CLOUDCLI_SERVER_DIR || DEFAULT_INSTALL_ROOT,
bundleBaseUrl = process.env.CLOUDCLI_SERVER_BUNDLE_URL || DEFAULT_BUNDLE_BASE_URL,
bundleReleaseTag = process.env.CLOUDCLI_SERVER_BUNDLE_RELEASE_TAG || '',
onLog,
} = {}) {
if (!version) throw new Error('ServerInstaller requires the app version');
@@ -43,6 +44,7 @@ export class ServerInstaller {
this.arch = mapArch(arch);
this.installRoot = installRoot;
this.bundleBaseUrl = bundleBaseUrl.replace(/\/+$/, '');
this.bundleReleaseTag = bundleReleaseTag || `v${this.version}`;
this.onLog = typeof onLog === 'function' ? onLog : () => {};
}
@@ -61,7 +63,7 @@ export class ServerInstaller {
}
getBundleUrl() {
const url = new URL(`${this.bundleBaseUrl}/v${this.version}/${this.getBundleName()}`);
const url = new URL(`${this.bundleBaseUrl}/${this.bundleReleaseTag}/${this.getBundleName()}`);
if (url.protocol !== 'https:' && !(url.protocol === 'http:' && LOCAL_DOWNLOAD_HOSTS.has(url.hostname))) {
throw new Error(`Refusing unsupported server bundle URL: ${url.toString()}`);
}