chore: update scripts

This commit is contained in:
Isaac 2023-02-13 13:14:51 +00:00
parent c03eafd329
commit 63c3cc729a
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33
2 changed files with 3 additions and 2 deletions

View File

@ -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.',
));

View File

@ -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');
}