Plugin to read file and expose an API endpoint

What are the limitations of plugins?

I found very little documentation about this.

Can I respond to http requests / extend traefik / expose a REST API ?

Can I read a file ( acme.json) . I believe I can do this - I saw some plugins that do that.

I would like to implement a plugin that leverages traefik ACME support and provision those certificates for services that don't support acme (DB's , etc) .

Traefik would fetch the cert and store it in acme.json.
I would read the file and expose it as a secure API , preferably private to my swarm cluster if possible.
I would then call this API to get certs for each service that needs them.

AFAIK a plugin is a middleware, so can intercept and change requests after router match before service call.

It’s written in go, it runs in an own runtime, you can not select which target service instance the request is proxied to. You can change headers and body going both ways. And you can have static variables for example for caching across requests.


Traefik has a read only API, so you can write external programs for example to fetch Host(), generate a TLS cert, then supply it as dynamic config via http, file or redis, etc (doc).