MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.9k stars 499 forks source link

DietPi-Software/LetsEncrypt | acme.sh #2363

Open Kreeblah opened 5 years ago

Kreeblah commented 5 years ago

Creating a software request:

Vote for it on FeatHub: https://feathub.com/MichaIng/DietPi/+28

Give us some formal software information:

Are there similar/alternative software titles available with DietPi-Software?

What makes your requested software better than the above solutions, if available?

How can DietPi make the installation easier or compatible, than following the install instructions or do APT installation, if available?

Can you provide the installation steps that you would suggest DietPi-Software to do?

  1. Download the acme.sh script as an appropriate user
  2. Prompt for details about the certificate, what it will be used for, which domain to issue it under, what key length to use, and where to keep it (if it won't be used for Apache or Nginx)
  3. Reload the web server daemon if applicable, or other service if specified as a separate --reloadcmd value.

Are you willing to help maintaining the software installation, e.g. in case of needed setup changes due to updates etc.? This is not needed, but could speed up our decision to implement it, as man power is always a topic :wink:.

MichaIng commented 5 years ago

@Kreeblah Thanks for your request.

Jep we had this suggestion in the past. Actually my plan is to create a new DietPi-TLS script. This should allow to:

It makes sense then to allow DNS validation method, e.g. if no webserver is installed, the cert is required for something else.

Other issues/feature requests related to this:

MichaIng commented 5 years ago

Added to FeatHub, feel free to vote for it: https://feathub.com/MichaIng/DietPi/+28

Kreeblah commented 5 years ago

Um, did that comment get left on the wrong issue? That link points to an entry for Etherpad.

MichaIng commented 5 years ago

@Kreeblah Whoopsie, fixed!

keithellis74 commented 5 years ago

Hi guys, I'm in the process of setting up HAproxy to handle a single SSL cert for multiple sub domains directing to multiple backends. Is there a timeline for wildcard lets encrypt certificates?

MichaIng commented 5 years ago

@keithellis74 Larger tasks, will take at least 2 DietPi subversions longer. However easy to apply manually, which webserver do you use?

Ah it's HAproxy only that requires the certificate, if I get it right? Then dietpi-letsencrypt would currently anyway not work, since it applies/installs the cert for Apache2/Nginx/Lighttpd/Minio S3 only currently. Another task to add HAproxy support, respectively standalone cert creation option without any install.

In this case please do the following:

EDIT: See below, DNS authentication required, which somehow makes sense to verify that you really own all subdomains.


Hmm official instructions state to use DNS authentication for wildcards, not sure currently if the above works as well: https://certbot.eff.org/lets-encrypt/debianstretch-haproxy And it looks like the webserver needs to be setup with SSL + cert as well, not just the load balancer. Sorry I have not really any experience with HAproxy 😉. If indeed required, then the steps are as well not too hard to apply manually.

ovz93br43v7 commented 3 years ago

Probably useful, I read here from DietPi. In the comment section was a discussion about Certbot which ended in two proposals: https://github.com/diafygi/acme-tiny and the already mentioned https://github.com/acmesh-official/acme.sh

So probably acme-tiny is worth a look.

MichaIng commented 3 years ago

Here is how I use acme.sh currently: https://github.com/MichaIng/hacks/blob/main/install_acme.sh

acme-tiny is a Python script (hence not so "tiny" when taking into account the dependency) and not developed for more than a year. acme.sh is very actively developed and has a large set DNS authentication plugins, full support for as well ECC certs and all such, so I think between those two the match is more than clear 😉.

sannidhyaroy commented 1 year ago

Adding acme.sh to dietpi-software would be really useful.

cujomalainey commented 1 year ago

Came across this after going through the guide on digitalocean and then tricking the dietpi script into setting up renewal services. Definitely would be great to get better support for use cases like HTTPS over VPN.

master-kw commented 2 months ago

I'm making the jump from a Synology NAS to a Docker solution with DietPi (the NAS remains data storage).

Currently I retrieve and create the LE (wildcard) certificate with acme.sh and “push” it to the Diskstation with a defined deployhook.

I have now installed Docker and acme.sh as a container under DietPi. Using the appropriate commands, I was also able to successfully retrieve a certificate here. All data is stored on the client in the Docker container.

Where does the certificate have to go, or which deployhook do I have to execute in order to be able to integrate it later using reverse proxy? On my diskstation, the renewal took place automatically without having to release any ports.

Sorry for that extremely short explanation but I would explain this further if my approach here is the right way.

Regards, Oliver

Joulinar commented 2 months ago

You would need to configure your acme.sh container in away to store certificates on local storage outside the container. This way you are able to access them and can do whatever you want.

MichaIng commented 2 months ago

Note that acme.sh is a well documented single standalone shell script. I see zero reason why one would want to wrap it into a Docker container, where you just replace one CLI with another + complexity + overhead + points of failure etc. Nothing against containers, but a shell script is not a use case for them.

master-kw commented 2 months ago

Okay, I will test it on a separate client. There‘re a view things more to plan. :-)