Skip to content

Comments

feat(update): add self-update feature with Docker-based one-click updates#322

Merged
javi11 merged 5 commits intomainfrom
session-436537
Feb 24, 2026
Merged

feat(update): add self-update feature with Docker-based one-click updates#322
javi11 merged 5 commits intomainfrom
session-436537

Conversation

@javi11
Copy link
Owner

@javi11 javi11 commented Feb 24, 2026

Summary

  • Adds a new internal/version package with Version, GitCommit, Timestamp vars set by ldflags, making version info available app-wide without threading through function args
  • Populates version/git_commit in the /api/system/stats response so the UI can display the running version
  • Two new API endpoints:
    • GET /api/system/update/status?channel=latest|dev — queries the GitHub releases/commits API and returns whether an update is available
    • POST /api/system/update/apply — pulls the new Docker image via docker CLI and sends SIGTERM to PID 1 to trigger a container restart (requires restart: unless-stopped)
  • Updates Makefile ldflags to target internal/version instead of the unused main.* vars
  • Updates Dockerfile to accept VERSION/COMMIT/BUILD_TIMESTAMP build args and installs docker.io in the final stage (provides the docker CLI for auto-update)
  • Adds an optional /var/run/docker.sock mount to docker-compose.yml (required for one-click updates)
  • Frontend UpdateSection component added to Config → System with:
    • Current version + git commit display
    • Channel toggle (Latest stable / Dev rolling)
    • "Check for Updates" button with status display
    • "Update Now" button (visible when update available)
    • Graceful warning when Docker socket is not mounted

Test plan

  • Build with make build-cli and verify the binary reports a version via /api/system/stats
  • GET /api/system/update/status?channel=latest returns a valid response with current_version populated
  • GET /api/system/update/status?channel=dev returns latest commit SHA from GitHub
  • Navigate to Config → System and verify the Updates card renders
  • Without Docker socket mount, "Update Now" button is hidden and warning is shown
  • With Docker socket mounted, clicking "Update Now" triggers the pull + restart flow

🤖 Generated with Claude Code

javi11 and others added 5 commits February 24, 2026 10:43
…ze range

- Remove auto-save on drag-and-drop reorder; reordering now marks unsaved
  changes and requires the user to click Save Changes, consistent with
  other provider field edits
- Fix index lookup in handleDrop to use formData instead of config.providers
- Remove isReordering overlay and associated disabled-drag guards
- Extend streaming cache max_size_gb slider range from 200 → 1000 GB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ates

- Add internal/version package with Version, GitCommit, Timestamp vars
  targeted by ldflags, replacing the unused main.* vars
- Expose version/git_commit in /api/system/stats via getSystemInfo()
- Add GET /api/system/update/status: queries GitHub releases/commits API
  to compare current vs latest version per channel (latest|dev)
- Add POST /api/system/update/apply: pulls new Docker image via docker CLI
  and signals PID 1 (SIGTERM) to trigger container restart
- Update Makefile ldflags to target internal/version package
- Update Dockerfile to pass VERSION/COMMIT build args and install docker.io
- Add optional /var/run/docker.sock mount to docker-compose.yml
- Frontend: UpdateSection component with channel toggle, check/apply buttons,
  status display, and graceful warning when Docker socket is unavailable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n check

Remove the self-update feature that required Docker socket access, which
was unsafe in containerized environments. Replace with a simpler approach
that queries the GitHub API to show the latest available version.

- Remove handleApplyUpdate, performUpdate, isDockerAvailable, and all
  Docker socket/exec/syscall dependencies from update_handlers.go
- Restore fetchLatestGitHubRelease and fetchLatestGitHubCommit helpers
  that compare against the running version/commit
- Drop DockerAvailable, UpdateApplyRequest, UpdateApplyResponse from types
- Remove POST /api/system/update/apply route from server
- Remove applyUpdate() from API client and useApplyUpdate() hook
- Update UpdateSection UI: remove "Update Now" button and Docker warning;
  show a "View on GitHub" link when an update is available

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No longer needed since the auto-update feature has been removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javi11 javi11 merged commit 8c66b4b into main Feb 24, 2026
1 check passed
@javi11 javi11 deleted the session-436537 branch February 24, 2026 10:40
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.

1 participant