The environment file contains information about the context of your hosting environment, and is located in the home directory – if the feature is enabled in the Control Panel. The files are named environment.ini
and/or environment.json
. The files are identical in content, but formatted differently. Both the INI and JSON formats are provided for convenience.
The files are read-only, and automatically updated and maintained with current information based on any changes to your environment. You’ll find the files placed in your home folder like this:
Control Panel options
The environment info feature is enabled for all new environments by default. You’ll find the configurable options in the Advanced section in the “Site Settings” tab in the Servebolt Control Panel.
The default setting for new environments is that both the INI file and the JSON file are generated (“Both”). You can select for either file type independently, or turn the feature entirely off so that no such files will be made. For old environments, already existing before the feature was released the feature will be off (“None”).
What can this be used for?
The files are accessible from both the command line and from your scripts or web application. That means that you can make use of the information from deploy scripts, or use the information in or on your website. Your own creativity sets the limits for how the information can be used in combination with the Servebolt API.
Example environment files
The following two files are an example of what the files look like, and the information that is currently provided in them. The current content is the starting point, we will be adding more information to the files over time.
environment.json
{
"bolt_id": 10472,
"private_dir": "/kunder/gmailc_10472/metate_13168/private",
"id": 13168,
"internal_url": "https://metate-13168.sterre-lon.servebolt.cloud",
"home_dir": "/kunder/gmailc_10472/metate_13168",
"public_dir": "/kunder/gmailc_10472/metate_13168/public",
"api_key": null,
"internal_domain": "metate-13168.sterre-lon.servebolt.cloud",
"name": "Meta Test"
}
environment.ini
id=13168
bolt_id=10472
name=Meta Test
api_key=None
internal_domain=metate-13168.sterre-lon.servebolt.cloud
internal_url=https://metate-13168.sterre-lon.servebolt.cloud
home_dir=/kunder/gmailc_10472/metate_13168
public_dir=/kunder/gmailc_10472/metate_13168/public
private_dir=/kunder/gmailc_10472/metate_13168/private