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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 3D5C4932DA for ; Fri, 16 Sep 2022 10:09:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2CBFE213F3 for ; Fri, 16 Sep 2022 10:09:53 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 16 Sep 2022 10:09:52 +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 5259444294 for ; Fri, 16 Sep 2022 10:09:52 +0200 (CEST) Message-ID: <5c890689-bd43-1057-6ecf-62c8e615a176@proxmox.com> Date: Fri, 16 Sep 2022 10:09:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Thunderbird/105.0 Content-Language: en-GB To: Stefan Hanreich , Proxmox Backup Server development discussion References: <20220915140857.1041222-1-s.hanreich@proxmox.com> <6d281db9-90e8-9164-6979-4b73b04cc627@proxmox.com> <7ecef7a9-afda-f0fd-55d1-924d4819745b@proxmox.com> From: Thomas Lamprecht In-Reply-To: <7ecef7a9-afda-f0fd-55d1-924d4819745b@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.893 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 -1.816 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: [pbs-devel] [PATCH proxmox-backup] fix #4095: make http client read proxy config from envvars 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: Fri, 16 Sep 2022 08:09:53 -0000 Am 16/09/2022 um 09:08 schrieb Stefan Hanreich: > On=C2=A09/16/22=C2=A008:58,=C2=A0Thomas=C2=A0Lamprecht=C2=A0wrote: >> Am=C2=A015/09/2022=C2=A0um=C2=A016:08=C2=A0schrieb=C2=A0Stefan=C2=A0Ha= nreich: >>> In=C2=A0order=C2=A0to=C2=A0be=C2=A0able=C2=A0to=C2=A0use=C2=A0a=C2=A0= proxy=C2=A0with=C2=A0the=C2=A0proxmox-backup-client,=C2=A0use >>> ProxyConfig=C2=A0for=C2=A0parsing=C2=A0proxy=C2=A0server=C2=A0config=C2= =A0from=C2=A0the=C2=A0environment.=C2=A0Also >>> added=C2=A0a=C2=A0section=C2=A0in=C2=A0the=C2=A0documentation=C2=A0th= at=C2=A0describes=C2=A0how=C2=A0to=C2=A0configure=C2=A0the >>> environment=C2=A0if=C2=A0a=C2=A0proxy=C2=A0server=C2=A0should=C2=A0be= =C2=A0used. >> >> Proxy=C2=A0config=C2=A0was=C2=A0more=C2=A0intended=C2=A0for=C2=A0the=C2= =A0server,=C2=A0not=C2=A0the=C2=A0client=C2=A0side(s),=C2=A0and=C2=A0IMO >> proxy's=C2=A0never=C2=A0have=C2=A0any=C2=A0use=C2=A0outside=C2=A0of=C2= =A0central=C2=A0surveillance=C2=A0of=C2=A0(tls)=C2=A0traffic,=C2=A0but >> well,=C2=A0we=C2=A0already=C2=A0got=C2=A0it=C2=A0and=C2=A0some=C2=A0us= er=C2=A0may=C2=A0want=C2=A0it,=C2=A0so=C2=A0can=C2=A0be=C2=A0fine,=C2=A0I= MO=C2=A0close >> to=C2=A0a=C2=A0breaking=C2=A0change=C2=A0though,=C2=A0would=C2=A0at=C2= =A0least=C2=A0require=C2=A0entries=C2=A0in=C2=A0all=C2=A0product's >> "noteable=C2=A0changes"=C2=A0section=C2=A0of=C2=A0their=C2=A0next=C2=A0= point=C2=A0release. >=20 > Yes, it seemed like some users desperately wanted it, judging from the = bugzilla=C2=A0issue=C2=A0as=C2=A0well=C2=A0as=C2=A0the=C2=A0forum. Sounds still like a x-y problem to me, e.g., the reporter doesn't want a proxy, they want a way to bridge isolated networks to certain services (apt, pbs, ...), but anyway, it's to small of a change to not do compared= to debating that with users semi-frequently ;-) >> so, if I get this right this test requires the following in the build = env: >> * needs a proxy to run on 8080 >> * needs PBS running >> * needs to build/tetst as root >> >> All three are a complete no-go, makes bootstrapping harder and is just= a flaky >> test all together, I'd just drop it completely... Anyway, NAK until fi= xed. >> >=20 > I don't think any of them are required actually, since it is just check= ing whether it can instantiate the HttpClient. It never makes any request= to the outside. I ran this test as non-root on my local machine without = PBS nor proxy runnning and it runs just fine. But the HttpClient::new code clearly spawns a login future due to the aut= h not being a API token, so your test just seems brittle and you may got lucky with timing = (i.e., future didn't schedule until test exited already), seems a recipe for flaky test= s to me... Also, note that you do not test the client's proxy capabilities, but only= what ProxyConfig accepts, and that should go into the ProxyConfig implementation, if we re= ally want to have that. Besides belonging there it can be also much simpler/less complex to= test.. >=20 >>> + env::set_var("ALL_PROXY", "https://localhost:8080"); >>> + >>> + let mut http_client =3D HttpClient::new( fyi, it would be more idiomatic rust to avoid the `mut` here and just always do a `let http_client =3D ...` for subsequent declarations too.