From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4ZCbnY0QGsz34Vl for ; Wed, 12 Mar 2025 16:34:41 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4ZCbnT27Nvz33qR for ; Wed, 12 Mar 2025 16:34:37 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4ZCbnS5rhczGJ; Wed, 12 Mar 2025 16:34:36 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1741797276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jGsW5n9oVMVnXiU/8nFmQqTaYYMBpc1a3MV/hwYUSAQ=; b=3VgCbrQR1p/vM4Fq4o1rsycmeSLLCEv2YJ3NEWpmj0eOVv1n0jBAWFVUhb/czxEKmfKsQQ oT4ZwW5HH9KWgCAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1741797276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jGsW5n9oVMVnXiU/8nFmQqTaYYMBpc1a3MV/hwYUSAQ=; b=bVsludHdNyXMoE/DVaboaodgP1KXaBBuIAM5a6rcX5qFHlPUdhOyMkqn9+7VvsFYjhH92P UwmUC1JAdoDH7D8uQWsFZPj+wIABSM0qmmYv1hC4FhG7vP7KaF1bAh8kMEvjUtxTK+go4S aEv+tCoi+p8nehUcCSqbROadQ7yLEm7+/51BARMn5Jlrb1mmYG1kD0c8xB3ZuSK+JTEjg3 4pscwUwTw4TsDrptX0DJ9zvZVAdzbMHww8vl3ASBX2H/LFpt0s0DQM4pupbGSYh0zKobRP 9RkD/463LU9H8T383KBn9+QdmAxTvG7EvF0/qmG8PLeO7ufX3GXrAB1BpSUt0w== Content-Type: text/plain; charset=utf-8 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: Mime-Version: 1.0 Subject: Re: [PATCH] ipblocklist-functions.pl: Specify an IPFire user agent for the downloads From: Michael Tremer In-Reply-To: <20250312144610.3254927-1-adolf.belka@ipfire.org> Date: Wed, 12 Mar 2025 16:34:36 +0000 Cc: development@lists.ipfire.org Content-Transfer-Encoding: quoted-printable Message-Id: <23102622-D7F5-451E-96F3-F34DAEF3E24A@ipfire.org> References: <20250312144610.3254927-1-adolf.belka@ipfire.org> To: Adolf Belka Very interesting. I wasn=E2=80=99t even aware that we had this function. > On 12 Mar 2025, at 14:46, Adolf Belka wrote: >=20 > - As discussed at the IPFire conf call in March 2025, this patch = provides an IPFire > specific User Agent string for the IP Block Lists downloads using = LWP::UserAgent. > - It turned out that there was already a function in = general-functions.pl that creates > an IPFire Useer Agent string. This was used for this IP Blocklist = download. > - Currently it gave me the string IPFire/2.29/192. > - This was tested out with the Threatview.io IP blocklist download and = it worked fine. > - If this patch is approved and merged then I will let contact = Threatview.io to let them > know what our User Agent string is. >=20 > Tested-by: Adolf Belka > Signed-off-by: Adolf Belka > --- > config/cfgroot/ipblocklist-functions.pl | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/config/cfgroot/ipblocklist-functions.pl = b/config/cfgroot/ipblocklist-functions.pl > index bd026a01d..665dadb4c 100644 > --- a/config/cfgroot/ipblocklist-functions.pl > +++ b/config/cfgroot/ipblocklist-functions.pl > @@ -2,7 +2,7 @@ > = ##########################################################################= ##### > # = # > # IPFire.org - A linux based firewall = # > -# Copyright (C) 2007-2022 IPFire Team = # > +# Copyright (C) 2007-2025 IPFire Team = # > # = # > # This program is free software: you can redistribute it and/or modify = # > # it under the terms of the GNU General Public License as published by = # > @@ -118,13 +118,15 @@ sub download_and_create_blocklist($) { > use LWP::UserAgent; >=20 > # Create a user agent for downloading the blacklist > + # Define the User Agent string > # Limit the download size for safety > + my $user_agent =3D &General::MakeUserAgent(); > my $ua =3D LWP::UserAgent->new ( > ssl_opts =3D> { > SSL_ca_file =3D> '/etc/ssl/cert.pem', > verify_hostname =3D> 1, > }, > - > + agent =3D> $user_agent, > max_size =3D> $max_dl_bytes, > ); >=20 > --=20 > 2.48.1 >=20 >=20