From: Dominik Csapak Date: Tue, 5 May 2020 12:38:11 +0000 (+0200) Subject: DNSChallenge: make plugins a hash with an optional schema X-Git-Url: https://git.proxmox.com/?p=proxmox-acme.git;a=commitdiff_plain;h=6f5be4aa3c7e906d2cea970bb0552448b8a1d9e8;hp=f4ee95aec5780ea98c7f5adda3a87e512934e94e DNSChallenge: make plugins a hash with an optional schema so that we can use that schema to generate form fields in the gui Signed-off-by: Dominik Csapak --- diff --git a/src/PVE/ACME/DNSChallenge.pm b/src/PVE/ACME/DNSChallenge.pm index 2b4f051..8a393f4 100644 --- a/src/PVE/ACME/DNSChallenge.pm +++ b/src/PVE/ACME/DNSChallenge.pm @@ -18,109 +18,138 @@ sub type { return 'dns'; } -my $plugin_names = [ - 'acmedns', - 'acmeproxy', - 'active24', - 'ad', - 'ali', - 'autodns', - 'aws', - 'azure', - 'cf', - 'clouddns', - 'cloudns', - 'cn', - 'conoha', - 'constellix', - 'cx', - 'cyon', - 'da', - 'ddnss', - 'desec', - 'dgon', - 'dnsimple', - 'do', - 'doapi', - 'domeneshop', - 'dp', - 'dpi', - 'dreamhost', - 'duckdns', - 'durabledns', - 'dyn', - 'dynu', - 'dynv6', - 'easydns', - 'euserv', - 'exoscale', - 'freedns', - 'gandi_livedns', - 'gcloud', - 'gd', - 'gdnsdk', - 'he', - 'hexonet', - 'hostingde', - 'infoblox', - 'internetbs', - 'inwx', - 'ispconfig', - 'jd', - 'kas', - 'kinghost', - 'knot', - 'leaseweb', - 'lexicon', - 'linode', - 'linode_v4', - 'loopia', - 'lua', - 'maradns', - 'me', - 'miab', - 'misaka', - 'myapi', - 'mydevil', - 'mydnsjp', - 'namecheap', - 'namecom', - 'namesilo', - 'nederhost', - 'neodigit', - 'netcup', - 'nic', - 'nsd', - 'nsone', - 'nsupdate', - 'nw', - 'one', - 'online', - 'openprovider', - 'opnsense', - 'ovh', - 'pdns', - 'pleskxml', - 'pointhq', - 'rackspace', - 'rcode0', - 'regru', - 'schlundtech', - 'selectel', - 'servercow', - 'tele3', - 'ultra', - 'unoeuro', - 'variomedia', - 'vscale', - 'vultr', - 'yandex', - 'zilore', - 'zone', - 'zonomi', -]; +# describe the data schema of the supported plugins +my $plugins = { + 'acmedns' => {}, + 'acmeproxy' => {}, + 'active24' => {}, + 'ad' => {}, + 'ali' => {}, + 'autodns' => {}, + 'aws' => {}, + 'azure' => {}, + 'cf' => {}, + 'clouddns' => {}, + 'cloudns' => {}, + 'cn' => {}, + 'conoha' => {}, + 'constellix' => {}, + 'cx' => {}, + 'cyon' => {}, + 'da' => {}, + 'ddnss' => {}, + 'desec' => {}, + 'dgon' => {}, + 'dnsimple' => {}, + 'do' => {}, + 'doapi' => {}, + 'domeneshop' => {}, + 'dp' => {}, + 'dpi' => {}, + 'dreamhost' => {}, + 'duckdns' => {}, + 'durabledns' => {}, + 'dyn' => {}, + 'dynu' => {}, + 'dynv6' => {}, + 'easydns' => {}, + 'euserv' => {}, + 'exoscale' => {}, + 'freedns' => {}, + 'gandi_livedns' => {}, + 'gcloud' => {}, + 'gd' => {}, + 'gdnsdk' => {}, + 'he' => {}, + 'hexonet' => {}, + 'hostingde' => {}, + 'infoblox' => {}, + 'internetbs' => {}, + 'inwx' => {}, + 'ispconfig' => {}, + 'jd' => {}, + 'kas' => {}, + 'kinghost' => {}, + 'knot' => {}, + 'leaseweb' => {}, + 'lexicon' => {}, + 'linode' => {}, + 'linode_v4' => {}, + 'loopia' => {}, + 'lua' => {}, + 'maradns' => {}, + 'me' => {}, + 'miab' => {}, + 'misaka' => {}, + 'myapi' => {}, + 'mydevil' => {}, + 'mydnsjp' => {}, + 'namecheap' => {}, + 'namecom' => {}, + 'namesilo' => {}, + 'nederhost' => {}, + 'neodigit' => {}, + 'netcup' => {}, + 'nic' => {}, + 'nsd' => {}, + 'nsone' => {}, + 'nsupdate' => {}, + 'nw' => {}, + 'one' => {}, + 'online' => {}, + 'openprovider' => {}, + 'opnsense' => {}, + 'ovh' => { + 'OVH_END_POINT' => { + description => "The OVH endpoint", + type => 'string', + }, + 'OVH_AK' => { + description => "The application key.", + type => 'string', + }, + 'OVH_AS' => { + description => "The application secret.", + type => 'string', + }, + }, + 'pdns' => { + 'PDNS_Url' => { + description => "The PowerDNS API endpoint.", + type => 'string', + }, + 'PDNS_ServerId'=> { + type => 'string', + }, + 'PDNS_Token'=> { + type => 'string', + }, + 'PDNS_Ttl'=> { + type => 'integer', + }, + }, + 'pleskxml' => {}, + 'pointhq' => {}, + 'rackspace' => {}, + 'rcode0' => {}, + 'regru' => {}, + 'schlundtech' => {}, + 'selectel' => {}, + 'servercow' => {}, + 'tele3' => {}, + 'ultra' => {}, + 'unoeuro' => {}, + 'variomedia' => {}, + 'vscale' => {}, + 'vultr' => {}, + 'yandex' => {}, + 'zilore' => {}, + 'zone' => {}, + 'zonomi' => {}, +}; + sub get_supported_plugins { - return $plugin_names; + return $plugins; } sub properties { @@ -128,7 +157,7 @@ sub properties { api => { description => "API plugin name", type => 'string', - enum => $plugin_names, + enum => [sort keys %$plugins], }, data => { type => 'string',