fix: lego v5 = syntax for flags

This commit is contained in:
Claus Lohmar 2026-07-07 15:14:13 +01:00
parent fbbf1732b3
commit d144fcdc28

View file

@ -164,16 +164,16 @@ func obtainCertsLego(domains []string, email, backupDir, legoDir, legoPath strin
return fmt.Errorf("creating lego dir: %w", err)
}
// Build lego args (v5+: flags go after the command)
// Build lego args (v5+: flags go after the command, use = syntax)
args := []string{"run",
"--email", email,
"--email=" + email,
"--http",
"--http.port", ":80",
"--path", legoDir,
"--http.port=:80",
"--path=" + legoDir,
"--accept-tos",
}
for _, d := range domains {
args = append(args, "--domains", d)
args = append(args, "--domains="+d)
}
cmd := exec.Command(legoPath, args...)