moved migration directory to db, fix sync records

This commit is contained in:
azivner
2018-01-28 21:00:54 -05:00
parent 75878c80a8
commit 9a0c2b6bcd
77 changed files with 20 additions and 17 deletions

View File

@@ -0,0 +1,25 @@
const password_encryption = require('../services/password_encryption');
const readline = require('readline');
const cl = readline.createInterface(process.stdin, process.stdout);
function question(q) {
return new Promise( (res, rej) => {
cl.question( q, answer => {
res(answer);
})
});
}
module.exports = async () => {
const password = await question("Enter password: ");
let dataKey = await password_encryption.getDecryptedDataKey(password);
console.log("Original data key: ", dataKey);
dataKey = dataKey.slice(0, 16);
console.log("Trimmed data key: ", dataKey);
await password_encryption.setDataKey(password, dataKey);
};