public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. b679d0a3b4454b3563dac9cfacf659eaca50fb72
@ 2026-12-01 17:20 Michael Tremer
  0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2026-12-01 17:20 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  b679d0a3b4454b3563dac9cfacf659eaca50fb72 (commit)
       via  e716f8f77b274d794aac262bf0265c732833080c (commit)
       via  841215fffcd2bc2a67c9769230463a265a24db31 (commit)
       via  c53a4917db0e3d8ee7d649c234b031b57f54b675 (commit)
       via  c21f3da3622d78767a2a200840fdd9c193d87e3b (commit)
      from  6173acf9351c9c553b356bc82adb8881db0815c5 (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 b679d0a3b4454b3563dac9cfacf659eaca50fb72
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Dec 1 16:42:01 2026 +0000

    fwhosts.cgi: Remove the limit of 15 TCP/UDP services per group
    
    The firewall splits large service groups into multiple rules now, so
    that the number of services in a group does not have to be limited any
    more.
    
    Fixes: #14959
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit e716f8f77b274d794aac262bf0265c732833080c
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Dec 1 16:42:01 2026 +0000

    firewall: Split service groups with many ports into multiple rules
    
    iptables can only match 15 ports in one multiport rule, and port ranges
    count twice. Service groups with more ports than that could not be
    used, and the web user interface refused to add any more services.
    
    The ports of a service group are now split up into as many chunks as
    required, and one rule is created for each of them. This is only done
    for TCP and UDP, and only if the group has too many ports.
    
    Fixes: #14959
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 841215fffcd2bc2a67c9769230463a265a24db31
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Dec 1 16:37:57 2026 +0000

    collectd-migrate.py: Create all data sources of the OpenVPN N2N databases
    
    telemetryd collects the payload of the tunnel in addition to what has
    been sent and received over the network, but collectd has not. The
    migrated databases were missing these data sources until telemetryd has
    written to them for the first time (which migrates them), and the graph
    could not be rendered before that because rrdtool fails with an error
    about the missing data source.
    
    Fixes: #14962
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit c53a4917db0e3d8ee7d649c234b031b57f54b675
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Dec 1 16:25:09 2026 +0000

    red: Write the PPP secrets right before pppd is started
    
    pppd 2.5.4 has started to refuse secrets that are not owned by root or
    that can be accessed by the group or others. The web user interface was
    writing them as nobody, so PPPoE connections could not be established.
    
    The secrets are now written by the red script from the settings of the
    current profile each time before pppd is started. This is also what
    connectd needs when it switches to the backup profile, so that it does
    not have to write them itself any more. The web user interface does not
    write them any more.
    
    Fixes: #14964
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit c21f3da3622d78767a2a200840fdd9c193d87e3b
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Dec 1 16:17:41 2026 +0000

    core208: Migrate the status format of the OpenVPN RW server
    
    The connection status and statistics are only read in the "version 3"
    format since d63f6cadad, but existing systems still have the old format
    in their server.conf until the settings are saved again. All clients
    therefore showed up as disconnected without a graph.
    
    The configuration is migrated and the server is restarted.
    
    Fixes: #14963
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 config/firewall/firewall-lib.pl      | 55 ++++++++++++++++++++++++++++++------
 config/firewall/rules.pl             | 22 +++++++++++++--
 config/rootfiles/core/208/update.sh  |  7 +++++
 config/telemetry/collectd-migrate.py |  5 ++++
 html/cgi-bin/fwhosts.cgi             | 44 -----------------------------
 html/cgi-bin/index.cgi               |  8 +-----
 html/cgi-bin/pppsetup.cgi            | 19 ++-----------
 src/initscripts/networking/red       |  8 ++++++
 src/initscripts/system/connectd      |  3 --
 9 files changed, 89 insertions(+), 82 deletions(-)

Difference in files:
diff --git a/config/firewall/firewall-lib.pl b/config/firewall/firewall-lib.pl
index fa71009a20..1ee1265dc9 100644
--- a/config/firewall/firewall-lib.pl
+++ b/config/firewall/firewall-lib.pl
@@ -125,23 +125,60 @@ sub get_srv_port
 		}
 	}
 }
-sub get_srvgrp_port
+# The maximum weight of the ports that fit into a single multiport match.
+# Port ranges count twice.
+my $MULTIPORT_MAX_WEIGHT = 15;
+
+# Returns all ports of a service group for the given protocol which are split
+# into as many lists as are required so that each of them can be matched by a
+# single iptables rule.
+sub get_srvgrp_port_chunks
 {
 	my $val=shift;
 	my $prot=shift;
-	my $back;
+	my @chunks=();
+	my @ports=();
+	my $weight=0;
 	my $value;
-	my @ips=();
+
 	foreach my $key (sort {$a <=> $b} keys %customservicegrp){
-		if($customservicegrp{$key}[0] eq $val){
-			if ($prot ne 'ICMP'){
-				$value=&get_srv_port($customservicegrp{$key}[2],1,$prot);
-			}elsif ($prot eq 'ICMP'){
-				$value=&get_srv_port($customservicegrp{$key}[2],3,$prot);
+		next unless ($customservicegrp{$key}[0] eq $val);
+
+		if ($prot ne 'ICMP'){
+			$value=&get_srv_port($customservicegrp{$key}[2],1,$prot);
+		}else{
+			$value=&get_srv_port($customservicegrp{$key}[2],3,$prot);
+		}
+		next if ($value eq '');
+
+		# Start a new chunk when this port does not fit in any more
+		if ($prot ne 'ICMP'){
+			my $w = ($value =~ m/:/) ? 2 : 1;
+
+			if ($weight + $w > $MULTIPORT_MAX_WEIGHT){
+				push(@chunks, [ @ports ]);
+				@ports=();
+				$weight=0;
 			}
-			push (@ips,$value) if ($value ne '') ;
+			$weight+=$w;
 		}
+		push(@ports,$value);
 	}
+
+	# There is always at least one chunk (even when it is empty)
+	push(@chunks, [ @ports ]) if (@ports || !@chunks);
+
+	return @chunks;
+}
+sub get_srvgrp_port
+{
+	my $val=shift;
+	my $prot=shift;
+	my $chunk=shift || 0;
+	my $back;
+	my @chunks=&get_srvgrp_port_chunks($val,$prot);
+	my @ips=@{ $chunks[$chunk] || [] };
+
 	if($prot ne 'ICMP'){
 		if ($#ips gt 0){$back="-m multiport --dports ";}else{$back="--dport ";}
 	}elsif ($prot eq 'ICMP'){
diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl
index 36fd8f36c0..6e500ea6c6 100644
--- a/config/firewall/rules.pl
+++ b/config/firewall/rules.pl
@@ -394,7 +394,22 @@ sub buildrules {
 			next;
 		}
 
+		# Service groups with too many ports for one rule are split into
+		# multiple rules which match the same protocol
+		my @protocol_chunks = ();
 		foreach my $protocol (@protocols) {
+			my $chunks = 1;
+
+			if (($protocol ~~ @PROTOCOLS_WITH_PORTS) && ($$hash{$key}[11] eq "ON") && ($$hash{$key}[14] eq "cust_srvgrp")) {
+				$chunks = scalar(&fwlib::get_srvgrp_port_chunks($$hash{$key}[15], uc($protocol)));
+			}
+
+			push(@protocol_chunks, map { [ $protocol, $_ ] } (0 .. $chunks - 1));
+		}
+
+		foreach my $protocol_chunk (@protocol_chunks) {
+			my ($protocol, $chunk) = @$protocol_chunk;
+
 			# Check if the given protocol is supported.
 			if (($protocol ne "all") && (!$protocol ~~ @PROTOCOLS)) {
 				print_error("Protocol $protocol is not supported (rule $key)");
@@ -402,7 +417,7 @@ sub buildrules {
 			}
 
 			# Prepare protocol options (like ICMP types, ports, etc...).
-			my @protocol_options = &get_protocol_options($hash, $key, $protocol, 0);
+			my @protocol_options = &get_protocol_options($hash, $key, $protocol, 0, $chunk);
 
 			# Check if this protocol knows ports.
 			my $protocol_has_ports = ($protocol ~~ @PROTOCOLS_WITH_PORTS);
@@ -517,7 +532,7 @@ sub buildrules {
 						if ($NAT_MODE eq "DNAT") {
 							my @nat_options = ();
 							if ($protocol ne "all") {
-								my @nat_protocol_options = &get_protocol_options($hash, $key, $protocol, 1);
+								my @nat_protocol_options = &get_protocol_options($hash, $key, $protocol, 1, $chunk);
 								push(@nat_options, @nat_protocol_options);
 							}
 
@@ -873,6 +888,7 @@ sub get_protocol_options {
 	my $key  = shift;
 	my $protocol = shift;
 	my $nat_options_wanted = shift;
+	my $chunk = shift || 0;
 	my @options = ();
 
 	# Nothing to do if no protocol is specified.
@@ -914,7 +930,7 @@ sub get_protocol_options {
 				}
 
 			} elsif ($dst_ports_mode eq "cust_srvgrp") {
-				push(@options, split(/ /, &fwlib::get_srvgrp_port($dst_ports, uc($protocol))));
+				push(@options, split(/ /, &fwlib::get_srvgrp_port($dst_ports, uc($protocol), $chunk)));
 			}
 		}
 	}
diff --git a/config/rootfiles/core/208/update.sh b/config/rootfiles/core/208/update.sh
index 6832bcc392..cf725cb0ce 100644
--- a/config/rootfiles/core/208/update.sh
+++ b/config/rootfiles/core/208/update.sh
@@ -400,6 +400,13 @@ sudo -u nobody /srv/web/ipfire/cgi-bin/dhcp.cgi </dev/null >/dev/null
 # Rebuild the firewall rules so that empty groups do not match everything
 /etc/init.d/firewall restart
 
+# The status of the OpenVPN Roadwarrior server is now read in the "version 3"
+# format which is only written once the configuration has been regenerated
+if grep -q "^status-version 1" /var/ipfire/ovpn/server.conf 2>/dev/null; then
+	sed -i -e "s/^status-version 1\$/status-version 3/" /var/ipfire/ovpn/server.conf
+	/etc/init.d/openvpn-rw restart
+fi
+
 # Restart Apache
 /etc/init.d/apache restart
 
diff --git a/config/telemetry/collectd-migrate.py b/config/telemetry/collectd-migrate.py
index fa6321956f..f2845fecae 100644
--- a/config/telemetry/collectd-migrate.py
+++ b/config/telemetry/collectd-migrate.py
@@ -673,6 +673,11 @@ def main():
 		c.add_ds("rx_bytes", "DERIVE", min=0, source=path / "if_octets-traffic.rrd", source_field="rx")
 		c.add_ds("tx_bytes", "DERIVE", min=0, source=path / "if_octets-traffic.rrd", source_field="tx")
 
+		# collectd has not collected what has gone in and out of the tunnel, but
+		# telemetryd needs all data sources to be present to render the graph
+		c.add_ds("rx_payload", "DERIVE", min=0)
+		c.add_ds("tx_payload", "DERIVE", min=0)
+
 		# Write to disk
 		c.write("openvpn-n2n/%s.rrd" % name)
 
diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi
index 9cc6422923..a15c6ee5dd 100644
--- a/html/cgi-bin/fwhosts.cgi
+++ b/html/cgi-bin/fwhosts.cgi
@@ -843,53 +843,9 @@ if ($fwhostsettings{'ACTION'} eq 'saveservice')
 }
 if ($fwhostsettings{'ACTION'} eq 'saveservicegrp')
 {
-	my $prot;
-	my $port;
-	my $tcpcounter=0;
-	my $udpcounter=0;
 	&General::readhasharray("$configsrvgrp", \%customservicegrp );
 	&General::readhasharray("$configsrv", \%customservice );
 	$errormessage=&checkservicegroup;
-	#Check if we have more than 15 services from one Protocol in the group
-	#iptables can only handle 15 ports/portranges via multiport
-	foreach my $key (keys %customservicegrp){
-		if($customservicegrp{$key}[0] eq $fwhostsettings{'SRVGRP_NAME'}){
-			foreach my $key1 (keys %customservice){
-				$tcpcounter++ if $customservice{$key1}[2] eq 'TCP' && $customservicegrp{$key}[2] eq $customservice{$key1}[0];
-				$tcpcounter++ if $customservice{$key1}[2] eq 'TCP' && $customservicegrp{$key}[2] eq $customservice{$key1}[0] && $customservice{$key1}[1] =~m/:/i;
-				$udpcounter++ if $customservice{$key1}[2] eq 'UDP' && $customservicegrp{$key}[2] eq $customservice{$key1}[0];
-				$udpcounter++ if $customservice{$key1}[2] eq 'UDP' && $customservicegrp{$key}[2] eq $customservice{$key1}[0] && $customservice{$key1}[1] =~m/:/i;
-			}
-		}
-	}
-
-	# Loop through the hash of configured services.
-	foreach my $key (keys %customservice) {
-		# Assign nice human-readable values.
-		my $service_name = $customservice{$key}[0];
-		my $service_port = $customservice{$key}[1];
-		my $service_proto = $customservice{$key}[2];
-
-		# Skip services unless the processed one has found.
-		next unless $service_name eq $fwhostsettings{'CUST_SRV'};
-
-		# Increase the counters.
-		$tcpcounter++ if $service_proto eq 'TCP';
-		$tcpcounter++ if $service_proto eq 'TCP' && $service_port =~ m/:/i;
-		$udpcounter++ if $service_proto eq 'UDP';
-		$udpcounter++ if $service_proto eq 'UDP' && $service_port =~ m/:/i;
-	}
-
-	if ($tcpcounter > 15) {
-		$errormessage=_('The maximal number of 15 TCP services has been reached in this group (port ranges count twice)');
-		&UI::Validate::mark("CUST_SRV");
-	}
-	if ($udpcounter > 15) {
-		$errormessage=_('The maximal number of 15 UDP services has been reached in this group (port ranges count twice)');
-		&UI::Validate::mark("CUST_SRV");
-	}
-	$tcpcounter=0;
-	$udpcounter=0;
 	#check remark
 	$errormessage .= "<br>$_" foreach (&UI::Validate::check(\%fwhostsettings, $servicegrouprules));
 	&UI::Validate::mark("newsrvrem") if (&UI::Validate::invalid("SRVGRP_REMARK"));
diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi
index 26d4a4b165..519e27373a 100644
--- a/html/cgi-bin/index.cgi
+++ b/html/cgi-bin/index.cgi
@@ -115,7 +115,7 @@ if ($cgiparams{'ACTION'} eq _('Connect With Profile'))
 	link("${General::swroot}/ppp/settings-$cgiparams{'PROFILE'}",
 		"${General::swroot}/ppp/settings");
 	&General::touch("${General::swroot}/ppp/updatesettings");
-	# read in the new params "early" so we can write secrets.
+	# read in the new params "early".
 	%cgiparams = ();
 	&General::readhash("${General::swroot}/ppp/settings", \%cgiparams);
 	$cgiparams{'PROFILE'} = $profile;
@@ -123,12 +123,6 @@ if ($cgiparams{'ACTION'} eq _('Connect With Profile'))
 	&General::writehash("${General::swroot}/ppp/settings-$cgiparams{'PROFILE'}",
 		\%cgiparams);
 
-	# write secrets file.
-	my $username = $cgiparams{'USERNAME'};
-	my $password = $cgiparams{'PASSWORD'};
-	&General::write_file("/${General::swroot}/ppp/secrets", { mode => 0600 }, "'$username' * '$password'\n")
-		or die "Unable to write secrets file.";
-
 	&General::log("@{[ _('Profile Made Current:') ]} $tempcgiparams{'PROFILENAME'}");
 	$cgiparams{'ACTION'} = _('Connect');
 }
diff --git a/html/cgi-bin/pppsetup.cgi b/html/cgi-bin/pppsetup.cgi
index 2e3c55187f..8578c497a9 100644
--- a/html/cgi-bin/pppsetup.cgi
+++ b/html/cgi-bin/pppsetup.cgi
@@ -221,9 +221,8 @@ ERROR:
                 &General::writehash("${General::swroot}/ppp/settings-$pppsettings{'PROFILE'}",
                         \%pppsettings);
 
-                # make link and write secret file.
+                # make link.
                 &updatesettings();
-                &writesecrets();
 
                 &General::log("@{[ _('Profile Saved:') ]} $pppsettings{'PROFILENAME'}");
         }
@@ -239,15 +238,13 @@ if ($pppsettings{'ACTION'} eq _('Select'))
         # make link.
         &updatesettings();
 
-        # read in the new params "early" so we can write secrets.
+        # read in the new params "early".
         %pppsettings = ();
         &General::readhash("${General::swroot}/ppp/settings", \%pppsettings);
         $pppsettings{'PROFILE'} = $profile;
         &General::writehash("${General::swroot}/ppp/settings-$pppsettings{'PROFILE'}",
                 \%pppsettings);
 
-        &writesecrets();
-
         &General::log("@{[ _('Profile Made Current:') ]} $pppsettings{'PROFILENAME'}");
 }
 elsif ($pppsettings{'ACTION'} eq _('Delete'))
@@ -265,7 +262,7 @@ elsif ($pppsettings{'ACTION'} eq _('Delete'))
         # make link.
         &updatesettings();
 
-        # read in the new params "early" so we can write secrets.
+        # read in the new params "early".
         %pppsettings = ();
         &General::readhash("${General::swroot}/ppp/settings", \%pppsettings);
         $pppsettings{'PROFILE'} = $profile;
@@ -552,16 +549,6 @@ sub updatesettings
 	&General::touch("${General::swroot}/ppp/updatesettings");
 }
 
-sub writesecrets
-{
-        # write secrets file.
-        my $file = "${General::swroot}/ppp/secrets";
-        my $username = $pppsettings{'USERNAME'};
-        my $password = $pppsettings{'PASSWORD'};
-
-        &General::write_file($file, { mode => 0600 }, "'$username' * '$password'\n") or die "Unable to write secrets file.";
-}
-
 sub initprofile
 {
         $pppsettings{'PROFILENAME'} = _('Unnamed');
diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red
index 06dc5361ba..165ed87278 100644
--- a/src/initscripts/networking/red
+++ b/src/initscripts/networking/red
@@ -470,6 +470,14 @@ case "${1}" in
 				METHOD=""
 			fi
 
+			### Secrets
+			#
+			# pppd refuses to use the secrets if they are not owned by root or if
+			# they can be accessed by the group or others. Therefore they are
+			# written here and not by the web user interface.
+			rm -f /var/ipfire/ppp/secrets
+			(umask 077; echo "'${USERNAME}' * '${PASSWORD}'" > /var/ipfire/ppp/secrets)
+
 			### Run everything
 			#
 			if [ "$METHOD" == "PPPOE_PLUGIN" ]; then
diff --git a/src/initscripts/system/connectd b/src/initscripts/system/connectd
index d956c2847a..267ade4a4b 100644
--- a/src/initscripts/system/connectd
+++ b/src/initscripts/system/connectd
@@ -84,9 +84,6 @@ case "$1" in
 				rm -f /var/ipfire/ppp/settings
 				cp "/var/ipfire/ppp/settings-${BACKUPPROFILE}" /var/ipfire/ppp/settings
 				msg_log "Switched to backup profile ${BACKUPPROFILE}"
-				# to be shure the right secrets are used
-        eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings-${BACKUPPROFILE})
-        echo "'$USERNAME' * '$PASSWORD'" > /var/ipfire/ppp/secrets
 			else
 				msg_log "No backup profile given. Exiting."
 				exit 0


hooks/post-receive
--
IPFire 2.x development tree


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-01 17:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 17:20 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. b679d0a3b4454b3563dac9cfacf659eaca50fb72 Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox