Closed sjafferali closed 1 year ago
I think these two changes should fix it.
edit: The healthcheck is fixed but there is still a little issue with the redirect, unrelated to docker and healthcheck. edit 2: redirect issue is now also fixed.
Corrected with the above commits and new version is building now.
Thank you, @gregtwallace! I just had a chance to try out the new version and it looks like it fixed the issue.
Additionally, I was actually planning on submitting a PR to fix the redirect issue (I noticed as well since I run certhub behind a reverse proxy), but it seems like you beat me to it. 😄 Awesome.
Currently the healthcheck command built into the docker image results in the below failure after setting up a certificate and leaving http redirects enabled on a launch of a new container.
If we were to bypass the certificate check, it results in a new error.
It seems the API endpoint that the healthcheck is currently configured to check, requires authentication, and also does not support HEAD requests. https://github.com/gregtwallace/legocerthub-backend/blob/master/pkg/domain/app/routes.go#L21
We likely need to need to add the
--no-check-certificate
flag to the wget command and additionally configure it to check another URL - one that supports HEAD requests and does not require authentication.I also noticed, updating the healthcheck URL to the root without any path, succeeds in its current state.
Alternatively, if we want to continue health checking something on the API path we would need to disable the authentication requirement on the
/api/status
path, or create a new/api/ping
or/api/health
endpoint that requires no authentication.