diff --git a/src/PVE/ACME/DNSChallenge.pm b/src/PVE/ACME/DNSChallenge.pm index 9b28970..7214d88 100644 --- a/src/PVE/ACME/DNSChallenge.pm +++ b/src/PVE/ACME/DNSChallenge.pm @@ -23,13 +23,19 @@ sub type { } 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)); +my $plugin_cache; sub get_supported_plugins { - return $plugins; + if (!$plugin_cache) { + $plugin_cache = -e $DNS_API_CHALLENGE_SCHEMA_FN # we allow this to be optional as not all users require + ? from_json(PVE::Tools::file_get_contents($DNS_API_CHALLENGE_SCHEMA_FN)) + : {}; + } + return $plugin_cache; } sub properties { + my $plugins = get_supported_plugins(); return { api => { description => "API plugin name",