Provide credentials to Synchrony standalone using environment variables (Linux)
This guide applies to Confluence Data Center 6.5 and later.
This guide does NOT apply if Synchrony is managed by Confluence (available in Confluence 6.12 and later).
If you're running Synchrony standalone in a cluster, and you prefer to store sensitive information in your environment, rather than directly in the Synchrony startup scripts you can create a
synchronyenv file, and use it to provide your database credentials.
These instructions are for Linux users. We'll assume your dedicated Synchrony user is named
Create the synchronyenv file
Change to your Synchrony user, for example:
sudo su - synchrony
- In your
<synchrony-home>directory, create a new file called
Add the following lines to the
synchronyenvfile, and include your database credentials.
export SYNCHRONY_DATABASE_USERNAME="database-username" export SYNCHRONY_DATABASE_PASSWORD="database-password"
- Make sure to make this file executable, so it can be sourced by start-synchrony.sh
chmod +x synchronyenv
Modify your Synchrony startup script
Comment out the following lines
Note that they may already be commented out, or have slightly different information.
Uncomment the following line, and include the path to the
synchronyenvfile you've just created.
Save your changes.
Modify your shell profile
Bash as login shell will load the following profiles in order. Your environment may vary, but this is an example for Ubuntu:
Note: Bash as non-login interactive shell will load ~/.bashrc
Edit the appropriate profile as noted above, and to add the following code:
# Defines the absolute path to the synchronyenv file. # For example, if your synchronyenv file was located in /opt/synchrony-home/synchrony, you would use the example: source /opt/synchrony-home/synchrony/synchronyenv
Confirm the variables are in place by exiting the bash session of the Synchrony user, then re-entering it, and running the following command:
Your database credentials defined should appear in your env output. Here's a sanitized example:
XDG_SESSION_ID=15 SYNCHRONY_DATABASE_PASSWORD=<sanitized> ... SYNCHRONY_DATABASE_USERNAME=<sanitized> ... _=/usr/bin/env
If the info you defined in your
synchronyenv file appears correctly in the output above, you should be good to start Synchrony once again. If they don't appear, you may need to define them in a different profile config, based on your operating system and shell.