perf: add preferred chain option (#519) @ZeroClover

v2-dev
Zero Clover 2025-09-06 00:41:03 +08:00 committed by GitHub
parent bb4d5f1e93
commit 902359f24e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 1 deletions

View File

@ -329,8 +329,9 @@ export class AcmeService {
isTest?: boolean;
privateKeyType?: string;
profile?: string;
preferredChain?: string;
}): Promise<CertInfo> {
const { email, isTest, csrInfo, dnsProvider, domainsVerifyPlan, profile } = options;
const { email, isTest, csrInfo, dnsProvider, domainsVerifyPlan, profile, preferredChain } = options;
const client: acme.Client = await this.getAcmeClient(email, isTest);
let domains = options.domains;
@ -404,6 +405,7 @@ export class AcmeService {
},
signal: this.options.signal,
profile,
preferredChain,
});
const crtString = crt.toString();

View File

@ -292,6 +292,29 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
})
certProfile!: string;
@TaskInput({
title: "首选链",
value: "ISRG Root X1",
component: {
name: "a-select",
vModel: "value",
options: [
{ value: "ISRG Root X1", label: "ISRG Root X1" },
{ value: "ISRG Root X2", label: "ISRG Root X2" },
],
},
helper: "仅 Let's Encrypt 可选,默认为 ISRG Root X1",
required: false,
mergeScript: `
return {
show: ctx.compute(({form})=>{
return form.sslProvider === 'letsencrypt'
})
}
`,
})
preferredChain!: string;
@TaskInput({
title: "使用代理",
value: false,
@ -438,6 +461,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin {
isTest: false,
privateKeyType: this.privateKeyType,
profile: this.certProfile,
preferredChain: this.preferredChain,
});
const certInfo = this.formatCerts(cert);

View File

@ -934,6 +934,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
"sslProvider": "letsencrypt",
"privateKeyType": "rsa_2048",
"certProfile": "classic",
"preferredChain": "ISRG Root X1",
"useProxy": false,
"skipLocalVerify": false,
"maxCheckRetryCount": 20,