Skip to content

Commit

Permalink
Change version to 1.10.1, add DEBUG flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Weiyan Shao committed Mar 13, 2020
1 parent a870232 commit 4e04ec6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Docker Hub page:
- [Share Certificates with Other Apps](#share-certificates-with-other-apps)
- [HTTP Basic Auth](#http-basic-auth)
- [Access Restriction](#access-restriction)
- [Debugging](#debugging)
- [Advanced Usage](#advanced-usage)
- [Configure Nginx through Environment Variables](#configure-nginx-through-environment-variables)
- [Override Nginx Configuration Files](#override-nginx-configuration-files)
Expand Down Expand Up @@ -374,6 +375,15 @@ my_app:

For valid IP values see [Nginx allow](http://nginx.org/en/docs/http/ngx_http_access_module.html#allow)

### Debugging

With the environment variable `DEBUG=true` you can see more info printed about domain parsing, such as:

```
DEBUG: name:'example.com' upstream:'' redirect_target:''
```


## Advanced Usage

### Configure Nginx through Environment Variables
Expand Down
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.9.0
HTTPS-PORTAL v1.10.1
========================================
'
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 @@ -8,6 +8,7 @@ class CertsManager

def setup
add_dockerhost_to_hosts
NAConfig.domains.each(&:print_debug_info) if NAConfig.debug_mode
NAConfig.domains.each(&:ensure_welcome_page)

OpenSSL.ensure_dhparam
Expand All @@ -26,6 +27,7 @@ def setup

def renew
puts "Renewing ..."
NAConfig.domains.each(&:print_debug_info) if NAConfig.debug_mode
with_lock do
NAConfig.domains.each do |domain|
if OpenSSL.need_to_sign_or_renew? domain
Expand Down
4 changes: 4 additions & 0 deletions fs_overlay/opt/certs_manager/lib/na_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def self.auto_discovered_domains
end
end

def self.debug_mode
ENV['DEBUG']
end

private

def self.parse(domain_desc)
Expand Down
5 changes: 5 additions & 0 deletions fs_overlay/opt/certs_manager/models/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Domain

def initialize(descriptor)
@descriptor = descriptor

create_dir
end

Expand Down Expand Up @@ -123,6 +124,10 @@ def access_restriction
end
end

def print_debug_info
puts "DEBUG: name:'#{name}' upstream:'#{upstream}' redirect_target:'#{redirect_target_url}'"
end

private

def create_dir
Expand Down

0 comments on commit 4e04ec6

Please sign in to comment.