WARNING This is deprecated. You should instead use the official LEGO provider https://go-acme.github.io/lego/dns/njalla/
Updated 25/09/2022: njal.la api was updated - and lego lib wasn't working anymore.
A patch was provided but Traefik 2.9 is still not including the patch. (failed to unmarshal response result: json: cannot unmarshal string into Go struct field Record.id of type int when trying to renew certificates)
Solution ? Use this tool as an http provider to correctly renew certificates. So this is temporarily undeprecated to patch this Traefik issue.
API for njal.la automatic wildcard certification with Let's Encrypt (compatible with lego's httpreq strategy).
Disclosure: It relies on my unofficial njal.la library node-njalla-dns to administrate your domains.
Don't forget to change variables.
NJALLA_API_KEYis your njal.la API key (Go on https://njal.la/settings/api/ to grab one)HTTPREQ_USERNAMEis a username that will be used by lego to access this APIHTTPREQ_PASSWORDis a password that will be used by lego to access this API
$ npm install && NJALLA_API_KEY=your_njalla_api_key \
HTTPREQ_USERNAME=lego \
HTTPREQ_PASSWORD=password \
npm run startWe advise you to use docker to test your configuration. The next command runs a DNS validation like it will do when deployed on production.
Don't forget to change variables before running.
HTTPREQ_USERNAMEis theHTTPREQ_USERNAMEyou set when you started the APIHTTPREQ_PASSWORDis theHTTPREQ_PASSWORDyou set when you started the APIHTTPREQ_ENDPOINTis the host and port of this API--domainsis the domain you want LEGO to get certificates for--emailis the email that will be used by Let's Encrypt
$ docker run --rm -ti \
-e "HTTPREQ_USERNAME=lego" \
-e "HTTPREQ_PASSWORD=password" \
-e "HTTPREQ_ENDPOINT=http://<your_local_ip_like_192_168_0_xx>:8080" \
goacme/lego \
--server=https://acme-staging-v02.api.letsencrypt.org/directory \
--dns httpreq \
--domains domain.io \
--email hello@romualdr.io runNote that this command uses staging LE environment to avoid hitting the request limit
docker build -t njalla-letsencrypt:latest -f ./docker/Dockerfile .
docker-compose -f ./docker/docker-compose.yml up -d lego-njalla-api