improve config saving; fix pairing bug

This commit is contained in:
Josh Harvey 2017-05-07 15:29:18 +03:00
parent 67e12b19cb
commit f3f46f7b5b
4 changed files with 81 additions and 9 deletions

View file

@ -6,14 +6,12 @@ const baseX = require('base-x')
const options = require('../options')
const db = require('../db')
const pairing = require('../pairing')
const ALPHA_BASE = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'
const bsAlpha = baseX(ALPHA_BASE)
function unpair (deviceId) {
const sql = 'delete from devices where device_id=$1'
return db.none(sql, [deviceId])
}
const unpair = pairing.unpair
function totem (hostname, name) {
const caPath = options.caPath