Skip to main content
Version: 7.0

Linux

danger

This instruction assumes the following location of Passwork — /var/www/

Preparation

  • Before updating, if Passwork is installed in a cloud/virtual environment, create a snapshot of the OS virtual state to restore functionality in case of incorrect update;
  • Obtain root rights and update the local package database:
sudo -i 
apt-get update

Obtaining current version of Passwork

Create a temporary directory to obtain Passwork:

mkdir /tmp/update_passwork
danger

If the server with Passwork is located in a closed network, you need to go to the Passwork Customer Portal and manually obtain version 7 and move it to the server in a directory named — /tmp/update_passwork/passwork.zip ::

Go to the Passwork Customer Portal and copy the API key to obtain the current version:

Obtaining API key on the client portal

Create the API_KEY variable:

API_KEY=your_api_key

Check the available Passwork version from the client portal using the copied API key with the request:

curl -X GET "https://portal.passwork.pro/api/version?apikey=$API_KEY" -w "\n"

Correct output

{"response":{"last-available-version":"07xxxx"}}
danger

Make sure that version 7 of Passwork — 07xxxx is available for download

Obtain version 7 of Passwork with the request:

curl -o "/tmp/update_passwork/passwork.zip" "https://portal.passwork.pro/api/download?apikey=$API_KEY"

Clear the API_KEY variable:

unset API_KEY

Updating to current version

Get the current Passwork version into a variable:

# Get Passwork version from the version file
version=$(cat /var/www/version)

Copy the Passwork configuration file to a separate directory:

cp /var/www/app/config/config.ini /var/

Create an archive of the current Passwork version for rollback possibility:

# Install zip if an error occurs during execution
apt install zip -y
yum install zip -y

zip -r /var/passwork-$version.zip /var/www/*

Delete all contents from the Passwork directory:

rm -rf /var/www/* && rm -rf /var/www/.*

Extract version 7 of Passwork to the physical location:

unzip /tmp/update_passwork/passwork.zip -d /var/www/

Set permissions for the physical location of Passwork:

find /var/www/ -type d -exec chmod 755 {} \;
find /var/www/ -type f -exec chmod 644 {} \;
find /var/www/init -type f -exec chmod 600 {} \;
chown -R www-data:www-data /var/www/