fix up notify.js and README
This commit is contained in:
parent
4dd69df9f5
commit
ec09aaeb7d
2 changed files with 10 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ npm install
|
|||
## Configuration
|
||||
|
||||
```bash
|
||||
bin/ssu config smtp2go user pass toEmail
|
||||
bin/ssu config smtp2go user pass fromEmail toEmail
|
||||
bin/ssu config twilio accountSid authToken fromNumber toNumber
|
||||
bin/ssu set sms twilio
|
||||
bin/ssu set email smtp2go
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
require('es6-promise').polyfill()
|
||||
|
||||
var fs = require('fs')
|
||||
var notifier = require('../lib/notifier')
|
||||
var db = require('../lib/postgresql_interface')
|
||||
|
||||
|
|
@ -10,7 +11,14 @@ function getBalances () {
|
|||
]
|
||||
}
|
||||
|
||||
db.init('psql://lamassu:lamassu@localhost/lamassu')
|
||||
var psqlUrl
|
||||
try {
|
||||
psqlUrl = process.env.DATABASE_URL || JSON.parse(fs.readFileSync('/etc/lamassu.json')).postgresql
|
||||
} catch (ex) {
|
||||
psqlUrl = 'psql://lamassu:lamassu@localhost/lamassu'
|
||||
}
|
||||
|
||||
db.init(psqlUrl)
|
||||
notifier.init(db, getBalances, {lowBalanceThreshold: 10})
|
||||
console.log('DEBUG0')
|
||||
notifier.checkStatus()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue