Sha256: a9c9d235d1e16256cb25caca2d51b2655e1bc73985e695a891e6e00881baa73d

Contents?: true

Size: 1.14 KB

Versions: 766

Compression:

Stored size: 1.14 KB

Contents

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

require 'yaml'

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

pwn_provider = ENV.fetch('PWN_PROVIDER') if ENV.fetch('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

766 entries across 766 versions & 1 rubygems

Version Path
pwn-0.5.253 vagrant/provisioners/letsencrypt.rb
pwn-0.5.252 vagrant/provisioners/letsencrypt.rb
pwn-0.5.251 vagrant/provisioners/letsencrypt.rb
pwn-0.5.250 vagrant/provisioners/letsencrypt.rb
pwn-0.5.249 vagrant/provisioners/letsencrypt.rb
pwn-0.5.248 vagrant/provisioners/letsencrypt.rb
pwn-0.5.247 vagrant/provisioners/letsencrypt.rb
pwn-0.5.246 vagrant/provisioners/letsencrypt.rb
pwn-0.5.245 vagrant/provisioners/letsencrypt.rb
pwn-0.5.244 vagrant/provisioners/letsencrypt.rb
pwn-0.5.243 vagrant/provisioners/letsencrypt.rb
pwn-0.5.242 vagrant/provisioners/letsencrypt.rb
pwn-0.5.241 vagrant/provisioners/letsencrypt.rb
pwn-0.5.240 vagrant/provisioners/letsencrypt.rb
pwn-0.5.239 vagrant/provisioners/letsencrypt.rb
pwn-0.5.238 vagrant/provisioners/letsencrypt.rb
pwn-0.5.237 vagrant/provisioners/letsencrypt.rb
pwn-0.5.236 vagrant/provisioners/letsencrypt.rb
pwn-0.5.235 vagrant/provisioners/letsencrypt.rb
pwn-0.5.234 vagrant/provisioners/letsencrypt.rb