feat: 新增雨云DNS提供商

This commit is contained in:
unknown-o
2025-12-09 11:32:16 +00:00
parent e1818849db
commit 80853d8292
4 changed files with 31 additions and 8 deletions

View File

@@ -10,6 +10,13 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
azcorecloud "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
"github.com/go-acme/lego/v4/certcrypto"
"github.com/go-acme/lego/v4/certificate"
@@ -31,18 +38,13 @@ import (
"github.com/go-acme/lego/v4/providers/dns/namedotcom"
"github.com/go-acme/lego/v4/providers/dns/namesilo"
"github.com/go-acme/lego/v4/providers/dns/ns1"
"github.com/go-acme/lego/v4/providers/dns/rainyun"
"github.com/go-acme/lego/v4/providers/dns/route53"
"github.com/go-acme/lego/v4/providers/dns/spaceship"
"github.com/go-acme/lego/v4/providers/dns/tencentcloud"
"github.com/go-acme/lego/v4/providers/dns/volcengine"
"github.com/go-acme/lego/v4/providers/dns/westcn"
"github.com/go-acme/lego/v4/registration"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
)
var AlgorithmMap = map[string]certcrypto.KeyType{
@@ -217,6 +219,11 @@ func GetDNSProvider(providerName string, creds map[string]string, httpClient *ht
config.APISecret = creds["api_secret"]
config.PropagationTimeout = maxWait
return spaceship.NewDNSProviderConfig(config)
case "rainyun":
config := rainyun.NewDefaultConfig()
config.APIKey = creds["api_key"]
config.PropagationTimeout = maxWait
return rainyun.NewDNSProviderConfig(config)
case "btdomain":
config := bt.NewDefaultConfig()
config.AccountID = creds["account_id"]

View File

@@ -155,6 +155,7 @@ func init() {
INSERT INTO access_type (name, type) VALUES ('1panel', 'host');`)
InsertIfNotExists(db, "access_type", map[string]any{"name": "cloudflare", "type": "host"}, []string{"name", "type"}, []any{"cloudflare", "host"})
InsertIfNotExists(db, "access_type", map[string]any{"name": "rainyun", "type": "dns"}, []string{"name", "type"}, []any{"rainyun", "dns"})
InsertIfNotExists(db, "access_type", map[string]any{"name": "cloudflare", "type": "dns"}, []string{"name", "type"}, []any{"cloudflare", "dns"})
InsertIfNotExists(db, "access_type", map[string]any{"name": "huaweicloud", "type": "host"}, []string{"name", "type"}, []any{"huaweicloud", "host"})
InsertIfNotExists(db, "access_type", map[string]any{"name": "huaweicloud", "type": "dns"}, []string{"name", "type"}, []any{"huaweicloud", "dns"})

View File

@@ -278,6 +278,12 @@ export const ApiProjectConfig: Record<string, ApiProjectType> = {
hostRelated: { default: { name: "BTDomain" } },
sort: 33,
},
rainyun: {
name: "雨云",
icon: "rainyun",
type: ["dns"],
sort: 33,
},
plugin: {
name: "插件",
icon: "plugin",

View File

@@ -62,8 +62,8 @@ import { testAccess, getPlugins } from "@/api/access";
// import { useLocalStorage } from '@vueuse/core'
import ApiManageForm from "./components/ApiManageModel";
import SvgIcon from "@components/SvgIcon";
import TypeIcon from "@components/TypeIcon";
import SvgIcon from "@/components/svgIcon";
import TypeIcon from "@/components/typeIcon";
import { noSideSpace } from "@lib/utils";
import { JSX } from "vue/jsx-runtime";
@@ -1269,6 +1269,15 @@ export const useApiFormController = (
})
);
break;
case "rainyun":
items.push(
useFormInput("API Key", "config.api_key", {
type: "password",
showPasswordOn: "click",
allowInput: noSideSpace,
}),
);
break;
case "plugin":
items.push(
useFormCustom(() => {