feat: add dynv6 dns-01 applicant

This commit is contained in:
Fu Diwei
2025-03-20 23:11:43 +08:00
parent 347d166250
commit da6526d5fa
16 changed files with 315 additions and 1 deletions

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" height="128" width="128" viewBox="-1.5 -32 128 128"><path fill="#cf0000" d="m 124.6,35.7 c 0,3.9 -1.2,7.3 -3.8,10.2 -3.1,3.3 -6.9,5 -11.6,5 -5.5,0 -9.49,-2.2 -12.19,-6.8 -1.8,-3.1 -2.8,-6.7 -2.8,-11 0,-6.2 2.3,-12.3 6.49,-18.1 5,-6.8 11.2,-11.8 18.9,-14.9 0.1,0 0.1,0 0.2,0 0.4,0 0.7,0.3 0.9,1 0.2,0.4 0.3,0.7 0.3,0.9 0,0.3 -0.1,0.4 -0.2,0.5 -5.9,3.1 -10.3,7.8 -13.5,14 -1.5,2.9 -2.6,5.8 -3.4,8.9 1.5,-1.8 3.4,-3 5.7,-3.6 0.7,-0.2 1.6,-0.3 2.3,-0.3 3.9,0 7.1,1.6 9.6,4.7 2.1,2.6 3.1,5.8 3.1,9.5 m -7.9,2 c 0,-2.5 -0.7,-4.8 -2.1,-7.1 -1.5,-2.4 -3.3,-3.6 -5.6,-3.6 -2.2,0 -4.1,1 -5.8,2.9 -0.2,1 -0.3,2 -0.3,3.3 0,9.3 2.4,14 7.1,14 2.6,0 4.5,-1.4 5.7,-4.2 0.7,-1.5 1,-3.3 1,-5.3" /><path fill="#404040" d="M 13.56,32.3 V 21.1 h 5.45 v 29.2 h -5.45 v -3.1 c -0.59,1.2 -1.36,2.1 -2.3,2.7 -0.92,0.6 -2.01,0.9 -3.27,0.9 -2.4,0 -4.27,-0.9 -5.59,-2.9 -1.32,-1.9 -2,-4.7 -2,-8.2 0,-3.5 0.68,-6.2 2.01,-8.1 1.35,-1.9 3.27,-2.9 5.76,-2.9 1.13,0 2.13,0.4 3.02,0.9 0.91,0.6 1.68,1.5 2.37,2.7 M 5.9,39.8 c 0,2.1 0.34,3.7 1.01,4.7 0.68,1.2 1.61,1.8 2.8,1.8 1.19,0 2.12,-0.6 2.81,-1.8 0.68,-1 1.04,-2.6 1.04,-4.7 0,-2 -0.36,-3.6 -1.04,-4.8 C 11.83,33.9 10.9,33.3 9.71,33.3 8.52,33.3 7.59,33.9 6.91,35 6.24,36.2 5.9,37.8 5.9,39.8" /><path fill="#404040" d="m 35.11,52.5 c -0.7,2.1 -1.6,3.4 -2.6,4.3 -1.1,1 -2.3,1.4 -3.8,1.4 h -4.5 V 54 h 2.2 c 1.2,0 2,-0.2 2.5,-0.5 0.5,-0.4 1,-1.3 1.6,-2.7 l 0.4,-1.2 -8,-20.3 h 5.7 l 4.8,13.6 4.7,-13.6 h 5.8 l -8.8,23.2" /><path fill="#404040" d="m 65.01,36.6 v 13.7 h -5.4 V 37.5 c 0,-1.5 -0.2,-2.7 -0.7,-3.3 -0.4,-0.7 -1.1,-1 -2.1,-1 -1,0 -1.8,0.4 -2.3,1.3 -0.6,1 -0.9,2.1 -0.9,3.7 v 12.1 h -5.4 v -21 h 5.4 v 3.1 c 0.4,-1.1 1.1,-2.1 2,-2.7 0.9,-0.6 2.1,-1 3.3,-1 2.1,0 3.6,0.7 4.6,2.1 1,1.2 1.5,3.2 1.5,5.8" /><path fill="#008fd4" d="m 89.71,29.3 -6.8,21 h -6.7 l -6.7,-21 h 5.5 l 4.5,16.4 4.6,-16.4 h 5.6" /></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -25,6 +25,7 @@ import AccessFormClouDNSConfig from "./AccessFormClouDNSConfig";
import AccessFormCMCCCloudConfig from "./AccessFormCMCCCloudConfig";
import AccessFormDNSLAConfig from "./AccessFormDNSLAConfig";
import AccessFormDogeCloudConfig from "./AccessFormDogeCloudConfig";
import AccessFormDynv6Config from "./AccessFormDynv6Config";
import AccessFormEdgioConfig from "./AccessFormEdgioConfig";
import AccessFormGcoreConfig from "./AccessFormGcoreConfig";
import AccessFormGnameConfig from "./AccessFormGnameConfig";
@@ -133,6 +134,8 @@ const AccessForm = forwardRef<AccessFormInstance, AccessFormProps>(({ className,
return <AccessFormDNSLAConfig {...nestedFormProps} />;
case ACCESS_PROVIDERS.DOGECLOUD:
return <AccessFormDogeCloudConfig {...nestedFormProps} />;
case ACCESS_PROVIDERS.DYNV6:
return <AccessFormDynv6Config {...nestedFormProps} />;
case ACCESS_PROVIDERS.GCORE:
return <AccessFormGcoreConfig {...nestedFormProps} />;
case ACCESS_PROVIDERS.GNAME:

View File

@@ -0,0 +1,61 @@
import { useTranslation } from "react-i18next";
import { Form, type FormInstance, Input } from "antd";
import { createSchemaFieldRule } from "antd-zod";
import { z } from "zod";
import { type AccessConfigForDynv6 } from "@/domain/access";
type AccessFormDynv6ConfigFieldValues = Nullish<AccessConfigForDynv6>;
export type AccessFormDynv6ConfigProps = {
form: FormInstance;
formName: string;
disabled?: boolean;
initialValues?: AccessFormDynv6ConfigFieldValues;
onValuesChange?: (values: AccessFormDynv6ConfigFieldValues) => void;
};
const initFormModel = (): AccessFormDynv6ConfigFieldValues => {
return {
httpToken: "",
};
};
const AccessFormDynv6Config = ({ form: formInst, formName, disabled, initialValues, onValuesChange }: AccessFormDynv6ConfigProps) => {
const { t } = useTranslation();
const formSchema = z.object({
httpToken: z
.string()
.min(1, t("access.form.dynv6_http_token.placeholder"))
.max(256, t("common.errmsg.string_max", { max: 256 }))
.trim(),
});
const formRule = createSchemaFieldRule(formSchema);
const handleFormChange = (_: unknown, values: z.infer<typeof formSchema>) => {
onValuesChange?.(values);
};
return (
<Form
form={formInst}
disabled={disabled}
initialValues={initialValues ?? initFormModel()}
layout="vertical"
name={formName}
onValuesChange={handleFormChange}
>
<Form.Item
name="httpToken"
label={t("access.form.dynv6_http_token.label")}
rules={[formRule]}
tooltip={<span dangerouslySetInnerHTML={{ __html: t("access.form.dynv6_http_token.tooltip") }}></span>}
>
<Input.Password autoComplete="new-password" placeholder={t("access.form.dynv6_http_token.placeholder")} />
</Form.Item>
</Form>
);
};
export default AccessFormDynv6Config;

View File

@@ -22,6 +22,7 @@ export interface AccessModel extends BaseModel {
| AccessConfigForCMCCCloud
| AccessConfigForDNSLA
| AccessConfigForDogeCloud
| AccessConfigForDynv6
| AccessConfigForEdgio
| AccessConfigForGcore
| AccessConfigForGname
@@ -132,6 +133,10 @@ export type AccessConfigForDogeCloud = {
secretKey: string;
};
export type AccessConfigForDynv6 = {
httpToken: string;
};
export type AccessConfigForEdgio = {
clientId: string;
clientSecret: string;

View File

@@ -20,6 +20,7 @@ export const ACCESS_PROVIDERS = Object.freeze({
CMCCCLOUD: "cmcccloud",
DNSLA: "dnsla",
DOGECLOUD: "dogecloud",
DYNV6: "dynv6",
GCORE: "gcore",
GNAME: "gname",
GODADDY: "godaddy",
@@ -97,6 +98,7 @@ export const accessProvidersMap: Map<AccessProvider["type"] | string, AccessProv
[ACCESS_PROVIDERS.CLOUDFLARE, "provider.cloudflare", "/imgs/providers/cloudflare.svg", [ACCESS_USAGES.APPLY]],
[ACCESS_PROVIDERS.CLOUDNS, "provider.cloudns", "/imgs/providers/cloudns.png", [ACCESS_USAGES.APPLY]],
[ACCESS_PROVIDERS.DNSLA, "provider.dnsla", "/imgs/providers/dnsla.svg", [ACCESS_USAGES.APPLY]],
[ACCESS_PROVIDERS.DYNV6, "provider.dynv6", "/imgs/providers/dynv6.svg", [ACCESS_USAGES.APPLY]],
[ACCESS_PROVIDERS.GNAME, "provider.gname", "/imgs/providers/gname.png", [ACCESS_USAGES.APPLY]],
[ACCESS_PROVIDERS.GODADDY, "provider.godaddy", "/imgs/providers/godaddy.svg", [ACCESS_USAGES.APPLY]],
[ACCESS_PROVIDERS.NAMECHEAP, "provider.namecheap", "/imgs/providers/namecheap.svg", [ACCESS_USAGES.APPLY]],
@@ -139,6 +141,7 @@ export const APPLY_DNS_PROVIDERS = Object.freeze({
CLOUDNS: `${ACCESS_PROVIDERS.CLOUDNS}`,
CMCCCLOUD: `${ACCESS_PROVIDERS.CMCCCLOUD}`,
DNSLA: `${ACCESS_PROVIDERS.DNSLA}`,
DYNV6: `${ACCESS_PROVIDERS.DYNV6}`,
GCORE: `${ACCESS_PROVIDERS.GCORE}`,
GNAME: `${ACCESS_PROVIDERS.GNAME}`,
GODADDY: `${ACCESS_PROVIDERS.GODADDY}`,
@@ -185,6 +188,7 @@ export const applyDNSProvidersMap: Map<ApplyDNSProvider["type"] | string, ApplyD
[APPLY_DNS_PROVIDERS.CLOUDFLARE, "provider.cloudflare"],
[APPLY_DNS_PROVIDERS.CLOUDNS, "provider.cloudns"],
[APPLY_DNS_PROVIDERS.DNSLA, "provider.dnsla"],
[APPLY_DNS_PROVIDERS.DYNV6, "provider.dynv6"],
[APPLY_DNS_PROVIDERS.GCORE, "provider.gcore"],
[APPLY_DNS_PROVIDERS.GNAME, "provider.gname"],
[APPLY_DNS_PROVIDERS.GODADDY, "provider.godaddy"],

View File

@@ -138,6 +138,9 @@
"access.form.dogecloud_secret_key.label": "Doge Cloud SecretKey",
"access.form.dogecloud_secret_key.placeholder": "Please enter Doge Cloud SecretKey",
"access.form.dogecloud_secret_key.tooltip": "For more information, see <a href=\"https://console.dogecloud.com/\" target=\"_blank\">https://console.dogecloud.com/</a>",
"access.form.dynv6_http_token.label": "dynv6 HTTP token",
"access.form.dynv6_http_token.placeholder": "Please enter dynv6 HTTP token",
"access.form.dynv6_http_token.tooltip": "For more information, see <a href=\"https://dynv6.com/keys\" target=\"_blank\">https://dynv6.com/keys</a>",
"access.form.edgio_client_id.label": "Edgio ClientId",
"access.form.edgio_client_id.placeholder": "Please enter Edgio ClientId",
"access.form.edgio_client_id.tooltip": "For more information, see <a href=\"https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients\" target=\"_blank\">https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients</a>",

View File

@@ -47,6 +47,7 @@
"provider.dnsla": "DNS.LA",
"provider.dogecloud": "Doge Cloud",
"provider.dogecloud.cdn": "Doge Cloud - CDN (Content Delivery Network)",
"provider.dynv6": "dynv6",
"provider.edgio": "Edgio",
"provider.edgio.applications": "Edgio - Applications",
"provider.fastly": "Fastly",

View File

@@ -132,6 +132,9 @@
"access.form.dogecloud_secret_key.label": "多吉云 SecretKey",
"access.form.dogecloud_secret_key.placeholder": "请输入多吉云 SecretKey",
"access.form.dogecloud_secret_key.tooltip": "这是什么?请参阅 <a href=\"https://console.dogecloud.com/\" target=\"_blank\">https://console.dogecloud.com/</a>",
"access.form.dynv6_http_token.label": "dynv6 HTTP Token",
"access.form.dynv6_http_token.placeholder": "请输入 dynv6 HTTP Token",
"access.form.dynv6_http_token.tooltip": "这是什么?请参阅 <a href=\"https://dynv6.com/keys\" target=\"_blank\">https://dynv6.com/keys</a>",
"access.form.edgio_client_id.label": "Edgio 客户端 ID",
"access.form.edgio_client_id.placeholder": "请输入 Edgio 客户端 ID",
"access.form.edgio_client_id.tooltip": "这是什么?请参阅 <a href=\"https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients\" target=\"_blank\">https://docs.edg.io/applications/v7/rest_api/authentication#administering-api-clients</a>",

View File

@@ -47,6 +47,7 @@
"provider.dnsla": "DNS.LA",
"provider.dogecloud": "多吉云",
"provider.dogecloud.cdn": "多吉云 - 内容分发网络 CDN",
"provider.dynv6": "dynv6",
"provider.edgio": "Edgio",
"provider.edgio.applications": "Edgio - Applications",
"provider.fastly": "Fastly",