Skip to main content
Version: 7.0

Linux

info

Starting from version 7 of Passwork, updates via git are no longer supported. For updating Passwork, we have prepared a script.

Online update

  1. Get the script:
wget https://repos.passwork.pro/repository/linux/scripts/passwork.sh
danger

The Passwork update script must not be located in the directory together with the application server files.

  1. Assign execution rights to the script:
chmod +x passwork.sh

By default, the passwork.sh script will perform:

  • Creating a hidden .script_env file in the current directory;
  • Creating a passwork_archive directory for Passwork backup;
  • Retrieving the latest available version of Passwork, signature, and public key;
  • Installing the previously obtained archive into /var/www/
Actions performed
  1. Check that all necessary system tools are installed — php, curl, jq, zip, unzip, file, stat, find
  2. Check PHP version and compare with the required one (8.3)
  3. Check availability of the Passwork client portal to determine the installation mode
  4. If Passwork is already installed (the .env file is present), switch mode to UPDATE; if the file is not found, use INSTALL mode
  5. If the .script_env file exists, read and get the API key
  6. If the API key is not set, prompt the user to enter it and validate the format
  7. Get the number of the latest available version via API request
  8. Compare the obtained version with the current Passwork version
  9. If a new version is available, download the archive using the request and API key
  10. Verify correct receipt of the ZIP archive
  11. Obtain the digital signature and public key
  12. Verify the ZIP archive using OpenSSL
  13. Unpack the ZIP archive into a temporary directory
  14. Make a backup of the current version
  15. Clean the directory from the previous version, preserving configuration files and logs
  16. Check directory access rights
  17. Change owner permissions if the owner is not root
  18. Modify OPcache settings if they are not configured
  19. Restart the web server and php-fpm service
  20. Then run the version update command update
info

To use a non-standard installation path, disable certificate verification, or change behavior, use — script parameters

  1. Run the script:
sudo ./passwork.sh

At the first run, the script will request the API key and perform basic environment checks:

Obtaining API key on the customer portal

Example of successful script execution:

Example of successful script execution

Offline update

Get the script on another machine with Internet access:

wget https://repos.passwork.pro/repository/linux/scripts/passwork.sh
info

Or get the passwork.sh script manually using the link

danger

The Passwork update script must not be located in the directory together with the application server files.

Assign execution rights to the script:

chmod +x passwork.sh

Before running passwork.sh, you need to:

By default, the passwork.sh script will perform:

  • Creating a passwork_archive directory for Passwork backup;
  • Unpacking the Passwork archive;
  • Installing the previously obtained archive into /var/www/
Actions performed
  1. Check that all necessary system tools are installed — php, curl, jq, zip, unzip, file, stat, find
  2. Check PHP version and compare with the required one (8.3)
  3. Check availability of the Passwork client portal to determine the installation mode
  4. If connection failed or the --offline flag is used, switch to offline mode
  5. Confirm installation in offline mode
  6. Search for the latest archive in Passwork-*.zip format in the directory
  7. Extract the version number from the ZIP file and check that it is not less than 070000
  8. If Passwork is already installed (the .env file is present), switch mode to UPDATE; if the file is not found, use INSTALL mode
  9. Compare the archive version with the current Passwork version
  10. Move the ZIP to a temporary directory
  11. Search and move the digital signature and Passwork public key
  12. Verify the ZIP archive using OpenSSL
  13. Unpack the ZIP archive into a temporary directory
  14. Make a backup of the current version
  15. Clean the directory from the previous version, preserving configuration files and logs
  16. Check directory access rights
  17. Change owner permissions if the owner is not root
  18. Modify OPcache settings if they are not configured
  19. Restart the web server and php-fpm service
  20. Then run the version update command update

After preparation, run the passwork.sh script:

sudo ./passwork.sh -offline

Example of successful script execution:

Example of successful offline update

Script parameters

-i, --input

Path to the archive in offline_mode. Also defines the location of .script_env, passwork_archives:

sudo ./passwork.sh -i "/home/administrator/passwork"

-o, --output

Installation path (default: /var/www):

sudo ./passwork.sh -o "/var/www/passwork"

-offline, --offline

Forced offline mode. Requires manual preparation:

sudo ./passwork.sh -offline

-insecure, --insecure

Skip certificate verification (used if the server lacks CA certificates):

sudo ./passwork.sh -insecure

-skip, --skip

Skip verification of the Passwork archive signature:

  sudo ./passwork.sh -skip