Merge pull request #411 from 5aaee9/v2

支持为 Lego 添加额外的命令参数
pull/413/head
greper 2025-06-04 16:41:17 +08:00 committed by GitHub
commit 9d10c45dac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 3 deletions

View File

@ -80,17 +80,29 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
legoEabAccessId!: number; legoEabAccessId!: number;
@TaskInput({ @TaskInput({
title: "自定义LEGO参数", title: "自定义LEGO全局参数",
component: { component: {
name: "a-input", name: "a-input",
vModel: "value", vModel: "value",
placeholder: "--dns-timeout 30", placeholder: "--dns-timeout 30",
}, },
helper: "额外的lego命令行参数参考文档https://go-acme.github.io/lego/usage/cli/options/", helper: "额外的lego全局命令行参数参考文档https://go-acme.github.io/lego/usage/cli/options/",
maybeNeed: true, maybeNeed: true,
}) })
customArgs = ""; customArgs = "";
@TaskInput({
title: "自定义LEGO签名参数",
component: {
name: "a-input",
vModel: "value",
placeholder: "--no-bundle",
},
helper: "额外的lego签名命令行参数参考文档https://go-acme.github.io/lego/usage/cli/options/",
maybeNeed: true,
})
customCommandOptions = "";
@TaskInput({ @TaskInput({
title: "加密算法", title: "加密算法",
value: "ec256", value: "ec256",
@ -205,7 +217,7 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin {
if (this.acmeServer) { if (this.acmeServer) {
serverArgs = ` --server ${this.acmeServer}`; serverArgs = ` --server ${this.acmeServer}`;
} }
const cmds = [`${legoPath} -a --email "${this.email}" --dns ${this.dnsType} ${keyType} ${domainArgs} ${serverArgs} ${eabArgs} ${savePathArgs} ${this.customArgs || ""} run`]; const cmds = [`${legoPath} -a --email "${this.email}" --dns ${this.dnsType} ${keyType} ${domainArgs} ${serverArgs} ${eabArgs} ${savePathArgs} ${this.customArgs || ""} run ${this.customCommandOptions || ""}`];
await this.ctx.utils.sp.spawn({ await this.ctx.utils.sp.spawn({
cmd: cmds, cmd: cmds,