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.363 vagrant/provisioners/letsencrypt.rb
pwn-0.4.361 vagrant/provisioners/letsencrypt.rb
pwn-0.4.360 vagrant/provisioners/letsencrypt.rb
pwn-0.4.359 vagrant/provisioners/letsencrypt.rb
pwn-0.4.357 vagrant/provisioners/letsencrypt.rb
pwn-0.4.356 vagrant/provisioners/letsencrypt.rb
pwn-0.4.355 vagrant/provisioners/letsencrypt.rb
pwn-0.4.353 vagrant/provisioners/letsencrypt.rb
pwn-0.4.352 vagrant/provisioners/letsencrypt.rb
pwn-0.4.351 vagrant/provisioners/letsencrypt.rb
pwn-0.4.350 vagrant/provisioners/letsencrypt.rb
pwn-0.4.349 vagrant/provisioners/letsencrypt.rb
pwn-0.4.348 vagrant/provisioners/letsencrypt.rb
pwn-0.4.347 vagrant/provisioners/letsencrypt.rb
pwn-0.4.346 vagrant/provisioners/letsencrypt.rb
pwn-0.4.344 vagrant/provisioners/letsencrypt.rb
pwn-0.4.343 vagrant/provisioners/letsencrypt.rb
pwn-0.4.342 vagrant/provisioners/letsencrypt.rb
pwn-0.4.341 vagrant/provisioners/letsencrypt.rb
pwn-0.4.340 vagrant/provisioners/letsencrypt.rb