]> git.proxmox.com Git - proxmox-acme.git/commitdiff
config: always define a 'standalone' plugin instance
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 16 Apr 2020 18:07:33 +0000 (20:07 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 17 Apr 2020 07:44:09 +0000 (09:44 +0200)
so that consumers can fallback to it

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/ACME/Challenge.pm

index 649c2284694da3f8290e4c7a5e1db489fa22048b..3fb8ab9cde5186232634ec67e2faaa38044cfb12 100644 (file)
@@ -31,6 +31,22 @@ sub private {
     return $defaultData;
 }
 
     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 {};
 }
 sub supported_challenge_types {
     return {};
 }