From patchwork Mon Apr 13 07:45:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2942 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zZ6Jkpz3yC0 for ; Mon, 13 Apr 2020 07:46:02 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zW66JYz2bx; Mon, 13 Apr 2020 07:45:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zW2pzxz2xkV; Mon, 13 Apr 2020 07:45:59 +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 (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zT0CjCz2xkV for ; Mon, 13 Apr 2020 07:45:57 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zQ51YVzgh; Mon, 13 Apr 2020 07:45:54 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763955; 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; bh=rIC3zh3ILC7tsG/FHQW38nJEZQRBCy++oahcZJ/KEkY=; b=Hj3Cm3nS1XBrh/SI/TKQeXFKpSrTzIZiKWTZPxl38BeSIjLFzu1flxk19H7T9ARRhAjmEq 0fQ3PNZS5pmv7gBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763955; 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; bh=rIC3zh3ILC7tsG/FHQW38nJEZQRBCy++oahcZJ/KEkY=; b=DRyD3YYwn4Bhi78aIOqzfkXm3ZTGP408UcV72r1UR1pqtCgD1sZ53wGJXly9sMahJApdly x9lK0oWg6wrOeAPBSNe7IgiDG2sxJNpm0DWdwXYMOesT9MWGQzDAEqeLjfkFFuYmUUAMpM 6nKY9u9YwuIAIFdN55VIR/mHi+fL0G+b4Rflx+l0qvnLCtry7+CPUbx3iMo+fLwv3wXLX3 kTnVMUTbqs5ej3DjDFEH2mZfOUXSlSKKkOUyWZwJcAWikbVuuGa3RfmUd63NzZdZyij3MT oANz1ok+EMOKa+mpODpOwcbf3suufFn3Dy/iX0T9AP6ZbKEOid59o+rH7AJuig== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 01/19] openvpn: Add WUI page for client usage statistics Date: Mon, 13 Apr 2020 09:45:32 +0200 Message-Id: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 327 ++++++++++++++++++++++++++ langs/en/cgi-bin/en.pl | 2 + 2 files changed, 329 insertions(+) create mode 100755 html/cgi-bin/logs.cgi/ovpnclients.dat diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat new file mode 100755 index 000000000..703f4e507 --- /dev/null +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -0,0 +1,327 @@ +#!/usr/bin/perl +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2020 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 # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +use strict; +use POSIX(); +use DBI; + +# enable only the following on debugging purpose +#use warnings; +#use CGI::Carp 'fatalsToBrowser'; + +require '/var/ipfire/general-functions.pl'; +require "${General::swroot}/lang.pl"; +require "${General::swroot}/header.pl"; + +my %color = (); +my %mainsettings = (); +&General::readhash("${General::swroot}/main/settings", \%mainsettings); +&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); + +# Path and file of the OVPN connections database. +my $database = "/var/ipfire/ovpn/clients.db"; + +my %cgiparams=(); +my %logsettings=(); +my %ovpnsettings=(); + +my $errormessage=''; + +# Hash wich contains the month numbers and the translated names for easy access. +my %monthhash = ( + "1" => "$Lang::tr{'january'}", + "2" => "$Lang::tr{'february'}", + "3" => "$Lang::tr{'march'}", + "4" => "$Lang::tr{'april'}", + "5" => "$Lang::tr{'may'}", + "6" => "$Lang::tr{'june'}", + "7" => "$Lang::tr{'july'}", + "8" => "$Lang::tr{'august'}", + "9" => "$Lang::tr{'september'}", + "10" => "$Lang::tr{'october'}", + "11" => "$Lang::tr{'november'}", + "12" => "$Lang::tr{'december'}" +); + +# Get current time. +my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime(time); + +# Adjust month, because Jan starts as month "0". +$month = $month+1; + +# Adjust year number. +$year = $year+1900; + +# Assign default vaules. +$cgiparams{'FROM_DAY'} = $mday; +$cgiparams{'FROM_MONTH'} = $month; +$cgiparams{'FROM_YEAR'} = $year; +$cgiparams{'TO_DAY'} = $mday; +$cgiparams{'TO_MONTH'} = $month; +$cgiparams{'TO_YEAR'} = $year; + +&Header::getcgihash(\%cgiparams); + +# Read-in OpenVPN settings and connections. +&General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%ovpnsettings); + +# Init DB Module and connect to the database. +my $database_handle = DBI->connect("DBI:SQLite:dbname=$database", "", "", { RaiseError => 1 }); + +# Generate datestrings for SQL queries. +my $from_datestring = sprintf '%04d-%02d-%02d', ($cgiparams{"FROM_YEAR"}, $cgiparams{"FROM_MONTH"}, $cgiparams{"FROM_DAY"}); +my $to_datestring = sprintf '%04d-%02d-%02d', ($cgiparams{"TO_YEAR"}, $cgiparams{"TO_MONTH"}, $cgiparams{"TO_DAY"}); + +my $database_query = qq( + SELECT + common_name, SUM( + STRFTIME('%s', ( + CASE + WHEN DATETIME(COALESCE(disconnected_at, CURRENT_TIMESTAMP), 'localtime') < DATETIME('$to_datestring', 'localtime', 'start of day', '+86399 seconds') + THEN DATETIME(COALESCE(disconnected_at, CURRENT_TIMESTAMP), 'localtime') + ELSE DATETIME('$to_datestring', 'localtime', 'start of day', '+86399 seconds') + END + ), 'utc') - + STRFTIME('%s', ( + CASE + WHEN DATETIME(connected_at, 'localtime') > DATETIME('$from_datestring', 'localtime', 'start of day') + THEN DATETIME(connected_at, 'localtime') + ELSE DATETIME('$from_datestring', 'localtime', 'start of day') + END + ), 'utc') + ) + FROM sessions + WHERE + disconnected_at IS NULL + OR + DATETIME(disconnected_at, 'localtime') > DATETIME('$from_datestring', 'localtime', 'start of day') + OR + DATETIME(connected_at, 'localtime') < DATETIME('$to_datestring', 'localtime', 'start of day', '+86399 seconds') + GROUP BY common_name + ORDER BY common_name; +); + +if ($cgiparams{'CONNECTION_NAME'}) { + $database_query = qq( + SELECT * + FROM sessions + WHERE + common_name = '$cgiparams{"CONNECTION_NAME"}' AND ( + DATETIME(disconnected_at, 'localtime') > DATETIME('$from_datestring', 'localtime', 'start of day') + OR + DATETIME(connected_at, 'localtime') < DATETIME('$to_datestring', 'localtime', 'start of day', '+86399 seconds')); + ); +} + +# Prepare SQL statement. +my $statement_handle = $database_handle->prepare($database_query); + +# Execute SQL statement and get retun value if any error happened. +my $database_return_value = $statement_handle->execute(); + +# If an error has been returned, assign it to the errorstring value for displaying. +if($database_return_value < 0) { + $errormessage = "$DBI::errstr"; +} + +&Header::showhttpheaders(); + +&Header::openpage($Lang::tr{'ovpn rw connection log'}, 1, ''); + +&Header::openbigbox('100%', 'left', '', $errormessage); + +if ($errormessage) { + &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); + print "$errormessage \n"; + &Header::closebox(); +} + +&Header::openbox('100%', 'left', "$Lang::tr{'settings'}:"); + +print "
\n"; +print "\n"; + print "\n"; + print "\n"; + print "\n"; + + print "\n"; + print "\n"; + + print "\n"; + + print "\n"; + print "\n"; + + print "\n"; + + print "\n"; + print "\n"; + print "\n"; + + print "\n"; + print "\n"; + + print "\n"; + + print "\n"; + print "\n"; + + print "\n"; + + print "\n"; + print "\n"; + print "\n"; + print "\n"; + + print "\n"; + print "\n"; + print "\n"; +print "
$Lang::tr{'from'}:
$Lang::tr{'day'}: \;\n"; + &generate_select("FROM_DAY", "days"); + print "$Lang::tr{'month'}: \;\n"; + &generate_select("FROM_MONTH", "months"); + print "$Lang::tr{'year'}: \;\n"; + &generate_select("FROM_YEAR", "years"); + print "

$Lang::tr{'to'}:
$Lang::tr{'day'}: \;\n"; + &generate_select("TO_DAY", "days"); + print "$Lang::tr{'month'}: \;\n"; + &generate_select("TO_MONTH", "months"); + print "$Lang::tr{'year'}: \;\n"; + &generate_select("TO_YEAR", "years"); + print "

$Lang::tr{'ovpn connection name'}:\n"; + + print "\n"; + print "
\n"; +print "
\n"; + +&Header::closebox(); + +&Header::openbox('100%', 'left', $Lang::tr{'log'}); + +my $lines = 0; + +print ""; + +my $col=""; + +while(my @row = $statement_handle->fetchrow_array()) { + # Assign some nice to read variable names for the DB fields. + my $connection_name = $row[0]; + my $connection_open_time = $row[1]; + my $connection_close_time = $row[2]; + my $connection_bytes_recieved = $row[3]; + my $connection_bytes_sent = $row[4]; + + # Colorize columns. + if ($lines % 2) { + $col="bgcolor='$color{'color22'}'"; + } else { + $col="bgcolor='$color{'color20'}'"; + } + +print < + + + + + + +END +; + + # Increase lines count. + $lines++; + + } + +print "
$connection_name$connection_open_time$connection_close_time$connection_bytes_recieved$connection_bytes_sent

\n"; + +&Header::closebox(); + +# Close database connection. +$database_handle->disconnect(); + +&Header::closebigbox(); + +&Header::closepage(); + +# +## Function for easy select generation. +# +sub generate_select($$) { + my ($name, $type) = @_; + + my $start = 1; + my $stop; + + # Adjust start and stop by the given type. + if ($type eq "days") { + $stop = 31; + } elsif ($type eq "months") { + $stop = 12; + } elsif ($type = "years") { + $stop = $year; + $start = $stop - 10; + } + + # Print select HTML tag. + print "\n\n"; +} diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index a68c8f411..9d3ca5c6d 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1915,6 +1915,7 @@ 'ovpn' => 'OpenVPN', 'ovpn add conf' => 'Additional configuration', 'ovpn con stat' => 'OpenVPN Connection Statistics', +'ovpn connection name' => 'Connection name', 'ovpn config' => 'OVPN-Config', 'ovpn crypt options' => 'Cryptographic options', 'ovpn device' => 'OpenVPN device:', @@ -1947,6 +1948,7 @@ 'ovpn reneg sec' => 'Session key lifetime:', 'ovpn routes push' => 'Routes (one per line) e.g. 192.168.10.0/255.255.255.0 192.168.20.0/24', 'ovpn routes push options' => 'Route push options', +'ovpn rw connection log' => 'OpenVPN RW connections log', 'ovpn server status' => 'Current OpenVPN server status:', 'ovpn subnet' => 'OpenVPN subnet:', 'ovpn subnet is invalid' => 'OpenVPN subnet is invalid.', From patchwork Mon Apr 13 07:45:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2941 Return-Path: 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 (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zZ1gxSz3yBt for ; Mon, 13 Apr 2020 07:46:02 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zX4F5kz2h9; Mon, 13 Apr 2020 07:46:00 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zW66N7z30FF; Mon, 13 Apr 2020 07:45:59 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zT0s2lz2yRK for ; Mon, 13 Apr 2020 07:45:57 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zS1YWBzRj; Mon, 13 Apr 2020 07:45:56 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763956; 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=fL72oFCCcqoIQ+mkXoQ4jgAhvR2/J6w2pvMFmFYrp6I=; b=tcVLv8opw4jy1IxnvJ45B/1cGGevwS+UE5Sgmhbm2U1jbruYyZnzkX0wsDDWl40bB9YZbS arYCjFNmgn8/zaAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763956; 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=fL72oFCCcqoIQ+mkXoQ4jgAhvR2/J6w2pvMFmFYrp6I=; b=KdQ3NLBCQnrgk5qI2uvDPgjUO2RvRuBEA0Ev/ZFf3jxgfPhTRMnDdcwYmdFL6dG2eahOcb sn0BWnWovVWhOBETa/Vyyw2Nn6pAeobs+hwft1o3Bk2e0+0/aBvN1W4gFWHLU0HzgFa3P/ wxMyHubnTyG+ajPqrPO2stLePtq8gGxJKdi7fHS+xq2M5blkLNtBVAi7/fFCT98QZZVVqF p9kdln0lRJ97re1z+gNI8cMzFdz1bYFjiPvkV4hdbylSa1IPckdAPtZIrxJMfWtsW9rdPF jEmeA07X8wRB1EDs/y3+0tPeCRaF/QzIyIm3F7W/cQgIhatRZESgThVQXUuo6Q== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 02/19] OpenVPN: Fix query when selecting sessions only Date: Mon, 13 Apr 2020 09:45:33 +0200 Message-Id: <20200413074550.2735-2-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" From: Michael Tremer Previously some sessions were selected which did not qualify for the search. Signed-off-by: Michael Tremer --- html/cgi-bin/logs.cgi/ovpnclients.dat | 28 +++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index 703f4e507..46667a9d1 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -107,27 +107,31 @@ my $database_query = qq( ELSE DATETIME('$from_datestring', 'localtime', 'start of day') END ), 'utc') - ) + ) AS duration FROM sessions WHERE - disconnected_at IS NULL - OR - DATETIME(disconnected_at, 'localtime') > DATETIME('$from_datestring', 'localtime', 'start of day') - OR + ( + disconnected_at IS NULL + OR + DATETIME(disconnected_at, 'localtime') > DATETIME('$from_datestring', 'localtime', 'start of day') + ) + AND DATETIME(connected_at, 'localtime') < DATETIME('$to_datestring', 'localtime', 'start of day', '+86399 seconds') GROUP BY common_name - ORDER BY common_name; + ORDER BY common_name, duration DESC; ); if ($cgiparams{'CONNECTION_NAME'}) { $database_query = qq( - SELECT * - FROM sessions + SELECT * FROM sessions WHERE - common_name = '$cgiparams{"CONNECTION_NAME"}' AND ( - DATETIME(disconnected_at, 'localtime') > DATETIME('$from_datestring', 'localtime', 'start of day') - OR - DATETIME(connected_at, 'localtime') < DATETIME('$to_datestring', 'localtime', 'start of day', '+86399 seconds')); + common_name = '$cgiparams{"CONNECTION_NAME"}' + AND ( + DATETIME(disconnected_at, 'localtime') > DATETIME('$from_datestring', 'localtime', 'start of day') + AND + DATETIME(connected_at, 'localtime') < DATETIME('$to_datestring', 'localtime', 'start of day', '+86399 seconds') + ) + ORDER BY connected_at; ); } From patchwork Mon Apr 13 07:45:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2943 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zb2vDPz3yC3 for ; Mon, 13 Apr 2020 07:46:03 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zX6d0Cz2jd; Mon, 13 Apr 2020 07:46:00 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zX1PHMz30FN; Mon, 13 Apr 2020 07:46:00 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zV3p3nz2yd8 for ; Mon, 13 Apr 2020 07:45:58 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zT2cwZz2Cd; Mon, 13 Apr 2020 07:45:57 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763957; 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=quPhshlpRG7vAEpMCmR6lBLwMoW3Vb18fPIZuCUNRSY=; b=niF4th7o4kAaNkNnQaqisc0ZwN/gybEQlibzCqZc1hPUCr7Xjwu3fmfw56zrZ2iFMMgdhm eONOchyeCJTQWxCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763957; 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=quPhshlpRG7vAEpMCmR6lBLwMoW3Vb18fPIZuCUNRSY=; b=m7K0RGUw6RISDk/jQtUZC6W3xheVk7f3XSxVkj9iMHCW15f3jkSDlQ9CUs1rvtFStQA1jH ZeX7ArCWD11hToCsmMbFK5D3dRweBIRFcB6jtHpn+eIyyMWIrqiAiGOIzNno0OavKd91ZB LWwD2XtsUwIJrb6nrFY2EIoJpYEQrMCI4smC9hJG88yDZ1kyOzI8r8m8NZhZ2X5uY9AbPZ KopZfV17N6nwJVysWMDFVyc3HVrlMp5iyWh2H5UDETeytRv88PntDVyqJ+DvBz7n70IsYN FtU9WVXBOf6kjUmgxlSwf39PfbfQ1euhyiXKjJ8Y1nR2zlUhekR74dURra0h1w== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 03/19] ovpnclients.dat: Fix hard coded language string Date: Mon, 13 Apr 2020 09:45:34 +0200 Message-Id: <20200413074550.2735-3-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index 46667a9d1..bb7bdfb7b 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -207,7 +207,7 @@ print "\n"; print "\n"; -while(my @row = $statement_handle->fetchrow_array()) { - # Assign some nice to read variable names for the DB fields. - my $connection_name = $row[0]; - my $connection_open_time = $row[1]; - my $connection_close_time = $row[2]; - my $connection_bytes_recieved = &General::formatBytes($row[3]); - my $connection_bytes_sent = &General::formatBytes($row[4]); - - # Colorize columns. - if ($lines % 2) { - $col="bgcolor='$color{'color20'}'"; - } else { - $col="bgcolor='$color{'color22'}'"; - } +# Only try to fetch the DB items if there is no error message. +unless ($errormessage) { + while(my @row = $statement_handle->fetchrow_array()) { + # Assign some nice to read variable names for the DB fields. + my $connection_name = $row[0]; + my $connection_open_time = $row[1]; + my $connection_close_time = $row[2]; + my $connection_bytes_recieved = &General::formatBytes($row[3]); + my $connection_bytes_sent = &General::formatBytes($row[4]); + + # Colorize columns. + if ($lines % 2) { + $col="bgcolor='$color{'color20'}'"; + } else { + $col="bgcolor='$color{'color22'}'"; + } - print "\n"; - print "\n"; + print "\n"; + print "\n"; - if ($cgiparams{'CONNECTION_NAME'}) { - print "\n"; - print "\n"; - print "\n"; - print "\n"; - } else { - # Convert total connection time into human-readable format. - my $total_time = &General::format_time($row[1]); + if ($cgiparams{'CONNECTION_NAME'}) { + print "\n"; + print "\n"; + print "\n"; + print "\n"; + } else { + # Convert total connection time into human-readable format. + my $total_time = &General::format_time($row[1]); - print "\n"; - } + print "\n"; + } - print "\n"; + print "\n"; - # Increase lines count. - $lines++; + # Increase lines count. + $lines++; + } } # If nothing has been fetched, the amount of lines is still zero. -# In this case display a hint about no data. +# In this case display a hint about no data. unless ($lines) { print "\n"; } From patchwork Mon Apr 13 07:45:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2953 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zy4lTZz3yC0 for ; Mon, 13 Apr 2020 07:46:22 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zl2kRFz2qG; Mon, 13 Apr 2020 07:46:11 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zl1pyFz30FQ; Mon, 13 Apr 2020 07:46:11 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zf3tJhz30F8 for ; Mon, 13 Apr 2020 07:46:06 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zb26mbz2l5; Mon, 13 Apr 2020 07:46:03 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763963; 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=y8n8ipwOLVMv3HG9X0auOAPjBvWq/KNQ0CATclO2Q+o=; b=rHEhvvN25qwTyPbK+Q+g59FjQTUBqw3JtN+Ltnh1xK5OI6Ap1a9qy2E0S8ILYF3Osuu8AB cx2Et8HvnmoK83BA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763963; 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=y8n8ipwOLVMv3HG9X0auOAPjBvWq/KNQ0CATclO2Q+o=; b=G+YZpQjmqgS1TqxxJk7eHet5mG9HbidTWaKT+f4dr0wGMkh9j/01bgjOjIlBr14uBadeTC 9SU8j6yU7kUh05oCa++D9NyZEZYzkbp6pomWk090aBI3JVzsCPGs9aAz3Iqr2d/hgVu9Hf BTomFLwCGCLJA51NHEPnAljzI8kh8/9DKeK5O1CxzJri/nY8Qv5S/bZvk7JvTht8K0ZDRE W9JlbnKyo0oTFhralxnbDAd73pU0ksN7Z+jz+NrXBxjZCKtj3Mfuvd66IB9bjFRxoFzVSC CRqUxtGHhEuDlG/TOcWQ1htnrAL10R4+cKvQxDqRTL9e0I2foEEitget2TVEYw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 12/19] general-functions.pl: formatBytes() Fix computing the correct unit. Date: Mon, 13 Apr 2020 09:45:43 +0200 Message-Id: <20200413074550.2735-12-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- config/cfgroot/general-functions.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 692e072c2..4c7cf09a8 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1272,14 +1272,14 @@ sub formatBytes { # Loop through the array of units. foreach my $element (@units) { + # Assign current processed element to unit. + $unit = $element; + # Break loop if the bytes are less than the next unit. last if $bytes < 1024; # Divide bytes amount with 1024. $bytes /= 1024; - - # Assign current processed element to unit. - $unit = $element; } # Return the divided and rounded bytes count and the unit. From patchwork Mon Apr 13 07:45:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2955 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4911014xnBz3yBt for ; Mon, 13 Apr 2020 07:46:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zm4F1Qz2qq; Mon, 13 Apr 2020 07:46:12 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zm2nhtz30FQ; Mon, 13 Apr 2020 07:46:12 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zg3XKfz2y3R for ; Mon, 13 Apr 2020 07:46:07 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zb60Hcz2lB; Mon, 13 Apr 2020 07:46:03 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763964; 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=QjOGtJwFOeS2fpi0KDjM6/C/Nyzfa11GoiBp8aQ3O54=; b=4ykCLlwkzNsDVNArXO5t6AilGzwALKfJPMPaEMuxT6dNHtmKoPCDsZRuJFyRl+3Ncz4Qjs VVjNVQPIOsF/s0BQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763964; 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=QjOGtJwFOeS2fpi0KDjM6/C/Nyzfa11GoiBp8aQ3O54=; b=NzFyMAXYtZq9qXQAjvUTk9/bidStHUT82ZTdwQK5TbrWTtWh6mynZEEjEX3G/BNKZaEpG8 oifTgMitrjqeXHow+T7in2u5C4PgNMGYkQNfghE38ePQkEqPSw+PypwU21e9C/QpDQWO5r kBr+HPU3YMVN6J6xT0lYtJlN4WLA11y946Wym77e4U9cH9uDuHH3XUi+usvE9qfmxtJ65b wYZF7f6PlSIcgyK+TkWNnvKq0FZebb7K+HIO74m0E2+o8poACIxEhX/bGwJXJ/AhP1GqNI lYzW4pYcfK9H9o3kDR18ziYP3onEMYmTYKksAQB4AJJx8N4Av1KpmBTd/fqO0w== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 13/19] ovpnclients.dat: Fix type in received. Date: Mon, 13 Apr 2020 09:45:44 +0200 Message-Id: <20200413074550.2735-13-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 2 +- langs/en/cgi-bin/en.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index 093315a64..62b91a054 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -262,7 +262,7 @@ my $col = "bgcolor='$color{'color20'}'"; if ($cgiparams{'CONNECTION_NAME'}) { print "\n"; print "\n"; - print "\n"; + print "\n"; print "\n"; } else { print "\n"; print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; } else { print "\n"; print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; } else { # Convert total connection time into human-readable format. my $total_time = &General::format_time($row[1]); From patchwork Mon Apr 13 07:45:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2952 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zx5G8nz3yBt for ; Mon, 13 Apr 2020 07:46:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zl0VZXz2nB; Mon, 13 Apr 2020 07:46:11 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zk6Z4Vz30FV; Mon, 13 Apr 2020 07:46:10 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zf3HFtz2yXg for ; Mon, 13 Apr 2020 07:46:06 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zd0t2Tz2nf; Mon, 13 Apr 2020 07:46:05 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763965; 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=1HiSxDgLCSQyflYTJsXOfogOjV7ppHWzCad1pGylPXI=; b=sgzXBDsxP9rX3vh0K5hAIBGRUUkWMBq4qEWFTDZnTiwg21j8CAQJD0WVbf/ZJM48XLzNcj +9to8CGOOFL9wdDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763965; 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=1HiSxDgLCSQyflYTJsXOfogOjV7ppHWzCad1pGylPXI=; b=XB7Vzo4pNaF8dsmuR6dyUla6LOccWaZ7Q4XihLOw64i1xA61FqIEkdnryX+ObCbrteNsqA 8QZWJ2TIEKAZe4L/IHyOGRqldElhtxGsN4VS2E2XHZ9q8MYkAoM7xkrCZkhAn2igu2C/cG 80niu4GuAVvEBbi/apeRjYJWVVkLJ74iCFeDWTOFTmJYNya3M9DH27hYcV8nKkBO3ZCrAx L0t8i4EmWQja8zSAc6A46Wp1f2kFeueQiL2HDq2hCX/axTldUOZNShohwMXngLuUt5T/yi vwzF/XJxSxdBhfRMEoHROE3htKbGO2vdXyXfhgNQtw3KRhOPMu0Ybwisi8qInw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 15/19] OpenVPN: Capitalise some headings and labels Date: Mon, 13 Apr 2020 09:45:46 +0200 Message-Id: <20200413074550.2735-15-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" From: Michael Tremer Signed-off-by: Michael Tremer --- langs/en/cgi-bin/en.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 3675a21ca..a1747a654 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1918,7 +1918,7 @@ 'ovpn' => 'OpenVPN', 'ovpn add conf' => 'Additional configuration', 'ovpn con stat' => 'OpenVPN Connection Statistics', -'ovpn connection name' => 'Connection name', +'ovpn connection name' => 'Connection Name', 'ovpn config' => 'OVPN-Config', 'ovpn crypt options' => 'Cryptographic options', 'ovpn device' => 'OpenVPN device:', @@ -1951,7 +1951,7 @@ 'ovpn reneg sec' => 'Session key lifetime:', 'ovpn routes push' => 'Routes (one per line) e.g. 192.168.10.0/255.255.255.0 192.168.20.0/24', 'ovpn routes push options' => 'Route push options', -'ovpn rw connection log' => 'OpenVPN RW connections log', +'ovpn rw connection log' => 'OpenVPN Roadwarrior Connections Log', 'ovpn server status' => 'Current OpenVPN server status:', 'ovpn subnet' => 'OpenVPN subnet:', 'ovpn subnet is invalid' => 'OpenVPN subnet is invalid.', @@ -2446,7 +2446,7 @@ 'tor traffic limit soft' => 'Traffic limit almost reached. Not accepting any new connections.', 'tor traffic read written' => 'Total traffic (read/written)', 'tor use exit nodes' => 'Use only these exit nodes (one per line)', -'total connection time' => 'Total connection time', +'total connection time' => 'Total Connection Time', 'total hits for log section' => 'Total hits for log section', 'traffic back' => 'Back', 'traffic calc time' => 'Time of calculation', From patchwork Mon Apr 13 07:45:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2954 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zz43sTz3yBt for ; Mon, 13 Apr 2020 07:46:23 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zl4k1qz2ql; Mon, 13 Apr 2020 07:46:11 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zl3mpjz30FF; Mon, 13 Apr 2020 07:46:11 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zf51RXz30FG for ; Mon, 13 Apr 2020 07:46:06 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zd4sR3z2jN; Mon, 13 Apr 2020 07:46:05 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763965; 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=Kqp8oZgUEFfKRLRrstOtL2+sGfiC03ef7nfb6QiVz0o=; b=EMtGLobJelIF8Y6Ne8PXB1s7ZHqy+CqfkeheEzKK/aj/HTOArn/6PWzB1aPF69giFVJaKQ 3GcVUpnppfxGnWAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763965; 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=Kqp8oZgUEFfKRLRrstOtL2+sGfiC03ef7nfb6QiVz0o=; b=jPbvilE1hCzF4n+zsR4+xInu9t+r9oai7Wl8408PkCt11FYHnVP7jVx6ceYVIVap7AzBvd 81tx4kt4XqrfQVwuH6i5e4aMbWexszeObZZNvol3x+UvbbtZHXQlLAJkfTmqju+D+IvIJS v6+ulvqmtkUJiS2sifwDOB9XFWj13CRUjhsEBs7ZlvNElAj3NM8ly2T2UGnxLf4ySsUMMH kQHs5sN+Mcv78T6JegAkNqX8/RgZTuMzlhr+Y3DVyhmsOxvt7LU1jEikBn4/78RGa8Lomv dtjudKrgeaBiiQDZUP0fo2y7VkeWJzQhQga+Kb8G06LbI3dDWjTmnCwbCfZpKg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 16/19] OpenVPN Log: Add connection duration Date: Mon, 13 Apr 2020 09:45:47 +0200 Message-Id: <20200413074550.2735-16-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" From: Michael Tremer Signed-off-by: Michael Tremer --- html/cgi-bin/logs.cgi/ovpnclients.dat | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index 002a393ad..2009990ec 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -128,7 +128,8 @@ my $database_query = qq( if ($cgiparams{'CONNECTION_NAME'}) { $database_query = qq( - SELECT common_name, DATETIME(connected_at, 'localtime'), DATETIME(disconnected_at, 'localtime'), bytes_received, bytes_sent FROM sessions + SELECT common_name, DATETIME(connected_at, 'localtime'), DATETIME(disconnected_at, 'localtime'), bytes_received, bytes_sent, + STRFTIME('%s', DATETIME(disconnected_at)) - STRFTIME('%s', DATETIME(connected_at)) AS duration FROM sessions WHERE common_name = '$cgiparams{"CONNECTION_NAME"}' AND ( @@ -260,8 +261,9 @@ my $col = "bgcolor='$color{'color20'}'"; print "\n"; if ($cgiparams{'CONNECTION_NAME'}) { - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print "\n"; print "\n"; } else { @@ -279,6 +281,7 @@ unless ($errormessage) { my $connection_close_time = $row[2]; my $connection_bytes_recieved = &General::formatBytes($row[3]); my $connection_bytes_sent = &General::formatBytes($row[4]); + my $duration = &General::format_time($row[5]); # Colorize columns. if ($lines % 2) { @@ -291,8 +294,9 @@ unless ($errormessage) { print "\n"; if ($cgiparams{'CONNECTION_NAME'}) { - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print "\n"; print "\n"; } else { @@ -312,7 +316,7 @@ unless ($errormessage) { # If nothing has been fetched, the amount of lines is still zero. # In this case display a hint about no data. unless ($lines) { - print "\n"; + print "\n"; } print "
\n"; print ""; -my $col=""; +my $col = "bgcolor='$color{'color20'}'"; + + print "\n"; + print "\n"; + + if ($cgiparams{'CONNECTION_NAME'}) { + print "\n"; + print "\n"; + print "\n"; + print "\n"; + } else { + print "\n"; while(my @row = $statement_handle->fetchrow_array()) { # Assign some nice to read variable names for the DB fields. @@ -253,23 +267,29 @@ while(my @row = $statement_handle->fetchrow_array()) { my $connection_bytes_recieved = &General::formatBytes($row[3]); my $connection_bytes_sent = &General::formatBytes($row[4]); - # Colorize columns. + # Colorize columns. if ($lines % 2) { + $col="bgcolor='$color{'color20'}'"; + } else { $col="bgcolor='$color{'color22'}'"; + } + + print "\n"; + print "\n"; + + if ($cgiparams{'CONNECTION_NAME'}) { + print "\n"; + print "\n"; + print "\n"; + print "\n"; } else { - $col="bgcolor='$color{'color20'}'"; + # Convert total connection time into human-readable format. + my $total_time = &General::format_time($row[1]); + + print "\n"; } -print < - - - - - - -END -; + print "\n"; # Increase lines count. $lines++; From patchwork Mon Apr 13 07:45:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2948 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zr2dtkz3yC0 for ; Mon, 13 Apr 2020 07:46:16 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zd3qRmz2p8; Mon, 13 Apr 2020 07:46:05 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zc6xsqz30FK; Mon, 13 Apr 2020 07:46:04 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zY2Xkbz2xqq for ; Mon, 13 Apr 2020 07:46:01 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zX5rbXz2jN; Mon, 13 Apr 2020 07:46:00 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763961; 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=qth+3TexGRx6N7H1vS2KtV/oFqpVEB1oTp3+0mYDnNk=; b=m7tWUZvKN9hPmdSVkukt98KrFRsMU3QPgeZLlFsGt6fqZJPhXpSlpUzr/Q45JJDZt+iFXt hE7+qId0TXOWLoCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763961; 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=qth+3TexGRx6N7H1vS2KtV/oFqpVEB1oTp3+0mYDnNk=; b=DsW53EWSf2uEfkYBRdqUmRj7BWKxCMh+pVWtvGiJVSWcK8dvZABF1K83suUgfUA0hAct0g UEsPbeC2OT6fv11plb78Qb3lTv81OfCUjGUkxIy+1pfyM/yATcP5P04zoDUgSU1C0AB9+H 8ARpaEYVFjZRRmtDGvef/r+lohP3bKn6wI2lZ4pruKnyR0E3x/lcozXOHhWASSa3+8X8Rb pyrYK0kTR4A4I7mcXAFBI7+Y3kR0xpwDqNxF1sgLw1SRu0H1fqM30BTovabJrIdWmlte4X bZXyqhgVdwYl3xe9Erp/u+7Lsat76hdTJe0DPipvdYkcQhD6rvdPZdP2ueJBEA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 08/19] ovpnclients.dat: Convert timestamps into localtime. Date: Mon, 13 Apr 2020 09:45:39 +0200 Message-Id: <20200413074550.2735-8-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index 33d6d8717..cf3e0e7bc 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -123,7 +123,7 @@ my $database_query = qq( if ($cgiparams{'CONNECTION_NAME'}) { $database_query = qq( - SELECT * FROM sessions + SELECT common_name, DATETIME(connected_at, 'localtime'), DATETIME(disconnected_at, 'localtime'), bytes_received, bytes_sent FROM sessions WHERE common_name = '$cgiparams{"CONNECTION_NAME"}' AND ( From patchwork Mon Apr 13 07:45:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2949 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zs4hRrz3yBt for ; Mon, 13 Apr 2020 07:46:17 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zf4HqJz2fm; Mon, 13 Apr 2020 07:46:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zf31tTz2yRK; Mon, 13 Apr 2020 07:46:06 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zc4VlRz30F6 for ; Mon, 13 Apr 2020 07:46:04 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zY2y5Lz2kn; Mon, 13 Apr 2020 07:46:01 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763961; 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=Yde0STqhFuWSqnbcNhKIeKRk8iqowN/06SiP0uOfPq4=; b=SU6jlNxZYrzVUF+BhrZ8O0kV4RV298EDFIk+zEwhdjMDhPCIehCqFhT+WLFX1/0f91U82I beXjvV5kOvK+L3CQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763961; 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=Yde0STqhFuWSqnbcNhKIeKRk8iqowN/06SiP0uOfPq4=; b=KYCNS/lNbIu6/ulD2h52wo+rszh0se0c1Brx0y3W3eBHekr2lfCxs3e7bBZzMOi4XGN8Es KnApPC4++xFhrFDCb26KDuykCHAtYALvEGkMfQKS0QHjqqOLcd0MN5KeZC5nPwdBzgsBIu pDMwVHlvRNW5QF929ozx/QhywfhzItUd25gQShPS/G1yEDPzf+J5tiaYgtDLdojIBHaD1h ICFscWDP6az6oHS2RRVZpCUhcYEcT8ez5cQ/zZo+DUfbTPZZ5NA3J/1Y6zBjpfsaWZaYXV pf+wvr1jrUUT3G+JQlMhAjXqHTWRbs75FsHfPFW0tOv6z6zOB5l1Cyobdc1bbw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 09/19] ovpnclients.dat: Display a notice if there are no entries. Date: Mon, 13 Apr 2020 09:45:40 +0200 Message-Id: <20200413074550.2735-9-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 7 ++++++- langs/en/cgi-bin/en.pl | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index cf3e0e7bc..b84c2b8d7 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -293,8 +293,13 @@ while(my @row = $statement_handle->fetchrow_array()) { # Increase lines count. $lines++; +} - } +# If nothing has been fetched, the amount of lines is still zero. +# In this case display a hint about no data. +unless ($lines) { + print "\n"; +} print "
$Lang::tr{'ovpn connection name'}$Lang::tr{'connected'}$Lang::tr{'disconnected'}$Lang::tr{'recieved'}$Lang::tr{'sent'}$Lang::tr{'total connection time'}\n"; + } + + print "
$connection_name$connection_open_time$connection_close_time$connection_bytes_recieved$connection_bytes_sent$total_time$connection_name$connection_open_time$connection_close_time$connection_bytes_recieved$connection_bytes_sent
$Lang::tr{'no entries'}

\n"; diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1d3b87649..171d24937 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1800,6 +1800,7 @@ 'no alcatelusb firmware' => 'No Alcatel USB firmware. Please upload.', 'no cfg upload' => 'No data was uploaded', 'no dhcp lease' => 'No DHCP lease has been acquired', +'no entries' => 'No entries at the moment.', 'no eciadsl synch.bin file' => 'No ECI ADSL synch.bin file. Please upload.', 'no filter pass' => 'Enter the standard class for non-filtered packets.', 'no fritzdsl driver' => 'No Fritz!DSL driver. Please upload.', From patchwork Mon Apr 13 07:45:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2950 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zv02fsz3yC0 for ; Mon, 13 Apr 2020 07:46:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zf6gH5z2qC; Mon, 13 Apr 2020 07:46:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zf5NhPz2y3R; Mon, 13 Apr 2020 07:46:06 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zc4lxcz30FG for ; Mon, 13 Apr 2020 07:46:04 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zZ1tXVz2jN; Mon, 13 Apr 2020 07:46:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763962; 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=+QJN2YvmOykL+wpu9mrnFaHJxFnyoQXiM7fovOw5cUI=; b=LjLOGlrH1uvAUI+a9FBpaNcHvGOkt1y5zJz18TBq48fngg5bbeZ+SaBgdg3Z7glrJ1KwO1 9VTlskmh6NWlCJAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763962; 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=+QJN2YvmOykL+wpu9mrnFaHJxFnyoQXiM7fovOw5cUI=; b=RKr+CCcsF09Ri9CDt/IdQlerQBgPOG8z9oRfmIxC48g1IGNCiCmuu7Bqqvlrr1BuIem9Ou F7NGWGEcebtpyITfyqLMJDo/QeXV9Ez52I8PxFUc86KCjTbCWQA4nNTTbRxoZqTjKyVYro Y9NkSxXRNDj7++PfVC67yyFYZFd+Xk7f2NklmKguvGGpSCPz5SqzBTWSTwpwJ5JVXO53NG CDjOeSkSAsqdSVvdZI+bqWMT7A2xVffiCNGrW6LXvW7/gT6YzNwX0j9uwu9NPRJSpgnRpX dDWWLB6yALrS2p+7wg9WkNd+GIQwzscPrpcMGCL2WPDvMH2BvlOuzxmoNbHh6w== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 10/19] ovpnclients.dat: Display error when the to date is not later than the from date. Date: Mon, 13 Apr 2020 09:45:41 +0200 Message-Id: <20200413074550.2735-10-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 5 +++++ langs/en/cgi-bin/en.pl | 1 + 2 files changed, 6 insertions(+) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index b84c2b8d7..a83a0bca9 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -90,6 +90,11 @@ my $database_handle = DBI->connect("DBI:SQLite:dbname=$database", "", "", { Rais my $from_datestring = sprintf '%04d-%02d-%02d', ($cgiparams{"FROM_YEAR"}, $cgiparams{"FROM_MONTH"}, $cgiparams{"FROM_DAY"}); my $to_datestring = sprintf '%04d-%02d-%02d', ($cgiparams{"TO_YEAR"}, $cgiparams{"TO_MONTH"}, $cgiparams{"TO_DAY"}); +# Check if the to datestring is later than the from datestring. +unless ($to_datestring ge $from_datestring) { + $errormessage = "$Lang::tr{'error the to date has to be later than the from date'}"; +} + my $database_query = qq( SELECT common_name, SUM( diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 171d24937..3d07473e7 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1012,6 +1012,7 @@ 'error config' => 'Could not open /var/ipfire/ovpn/config/ZERINA.ovpn !', 'error external access' => 'Could not open /var/ipfire/xtaccess/config (external acccess could not be granted)!', 'error messages' => 'Error messages', +'error the to date has to be later than the from date' => 'The to date has to be later than the from date!', 'esp encryption' => 'ESP Encryption:', 'esp grouptype' => 'ESP Grouptype:', 'esp integrity' => 'ESP Integrity:', From patchwork Mon Apr 13 07:45:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2951 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4910zw2b4rz3yBt for ; Mon, 13 Apr 2020 07:46:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zk5TcQz2jN; Mon, 13 Apr 2020 07:46:10 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zk1YVlz30FQ; Mon, 13 Apr 2020 07:46:10 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zd4t44z2yRK for ; Mon, 13 Apr 2020 07:46:05 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zZ5m2wz2Lv; Mon, 13 Apr 2020 07:46:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763963; 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=TgtoPJBIoUYBdU61dybXGsWuX/rKrBuHXyRSQjI+cbU=; b=i/1eD71haH2TxHiX4PAMy+h78VjGII5Ar/NhUaH9uc1AGo3p9K4X2RE3BNZc8Vpl4HoJqr eOKDjP1BNDCAM5CA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763963; 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=TgtoPJBIoUYBdU61dybXGsWuX/rKrBuHXyRSQjI+cbU=; b=gIpf2PG2yzLk9gtI2HNGF0rBxUc3BFzHQUxlf5DSYwfBsEOMGCjFBELF6ssYi6+vw2F4+n 6gRXqFIHQzvhjcjucoAzDGw8KrFZOPCiI1etv7kZhJtxdX+cbrGmTwBObOXQILDAmpFI34 GCRUr0q5Z7nRdGwpPIxZbt/8IelP5Jk7UyIzbv9JWgHs4Pu0b4Dn+iksFzi4hncXI2s4xM RgA7nBjNXvvZ8Yn9AXjhgJDfUv69ayQqjh861WdHBkb68rKYEG1UxMirBjQrlawjvgE8n6 vmhgWMtRF02Fg5sXmA8+pDtTnxOY3lp72lvsnvXOwJC0F2rLD04w3cCinM7rYg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 11/19] ovpnclients.dat: Do not perform DB actions if there is an error message. Date: Mon, 13 Apr 2020 09:45:42 +0200 Message-Id: <20200413074550.2735-11-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 77 +++++++++++++++------------ 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index a83a0bca9..093315a64 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -140,11 +140,17 @@ if ($cgiparams{'CONNECTION_NAME'}) { ); } -# Prepare SQL statement. -my $statement_handle = $database_handle->prepare($database_query); +my $statement_handle; +my $database_return_value; -# Execute SQL statement and get retun value if any error happened. -my $database_return_value = $statement_handle->execute(); +# Only process SQL actions if there is no error message. +unless ($errormessage) { + # Prepare SQL statement. + $statement_handle = $database_handle->prepare($database_query); + + # Execute SQL statement and get retun value if any error happened. + $database_return_value = $statement_handle->execute(); +} # If an error has been returned, assign it to the errorstring value for displaying. if($database_return_value < 0) { @@ -264,44 +270,47 @@ my $col = "bgcolor='$color{'color20'}'"; print "
$connection_name
$connection_name$connection_open_time$connection_close_time$connection_bytes_recieved$connection_bytes_sent$connection_open_time$connection_close_time$connection_bytes_recieved$connection_bytes_sent$total_time$total_time
$Lang::tr{'no entries'}
$Lang::tr{'connected'}$Lang::tr{'disconnected'}$Lang::tr{'recieved'}$Lang::tr{'received'}$Lang::tr{'sent'}$Lang::tr{'total connection time'}\n"; diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 3d07473e7..3675a21ca 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -2106,7 +2106,7 @@ 'reboot sure' => 'Are you sure that you want to reboot?', 'rebooting' => 'Rebooting', 'rebooting ipfire' => 'Rebooting IPFire', -'recieved' => 'Recieved', +'received' => 'Received', 'reconnect' => 'Reconnect', 'reconnection' => 'Reconnection', 'red' => 'Internet', From patchwork Mon Apr 13 07:45:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2956 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 49110371qKz3yBt for ; Mon, 13 Apr 2020 07:46:27 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zm6Mrbz2rD; Mon, 13 Apr 2020 07:46:12 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zm4zZxz2xqq; Mon, 13 Apr 2020 07:46:12 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zg6cVxz2xqq for ; Mon, 13 Apr 2020 07:46:07 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zc2QcWz2nB; Mon, 13 Apr 2020 07:46:04 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763964; 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=7jlaoR32SBF04ZnPGBuq9I7nipGOTRsvuyx59BB3E2g=; b=qbhRFHDxjz7etERkN7P32CqiGcE2WAqLkVXYMP/e7XfiHs+/0uCfz/3g2lPBaDrS2/doJg nTNCA7VDp5Z7TgCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763964; 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=7jlaoR32SBF04ZnPGBuq9I7nipGOTRsvuyx59BB3E2g=; b=YiY5+G19+B/N8nL2206NrxFLoraaiWufaycFIY38PKoQjTtGy5yq77D7ynVRjQd6rfyrbY hRZfXtYO7EA5oujU3gSKu61C/ohDVtBnx13oPAJ8MTyRmZE8c3C7SdCsXzxckm3eg1pcmA zKIv0bNtMM21l5oAGSRGkDE5U29uaYFTMIXEyhJqsQajFH3mJAEywaXJLqWYpbxzkK4bsT 03UynsTdN7RWu5TCM5A59ybykfVw2pyrG+JqayMhfB5vax0J3fQdZwUU4tq+SF5u4v82mg HW2TasPBV3ceDyMsKFcE/QXxuyXwBuxA7vUw/WKHI7VtJepovf5jlg+Fay0dcQ== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 14/19] ovpnclients.dat: Align traffic values to the right side. Date: Mon, 13 Apr 2020 09:45:45 +0200 Message-Id: <20200413074550.2735-14-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- html/cgi-bin/logs.cgi/ovpnclients.dat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/cgi-bin/logs.cgi/ovpnclients.dat b/html/cgi-bin/logs.cgi/ovpnclients.dat index 62b91a054..002a393ad 100755 --- a/html/cgi-bin/logs.cgi/ovpnclients.dat +++ b/html/cgi-bin/logs.cgi/ovpnclients.dat @@ -262,8 +262,8 @@ my $col = "bgcolor='$color{'color20'}'"; if ($cgiparams{'CONNECTION_NAME'}) { print "$Lang::tr{'connected'}$Lang::tr{'disconnected'}$Lang::tr{'received'}$Lang::tr{'sent'}$Lang::tr{'received'}$Lang::tr{'sent'}$Lang::tr{'total connection time'}\n"; } @@ -293,8 +293,8 @@ unless ($errormessage) { if ($cgiparams{'CONNECTION_NAME'}) { print "$connection_open_time$connection_close_time$connection_bytes_recieved$connection_bytes_sent$connection_bytes_recieved$connection_bytes_sent$Lang::tr{'ovpn connection name'}$Lang::tr{'connected'}$Lang::tr{'disconnected'}$Lang::tr{'connected'}$Lang::tr{'disconnected'}$Lang::tr{'duration'}$Lang::tr{'received'}$Lang::tr{'sent'}$connection_name$connection_open_time$connection_close_time$connection_open_time$connection_close_time$duration$connection_bytes_recieved$connection_bytes_sent
$Lang::tr{'no entries'}
$Lang::tr{'no entries'}

\n"; From patchwork Mon Apr 13 07:45:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2957 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4911041kYdz3yC0 for ; Mon, 13 Apr 2020 07:46:28 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zn1ymyz2sF; Mon, 13 Apr 2020 07:46:13 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zn0sjxz30F8; Mon, 13 Apr 2020 07:46:13 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zh5Z0Xz2xqq for ; Mon, 13 Apr 2020 07:46:08 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zf1qdpz2kv; Mon, 13 Apr 2020 07:46:06 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763966; 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=mVjgPrfnc5Im/wXcyelKomnLq3Zbd8Trqu6XswdEVnE=; b=H1AlWgfTOUG56OYr+STlsw2bNUqiII4Y0kGo7VqakBSlAdJBX+JEsysYU85xyeEzOpjAOy LcFGVjjUjcXu0uAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763966; 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=mVjgPrfnc5Im/wXcyelKomnLq3Zbd8Trqu6XswdEVnE=; b=FDIGOd73+IAC2qmY7Y3dN/njD2dcfUMwKqO49qQv3zJj2L8pvdxskNuNy1M3ozlFkjkbea fuNX9/yNDwaNWhDb0eMfAgsIgPbG5NR87nm6ZTRZeZFAkSidA7M022tj9fEWEqbD2sBrk1 uCccU5lR8ZjZvh770fi+EplBnUXYjxnJ14MmaRwNoOVlw2IyuNQxokqBjBPTlCrD3iFl00 oGRZDQSyinIlokYsKHXVOofUs1cxgbuWvrxid4e5y7daWyAI41JMr4VtJwpgTnPWK2LG0s XPG+cL0NCdFHEFZwUDgbRP/OLlYrFYKF+otxBmxP3ouRkRwcXTZYKBmUbr1HfA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 17/19] Add ovpnclients page to log menu. Date: Mon, 13 Apr 2020 09:45:48 +0200 Message-Id: <20200413074550.2735-17-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- config/menu/70-log.menu | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/menu/70-log.menu b/config/menu/70-log.menu index 08973de5a..48c23ccc2 100644 --- a/config/menu/70-log.menu +++ b/config/menu/70-log.menu @@ -43,6 +43,12 @@ 'title' => "$Lang::tr{'ids logs'}", 'enabled' => 1 }; + $sublogs->{'55.ovpnclients'} = { + 'caption' => $Lang::tr{'ovpn rw connection log'}, + 'uri' => '/cgi-bin/logs.cgi/ovpnclients.dat', + 'title' => "$Lang::tr{'ovpn rw connection log'}, + 'enabled' => 1, + }; $sublogs->{'60.urlfilter'} = { 'caption' => $Lang::tr{'urlfilter logs'}, 'uri' => '/cgi-bin/logs.cgi/urlfilter.dat', From patchwork Mon Apr 13 07:45:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2958 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4911050XdGz3yC3 for ; Mon, 13 Apr 2020 07:46:29 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zn48WYz2sL; Mon, 13 Apr 2020 07:46:13 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zn30pnz30FR; Mon, 13 Apr 2020 07:46:13 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zj506Sz30FF for ; Mon, 13 Apr 2020 07:46:09 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zg01b3z2qG; Mon, 13 Apr 2020 07:46:06 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763967; 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=Lei8bXQpozy59fxV74HoRF89rigNBncbh44rA/BEETU=; b=BKew5d3kv2S6fU6JjsbhDp4R+LM8gn7rnOuZgtSDb7WIncJ1pf0BLO3y9MA8msPadRe0Y1 lyPyp0KhUOTBhhBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763967; 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=Lei8bXQpozy59fxV74HoRF89rigNBncbh44rA/BEETU=; b=jChCWT/LU31ca7ghKzgpBoYYG+0n4kH/GPT1lx5AqIY9re5GyhFaUX+jnlbIzLihct2Scu A6dGYz5pyl4meEHcgHYO4bts4LEk6HN2kXT9x3QP0FUSUujUehbr/C5I7x9Qgqwbqtu6rM pYnEoEtDU3F0uGfzjI66sTtBNrQj+2xRwwThpkxnsJC7Ff+Y4u+4sSNYGlyt/Y0tRopZ+T Xs6kAnwu657QTbfYI23l5E7o8v8IayNLdvRrRWLPpQPurqzPrKDcOWYMV3u43BbV1jzi3p 8f0Now2DoVIWK4zSzf5NApQwyZAtbvxpSQWAlIs1GtGCkwa9qqWmJGwVdqizmA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 18/19] Langs/en.pl: Add duration. Date: Mon, 13 Apr 2020 09:45:49 +0200 Message-Id: <20200413074550.2735-18-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- langs/en/cgi-bin/en.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index a1747a654..f9335a0e9 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -936,6 +936,7 @@ 'duplicate ip bold' => 'Duplicate addresses are in bold', 'duplicate mac' => 'Duplicate MAC address entered', 'duplicate name' => 'That name is already being used, please choose another.', +'duration' => 'Duration', 'dyn dns source choice' => 'Dynamic DNS provider(s) will receive an IP address for this IPFire from:', 'dynamic dns' => 'Dynamic DNS', 'dynamic dns client' => 'Dynamic DNS Client', From patchwork Mon Apr 13 07:45:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 2959 Return-Path: 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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 49110C0hXFz3yBt for ; Mon, 13 Apr 2020 07:46:35 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4910zn61b1z2tC; Mon, 13 Apr 2020 07:46:13 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4910zn4w31z30FL; Mon, 13 Apr 2020 07:46:13 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4910zj6GrJz30FM for ; Mon, 13 Apr 2020 07:46:09 +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 ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4910zg4rCKz2jN; Mon, 13 Apr 2020 07:46:07 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586763967; 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=INiUGrlK7PaGURGPh7DngXxqmJyXfnfp8yzvHzR4PlI=; b=wpl99+3BmOSnNkPQDRmIK8Va21ZdVSOGCrIJIJs9rxmlxPjNVxddFXYu6hgO9lxrMLKhki zY4sP892pvSqMwCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586763967; 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=INiUGrlK7PaGURGPh7DngXxqmJyXfnfp8yzvHzR4PlI=; b=YRvItoz4qZgjJUH7Q7lpNSmQ7AodCd4pie7W+mIwt3sjeqkDYlsybSJAM6A39wtEMGcwRy 0x59Ook9ZTSSH49zJwl5yGE6c7hBtJT9MEMWMZXsHna/RWWhnG4yY0sNd5IKBoHu+zD1sG yG59ube303ZwLQGGH8tVPTyBIBn2p0EwIZKxVz9keX7hF1Ncbk6uIU5VaWuu9YS25hUb9S QD3r8byNRLI8418Sv/9b9BogvOCnyrX0dAgeMfYI+I22U21CslPU1YARXYC/P7tJ9YW0Qm IgPG57oFPD+jyNoMilZxDsb7exTONSHvr+2ZYKkHsSFPG7g4bRsG3QC7fJBuwg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 19/19] Langs/de.pl: Add translations for OpenVPN roadwarrior connection log. Date: Mon, 13 Apr 2020 09:45:50 +0200 Message-Id: <20200413074550.2735-19-stefan.schantl@ipfire.org> In-Reply-To: <20200413074550.2735-1-stefan.schantl@ipfire.org> References: <20200413074550.2735-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 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" Signed-off-by: Stefan Schantl --- langs/de/cgi-bin/de.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 80579e7cc..3959e1655 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -792,6 +792,7 @@ 'directory writeable' => 'Verzeichnis schreibbar', 'disabled' => 'deaktiviert', 'disconnect' => 'OVPN Stop / Trennen', +'disconnected' => 'Getrennt', 'disconnects' => 'Abbrüche', 'disk access per' => 'Plattenzugriff je', 'disk usage' => 'Festplattenbelegung', @@ -894,6 +895,7 @@ 'duplicate ip bold' => 'Doppelte Adressen sind fett gedruckt', 'duplicate mac' => 'Doppelte MAC-Adresse eingegeben', 'duplicate name' => 'Dieser Name wird bereits benutzt. Bitte wählen Sie einen anderen.', +'duration' => 'Dauer', 'dyn dns source choice' => 'Dynamic DNS Anbieter werden eine IP-Adresse für diesen IPFire erhalten von:', 'dynamic dns' => 'Dynamischer DNS', 'dynamic dns client' => 'Dynamischer DNS-Client', @@ -1863,6 +1865,7 @@ 'ovpn' => 'OpenVPN', 'ovpn add conf' => 'Erweiterte Konfiguration', 'ovpn con stat' => 'OpenVPN Verbindungs-Statistik', +'ovpn connection name' => 'Verbindungs-Name', 'ovpn config' => 'OVPN-Konfiguration', 'ovpn crypt options' => 'Kryptografieoptionen', 'ovpn device' => 'OpenVPN-Gerät', @@ -1895,6 +1898,7 @@ 'ovpn reneg sec' => 'Sitzungsschlüssellebensdauer', 'ovpn routes push' => 'Routen (eine pro Zeile) z.b. 192.168.10.0/255.255.255.0 192.168.20.0/24', 'ovpn routes push options' => 'Route push Optionen', +'ovpn rw connection log' => 'OpenVPN Roadwarrior Verbindungs-Log', 'ovpn server status' => 'OpenVPN-Server-Status', 'ovpn subnet' => 'OpenVPN-Subnetz:', 'ovpn subnet is invalid' => 'Das OpenVPN-Subnetz ist ungültig.', @@ -2044,6 +2048,7 @@ 'reboot sure' => 'Sind Sie sicher, dass Sie neustarten wollen?', 'rebooting' => 'Starte neu ...', 'rebooting ipfire' => 'Starte IPFire neu', +'recieved' => 'Empfangen', 'reconnect' => 'Neu Verbinden', 'reconnection' => 'Wiederverbindung', 'red' => 'Internet', @@ -2130,6 +2135,7 @@ 'send cr' => 'ISP verlangt Zeilenrücklaufzeichen:', 'send email notification' => 'Aktiviert, E-Mail Benachrichtigung senden', 'send test mail' => 'Sende Testemail', +'sent' => 'Gesendet', 'september' => 'September', 'serial' => 'serielle', 'server reserved' => 'The connection name server is reserved and not allowed', @@ -2373,6 +2379,7 @@ 'tor traffic read written' => 'Gesamter Traffic (empfangen/gesendet)', 'tor use exit nodes' => 'Nur diese Exit-Nodes benutzen (eins pro Zeile)', 'total connection time' => 'Verbindungszeit', +'total connection time' => 'Gesammte Verbindungszeit', 'total hits for log section' => 'Gesamte Treffer für Protokollsektion', 'traffic back' => 'Zurück', 'traffic calc time' => 'Berechnungszeitpunkt',