diff --git a/scripts/keygen.js b/scripts/keygen.js index 4a6964a..08ec5d0 100644 --- a/scripts/keygen.js +++ b/scripts/keygen.js @@ -2,7 +2,7 @@ const { randomBytes } = require('crypto'); const { short } = require('leeks.js'); console.log(short( - 'Set the "ENCRYPTION_KEY" environment variable to: \n&!b' + + 'Set the "ENCRYPTION_KEY" environment variable to: \n&!b ' + randomBytes(24).toString('hex') + - '&r\n\n&0&!e WARNING &r &e&lIf you lose the encryption key, most of the data in the database will become unreadable, requiring a new key and a full reset.', + ' &r\n\n&0&!e WARNING &r &e&lIf you lose the encryption key, most of the data in the database will become unreadable, requiring a new key and a full reset.', )); \ No newline at end of file diff --git a/scripts/preinstall.js b/scripts/preinstall.js index 20261e5..2e51c02 100644 --- a/scripts/preinstall.js +++ b/scripts/preinstall.js @@ -29,6 +29,7 @@ if (!process.env.ENCRYPTION_KEY && !fs.existsSync('./.env')) { log('generating ENCRYPTION_KEY'); fs.writeFileSync('./.env', Object.entries(env).map(([k, v]) => `${k}=${v}`).join('\n')); log('created .env file'); + log(short('&r&0&!e WARNING &r &e&lkeep your environment variables safe, don\'t lose your encryption key or you will lose data')); } else { log('nothing to do'); } \ No newline at end of file