go-acme / lego

Let's Encrypt/ACME client and library written in Go
https://go-acme.github.io/lego/
MIT License
7.44k stars 987 forks source link

renew doesn't take multiple domains #2148

Closed pointlessone closed 3 months ago

pointlessone commented 3 months ago

Welcome

What did you expect to see?

I want to renew multiple domains. From the --help and docs I see that --domains can be specified multiple times. I assume this means that every specified domain will be processed by the specified subcommand.

What did you see instead?

I run lego like this:

lego --domains first.domain --domains second.domain --domains another.domain renew

But only the first domain renewal is attempted.

2024/04/02 07:29:23 [first.domain] The certificate expires in 87 days, the number of days defined to perform the renewal is 30: no renewal.

All other domains are ignored.

PS: --domains is not a good parameter name as it, apparently, only takes one domain.

How do you use lego?

Binary

Reproduction steps

  1. Have multiple domains
  2. lego -d domain1 -d domain2 renew

Version of lego

lego version 4.16.1 linux/arm64

Logs

This is all I get. Only one (first) domain is mentioned in the output. ```console 2024/04/02 07:29:23 [domain1] The certificate expires in 87 days, the number of days defined to perform the renewal is 30: no renewal. ```

Go environment (if applicable)

```console $ go version && go env go version go1.22.1 linux/arm64 GO111MODULE='' GOARCH='arm64' GOBIN='' GOCACHE='/root/.cache/go-build' GOENV='/root/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='arm64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/root/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/root/go' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOROOT='/usr/lib/go' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='local' GOTOOLDIR='/usr/lib/go/pkg/tool/linux_arm64' GOVCS='' GOVERSION='go1.22.1' GCCGO='gccgo' AR='ar' CC='aarch64-unknown-linux-gnu-gcc' CXX='aarch64-unknown-linux-gnu-g++' CGO_ENABLED='1' GOMOD='/dev/null' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -pthread -fmessage-length=0 -ffile-prefix-map=/tmp/go-build910179223=/tmp/go-build -gno-record-gcc-switches' ``` The binary is built on Gentoo via portage so this output might be not entirely representative.
ldez commented 3 months ago

Hello,

--domains flag can be repeated to handle multiple domains: --domains first.domain --domains second.domain --domains another.domain

The first domain will be used as the main and the other as sans.

About the name --domains: #526

Duplicate of #806