From 74acbad505800a9a3317a631a2333be1e34992b5 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 10 Mar 2020 13:20:11 -0400 Subject: [PATCH] FIX: don't break the private key when writing it out during theme import * when importing a private theme using the themes:install rake task the SSH key is written out to a file for use by the git-clone command * if the private key is written out without a newline at end-of-file (i.e. after it's been stripped) it's not recognized as a valid key by SSH * so: don't strip it when writing it out, we should be fine --- lib/theme_store/git_importer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/theme_store/git_importer.rb b/lib/theme_store/git_importer.rb index 0fccf3886c..c73d44f807 100644 --- a/lib/theme_store/git_importer.rb +++ b/lib/theme_store/git_importer.rb @@ -107,7 +107,7 @@ class ThemeStore::GitImporter ssh_folder = "#{Pathname.new(Dir.tmpdir).realpath}/discourse_theme_ssh_#{SecureRandom.hex}" FileUtils.mkdir_p ssh_folder - File.write("#{ssh_folder}/id_rsa", @private_key.strip) + File.write("#{ssh_folder}/id_rsa", @private_key) FileUtils.chmod(0600, "#{ssh_folder}/id_rsa") begin