Closed pedro-r-marques closed 4 years ago
Hello @pedro-r-marques,
thank you for your contribution!
First, adding a health endpoint to the service is a nice addition!
I don't think adding an additional configuration file to loginsrv is the way to go forward. This is unexpected for both use cases as a caddy plugin or as standalone software. If used as a caddy plugin the configuration should be put in the Caddyfile. If used as standalone application, the configuration should be put in arguments or environment variables.
vHost support is out of the scope of this project. Maybe running multiple instances of loginsrv (possibly behind some edge proxy, ie traefik) is a solution your use case.
I will close this PR since i will not accept most of the changes. But if you extract the changes regarding the health endpoint i will have a look at this!
This PR adds support for a new yaml configuration file which allows different auth backend usage based on the HOST request header field.
It also adds an health-check option that can be used to specify a path where the server responds with an 200 OK. This is used when the load balancer checks the health of the backend.
Please let me know whether you would be interested in accepting this functionality.