Skip to content

Commit 367e4d4

Browse files
authored
Use a dummy chain process for backward compatibility (#131)
1 parent 9a330f7 commit 367e4d4

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

fs_overlay/etc/cont-init.d/00-welcome

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
echo '
44
========================================
5-
HTTPS-PORTAL v1.2.6
5+
HTTPS-PORTAL v1.2.7
66
========================================
77
'

fs_overlay/opt/certs_manager/certs_manager.rb

-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def setup
1212

1313
OpenSSL.ensure_dhparam
1414
OpenSSL.ensure_account_key
15-
download_intermediate_cert
1615
Nginx.setup
1716
Nginx.start
1817

@@ -25,8 +24,6 @@ def setup
2524
def renew
2625
puts "Renewing ..."
2726
with_lock do
28-
download_intermediate_cert
29-
3027
NAConfig.domains.each do |domain|
3128
if OpenSSL.need_to_sign_or_renew? domain
3229
ACME.sign(domain)
+3-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
require 'open-uri'
22

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

149
def mkdir(domain)
@@ -22,8 +17,4 @@ def add_dockerhost_to_hosts
2217
f.puts "#{docker_host_ip}\tdockerhost"
2318
end
2419
end
25-
26-
def intermediate_cert_path
27-
'/var/lib/https-portal/intermediate.pem'
28-
end
2920
end

fs_overlay/opt/certs_manager/lib/open_ssl.rb

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def self.self_sign(domain)
5050
EOC
5151

5252
system command
53+
54+
system "ln -s #{domain.signed_cert_path} #{domain.chained_cert_path}"
5355
end
5456

5557
private

0 commit comments

Comments
 (0)