From patchwork Tue Nov 21 05:40:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 1561 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id 1E66B60CB6 for ; Mon, 20 Nov 2017 19:40:32 +0100 (CET) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id BE6BB3501; Mon, 20 Nov 2017 19:40:31 +0100 (CET) Received: from mx.link38.eu (mx.link38.eu [188.68.43.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 9384334F7 for ; Mon, 20 Nov 2017 19:40:28 +0100 (CET) X-Virus-Scanned: ClamAV at mx.link38.eu Received: from mx-fra.brokers.link38.eu (mx-fra.brokers.link38.eu [10.141.75.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx.link38.eu (Postfix) with ESMTPS id 2C3BC40123 for ; Mon, 20 Nov 2017 19:40:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx-fra.brokers.link38.eu (Postfix) with ESMTPSA id B143D9F876 for ; Mon, 20 Nov 2017 19:40:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=link38.eu; s=201711; t=1511203217; x=1574275217; bh=tmn2RCyZkkh+bq38MKSHu4OiPQEGs8IrXHFHNwag/DE=; h=Date:From:To:Subject:Message-ID:Content-Type:From:To:Subject:Date: Cc; b=XL2l8xG0hR2FiRAl3/FFaRS/cwXy1WNmgqkK608iZ99S5UefmchINFxkZUUrbiBdB +Se9yAcp5OeLawizpaRRhlV4XHtmzUjwmAOzmYAelknZUE92r2pAQU3LJCmSVD2zyH qcQWo4KH1qpBvJKHa0p0uJBJQuVLuXlpQIyOqXEZGiD75XiLFIStb17l4QTg9rgwQW tVnzN6ZH1qZ5yzHkq5j1geDSRXTA9mzc99Ezsae+q3waiKrnaRRHtiEuDkFBWGTDtX 6MCnsUXuX7NMkJ1Tg3Ogi6dys64fMC51hkkrk2JNLw/JF74t/7cv1KRQeJNz98E+Ep 8pX+1H7Orw6Wg== Date: Mon, 20 Nov 2017 19:40:17 +0100 From: Peter =?utf-8?q?M=C3=BCller?= To: "development@lists.ipfire.org" Subject: [PATCH 2/3 v4] allow changing remote syslog protocol to TCP Message-ID: <20171120194017.5d10d634.peter.mueller@link38.eu> Organization: Link38 MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Add option to change remote syslog protocol to TCP, which is more reliable than UDP, but might be unsupported on older syslog servers. Signed-off-by: Peter Müller --- html/cgi-bin/logs.cgi/config.dat | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/html/cgi-bin/logs.cgi/config.dat b/html/cgi-bin/logs.cgi/config.dat index 789341dbe..aed0db9cf 100644 --- a/html/cgi-bin/logs.cgi/config.dat +++ b/html/cgi-bin/logs.cgi/config.dat @@ -33,6 +33,7 @@ $logsettings{'LOGWATCH_KEEP'} = '56'; my @VS = ('15','50','100','150','250','500'); $logsettings{'ENABLE_REMOTELOG'} = 'off'; $logsettings{'REMOTELOG_ADDR'} = ''; +$logsettings{'REMOTELOG_PROTOCOL'} = 'udp'; $logsettings{'ACTION'} = ''; &Header::getcgihash(\%logsettings); @@ -45,6 +46,10 @@ if ($logsettings{'ACTION'} eq $Lang::tr{'save'}) { $errormessage = $Lang::tr{'invalid logserver address'}; } + unless ($logsettings{'REMOTELOG_PROTOCOL'} =~ /^udp|tcp$/) + { + $errormessage = $Lang::tr{'invalid logserver protocol'}; + } } unless ($logsettings{'LOGWATCH_KEEP'} =~ /^\d+$/) { @@ -69,6 +74,10 @@ $checked{'ENABLE_REMOTELOG'}{'off'} = ''; $checked{'ENABLE_REMOTELOG'}{'on'} = ''; $checked{'ENABLE_REMOTELOG'}{$logsettings{'ENABLE_REMOTELOG'}} = "checked='checked'"; +$selected{'REMOTELOG_PROTOCOL'}{'udp'} = ''; +$selected{'REMOTELOG_PROTOCOL'}{'tcp'} == ''; +$selected{'REMOTELOG_PROTOCOL'}{$logsettings{'REMOTELOG_PROTOCOL'}} = "selected='selected'"; + $checked{'LOGVIEW_REVERSE'}{'off'} = ''; $checked{'LOGVIEW_REVERSE'}{'on'} = ''; $checked{'LOGVIEW_REVERSE'}{$logsettings{'LOGVIEW_REVERSE'}} = "checked='checked'"; @@ -139,6 +148,11 @@ print < $Lang::tr{'enabled'} $Lang::tr{'log server address'} + $Lang::tr{'log server protocol'} + END