]> git.proxmox.com Git - pve-manager.git/commitdiff
Extend node config in the acme section.
authorWolfgang Link <w.link@proxmox.com>
Thu, 16 Apr 2020 05:18:23 +0000 (07:18 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 3 May 2020 12:10:17 +0000 (14:10 +0200)
Allow additional domains with different sub-plugins,
However, only one domain per additional entry is permitted.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
PVE/NodeConfig.pm

index 7a663f468376ea820fc93ef353ac3245379c32c7..560da11667738b226bbd44725b8e5790428a4bcc 100644 (file)
@@ -6,6 +6,10 @@ use warnings;
 use PVE::CertHelpers;
 use PVE::JSONSchema qw(get_standard_option);
 use PVE::Tools qw(file_get_contents file_set_contents lock_file);
+use PVE::ACME;
+
+# register up to 20 domain names
+my $MAXDOMAINS = 20;
 
 my $node_config_lock = '/var/lock/pvenode.lock';
 
@@ -77,6 +81,29 @@ my $confdesc = {
     },
 };
 
+my $acme_additional_desc = {
+    domain => {
+       type => 'string',
+       format => 'pve-acme-domain',
+       format_description => 'domain',
+       description => 'domain for this node\'s ACME certificate',
+    },
+    plugin => {
+       type => 'string',
+       format => 'pve-configid',
+       description => 'The plugin ID, default is standalone http',
+       format_description => 'name of the plugin configuration',
+    },
+    alias => {
+       type => 'string',
+       format => 'pve-acme-domain',
+       format_description => 'domain',
+       description => 'Alias for the Domain to verify ACME Challenge over DNS',
+       optional => 1,
+    },
+};
+PVE::JSONSchema::register_format('pve-acme-additional-node-conf', $acme_additional_desc);
+
 my $acmedesc = {
     account => get_standard_option('pve-acme-account-name'),
     domains => {
@@ -84,6 +111,7 @@ my $acmedesc = {
        format => 'pve-acme-domain-list',
        format_description => 'domain[;domain;...]',
        description => 'List of domains for this node\'s ACME certificate',
+       optional => 1,
     },
 };
 PVE::JSONSchema::register_format('pve-acme-node-conf', $acmedesc);
@@ -95,6 +123,15 @@ $confdesc->{acme} = {
     optional => 1,
 };
 
+for my $i (0..$MAXDOMAINS) {
+    $confdesc->{"acme_additional_domain$i"} = {
+       type => 'string',
+       description => 'ACME additional Domain',
+       format => $acme_additional_desc,
+       optional => 1,
+    };
+};
+
 sub check_type {
     my ($key, $value) = @_;
 
@@ -214,6 +251,7 @@ sub print_acme {
 }
 
 sub get_nodeconfig_schema {
+
     return $confdesc;
 }