-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Environment
Self-Hosted (Docker)
System
24.0.7
Version
2.1.1
Describe the problem
This is similar to #768, #840, and #843, however none of those issues resolve this specific issue.
Healthcheck is failing under docker when SSL certificate files are passed to the container as described in the documentation (snippet below): https://github.com/Lissy93/dashy/blob/master/docs/management.md#passing-a-self-signed-certificate-to-dashy
Passing a Self-Signed Certificate to Dashy
Once you've generated your SSL cert, you'll need to pass it to Dashy. This can be done by specifying the paths to your public and private keys using the SSL_PRIV_KEY_PATH and SSL_PUB_KEY_PATH environmental variables. Or if you're using Docker, then just pass public + private SSL keys in under /etc/ssl/certs/dashy-pub.pem and /etc/ssl/certs/dashy-priv.key respectively
I think the issue is with the isSsl test at the beginning of healthcheck.js. It is determining if SSL is applicable strictly based on the SSL-related environment variables (SSL_PRIV_KEY_PATH and SSL_PUB_KEY_PATH) that are mentioned in the docs.
The docs indicate that with Docker you just need to pass the key files to the container (without specifying the environment variables), and indeed Dashy will run in SSL mode by doing so. However, because healthcheck.js is only using the environment variables to determine the SSL status, if you don't set them it assumes non-SSL and ultimately fails because it gets a "302 Found" instead of a "200 OK".
Ideally, the isSsl check should probably include whatever mechanism Dashy is using to put itself in SSL mode based on the presence of the key files in the container, however you can work around this issue simply by specifying the environment variables with docker run / docker compose:
--env SSL_PUB_KEY_PATH="/etc/ssl/certs/dashy-pub.pem"
--env SSL_PRIV_KEY_PATH="/etc/ssl/certs/dashy-priv.key" \
By specifying the environment variables (in addition to passing the key files), the isSsl check determines the correct SSL status and the rest of the healthcheck proceeds as it should.
Additional info
No response
Please tick the boxes
- You have explained the issue clearly, and included all relevant info
- You are using a supported version of Dashy
- You've checked that this issue hasn't already been raised
- You've checked the docs and troubleshooting guide
- You agree to the code of conduct
Metadata
Metadata
Assignees
Labels
Projects
Status