From 7225ccab733419a4f0f39c28ec084279cc164cff Mon Sep 17 00:00:00 2001 From: bim-g Date: Tue, 30 Jul 2024 01:02:54 +0200 Subject: [PATCH 01/11] [FIX] Add missing title parameter to ui_print_header documentation --- ui-lib.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-lib.pl b/ui-lib.pl index e72f26e9c..97c222fa6 100755 --- a/ui-lib.pl +++ b/ui-lib.pl @@ -1690,7 +1690,7 @@ if (!$tconfig{'nohr'} && !$tconfig{'nobottomhr'}) { return $rv; } -=head2 ui_print_header(subtext, image, [help], [config], [nomodule], [nowebmin], [rightside], [head-stuff], [body-stuff], [below]) +=head2 ui_print_header(subtext, title, image, [help], [config], [nomodule], [nowebmin], [rightside], [head-stuff], [body-stuff], [below]) Print HTML for a header with the post-header line. The args are the same as those passed to header(), defined in web-lib-funcs.pl, with the addition From e1398bf75b26e54486547f1b9455be5ac45748cf Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Tue, 30 Jul 2024 22:13:20 +0300 Subject: [PATCH 02/11] Version bump 2.202 --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cc8603d3..ae467af3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,11 @@ ## Changelog -#### 2.202 (Upcoming) -* Fix to set the WebSocket URL webprefix correctly +#### 2.202 (July 30, 2024) +* Add LDAP related fixes and improvements +* Fix to automatically set the WebSocket URL webprefix correctly +* Fix to name downloaded backup file nicely in Backup Configuration Files module [#2239](https://github.com/webmin/webmin/issues/2239) +* Fix to optimize getting table index stats for large tables in MySQL/MariaDB module [pull#2234](https://github.com/webmin/webmin/pull/2234) +* Fix duplication of _systemd_ actions and init scripts [#2227](https://github.com/webmin/webmin/issues/2227) #### 2.201 (July 24, 2024) * Fix real-time monitoring not updating graphs in the Dashboard [#2222](https://github.com/webmin/webmin/issues/2222) From a51e3d0a22a4d29609779a2cbd73946f51cfcb2e Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Thu, 1 Aug 2024 00:34:02 +0300 Subject: [PATCH 03/11] Fix BIND service name is now `named.service` in Debian 12 and Ubuntu 24.04 [build] --- ....0-ALL => config-Ubuntu-Linux-18.04-22.99} | 0 bind8/config-Ubuntu-Linux-24.04-ALL | 50 +++++++++++++++++++ bind8/config-debian-linux-10.0-11.99 | 50 +++++++++++++++++++ bind8/config-debian-linux-12.0-ALL | 50 +++++++++++++++++++ 4 files changed, 150 insertions(+) rename bind8/{config-debian-linux-10.0-ALL => config-Ubuntu-Linux-18.04-22.99} (100%) create mode 100644 bind8/config-Ubuntu-Linux-24.04-ALL create mode 100644 bind8/config-debian-linux-10.0-11.99 create mode 100644 bind8/config-debian-linux-12.0-ALL diff --git a/bind8/config-debian-linux-10.0-ALL b/bind8/config-Ubuntu-Linux-18.04-22.99 similarity index 100% rename from bind8/config-debian-linux-10.0-ALL rename to bind8/config-Ubuntu-Linux-18.04-22.99 diff --git a/bind8/config-Ubuntu-Linux-24.04-ALL b/bind8/config-Ubuntu-Linux-24.04-ALL new file mode 100644 index 000000000..23c545bc4 --- /dev/null +++ b/bind8/config-Ubuntu-Linux-24.04-ALL @@ -0,0 +1,50 @@ +soa_style=1 +named_path=/usr/sbin/named +named_conf=/etc/bind/named.conf +show_list=1 +records_order=0 +max_zones=50 +rev_def=0 +support_aaaa=1 +allow_comments=0 +allow_wild=1 +allow_long=0 +master_ttl=1 +whois_cmd=whois +short_names=0 +updserial_def=0 +updserial_on=1 +updserial_man=1 +ndc_cmd=ndc +forwardzonefilename_format=ZONE.hosts +reversezonefilename_format=ZONE.rev +rev_must=0 +ipv6_mode=1 +allow_underscore=1 +by_view=0 +confirm_zone=1 +confirm_rec=0 +no_chroot=0 +relative_paths=0 +rndc_cmd=rndc +pid_file=/var/run/named/named.pid +zones_file=/etc/bind/named.conf.local +master_dir=/var/lib/bind +slave_dir=/var/lib/bind +no_pid_chroot=0 +soa_start=0 +rndc_conf=/etc/bind/rndc.conf +rndcconf_cmd=rndc-confgen +largezones=0 +checkzone=named-checkzone +keygen=dnssec-keygen +signzone=dnssec-signzone +checkconf=named-checkconf +other_slaves=1 +force_random=0 +spf_record=0 +dnssec_info=1 +start_cmd=systemctl start named.service +stop_cmd=systemctl stop named.service +restart_cmd=systemctl reload named.service +dnssec_period=21 diff --git a/bind8/config-debian-linux-10.0-11.99 b/bind8/config-debian-linux-10.0-11.99 new file mode 100644 index 000000000..3a042bc0d --- /dev/null +++ b/bind8/config-debian-linux-10.0-11.99 @@ -0,0 +1,50 @@ +soa_style=1 +named_path=/usr/sbin/named +named_conf=/etc/bind/named.conf +show_list=1 +records_order=0 +max_zones=50 +rev_def=0 +support_aaaa=1 +allow_comments=0 +allow_wild=1 +allow_long=0 +master_ttl=1 +whois_cmd=whois +short_names=0 +updserial_def=0 +updserial_on=1 +updserial_man=1 +ndc_cmd=ndc +forwardzonefilename_format=ZONE.hosts +reversezonefilename_format=ZONE.rev +rev_must=0 +ipv6_mode=1 +allow_underscore=1 +by_view=0 +confirm_zone=1 +confirm_rec=0 +no_chroot=0 +relative_paths=0 +rndc_cmd=rndc +pid_file=/var/run/named/named.pid +zones_file=/etc/bind/named.conf.local +master_dir=/var/lib/bind +slave_dir=/var/lib/bind +no_pid_chroot=0 +soa_start=0 +rndc_conf=/etc/bind/rndc.conf +rndcconf_cmd=rndc-confgen +largezones=0 +checkzone=named-checkzone +keygen=dnssec-keygen +signzone=dnssec-signzone +checkconf=named-checkconf +other_slaves=1 +force_random=0 +spf_record=0 +dnssec_info=1 +start_cmd=systemctl start bind9.service +stop_cmd=systemctl stop bind9.service +restart_cmd=systemctl reload bind9.service +dnssec_period=21 diff --git a/bind8/config-debian-linux-12.0-ALL b/bind8/config-debian-linux-12.0-ALL new file mode 100644 index 000000000..23c545bc4 --- /dev/null +++ b/bind8/config-debian-linux-12.0-ALL @@ -0,0 +1,50 @@ +soa_style=1 +named_path=/usr/sbin/named +named_conf=/etc/bind/named.conf +show_list=1 +records_order=0 +max_zones=50 +rev_def=0 +support_aaaa=1 +allow_comments=0 +allow_wild=1 +allow_long=0 +master_ttl=1 +whois_cmd=whois +short_names=0 +updserial_def=0 +updserial_on=1 +updserial_man=1 +ndc_cmd=ndc +forwardzonefilename_format=ZONE.hosts +reversezonefilename_format=ZONE.rev +rev_must=0 +ipv6_mode=1 +allow_underscore=1 +by_view=0 +confirm_zone=1 +confirm_rec=0 +no_chroot=0 +relative_paths=0 +rndc_cmd=rndc +pid_file=/var/run/named/named.pid +zones_file=/etc/bind/named.conf.local +master_dir=/var/lib/bind +slave_dir=/var/lib/bind +no_pid_chroot=0 +soa_start=0 +rndc_conf=/etc/bind/rndc.conf +rndcconf_cmd=rndc-confgen +largezones=0 +checkzone=named-checkzone +keygen=dnssec-keygen +signzone=dnssec-signzone +checkconf=named-checkconf +other_slaves=1 +force_random=0 +spf_record=0 +dnssec_info=1 +start_cmd=systemctl start named.service +stop_cmd=systemctl stop named.service +restart_cmd=systemctl reload named.service +dnssec_period=21 From f499c62da4fe9924858a1106bdd2b04c06b54018 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Thu, 1 Aug 2024 00:52:57 +0300 Subject: [PATCH 04/11] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae467af3e..456a8ef68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ ## Changelog -#### 2.202 (July 30, 2024) +#### 2.202 (July 31, 2024) * Add LDAP related fixes and improvements * Fix to automatically set the WebSocket URL webprefix correctly * Fix to name downloaded backup file nicely in Backup Configuration Files module [#2239](https://github.com/webmin/webmin/issues/2239) * Fix to optimize getting table index stats for large tables in MySQL/MariaDB module [pull#2234](https://github.com/webmin/webmin/pull/2234) * Fix duplication of _systemd_ actions and init scripts [#2227](https://github.com/webmin/webmin/issues/2227) +* Fix BIND service name for Debian 12 and Ubuntu 24.04 #### 2.201 (July 24, 2024) * Fix real-time monitoring not updating graphs in the Dashboard [#2222](https://github.com/webmin/webmin/issues/2222) From 8236fb2fd85c7a99571b9ccc4cc0450adecdc8cc Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Thu, 1 Aug 2024 13:01:30 +0300 Subject: [PATCH 05/11] Add support to display tag, algo and digests in table #2245 --- bind8/edit_zonekey.cgi | 22 +++++++++++++++++++++- bind8/lang/en | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/bind8/edit_zonekey.cgi b/bind8/edit_zonekey.cgi index ecd418249..838e05d1d 100755 --- a/bind8/edit_zonekey.cgi +++ b/bind8/edit_zonekey.cgi @@ -68,8 +68,28 @@ if (@keyrecs) { my $ds = &get_ds_record($zone); if ($ds) { print $text{'zonekey_ds'},"
\n"; - print &ui_textarea("ds", join("\n".$desc, split(/$desc/, $ds)), 2, 80, "off", 0, + # Split DS records in string into a list + my @ds = split(/\s(?=\S+\.\s+\d+\s+IN\s+DS\s+\d+\s+ + \d+\s+\d+\s+[0-9A-Fa-f]{16,})/x, $ds); + print &ui_textarea("ds", join("\n", @ds), 2, 80, "off", 0, "readonly style='width:90%'"),"
\n"; + print &ui_columns_start([ + $text{'zonekey_ds_keytag'}, + $text{'zonekey_ds_alg'}, + $text{'zonekey_ds_type'}, + $text{'zonekey_ds_digest'}, + ]); + foreach my $r (@ds) { + if ($r =~ / + \bDS\s+(?\d+)\s+(?\d+)\s+ + (?\d+)\s+ + (?[0-9A-Fa-f]+)\b/x) { + print &ui_columns_row([ + $+{key_tag}, $+{algorithm}, + $+{digest_type}, $+{digest}]); + } + } + print &ui_columns_end(); } # Offer to disable diff --git a/bind8/lang/en b/bind8/lang/en index 26c02f7dc..ee7315edb 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -1282,6 +1282,10 @@ zonekey_private=Private key details : zonekey_privatefile=Private key file : $1 zonekey_algorithm=DNSSEC algorithm : $1 zonekey_ds=DS record for parent zone : +zonekey_ds_keytag=Key tag +zonekey_ds_alg=Algorithm +zonekey_ds_type=Digest type +zonekey_ds_digest=Digest string zonekey_expandksk=Show public and private key-signing-key details .. zonekey_expandzone=Show public and private zone-key details .. zonekey_noprivate=However, Webmin could not find the private key associated with the zone, and so will not be able to re-sign it. From ae34d0ef86ac7acb1464339b4a0717bdfd2b0b4e Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Thu, 1 Aug 2024 20:29:40 +0300 Subject: [PATCH 06/11] Fix to unquote database name in view https://github.com/virtualmin/virtualmin-gpl/issues/723#issuecomment-2262824643 --- mysql/list_dbs.cgi | 5 +++-- mysql/mysql-lib.pl | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mysql/list_dbs.cgi b/mysql/list_dbs.cgi index 1d0436190..02effc4d7 100755 --- a/mysql/list_dbs.cgi +++ b/mysql/list_dbs.cgi @@ -27,8 +27,9 @@ if (@{$d->{'data'}}) { next if ($access{'perms'} == 2 && !&can_edit_db($u->[1])); local @cols; push(@cols, "". - ($u->[1] eq '%' || $u->[1] eq '' ? $text{'dbs_any'} - : &html_escape($u->[1])).""); + ($u->[1] eq '%' || $u->[1] eq '' ? $text{'dbs_any'} : + &html_escape(&unquote_mysql_database( + $u->[1]))).""); push(@cols, $u->[2] eq '' ? $text{'dbs_anon'} : &html_escape($u->[2])); push(@cols, $u->[0] eq '%' ? $text{'dbs_any'} : diff --git a/mysql/mysql-lib.pl b/mysql/mysql-lib.pl index 3fef6874f..87b1fa69a 100755 --- a/mysql/mysql-lib.pl +++ b/mysql/mysql-lib.pl @@ -675,6 +675,15 @@ $db =~ s/%/\\%/g; return $db; } +# unquote_mysql_database(name) +# Returns a MySQL database name with \% and \_ characters unescaped +sub unquote_mysql_database { + my ($db) = @_; + $db =~ s/\\%/%/g; + $db =~ s/\\_/_/g; + return $db; +} + # escapestr(string) # Returns a string with quotes escaped, for use in SQL sub escapestr From e517300fe0db049e070b617b1d8d87f0125b48fa Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 2 Aug 2024 15:22:21 +0300 Subject: [PATCH 07/11] Fix to display wildcard char next to dbs https://github.com/virtualmin/virtualmin-gpl/issues/723#issuecomment-2263713657 --- mysql/list_dbs.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mysql/list_dbs.cgi b/mysql/list_dbs.cgi index 02effc4d7..b127edb94 100755 --- a/mysql/list_dbs.cgi +++ b/mysql/list_dbs.cgi @@ -26,10 +26,13 @@ if (@{$d->{'data'}}) { $i++; next if ($access{'perms'} == 2 && !&can_edit_db($u->[1])); local @cols; + my $dbname = &unquote_mysql_database($u->[1]); + my $big_style = ' style="position: absolute; margin-top: -2px;"'; + my $wildcard = $u->[1]=~ /\_/ && + $u->[1] eq $dbname ? "∗" : ''; push(@cols, "". ($u->[1] eq '%' || $u->[1] eq '' ? $text{'dbs_any'} : - &html_escape(&unquote_mysql_database( - $u->[1]))).""); + &html_escape($dbname))." $wildcard"); push(@cols, $u->[2] eq '' ? $text{'dbs_anon'} : &html_escape($u->[2])); push(@cols, $u->[0] eq '%' ? $text{'dbs_any'} : From 0ac51a83e9cce273a632d8c8ba1e9f599c6d0a34 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sat, 3 Aug 2024 17:05:56 +0300 Subject: [PATCH 08/11] Add an API to count processes --- proc/proc-lib.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/proc/proc-lib.pl b/proc/proc-lib.pl index 391c8edf3..0c43d5db6 100755 --- a/proc/proc-lib.pl +++ b/proc/proc-lib.pl @@ -710,5 +710,29 @@ else { } } +# count_processes() +sub count_processes +{ +my $process_count = 0; +if ($^O eq 'MSWin32') { + open(my $ps, '-|', 'tasklist /FO CSV') || return -1; + while (my $line = <$ps>) { + next if $. == 1; # Skip the header line + $process_count++; + } + close($ps); + return $process_count; + } +else { + open(my $ps, '-|', 'ps -e') || return -1; + while (<$ps>) { + $process_count++; + } + close($ps); + # Skip the header line + return $process_count - 1; + } +} + 1; From 24055330d353bc3509bb4835e3a1547f06f2da74 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Sun, 4 Aug 2024 17:03:41 +0300 Subject: [PATCH 09/11] Fix build system --- .github/workflows/webmin.dev-deploy-webmin-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webmin.dev-deploy-webmin-package.yml b/.github/workflows/webmin.dev-deploy-webmin-package.yml index f0763a1a1..4ea7fbe1a 100644 --- a/.github/workflows/webmin.dev-deploy-webmin-package.yml +++ b/.github/workflows/webmin.dev-deploy-webmin-package.yml @@ -7,13 +7,13 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest if: contains(github.event.head_commit.message, '[build]') steps: - uses: actions/checkout@v3 - uses: awalsh128/cache-apt-pkgs-action@latest with: - packages: git tar gzip openssl curl openssh-client rpm perl libjson-pp-perl libdigest-sha-perl liblist-moreutils-perl libencode-detect-perl + packages: git tar gzip openssl curl openssh-client rpm perl libjson-pp-perl libdigest-sha-perl liblist-moreutils-perl libencode-detect-perl zstd version: 1.0 - uses: szenius/set-timezone@v1.2 with: From f5b3f9cc1df73669a177a0d2d0e631a9b0b3baf7 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Tue, 6 Aug 2024 12:21:19 +0300 Subject: [PATCH 10/11] Fix to use `os_type` for OS check https://github.com/webmin/webmin/commit/0ac51a83e9cce273a632d8c8ba1e9f599c6d0a34#r145024453 --- proc/proc-lib.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc/proc-lib.pl b/proc/proc-lib.pl index 0c43d5db6..334f887e7 100755 --- a/proc/proc-lib.pl +++ b/proc/proc-lib.pl @@ -714,7 +714,7 @@ else { sub count_processes { my $process_count = 0; -if ($^O eq 'MSWin32') { +if ($gconfig{'os_type'} eq 'windows') { open(my $ps, '-|', 'tasklist /FO CSV') || return -1; while (my $line = <$ps>) { next if $. == 1; # Skip the header line From 6bc70a773867aac680f83629971ca49d423f654b Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Wed, 7 Aug 2024 15:28:58 +0300 Subject: [PATCH 11/11] Add support for disk I/O in FreeBSD --- proc/freebsd-lib.pl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/proc/freebsd-lib.pl b/proc/freebsd-lib.pl index 1e3e9e0a8..2d1f052b1 100755 --- a/proc/freebsd-lib.pl +++ b/proc/freebsd-lib.pl @@ -173,7 +173,20 @@ return ( ) if ($?); my @lines = split(/\r?\n/, $out); my @w = split(/\s+/, $lines[$#lines]); shift(@w) if ($w[0] eq ''); -return ( $w[-3], $w[-2], $w[-1], 0, 0, undef, undef ); +my ($bi, $bo) = (0, 0); +my $out2 = &backquote_command("iostat -Ix -d -t da 0.25 2 2>/dev/null"); +if (!$?) { + foreach my $l (split(/\r?\n/, $out2)) { + # Getting the 4th and 5th columns of the last line for direct access device + # device r/i w/i kr/i kw/i qlen tsvc_t/i sb/i + # ada0 3457.0 134574.0 61068.0 8443152.0 0 36.3 19.2 + if ($l =~ /^.*?da\d+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\d/) { + $bi = int($1) * 4; # kr/i per period, i.e. 0.25 seconds + $bo = int($2) * 4; # kw/i per period, i.e. 0.25 seconds + } + } + } +return ( $w[-3], $w[-2], $w[-1], 0, 0, $bi, $bo ); } 1;