The Settings upgrade can switch to a chosen branch (#954)

* The Settings upgrade can switch to a chosen branch

The Upgrade panel gains a Branch input: a dropdown listing the current
branch, master, and release that also takes a typed branch name.
/api/upgrade/start accepts an optional {"branch": ...}; without it the
current branch is upgraded as before.  A branch is written into the systemd
env file and passed to `upgrade.sh -b`, so only plain git branch names are
accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* The Controller upgrade refuses a branch that is not a plain branch name

The Controller's upgrade script wrote its branch straight into the systemd
env file, so a newline in it added a variable, and a leading dash became an
upgrade.sh option.  It now accepts the same branch names as the API, and no
script parameter may span lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lrnselfreliance 2026-11-08 08:48:58 -07:00 • committed by Roland
parent f3f762ef1b
commit d88db90ce9
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
10 changed files with 304 additions and 28 deletions

View file

@ -2226,8 +2226,10 @@ export async function checkUpgrade(force = false) {
return null;
}
export async function triggerUpgrade() {
const response = await apiPost(`${API_URI}/upgrade/start`);
// `branch` upgrades from that branch; without it the current branch is upgraded.
export async function triggerUpgrade(branch = null) {
const body = branch ? {branch} : undefined;
const response = await apiPost(`${API_URI}/upgrade/start`, body);
if (!response.ok) {
const message = await getErrorMessage(response, 'Failed to start upgrade. See server logs.');
toast({