public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Christoph Heiss" <c.heiss@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH widget-toolkit v2] window: ACMEDomains: show error dialog on domain limit
Date: Wed, 11 Jun 2025 08:43:48 +0200	[thread overview]
Message-ID: <DAJI0YLVPLRM.53IV0Q69UEZ2@proxmox.com> (raw)
In-Reply-To: <20250304120312.720783-1-c.heiss@proxmox.com>

Ping, still applies.

On Tue Mar 4, 2025 at 12:57 PM CET, Christoph Heiss wrote:
> Currently, this just fails silently for users and only logs an error to
> the console. Improve the error message & show an alert dialog on
> failure.
>
> This affects both PMG & PBS, as they use the exact same codepath/panel.
>
> Originally reported in the forum:
>   https://forum.proxmox.com/threads/acme-max-certificate.161400/
>
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> Changes v1 -> v2:
>   * change `gettext('Error')` to `Proxmox.Utils.errorText`
>
> v1: https://lore.proxmox.com/pve-devel/20250129112633.1082600-1-c.heiss@proxmox.com/
>
>  src/window/ACMEDomains.js | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/src/window/ACMEDomains.js b/src/window/ACMEDomains.js
> index 1fcc784..b1b845f 100644
> --- a/src/window/ACMEDomains.js
> +++ b/src/window/ACMEDomains.js
> @@ -49,13 +49,21 @@ Ext.define('Proxmox.window.ACMEDomainEdit', {
>  			    return `acmedomain${i}`;
>  			}
>  		    }
> -		    throw "too many domains configured";
> +		    throw Ext.String.format(
> +			gettext('Cannot create more than {0} ACME domains.'),
> +			Proxmox.Utils.acmedomain_count,
> +		    );
>  		};
>
>  		// If we have a 'usage' property (pmg), we only use the `acmedomainX` config keys.
>  		if (win.separateDomainEntries || win.domainUsages) {
>  		    if (!configkey || configkey === 'acme') {
> -			configkey = find_free_slot();
> +			try {
> +			    configkey = find_free_slot();
> +			} catch (e) {
> +			    Ext.Msg.alert(Proxmox.Utils.errorText, e);
> +			    throw e;
> +			}
>  		    }
>  		    delete values.type;
>  		    params[configkey] = Proxmox.Utils.printPropertyString(values, 'domain');
> @@ -68,7 +76,12 @@ Ext.define('Proxmox.window.ACMEDomainEdit', {
>  		// Then insert the domain depending on its type:
>  		if (values.type === 'dns') {
>  		    if (!olddomain.configkey || olddomain.configkey === 'acme') {
> -			configkey = find_free_slot();
> +			try {
> +			    configkey = find_free_slot();
> +			} catch (e) {
> +			    Ext.Msg.alert(Proxmox.Utils.errorText, e);
> +			    throw e;
> +			}
>  			if (olddomain.domain) {
>  			    // we have to remove the domain from the acme domainlist
>  			    Proxmox.Utils.remove_domain_from_acme(acmeObj, olddomain.domain);



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


      reply	other threads:[~2025-06-11  6:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 11:57 Christoph Heiss
2025-06-11  6:43 ` Christoph Heiss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DAJI0YLVPLRM.53IV0Q69UEZ2@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal