Browse files

reduce fragility on encryption key for data population

  • Loading branch information...
1 parent 4d67d70 commit 2e7825b60c873641beaa7718d9056107a4572143 @shackbarth shackbarth committed Jul 14, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/lib/build_database.js
View
4 scripts/lib/build_database.js
@@ -223,9 +223,9 @@ var async = require('async'),
winston.info("Applying build to database " + spec.database);
credsClone.database = spec.database;
buildDatabaseUtil.sendToDatabase(allSql, credsClone, spec, function (err, res) {
- if (spec.populateData) {
+ if (spec.populateData && creds.encryptionKeyFile) {
var populateSql = "DO $$ XT.disableLocks = true; $$ language plv8;";
- var encryptionKey = fs.readFileSync(path.join(__dirname, "../../node-datasource", creds.encryptionKeyFile), "utf8");
+ var encryptionKey = fs.readFileSync(path.resolve(__dirname, "../../node-datasource", creds.encryptionKeyFile), "utf8");
var patches = require(path.join(__dirname, "../../enyo-client/database/source/populate_data")).patches;
_.each(patches, function (patch) {
patch.encryptionKey = encryptionKey;

0 comments on commit 2e7825b

Please sign in to comment.