Add Docker update support via Watchtower integration#1330
Open
Sebbeben wants to merge 3 commits intoPart-DB:masterfrom
Open
Add Docker update support via Watchtower integration#1330Sebbeben wants to merge 3 commits intoPart-DB:masterfrom
Sebbeben wants to merge 3 commits intoPart-DB:masterfrom
Conversation
Enable web-based updates for Docker installations by integrating with Watchtower's HTTP API. The Update Manager now detects Docker installs, shows Watchtower connection status, and provides a one-click update flow with progress UI that survives container restarts. - Add WatchtowerClient service for Watchtower HTTP API communication - Add Docker update progress page with Stimulus controller for polling - Add health endpoint for post-restart detection (unauthenticated) - Show Docker-specific UI (hide Git-only fields, show Watchtower status) - Create database backup before triggering Docker updates - Fix CSP violation in error page (javascript:history.back -> proper link) - Add translation keys for all Docker update UI strings
Without defaults, Symfony throws EnvNotFoundException when WatchtowerClient is constructed in non-Docker environments (including CI test runners).
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1330 +/- ##
============================================
- Coverage 56.45% 56.39% -0.06%
- Complexity 8323 8351 +28
============================================
Files 611 612 +1
Lines 26731 26824 +93
============================================
+ Hits 15091 15128 +37
- Misses 11640 11696 +56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Covers all public methods with mocked HTTP client: - isConfigured with various empty/set combinations - isAvailable with success, error, and exception scenarios - triggerUpdate with success, failure, and not-configured cases - URL trailing slash normalization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the Update Manager to support Docker-based installations by integrating with Watchtower, a popular container update tool.
/update-manager/health) — unauthenticated JSON endpoint for post-restart detection (session is lost when container restarts)javascript:history.back()with proper navigation in error templateHow it works
Configuration
Docker users add a Watchtower sidecar to their
docker-compose.yml:And set environment variables for Part-DB:
If Watchtower is not configured, the Update Manager gracefully shows an informational message explaining how to enable Docker updates.
Files changed
src/Services/System/WatchtowerClient.phpsrc/Controller/UpdateManagerController.phpsrc/Services/System/UpdateChecker.phpsrc/Services/System/UpdateExecutor.phpsrc/Services/System/InstallationType.phpsrc/EventSubscriber/MaintenanceModeSubscriber.phpassets/controllers/docker_update_progress_controller.jstemplates/admin/update_manager/docker_progress.html.twigtemplates/admin/update_manager/index.html.twigtemplates/bundles/TwigBundle/Exception/error.html.twigtranslations/messages.en.xlfTest plan
Screenshots
Update Manager - Docker Installation
Update in Progress
Update Complete