[pmg-devel] [PATCH pmg-api v3 3/3] nodeconfig: parse acme config before writing

Stoiko Ivanov s.ivanov at proxmox.com
Thu Apr 15 21:46:20 CEST 2021


we use `get_acme_conf` as higher level sanity checker (e.g. to ensure
that wildcard certificates have a configured DNS plugin)

(adapted from pve-manger (where this is done in the corresponding API
call)

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PMG/NodeConfig.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PMG/NodeConfig.pm b/src/PMG/NodeConfig.pm
index 029b903..42139e4 100644
--- a/src/PMG/NodeConfig.pm
+++ b/src/PMG/NodeConfig.pm
@@ -131,6 +131,9 @@ sub read_pmg_node_config {
 sub write_pmg_node_config {
     my ($filename, $fh, $cfg) = @_;
     my $raw = PVE::JSONSchema::dump_config($config_schema, $filename, $cfg);
+
+    # higher level ACME sanity checking
+    get_acme_conf($cfg);
     PVE::Tools::safe_print($filename, $fh, $raw);
 }
 
-- 
2.20.1





More information about the pmg-devel mailing list