From: Fabian Grünbichler Date: Thu, 16 Apr 2020 18:07:33 +0000 (+0200) Subject: config: always define a 'standalone' plugin instance X-Git-Url: https://git.proxmox.com/?p=proxmox-acme.git;a=commitdiff_plain;h=c82603c9b5cae1a0238c5084c5c5c0060a813236;ds=sidebyside config: always define a 'standalone' plugin instance so that consumers can fallback to it Signed-off-by: Fabian Grünbichler --- diff --git a/src/PVE/ACME/Challenge.pm b/src/PVE/ACME/Challenge.pm index 649c228..3fb8ab9 100644 --- a/src/PVE/ACME/Challenge.pm +++ b/src/PVE/ACME/Challenge.pm @@ -31,6 +31,22 @@ sub private { return $defaultData; } +sub parse_config { + my ($class, $filename, $raw) = @_; + + my $cfg = $class->SUPER::parse_config($filename, $raw); + my $ids = $cfg->{ids}; + + # make sure we have a standalone plugin definition as fallback! + if (!$ids->{standalone} || $ids->{standalone}->{type} ne 'standalone') { + $ids->{standalone} = { + type => 'standalone', + }; + } + + return $cfg; +} + sub supported_challenge_types { return {}; }