This release introduces support for environment variables, which can override command-line arguments as well as configuration properties (even nested ones). Also, a new "foreground" mode is available, for launching Cronicle in the foreground (no daemon fork), but not activating debug mode.
Environment Variables
Cronicle supports a special environment variable syntax, which can specify command-line options as well as override any configuration settings. The variable name syntax is CRONICLE_key
where key
is one of several command-line options (see table below) or a JSON configuration property path. These can come in handy for automating installations, and using container systems.
For overriding configuration properties by environment variable, you can specify any top-level JSON key from config.json
, or a path to a nested property using double-underscore (__
) as a path separator. For boolean properties, you can specify 1
for true and 0
for false. Here is an example of some of the possibilities available:
Variable | Sample Value | Description |
---|---|---|
CRONICLE_foreground
| 1
| Run Cronicle in the foreground (no background daemon fork). |
CRONICLE_echo
| 1
| Echo the event log to the console (STDOUT), use in conjunction with CRONICLE_foreground .
|
CRONICLE_color
| 1
| Echo the event log with color-coded columns, use in conjunction with CRONICLE_echo .
|
CRONICLE_base_app_url
| http://cronicle.mycompany.com
| Override the base_app_url configuration property. |
CRONICLE_email_from
| cronicle@mycompany.com
| Override the email_from configuration property. |
CRONICLE_smtp_hostname
| mail.mycompany.com
| Override the smtp_hostname configuration property. |
CRONICLE_secret_key
| CorrectHorseBatteryStaple
| Override the secret_key configuration property. |
CRONICLE_web_socket_use_hostnames
| 1
| Override the web_socket_use_hostnames configuration property. |
CRONICLE_server_comm_use_hostnames
| 1
| Override the server_comm_use_hostnames configuration property. |
CRONICLE_WebServer__http_port
| 80
| Override the http_port property inside the WebServer object.
|
CRONICLE_WebServer__https_port
| 443
| Override the https_port property inside the WebServer object.
|
CRONICLE_Storage__Filesystem__base_dir
| /data/cronicle
| Override the base_dir property inside the Filesystem object inside the Storage object.
|
Almost every configuration property can be overridden using this environment variable syntax. The only exceptions are things like arrays, e.g. log_columns and socket_io_transports.