slackhive 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/init.js +5 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -140,6 +140,7 @@ async function init(opts) {
|
|
|
140
140
|
envContent += `\nADMIN_USERNAME=${response.adminUsername}\n`;
|
|
141
141
|
envContent += `ADMIN_PASSWORD=${response.adminPassword}\n`;
|
|
142
142
|
envContent += `AUTH_SECRET=${randomSecret()}\n`;
|
|
143
|
+
envContent += `ENV_SECRET_KEY=${randomSecret()}\n`;
|
|
143
144
|
envContent += `\nNODE_ENV=production\n`;
|
|
144
145
|
(0, fs_1.writeFileSync)(envPath, envContent);
|
|
145
146
|
console.log('');
|
|
@@ -156,6 +157,8 @@ async function init(opts) {
|
|
|
156
157
|
missingKeys.push('REDIS_PASSWORD');
|
|
157
158
|
if (!envContents.includes('AUTH_SECRET='))
|
|
158
159
|
missingKeys.push('AUTH_SECRET');
|
|
160
|
+
if (!envContents.includes('ENV_SECRET_KEY='))
|
|
161
|
+
missingKeys.push('ENV_SECRET_KEY');
|
|
159
162
|
if (missingKeys.length > 0) {
|
|
160
163
|
console.log(chalk_1.default.yellow(` warning: .env is missing: ${missingKeys.join(', ')} — patching...`));
|
|
161
164
|
let patch = '';
|
|
@@ -163,6 +166,8 @@ async function init(opts) {
|
|
|
163
166
|
patch += `\nREDIS_PASSWORD=${randomSecret().slice(0, 16)}\n`;
|
|
164
167
|
if (!envContents.includes('AUTH_SECRET='))
|
|
165
168
|
patch += `AUTH_SECRET=${randomSecret()}\n`;
|
|
169
|
+
if (!envContents.includes('ENV_SECRET_KEY='))
|
|
170
|
+
patch += `ENV_SECRET_KEY=${randomSecret()}\n`;
|
|
166
171
|
require('fs').appendFileSync(envPath, patch);
|
|
167
172
|
console.log(chalk_1.default.green(' ✓') + ' .env patched');
|
|
168
173
|
}
|
package/dist/index.js
CHANGED