Majoe French translation update, thanks to ButterflyOfFire.
Allow per-language language overrides to be defined, in custom-lang.$code files.
Updated numerous modules to improve support for Debian 6 and Ubuntu 10.10.
-If a browser asks for gzip compression and a file with a .gz extension exists in the same directory as a static file, Webmin will now serve the gzipped file instead.
+If a browser asks for gzip compression and a file with a .gz extension exists in the same directory as a static file, Webmin will now serve the gzipped file instead. If the Compress::Zlib perl module is installed and dynamic compression is enabled in the Webmin Configuration module, all non-image files will be served compressed.
Added support for Amazon Linux.
}
}
+# Load gzip library if enabled
+if ($config{'gzip'} eq '1') {
+ eval "use Compress::Zlib";
+ if (!$@) {
+ $use_gzip = 1;
+ }
+ }
+
# Setup syslog support if possible and if requested
if ($use_syslog) {
open(ERRDUP, ">&STDERR");
$rv = 0;
}
}
+elsif ($use_gzip && $acceptenc{'gzip'} && &should_gzip_file($full)) {
+ # Load and compress file
+ print DEBUG "handle_request: outputting gzipped file $full\n";
+ open(FILE, $full) || &http_error(404, "Failed to open file");
+ {
+ local $/ = undef;
+ $data = <FILE>;
+ }
+ close(FILE);
+ @stopen = stat($file);
+ $data = Compress::Zlib::memGzip($data);
+ local $resp = "HTTP/1.0 $ok_code $ok_message\r\n".
+ "Date: $datestr\r\n".
+ "Server: $config{server}\r\n".
+ "Content-type: ".&get_type($full)."\r\n".
+ "Content-length: ".length($data)."\r\n".
+ "Last-Modified: ".&http_date($stopen[9])."\r\n".
+ "Content-Encoding: gzip\r\n".
+ "Expires: ".&http_date(time()+$config{'expires'})."\r\n";
+ &write_data($resp);
+ $rv = &write_keep_alive();
+ &write_data("\r\n");
+ &reset_byte_count();
+ &write_data($data);
+ }
else {
# A file to output
print DEBUG "handle_request: outputting file $full\n";
}
select(STDERR); $| = 1; select(STDOUT);
}
+
+# should_gzip_file(filename)
+# Returns 1 if some path should be gzipped
+sub should_gzip_file
+{
+my ($path) = @_;
+return $path !~ /\.(gif|png|jpg|jpeg|tif|tiff)$/i;
+}
+
# Save password pass option
$miniserv{'pass_password'} = $in{'pass'};
+# Save gzip option
+if ($in{'gzip'} == 1) {
+ eval "use Compress::Zlib";
+ $@ && &error(&text('advanced_egzip', '<tt>Compress::Zlib</tt>'));
+ }
+$miniserv{'gzip'} = $in{'gzip'};
+
&lock_file($ENV{'MINISERV_CONFIG'});
&put_miniserv_config(\%miniserv);
&unlock_file($ENV{'MINISERV_CONFIG'});
--- /dev/null
+cron_mode=Çàäàâàòü âðåìÿ â "Îáíîâëåíèè ïî ðàñïèñàíèþ" êàê,1,0-Ïðîñòîé èíòåðôåéñ,1-Cron time selector
+warn_days=Çà ñêîëüêî äíåé ïðåäóïðåæäàòü ïîëüçîâàòåëåé îá èñòå÷åíèè ñðîêà äåéñòâèÿ ïàðîëÿ,0,5
+third_url=URL ñïèñêà ñòîðîííèõ ìîäóëåé,3,Íà www.webmin.com
+standard_url=URL ñïèñêà ñòàíäàðòíûõ ìîäóëåé,3,Íà www.webmin.com
}
}
+# Gzip static files?
+print &ui_table_row($text{'advanced_gzip'},
+ &ui_radio("gzip", $miniserv{'gzip'},
+ [ [ '', $text{'advanced_gzipauto'} ],
+ [ 0, $text{'advanced_gzip0'} ],
+ [ 1, $text{'advanced_gzip1'} ] ]));
+
print &ui_table_end();
print &ui_form_end([ [ "save", $text{'save'} ] ]);
advanced_pri=Priority level
advanced_sclass=IO class for scheduled jobs
advanced_sprio=IO priority for scheduled jobs
+advanced_gzip=Server gzip compressed static files?
+advanced_gzipauto=If pre-compressed .gz file exists
+advanced_gzip0=Never
+advanced_gzip1=Always compress dynamically
+advanced_egzip=Gzip compression cannot be enabled unless the $1 perl module is installed
syslog_errorlog=Webmin error log