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 D657A9146B; Thu, 8 Sep 2022 11:40:42 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BCE101AB43; Thu, 8 Sep 2022 11:40:12 +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; Thu, 8 Sep 2022 11:40:07 +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 EDCE04453B; Thu, 8 Sep 2022 11:40:06 +0200 (CEST) Message-ID: <889eb91a-5795-fb74-ed17-4adc9a4d93a5@proxmox.com> Date: Thu, 8 Sep 2022 11:40:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Content-Language: en-US To: Daniel Tschlatscher , pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com, pmg-devel@lists.proxmox.com References: <20220907085633.89113-1-d.tschlatscher@proxmox.com> From: Stefan Sterz In-Reply-To: <20220907085633.89113-1-d.tschlatscher@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 2.037 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 -4.199 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. [tools.pm, tasks.pm, chromium.org, tasks.rs, anyevent.pm] Subject: Re: [pmg-devel] [PATCH http/common/manager/wt/backup/pmg v2] fix: #3971 Tasklog download button X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2022 09:40:42 -0000 On 9/7/22 10:56, 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. > Now, when the parameter 'limit' for the /log API call is set to '0', > the backends will stream the file rather than returning a JSON array > with the corresponding lines. (Beforehand, it would return 0 lines) > > I initially included a number of patches aimed at refactoring > redundant implementations of downloading a file via a button click. > However, after talking with Sterzy, Dominik and Aaron a bit about > it, I decided to only send the "core" task log download patch series > now, because the refactoring depends on the changes made in widget- > toolkit, but is done in the same repositories as the backend patches. > This would make both reviewing and applying them more confusing, and > the refactoring patches are "a step removed" anyway from this patch > series. Therefore, I am going to send a separate patch series for them > later instead. > > > During the implementation of the file stream download I found a bug > concerning chromium browsers because of which downloads "randomly" > fail. > The problem was, when implementing the download through an html a tag > and setting its property "download" to anything, (even undefined) > with a not imported self-signed certificate, the download will fail > once 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. The PBS, however, 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. > > See https://bugs.chromium.org/p/chromium/issues/detail?id=993362 for > more information on this. > > -- Changes from v1 -- > * Rewrote commit messages and cover letter > * Got rid of some refactoring which were initially included > (going to send as own patch series later) > * Rebased to current repository versions > > > Daniel Tschlatscher (1): > make tasklog downloadable in the backup server backend > > src/api2/node/tasks.rs | 159 ++++++++++++++++++----------- > 4 files changed, 107 insertions(+), 79 deletions(-) > > Daniel Tschlatscher (1): > stream file method for PMG and PVE > > src/PVE/Tools.pm | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > Daniel Tschlatscher (1): > acknowledge content-disposition header > > src/PVE/APIServer/AnyEvent.pm | 3 +++ > 1 file changed, 3 insertions(+) > > Daniel Tschlatscher (1): > Revised task log API call when parameter 'limit' is 0 > > PVE/API2/Tasks.pm | 13 ++++++++++--- > 3 files changed, 15 insertions(+), 24 deletions(-) > > Daniel Tschlatscher (1): > revised task log download function in the PMG backend > > src/PMG/API2/Tasks.pm | 34 +++++++++++----------------------- > 1 file changed, 11 insertions(+), 23 deletions(-) > > Daniel Tschlatscher (3): > Source file download call in central function > add task log download button in TaskViewer > > src/Utils.js | 13 +++++++++++++ > src/window/TaskViewer.js | 17 +++++++++++++++-- > src/window/FileBrowser.js | 11 +++++------ > 3 files changed, 38 insertions(+), 8 deletions(-) > Other than one bug in `pmg-api` (see my other email) this series seems to work as intended. The bug in `pmg-api` is fixed fairly easily by just calling the right function and I tested that locally already. So unless there are other considerations: Tested-by: Stefan Sterz