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