Config
Understanding the different parts of the Config file#
In Tower of Power, a config.json
file is required at the root of the project. A sample named config.json.dist
can be found at the root of the project, but it will need to be updated with environment-specific values. Below is a description of the different properties that may be set in the Config file.
Database#
A database
section is required, containing the following fields:
Property | Value | Required | Description |
---|---|---|---|
"host" | "127.0.0.1" | Yes | The IP address of the database. |
"port" | 5984 | Yes | The Port to access the database. |
"clusters_db" | "kazoo_clusters" | Yes | The name of the clusters db (the -top suffix will be added automatically). |
"mvnos_db" | "mvnos" | Yes | The name of the mvnos db (the -top suffix will be added automatically). |
"ports_db" | "number_ports" | Yes | The name of the ports db (the -top suffix will be added automatically). |
"unknown_usage_db" | "unknown_numbers_usage" | Yes | The name of the unknown data usage db (the -top suffix will be added automatically). |
"blocked_devices_db" | "blocked_devices" | Yes | The name of the blocked devices db (the -top suffix will be added automatically). |
"throttled_devices_db" | "throttled_devices" | Yes | The name of the throttled devices db (the -top suffix will be added automatically). |
Log#
A log
section is required, containing the following fields:
Property | Value | Required | Description |
---|---|---|---|
"log_type" | "file" | Yes | The type of logging ("file" or "syslog") to use. TOP should use file logs. |
"log_file" | "/var/log/towerofpower/top.log" | Yes | The full path of the log file used for general logging in TOP. |
"public_api_log_file" | "/var/log/towerofpower/public_api.log" | Yes | The full path of the log file used for public API logging in TOP. |
Mailer#
A mailer
section is required, containing the following fields:
Property | Value | Required | Description |
---|---|---|---|
"default_from" | "noreply@{{hostname}}" | Yes | The default "from" address to be used for emails sent by TOP. |
"default_to" | "mobile-services@2600hz.com" | Yes | The default "to" address to be used for emails sent by TOP. |
"default_cc" | "/var/log/towerofpower/public_api.log" | No | The default "cc" address(es) to be used for emails sent by TOP. Can be set as a string or array of strings. |
"default_bcc" | "/var/log/towerofpower/public_api.log" | No | The default "bcc" address(es) to be used for emails sent by TOP. Can be set as a string or array of strings. |
"smtp_info" | Object | No | An object containing the SMTP server info to be used for emails sent by TOP. If not specified, the php mail function will be used. The required fields below are only required if this field is specified. |
"smtp_info.host" | "smtp.myserver.com" | Yes | The address of the SMTP server to be used |
"smtp_info.port" | "0000" | Yes | The port of the SMTP server to be used |
"smtp_info.username" | "username" | Yes | The username used for authentication with the SMTP server |
"smtp_info.password" | "password" | Yes | The password used for authentication with the SMTP server |
"smtp_info.encryption" | "tls" | No | The encryption type of the SMTP server. Accepted values are "tls" and "ssl". If not specified, default value will be "tls". |
"t_mobile_cancellations" | Object | Yes | An object containing the email addresses to use for T-Mobile cancellation emails. |
"t_mobile_cancellations.from" | "example@address.com" | Yes | The "from" address, it may need to be the same as the smtp username depending on how the server is configured |
"t_mobile_cancellations.to" | "support@sensitek.com" | Yes | The "to" address, which should be the sensitek support team, who deals with cancellation. |
"t_mobile_cancellations.cc" | [] | No | The "cc" address. |
"t_mobile_cancellations.bcc" | ["mobile-cancellations@2600hz.com"] | Yes | The "bcc" address, should be set to our cancellation distribution list, so we can keep track of sent requests. |
"t_mobile_cancellations.reply_to" | "mobile-cancellations@2600hz.com" | Yes | The "reply-to" address, should be set to our cancellation distribution list. |
Note: All email addresses above can use macros. Currently, the only existing macro is {{hostname}}
.
Kazoo#
A kazoo
section is required, containing the following fields:
Property | Value | Required | Description |
---|---|---|---|
"master_cluster_id" | "8a901bea1d3297ef7d4c8d34809472c2" | Yes | The ID of the master kazoo cluser. This will be used for super_master authentication and various scripts. |
Encryption#
An encryption
section is required, containing the following fields:
Property | Value | Required | Description |
---|---|---|---|
"secret" | "def0000069be2e06492675526726ff87e3b84b903b0dedc1c5204852ef42b119caff024fd6149fa233b70c74c27bcba0af0c0087149b03aa65ec88139aeafc042c6fd2c0" | Yes | The "secret" used to encrypt the API Key in the Cluster document (See Cluster documentation). |
Porting#
A porting
section is required, containing the following fields:
Property | Value | Required | Description |
---|---|---|---|
"staleness_threshold" | 14 | Yes | The number of days after which a non-resolved port request will be marked as "stale". This is a default value that can be overriden at the MVNO level (See MVNO documentation). |
Billing#
A billing
section is required, containing the following fields:
Property | Value | Required | Description |
---|---|---|---|
"data_bucket_price" | 0.99 | Yes | The price of a 100MB "bucket" to be used by the billing system. This is the base amount used to bill accounts on kazoo via the ledgers API. |
"apply_data_caps" | true | Yes | A flag determining whether or not data caps set on accounts and devices will actually be applied. If set to false, no device will get blocked/throttled when reaching their respective cap. However, an email alert will still be sent either way. |