Skip to content

Commit

Permalink
Merge branch '1.2.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLTN committed Apr 30, 2018
2 parents 367e4d4 + d47a936 commit 965aba9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 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.7
HTTPS-PORTAL v1.2.8
========================================
'
2 changes: 2 additions & 0 deletions fs_overlay/opt/certs_manager/certs_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def renew
NAConfig.domains.each do |domain|
if OpenSSL.need_to_sign_or_renew? domain
ACME.sign(domain)
chain_certs(domain)
Nginx.reload
puts "Renewed certs for #{domain.name}"
else
Expand All @@ -53,6 +54,7 @@ def ensure_signed(domains)
OpenSSL.ensure_domain_key(domain)
OpenSSL.create_csr(domain)
if ACME.sign(domain)
chain_certs(domain)
Nginx.config_ssl(domain)
puts "Signed key for #{domain.name}"
else
Expand Down
6 changes: 3 additions & 3 deletions fs_overlay/opt/certs_manager/lib/commands.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'open-uri'

module Commands
def chain_cert(domain)
# Keeping this step for backward compatibility
system "ln -s #{domain.signed_cert_path} #{domain.chained_cert_path}"
def chain_certs(domain)
# Keeping it for backward compatibility
system "test ! -e #{domain.chained_cert_path} && ln -s #{domain.signed_cert_path} #{domain.chained_cert_path}"
end

def mkdir(domain)
Expand Down
2 changes: 0 additions & 2 deletions fs_overlay/opt/certs_manager/lib/open_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def self.self_sign(domain)
EOC

system command

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

private
Expand Down
4 changes: 1 addition & 3 deletions fs_overlay/opt/certs_manager/models/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ def signed_cert_path

# For backward compatibility
def chained_cert_path
puts "Warning: `chained_cert_path` is deprecated. Use `signed_cert_path` instead in your Nginx config file."

signed_cert_path
File.join(dir, 'chained.crt')
end

def ongoing_cert_path
Expand Down

0 comments on commit 965aba9

Please sign in to comment.