【新增】支持 acme-dns DNS 验证方式

This commit is contained in:
LystranG
2026-03-22 12:08:57 +08:00
parent 82b96976d0
commit abb0cd6c97
9 changed files with 229 additions and 0 deletions

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19933" width="200" height="200"><path d="M749.1 515.5c-23.8 0.1-47.3 4.5-69.6 12.9l-80.1-159.5c28.6-31.1 31.5-78 6.9-112.3-24.6-34.4-69.9-46.8-108.5-29.7s-60.1 58.8-51.3 100.2c8.7 41.3 45.3 70.9 87.5 70.8 3.3 0.2 6.6 0.2 9.8 0l107.6 214.5 27.8-13.9c49.1-28.4 110.6-24.4 155.6 10.2 45 34.6 64.7 92.9 49.9 147.7-14.8 54.8-61.2 95.2-117.5 102.4-56.3 7.2-111.4-20.3-139.5-69.6l-54.3 31.6c49.4 85.6 153.2 123.4 246.1 89.5 92.9-33.9 148-129.6 130.6-227S848 514.9 749.1 515.2v0.3z" fill="#3296FA" p-id="19934"></path><path d="M404.3 463.6L295.7 630.2c-6.8-1.4-13.7-2-20.7-2-41.6-0.1-77.8 28.2-87.7 68.6-9.8 40.4 9.3 82.3 46.3 101.3s82.2 10.2 109.3-21.3 29.1-77.5 4.8-111.2l142.5-218.9-26.1-17c-49.7-28.2-77.4-83.7-70.1-140.3 7.3-56.7 48-103.3 103.2-118.1 55.2-14.8 113.8 5.2 148.5 50.6 34.6 45.4 38.4 107.3 9.5 156.6l54.3 31.2c18.1-30.9 27.6-66 27.5-101.8 1-94.9-63.7-177.9-156.1-200.1-92.3-22.2-187.7 22.4-229.9 107.4s-20.1 188 53.4 248.1v0.3z" fill="#3296FA" p-id="19935"></path><path d="M665.3 749.3c15.1 40.6 57.2 64.6 99.8 57 42.7-7.7 73.7-44.8 73.7-88.2 0-43.4-31.1-80.5-73.7-88.2s-84.7 16.3-99.8 57H415.2v31.2c0 77.6-62.9 140.5-140.5 140.5s-140.5-62.9-140.5-140.5 62.9-140.5 140.5-140.5v-63.1c-108.6-0.6-198.6 84.2-204.4 192.7s74.5 202.4 182.5 213.5c108 11.1 205.8-64.6 222.1-172l190.4 0.6z" fill="#3296FA" p-id="19936"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -297,6 +297,12 @@ export const ApiProjectConfig: Record<string, ApiProjectType> = {
},
sort: 38,
},
acmedns: {
name: "ACME DNS",
icon: "acmedns",
type: ["dns"],
sort: 39,
},
plugin: {
name: "插件",
icon: "plugin",

View File

@@ -64,6 +64,7 @@ export interface AddAccessParams<
| LecdnAccessConfig
| ConstellixAccessConfig
| WebhookAccessConfig
| AcmeDnsAccessConfig
| SpaceshipAccessConfig
| BTDomainAccessConfig
> {
@@ -102,6 +103,7 @@ export interface UpdateAccessParams<
| LecdnAccessConfig
| ConstellixAccessConfig
| WebhookAccessConfig
| AcmeDnsAccessConfig
| SpaceshipAccessConfig
| BTDomainAccessConfig
> extends AddAccessParams<T> {
@@ -320,6 +322,11 @@ export interface WebhookAccessConfig {
ignore_ssl: "0" | "1";
}
export interface AcmeDnsAccessConfig {
server_url: string;
credentials: string;
}
export interface SpaceshipAccessConfig {
api_key: string;
api_secret: string;

View File

@@ -55,6 +55,7 @@ import type {
LecdnAccessConfig,
ConstellixAccessConfig,
WebhookAccessConfig,
AcmeDnsAccessConfig,
SpaceshipAccessConfig,
BTDomainAccessConfig,
} from "@/types/access";
@@ -554,6 +555,39 @@ export const useApiFormController = (
callback();
},
},
server_url: {
required: true,
trigger: "input",
validator: (
rule: FormItemRule,
value: string,
callback: (error?: Error) => void
) => {
if (!isUrl(value)) {
return callback(new Error("请输入正确的 Server URL"));
}
callback();
},
},
credentials: {
required: true,
trigger: "input",
validator: (
rule: FormItemRule,
value: string,
callback: (error?: Error) => void
) => {
if (!value || value.trim() === "") {
return callback(new Error("请输入 Credentials JSON"));
}
try {
JSON.parse(value);
} catch (error) {
return callback(new Error("Credentials 必须是合法 JSON"));
}
callback();
},
},
api_key: {
trigger: "input",
validator: (
@@ -1320,6 +1354,45 @@ export const useApiFormController = (
})
);
break;
case "acmedns":
items.push(
useFormInput("Server URL", "config.server_url", {
allowInput: noSideSpace,
placeholder: "https://auth.acme-dns.io",
}),
useFormTextarea(
"Credentials(JSON)",
"config.credentials",
{
rows: 8,
placeholder:
'{\n "username": "xxx",\n "password": "xxx",\n "subdomain": "xxx",\n "fulldomain": "xxx.auth.acme-dns.io"\n}',
}
),
useFormCustom(() => {
return (
<NAlert
type="info"
class="mt-[1.2rem] whitespace-normal"
showIcon={false}
>
<span class="text-[1.3rem]">
Credentials acme-dns <code>/register</code>{" "}
JSON
<a
href="https://github.com/acme-dns/acme-dns"
target="_blank"
rel="noreferrer"
class="ml-2 text-[#3296FA] underline"
>
</a>
</span>
</NAlert>
);
})
);
break;
case "spaceship":
items.push(
useFormInput("API Key", "config.api_key", {
@@ -1728,6 +1801,12 @@ export const useApiFormController = (
ignore_ssl: "0",
} as WebhookAccessConfig;
break;
case "acmedns":
param.value.config = {
server_url: "https://auth.acme-dns.io",
credentials: "",
} as AcmeDnsAccessConfig;
break;
case "spaceship":
param.value.config = {
api_key: "",