[pve-devel] applied: [PATCH node_config 1/1] node_config: Allow leading underscore in ACME aliases

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Jun 25 10:37:04 CEST 2020


applied with rename follow-up, thanks!

On June 22, 2020 12:10 pm, Fabian Möller wrote:
> ---
>  PVE/NodeConfig.pm | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/NodeConfig.pm b/PVE/NodeConfig.pm
> index ad49e288..017f6b30 100644
> --- a/PVE/NodeConfig.pm
> +++ b/PVE/NodeConfig.pm
> @@ -25,6 +25,16 @@ PVE::JSONSchema::register_format('pve-acme-domain', sub {
>      die "value '$domain' does not look like a valid domain name!\n";
>  });
>  
> +PVE::JSONSchema::register_format('pve-acme-alias', sub {
> +    my ($domain, $noerr) = @_;
> +
> +    my $label = qr/[a-z0-9_][a-z0-9_-]*/i;
> +
> +    return $domain if $domain =~ /^$label(?:\.$label)+$/;
> +    return undef if $noerr;
> +    die "value '$domain' does not look like a valid domain name!\n";
> +});
> +
>  sub config_file {
>      my ($node) = @_;
>  
> @@ -107,7 +117,7 @@ my $acme_domain_desc = {
>      },
>      alias => {
>  	type => 'string',
> -	format => 'pve-acme-domain',
> +	format => 'pve-acme-alias',
>  	format_description => 'domain',
>  	description => 'Alias for the Domain to verify ACME Challenge over DNS',
>  	optional => 1,
> -- 
> 2.27.0
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




More information about the pve-devel mailing list