From 19e4ab69d270bf7858e4d33666cf062b5dfdd6c6 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sat, 16 Nov 2019 19:11:37 -0500 Subject: [PATCH] fix: add missing EOL for git key contents --- server/modules/storage/git/storage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/modules/storage/git/storage.js b/server/modules/storage/git/storage.js index d3073d31..e47d5582 100644 --- a/server/modules/storage/git/storage.js +++ b/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 })