Also warn about RAM disks
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled

This commit is contained in:
Jamie Cameron
2026-02-25 15:16:43 -08:00
4 changed files with 25 additions and 12 deletions

View File

@@ -504,7 +504,11 @@ acl_sysinfo=Show available disk data on Dashboard?
sysinfo_total=Total
sysinfo_dev=Device ID
<<<<<<< HEAD
sysinfo_smalltmp=Warning! The filesystem $2 which contains the Webmin temp files directory $1 has a size of only $4, which is less than the recommended minimum of $3 for temporary and backup files. Consider switching the temp files location to a different directory in the <a href='$5'>Webmin Configuration</a> module.
sysinfo_ramtmp=Warning! The filesystem $2 which contains the Webmin temp files directory $1 is mounted from a <tt>tmpfs</tt> RAM disk, which may be too small for temporary and backup files. Consider switching the temp files location to a different directory in the <a href='$3'>Webmin Configuration</a> module.
=======
sysinfo_smalltmp=The filesystem $2 which contains the Webmin temp files directory $1 has a size of only $4, which is less than the recommended minimum of $3 for temporary and backup files. Consider switching the temp files location to a different directory in the <a href='$5'>Webmin Configuration</a> module.
>>>>>>> 3354a0cc2fa31610b76563f3baa444766d86b7e3
__norefs=1

View File

@@ -86,7 +86,7 @@ my @rv = ({ 'type' => 'html',
# Check if the filesystem the Webmin temp dir is on is too small
if (&foreign_available("webmin")) {
my $tmp = $gconfig{'tempdir'} || &default_webmin_temp_dir();
my $small = 10*1024*1024*102; # 10 MB
my $small = 10*1024*1024; # 10 MB
my $url = &get_webprefix()."/webmin/edit_advanced.cgi";
foreach my $disk (sort { length($b->{'dir'}) <=>
length($a->{'dir'}) } @$disks) {

View File

@@ -3355,8 +3355,9 @@ return &theme_ui_note(@_) if (defined(&theme_ui_note));
my ($text, $whitespace) = @_;
$whitespace //= 2;
my $whitespace_str = "&nbsp;" x $whitespace;
return "<font style='font-size:92%;opacity:0.66'>${whitespace_str}ⓘ&nbsp;&nbsp;".
"$text</font>";
return "<font class='ui_note' style='font-size:92%;opacity:0.66'>".
"${whitespace_str}ⓘ&nbsp;&nbsp;$text".
"</font>";
}
=head2 ui_brh()

View File

@@ -10400,22 +10400,29 @@ $dir =~ s/\/*$/\//;
return substr($file, 0, length($dir)) eq $dir;
}
=head2 parse_http_url(url, [basehost, baseport, basepage, basessl])
=head2 parse_http_url(url, [basehost], [baseport], [basepage],
[basessl], [baseuser], [basepass], [no-default-port])
Given an absolute URL, returns the host, port, page and ssl flag components.
If a username and password are given before the hostname, return those too.
Relative URLs can also be parsed, if the base information is provided.
If C<no-default-port> is set, omitted ports in absolute URLs are returned as
undef instead of being normalized to 80/443/21.
SSL mode 0 = HTTP, 1 = HTTPS, 2 = FTP.
=cut
sub parse_http_url
{
if ($_[0] =~ /^(http|https|ftp):\/\/([^\@\/]+\@)?\[([^\]]+)\](:(\d+))?(\/\S*)?$/ ||
$_[0] =~ /^(http|https|ftp):\/\/([^\@\/]+\@)?([^:\/]+)(:(\d+))?(\/\S*)?$/) {
my ($url, $basehost, $baseport, $basepage, $basessl, $baseuser, $basepass,
$no_default_port) = @_;
if ($url =~ /^(http|https|ftp):\/\/([^\@\/]+\@)?\[([^\]]+)\](:(\d+))?(\/\S*)?$/ ||
$url =~ /^(http|https|ftp):\/\/([^\@\/]+\@)?([^:\/]+)(:(\d+))?(\/\S*)?$/) {
# An absolute URL
my $ssl = $1 eq 'https' ? 1 : $1 eq 'ftp' ? 2 : 0;
my $port = $4 ? $5 : $no_default_port ? undef :
$ssl == 1 ? 443 : $ssl == 2 ? 21 : 80;
my @rv = ($3,
$4 ? $5 : $ssl == 1 ? 443 : $ssl == 2 ? 21 : 80,
$port,
$6 || "/",
$ssl,
);
@@ -10424,19 +10431,20 @@ if ($_[0] =~ /^(http|https|ftp):\/\/([^\@\/]+\@)?\[([^\]]+)\](:(\d+))?(\/\S*)?$/
}
return @rv;
}
elsif (!$_[1]) {
elsif (!$basehost) {
# Could not parse
return undef;
}
elsif ($_[0] =~ /^\/\S*$/) {
elsif ($url =~ /^\/\S*$/) {
# A relative to the server URL
return ($_[1], $_[2], $_[0], $_[4], $_[5], $_[6]);
return ($basehost, $baseport, $url, $basessl, $baseuser, $basepass);
}
else {
# A relative to the directory URL
my $page = $_[3];
my $page = $basepage;
$page =~ s/[^\/]+$//;
return ($_[1], $_[2], $page.$_[0], $_[4], $_[5], $_[6]);
return ($basehost, $baseport, $page.$url, $basessl,
$baseuser, $basepass);
}
}