Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions on how to symlink certificates from outside to be used with this Docker image. #111

Open
GuruSR opened this issue Dec 17, 2024 · 2 comments

Comments

@GuruSR
Copy link

GuruSR commented Dec 17, 2024

I have Letsencrypt already doing certificates for various other containers and services, would like to use the same ones for this one, what would it take to get this working? Perhaps put this into a Wiki or discussion as to how to proceed with this.

Thanks!

@Nico640
Copy link
Owner

Nico640 commented Dec 18, 2024

Use the SSL_CERT and SSL_CERT_KEY environment variables mentioned in the readme.

For example, setting these environment variables:
SSL_CERT=cert.crt
SSL_CERT_KEY=cert.key
means that it will look for cert.crt and cert.key in the /config/usercert/ directory (inside the container).
/config/ should already be mapped outside of the container, in your case to /home/pi/unms/, so the two files have to be in the /home/pi/unms/usercert/ directory on your host.
That's basically it, it should then simply use that certificate for the web server.

@GuruSR
Copy link
Author

GuruSR commented Dec 18, 2024

I looked at my deploy for Letsencrypt, it was indeed copying the files to the usercert folder, but it was setting it to the wrong user, I've since corrected it and the run.sh I use to start/restart the Docker. Is there a "sane" way to shutdown this Docker without forcing it off with the stop, or do I have to worry about that?

In the deploy it is doing this:
docker exec unms_unms_1 /refresh-certificate.sh --custom

And I'm getting:
Custom certificate is not defined.
Keeping existing certificate for 'localhost'.

I presume since I've started it without the -e's for the usercerts that that is the error reason, but what is a sane way to stop the docker so I don't lose any data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants