Coder Social home page Coder Social logo

Comments (5)

dietmar avatar dietmar commented on August 25, 2024 1

I disagree, the original script works very well for multiple domains.

When I first read the script, I was also a bit surprised by this mkdir statement:

domains=(example.org www.example.org)
rsa_key_size=4096
data_path="./data/certbot"
# ...
mkdir -p "$data_path/conf/live/$domains"

But this is actually fine, domains is a Bash array, and using $domains will give you the first element of the array.

Try this:

echo "The value of domains is: $domains"

It will print The value of domains is: example.org, without mentioning the second domain www.example.org. So the mkdir command is fine.

Now as far as the actual certbot command is concerned, the original script is IMHO much better than @masikh's version above, because it only creates one certificate, which is valid for all the given domains. The above version on the other hand creates a separate certificate for every domain.

https://eff-certbot.readthedocs.io/en/stable/using.html#certbot-command-line-options says:

-d DOMAIN, --domains DOMAIN, --domain DOMAIN
                        Domain names to include. For multiple domains you can
                        use multiple -d flags or enter a comma separated list
                        of domains as a parameter. All domains will be
                        included as Subject Alternative Names on the
                        certificate. The first domain will be used as the
                        certificate name, unless otherwise specified or if you
                        already have a certificate with the same name. In the
                        case of a name conflict, a number like -0001 will be
                        appended to the certificate name. (default: Ask)

from nginx-certbot.

dontic avatar dontic commented on August 25, 2024

Worked like a charm, thanks @masikh !

from nginx-certbot.

hguilla avatar hguilla commented on August 25, 2024

The problem seem to be that what @dietmar is saying works only for bash.
In bash I get the same result that you got executing:

echo "The value of domains is: $domains"

But when executing the same 2 commands (including the same variable assignment) in zsh I got:

The value of domains is: example.org www.example.org

from nginx-certbot.

kzkvv avatar kzkvv commented on August 25, 2024

Met the same issue today on Ubuntu 20.0.4. I defined 2 domains in array, but all commands were completed for first domain only.
I like the solution by masich more, because it's more intuitive, it's easier to read the code with explicitly defined cycles, and ofk it's more convinient to debug it.

from nginx-certbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.