diff --git a/backend/internal/cert/apply/apply.go b/backend/internal/cert/apply/apply.go index 30bbfad..24c97a0 100644 --- a/backend/internal/cert/apply/apply.go +++ b/backend/internal/cert/apply/apply.go @@ -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"] diff --git a/backend/migrations/init.go b/backend/migrations/init.go index 03dbffd..6d1da8b 100644 --- a/backend/migrations/init.go +++ b/backend/migrations/init.go @@ -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"}) diff --git a/frontend/apps/allin-ssl/src/config/data.tsx b/frontend/apps/allin-ssl/src/config/data.tsx index c85930a..a1f2834 100644 --- a/frontend/apps/allin-ssl/src/config/data.tsx +++ b/frontend/apps/allin-ssl/src/config/data.tsx @@ -278,6 +278,12 @@ export const ApiProjectConfig: Record = { hostRelated: { default: { name: "BTDomain" } }, sort: 33, }, + rainyun: { + name: "雨云", + icon: "rainyun", + type: ["dns"], + sort: 33, + }, plugin: { name: "插件", icon: "plugin", diff --git a/frontend/apps/allin-ssl/src/views/authApiManage/useController.tsx b/frontend/apps/allin-ssl/src/views/authApiManage/useController.tsx index 8ef4214..13e10f9 100644 --- a/frontend/apps/allin-ssl/src/views/authApiManage/useController.tsx +++ b/frontend/apps/allin-ssl/src/views/authApiManage/useController.tsx @@ -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(() => {