Sha256: b39665fcd2403fbfcd243e33fa6e1d3de79c5e9b050ecfafc228ed2f2d1e306c

Contents?: true

Size: 1.11 KB

Versions: 64

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'yaml'

print "Installing Let's Encrypt **************************************************************"
if ENV['PWN_ROOT']
  pwn_root = ENV['PWN_ROOT']
elsif Dir.exist?('/pwn')
  pwn_root = '/pwn'
else
  pwn_root = Dir.pwd
end

pwn_provider = ENV['PWN_PROVIDER'] if ENV['PWN_PROVIDER']
letsencrypt_git = 'https://github.com/letsencrypt/letsencrypt'
letsencrypt_root = '/opt/letsencrypt-git'
letsencrypt_yaml = YAML.load_file("#{pwn_root}/etc/userland/#{pwn_provider}/letsencrypt/vagrant.yaml")
letsencrypt_domains = letsencrypt_yaml['domains']
letsencrypt_email = letsencrypt_yaml['email'].to_s.scrub.strip.chomp

letsencrypt_flags = '--apache'
letsencrypt_domains.each { |domain| letsencrypt_flags = "#{letsencrypt_flags} -d #{domain}" }
letsencrypt_flags = "#{letsencrypt_flags} --non-interactive --agree-tos --text --email #{letsencrypt_email}"

system(
  "sudo -i /bin/bash \
    --login \
    -c \"
      git clone #{letsencrypt_git} #{letsencrypt_root} && \
      cd #{letsencrypt_root} && \
      ./letsencrypt-auto-source/letsencrypt-auto #{letsencrypt_flags}
    \"
  "
)

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
pwn-0.4.407 vagrant/provisioners/letsencrypt.rb
pwn-0.4.406 vagrant/provisioners/letsencrypt.rb
pwn-0.4.405 vagrant/provisioners/letsencrypt.rb
pwn-0.4.404 vagrant/provisioners/letsencrypt.rb
pwn-0.4.403 vagrant/provisioners/letsencrypt.rb
pwn-0.4.402 vagrant/provisioners/letsencrypt.rb
pwn-0.4.401 vagrant/provisioners/letsencrypt.rb
pwn-0.4.400 vagrant/provisioners/letsencrypt.rb
pwn-0.4.399 vagrant/provisioners/letsencrypt.rb
pwn-0.4.398 vagrant/provisioners/letsencrypt.rb
pwn-0.4.396 vagrant/provisioners/letsencrypt.rb
pwn-0.4.394 vagrant/provisioners/letsencrypt.rb
pwn-0.4.393 vagrant/provisioners/letsencrypt.rb
pwn-0.4.391 vagrant/provisioners/letsencrypt.rb
pwn-0.4.390 vagrant/provisioners/letsencrypt.rb
pwn-0.4.389 vagrant/provisioners/letsencrypt.rb
pwn-0.4.388 vagrant/provisioners/letsencrypt.rb
pwn-0.4.387 vagrant/provisioners/letsencrypt.rb
pwn-0.4.386 vagrant/provisioners/letsencrypt.rb
pwn-0.4.385 vagrant/provisioners/letsencrypt.rb