From 523449f05073fd9604c43fcff230306b1d84218e Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Wed, 1 Jun 2022 13:11:21 +0400 Subject: [PATCH] dns_acmedns --- backend/internal/dnsproviders/common.go | 1 + backend/internal/dnsproviders/dns_acmedns.go | 69 ++++++++++++++++++++ frontend/src/locale/src/en.json | 3 + 3 files changed, 73 insertions(+) create mode 100644 backend/internal/dnsproviders/dns_acmedns.go diff --git a/backend/internal/dnsproviders/common.go b/backend/internal/dnsproviders/common.go index ddd751db..d1fa7f3c 100644 --- a/backend/internal/dnsproviders/common.go +++ b/backend/internal/dnsproviders/common.go @@ -36,6 +36,7 @@ func (p *Provider) GetAcmeEnvVars(meta interface{}) map[string]string { // List returns an array of providers func List() []Provider { return []Provider{ + getDNSAcmeDNS(), getDNSAd(), getDNSAli(), getDNSAws(), diff --git a/backend/internal/dnsproviders/dns_acmedns.go b/backend/internal/dnsproviders/dns_acmedns.go new file mode 100644 index 00000000..af3aa60a --- /dev/null +++ b/backend/internal/dnsproviders/dns_acmedns.go @@ -0,0 +1,69 @@ +package dnsproviders + +const acmeDNSchema = ` +{ + "type": "object", + "required": [ + "api_url", + "user", + "password" + ], + "additionalProperties": false, + "properties": { + "api_url": { + "type": "string", + "minLength": 4 + }, + "subdomain": { + "type": "string", + "minLength": 1 + }, + "user": { + "type": "string", + "minLength": 1 + }, + "password": { + "type": "string", + "minLength": 1 + } + } +} +` + +func getDNSAcmeDNS() Provider { + return Provider{ + AcmeshName: "dns_acmedns", + Schema: acmeDNSchema, + Fields: []providerField{ + { + Name: "Base URL", + Type: "text", + MetaKey: "api_url", + EnvKey: "ACMEDNS_BASE_URL", + IsRequired: true, + }, + { + Name: "Subdomain", + Type: "text", + MetaKey: "subdomain", + EnvKey: "ACMEDNS_SUBDOMAIN", + IsRequired: true, + }, + { + Name: "User", + Type: "text", + MetaKey: "user", + EnvKey: "ACMEDNS_USERNAME", + IsRequired: true, + }, + { + Name: "Password", + Type: "password", + MetaKey: "password", + EnvKey: "ACMEDNS_PASSWORD", + IsRequired: true, + IsSecret: true, + }, + }, + } +} diff --git a/frontend/src/locale/src/en.json b/frontend/src/locale/src/en.json index 4f2e3722..b8b8e44c 100644 --- a/frontend/src/locale/src/en.json +++ b/frontend/src/locale/src/en.json @@ -2,6 +2,9 @@ "access-lists.title": { "defaultMessage": "Access Lists" }, + "acmesh.dns_acmedns": { + "defaultMessage": "ACME DNS" + }, "acmesh.dns_ad": { "defaultMessage": "Alwaysdata" },