use warnings;
use Digest::SHA qw(sha256);
+use JSON;
+
use PVE::Tools;
+use PVE::ACME;
+
use base qw(PVE::ACME::Challenge);
my $ACME_PATH = '/usr/share/proxmox-acme/proxmox-acme';
return 'dns';
}
-# 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",
- 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' => {
- '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' => {},
-};
+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;
my $domain = $proxmox_acme_command->($self, $acme, $auth, $data, 'setup');
print "Add TXT record: _acme-challenge.$domain\n";
- # FIXME: probe ourself for propagation of TXT record, while not 100%
- # failsafe it's good enough of a heuristic to do away with fixed sleep
- # intervalls - original acme.sh employs that heuristic too.
- my $delay = $data->{'validation-delay'} // 30;
+ my $delay = $data->{plugin}->{'validation-delay'} // 30;
if ($delay > 0) {
print "Sleeping $delay seconds to wait for TXT record propagation\n";
sleep($delay); # don't care for EINTR