* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. e1392101d1f0483a12d777c7b9da773852a4be0f
@ 2026-03-09 10:44 Michael Tremer
0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2026-03-09 10:44 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 e1392101d1f0483a12d777c7b9da773852a4be0f (commit)
via c50eb77f0521ef530a54390953bbd57bb477271f (commit)
via 76117e520295cef91951995b6e533820b20002ba (commit)
via 97e8639c68c9f44b92a2a23e9343d4ce63ab13a8 (commit)
via 710c51b525c47904f8d8038e3190fcf400d142b4 (commit)
from 92b0883545200119c9403dd516084fed388201a0 (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 e1392101d1f0483a12d777c7b9da773852a4be0f
Author: Michael Tremer <michael.tremer@ipfire.org>
Date: Mon Mar 9 10:43:42 2026 +0000
dnsbl: Add the games category
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
commit c50eb77f0521ef530a54390953bbd57bb477271f
Author: Michael Tremer <michael.tremer@ipfire.org>
Date: Mon Mar 9 10:41:47 2026 +0000
core201: Ship perl-Net-LibIDN2
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
commit 76117e520295cef91951995b6e533820b20002ba
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date: Sun Mar 8 18:31:43 2026 +0100
web-user-interface: Rootfile update
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
commit 97e8639c68c9f44b92a2a23e9343d4ce63ab13a8
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date: Sun Mar 8 18:31:15 2026 +0100
dnsbl.cgi: Add support for IDN
Use the LibIDN2 perl module to convert international domain names
in the custom allow and block list, into the idn ascii format (punnycode).
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
commit 710c51b525c47904f8d8038e3190fcf400d142b4
Author: Stefan Schantl <stefan.schantl@ipfire.org>
Date: Sun Mar 8 18:31:14 2026 +0100
perl-Net-LibIDN2: New package
This perl package provides C bindings to the libidn2,
and can be used to convert international domain names into
the "idn ascii" format and vice versa.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
.../{perl-Convert-UUlib => perl-Net-LibIDN2} | 12 +-
config/rootfiles/common/web-user-interface | 1 +
.../rootfiles/core/201/filelists/perl-Net-LibIDN2 | 1 +
config/unbound/dnsbl.json | 7 ++
html/cgi-bin/dnsbl.cgi | 122 ++++++++++++++++++---
lfs/{meson => perl-Net-LibIDN2} | 12 +-
make.sh | 1 +
7 files changed, 128 insertions(+), 28 deletions(-)
copy config/rootfiles/common/{perl-Convert-UUlib => perl-Net-LibIDN2} (67%)
create mode 120000 config/rootfiles/core/201/filelists/perl-Net-LibIDN2
copy lfs/{meson => perl-Net-LibIDN2} (89%)
Difference in files:
diff --git a/config/rootfiles/common/perl-Net-LibIDN2 b/config/rootfiles/common/perl-Net-LibIDN2
new file mode 100644
index 000000000..1d23bd083
--- /dev/null
+++ b/config/rootfiles/common/perl-Net-LibIDN2
@@ -0,0 +1,6 @@
+usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/Net/LibIDN2.pm
+#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Net/LibIDN2
+#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Net/LibIDN2/.packlist
+#usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Net/LibIDN2/LibIDN2.bs
+usr/lib/perl5/site_perl/5.36.0/xxxMACHINExxx-linux-thread-multi/auto/Net/LibIDN2/LibIDN2.so
+#usr/share/man/man3/Net::LibIDN2.3
diff --git a/config/rootfiles/common/web-user-interface b/config/rootfiles/common/web-user-interface
index 29fb52c28..9aaf0db8f 100644
--- a/config/rootfiles/common/web-user-interface
+++ b/config/rootfiles/common/web-user-interface
@@ -14,6 +14,7 @@ srv/web/ipfire/cgi-bin/credits.cgi
srv/web/ipfire/cgi-bin/ddns.cgi
srv/web/ipfire/cgi-bin/dhcp.cgi
srv/web/ipfire/cgi-bin/dns.cgi
+srv/web/ipfire/cgi-bin/dnsbl.cgi
srv/web/ipfire/cgi-bin/dnsforward.cgi
srv/web/ipfire/cgi-bin/extrahd.cgi
srv/web/ipfire/cgi-bin/fireinfo.cgi
diff --git a/config/rootfiles/core/201/filelists/perl-Net-LibIDN2 b/config/rootfiles/core/201/filelists/perl-Net-LibIDN2
new file mode 120000
index 000000000..7e3383cb4
--- /dev/null
+++ b/config/rootfiles/core/201/filelists/perl-Net-LibIDN2
@@ -0,0 +1 @@
+../../../common/perl-Net-LibIDN2
\ No newline at end of file
diff --git a/config/unbound/dnsbl.json b/config/unbound/dnsbl.json
index a6636a92b..b4fb33c55 100644
--- a/config/unbound/dnsbl.json
+++ b/config/unbound/dnsbl.json
@@ -27,6 +27,13 @@
"description" : "Blocks domains related to online gambling and betting",
"license" : "CC BY-SA 4.0"
},
+ {
+ "name" : "Games",
+ "zone" : "games.rpz.ipfire.org",
+ "primary" : "primary.dbl.ipfire.org",
+ "description" : "Blocks online gaming websites",
+ "license" : "CC BY-SA 4.0"
+ },
{
"name" : "Malware",
"zone" : "malware.rpz.ipfire.org",
diff --git a/html/cgi-bin/dnsbl.cgi b/html/cgi-bin/dnsbl.cgi
index e81b144c2..16e6dded2 100644
--- a/html/cgi-bin/dnsbl.cgi
+++ b/html/cgi-bin/dnsbl.cgi
@@ -21,6 +21,7 @@
use strict;
use JSON::PP;
+use Net::LibIDN2 ':all';
# enable only the following on debugging purpose
#use warnings;
@@ -168,6 +169,8 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") {
} elsif ($cgiparams{'CUSTOM_DOMAINS'} eq "$Lang::tr{'save'}") {
my @cgi_allowed_domains;
my @cgi_blocked_domains;
+ my @ascii_allowed_domains;
+ my @ascii_blocked_domains;
# Get the current configured custom domains to allow or block
&readsettings("$custom_domains_file", \%custom_domains) if (-f "$custom_domains_file");
@@ -184,36 +187,32 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") {
@cgi_allowed_domains = &General::uniq(@cgi_allowed_domains);
@cgi_blocked_domains = &General::uniq(@cgi_blocked_domains);
+ # Check domains and convert into ascii format.
+ @ascii_allowed_domains = &format_domains(\@cgi_allowed_domains, "ascii");
+ @ascii_blocked_domains = &format_domains(\@cgi_blocked_domains, "ascii");
+
# Merge temporary merge both arrays for duplicate and valid check.
- my @merged = (@cgi_allowed_domains, @cgi_blocked_domains);
+ my @ascii_merged = (@ascii_allowed_domains, @ascii_blocked_domains);
# Check if there are duplicate entries on the merged list.
# This assumes a domain which has been entered on both
- my $dup = &check_for_duplicates(@merged);
+ my $dup = &check_for_duplicates(@ascii_merged);
# If a duplicate has been found, raise an error
if ($dup) {
push(@errormessages, "$dup - $Lang::tr{'dnsbl error domain specified twice'}");
}
- # Loop through the arrays and check for valid domains and duplicates
- foreach my $domain (@merged) {
- # Check if the domain is valid
- unless (&General::validdomainname($domain)) {
- push(@errormessages, "$domain - $Lang::tr{'invalid domain name'}");
- }
- }
-
# Check if a domain from the posted blocked domains array is allready part of
# the saved allowed domains array
- $dup = &compare_arrays(\@custom_allowed_domains, \@cgi_blocked_domains);
+ $dup = &compare_arrays(\@custom_allowed_domains, \@ascii_blocked_domains);
if ($dup) {
push(@errormessages, "$dup - $Lang::tr{'dnsbl error domain specified twice'}");
}
# Check if a domain from the posted allowed domains array is allready part of
# the saved blocked domains array.
- $dup = &compare_arrays(\@custom_blocked_domains, \@cgi_allowed_domains);
+ $dup = &compare_arrays(\@custom_blocked_domains, \@ascii_allowed_domains);
if ($dup) {
push(@errormessages, "$dup - $Lang::tr{'dnsbl error domain specified twice'}");
}
@@ -222,11 +221,11 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") {
my %tmp;
# Assign the allowed and blocked domain arrays to the temporary hash
- foreach my $domain (@cgi_allowed_domains) {
+ foreach my $domain (@ascii_allowed_domains) {
$tmp{$domain} = [ "allowed" ];
}
- foreach my $domain (@cgi_blocked_domains) {
+ foreach my $domain (@ascii_blocked_domains) {
$tmp{$domain} = [ "blocked" ];
}
@@ -271,9 +270,9 @@ sub show_mainpage() {
my $status = $custom_domains{$domain}[0];
if ($status eq "allowed") {
- push(@custom_allowed_domains, $domain);
+ push(@custom_allowed_domains, &format_domain_to_unicode($domain));
} elsif ($status eq "blocked") {
- push(@custom_blocked_domains, $domain);
+ push(@custom_blocked_domains, &format_domain_to_unicode($domain));
}
}
}
@@ -539,3 +538,94 @@ sub compare_arrays (\@\@) {
}
}
}
+
+sub format_domains(\@$) {
+ my ($arrayref, $format) = @_;
+ my @formated_domains;
+
+ # Deref and assign array.
+ my @domains = @{ $arrayref };
+
+ # Exit if not data passed.
+ return unless (@domains);
+
+ # Loop through the given domains array.
+ foreach my $domain (@domains) {
+ my $formated_domain;
+
+ # Check the output format and convert the domain into requested format.
+ if ($format eq "ascii") {
+ $formated_domain = &format_domain_to_ascii($domain);
+ } elsif ($format eq "unicode") {
+ $formated_domain = &format_domain_to_unicode($domain);
+ } else {
+ # Unknown format requested.
+ return;
+ }
+
+ # Check if the domain could be converted.
+ if ($formated_domain) {
+ # Add the converted domain to the array of ascii domains.
+ push(@formated_domains, $formated_domain);
+ } else {
+ # Add the invalid domain to the array of error messages.
+ push(@errormessages, "$domain - $Lang::tr{'invalid domain name'}");
+ }
+ }
+
+ return @formated_domains;
+}
+
+sub format_domain_to_ascii($) {
+ my ($domain) = @_;
+ my $ascii;
+ my $ret;
+
+ # Early exit on empty input.
+ return unless($domain);
+
+ # Spit the given domain name into parts.
+ my @parts = split(/\./, $domain);
+
+ # Exit if the given domain does not contain at least one dot.
+ return if(scalar(@parts) < 2);
+
+ # Use the perl module to convert the domain into the idn ascii format.
+ $ascii = &Net::LibIDN2::idn2_to_ascii_8($domain, "", $ret);
+
+ # Check if an error occured.
+ if ($ret) {
+ # Get the error message.
+ my $error = &Net::LibIDN2::idn2_strerror($ret);
+
+ push(@errormessages, "$domain - LibIDN2: $error");
+ }
+
+ # Exit if the given domain could not be converted.
+ return unless($ascii);
+
+ # Return the converted domain.
+ return $ascii;
+}
+
+sub format_domain_to_unicode($) {
+ my ($ascii) = @_;
+ my $unicode;
+ my $ret;
+
+ # Exit if no input has been given.
+ return unless($ascii);
+
+ # Convert the idn_ascii formated domain back to unicode and return it.
+ $unicode = &Net::LibIDN2::idn2_to_unicode_88($ascii, $ret);
+
+ # Check if an error occured.
+ if ($ret) {
+ # Get the error message.
+ my $error = &Net::LibIDN2::idn2_strerror($ret);
+
+ push(@errormessages, "$ascii - LibIDN2: $error");
+ }
+
+ return $unicode;
+}
diff --git a/lfs/perl-Net-LibIDN2 b/lfs/perl-Net-LibIDN2
new file mode 100644
index 000000000..5e7afb613
--- /dev/null
+++ b/lfs/perl-Net-LibIDN2
@@ -0,0 +1,77 @@
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007-2026 IPFire Team <info@ipfire.org> #
+# #
+# 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 <http://www.gnu.org/licenses/>. #
+# #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER = 1.02
+
+THISAPP = Net-LibIDN2-$(VER)
+DL_FILE = $(THISAPP).tar.gz
+DL_FROM = $(URL_IPFIRE)
+DIR_APP = $(DIR_SRC)/$(THISAPP)
+TARGET = $(DIR_INFO)/$(THISAPP)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_BLAKE2 = 0ccbadd445fcec84d082acdc6c43566a50276fc9bb4cc5a1e954761889b2712c8fde4012e1ffacfefcea796d7d04698a74928895ce822ef84d74f44c97b36b37
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+b2 : $(subst %,%_BLAKE2,$(objects))
+
+###############################################################################
+# Downloading, checking, b2sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+ @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+ @$(LOAD)
+
+$(subst %,%_BLAKE2,$(objects)) :
+ @$(B2SUM)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+ @$(PREBUILD)
+ @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && perl Build.PL
+ cd $(DIR_APP) && perl Build
+ cd $(DIR_APP) && perl Build install
+ @rm -rf $(DIR_APP)
+ @$(POSTBUILD)
diff --git a/make.sh b/make.sh
index 5309b5675..225767f91 100755
--- a/make.sh
+++ b/make.sh
@@ -2160,6 +2160,7 @@ build_system() {
lfsmake2 arpwatch
lfsmake2 suricata-reporter
lfsmake2 lldpd
+ lfsmake2 perl-Net-LibIDN2
lfsmake2 linux
lfsmake2 linux-initrd
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-09 10:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-09 10:44 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. e1392101d1f0483a12d777c7b9da773852a4be0f Michael Tremer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox