Skip to content

feat(updater): Builtin updater in a new Updates tab - #579

Open
brandonhs wants to merge 4 commits into
mainfrom
578-builtin-updater
Open

brandonhs wants to merge 4 commits into
mainfrom
578-builtin-updater

Conversation

@brandonhs

Copy link
Copy Markdown
Member

Summary

Adds a builtin updater, so dweOS can be updated from the web UI instead of over SSH.

New Updates tab (/updater)

  • Lists the releases on GitHub with their release notes, and marks the installed and latest releases. Preview builds are recognized too: -prN.<sha> matches preview-pr-N.
  • When a newer release is available, an "Update to vX.Y.Z" button appears. Any listed release can be installed or reinstalled, and a "Show pre-releases" toggle shows the preview builds.
  • During an update the page shows the install output live. It reloads into the new version when the backend comes back. If the update fails, the page shows the output.

Backend (/api/updater/{releases,status,install})

  • UpdateManager gets the releases from the GitHub API. It installs a release with the same curl … install.sh | bash -s <tag> command as the README. The install runs in its own systemd unit (dwe_os_2_update), because install.sh restarts dwe_os_2 and would otherwise kill itself.
  • Release tags are validated before they are passed to the install.
  • New updater feature flag, which --no-updater turns off. The BlueOS Dockerfile now passes --no-updater, because BlueOS updates its own extensions. The tab then shows the usual "not supported" card.

install.sh

  • Before, the script deleted /opt/DWE_OS_2 before it installed anything, so a failed download or pip install left the device with no dweOS. Now it downloads the release to a temporary directory and builds the new install in /opt/DWE_OS_2.new. It swaps the new install in only after the requirements and the venv are installed, and restores the old install if the swap fails.
  • device_settings.json and server_preferences.json are now kept across installs. Before, every install reset them. An in-app update that cleared all camera settings would be unexpected, so this behavior change needs a reviewer to agree.

frontend/src/schemas/dwe_os_2.d.ts was regenerated from the backend. It also includes earlier endpoints that were missing from the committed schema.

Fixes #578

Type of change

  • Bug fix
  • Feature / Refactor
  • Breaking change
  • Misc.

Quick Checklist

  • I have reviewed my own code.
  • I have tested these changes locally.
  • I have tested these changes on the following platforms (optional):
    • SVC
    • microSVC (optional)
    • SVC Pro

Tested

  • ruff, ty, bandit -lll, tsc, eslint, and npm run build pass.
  • UpdateManager.get_releases() against the live GitHub API, get_status(), and the tag validation.

Not yet tested

  • A real install on a device: the systemd-run update, the install.sh swap and rollback, and the page reloading after the restart.
  • Devices get install.sh from main, so the safer install only applies to updates after this PR is merged.

install.sh deleted /opt/DWE_OS_2 before installing anything, so a failed
download or dependency install left the device with no dweOS at all.

The release is now downloaded to a temp directory and installed to
/opt/DWE_OS_2.new, and only swapped in once its requirements and venv are
set up. The old install is restored if the swap fails. Camera settings and
preferences are carried over to the new install.
The Updates tab lists the releases on GitHub with their notes, marks the
installed and latest ones, and installs any release (pre-releases behind a
toggle). The install runs install.sh in its own systemd unit, since it
restarts the dwe_os_2 service, and streams its output to the page. The
page reloads into the new version once the backend comes back.

The updater can be disabled with --no-updater, which the BlueOS image
uses, since BlueOS updates its extensions itself.
@brandonhs brandonhs linked an issue Oct 27, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Preview build: preview-pr-579 (v0.7.7-pr579.add8a93)

curl -s https://raw.githubusercontent.com/DeepWaterExploration/dweOS/main/install.sh | sudo bash -s preview-pr-579

Rebuilt on every push. Closing this pull request deletes the preview.

The install buttons sat after each release's accordion header, which only
took the width of its contents, so they never lined up. Each row is now a
full width header with the date and a fixed width button on the right.

The list also showed every release ever published with duplicate tags and
pre-release badges. It now shows the 5 most recent, with the rest behind a
button, and only marks the latest and installed releases. Long commands in
release notes wrap instead of widening the page.
On a pre-release the Updates tab offered the latest release as an update,
even though a preview like v0.7.7-pr579 is built on v0.7.7.

An update is now only offered when the latest release's X.Y.Z is newer
than the installed version's, ignoring any pre-release suffix. The tab
says when a pre-release is installed, and shows pre-releases by default
so the installed one is in the list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Builtin Updater

1 participant