Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: automatic check for updates #951

Merged
merged 17 commits into from
Dec 21, 2024

Conversation

szwabodev
Copy link
Contributor

@szwabodev szwabodev commented Dec 20, 2024

  • added toggle in Settings->Server->Updates dialog for automatic server update checking (enabled by default, saved in local storage)
  • use interval (15min) to periodically check for new updates (if enabled via toggle)
  • check for new updates on page load (if enabled via toggle)
  • show "Update available" button in header when new server update is available
  • improved logic for checking available updates to use Docker hub API instead of pulling image, which makes checking update a lot faster
  • moved pulling latest release to updateServer action
  • removed green dot pinging while server is updating
  • added button loading text while server is updating
  • added automatic page reload on successful server update
  • added information about page reload in confirmation modal and success toast
  • added getDokployImageTag helper
  • improved toasts messages related with updating to be clearer (separate for error, available, unavailable)

Screenshots:
image
image
image
image
image

@szwabodev szwabodev marked this pull request as draft December 20, 2024 13:50
@szwabodev szwabodev changed the title Merge pull request #937 from drudge/fix-custom-registry feat: automatic check for updates Dec 20, 2024
@szwabodev szwabodev changed the base branch from main to canary December 20, 2024 14:06
@drudge
Copy link
Contributor

drudge commented Dec 20, 2024

It would be great if this modal showed what the version was.

@szwabodev szwabodev marked this pull request as ready for review December 20, 2024 18:28
@Siumauricio
Copy link
Contributor

@szwabodev Hi, I'm getting this error

Screenshot 2024-12-20 at 11 33 01 PM
Screenshot 2024-12-20 at 11 33 41 PM

@szwabodev szwabodev marked this pull request as draft December 21, 2024 08:52
@szwabodev
Copy link
Contributor Author

szwabodev commented Dec 21, 2024

@szwabodev Hi, I'm getting this error

Screenshot 2024-12-20 at 11 33 01 PM Screenshot 2024-12-20 at 11 33 41 PM

I refactored the logic to get image SHA from dokploy service instead of docker image (which was not pulled in your case causing this error). Could you please try now?

The error might still occur when dokploy service doesn't exist, but I guess we can assume that this service always exist when dokploy is running, right?

@szwabodev szwabodev marked this pull request as ready for review December 21, 2024 09:06
@Siumauricio
Copy link
Contributor

@szwabodev Hi, I'm getting this error
Screenshot 2024-12-20 at 11 33 01 PM Screenshot 2024-12-20 at 11 33 41 PM

I refactored the logic to get image SHA from dokploy service instead of docker image (which was not pulled in your case causing this error). Could you please try now?

The error might still occur when dokploy service doesn't exist, but I guess we can assume that this service always exist when dokploy is running, right?
Now it give me this error
Screenshot 2024-12-21 at 3 23 57 AM
Screenshot 2024-12-21 at 3 24 14 AM

@szwabodev
Copy link
Contributor Author

szwabodev commented Dec 21, 2024

@szwabodev Hi, I'm getting this error
Screenshot 2024-12-20 at 11 33 01 PM Screenshot 2024-12-20 at 11 33 41 PM

I refactored the logic to get image SHA from dokploy service instead of docker image (which was not pulled in your case causing this error). Could you please try now?
The error might still occur when dokploy service doesn't exist, but I guess we can assume that this service always exist when dokploy is running, right?
Now it give me this error
Screenshot 2024-12-21 at 3 23 57 AM
Screenshot 2024-12-21 at 3 24 14 AM

Yeah that's what I asked if we can assume that dokploy service always exists. In base canary version there's similar error when trying to update the server due to missing dokploy service as well. I don't know if there is any possibility that dokploy service doesn't exist in self-hosted mode, except when running it locally which by default doesn't use dokploy service and you need to start it manually like I did for testing this.

this is what this command returns on my self-hosted dokploy server:
image

If you want I can simply wrap it with try/catch and return that update is not available in such case? I just wanted to make sure that this service always would exist on self hosted instances.

@szwabodev
Copy link
Contributor Author

ok I added try/catch with default update data fallback, also added a comment with a link to manual installation docs for information how to start service locally to fully test checking updates functionality.

@drudge drudge mentioned this pull request Dec 21, 2024
apps/dokploy/components/layouts/navbar.tsx Outdated Show resolved Hide resolved
@Siumauricio Siumauricio merged commit 392be2c into Dokploy:canary Dec 21, 2024
@Siumauricio Siumauricio mentioned this pull request Dec 21, 2024
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.

3 participants