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 162C866A47 for ; Tue, 28 Jul 2020 10:59:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0A6EA22504 for ; Tue, 28 Jul 2020 10:59:26 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 8CD1A224E6 for ; Tue, 28 Jul 2020 10:59:23 +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 55A624031B for ; Tue, 28 Jul 2020 10:59:23 +0200 (CEST) From: Stefan Reiter To: pbs-devel@lists.proxmox.com Date: Tue, 28 Jul 2020 10:58:42 +0200 Message-Id: <20200728085846.28816-1-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.052 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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. [http.rs, tools.rs, apt.rs] Subject: [pbs-devel] [RFC 0/4] Add GET /apt/changelog API call X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 08:59:56 -0000 Allows a user to retrieve changelogs for individual packages. Compatible with the widget-toolkit's APT panel, works the same as in PVE. Sent as RFC since it contains quite a bit of 'workaround' code. The initial idea was to replicate the way PVE does it right now, but that turned out to be very fragile with all the hardcoded URLs and whatnot (indicated by the fact that is indeed currently broken in PVE, I'll look at that soon). So instead, after Discussion with Fabian, I opted to simply use 'apt-get changelog' - this works well for Debian packages, but not for ours, since our repo doesn't contain the changelogs at the place APT expects. These patches therefore implement a rather weird in-between solution, where a HTTP GET to a fixed URL is used for our packages, and 'apt-get changelog [--print-uris]' is used for Debian ones. If we can make our repos work with 'apt-get changelog' soon, or don't mind the changelogs for our packages unavailable in PBS for a while, I can send a v2 dropping the 'tools::http' module and using 'apt-get' everywhere, without any new FIXMEs. If not, consider using it like this and I'll rework the code once our Repos support it. @Fabian: the idea that you can pre-download packages and get changelogs that way appears moot, since as it turns out, packages only downloaded with 'apt-get -d install' are not checked by 'apt-get changelog', returning the same 404 error as before. proxmox-backup: Stefan Reiter (4): apt: allow filter to select different package version add tools::http for generic HTTP GET and move HttpsConnector there apt: use 'apt-get changelog --print-uris' in get_changelog_url apt: add /changelog API call similar to PVE src/api2/node/apt.rs | 157 ++++++++++++++++++++++++++------------ src/client/http_client.rs | 64 +--------------- src/tools.rs | 1 + src/tools/http.rs | 90 ++++++++++++++++++++++ 4 files changed, 202 insertions(+), 110 deletions(-) create mode 100644 src/tools/http.rs -- 2.20.1