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 4ZfC172yRZz33BX for ; Fri, 18 Apr 2025 11:18:03 +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 4ZfC136fgZz335f for ; Fri, 18 Apr 2025 11:17:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4ZfC123dRHz33G; Fri, 18 Apr 2025 11:17:58 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1744975078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MGgtnekjB75HK2GkOdhaXzyVFNJAAsfXowkRCAV7opU=; b=XmKXM00d40LtCwem9mm5fTYv5ZJXLe7ywKsufz5qtboHfga4reBXtWvS7aD2U5kn5I4fH4 +51Xh6dDGVjFiYBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1744975078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MGgtnekjB75HK2GkOdhaXzyVFNJAAsfXowkRCAV7opU=; b=wimMNALxZmSJVg69M0SqjdXD25tHA955c65ngk3SwZc2Kk6LFitx8F9+8rw6b0YYZchxfv uAfSJ6iMT4po/yevAFQjszqbOoRRcMCMvFgYtipMwZmdfK81a4yyrPeV55FOZIJYZG7JE8 LTn5zaEkVAqGBlWoj0rs6dkq+fXgXmq8o12BxSPZNNj+LLnbArGrXyf7VHGoP8vtU3PzCu HlzZ5d91iWr3ojFo5KqaB1B/M6c8wUC/QAIlLs7+iRD1cYu3KdIlsD/LDPdNP/KDXKw2P7 GXDYphNqz67kocTaj4s4Puo1z7TKEjp57wmTMHww7Schu98y6vsb6PlZHJw9FQ== From: Stefan Schantl To: development@lists.ipfire.org Cc: Stefan Schantl Subject: [PATCHv2 3/7] general-functions.pl: Drop FetchPublicIp function. Date: Fri, 18 Apr 2025 12:54:42 +0200 Message-ID: <20250418110741.7756-4-stefan.schantl@ipfire.org> In-Reply-To: <20250418110741.7756-1-stefan.schantl@ipfire.org> References: <20250418110741.7756-1-stefan.schantl@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This function has been reworked and moved into the http-client-functions library. Signed-off-by: Stefan Schantl --- config/cfgroot/general-functions.pl | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 8ba6e3f79..861f95dec 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -17,7 +17,6 @@ package General; use strict; use Socket; use IO::Socket; -use Net::SSLeay; use Net::IPv4Addr qw(:all); $General::version = 'VERSION'; @@ -961,26 +960,6 @@ sub findhasharraykey { } } -sub FetchPublicIp { - my %proxysettings; - &General::readhash("${General::swroot}/proxy/settings", \%proxysettings); - if ($_=$proxysettings{'UPSTREAM_PROXY'}) { - my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/); - Net::SSLeay::set_proxy($peer,$peerport,$proxysettings{'UPSTREAM_USER'},$proxysettings{'UPSTREAM_PASSWORD'} ); - } - my $user_agent = &MakeUserAgent(); - my ($out, $response) = Net::SSLeay::get_http( 'checkip4.dns.lightningwirelabs.com', - 80, - "/", - Net::SSLeay::make_headers('User-Agent' => $user_agent ) - ); - if ($response =~ m%HTTP/1\.. 200 OK%) { - $out =~ /Your IP address is: (\d+.\d+.\d+.\d+)/; - return $1; - } - return ''; -} - # # Check if hostname.domain provided have IP provided # use gethostbyname to verify that -- 2.47.2