byjg / docker-easy-haproxy

Discover services and create dynamically the haproxy.cfg based on the labels defined in docker containers or from a simple static Yaml
MIT License
56 stars 13 forks source link

Add letsencrypt integration #13

Closed josegonzalez closed 2 years ago

josegonzalez commented 2 years ago

It would be cool to have automatic letsencrypt support for this codebase. While haproxy doesn't support it directly (yet? ever?), I found this repo from the official Github account, documented here on their blog.

Might be a cool addition to add somehow - maybe something like easyproxy.letsencrypt=true? The config file could be templated based on env vars for the easyhaproxy container :)

byjg commented 2 years ago

I'll take a look at it and let you know.

byjg commented 2 years ago

I found this tutorial newer, using certbot - https://devops.cisel.ch/lets-encrypt-on-haproxy and I found this other https://gist.github.com/lmmendes/7fad9a2c8f389b39b6661d0945b72cb7

I'll try to play with all these options.

byjg commented 2 years ago

To implement the letsencrypt I had to do another refactoring in the code. But it is good. That will open space for the improvements will suggest.

I am keeping https://test2.xpto.us. open so that you can access and test. This returns only the container hostname.

The PR is #21

byjg commented 2 years ago

All issues merged. Use the tag master while I don't create the tag 4.1.0