Sha256: de51ca124513058cfc175c32359b0a3a2926b13a7521c484f217963c12546cc3

Contents?: true

Size: 736 Bytes

Versions: 13

Compression:

Stored size: 736 Bytes

Contents

root = File.expand_path(File.join(File.dirname(__FILE__), "../.."))
require File.join(root, "lib/configuration")

namespace :keypair do
  task :generate do |t|
    if File.exists?(Houston.config.keypair)
      puts "#{Houston.config.keypair} exists"
      exit
    end
    
    tmp = Rails.root.to_s
    
    `openssl genrsa -des3 -passout pass:#{Houston.config.passphrase.shellescape} -out #{tmp}/config/private.pem 2048`
    `openssl rsa -in #{tmp}/config/private.pem -passin pass:#{Houston.config.passphrase.shellescape} -out #{tmp}/config/public.pem -outform PEM -pubout`
    `cat #{tmp}/config/private.pem #{tmp}/config/public.pem >> #{Houston.config.keypair}`
    `rm #{tmp}/config/private.pem #{tmp}/config/public.pem`
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
houston-core-0.7.0.beta lib/tasks/keypair.rake
houston-core-0.6.3 lib/tasks/keypair.rake
houston-core-0.6.2 lib/tasks/keypair.rake
houston-core-0.6.1 lib/tasks/keypair.rake
houston-core-0.6.0 lib/tasks/keypair.rake
houston-core-0.5.6 lib/tasks/keypair.rake
houston-core-0.5.5 lib/tasks/keypair.rake
houston-core-0.5.4 lib/tasks/keypair.rake
houston-core-0.5.3 lib/tasks/keypair.rake
houston-core-0.5.2 lib/tasks/keypair.rake
houston-core-0.5.1 lib/tasks/keypair.rake
houston-core-0.5.0 lib/tasks/keypair.rake
houston-core-0.5.0.beta1 lib/tasks/keypair.rake