This commit is contained in:
邱博亞 2024-05-09 00:11:08 +08:00
parent e057744fcd
commit f3c6d82693
1 changed files with 1 additions and 1 deletions

View File

@ -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)) 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)} 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)) 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") 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)) 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)} File.open(private_key_store_path,'w+'){|f| f.write(private_key_content)}