From b84159f2f11531f058837c2e82d66499f3740f20 Mon Sep 17 00:00:00 2001 From: Indexyz <7685264+5aaee9@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:31:25 +0800 Subject: [PATCH] feat(lego): support for command options --- .../src/plugin/cert-plugin/lego/index.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/lego/index.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/lego/index.ts index 9a4d760d..36d9b4a3 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/lego/index.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/lego/index.ts @@ -80,17 +80,29 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin { legoEabAccessId!: number; @TaskInput({ - title: "自定义LEGO参数", + title: "自定义LEGO全局参数", component: { name: "a-input", vModel: "value", 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, }) 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({ title: "加密算法", value: "ec256", @@ -205,7 +217,7 @@ export class CertApplyLegoPlugin extends CertApplyBasePlugin { if (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({ cmd: cmds,