create-better-system 1.0.1 → 1.0.2
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/index.js +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import inquirer from 'inquirer'
|
|
|
4
4
|
import { execa } from 'execa'
|
|
5
5
|
import fs from 'fs-extra'
|
|
6
6
|
import path from 'path'
|
|
7
|
+
import crypto from 'crypto'
|
|
7
8
|
|
|
8
9
|
const THEME_PRESETS = {
|
|
9
10
|
dark: {
|
|
@@ -236,8 +237,7 @@ const envPath = path.join(backendPath, '.env')
|
|
|
236
237
|
|
|
237
238
|
await fs.copy(envExamplePath, envPath)
|
|
238
239
|
|
|
239
|
-
const
|
|
240
|
-
const generatedKey = appKey.trim().split('\n').pop().trim()
|
|
240
|
+
const generatedKey = crypto.randomBytes(32).toString('base64url')
|
|
241
241
|
|
|
242
242
|
let envContent = await fs.readFile(envPath, 'utf-8')
|
|
243
243
|
envContent = envContent.replace('APP_KEY=', `APP_KEY=${generatedKey}`)
|