Browse Source

fix: add missing EOL for git key contents

NGPixel 5 năm trước cách đây
mục cha
commit
19e4ab69d2
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      server/modules/storage/git/storage.js

+ 2 - 1
server/modules/storage/git/storage.js

@@ -6,6 +6,7 @@ const stream = require('stream')
 const Promise = require('bluebird')
 const pipeline = Promise.promisify(stream.pipeline)
 const klaw = require('klaw')
+const os = require('os')
 
 const pageHelper = require('../../../helpers/page')
 const assetHelper = require('../../../helpers/asset')
@@ -67,7 +68,7 @@ module.exports = {
         if (this.config.sshPrivateKeyMode === 'contents') {
           try {
             this.config.sshPrivateKeyPath = path.resolve(WIKI.ROOTPATH, WIKI.config.dataPath, 'secure/git-ssh.pem')
-            await fs.outputFile(this.config.sshPrivateKeyPath, this.config.sshPrivateKeyContent, {
+            await fs.outputFile(this.config.sshPrivateKeyPath, this.config.sshPrivateKeyContent + os.EOL, {
               encoding: 'utf8',
               mode: 0o600
             })