* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. a90be563d2bc23f32e385961e0e1c34fb14e2436
@ 2026-11-29 15:33 Michael Tremer
0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2026-11-29 15:33 UTC (permalink / raw)
To: ipfire-scm
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via a90be563d2bc23f32e385961e0e1c34fb14e2436 (commit)
via 105f0cae415c1020504c39cf8aa31b04676e99fd (commit)
from 9cf1ac083d4dd56095416e67bb65b281f102a88b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a90be563d2bc23f32e385961e0e1c34fb14e2436
Author: Matthias Fischer <matthias.fischer@ipfire.org>
Date: Sat Nov 28 18:07:09 2026 +0100
summary.dat (logs.cgi): Added translation for 'lm_sensors output'
Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
commit 105f0cae415c1020504c39cf8aa31b04676e99fd
Author: Michael Tremer <michael.tremer@ipfire.org>
Date: Sun Nov 29 14:57:40 2026 +0000
ovpnmain.cgi: Group the connections by their IP address pool again
A single list of all connections ordered by their name makes it hard to
see which connections belong to a pool, and when one of the pools does
not work.
This shows one table for each pool again: the dynamic pool first, then
the static pools by their name and the N2N connections last. The title
of each table has the name and the network of the pool. The Subnet
column is gone because it would only repeat the title.
Fixes: #13908
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
html/cgi-bin/logs.cgi/summary.dat | 1 +
html/cgi-bin/ovpnmain.cgi | 267 ++++++++++++++++++++++----------------
2 files changed, 157 insertions(+), 111 deletions(-)
Difference in files:
diff --git a/html/cgi-bin/logs.cgi/summary.dat b/html/cgi-bin/logs.cgi/summary.dat
index e7ccae13ab..4622c5d695 100644
--- a/html/cgi-bin/logs.cgi/summary.dat
+++ b/html/cgi-bin/logs.cgi/summary.dat
@@ -143,6 +143,7 @@ my %sections = (
'httpd' => _('HTTP Server'),
'init' => _('Init'),
'kernel' => _('Kernel and Firewall'),
+ 'lm_sensors output' => _('Sensors:'),
'modprobe' => _('Module Loader'),
'pam_unix' => _('Local User Logins'),
'sshd' => _('Remote User Logins'),
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index 4b8498f5df..f5dedb3ad5 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -4525,147 +4525,192 @@ if ($cgiparams{'TYPE'} eq 'net') {
&Header::closebox();
&Header::openbox('100%', 'LEFT', _('Connection Status and -Control'));
- my $table = UI::Table->new(
- columns => [
- { title => _('Name'), row_header => 1 },
- { title => _('Type'), align => "center" },
- { title => _('Remark') },
- { title => _('Subnet'), align => "center" },
- { title => _('Status') },
- ],
- legend => 0,
- );
+ # Load the static IP address pools
+ my %ccdconfhash = ();
+ &General::readhasharray("${General::swroot}/ovpn/ccd.conf", \%ccdconfhash);
- foreach my $key (sort { ncmp ($confighash{$a}[1],$confighash{$b}[1]) } keys %confighash) {
- my $status = $confighash{$key}[0];
- my $name = $confighash{$key}[1];
- my $type = $confighash{$key}[3];
+ my %subnets = map { $ccdconfhash{$_}[0] => $ccdconfhash{$_}[1] } keys %ccdconfhash;
- my %types = (
- 'host' => _('Host'),
- 'net' => _('Net'),
- );
+ # Group the connections by the pool they get their address from
+ my %groups = ();
- # Create some simple booleans to check the status
- my $hasExpired = 0;
- my $expiresSoon = 0;
+ foreach my $key (keys %confighash) {
+ my $pool = $confighash{$key}[32];
- # Fetch information about the certificate for non-N2N connections only
- if ($confighash{$key}[3] ne 'net') {
- my @cavalid = &General::system_output("/usr/bin/openssl", "x509", "-text",
- "-in", "${General::swroot}/ovpn/certs/$confighash{$key}[1]cert.pem");
+ # N2N connections do not use any pool, all others use the dynamic pool by default
+ if ($pool eq "") {
+ $pool = ($confighash{$key}[3] eq "net") ? "n2n" : "dynamic";
+ }
- my $expiryDate = 0;
+ push(@{ $groups{$pool} }, $key);
+ }
- # Parse the certificate information
- foreach my $line (@cavalid) {
- if ($line =~ /Not After : (.*)[\n]/) {
- $expiryDate = &Date::Parse::str2time($1);
- last;
- }
- }
+ # Show the dynamic pool first, then the static pools and the N2N connections last
+ my @pools = (
+ grep({ $_ eq "dynamic" } keys %groups),
+ sort({ ncmp($a, $b) } grep({ $_ ne "dynamic" && $_ ne "n2n" } keys %groups)),
+ grep({ $_ eq "n2n" } keys %groups),
+ );
- # Calculate the remaining time
- my $remainingTime = $expiryDate - time();
+ # Show an empty table if there are no connections
+ push(@pools, "") unless (@pools);
- # Determine whether the certificate has already expired, or will so soon
- $hasExpired = ($remainingTime <= 0);
- $expiresSoon = ($remainingTime <= 30 * 24 * 3600);
- }
+ my $table;
- # Show the name of the connection
- my $title = $name;
+ foreach my $pool (@pools) {
+ $table = UI::Table->new(
+ columns => [
+ { title => _('Name'), row_header => 1 },
+ { title => _('Type'), align => "center" },
+ { title => _('Remark') },
+ { title => _('Status') },
+ ],
+ legend => 0,
+ );
- if ($hasExpired) {
- $title .= " (" . _('Expired') . ")";
- } elsif ($expiresSoon) {
- $title .= " (" . _('Expires Soon') . ")";
+ my $heading = "";
+
+ if ($pool eq "dynamic") {
+ $heading = _('Dynamic OpenVPN IP Address Pool');
+ $heading .= " ($vpnsettings{'DOVPN_SUBNET'})" if ($vpnsettings{'DOVPN_SUBNET'});
+ } elsif ($pool eq "n2n") {
+ $heading = _('OpenVPN Net-to-Net');
+ } elsif ($pool ne "") {
+ $heading = $pool;
+ $heading .= " ($subnets{$pool})" if ($subnets{$pool});
}
- my $connstatus = "DISCONNECTED";
+ foreach my $key (sort { ncmp ($confighash{$a}[1],$confighash{$b}[1]) } @{ $groups{$pool} || [] }) {
+ my $status = $confighash{$key}[0];
+ my $name = $confighash{$key}[1];
+ my $type = $confighash{$key}[3];
+
+ my %types = (
+ 'host' => _('Host'),
+ 'net' => _('Net'),
+ );
- # Disabled Connections
- if ($status eq "off") {
- $connstatus = "DISABLED";
+ # Create some simple booleans to check the status
+ my $hasExpired = 0;
+ my $expiresSoon = 0;
- # N2N Connections
- } elsif ($type eq "net") {
- if (-e "/var/run/${name}n2n.pid") {
- my $port = $confighash{$key}[22];
+ # Fetch information about the certificate for non-N2N connections only
+ if ($confighash{$key}[3] ne 'net') {
+ my @cavalid = &General::system_output("/usr/bin/openssl", "x509", "-text",
+ "-in", "${General::swroot}/ovpn/certs/$confighash{$key}[1]cert.pem");
- if ($port ne "") {
- $connstatus = &OpenVPN::n2n_status($port);
+ my $expiryDate = 0;
+
+ # Parse the certificate information
+ foreach my $line (@cavalid) {
+ if ($line =~ /Not After : (.*)[\n]/) {
+ $expiryDate = &Date::Parse::str2time($1);
+ last;
+ }
}
+
+ # Calculate the remaining time
+ my $remainingTime = $expiryDate - time();
+
+ # Determine whether the certificate has already expired, or will so soon
+ $hasExpired = ($remainingTime <= 0);
+ $expiresSoon = ($remainingTime <= 30 * 24 * 3600);
}
- # RW Connections
- } elsif ($type eq "host") {
- if (grep { $_->{'Common Name'} eq $confighash{$key}[2] } @{ $status{'clients'} }) {
- $connstatus = "CONNECTED";
+ # Show the name of the connection
+ my $title = $name;
+
+ if ($hasExpired) {
+ $title .= " (" . _('Expired') . ")";
+ } elsif ($expiresSoon) {
+ $title .= " (" . _('Expires Soon') . ")";
}
- }
- my %states = (
- "DISABLED" => [ "is-disabled", _('DISCONNECTED') ],
- "CONNECTED" => [ "is-connected", _('CONNECTED') ],
- "DISCONNECTED" => [ "is-disconnected", _('DISCONNECTED') ],
- );
+ my $connstatus = "DISCONNECTED";
- my ($class, $state) = @{ $states{$connstatus} || [ "is-unknown", $connstatus ] };
+ # Disabled Connections
+ if ($status eq "off") {
+ $connstatus = "DISABLED";
- # Link to the graph of this connection
- my $graph = "";
+ # N2N Connections
+ } elsif ($type eq "net") {
+ if (-e "/var/run/${name}n2n.pid") {
+ my $port = $confighash{$key}[22];
- if ($type eq "host") {
- $graph = &Graphs::icon("OpenVPNClientThroughput", $confighash{$key}[2]);
- } elsif ($type eq "net") {
- $graph = &Graphs::icon("OpenVPNNetToNetThroughput", $confighash{$key}[1]);
- }
+ if ($port ne "") {
+ $connstatus = &OpenVPN::n2n_status($port);
+ }
+ }
- my @actions = (
- $graph ? { html => $graph } : undef,
- { action => _('Download Client Configuration'), image => 'vpn', title => _('Download Client Configuration'), hidden => { KEY => $key } },
- );
+ # RW Connections
+ } elsif ($type eq "host") {
+ if (grep { $_->{'Common Name'} eq $confighash{$key}[2] } @{ $status{'clients'} }) {
+ $connstatus = "CONNECTED";
+ }
+ }
- # Show Certificate
- if ($confighash{$key}[4] eq 'cert') {
- push(@actions, { action => _('Show File'), image => "info", title => _('Show File'), hidden => { KEY => $key } });
- } else {
- push(@actions, undef);
- }
+ my %states = (
+ "DISABLED" => [ "is-disabled", _('DISCONNECTED') ],
+ "CONNECTED" => [ "is-connected", _('CONNECTED') ],
+ "DISCONNECTED" => [ "is-disconnected", _('DISCONNECTED') ],
+ );
- # Show OTP QR code
- if ($confighash{$key}[43] eq 'on') {
- push(@actions, { action => _('Show OTP QRCode'), image => 'qr-code', title => _('Show OTP QRCode'), hidden => { KEY => $key } });
- } else {
- push(@actions, undef);
- }
+ my ($class, $state) = @{ $states{$connstatus} || [ "is-unknown", $connstatus ] };
- # Download Certificate
- if ($confighash{$key}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$key}[1].p12") {
- push(@actions, { action => _('Download PKCS12 File'), image => "download", title => _('Download PKCS12 File'), hidden => { KEY => $key } });
- } elsif ($confighash{$key}[4] eq 'cert') {
- push(@actions, { action => _('Download File'), image => "download", title => _('Download File'), hidden => { KEY => $key } });
- } else {
- push(@actions, undef);
- }
+ # Link to the graph of this connection
+ my $graph = "";
- push(@actions,
- { action => _('Enable or Disable'), image => ($status eq 'on') ? "on" : "off", title => _('Enable or Disable'), hidden => { KEY => $key } },
- { action => _('Edit'), image => "edit", hidden => { KEY => $key } },
- { action => _('Remove'), image => "remove", hidden => { KEY => $key } },
- );
+ if ($type eq "host") {
+ $graph = &Graphs::icon("OpenVPNClientThroughput", $confighash{$key}[2]);
+ } elsif ($type eq "net") {
+ $graph = &Graphs::icon("OpenVPNNetToNetThroughput", $confighash{$key}[1]);
+ }
- $table->add_row([
- $title,
- $types{$type},
- $confighash{$key}[25],
- $confighash{$key}[32],
- { text => $state, class => "status $class" },
- ], actions => \@actions, highlight => ($hasExpired || $expiresSoon));
- }
+ my @actions = (
+ $graph ? { html => $graph } : undef,
+ { action => _('Download Client Configuration'), image => 'vpn', title => _('Download Client Configuration'), hidden => { KEY => $key } },
+ );
- print $table->render();
+ # Show Certificate
+ if ($confighash{$key}[4] eq 'cert') {
+ push(@actions, { action => _('Show File'), image => "info", title => _('Show File'), hidden => { KEY => $key } });
+ } else {
+ push(@actions, undef);
+ }
+
+ # Show OTP QR code
+ if ($confighash{$key}[43] eq 'on') {
+ push(@actions, { action => _('Show OTP QRCode'), image => 'qr-code', title => _('Show OTP QRCode'), hidden => { KEY => $key } });
+ } else {
+ push(@actions, undef);
+ }
+
+ # Download Certificate
+ if ($confighash{$key}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$key}[1].p12") {
+ push(@actions, { action => _('Download PKCS12 File'), image => "download", title => _('Download PKCS12 File'), hidden => { KEY => $key } });
+ } elsif ($confighash{$key}[4] eq 'cert') {
+ push(@actions, { action => _('Download File'), image => "download", title => _('Download File'), hidden => { KEY => $key } });
+ } else {
+ push(@actions, undef);
+ }
+
+ push(@actions,
+ { action => _('Enable or Disable'), image => ($status eq 'on') ? "on" : "off", title => _('Enable or Disable'), hidden => { KEY => $key } },
+ { action => _('Edit'), image => "edit", hidden => { KEY => $key } },
+ { action => _('Remove'), image => "remove", hidden => { KEY => $key } },
+ );
+
+ $table->add_row([
+ $title,
+ $types{$type},
+ $confighash{$key}[25],
+ { text => $state, class => "status $class" },
+ ], actions => \@actions, highlight => ($hasExpired || $expiresSoon));
+ }
+
+ print "<p><strong>" . &Header::escape($heading) . "</strong></p>\n" if ($heading);
+ print $table->render();
+ }
# Show controls
print UI::Form::button_bar(
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-29 15:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 15:33 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. a90be563d2bc23f32e385961e0e1c34fb14e2436 Michael Tremer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox