From 92860cffcac11f43dbecf527a779b84825f6d0a3 Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Mon, 11 Jun 2018 13:32:53 -0700 Subject: [PATCH] Default configuration for DNS providers --- lemur/dns_providers/service.py | 37 +++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/lemur/dns_providers/service.py b/lemur/dns_providers/service.py index ed6fbf2f..442b2c31 100644 --- a/lemur/dns_providers/service.py +++ b/lemur/dns_providers/service.py @@ -53,7 +53,42 @@ def delete(dns_provider_id): def get_types(): - provider_config = current_app.config.get('ACME_DNS_PROVIDER_TYPES') + provider_config = current_app.config.get( + 'ACME_DNS_PROVIDER_TYPES', + {"items": [ + { + 'name': 'route53', + 'requirements': [ + { + 'name': 'account_id', + 'type': 'int', + 'required': True, + 'helpMessage': 'AWS Account number' + }, + ] + }, + { + 'name': 'cloudflare', + 'requirements': [ + { + 'name': 'email', + 'type': 'str', + 'required': True, + 'helpMessage': 'Cloudflare Email' + }, + { + 'name': 'key', + 'type': 'str', + 'required': True, + 'helpMessage': 'Cloudflare Key' + }, + ] + }, + { + 'name': 'dyn', + }, + ]} + ) if not provider_config: raise Exception("No DNS Provider configuration specified.") provider_config["total"] = len(provider_config.get("items"))