logoBack to home screen

Understanding Script Files in ADx Deployment Package

Environment Variable Script

If you decided to run a script to set your environment variables, the easiest way to create the environment script is to copy the file example-environment.sh included in this package to a location of your choice. Afterwards, simply open the file in a text editor and set respective values:

#!/bin/bash

# This is an example environment script which can be used as a template to easily create your own file.

# exit when any command fails
set -e

# set Java installation path
export JAVA_HOME=/path/to/jdk
# add Java's bin folder to the PATH variable
export PATH=${JAVA_HOME}/bin:${PATH}

When you have set the values, save your new script. It's now ready to be referenced by the encryption, installation, and health check scripts by adding the --environment /path/to/environment.sh part to the command as in:

Installation reference:

./install.sh --settings /path/to/installation-settings.yaml --environment /path/to/environment.sh

Encryption reference:

./encrypt.sh --value 'my-password' --environment /path/to/environment.sh

Health check reference:

./check-health.sh --url https://localhost:8443 --environment /path/to/environment.sh

Password Encryption Script

All passwords in your configuration files must be encrypted. You can use the encrypt.sh script which is provided in your deployment package for that purpose. Note that an unencrypted password will not work, resulting in tribefire-services crash after installation.

To encrypt a password:

  1. In the command line, run the ./encrypt.sh --value 'example-password' command, for example ./encrypt.sh --value 's3cur3p455w0rd'. The encrypted password is then displayed:

    $ ./encrypt.sh --value 's3cur3p455w0rd'
    cNRVe5T5gOB0o3NXxjCdRkiMGbNKWpAsbGFWFVKCVjZ0Jh1yUwyaZxPJ1WjFYbXABc6qiw==
    
    DONE
    

    Note that you can reference the environment variable script while encrypting your password by adding --environment /path/to/environment.sh to the command.

Copy the encrypted password to the clipboard and paste it to the configuration file, then wrap it in "${decrypt(' encrypted_password ')}", as in "${decrypt('cNRVe5T5gOB0o3NXxjCdRkiMGbNKWpAsbGFWFVKCVjZ0Jh1yUwyaZxPJ1WjFYbXABc6qiw==')}".