Skip to content

Commit

Permalink
Use a dummy chain process for backward compatibility (SteveLTN#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLTN authored Apr 27, 2018
1 parent 9a330f7 commit 367e4d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion fs_overlay/etc/cont-init.d/00-welcome
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

echo '
========================================
HTTPS-PORTAL v1.2.6
HTTPS-PORTAL v1.2.7
========================================
'
3 changes: 0 additions & 3 deletions fs_overlay/opt/certs_manager/certs_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def setup

OpenSSL.ensure_dhparam
OpenSSL.ensure_account_key
download_intermediate_cert
Nginx.setup
Nginx.start

Expand All @@ -25,8 +24,6 @@ def setup
def renew
puts "Renewing ..."
with_lock do
download_intermediate_cert

NAConfig.domains.each do |domain|
if OpenSSL.need_to_sign_or_renew? domain
ACME.sign(domain)
Expand Down
15 changes: 3 additions & 12 deletions fs_overlay/opt/certs_manager/lib/commands.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
require 'open-uri'

module Commands
def download_intermediate_cert
unless File.exist? intermediate_cert_path
File.open(intermediate_cert_path, 'wb') do |saved_file|
open('https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem', 'rb') do |read_file|
saved_file.write(read_file.read)
end
end
end
def chain_cert(domain)
# Keeping this step for backward compatibility
system "ln -s #{domain.signed_cert_path} #{domain.chained_cert_path}"
end

def mkdir(domain)
Expand All @@ -22,8 +17,4 @@ def add_dockerhost_to_hosts
f.puts "#{docker_host_ip}\tdockerhost"
end
end

def intermediate_cert_path
'/var/lib/https-portal/intermediate.pem'
end
end
2 changes: 2 additions & 0 deletions fs_overlay/opt/certs_manager/lib/open_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def self.self_sign(domain)
EOC

system command

system "ln -s #{domain.signed_cert_path} #{domain.chained_cert_path}"
end

private
Expand Down

0 comments on commit 367e4d4

Please sign in to comment.