}
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",