From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.tschlatscher@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))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 334A97866A
 for <pve-devel@lists.proxmox.com>; Tue, 28 Jun 2022 13:23:58 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 29DB9A624
 for <pve-devel@lists.proxmox.com>; Tue, 28 Jun 2022 13:23:58 +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 id 74A2AA619
 for <pve-devel@lists.proxmox.com>; Tue, 28 Jun 2022 13:23:57 +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 4825A42AE4
 for <pve-devel@lists.proxmox.com>; Tue, 28 Jun 2022 13:23:57 +0200 (CEST)
Message-ID: <74daf8eb-a6d5-8c5f-7368-76cec19a434e@proxmox.com>
Date: Tue, 28 Jun 2022 13:23:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.10.0
Content-Language: en-US
To: pve-devel@lists.proxmox.com
References: <20220426123542.154739-1-d.tschlatscher@proxmox.com>
From: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
In-Reply-To: <20220426123542.154739-1-d.tschlatscher@proxmox.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.104 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A           -0.001 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
 T_SCC_BODY_TEXT_LINE    -0.01 -
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [anyevent.pm, tasks.rs, tools.pm, tasks.pm]
Subject: Re: [pve-devel] [PATCH http/common/manager/wt/proxmox-backup/pmg]
 Tasklog download button
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, 28 Jun 2022 11:23:58 -0000

ping

(And now that I see it, the patches should actually count up to 7, they
are not in fact 1/1 standalone patches)

On 4/26/22 14:35, Daniel Tschlatscher wrote:
> This patch series' aim is to add a download button in the tasklog-
> viewer GUI so that users may access all parts of the tasklog more
> easily (The tasklog-viewer only displays 50 lines at a time).
> 
> For this change in the GUI (proxmox-widget-toolkit) there were revised
> implementations for all backends (PVE, PMG and PBS) needed.
> The change was implemented by setting the URL parameter 'limit' for
> the .../log call and streaming a file in this case. (Before this
> call returned 0 lines).
> 
> I also revised a few different parts in the code which had redundant
> implementations for "downloading" a file locally from a string.
> For this I added a function in the proxmox-widget-toolkit Utils class
> which all occurences (that I found) now call.
> 
> During the implementation of the file stream download I found a bug
> concerning chromium browsers because of which downloads "randomly"
> fail.
> The problem was, that when implementing the download through an html a
> tag and setting its property "download" to anything (even undefined)
> with a self-signed certificate (not imported) will fail after the
> SSL connection is reset.
> In my testing this was the case after about 5 seconds. This problem is
> especially pronounced in the PMG as there are less background calls in
> contrast to the PVE. However, the PBS does not seem to suffer this
> error at all, because the SSL handshake timeout seems to not run out.
>  
> Without the 'download' attribute you can't set the filename though.
> The file will only have a proper name if the server adds the correct
> 'content-disposition' header. A few calls to the 'downloadAsFile'
> function set the filename anyway, because in most cases the browser
> frontend is making enough polling calls so that the SSL handshake
> does not have to be executed for the download. (That is also why it
> probably did not come up before)
> This problem does not apply in Firefox as far as I could tell. 
> 
> Daniel Tschlatscher (1):
>   fix #3971: tasklog download in the backup server backend
> 
>  Cargo.toml               |   2 +-
>  src/api2/node/tasks.rs   | 154 +++++++++++++++++++++++++--------------
>  www/Subscription.js      |  14 +---
>  www/datastore/Content.js |   7 +-
>  4 files changed, 105 insertions(+), 72 deletions(-)
> 
> Daniel Tschlatscher (1):
>   fix #3971: Make tasklog downloadable
> 
>  src/PVE/APIServer/AnyEvent.pm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> Daniel Tschlatscher (1):
>   fix #3971: Create log file stream for download
> 
>  src/PVE/Tools.pm | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> Daniel Tschlatscher (1):
>   fix #3971: Revised task log API call when parameter 'limit' is 0
> 
>  PVE/API2/Tasks.pm                 | 13 ++++++++++---
>  www/manager6/node/Subscription.js | 20 ++++----------------
>  2 files changed, 14 insertions(+), 19 deletions(-)
> 
> Daniel Tschlatscher (1):
>   fix #3971: Download button in TaskViewer for PMG
> 
>  src/PMG/API2/Tasks.pm | 34 +++++++++++-----------------------
>  1 file changed, 11 insertions(+), 23 deletions(-)
> 
> Daniel Tschlatscher (1):
>   fix #3971: Download button in the TaskViewer
> 
>  src/Utils.js              | 18 ++++++++++++++++++
>  src/window/FileBrowser.js | 12 +++---------
>  src/window/TaskViewer.js  | 16 ++++++++++++++--
>  3 files changed, 35 insertions(+), 11 deletions(-)
> 
> Daniel Tschlatscher (1):
>   Replaced the system-report file download implementation
> 
>  js/Subscription.js | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)