From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 A5BB597FF for ; Tue, 26 Apr 2022 14:35:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8122A1BC01 for ; Tue, 26 Apr 2022 14:35:52 +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 E274F1BB81 for ; Tue, 26 Apr 2022 14:35:49 +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 B595F42BEA for ; Tue, 26 Apr 2022 14:35:49 +0200 (CEST) From: Daniel Tschlatscher To: pve-devel@lists.proxmox.com Date: Tue, 26 Apr 2022 14:35:35 +0200 Message-Id: <20220426123542.154739-1-d.tschlatscher@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.070 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [tasks.pm, tasks.rs, tools.pm, anyevent.pm] Subject: [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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2022 12:35:53 -0000 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(-) -- 2.30.2