generator-razor 13.4.9 → 13.4.10
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/app/index.js +3 -61
- package/package.json +1 -1
package/app/index.js
CHANGED
|
@@ -297,13 +297,8 @@ module.exports = class extends Generator {
|
|
|
297
297
|
|
|
298
298
|
this._createSymlinks(this, path, () => {
|
|
299
299
|
copydir(t.templatePath(version), t.destinationPath('./'), () => {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
t._local12Settings(t)
|
|
303
|
-
} else {
|
|
304
|
-
t._localconf(t)
|
|
305
|
-
t._localSettings(t)
|
|
306
|
-
}
|
|
300
|
+
t._localconf12(t)
|
|
301
|
+
t._localSettings(t)
|
|
307
302
|
|
|
308
303
|
t._createDb((response) => {
|
|
309
304
|
t._processSqlFile(t, response, () => {
|
|
@@ -402,28 +397,6 @@ module.exports = class extends Generator {
|
|
|
402
397
|
}
|
|
403
398
|
|
|
404
399
|
_localconf (t) {
|
|
405
|
-
fs.readFile('typo3conf/LocalConfiguration.php', 'utf8', (err, content) => {
|
|
406
|
-
let newContent = t._substituteMarker(content, '###DBNEW###', rzr.DbNew.toLowerCase(), true)
|
|
407
|
-
newContent = t._substituteMarker(newContent, '###HOST###', rzr.DbHostname, true)
|
|
408
|
-
newContent = t._substituteMarker(newContent, '###PROJECTNAME###', rzr.ProjectName, true)
|
|
409
|
-
|
|
410
|
-
const encryptionKey = crypto.randomBytes((96 + 1) / 2).toString('hex')
|
|
411
|
-
newContent = t._substituteMarker(newContent, '###ENCRYPTION_KEY###', encryptionKey, true)
|
|
412
|
-
|
|
413
|
-
const hash = argon2.hash(rzr.Pass)
|
|
414
|
-
hash.then(function (res) {
|
|
415
|
-
newContent = t._substituteMarker(newContent, '###PASS###', res, true)
|
|
416
|
-
|
|
417
|
-
t._localconfWrite(newContent)
|
|
418
|
-
})
|
|
419
|
-
|
|
420
|
-
if (err) {
|
|
421
|
-
console.error('error setting LocalConfiguration.php')
|
|
422
|
-
}
|
|
423
|
-
})
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
_localconf12 (t) {
|
|
427
400
|
fs.readFile('typo3conf/system/settings.php', 'utf8', (err, content) => {
|
|
428
401
|
let newContent = t._substituteMarker(content, '###DBNEW###', rzr.DbNew.toLowerCase(), true)
|
|
429
402
|
newContent = t._substituteMarker(newContent, '###HOST###', rzr.DbHostname, true)
|
|
@@ -436,7 +409,7 @@ module.exports = class extends Generator {
|
|
|
436
409
|
hash.then(function (res) {
|
|
437
410
|
newContent = t._substituteMarker(newContent, '###PASS###', res, true)
|
|
438
411
|
|
|
439
|
-
t.
|
|
412
|
+
t._localconfWrite(newContent)
|
|
440
413
|
})
|
|
441
414
|
|
|
442
415
|
if (err) {
|
|
@@ -446,41 +419,10 @@ module.exports = class extends Generator {
|
|
|
446
419
|
}
|
|
447
420
|
|
|
448
421
|
_localconfWrite (content) {
|
|
449
|
-
fs.writeFile('typo3conf/LocalConfiguration.php', content, 'utf8', () => {})
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
_localconfWrite12 (content) {
|
|
453
422
|
fs.writeFile('typo3conf/system/settings.php', content, 'utf8', () => {})
|
|
454
423
|
}
|
|
455
424
|
|
|
456
425
|
_localSettings (t) {
|
|
457
|
-
if (rzr.Transport === 'smtp') {
|
|
458
|
-
let encryptVariable = '###SMTP_ENCRYPT###'
|
|
459
|
-
if (rzr.Encrypt === true || rzr.Encrypt === false) {
|
|
460
|
-
encryptVariable = "'###SMTP_ENCRYPT###'"
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
fs.readFile('typo3conf/Local.php', 'utf8', (err, content) => {
|
|
464
|
-
let newContent = t._substituteMarker(content, '###TRANSPORT###', rzr.Transport, true)
|
|
465
|
-
newContent = t._substituteMarker(newContent, encryptVariable, rzr.Encrypt, true)
|
|
466
|
-
newContent = t._substituteMarker(newContent, '###SMTP_PASS###', rzr.SmtpPass, true)
|
|
467
|
-
newContent = t._substituteMarker(newContent, '###SMTP_SERVER###', rzr.SmtpServer, true)
|
|
468
|
-
newContent = t._substituteMarker(newContent, '###SMTP_USER###', rzr.SmtpUser, true)
|
|
469
|
-
newContent = t._substituteMarker(newContent, '###SMTP_EMAIL###', rzr.SmtpEmail, true)
|
|
470
|
-
newContent = t._substituteMarker(newContent, '###SMTP_NAME###', rzr.SmtpName, true)
|
|
471
|
-
|
|
472
|
-
fs.writeFile('typo3conf/Local.php', newContent, 'utf8', () => {})
|
|
473
|
-
|
|
474
|
-
if (err) {
|
|
475
|
-
console.error('error setting local settings')
|
|
476
|
-
}
|
|
477
|
-
})
|
|
478
|
-
} else {
|
|
479
|
-
fs.unlink('typo3conf/Local.php', () => {})
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
_local12Settings (t) {
|
|
484
426
|
if (rzr.Transport === 'smtp') {
|
|
485
427
|
let encryptVariable = '###SMTP_ENCRYPT###'
|
|
486
428
|
if (rzr.Encrypt === true || rzr.Encrypt === false) {
|