Certificates - What is the difference between SSL_TYPE=manual vs SSL_TYPE=letsencrypt?
#4585
-
|
Hi, I see zero difference between those two options, in practice.
SSL_TYPE=manual
SSL_CERT_PATH=/certs/cert.pem
SSL_KEY_PATH=/certs/key.pem - /docker/swag/config/etc/letsencrypt/live/domain.com/fullchain.pem:/certs/cert.pem:ro
- /docker/swag/config/etc/letsencrypt/live/domain.com/privkey.pem:/certs/key.pem:ro
SSL_TYPE=letsencrypt - /docker/swag/config/etc/letsencrypt/:/etc/letsencrypt/:roDMS works exactly the same either way, and in both cases you have to inject a certificate chain+key, or a folder structure that DMS recognizes. So the question is... why the 2 options? Are you thinking of adding certbot to DMS one day? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
No. We have it documented how to do that with their official container. There's many ways to acquire certs, and you'll find a post a few years back where someone requested certbot integration and I commented with details as to why we'd want to avoid that in DMS I think.
DMS was started back in 2015 by a dev that wanted to share their work. It's been heavily extended and refactored since then. I think the manual approach might have been what was originally the default. Then someone contributed LetsEncrypt as a convenience. Around late 2020, I arrived to the project and audited the TLS config and PR'd some improvements. LetsEncrypt often is provisioned in a structure that uses symlinks, our docs make this rather clear as a caveat to be aware of. Thus you would need to mounot that whole folder for symlinks to resolve correctly IIRC, it may depend how different CRI (podman, k8s, docker) handle that though. For bind mounts, if you only bind mount a file, it's tied to the inode. Should that file on the host be updated in a way that the inode is modified, the container would no longer receive updates to that file (it'd continue to point to the old inode that is no longer visible as a file on the host filesystem), IIRC this also prevents modifications from within the container should those changes attempt to modify the inode. Thus folder mounts are often a better choice (but you lose the benefit of remapping the filenames). I can't recall what the behaviour is like when you bind mount symlinks, and it may depend how those symlinks are later updated when the cert is renewed. So that's something you might want to investigate.
I refactored the scripts in docker-mailserver/target/scripts/helpers/ssl.sh Lines 162 to 201 in d0a915b docker-mailserver/target/scripts/helpers/ssl.sh Lines 223 to 269 in d0a915b
We have more than 2 options for this setting, they're just more niche. As explained above, it's mostly due to how the project evolved. FWIW: A little over 2 years ago I outlined a way forward to refactor this TLS support into something simpler and more implicit. Doing so would broaden compatibility further as well. I've just not had time to tackle that yet (like with most tasks for DMS) as my time on the project is often invested in support, PR reviews, and general maintenance (with revisions to our docs being rather "expensive" for me to do time-wise). |
Beta Was this translation helpful? Give feedback.
-
|
Chipping in because i thought since nginx v1.28 (deployed either on docker or the host, often with custom repo) adds built in acme support, i wonder if i still can use letsencrypt ssl type. I'll test this on my server with nginx' example config with mounting the |
Beta Was this translation helpful? Give feedback.
No. We have it documented how to do that with their official container.
There's many ways to acquire certs, and you'll find a post a few years back where someone requested certbot integration and I commented with details as to why we'd want to avoid that in DMS I think.
DMS was started back in 2015 by a dev that wanted to share their work. It's been heavily extended and refactored since then.
I think the manual approach might have been what was originally the default. Then someone contributed LetsEncrypt as a convenience.
Around late 2020, I arrived to the project and audi…