question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bringing One-Click/Automatic Updates to Ghost

See original GitHub issue

It has been a feature long-requested by many users, and thanks to the new Ghost-CLI project, Automatic Updates are finally within reach!

Before this feature will work fully, however, there are several changes that need to be made across Ghost, Ghost-Admin, and Ghost-CLI, to provide the smoothest, most fault-tolerant update process. This issue exists to document and track those specific changes as they occur in the separate repositories.

Brief Overview

Currently, whenever there is a new Ghost version, a notification appears in Ghost-Admin prompting the user to update, and providing a link to the relevant support page with documentation as to how to manually update Ghost. This current notification would be extended and instead of linking to a support page, it would link to the /ghost/about page, where a button would appear that a user could click to update their blog.

Upon clicking the button, a server request would be made, and the Ghost server would communicate with the managing CLI process (ghost run), which would then trigger the ghost update command. As Ghost itself would still be running, the user could then continue using Ghost normally, and Ghost-Admin would poll the Ghost server in the background until 1 of 2 things happens:

  1. The update process erred, in which case Ghost-Admin would retrieve the error and display it (with perhaps a link to documentation).
  2. The update process succeeded, and the user needs to refresh the page to get the latest version of Ghost-Admin.

Additional Notes

  • The update process will only be available if Ghost is being run with Ghost-CLI.
  • The first iteration will only feature one-click updates through the admin client. Future versions will work on automatic updates that require no user interaction.

Tasks

Ghost-CLI

  • ghost update command should make sure blog can start before switching to new version (TryGhost/Ghost-CLI#153)

Basically, Ghost-CLI needs to be able to verify that the new version of Ghost has been installed correctly, and that there won’t be any issues switching versions. With the current update process, the blog could be left in a broken state if the old version is stopped and the new one fails to start, so we want to make sure the new version will start correctly.

  • ghost update should communicate with the Ghost process (issue/PR # TBD)

Currently, Ghost-CLI starts ghost using a ghost run command, which allows the CLI to provide some light management of the core Ghost server process. Communication between the two process currently happens over IPC channels - and this should be extended to allow ghost update to tell ghost run that it has finished installing the new Ghost version, before it stops the old version, giving Ghost time to notify the client that the blog is restarting.

Ghost

  • Update API endpoint (PR in progress - #7977)

This endpoint handles communication with the Ghost-CLI process to start the update process, as well as inform Ghost-Admin of the update status.

There will be both a GET endpoint and a POST endpoint.

The GET endpoint will return a couple of things:

  1. New version if one is available
  2. Status flag signifying whether or not the blog is currently undergoing an update process.
  3. Any errors that occurred during update

The POST endpoint will:

  • Trigger the update process by sending an IPC message to Ghost-CLI

At the moment, only the blog owner will be able to update the blog, but it could be extended in the future to allow administrators as well, pending discussion.

As part of this endpoint, there will be a config variable added that controls whether or not the blog is able to be updated (for example, if you enable a particular privacy flag or if you’re not running with Ghost-CLI).

Ghost-Admin

  • Make custom update notification that links to the About page.

Because the update button will be located on the About page, the update notification should link to the About page instead of a support page. This should also take into account the configuration of the server, so if the user is not running via Ghost-CLI, or has disabled CLI updates for any particular reason, then the notification will not link to the about page and instead show a different message.

  • Build polling service that will poll the server in the background at either fixed or increasing intervals to determine update status

The service should also check whenever Ghost-Admin is first loaded to see if Ghost is currently being updated, and trigger the polling process if it is. (Use case: user refreshes the page after starting an update process).

There should probably be a way to ask the service if Ghost is updating, and certain blog actions may need to be disabled during update (for example: theme uploads, import/export, etc.) - this may be added in future improvements

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:9
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
acburdinecommented, May 13, 2017

Ghost-CLI currently is missing a couple of things needed to get this working, my thought was we’d be putting this off until after 1.0, as it’s a fairly sizable feature that will require stuff in all three major Ghost components.

1reaction
acburdinecommented, Jul 31, 2017

That was actually something I had thought about as well. The email part might be a little tricky, but it’s definitely a viable approach 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic Updates for One-Click WordPress Installations
All One-Click WordPress installations at DreamHost have automatic updates enabled by default. This option can be deactivated after WordPress ...
Read more >
Click inactive / Hidden windows /10 in 1 Auto Clicker - YouTube
Be sure to let me know about any features that you would like to see added to this auto clicker in the futurePaste...
Read more >
macOS App Store Updates Not Showing? Ghost Updates?
Go to System Preferences and select the app store, turn on Automatically check for updates and checkmark ON all the options. This includes ......
Read more >
iOS 16 update causing ghost touch issues on some iPhones
iOS 16 users are reporting ghost touch issues where the touchscreen is not working, lagging or responding properly after the recent update.
Read more >
Symantec™ Ghost Solution Suite 3.3 User Guide - TechDocs
Click Change Settings to set the Ghost Solution Suite agent settings. Automatically add to a group. You can select one of the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found