From 3681d89a61d8c4465ffb59fe2889a5e281926639 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 23 Oct 2024 10:34:55 +0800 Subject: [PATCH] chore: --- packages/core/acme-client/src/auto.js | 7 ++++++- .../plugin-cert/src/plugin/cert-plugin/acme.ts | 4 ++-- .../plugins/cert/domains-verify-plan-editor/api.ts | 6 ++++-- .../domains-verify-plan-editor/cname-record-info.vue | 11 +++++++---- .../domains-verify-plan-editor/cname-verify-plan.vue | 1 + 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/core/acme-client/src/auto.js b/packages/core/acme-client/src/auto.js index 07635263..dcb47ac4 100644 --- a/packages/core/acme-client/src/auto.js +++ b/packages/core/acme-client/src/auto.js @@ -264,6 +264,7 @@ module.exports = async (client, userOpts) => { finally { if (client.opts.sslProvider !== 'google') { // letsencrypt 如果同时检出两个TXT记录,会以第一个为准,就会校验失败,所以需要提前删除 + // zerossl 此方式测试无问题 log(`清理challenge痕迹,length:${clearTasks.length}`); try { // eslint-disable-next-line no-await-in-loop @@ -279,7 +280,11 @@ module.exports = async (client, userOpts) => { } finally { if (client.opts.sslProvider === 'google') { - // google 相同的域名txt记录是一样的,不能提前删除,否则校验失败 + // google 相同的域名txt记录是一样的,不能提前删除,否则校验失败,报错如下 + // Error: The TXT record retrieved from _acme-challenge.bbc.handsfree.work. + // at the time the challenge was validated did not contain JshHVu7dt_DT6uYILWhokHefFVad2Q6Mw1L-fNZFcq8 + // (the base64url-encoded SHA-256 digest of RlJZNBR0LWnxNK_xd2zqtYVvCiNJOKJ3J1NmCjU_9BjaUJgL3k-qSpIhQ-uF4FBS.NRyqT8fRiq6THzzrvkgzgR5Xai2LsA2SyGLAq_wT3qc). + // See https://tools.ietf.org/html/rfc8555#section-8.4 for more information. log(`清理challenge痕迹,length:${clearTasks.length}`); try { // eslint-disable-next-line no-await-in-loop diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/acme.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/acme.ts index 79784e04..cb00d9d7 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/acme.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/acme.ts @@ -90,9 +90,9 @@ export class AcmeService { async getAcmeClient(email: string, isTest = false): Promise { const mappings = {}; - if (this.sslProvider === "google") { + if (this.sslProvider === "letsencrypt") { mappings["acme-v02.api.letsencrypt.org"] = this.options.reverseProxy || "le.px.certd.handfree.work"; - } else if (this.sslProvider === "letsencrypt") { + } else if (this.sslProvider === "google") { mappings["dv.acme-v02.api.pki.goog"] = this.options.reverseProxy || "gg.px.certd.handfree.work"; } const urlMapping: UrlMapping = { diff --git a/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/api.ts b/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/api.ts index 85394285..baeaee01 100644 --- a/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/api.ts +++ b/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/api.ts @@ -3,8 +3,10 @@ import { request } from "/src/api/service"; const apiPrefix = "/cname/record"; export type CnameRecord = { - id: number; - status: string; + id?: number; + status?: string; + hostRecord?: string; + recordValue?: string; }; export async function GetList() { diff --git a/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/cname-record-info.vue b/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/cname-record-info.vue index 50e16f69..5050c142 100644 --- a/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/cname-record-info.vue +++ b/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/cname-record-info.vue @@ -7,6 +7,7 @@ + CNAME @@ -44,10 +45,12 @@ const props = defineProps<{ }>(); const emit = defineEmits<{ - change: { - id: number | null; - status: string | null; - }; + change: [ + { + id: number | null; + status: string | null; + } + ]; }>(); const cnameRecord = ref(null); diff --git a/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/cname-verify-plan.vue b/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/cname-verify-plan.vue index 41259ad4..ce4d571e 100644 --- a/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/cname-verify-plan.vue +++ b/packages/ui/certd-client/src/components/plugins/cert/domains-verify-plan-editor/cname-verify-plan.vue @@ -3,6 +3,7 @@ 主机记录 + 记录类型 请设置CNAME记录(验证成功以后不要删除) 状态 操作