Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion scripts/selfhost-release-assets.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,27 @@ function replaceInstallerDefault(content, item, replacement) {
return content.replace(expected, replacementLine);
}

function withInferredInstallerDefaults(args) {
const inferred = { ...args };
const releaseAssetBaseUrl = args.baseUrl || "";
const releaseImageTag =
args.imageTag || (args.releaseTag ? `${args.imageRepository || DEFAULT_IMAGE_REPOSITORY}:${args.releaseTag}` : "");
Comment on lines +181 to +182

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the published image for inferred installer fallback

For release builds that pass an exact --image value but omit --image-tag, buildManifest() writes that exact image to release.json, while this inference builds DEFAULT_IMAGE from the repository/tag fallback instead. If the installer cannot fetch release.json and has to use DEFAULT_IMAGE, it can install ghcr.io/subboost/subboost:<tag> rather than the image actually published for that release. Derive the fallback from args.image || args.imageTag || ..., or require --image-tag whenever --image is supplied.

Useful? React with 👍 / 👎.


if (releaseAssetBaseUrl) {
inferred.installerReleaseUrl = inferred.installerReleaseUrl || urlJoin(releaseAssetBaseUrl, "release.json");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep stable installs on the latest update channel

When the generated installer is downloaded through the normal releases/latest/download/install.sh path, this pins DEFAULT_RELEASE_URL to the concrete release tag, and local/scripts/install.sh later persists that same value into .env as SUBBOOST_RELEASE_URL; local/scripts/subboost.sh:update_cmd then fetches only that saved URL for future updates. As a result, stable installs created from the latest installer keep re-reading the original tag's release.json and subboost update cannot advance them to newer stable releases without manual env edits. Consider keeping the persisted release URL on the latest channel while pinning the fallback asset/image defaults separately.

Useful? React with 👍 / 👎.

inferred.installerComposeUrl =
inferred.installerComposeUrl || urlJoin(releaseAssetBaseUrl, "docker-compose.image.yml");
inferred.installerManagerUrl = inferred.installerManagerUrl || urlJoin(releaseAssetBaseUrl, MANAGER_ASSET_NAME);
}
if (releaseAssetBaseUrl && releaseImageTag) inferred.installerImage = inferred.installerImage || releaseImageTag;
return inferred;
}

function rewriteInstallerDefaults(content, args) {
const resolvedArgs = withInferredInstallerDefaults(args);
let output = content;
for (const item of INSTALLER_DEFAULTS) {
const replacement = args[item.key];
const replacement = resolvedArgs[item.key];
if (replacement) output = replaceInstallerDefault(output, item, replacement);
}
return output;
Expand Down
Loading