Storing sensitive credentials in a secrets file and not in your website’s database means your private data won’t exist in your database backups. With this, you can distribute database backups to team members who might need a database snapshot, but do not need full access to external systems.
To create and use a secrets file with your website:
If the secrets.settings.php file doesn’t exist, create it.
In Cloud Classic, do not create the file in the /mnt/gfs/[sitename].[env]/files/ directory, as files in this are publicly accessible.
To make the secrets file available to your application, add the lines in the following example to the appropriate location based on your installed product:
settings.php fileSite Factory: To a post-settings-php hook named secrets.php
Add the secrets file to all Site Factory environments. During the Site Factory staging process, the secrets.settings.php file will not copy down to lower environments.
$secrets_file = $_ENV['HOME'] . '/secrets.settings.php';
if (file_exists($secrets_file)) {
require $secrets_file;
}Since the code uses $_ENV['HOME'] to build the link to the secrets.settings.php file, you can provide unique files for your production and non-production environments.
secrets.settings.php file. Backups are stored outside your website’s files area. The Site Factory full-website backups do not back up the secrets.settings.php file.$HOME/APP_NAME folder.You can also create a special nobackup directory where you can place files containing sensitive credentials. For information about using the method, see Storing private information in the file system.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Add the secrets file to all Site Factory environments. During the Site Factory staging process, the secrets.settings.php file will not copy down to lower environments.
$secrets_file = $_ENV['HOME'] . '/secrets.settings.php';
if (file_exists($secrets_file)) {
require $secrets_file;
}Since the code uses $_ENV['HOME'] to build the link to the secrets.settings.php file, you can provide unique files for your production and non-production environments.
If this content did not answer your questions, try searching or contacting our support team for further assistance.