From f3c6d826938af2bae232734a48a0d199e5b8734f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 9 May 2024 00:11:08 +0800 Subject: [PATCH] Fix bug. --- lib/tasks/detect_sites.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/detect_sites.rake b/lib/tasks/detect_sites.rake index 0dbfcf3..b56f080 100644 --- a/lib/tasks/detect_sites.rake +++ b/lib/tasks/detect_sites.rake @@ -148,7 +148,7 @@ namespace :create_site do FileUtils.mkdir_p(File.dirname(cert_file_store_path)) unless Dir.exist?(File.dirname(cert_file_store_path)) File.open(cert_file_store_path,'w+'){|f| f.write(crt_file_content)} site_cert.cert_file.retrieve_from_store!(File.basename(cert_file_store_path)) - private_key_store_path = "public/#{site_cert.cert_file.store_dir}/#{File.basename(private_key_path)}" + private_key_store_path = "public/#{site_cert.private_key.store_dir}/#{File.basename(private_key_path)}" private_key_content = exec_ssh_command_by_sudo_and_see_output(ssh,"cat #{private_key_path}",false).select{|s| s.present?}.join("\n").strip.split(/(\r\n|\n)/).select{|s| s.present?}.join("\n") FileUtils.mkdir_p(File.dirname(private_key_store_path)) unless Dir.exist?(File.dirname(private_key_store_path)) File.open(private_key_store_path,'w+'){|f| f.write(private_key_content)}