Skip to content
This repository was archived by the owner on Feb 6, 2019. It is now read-only.

Commit e506c05

Browse files
committed
Use same config file format as the chill monitor
1 parent 39079e0 commit e506c05

File tree

5 files changed

+149
-38
lines changed

5 files changed

+149
-38
lines changed

.gitignore

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# Dependency directories
9-
node_modules
10-
11-
# Optional npm cache directory
12-
.npm
13-
14-
# Optional REPL history
15-
.node_repl_history
16-
17-
# Yarn integrity file
18-
.yarn-integrity
19-
20-
# IntelliJ IDE
21-
.idea
22-
23-
# Build directory
24-
dist
25-
26-
# Dotenv configuration
27-
.env
28-
29-
# Visual Studio Code
30-
.vscode
31-
32-
# Test Coverage
33-
coverage
34-
35-
# Chill database
36-
chill.db
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Dependency directories
9+
node_modules
10+
11+
# Optional npm cache directory
12+
.npm
13+
14+
# Optional REPL history
15+
.node_repl_history
16+
17+
# Yarn integrity file
18+
.yarn-integrity
19+
20+
# IntelliJ IDE
21+
.idea
22+
23+
# Build directory
24+
dist
25+
26+
# Dotenv configuration
27+
.env
28+
29+
# Visual Studio Code
30+
.vscode
31+
32+
# Test Coverage
33+
coverage
34+
35+
# Chill database
36+
chill.db
37+
chill.yml

chill.yml.dist

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
logging:
2+
level: debug
3+
4+
db:
5+
client: 'sqlite3'
6+
connection:
7+
filename: './chill.db'
8+
9+
restApi:
10+
port: 8000
11+
12+
monitoring:
13+
minInterval: 1000
14+
maxInterval: 10000
15+
method: OPTIONS
16+
downStatus: '^(5..|4..)$'
17+
18+
notifications:
19+
slack:
20+
enabled: false
21+
endpoint: SLACK_WEBHOOK_ENDPOINT
22+
hipchat:
23+
enabled: false
24+
authToken: HIPCHAT_WEBHOOK_TOKENID
25+
roomId: HIPTCHAT_WEBHOOK_ROOMID
26+
twilio:
27+
enabled: false
28+
sender: SENDING_NUMBER
29+
receiver: RECEIVING_NUMBER
30+
authToken: AUTH_TOKEN
31+
accountSid: ACCOUNT_SID
32+
email:
33+
enabled: false
34+
transport:
35+
service: EMAIL_SERVICE # Check https://nodemailer.com/smtp/well-known/ for all email services
36+
auth:
37+
user: EMAIL_ACCOUNT_USERNAME
38+
pass: EMAIL_ACCOUNT_PASSWORD
39+
sender: SENDER_NAME_EMAIL
40+
receivers:
41+
- RECEIVER_EMAIL
42+
templateDir: TEMPLATE_DIRECTORY
43+
44+
services:
45+
- name: 'Localhost'
46+
url: 'http://127.0.0.1'

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"boom": "^4.2.0",
2626
"compression": "^1.6.2",
2727
"cors": "^2.8.1",
28-
"dotenv": "^4.0.0",
2928
"express": "^4.14.1",
3029
"helmet": "^3.2.0",
3130
"http-status-codes": "^1.0.6",

src/config/config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Note: This file is a total copy-paste from the chill repository
2+
// we'll need to extract a new package called chill-core or chill-common where
3+
// we can put all the common, initialization/config code.
4+
15
import Yaml from 'yamljs';
26
import Promise from 'bluebird';
37
import cache from 'memory-cache';
@@ -17,6 +21,8 @@ export const DEFAULT_FILENAME = 'chill.yml';
1721
* @returns {Object}
1822
*/
1923
export function resolve(filename = DEFAULT_FILENAME) {
24+
process.stdout.write(`Loading config file: ${filename}\n`);
25+
2026
let loadedConfig = Yaml.load(filename);
2127
let config = merge(defaultConfig, loadedConfig);
2228

src/config/default.config.js

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
// Note: This file is a total copy-paste from the chill repository
2+
// we'll need to extract a new package called chill-core or chill-common where
3+
// we can put all the common, initialization/config code.
4+
5+
import path from 'path';
6+
17
export default {
28
logging: {
39
level: 'info',
@@ -6,5 +12,58 @@ export default {
612
levelColumnWidth: 7,
713
tsFormat: () => new Date().toISOString(),
814
dateFormat: 'yyyy-MM-dd'
9-
}
15+
},
16+
db: {
17+
client: 'sqlite3',
18+
connection: {
19+
filename: './chill.db'
20+
},
21+
useNullAsDefault: true
22+
},
23+
restApi: {
24+
port: 8000
25+
},
26+
monitoring: {
27+
method: 'OPTIONS',
28+
minInterval: 1000,
29+
maxInterval: 10000,
30+
downStatus: '^(5..|4..)$'
31+
},
32+
notifications: {
33+
slack: {
34+
enabled: false,
35+
endpoint: null,
36+
baseUrl: 'https://hooks.slack.com/services'
37+
},
38+
hipchat: {
39+
notify: true,
40+
enabled: false,
41+
roomId: null,
42+
authToken: null,
43+
emailId: 'chill@noreply.com',
44+
baseUrl: 'https://api.hipchat.com/v2/room/'
45+
},
46+
twilio: {
47+
enabled: false,
48+
sender: null,
49+
receiver: null,
50+
authToken: null,
51+
accountSid: null
52+
},
53+
email: {
54+
enabled: false,
55+
transport: {
56+
service: null,
57+
auth: {
58+
user: null,
59+
pass: null
60+
}
61+
},
62+
sender: null,
63+
receivers: [],
64+
encoding: 'utf-8',
65+
templateDir: path.resolve(__dirname, '../common/templates/')
66+
}
67+
},
68+
services: []
1069
};

0 commit comments

Comments
 (0)