From c82603c9b5cae1a0238c5084c5c5c0060a813236 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 16 Apr 2020 20:07:33 +0200 Subject: [PATCH] config: always define a 'standalone' plugin instance MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit so that consumers can fallback to it Signed-off-by: Fabian Grünbichler --- src/PVE/ACME/Challenge.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 {}; } -- 2.39.2