greenhost / certbot-haproxy

HAProxy plugin for Let's Encrypt's Certbot
Other
126 stars 21 forks source link

Parse haproxy.cfg to get hosts #6

Closed camlafit closed 7 years ago

camlafit commented 7 years ago

Should be interesting to parse file to list all hdr(host) and propose in certbot a default host listing

frozen-sky commented 7 years ago

This is an option, we had this discussion internally. The problem is, haproxy is a very flexible platform, and not everybody will use the hdr(host) command. So it should be optional.

camlafit commented 7 years ago

Hi

Idea is to propose a default host listing. This listing can be follow different uses case and can be incomplete. I've think to hdr(host) because is my use case.

Should be interesting to have a behavior nice to certbot-apache . Some vhost are detected but listing can be partial. All vhost are not detected.

SnijderC commented 7 years ago

In interactive mode we actually do just about what you described, for the purpose of being compatible with certbot's workflow. It checks for a pattern that should contain:

acl [name] hdr(host) -i [domain].[tld]

This is done by checking a regex pattern which is defined in constants.py, constant: RE_HAPROXY_DOMAIN_ACL. You could overwrite this or suggest a change by making a pull-request.

Does that help?

camlafit commented 7 years ago

Hi

Looks great indeed, on my previous use any host was detected. I'll check my config and compare with this regexp.

Thanks