mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 15:06:19 -05:00
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:
parent
f3f762ef1b
commit
d88db90ce9
10 changed files with 304 additions and 28 deletions
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue