From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <p.hufnagl@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 86C23E903
 for <pve-devel@lists.proxmox.com>; Tue, 26 Sep 2023 16:55:12 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 6B8193570
 for <pve-devel@lists.proxmox.com>; Tue, 26 Sep 2023 16:54:42 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Tue, 26 Sep 2023 16:54:41 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7D94748D4C
 for <pve-devel@lists.proxmox.com>; Tue, 26 Sep 2023 16:54:41 +0200 (CEST)
Message-ID: <7b18ab61-59ab-d242-a99a-e81a0eacbce0@proxmox.com>
Date: Tue, 26 Sep 2023 16:54:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.1
Content-Language: en-US
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
 Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 =?UTF-8?Q?Fabian_Gr=c3=bcnbichler?= <f.gruenbichler@proxmox.com>
References: <20230921130917.2000926-1-p.hufnagl@proxmox.com>
 <20230921130917.2000926-2-p.hufnagl@proxmox.com>
 <6aab04ab-2d39-42ac-b389-8e563c7322d0@proxmox.com>
 <be63bea0-8beb-e695-7683-43dd770eb415@proxmox.com>
 <c170e593-8998-4a41-8344-38528062ffb4@proxmox.com>
From: Philipp Hufnagl <p.hufnagl@proxmox.com>
In-Reply-To: <c170e593-8998-4a41-8344-38528062ffb4@proxmox.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.724 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A           -1.473 Looks like a legit reply (A)
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [pve-devel] [PATCH manager v8 1/2] fix #4849: api: download to
 storage: automatically dectect and configure compression
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 26 Sep 2023 14:55:12 -0000

On 9/26/23 16:23, Thomas Lamprecht wrote:
> Am 26/09/2023 um 14:25 schrieb Philipp Hufnagl:
>> On 9/26/23 12:56, Thomas Lamprecht wrote:
>>> while this is already applied, some comments inline, for a possible next
>>> time, and also the big
>>> question if this is even required, after all I can just check the few
>>> compression algorithms easily in the frontend, i.e., offloading a simple
>>> string regex match to the backend seems rather odd to me..
>> The problem with that is that the point where the iso is stored might
>> not be accessible for the client. If it is done by the PVE, it might
>> resolve the url differently.
> 
> I'm not sure if I understand, I thought that's why we made the link
> metadata- query API in the first place (which I obv. do not want to drop
> in general)?
> 
> As we got the correct (from the PVE node's POV) resolved filename
> returned by the metadata query API, so we can just do the regex string
> match for detecting a possible compression file extension on that in the
> frontend after that API call returns.
> 

Yes that would have been possible, however it would not have saved an
API call since the call is needed anyway. I did it there because I
considered it a cleaner solution to do all handling of metadata in one
place rather then returning a "filename" that has to be further
processed in "filename" and "compression".