Git Product home page Git Product logo

updater's Introduction

Automatic updater for phpList

Provides an easy, automated, web-based update mechanism for phpList installations.

Usage

The new phpList updater gives you an easy way to upgrade your installation via web. In four steps you can update your installation to the latest release.

The Updater is available in phpList 3.3.7+.

Requirements

The automatic updater requires the following PHP extensions: curl, zip and pdo.

Technical details

The updater is currently performing the following steps. If one of those steps fail, you will have the possibility to correct the error and retry from the current step.

  1. Check if the user is authenticated (Only superadmins can update phpList)
  2. Check if there is an update available
  3. Check for write permissions
  4. Check whether all required phpList files are in place
  5. Ask the user if they want a backup of the software:
  • Yes: ask the user for the location
  • If no: continue to the next step.
  1. Download new version to a temporary folder
  2. Add maintenance mode
  3. Replace PHP entry points with "Update in progress" message
  4. Delete old files except config, updater and temporary directory
  5. Move new files in place
  6. Move new PHP entry points in place
  7. Move updater to a temporary directory
  8. Delete temporary files
  9. Remove maintenance mode
  10. Move new updater in place
  11. Deauthenticate updater session
  12. Redirect to the phpList dashboard

Permissions

The whole phpList directory and the files within it must be writable by the HTTP user under which your web server is running as. If there is no match between the owner of your phpList files and the user under which your web server is running, you won’t be able to update. The ownership can be changed in a Linux terminal using this command:

 chown -R user:group /path/to/phpList-directory 

For instance:

 chown -R www-data:www-data /var/www/lists 

Change directory and file permissions:

 find . -type d -exec chmod 755 {} \; 
 find . -type f -exec chmod 644 {} \; 

Permissions vary from host to host. To find the HTTP user check the Apache Server configuration files. You can view a file's ownership, permissions, and other important information with the ls command, using the -la option:

 ls -la file.php 

The default Apache user and group for some Linux distributions are:

  • Debian/Ubuntu: www-data
  • Arch Linux: http
  • Fedora/CentOS: apache
  • openSUSE: user is wwwrun and the group is www

After you change the permissions, you can try again the update. After a successful update, please consider to re-apply any hardened directory permissions.

What the updater doesn't do (yet):

The updater is at the moment solely focused on replacing the files of the core installation. It does neither:

  • Upgrade the database (this uses the existing database migration code)

Notes

  • The updater stops when it finds unexpected files (not from phpList default installation) and lists them. To continue, you should delete these files or move them outside lists directory.
  • It is possible to override the backup checks by reloading the page when the backup check fails. Do not reload the page unless you wish to proceed without a backup in this case.
  • When the update process fails you should manually remove actions.txt file inside the config folder in order to reset the process and be able to try again.
  • The config directory is required to be writable because the "current step" of the automatic updater is saved inside it.
  • The plugins that are now included with phplist will be upgraded as part of the update. Any additional plugins will be kept but not upgraded.

Future development plans

At the moment only our current stable release, phpList 3, is supported by the updater. We’ll work on adding support to our upcoming phpList 4 release.

Report bugs and improvements:

https://mantis.phplist.org/set_project.php?project_id=2;185

updater's People

Contributors

bramley avatar brunildadosti avatar dbx12 avatar marianaballa avatar mfettig avatar michield avatar samtuke avatar suelap avatar xh3n1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

updater's Issues

Error on uploadimages directory

Currently, if the uploadimages directory exists, the automatic updater throws an error on step 1

Error: The following files are either not expected and should be removed, or are missing but required and should be put back in place
uploadimages

The problem is that if you remove that folder, after the update, PHPList tells you that you can't upload images because that directory doesn't exist, so you have to add it back in. This error has been in place since 3.3.7 but is the same on 3.5.1.

Updater: JavaScript error

When calling the updater via https://example.com/lists/updater/ a JavaScript error pops up in the console. There seems to be a mistake with counting the steps, or the server response "-1" is not correct. Looking at the current JavaScript code it would have to be 0 to work. But not it returns -1. Rhe first line in executeNextStep() adds 1 to it which results in 0, but since stepActionMap in setCurrentActionItem() counts by beginning at 1 the entire updater doesn't work.

image

Default for backup location

When you request a backup and click next, it asks for a location and does not continue
Instead it would be good to use the suggested path as the default and continue

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.