mirror of
https://github.com/webmin/webmin.git
synced 2026-02-07 16:02:14 +00:00
Compare commits
30 Commits
dev/remove
...
dev/check-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d694649872 | ||
|
|
991795c296 | ||
|
|
8932f3bd6a | ||
|
|
b3ec083c7b | ||
|
|
da18dea780 | ||
|
|
35f8061049 | ||
|
|
e6e79a7eb5 | ||
|
|
a4d1280ef7 | ||
|
|
cc2cc62717 | ||
|
|
c59591e3de | ||
|
|
fc4e2751dc | ||
|
|
4dc64f5028 | ||
|
|
01d2323496 | ||
|
|
4c8b0fe008 | ||
|
|
e44ec464eb | ||
|
|
98c54fe3fb | ||
|
|
86968bfc31 | ||
|
|
956ad7ed0f | ||
|
|
a0d99e0a31 | ||
|
|
f27b1415be | ||
|
|
1f4b467ea8 | ||
|
|
95423c7425 | ||
|
|
89d23c5aa8 | ||
|
|
be3fcb89b0 | ||
|
|
25fa7c589d | ||
|
|
c86c45b10a | ||
|
|
f10540bd54 | ||
|
|
388f51843f | ||
|
|
7a723719da | ||
|
|
a027ad5dd6 |
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,7 +1,22 @@
|
||||
## Changelog
|
||||
|
||||
#### 2.511 (September, 2025)
|
||||
#### 2.520 (October 2, 2025)
|
||||
* Fix to make sure the mail URL uses a well-known host name [security]
|
||||
* Fix support for other Raspberry Pi sensors #2545
|
||||
* Fix the printing of the bottom button row in the form column table
|
||||
* Fix to recommend Perl `Sys::Syslog` module #2557
|
||||
* Fix to avoid using short hostname in HTTPS redirects when an FQDN is available
|
||||
* Fix to use _/proc_ sampler instead of `vmstat` for the same output with much lower overhead
|
||||
* Fix to query specific fields in FreeBSD memory stats collection, cutting CPU use by 80%
|
||||
* Fix to kill Webmin subprocesses during RC stop on FreeBSD and other systems
|
||||
* Add a complete overhaul of `var_dump` subroutine, which is now fully portable
|
||||
* Update the Authentic theme to the latest version with various fixes:
|
||||
- Fix the text color when reading email in the Read User Mail module [webmin#2555](https://github.com/webmin/webmin/issues/2555)
|
||||
- Fix to ensure the selected color palette is correctly stored when changed manually [webmin#2552](https://github.com/webmin/webmin/issues/2552)
|
||||
- Fix a bug when the Webmin version label was missing when copying to clipboard system information from the dashboard
|
||||
- Fix DNS query spike from network stats collection on FreeBSD [webmin#2556](https://github.com/webmin/webmin/issues/2556)
|
||||
- Fix spinner color in toast messages for dark palette
|
||||
- Fix other bugs and add various small improvements
|
||||
|
||||
#### 2.510 (September 16, 2025)
|
||||
* Fix to ensure DNSSEC re-signing period is less than 30 days in the BIND DNS module
|
||||
|
||||
@@ -15,6 +15,8 @@ if ($in{'new'}) {
|
||||
$backup = { 'emode' => 0,
|
||||
'email' => $gconfig{'webmin_email_to'},
|
||||
'sched' => 1,
|
||||
'configfile' => 1,
|
||||
'nofiles' => 0,
|
||||
'mins' => 0,
|
||||
'hours' => 0,
|
||||
'days' => '*',
|
||||
|
||||
@@ -647,5 +647,4 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
@@ -16,9 +16,9 @@ my $timeout = $gconfig{'passreset_timeout'} || 15;
|
||||
$remote_user && &error($text{'forgot_elogin'});
|
||||
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
|
||||
&error($text{'forgot_essl'});
|
||||
$ENV{'SSL_HOST_CERT'} == 1 ||
|
||||
$ENV{'SSL_CN_CERT'} == 1 ||
|
||||
&error(&text('forgot_esslhost',
|
||||
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
|
||||
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
|
||||
if ($ENV{'HTTPS'} eq 'ON');
|
||||
|
||||
# Check that the random ID is valid
|
||||
|
||||
@@ -15,9 +15,9 @@ $gconfig{'forgot_pass'} || &error($text{'forgot_ecannot'});
|
||||
$remote_user && &error($text{'forgot_elogin'});
|
||||
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
|
||||
&error($text{'forgot_essl'});
|
||||
$ENV{'SSL_HOST_CERT'} == 1 ||
|
||||
$ENV{'SSL_CN_CERT'} == 1 ||
|
||||
&error(&text('forgot_esslhost',
|
||||
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
|
||||
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
|
||||
if ($ENV{'HTTPS'} eq 'ON');
|
||||
|
||||
&ui_print_header(undef, $text{'forgot_title'}, "", undef, undef, 1, 1);
|
||||
|
||||
@@ -14,9 +14,9 @@ $gconfig{'forgot_pass'} || &error($text{'forgot_ecannot'});
|
||||
$remote_user && &error($text{'forgot_elogin'});
|
||||
$ENV{'HTTPS'} eq 'ON' || $gconfig{'forgot_pass'} == 2 ||
|
||||
&error($text{'forgot_essl'});
|
||||
$ENV{'SSL_HOST_CERT'} == 1 ||
|
||||
$ENV{'SSL_CN_CERT'} == 1 ||
|
||||
&error(&text('forgot_esslhost',
|
||||
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'})))
|
||||
&html_escape($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'})))
|
||||
if ($ENV{'HTTPS'} eq 'ON');
|
||||
|
||||
# Lookup the Webmin user
|
||||
|
||||
@@ -109,7 +109,7 @@ if ($product eq "webmin") {
|
||||
$size = int(`du -sk $tmp_dir`);
|
||||
@deps = ( "perl", "libnet-ssleay-perl", "openssl", "libauthen-pam-perl", "libpam-runtime", "libio-pty-perl", "unzip", "shared-mime-info", "tar", "libdigest-sha-perl", "libdigest-md5-perl", "gzip" );
|
||||
$deps = join(", ", @deps);
|
||||
@recommends = ( "libdatetime-perl", "libdatetime-timezone-perl", "libdatetime-locale-perl", "libtime-piece-perl", "libencode-detect-perl", "libtime-hires-perl", "libsocket6-perl", "html2text", "qrencode", "libdbi-perl", "libdbd-mysql-perl", "libjson-xs-perl" );
|
||||
@recommends = ( "libdatetime-perl", "libdatetime-timezone-perl", "libdatetime-locale-perl", "libtime-piece-perl", "libencode-detect-perl", "libtime-hires-perl", "libsocket6-perl", "html2text", "qrencode", "libdbi-perl", "libdbd-mysql-perl", "libjson-xs-perl", "libsys-syslog-perl" );
|
||||
$recommends = join(", ", @recommends);
|
||||
open(CONTROL, ">$control_file");
|
||||
print CONTROL <<EOF;
|
||||
|
||||
@@ -34,7 +34,7 @@ my $allow_overwrite = 0;
|
||||
|
||||
my ($force_theme, $no_prefix, $set_prefix,
|
||||
$obsolete_wbm, $vendor, $url, $force_usermin, $final_mod, $sign, $keyname,
|
||||
$epoch, $dir, $ver, @exclude,
|
||||
$epoch, $dir, $ver, @exclude, $copy_tar,
|
||||
|
||||
$rpmdepends, $norpmdepends, $rpmrecommends, $norpmrecommends,
|
||||
$no_requires, $no_recommends, $no_suggests, $no_conflicts, $no_provides,
|
||||
@@ -136,6 +136,9 @@ while(@ARGV) {
|
||||
elsif ($a eq "--mod-list") {
|
||||
$mod_list = shift(@ARGV);
|
||||
}
|
||||
elsif ($a eq "--copy-tar") {
|
||||
$copy_tar = 1;
|
||||
}
|
||||
elsif ($a =~ /^\-\-/) {
|
||||
print STDERR "Unknown option $a\n";
|
||||
exit(1);
|
||||
@@ -556,6 +559,15 @@ fi
|
||||
EOF
|
||||
close($SPEC);
|
||||
|
||||
# Put the tar in /tmp too if tar package is requested
|
||||
my $tar_release_file;
|
||||
if ($copy_tar) {
|
||||
my $tar_release = $release;
|
||||
$tar_release =~ s/^[0-9]+//;
|
||||
$tar_release_file = "$prefix$mod-$ver$tar_release.tar.gz";
|
||||
system("cp $rpm_source_dir/$mod.tar.gz /tmp/$tar_release_file");
|
||||
}
|
||||
|
||||
# Build the actual RPM
|
||||
my $cmd = -x "/usr/bin/rpmbuild" ? "/usr/bin/rpmbuild" : "/bin/rpm";
|
||||
system("$cmd -ba $spec_dir/$prefix$mod.spec") && exit;
|
||||
@@ -570,10 +582,20 @@ if ($sign) {
|
||||
if ($target_dir =~ /:/) {
|
||||
# scp to dest
|
||||
system("scp $rpm_dir/$prefix$mod-$ver-$release.noarch.rpm $target_dir/$prefix$mod-$ver-$release.noarch.rpm");
|
||||
# scp the tar too if requested
|
||||
if ($copy_tar) {
|
||||
system("scp /tmp/$tar_release_file $target_dir/$tar_release_file");
|
||||
unlink("/tmp/$tar_release_file");
|
||||
}
|
||||
}
|
||||
elsif ($rpm_dir ne $target_dir) {
|
||||
# Just copy
|
||||
system("/bin/cp $rpm_dir/$prefix$mod-$ver-$release.noarch.rpm $target_dir/$prefix$mod-$ver-$release.noarch.rpm");
|
||||
# Copy the tar too if requested
|
||||
if ($copy_tar) {
|
||||
system("/bin/cp /tmp/$tar_release_file $target_dir/$tar_release_file");
|
||||
unlink("/tmp/$tar_release_file");
|
||||
}
|
||||
}
|
||||
|
||||
# read_file(file, &assoc, [&order], [lowercase])
|
||||
|
||||
@@ -88,7 +88,7 @@ Release: $rel
|
||||
Provides: %{name}-%{version} perl(WebminCore)
|
||||
Requires(pre): /usr/bin/perl
|
||||
Requires: /bin/sh /usr/bin/perl perl(lib) perl(open) perl(Net::SSLeay) perl(Time::Local) perl(Data::Dumper) perl(File::Path) perl(File::Basename) perl(Digest::SHA) perl(Digest::MD5) openssl unzip tar gzip
|
||||
Recommends: perl(DateTime) perl(DateTime::TimeZone) perl(DateTime::Locale) perl(Time::Piece) perl(Encode::Detect) perl(Time::HiRes) perl(Socket6) html2text shared-mime-info perl-File-Basename perl-File-Path perl-JSON-XS qrencode perl(DBI) perl(DBD::mysql)
|
||||
Recommends: perl(DateTime) perl(DateTime::TimeZone) perl(DateTime::Locale) perl(Time::Piece) perl(Encode::Detect) perl(Time::HiRes) perl(Socket6) perl(Sys::Syslog) html2text shared-mime-info perl-File-Basename perl-File-Path perl-JSON-XS qrencode perl(DBI) perl(DBD::mysql)
|
||||
AutoReq: 0
|
||||
License: BSD-3-Clause
|
||||
Group: System/Tools
|
||||
|
||||
58
miniserv.pl
58
miniserv.pl
@@ -942,8 +942,8 @@ while(1) {
|
||||
($ssl_con,
|
||||
$ssl_certfile,
|
||||
$ssl_keyfile,
|
||||
$ssl_host,
|
||||
$ssl_cert_hosts) =
|
||||
$ssl_cn,
|
||||
$ssl_alts) =
|
||||
&ssl_connection_for_ip(
|
||||
SOCK, $ipv6fhs{$s});
|
||||
print DEBUG "ssl_con returned ".
|
||||
@@ -1381,26 +1381,48 @@ $method = $page = $request_uri = undef;
|
||||
print DEBUG "handle_request reqline=$reqline\n";
|
||||
alarm(0);
|
||||
if (!$use_ssl && $config{'ssl'} && $config{'ssl_enforce'}) {
|
||||
# This is an http request when https must be enforced
|
||||
local $urlhost = $config{'musthost'} || $host;
|
||||
$urlhost = "[".$urlhost."]" if (&check_ip6address($urlhost));
|
||||
local $wantport = $port;
|
||||
if ($wantport == 80 &&
|
||||
&indexof(443, @listening_on_ports) >= 0) {
|
||||
# Connection was to port 80, but since we are also
|
||||
# accepting on port 443, redirect to that
|
||||
$wantport = 443;
|
||||
# This is an HTTP request when HTTPS should be enforced
|
||||
my $musthost = $config{'musthost'};
|
||||
my $hostheader;
|
||||
if (!$musthost) {
|
||||
# Read host HTTP header because we want one earlier
|
||||
alarm(10);
|
||||
local $SIG{'ALRM'} = sub { die "timeout" };
|
||||
while (defined(my $line = &read_line())) {
|
||||
$line =~ s/\r|\n//g;
|
||||
last if $line eq '';
|
||||
if ($line =~ /^host:\s*(.*)$/i) {
|
||||
$hostheader = "https://$1";
|
||||
last;
|
||||
}
|
||||
}
|
||||
alarm(0);
|
||||
}
|
||||
local $url = $wantport == 443
|
||||
? "https://$urlhost/"
|
||||
: "https://$urlhost:$wantport/";
|
||||
# Host header must already contain full URL
|
||||
my $url = $hostheader;
|
||||
if (!$url) {
|
||||
# No host header
|
||||
local $urlhost = $musthost || $host;
|
||||
$urlhost = "[".$urlhost."]" if (&check_ip6address($urlhost));
|
||||
local $wantport = $port;
|
||||
if ($wantport == 80 &&
|
||||
&indexof(443, @listening_on_ports) >= 0) {
|
||||
# Connection was to port 80, but since we are also
|
||||
# accepting on port 443, redirect to that
|
||||
$wantport = 443;
|
||||
}
|
||||
$url = $wantport == 443
|
||||
? "https://$urlhost/"
|
||||
: "https://$urlhost:$wantport/";
|
||||
}
|
||||
# Enforce HTTPS
|
||||
&write_data("HTTP/1.0 302 Moved Temporarily\r\n");
|
||||
&write_data("Date: $datestr\r\n");
|
||||
&write_data("Server: @{[&server_info()]}\r\n");
|
||||
&write_data("Location: $url\r\n");
|
||||
&write_keep_alive(0);
|
||||
&write_data("\r\n");
|
||||
&log_error("Redirecting HTTP request to HTTPS for $acptip");
|
||||
&log_error("Redirecting HTTP request to $url");
|
||||
&log_request($loghost, $authuser, $reqline, 302, 0);
|
||||
return 0;
|
||||
}
|
||||
@@ -2503,9 +2525,9 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
|
||||
$ENV{"HTTPS"} = $use_ssl ? "ON" : "";
|
||||
$ENV{"SSL_HSTS"} = $config{"ssl_hsts"};
|
||||
if ($use_ssl) {
|
||||
$ENV{"SSL_HOST"} = $ssl_host;
|
||||
$ENV{"SSL_HOST_CERT"} =
|
||||
&ssl_hostname_match($header{'host'}, $ssl_cert_hosts);
|
||||
$ENV{"SSL_CN"} = $ssl_cn;
|
||||
$ENV{"SSL_CN_CERT"} =
|
||||
&ssl_hostname_match($header{'host'}, $ssl_alts);
|
||||
}
|
||||
$ENV{"MINISERV_PID"} = $miniserv_main_pid;
|
||||
if ($use_ssl) {
|
||||
|
||||
@@ -101,7 +101,16 @@ ioctl($ttyfh, 536900705, 0);
|
||||
sub get_memory_info
|
||||
{
|
||||
my $sysctl = {};
|
||||
my $sysctl_output = &backquote_command("/sbin/sysctl -a 2>/dev/null");
|
||||
# Get only the specific values we need not all with -a
|
||||
my @needed = qw(
|
||||
hw.physmem
|
||||
hw.pagesize
|
||||
vm.stats.vm.v_inactive_count
|
||||
vm.stats.vm.v_cache_count
|
||||
vm.stats.vm.v_free_count
|
||||
);
|
||||
my $sysctl_output = &backquote_command("/sbin/sysctl " .
|
||||
join(" ", @needed) . " 2>/dev/null");
|
||||
return ( ) if ($?);
|
||||
foreach my $line (split(/\n/, $sysctl_output)) {
|
||||
if ($line =~ m/^([^:]+):\s+(.+)\s*$/s) {
|
||||
|
||||
@@ -700,14 +700,14 @@ if (!@fans && @cpu && @fans_all &&
|
||||
}
|
||||
|
||||
# Fall back logic for CPU temperature and fans spread over multiple
|
||||
# devices like Raspberry Pi #2517 and #2539
|
||||
# devices like Raspberry Pi #2517 and #2539 #2545
|
||||
if (@cpu || !@fans) {
|
||||
# - Look for least two ISA voltage rails anywhere
|
||||
# - See a CPU temp under cpu_thermal
|
||||
# - Optionally grab a fan RPM under pwmfan-isa-*
|
||||
# - Optionally grab a fan RPM under *fan-isa-*
|
||||
my $can_fallback =
|
||||
(!@cpu && (grep { /^\s*cpu_thermal/i } @sensors)) ||
|
||||
(@cpu && !@fans && (grep { /^\s*pwmfan-isa-/i } @sensors));
|
||||
(@cpu && !@fans && (grep { /fan-isa-\d+/i } @sensors));
|
||||
return (\@cpu, \@fans) if (!$can_fallback);
|
||||
my ($chip, $bus); # isa|pci|platform|virtual
|
||||
my $isa_volt;
|
||||
@@ -735,7 +735,7 @@ if (@cpu || !@fans) {
|
||||
}
|
||||
|
||||
# Fan RPM
|
||||
if (defined $chip && $chip =~ /^pwmfan/i &&
|
||||
if (defined $chip && $chip =~ /fan$/i &&
|
||||
/\b(?:cpu[_ ]?fan(?:\s*\d+)?|fan\d+)\s*:\s*(\d+)\s*rpm\b/i) {
|
||||
my $rpm = $1 + 0;
|
||||
$fan_rpm = $rpm if (!$fan_rpm || $rpm > $fan_rpm);
|
||||
@@ -754,31 +754,65 @@ return (\@cpu, \@fans);
|
||||
}
|
||||
|
||||
# get_cpu_io_usage()
|
||||
# Returns a list containing CPU user, kernel, idle, io and VM time, and IO
|
||||
# blocks in and out
|
||||
# Returns a list of "us", "sy", "id", "wa", "st", "bi", "bo" that match `vmstat`
|
||||
# output by using /proc with much lower overhead
|
||||
sub get_cpu_io_usage
|
||||
{
|
||||
my ($nodelay) = @_;
|
||||
my $interval;
|
||||
$interval = " 1 2"
|
||||
if (!$nodelay);
|
||||
my ($out, @lines, @w);
|
||||
if (&has_command("vmstat")) {
|
||||
$out = &backquote_command("vmstat$interval 2>/dev/null");
|
||||
@lines = split(/\r?\n/, $out);
|
||||
@w = split(/\s+/, $lines[$#lines]);
|
||||
shift(@w) if ($w[0] eq '');
|
||||
if ($w[8] =~ /^\d+$/ && $w[9] =~ /^\d+$/) {
|
||||
return ( @w[12..16], $w[8], $w[9] );
|
||||
}
|
||||
} elsif (&has_command("dstat")) {
|
||||
$out = &backquote_command("dstat 1 1 2>/dev/null");
|
||||
@lines = split(/\r?\n/, $out);
|
||||
@w = split(/[\s|]+/, $lines[$#lines]);
|
||||
shift(@w) if ($w[0] eq '');
|
||||
return( @w[0..4], @w[6..7]);
|
||||
}
|
||||
return undef;
|
||||
# Read CPU counters from /proc/stat, the first "cpu" line
|
||||
my $read_cpu = sub {
|
||||
open(my $fh, '<', '/proc/stat') or return;
|
||||
my $line = <$fh>;
|
||||
close($fh);
|
||||
return unless defined $line && $line =~ /^cpu\s+/;
|
||||
my @v = split /\s+/, $line; shift @v;
|
||||
push @v, (0) x (8-@v) if @v < 8;
|
||||
return @v[0..7];
|
||||
};
|
||||
|
||||
# Read pgpgin/pgpgout from /proc/vmstat (in KB). Note, that all modern kernels,
|
||||
# /proc/vmstat pgpgin/pgpgout are KiB (scale=1); not as *pages*, so no need to
|
||||
# convert deltas
|
||||
my $read_io = sub {
|
||||
open(my $fh, '<', '/proc/vmstat') or return (undef, undef);
|
||||
my ($in, $out);
|
||||
while (my $l = <$fh>) {
|
||||
$in = $1 if !defined $in && $l =~ /^pgpgin\s+(\d+)/;
|
||||
$out = $1 if !defined $out && $l =~ /^pgpgout\s+(\d+)/;
|
||||
last if defined $in && defined $out;
|
||||
}
|
||||
close($fh);
|
||||
return ($in, $out); # KB on kernels 2.6.18+; no conversion needed
|
||||
};
|
||||
|
||||
# Sample A
|
||||
my @cb = $read_cpu->() or return;
|
||||
my ($pgin_b, $pgout_b) = $read_io->();
|
||||
|
||||
# Sleep half a second
|
||||
select(undef, undef, undef, 0.5);
|
||||
|
||||
# Sample B
|
||||
my @ca = $read_cpu->() or return;
|
||||
my ($pgin_a, $pgout_a) = $read_io->();
|
||||
|
||||
# CPU percentages as in vmstat
|
||||
my @d = map { $ca[$_] - $cb[$_] } 0..7;
|
||||
for (@d) { $_ = 0 if $_ < 0 }
|
||||
my $tot = 0; $tot += $_ for @d[0..7];
|
||||
return if !$tot;
|
||||
|
||||
# Calculate percentages
|
||||
my $us = int( (($d[0] + $d[1]) / $tot) * 100 ); # user+nice
|
||||
my $sy = int( (($d[2] + $d[5] + $d[6]) / $tot) * 100 ); # system+irq+softirq
|
||||
my $id = int( ( $d[3] / $tot ) * 100 ); # idle
|
||||
my $wa = int( ( $d[4] / $tot ) * 100 ); # iowait
|
||||
my $st = int( ( $d[7] / $tot ) * 100 ); # steal
|
||||
|
||||
# Calculate bi/bo in KiB/s over half a second
|
||||
my ($bi, $bo) = (0, 0);
|
||||
$bi = int( (($pgin_a // 0) - ($pgin_b // 0)) / 0.5 );
|
||||
$bo = int( (($pgout_a // 0) - ($pgout_b // 0)) / 0.5 );
|
||||
return ($us, $sy, $id, $wa, $st, $bi, $bo);
|
||||
}
|
||||
|
||||
# has_disk_stats()
|
||||
|
||||
@@ -108,7 +108,7 @@ if ($out =~ /Primary\s+memory\s+available:\s+([0-9\.]+)\s+g/i) {
|
||||
$rv[0] = $1 * 1024 * 1024;
|
||||
}
|
||||
else {
|
||||
my $out = &backquote_command("sysctl -a hw.physmem 2>/dev/null");
|
||||
my $out = &backquote_command("sysctl hw.physmem 2>/dev/null");
|
||||
if ($out =~ /:\s*(\d+)/) {
|
||||
$rv[0] = $1 / 1024;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ if ($usage > $rv[0]) {
|
||||
$rv[1] = $rv[0] - $usage;
|
||||
|
||||
# Get swap usage
|
||||
$out = &backquote_command("sysctl -a vm.swapusage 2>/dev/null");
|
||||
$out = &backquote_command("sysctl vm.swapusage 2>/dev/null");
|
||||
if ($out =~ /total\s*=\s*([0-9\.]+)([KMGT]).*free\s*=\s*([0-9\.]+)([KMGT])/) {
|
||||
$rv[2] = $1*($2 eq "K" ? 1 :
|
||||
$2 eq "M" ? 1024 :
|
||||
@@ -155,7 +155,7 @@ my $out = &backquote_command("uptime 2>&1");
|
||||
my @rv = $out =~ /average(s)?:\s+([0-9\.]+),?\s+([0-9\.]+),?\s+([0-9\.]+)/i ?
|
||||
( $2, $3, $4 ) : ( undef, undef, undef );
|
||||
|
||||
$out = &backquote_command("sysctl -a machdep.cpu.brand_string");
|
||||
$out = &backquote_command("sysctl machdep.cpu.brand_string");
|
||||
if ($out =~ /:\s*(\S.*)/) {
|
||||
$rv[4] = $1;
|
||||
if ($rv[4] =~ s/\s*\@\s*([0-9\.]+)(GHz|MHz)//i) {
|
||||
@@ -169,7 +169,7 @@ if (!$?) {
|
||||
$rv[5] = $out;
|
||||
}
|
||||
else {
|
||||
$out = &backquote_command("sysctl -a machdep.cpu.vendor");
|
||||
$out = &backquote_command("sysctl machdep.cpu.vendor");
|
||||
if ($out =~ /:\s*(\S.*)/) {
|
||||
$rv[5] = $1;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ if ($out =~ /:\s*(\d+)/) {
|
||||
$rv[6] = $1 * 1024;
|
||||
}
|
||||
|
||||
$out = &backquote_command("sysctl -a machdep.cpu.core_count");
|
||||
$out = &backquote_command("sysctl machdep.cpu.core_count");
|
||||
if ($out =~ /:\s*(\d+)/) {
|
||||
$rv[7] = $1;
|
||||
}
|
||||
|
||||
9
setup.pl
9
setup.pl
@@ -616,6 +616,13 @@ else {
|
||||
print STOP "else\n";
|
||||
print STOP " echo Stopping Webmin server in $wadir\n";
|
||||
print STOP "fi\n";
|
||||
print STOP "pids=\`ps axww -o pid= -o command= | awk -v wd=\"$wadir/\" '\$0 ~ wd && \$0 !~ /miniserv\\.pl/ {print \$1}'\`\n";
|
||||
print STOP "[ -n \"\$pids\" ] && kill \$pids 2>/dev/null || true\n";
|
||||
print STOP "if [ \"\$1\" = \"--kill\" ]; then\n";
|
||||
print STOP " sleep 1\n";
|
||||
print STOP " pids=\`ps axww -o pid= -o command= | awk -v wd=\"$wadir/\" '\$0 ~ wd && \$0 !~ /miniserv\\.pl/ {print \$1}'\`\n";
|
||||
print STOP " [ -n \"\$pids\" ] && kill -KILL \$pids 2>/dev/null || true\n";
|
||||
print STOP "fi\n";
|
||||
print STOP "pidfile=\`grep \"^pidfile=\" $config_directory/miniserv.conf | sed -e 's/pidfile=//g'\`\n";
|
||||
print STOP "pid=\`cat \$pidfile 2>/dev/null\`\n";
|
||||
print STOP "if [ \"\$pid\" != \"\" ]; then\n";
|
||||
@@ -971,7 +978,7 @@ if (!$ENV{'nostart'}) {
|
||||
print " - DateTime, DateTime::Locale, DateTime::TimeZone, Data::Dumper,\n";
|
||||
print " - Digest::MD5, Digest::SHA, Encode::Detect, File::Basename,\n";
|
||||
print " - File::Path, Net::SSLeay, Time::HiRes, Time::Local, Time::Piece,\n";
|
||||
print " - JSON::XS, lib, open\n";
|
||||
print " - Socket6, Sys::Syslog, JSON::XS, lib, open\n";
|
||||
print " Packages:\n";
|
||||
print " - openssl - Cryptography library with TLS implementation\n";
|
||||
print " - shared-mime-info - Shared MIME information database\n";
|
||||
|
||||
9
setup.sh
9
setup.sh
@@ -695,6 +695,13 @@ echo " echo Force stopping Webmin server in $wadir" >>$config_dir/.stop-init
|
||||
echo "else" >>$config_dir/.stop-init
|
||||
echo " echo Stopping Webmin server in $wadir" >>$config_dir/.stop-init
|
||||
echo "fi" >>$config_dir/.stop-init
|
||||
echo "pids=\`ps axww -o pid= -o command= | awk -v wd=\"$wadir/\" '\$0 ~ wd && \$0 !~ /miniserv\\.pl/ {print \$1}'\`" >>$config_dir/.stop-init
|
||||
echo "[ -n \"\$pids\" ] && kill \$pids 2>/dev/null || true" >>$config_dir/.stop-init
|
||||
echo "if [ \"\$1\" = \"--kill\" ]; then" >>$config_dir/.stop-init
|
||||
echo " sleep 1" >>$config_dir/.stop-init
|
||||
echo " pids=\`ps axww -o pid= -o command= | awk -v wd=\"$wadir/\" '\$0 ~ wd && \$0 !~ /miniserv\\.pl/ {print \$1}'\`" >>$config_dir/.stop-init
|
||||
echo " [ -n \"\$pids\" ] && kill -KILL \$pids 2>/dev/null || true" >>$config_dir/.stop-init
|
||||
echo "fi" >>$config_dir/.stop-init
|
||||
echo "pidfile=\`grep \"^pidfile=\" $config_dir/miniserv.conf | sed -e 's/pidfile=//g'\`" >>$config_dir/.stop-init
|
||||
echo "pid=\`cat \$pidfile 2>/dev/null\`" >>$config_dir/.stop-init
|
||||
echo "if [ \"\$pid\" != \"\" ]; then" >>$config_dir/.stop-init
|
||||
@@ -1063,7 +1070,7 @@ if [ "$nostart" = "" ]; then
|
||||
echo " - DateTime, DateTime::Locale, DateTime::TimeZone, Data::Dumper,"
|
||||
echo " - Digest::MD5, Digest::SHA, Encode::Detect, File::Basename,"
|
||||
echo " - File::Path, Net::SSLeay, Time::HiRes, Time::Local, Time::Piece,"
|
||||
echo " - JSON::XS, lib, open"
|
||||
echo " - Socket6, Sys::Syslog, JSON::XS, lib, open"
|
||||
echo " Packages:"
|
||||
echo " - openssl - Cryptography library with TLS implementation"
|
||||
echo " - shared-mime-info - Shared MIME information database"
|
||||
|
||||
10
ui-lib.pl
10
ui-lib.pl
@@ -1108,9 +1108,8 @@ if (dir == 1 && opts_idx >= 0) {
|
||||
for(var i=0; i<opts.options.length; i++) {
|
||||
var o = opts.options[i];
|
||||
if (o.selected) {
|
||||
vals.options[vals.options.length] =
|
||||
new Option(o.text, o.value);
|
||||
opts.remove(i);
|
||||
o.selected = false;
|
||||
vals.add(o, 0);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
@@ -1120,9 +1119,8 @@ else if (dir == 0 && vals_idx >= 0) {
|
||||
for(var i=0; i<vals.options.length; i++) {
|
||||
var o = vals.options[i];
|
||||
if (o.selected) {
|
||||
opts.options[opts.options.length] =
|
||||
new Option(o.text, o.value);
|
||||
vals.remove(i);
|
||||
o.selected = false;
|
||||
opts.add(o, 0);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7581,14 +7581,8 @@ if ($opened) {
|
||||
close $fh or return "Error: close($file): $!";
|
||||
}
|
||||
|
||||
# Optionally print to UI (web scripts only)
|
||||
if ($main::webmin_script_type eq 'web') {
|
||||
# Print HTTP header once per process
|
||||
our $var_dump__hdr_sent ||= 0;
|
||||
if (!$var_dump__hdr_sent && !$main::done_webmin_header) {
|
||||
print "Content-type: text/html; charset=UTF-8\n\n";
|
||||
$var_dump__hdr_sent = 1;
|
||||
}
|
||||
# Optionally print to UI (web scripts only) only if header already sent
|
||||
if ($main::done_webmin_header && $main::webmin_script_type eq 'web') {
|
||||
# Limit long dumps by wrapping parameter chunks between accordion lines
|
||||
my $out = $dump_txt;
|
||||
# Add header
|
||||
@@ -13261,11 +13255,11 @@ if (!$def && $gconfig{'webmin_email_url'}) {
|
||||
# From a config option
|
||||
$url = $gconfig{'webmin_email_url'};
|
||||
}
|
||||
elsif ($ENV{'HTTP_HOST'} || $ENV{'SSL_HOST'}) {
|
||||
elsif ($ENV{'HTTP_HOST'} || $ENV{'SSL_CN'}) {
|
||||
# From this HTTP request
|
||||
my $port = $ENV{'SERVER_PORT'} || 80;
|
||||
my $host = $ENV{'SSL_HOST'}
|
||||
? "$ENV{'SSL_HOST'}:$port"
|
||||
my $host = $ENV{'SSL_CN'}
|
||||
? "$ENV{'SSL_CN'}:$port"
|
||||
: $ENV{'HTTP_HOST'};
|
||||
if ($host =~ s/:(\d+)$//) {
|
||||
$port = $1;
|
||||
|
||||
Reference in New Issue
Block a user