Page MenuHomeMusing Studio

Upgrade WriteFreely from admin dashboard
Open, WishlistPublic

Description

Overview

Enable admins to upgrade their WriteFreely installation from the admin dashboard.

This is continued from the discussion in T555.

Background

Users

Instance admins.

Implementation

  • Download the latest version from an authoritative source
  • Extract and replace only application files (not *.ini or keys)
  • Restart the server (built-in?)

Considerations

There are cases where we won't want this enabled or might want different behavior, such as in #write.as_for_teams. So maybe this ability is tied to build flags (seems ideal) or application configuration.

Related Objects

StatusAssignedTask
Resolvedrobjloranger
OpenNone
Resolvedrobjloranger

Event Timeline

matt triaged this task as Wishlist priority.
matt created this task.

I think a rough process would be:

  • download and extract into temporary location
  • copy existing data to FILEorFOLDER.old, for each file or folder to replace
  • move the new files to the existing locations, replacing them
  • kill the server process, triggering systemd to restart.
  • clean up temporary files
  • keep .old around in case of some error? if so maybe old files should be moved elsewhere, it wouldn't take too much disk to keep a copy of the last installed version around though.

This relies on having the PID of the running server, we can use the os pkg to get the PID of the parent process as this will be a child and then send a sig kill.