]> git.proxmox.com Git - proxmox-acme.git/blobdiff - src/PVE/ACME/DNSChallenge.pm
move DNS plugin schema to separate JSON based file
[proxmox-acme.git] / src / PVE / ACME / DNSChallenge.pm
index ce66f3c5edd6ef016dad6560055634e36b8c8790..9b2897001145c070f5e34a5e56295dfe4a5b32d8 100644 (file)
@@ -4,6 +4,8 @@ use strict;
 use warnings;
 
 use Digest::SHA qw(sha256);
+use JSON;
+
 use PVE::Tools;
 
 use PVE::ACME;
@@ -20,356 +22,8 @@ sub type {
     return 'dns';
 }
 
-# describe the data schema of the supported plugins, e.g.:
-#    'dnsprovider' => {
-#      name => 'Full name of Plugin',
-#      fields => {
-#          'FOO_API_KEY' => {
-#              description => "The API key",
-#              default => "none",
-#              optional => 1,
-#              type => 'string',
-#          },
-#          # ...
-#      },
-#    },
-my $plugins = {
-    '1984hosting' => {},
-    'acmedns' => {
-       name => 'acme-dns',
-       fields => {
-           'ACMEDNS_UPDATE_URL' => {
-               description => 'The API update endpoint',
-               type => 'string',
-           },
-           'ACMEDNS_USERNAME' => {
-               description => 'The acme-dns user',
-               type => 'string',
-           },
-           'ACMEDNS_PASSWORD' => {
-               description => 'The acme-dns password',
-               type => 'string',
-           },
-           'ACMEDNS_SUBDOMAIN' => {
-               description => 'The subdomain you got from acme-dns registration',
-               type => 'string',
-           },
-       },
-    },
-    'acmeproxy' => {},
-    'active24' => {
-       name => 'Active24',
-       fields => {
-           'ACTIVE24_Token' => {
-               description => "The API key",
-               type => 'string',
-           },
-       },
-    },
-    'ad' => {
-       name => 'Alwaysdata',
-       fields => {
-           'AD_API_KEY' => {
-               description => "The API key",
-               type => 'string',
-           },
-       },
-    },
-    'ali' => {
-       name => 'Alibaba Cloud DNS',
-       fields => {
-           'Ali_API' => {
-               description => 'The API endpoint',
-               default => "https://alidns.aliyuncs.com/",
-               type => 'string',
-               optional => 1,
-           },
-           'Ali_Key' => {
-               description => 'The API Key',
-               type => 'string',
-           },
-           'Ali_Secret' => {
-               description => 'The API Secret',
-               type => 'string',
-           },
-       },
-    },
-    'anx' => {},
-    'arvan' => {},
-    'aurora' => {
-       name => 'AuroraDNS',
-       fields => {
-           'AURORA_Key' => {
-               description => 'The API Key',
-               type => 'string',
-           },
-           'AURORA_Secret' => {
-               description => 'The API Secret',
-               type => 'string',
-           },
-       },
-    },
-    'autodns' => {},
-    'aws' => {
-       name => 'Amazon Route53 (AWS)',
-       fields => {
-           'AWS_ACCESS_KEY_ID' => {
-               name => 'ACCESS_KEY_ID',
-               description => 'The AWS access-key ID',
-               type => 'string',
-           },
-           'AWS_SECRET_ACCESS_KEY' => {
-               name => 'SECRET_ACCESS_KEY',
-               description => 'The AWS access-key secret',
-               type => 'string',
-           },
-       },
-    },
-    'azure' => {},
-    'cf' => {
-       name => 'Cloudflare Managed DNS',
-       description => 'Either provide global account key and email, or CF API token and Account ID.',
-       fields => {
-           'CF_Key' => {
-               description => 'The Cloudflare Global API Key',
-               type => 'string',
-           },
-           'CF_Email' => {
-               description => 'The Cloudflare Account EMail-Address',
-               type => 'string',
-           },
-           'CF_Token' => {
-               description => 'The new Cloudflare API Token',
-               type => 'string',
-           },
-           'CF_Account_ID' => {
-               description => 'The new Cloudflare API Account ID',
-               type => 'string',
-           },
-           'CF_Zone_ID' => {
-               description => 'For Zone restricted API Token',
-               type => 'string',
-           },
-       },
-    },
-    'clouddns' => {},
-    'cloudns' => {},
-    'cn' => {},
-    'conoha' => {},
-    'constellix' => {},
-    'cx' => {},
-    'cyon' => {},
-    'da' => {},
-    'ddnss' => {},
-    'desec' => {},
-    'df' => {},
-    'dgon' => {
-       name => 'DigitalOcean DNS',
-       fields => {
-           'DO_API_KEY' => {
-               description => 'The DigitalOcean API Key',
-               type => 'string',
-           },
-       },
-    },
-    'dnsimple' => {},
-    'do' => {},
-    'doapi' => {},
-    'domeneshop' => {},
-    'dp' => {},
-    'dpi' => {},
-    'dreamhost' => {},
-    'duckdns' => {},
-    'durabledns' => {},
-    'dyn' => {},
-    'dynu' => {},
-    'dynv6' => {},
-    'easydns' => {},
-    'edgedns' => {},
-    'euserv' => {},
-    'exoscale' => {},
-    'freedns' => {},
-    'gandi_livedns' => {},
-    'gcloud' => {},
-    'gd' => {
-       name => 'GoDaddy',
-       fields => {
-           'GD_Key' => {
-               description => 'The GoDaddy API Key',
-               type => 'string',
-           },
-           'GD_Secret' => {
-               description => 'The GoDaddy API Secret',
-               type => 'string',
-           },
-       },
-    },
-    'gdnsdk' => {},
-    'he' => {},
-    'hetzner' => {},
-    'hexonet' => {},
-    'hostingde' => {},
-    'huaweicloud' => {},
-    'infoblox' => {},
-    'infomaniak' => {},
-    'internetbs' => {},
-    'inwx' => {
-       name => 'INWX',
-       fields => {
-           'INWX_User' => {
-               description => 'The INWX username',
-               type => 'string',
-           },
-           'INWX_Password' => {
-               description => 'The INWX password',
-               type => 'string',
-           },
-       },
-    },
-    'ionos' => {},
-    'ispconfig' => {},
-    'jd' => {},
-    'joker' => {},
-    'kappernet' => {
-       name => 'kapper.net',
-       fields => {
-           'KAPPERNETDNS_Key' => {
-               description => 'Your kapper.net API key',
-               type => 'string',
-           },
-           'KAPPERNETDNS_Secret' => {
-               description => 'Your kapper.net API secret',
-               type => 'string',
-           },
-       },
-    },
-    'kas' => {},
-    'kinghost' => {},
-    'knot' => {},
-    'leaseweb' => {},
-    'lexicon' => {},
-    'linode' => {},
-    'linode_v4' => {},
-    'loopia' => {},
-    'lua' => {},
-    'maradns' => {},
-    'me' => {},
-    'miab' => {},
-    'misaka' => {},
-    'myapi' => {},
-    'mydevil' => {},
-    'mydnsjp' => {},
-    'namecheap' => {},
-    'namecom' => {},
-    'namesilo' => {},
-    'nederhost' => {},
-    'neodigit' => {},
-    'netcup' => {},
-    'netlify' => {},
-    'nic' => {},
-    'njalla' => {},
-    'nm' => {},
-    'nsd' => {},
-    'nsone' => {},
-    'nsupdate' => {},
-    'nw' => {},
-    'one' => {},
-    'online' => {},
-    'openprovider' => {},
-    'openstack' => {},
-    'opnsense' => {},
-    'ovh' => {
-       name => 'OVH',
-       fields => {
-           'OVH_END_POINT' => {
-               description => "The OVH endpoint",
-               default => "ovh-eu",
-               optional => 1,
-               type => 'string',
-           },
-           'OVH_AK' => {
-               description => "The application key.",
-               type => 'string',
-           },
-           'OVH_AS' => {
-               description => "The application secret.",
-               type => 'string',
-           },
-           'OVH_CK' => {
-               description => "The consumer key.",
-               optional => 1,
-               type => 'string',
-           },
-       },
-    },
-    'pdns' => {
-       name => 'PowerDNS server',
-       fields => {
-           'PDNS_Url' => {
-               description => "The PowerDNS API endpoint.",
-               type => 'string',
-           },
-           'PDNS_ServerId'=> {
-               type => 'string',
-           },
-           'PDNS_Token'=> {
-               type => 'string',
-           },
-           'PDNS_Ttl'=> {
-               type => 'integer',
-           },
-       },
-    },
-    'pleskxml' => {},
-    'pointhq' => {},
-    'porkbun' => {
-       name => 'Porkbun',
-       fields => {
-           'PORKBUN_API_KEY' => {
-               description => 'The API Key',
-               type => 'string',
-           },
-           'PORKBUN_SECRET_API_KEY' => {
-               description => 'The API Secret',
-               type => 'string',
-           },
-       },
-    },
-    'rackcorp' => {},
-    'rackspace' => {},
-    'rcode0' => {},
-    'regru' => {},
-    'scaleway' => {},
-    'schlundtech' => {},
-    'selectel' => {},
-    'servercow' => {},
-    'simply' => {},
-    'tele3' => {},
-    'transip' => {},
-    'ultra' => {},
-    'unoeuro' => {},
-    'variomedia' => {},
-    'vscale' => {},
-    'vultr' => {},
-    'world4you' => {
-       name => 'World4You',
-       fields => {
-           'WORLD4YOU_USERNAME' => {
-               description => "The World4You customer id or package id",
-               type => 'string',
-           },
-           'WORLD4YOU_PASSWORD' => {
-               description => "The World4You password",
-               type => 'string',
-           },
-       },
-    },
-    'websupport' => {},
-    'yandex' => {},
-    'zilore' => {},
-    'zone' => {},
-    'zonomi' => {},
-};
+my $DNS_API_CHALLENGE_SCHEMA_FN = '/usr/share/proxmox-acme/dns-challenge-schema.json';
+my $plugins = from_json(PVE::Tools::file_get_contents($DNS_API_CHALLENGE_SCHEMA_FN));
 
 sub get_supported_plugins {
     return $plugins;