Compare commits
494 Commits
2.021
...
dev/server
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
486b323990 | ||
|
|
4b89587726 | ||
|
|
f24fa4af6a | ||
|
|
dda33af768 | ||
|
|
cc05c62609 | ||
|
|
3c113c9278 | ||
|
|
8b09edc5d3 | ||
|
|
643ace4777 | ||
|
|
097e24a7b1 | ||
|
|
f797d29b81 | ||
|
|
aca381b118 | ||
|
|
195ea913df | ||
|
|
7232db4b57 | ||
|
|
f688f29029 | ||
|
|
057f10d868 | ||
|
|
086ebe845a | ||
|
|
3e47779858 | ||
|
|
39132506e8 | ||
|
|
71dc51523a | ||
|
|
93a853f95f | ||
|
|
c0edba233a | ||
|
|
368dacd028 | ||
|
|
b49d4f8147 | ||
|
|
8f3fb71b68 | ||
|
|
01e4a5145d | ||
|
|
f3bc8c9061 | ||
|
|
9e58110854 | ||
|
|
2b2ead4d7d | ||
|
|
827c77c960 | ||
|
|
9db9582f4a | ||
|
|
20f0538c64 | ||
|
|
a026b69736 | ||
|
|
5b760082d9 | ||
|
|
487b11e9be | ||
|
|
8c236004c9 | ||
|
|
1025f8c657 | ||
|
|
14ad4cbf85 | ||
|
|
0a1f12c22b | ||
|
|
a9070e4bc3 | ||
|
|
679a590b0c | ||
|
|
797dd6a59c | ||
|
|
0b72f7f895 | ||
|
|
6472213dcc | ||
|
|
80df962012 | ||
|
|
944236d454 | ||
|
|
43dc4a479e | ||
|
|
9355b4969d | ||
|
|
0cd1d43fef | ||
|
|
44b06c8908 | ||
|
|
d78b8e0e1d | ||
|
|
312f55fe11 | ||
|
|
87b54273ff | ||
|
|
dedfaa49ae | ||
|
|
944400a136 | ||
|
|
d3cdbbcc4b | ||
|
|
ef9e525bd6 | ||
|
|
0754367f48 | ||
|
|
3a7145b2e3 | ||
|
|
8dd96e2aca | ||
|
|
f49539ad96 | ||
|
|
739411a07e | ||
|
|
ea8c76b5b8 | ||
|
|
d191f1ba92 | ||
|
|
444c101d19 | ||
|
|
9017d290bc | ||
|
|
2733f945c5 | ||
|
|
231df9c37f | ||
|
|
dbde3d370b | ||
|
|
1e07f0c93a | ||
|
|
9ed3fd2237 | ||
|
|
629ca21a3a | ||
|
|
0f898b161b | ||
|
|
de53c330d6 | ||
|
|
d9401ff1b7 | ||
|
|
e33c5aa630 | ||
|
|
8ac62d43bd | ||
|
|
c2c3533e4e | ||
|
|
bfe966f6cf | ||
|
|
75b1401e62 | ||
|
|
f1159015ed | ||
|
|
9c348f7909 | ||
|
|
c80d854054 | ||
|
|
f6299b4e29 | ||
|
|
b91e25aa6f | ||
|
|
a268373550 | ||
|
|
8d595a7ac5 | ||
|
|
2065602494 | ||
|
|
d27e37efbf | ||
|
|
85f9402bfe | ||
|
|
6bb6a0de01 | ||
|
|
081dfbe373 | ||
|
|
8d330a95de | ||
|
|
ac5f974d5c | ||
|
|
3f1306e9cf | ||
|
|
8bd7c32c10 | ||
|
|
cf7165ffaa | ||
|
|
dd4c7e6fe1 | ||
|
|
5aa1986a30 | ||
|
|
ff09a096cb | ||
|
|
ca74a730ee | ||
|
|
e208907db1 | ||
|
|
83c0cb66e5 | ||
|
|
675dd4d269 | ||
|
|
f49f068cdc | ||
|
|
f39282e0d0 | ||
|
|
b66a2ac0c2 | ||
|
|
2bc982127d | ||
|
|
21e76d19bf | ||
|
|
5ec3664397 | ||
|
|
be449d6fe2 | ||
|
|
1248c603e6 | ||
|
|
1ba3cdcbc9 | ||
|
|
3e5b68507e | ||
|
|
d11257cf84 | ||
|
|
a2204e46e0 | ||
|
|
61197c485f | ||
|
|
3f39df4203 | ||
|
|
6386ece898 | ||
|
|
ead4e97574 | ||
|
|
209ee473de | ||
|
|
4e06d22d85 | ||
|
|
a70a0de807 | ||
|
|
2788697c25 | ||
|
|
126b96730b | ||
|
|
c24c544225 | ||
|
|
7373913b0b | ||
|
|
90a21972ad | ||
|
|
17c3dbcf81 | ||
|
|
2ae51b03fd | ||
|
|
a353a11653 | ||
|
|
61e80f5d9f | ||
|
|
f931b6dc01 | ||
|
|
2ae5317946 | ||
|
|
50e4738f61 | ||
|
|
46a6379510 | ||
|
|
a0ede6b7e9 | ||
|
|
f27277c4eb | ||
|
|
d53bace45c | ||
|
|
1b689c4eb9 | ||
|
|
5677804487 | ||
|
|
e70d5ce764 | ||
|
|
45d6c8d235 | ||
|
|
a95ccc006b | ||
|
|
9bcf02a9b0 | ||
|
|
8c5a479d3a | ||
|
|
6872d8b6d6 | ||
|
|
036c08bb1d | ||
|
|
61805cee73 | ||
|
|
665c867601 | ||
|
|
3509d76a8c | ||
|
|
e55f6d0908 | ||
|
|
b00f24f0b5 | ||
|
|
07a46ff561 | ||
|
|
5954e40808 | ||
|
|
3e9a0e84fc | ||
|
|
a837b21013 | ||
|
|
a38229817a | ||
|
|
90c36605e8 | ||
|
|
e552c68f7e | ||
|
|
7708bc240c | ||
|
|
f6a3381682 | ||
|
|
fffe6fad63 | ||
|
|
cd1345cf30 | ||
|
|
e8264986af | ||
|
|
472bd9c0e4 | ||
|
|
18552ad5ab | ||
|
|
1bdcc54f21 | ||
|
|
ca5c75785d | ||
|
|
d0e84297eb | ||
|
|
df3b10c449 | ||
|
|
72c5e39121 | ||
|
|
cdd01e41bb | ||
|
|
5fc5fea30a | ||
|
|
a276ca7c14 | ||
|
|
a58fcffcb3 | ||
|
|
12bca2adb8 | ||
|
|
33fd258c71 | ||
|
|
9a69913ccb | ||
|
|
3d67e17cef | ||
|
|
61a40022d7 | ||
|
|
5a7dd1a458 | ||
|
|
74202c964f | ||
|
|
dc7d517989 | ||
|
|
b662f8d0c3 | ||
|
|
191ea97ea7 | ||
|
|
b0f33b6156 | ||
|
|
98b67cd60e | ||
|
|
edffeba60b | ||
|
|
88ae0b68f0 | ||
|
|
303b5ee31a | ||
|
|
f694b01535 | ||
|
|
37857ceeed | ||
|
|
5b8239c239 | ||
|
|
8e3fdf43b0 | ||
|
|
c7198232f5 | ||
|
|
3855a5f480 | ||
|
|
37a03e720c | ||
|
|
58229c1653 | ||
|
|
4ee13f0e20 | ||
|
|
8d66b62fce | ||
|
|
eae51d8492 | ||
|
|
1a0dec8f1e | ||
|
|
991e10a266 | ||
|
|
ec21297448 | ||
|
|
b97acb1e21 | ||
|
|
02236da8bc | ||
|
|
b3ab3f65a8 | ||
|
|
a5ba7ebe05 | ||
|
|
0e93560003 | ||
|
|
35922c6da6 | ||
|
|
71267fb601 | ||
|
|
6a079198bd | ||
|
|
88bd2825ab | ||
|
|
13da04673f | ||
|
|
68d6d831a1 | ||
|
|
23bd2fbe3f | ||
|
|
e56298f55b | ||
|
|
f19acd68b2 | ||
|
|
57df3868b5 | ||
|
|
ff140aab1b | ||
|
|
754f1efc66 | ||
|
|
2d9ddefe50 | ||
|
|
aa01bc8231 | ||
|
|
add8a4eff6 | ||
|
|
11e3fcc3a6 | ||
|
|
87c087dda9 | ||
|
|
605a32f87d | ||
|
|
7988abf900 | ||
|
|
08141fae66 | ||
|
|
2be85afce9 | ||
|
|
e77b97bc5f | ||
|
|
adbd30bacc | ||
|
|
e7a769ccf8 | ||
|
|
349a1f5873 | ||
|
|
f7a13c9f9e | ||
|
|
62d3c08fbd | ||
|
|
9296b12a71 | ||
|
|
2e06ab94b6 | ||
|
|
8938680044 | ||
|
|
ece9d2af52 | ||
|
|
185d2b546e | ||
|
|
d6e21f43ce | ||
|
|
3f470a4bcd | ||
|
|
9e714d7f57 | ||
|
|
8cd0b8ab49 | ||
|
|
1f339f2085 | ||
|
|
385d006c08 | ||
|
|
5db29277e4 | ||
|
|
21f4a9b368 | ||
|
|
121cbc4a95 | ||
|
|
93cc86315d | ||
|
|
76bf9ffd62 | ||
|
|
8319033bfa | ||
|
|
cb6e110f40 | ||
|
|
48abceeebd | ||
|
|
dc530e2faa | ||
|
|
3191805a88 | ||
|
|
d19809b79b | ||
|
|
ed1b7e862c | ||
|
|
d33b1e2681 | ||
|
|
d62f474d12 | ||
|
|
8df605cb15 | ||
|
|
10a56c13b5 | ||
|
|
820e128c14 | ||
|
|
39ef3f8c65 | ||
|
|
ada885ef41 | ||
|
|
6f7e322349 | ||
|
|
1f46918693 | ||
|
|
e29bb0eb53 | ||
|
|
102da88262 | ||
|
|
1f28b054fe | ||
|
|
79426c6aec | ||
|
|
d08d4a22d1 | ||
|
|
c66c078bde | ||
|
|
ec1501b329 | ||
|
|
4bf101d988 | ||
|
|
58a7faa684 | ||
|
|
4ac9d06f3a | ||
|
|
2c93a3c694 | ||
|
|
51595a6a92 | ||
|
|
9d382df56d | ||
|
|
79be97bbe4 | ||
|
|
cbc3078125 | ||
|
|
12822f97e5 | ||
|
|
fab2a1c871 | ||
|
|
c4fdb9524f | ||
|
|
8ffaf20d58 | ||
|
|
9b15a63781 | ||
|
|
fc0efe9ed5 | ||
|
|
c4866735ba | ||
|
|
ee1c42960a | ||
|
|
fb947920ef | ||
|
|
b9c154911a | ||
|
|
95f31ab26b | ||
|
|
e504bd7e8e | ||
|
|
9ecfb06187 | ||
|
|
27d8eea869 | ||
|
|
69d359c4fe | ||
|
|
1df55f32eb | ||
|
|
e92a82142a | ||
|
|
6eb3e42e17 | ||
|
|
146e4d0899 | ||
|
|
8a7abe98f2 | ||
|
|
338df27457 | ||
|
|
76c7ca743a | ||
|
|
3aa58e4523 | ||
|
|
74373af3de | ||
|
|
3996ff205f | ||
|
|
794ca0f651 | ||
|
|
e288f1b955 | ||
|
|
f22bada12c | ||
|
|
6af198b2f1 | ||
|
|
3de93296a9 | ||
|
|
29bb158ef4 | ||
|
|
7b37cedaf6 | ||
|
|
18392aab61 | ||
|
|
702fc7d584 | ||
|
|
cc15a65c47 | ||
|
|
377c64ef47 | ||
|
|
43edaacada | ||
|
|
b1f0c46059 | ||
|
|
6a693e3dc7 | ||
|
|
2436c25a46 | ||
|
|
352e3855db | ||
|
|
46e8076793 | ||
|
|
d308aa8ae8 | ||
|
|
96132e28d6 | ||
|
|
b0731f6e35 | ||
|
|
a4f7cb1f8c | ||
|
|
953c4ed020 | ||
|
|
d5a3eebe85 | ||
|
|
c92395176f | ||
|
|
ab44aa8023 | ||
|
|
152414d631 | ||
|
|
5e9f137adf | ||
|
|
f29d01a7be | ||
|
|
87aa2576c2 | ||
|
|
728ae07eed | ||
|
|
cfd66281eb | ||
|
|
e8526e00b4 | ||
|
|
b5b6c44d5f | ||
|
|
8f1a5a6376 | ||
|
|
9f58118635 | ||
|
|
d34994b5c0 | ||
|
|
07f8f1df4e | ||
|
|
04d75bc526 | ||
|
|
cf9e00060b | ||
|
|
a21ad361d9 | ||
|
|
873c324d0d | ||
|
|
3504c3f389 | ||
|
|
5f17149189 | ||
|
|
baf8a643bb | ||
|
|
1236027445 | ||
|
|
2160a3d47a | ||
|
|
9077922c57 | ||
|
|
a27ae8b7be | ||
|
|
d572edb7ed | ||
|
|
d4dcf6314c | ||
|
|
c7367e0f46 | ||
|
|
8ae1c01b5e | ||
|
|
996227d197 | ||
|
|
2081cf7002 | ||
|
|
3ec090f222 | ||
|
|
7e417a84e8 | ||
|
|
5d955fe3c8 | ||
|
|
117c97fcb9 | ||
|
|
a8748f3e97 | ||
|
|
8f46fbf836 | ||
|
|
1e97b55c9d | ||
|
|
26935dcda6 | ||
|
|
7188b3581a | ||
|
|
e63defe0d3 | ||
|
|
9eb2624deb | ||
|
|
bd2339aae4 | ||
|
|
cfa2e38162 | ||
|
|
3fa50f7222 | ||
|
|
696199033c | ||
|
|
05a34b099f | ||
|
|
b9b2546060 | ||
|
|
fa265c094b | ||
|
|
d915a3aacd | ||
|
|
c145c117af | ||
|
|
f42bb4ef1b | ||
|
|
550c21bca7 | ||
|
|
cc24384fea | ||
|
|
17d4090c45 | ||
|
|
2bbf06af99 | ||
|
|
699c9b9696 | ||
|
|
52450a7b3b | ||
|
|
2be0169902 | ||
|
|
295d3275bb | ||
|
|
7e8788cec3 | ||
|
|
5f46f05ba4 | ||
|
|
c68ffa8eb7 | ||
|
|
9b42e6d92a | ||
|
|
a698576f59 | ||
|
|
9d081e49d9 | ||
|
|
9a1da695cd | ||
|
|
913e326a71 | ||
|
|
1b3db94b73 | ||
|
|
0dc11e7385 | ||
|
|
c03fefd36d | ||
|
|
15c81e8ace | ||
|
|
3683c0e06c | ||
|
|
8c15fc9fdb | ||
|
|
25e5b2f4fc | ||
|
|
41a7d61df4 | ||
|
|
ad93a7cc53 | ||
|
|
7edccbe38b | ||
|
|
6310521982 | ||
|
|
ae544ec580 | ||
|
|
c2bbb27de4 | ||
|
|
797c38b9e6 | ||
|
|
2a1c5ce79c | ||
|
|
e260a96d93 | ||
|
|
4e96552b03 | ||
|
|
9a29c6f98e | ||
|
|
fae07aed8a | ||
|
|
62a3c9f237 | ||
|
|
cdf715ad2e | ||
|
|
33a8c5c8af | ||
|
|
06ae7b8582 | ||
|
|
9cf714d014 | ||
|
|
d1fe5d1bae | ||
|
|
f9c4cacd6c | ||
|
|
ce7e966c1a | ||
|
|
625f4ac93c | ||
|
|
fa311d5288 | ||
|
|
fa42a98acb | ||
|
|
81a8607628 | ||
|
|
2626d01005 | ||
|
|
1e5032c7a3 | ||
|
|
5dc2281e66 | ||
|
|
70fce1f97e | ||
|
|
da1ee58a7c | ||
|
|
4b3ef986bf | ||
|
|
14a07d4959 | ||
|
|
e3d4d2427c | ||
|
|
9bcee57c7c | ||
|
|
896fedf590 | ||
|
|
12e6b19586 | ||
|
|
3f322bee84 | ||
|
|
20d07a17a8 | ||
|
|
24b59c5b85 | ||
|
|
e5249a6e3b | ||
|
|
a3140c03da | ||
|
|
d154935e8f | ||
|
|
db8d712d83 | ||
|
|
d500367bdd | ||
|
|
03d245384d | ||
|
|
a89415739b | ||
|
|
e81c869531 | ||
|
|
690005a04f | ||
|
|
47043a41c5 | ||
|
|
5aaa81eeb6 | ||
|
|
b9ed596e3e | ||
|
|
e07db9663b | ||
|
|
48078357a3 | ||
|
|
9098936fc2 | ||
|
|
b425bdfbb7 | ||
|
|
392c010840 | ||
|
|
91a20d4b08 | ||
|
|
1db77e36eb | ||
|
|
a927647a07 | ||
|
|
0cc62bf748 | ||
|
|
37abb2707b | ||
|
|
31b2f92b88 | ||
|
|
850030ed17 | ||
|
|
c94e5d9aa0 | ||
|
|
215bfe083b | ||
|
|
af11d17cbd | ||
|
|
60141efc8e | ||
|
|
7ea1236eb6 | ||
|
|
a6597f6ebe | ||
|
|
31d69174fc | ||
|
|
364c37d755 | ||
|
|
c9c672a6a7 | ||
|
|
042e7de2f7 | ||
|
|
4b64ef0073 | ||
|
|
db869203db | ||
|
|
36f2e5d077 | ||
|
|
eaaa470818 | ||
|
|
e9f6ab278d | ||
|
|
764533a6e5 | ||
|
|
0f0e6ba516 | ||
|
|
8c0107f241 | ||
|
|
e0738d301b | ||
|
|
c7393d6e17 | ||
|
|
8694adcf93 | ||
|
|
483fb9074b | ||
|
|
a2adf19b80 | ||
|
|
0b8611b4fd | ||
|
|
8c50a2d147 | ||
|
|
03606c8214 |
@@ -774,14 +774,16 @@ if ($oldpass ne $user->{'pass'} &&
|
||||
my $nolock = $oldpass;
|
||||
$nolock =~ s/^\!//;
|
||||
$user->{'olds'} ||= [];
|
||||
unshift(@{$user->{'olds'}}, $nolock);
|
||||
if ($miniserv->{'pass_oldblock'}) {
|
||||
while(scalar(@{$user->{'olds'}}) >
|
||||
$miniserv->{'pass_oldblock'}) {
|
||||
pop(@{$user->{'olds'}});
|
||||
if (&indexof($nolock, @{$user->{'olds'}}) < 0) {
|
||||
unshift(@{$user->{'olds'}}, $nolock);
|
||||
if ($miniserv->{'pass_oldblock'}) {
|
||||
while(scalar(@{$user->{'olds'}}) >
|
||||
$miniserv->{'pass_oldblock'}) {
|
||||
pop(@{$user->{'olds'}});
|
||||
}
|
||||
}
|
||||
$user->{'lastchange'} = time();
|
||||
}
|
||||
$user->{'lastchange'} = time();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ if ($access{'lang'}) {
|
||||
if ($access{'locale'}) {
|
||||
# Current locale
|
||||
eval "use DateTime; use DateTime::Locale; use DateTime::TimeZone;";
|
||||
if (!$@) {
|
||||
if (!$@ && $] > 5.011) {
|
||||
my $locales = &list_locales();
|
||||
my %localesrev = reverse %{$locales};
|
||||
my $locale_auto = &parse_accepted_language();
|
||||
|
||||
@@ -38,7 +38,9 @@ if ($module_name ne 'htaccess') {
|
||||
# Need to build list of supported modules
|
||||
local ($ver, $mods, $fullver) = &httpd_info($httpd);
|
||||
if ($ver) {
|
||||
local @mods = map { "$_/$ver" } &configurable_modules();
|
||||
my @allmods = &available_modules();
|
||||
local @mods = map { "$_/$ver" }
|
||||
&configurable_modules(\@allmods);
|
||||
foreach my $m (@mods) {
|
||||
if ($m =~ /(\S+)\/(\S+)/) {
|
||||
$httpd_modules{$1} = $2;
|
||||
@@ -47,10 +49,14 @@ if ($module_name ne 'htaccess') {
|
||||
# Call again now that known modules have been set, as
|
||||
# sometimes there are dependencies due to LoadModule
|
||||
# statements in an IfModule block
|
||||
@mods = map { "$_/$ver" } &configurable_modules();
|
||||
undef(@get_config_cache);
|
||||
@allmods = &available_modules();
|
||||
@mods = map { "$_/$ver" }
|
||||
&configurable_modules(\@allmods);
|
||||
local %site = ( 'size' => $st[7],
|
||||
'path' => $httpd,
|
||||
'modules' => join(' ', @mods),
|
||||
'allmodules' => join(' ', @allmods),
|
||||
'version' => $ver,
|
||||
'fullversion' => $fullver,
|
||||
'webmin' => &get_webmin_version() );
|
||||
@@ -72,6 +78,9 @@ if (&read_file($site_file, \%site)) {
|
||||
$httpd_modules{$1} = $2;
|
||||
}
|
||||
}
|
||||
foreach $m (split(/\s+/, $site{'allmodules'})) {
|
||||
$all_httpd_modules{$m} = $site{'version'};
|
||||
}
|
||||
foreach $m (keys %httpd_modules) {
|
||||
if (!-r "$module_root_directory/$m.pl") {
|
||||
delete($httpd_modules{$m});
|
||||
@@ -1825,46 +1834,46 @@ for(my $i=0; $i<$secs; $i++) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
# configurable_modules()
|
||||
# configurable_modules([&all-mods])
|
||||
# Returns a list of Apaches that are compiled in or dynamically loaded, and
|
||||
# supported by Webmin.
|
||||
sub configurable_modules
|
||||
{
|
||||
local ($ver, $mods) = &httpd_info(&find_httpd());
|
||||
local @rv;
|
||||
local $m;
|
||||
my ($allmods) = @_;
|
||||
$allmods ||= [ &available_modules() ];
|
||||
return grep { -r "$module_root_directory/$_.pl" } @$allmods;
|
||||
}
|
||||
|
||||
# available_modules()
|
||||
# Returns a list of Apaches that are compiled in or dynamically loaded
|
||||
sub available_modules
|
||||
{
|
||||
my ($ver, $mods) = &httpd_info(&find_httpd());
|
||||
my @rv;
|
||||
|
||||
# Add compiled-in modules
|
||||
foreach $m (@$mods) {
|
||||
if (-r "$module_root_directory/$m.pl") {
|
||||
push(@rv, $m);
|
||||
}
|
||||
}
|
||||
push(@rv, @$mods);
|
||||
|
||||
# Add dynamically loaded modules
|
||||
local $conf = &get_config();
|
||||
foreach $l (&find_directive_struct("LoadModule", $conf)) {
|
||||
if ($l->{'words'}->[1] =~ /(mod_\S+)\.(so|dll)/ &&
|
||||
-r "$module_root_directory/$1.pl") {
|
||||
my $conf = &get_config();
|
||||
foreach my $l (&find_directive_struct("LoadModule", $conf)) {
|
||||
if ($l->{'words'}->[1] =~ /(mod_\S+)\.(so|dll)/) {
|
||||
push(@rv, $1);
|
||||
}
|
||||
elsif ($l->{'words'}->[1] =~ /libssl\.so/ &&
|
||||
-r "$module_root_directory/mod_apachessl.pl") {
|
||||
elsif ($l->{'words'}->[1] =~ /libssl\.so/) {
|
||||
push(@rv, "mod_apachessl");
|
||||
}
|
||||
elsif ($l->{'words'}->[1] =~ /lib([^\/\s]+)\.(so|dll)/ &&
|
||||
-r "$module_root_directory/mod_$1.pl") {
|
||||
elsif ($l->{'words'}->[1] =~ /lib([^\/\s]+)\.(so|dll)/) {
|
||||
push(@rv, "mod_$1");
|
||||
}
|
||||
}
|
||||
undef(@get_config_cache); # Cache is no longer valid
|
||||
|
||||
# Add dynamically loaded modules
|
||||
if ($config{'apachectl_path'}) {
|
||||
&open_execute_command(APACHE,
|
||||
"$config{'apachectl_path'} -M 2>/dev/null", 1);
|
||||
while(<APACHE>) {
|
||||
if (/(\S+)_module/ && -r "$module_root_directory/mod_${1}.pl") {
|
||||
if (/(\S+)_module/) {
|
||||
push(@rv, "mod_${1}");
|
||||
}
|
||||
}
|
||||
|
||||
19
apache/config-freebsd-11.0-ALL
Normal file
@@ -0,0 +1,19 @@
|
||||
show_list=0
|
||||
httpd_dir=/usr/local
|
||||
httpd_path=/usr/local/sbin/httpd
|
||||
apachectl_path=/usr/local/sbin/apachectl
|
||||
httpd_conf=/usr/local/etc/apache24/httpd.conf
|
||||
mime_types=/usr/local/etc/apache24/mime.types
|
||||
srm_conf=/usr/local/etc/apache24/srm.conf
|
||||
access_conf=/usr/local/etc/apache24/access.conf
|
||||
show_order=0
|
||||
max_servers=100
|
||||
test_config=1
|
||||
test_manual=0
|
||||
test_always=0
|
||||
test_apachectl=1
|
||||
auto_mods=1
|
||||
pid_file=/var/run/httpd.pid
|
||||
show_names=0
|
||||
allow_virtualmin=0
|
||||
format_config=1
|
||||
@@ -1,11 +1,11 @@
|
||||
show_list=0
|
||||
httpd_dir=/usr/apache2/2.2
|
||||
httpd_conf=/etc/apache2/2.2/httpd.conf
|
||||
httpd_path=/usr/apache2/2.2/bin/httpd
|
||||
apachectl_path=/usr/apache2/2.2/bin/apachectl
|
||||
pid_file=/var/run/apache2/2.2/httpd.pid
|
||||
start_cmd=svcadm enable svc:/network/http:apache22
|
||||
stop_cmd=svcadm disable svc:/network/http:apache22
|
||||
httpd_dir=/usr/apache2/2.4
|
||||
httpd_conf=/etc/apache2/2.4/httpd.conf
|
||||
httpd_path=/usr/apache2/2.4/bin/httpd
|
||||
apachectl_path=/usr/apache2/2.4/bin/apachectl
|
||||
pid_file=/var/run/apache2/2.4/httpd.pid
|
||||
start_cmd=svcadm enable svc:/network/http:apache24
|
||||
stop_cmd=svcadm disable svc:/network/http:apache24
|
||||
mime_types=
|
||||
srm_conf=
|
||||
access_conf=
|
||||
|
||||
@@ -1041,7 +1041,7 @@ sub edit_LimitRequestBody
|
||||
{
|
||||
return (1, $text{'core_maxbody'},
|
||||
&opt_input($_[0]->{'value'}, "LimitRequestBody", $text{'core_default'}, 8)
|
||||
.$text{'bytes'});
|
||||
.&ui_space(2).$text{'bytes'});
|
||||
}
|
||||
sub save_LimitRequestBody
|
||||
{
|
||||
@@ -1052,7 +1052,7 @@ sub edit_LimitXMLRequestBody
|
||||
{
|
||||
return (1, $text{'core_maxxml'},
|
||||
&opt_input($_[0]->{'value'}, "LimitXMLRequestBody",
|
||||
$text{'core_default'}, 8).$text{'bytes'});
|
||||
$text{'core_default'}, 8).&ui_space(2).$text{'bytes'});
|
||||
}
|
||||
sub save_LimitXMLRequestBody
|
||||
{
|
||||
|
||||
@@ -637,6 +637,7 @@ mod_proxy_preserve=Preserve original Host: header
|
||||
mod_proxy_timeout=Proxy request timeout in seconds
|
||||
mod_proxy_etimeout=Proxy request timeout must be a number of seconds
|
||||
mod_proxy_via=Set Via: headers
|
||||
mod_proxy_preserve=Preserve original HTTP host
|
||||
mod_proxy_not=None
|
||||
|
||||
mod_log_agent_default=Default
|
||||
|
||||
@@ -25,6 +25,7 @@ $rv = [ [ 'ProxyRequests', 0, 13, 'virtual', undef, 11 ],
|
||||
[ 'ProxyMaxForwards', 0, 13, 'virtual', 2.0 ],
|
||||
[ 'ProxyPreserveHost', 0, 13, 'virtual', 2.031 ],
|
||||
[ 'ProxyTimeout', 0, 13, 'virtual', 2.031 ],
|
||||
[ 'ProxyPreserveHost', 0, 13, 'virtual', 2.3 ],
|
||||
[ 'ProxyVia', 0, 13, 'virtual', 2.0 ] ];
|
||||
return &make_directives($rv, $_[0], "mod_proxy");
|
||||
}
|
||||
@@ -291,7 +292,16 @@ sub save_ProxyVia
|
||||
return &parse_choice("ProxyVia", "");
|
||||
}
|
||||
|
||||
|
||||
sub edit_ProxyPreserveHost
|
||||
{
|
||||
return (1, $text{'mod_proxy_preserve'},
|
||||
&choice_input($_[0]->{'value'}, "ProxyPreserveHost", "",
|
||||
"$text{'yes'},on", "$text{'no'},off", "$text{'default'},"));
|
||||
}
|
||||
sub save_ProxyPreserveHost
|
||||
{
|
||||
return &parse_choice("ProxyPreserveHost", "");
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ sub edit_SuexecUserGroup
|
||||
local $rv;
|
||||
$rv .= sprintf "<input type=radio name=SuexecUserGroup_def value=1 %s> %s\n",
|
||||
$_[0] ? "" : "checked", $text{'suexec_none'};
|
||||
$rv .= &ui_newline();
|
||||
$rv .= sprintf "<input type=radio name=SuexecUserGroup_def value=0 %s>\n",
|
||||
$_[0] ? "checked" : "";
|
||||
$rv .= sprintf "%s <input name=SuexecUserGroup_u size=8 value='%s'> %s\n",
|
||||
|
||||
@@ -159,7 +159,9 @@ $rv .= "<table id='show_backup_destination' cellpadding=1 cellspacing=0>";
|
||||
# Local file field
|
||||
$rv .= "<tr><td>".&ui_oneradio("$_[0]_mode", 0, undef, $mode == 0)."</td>\n";
|
||||
$rv .= "<td>$text{'backup_mode0'} </td><td colspan='3'>".
|
||||
&ui_textbox("$_[0]_file", $mode == 0 ? $path : "", 60).
|
||||
&ui_textbox("$_[0]_file", $mode == 0 ? $path : "", 60, undef, undef,
|
||||
($_[2] != 1 && $config{'date_subs'}) ?
|
||||
'placeholder="/backups/configs-%y-%m-%d-%H-%M-%S.tar.gz"' : undef).
|
||||
" ".&file_chooser_button("$_[0]_file")."</td> </tr>\n";
|
||||
|
||||
# FTP file fields
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
date_subs=0
|
||||
date_subs=1
|
||||
webmin_subs=0
|
||||
apply=1
|
||||
|
||||
@@ -48,13 +48,12 @@ if (@backups) {
|
||||
print &ui_columns_end();
|
||||
}
|
||||
else {
|
||||
print "<b>$text{'index_none'}</b><p>\n";
|
||||
print "<strong>$text{'index_none'}</strong><br>\n";
|
||||
}
|
||||
print &ui_link("edit.cgi?new=1", $text{'index_add'});
|
||||
print "<p>\n";
|
||||
print "\n";
|
||||
if ($using_strftime && !$config{'date_subs'}) {
|
||||
print "<font color=#ff0000><b>$text{'index_nostrftime'}",
|
||||
"</b></font><p>\n";
|
||||
print &ui_alert_box($text{'index_nostrftime'}, 'warn'),"\n";
|
||||
}
|
||||
print &ui_tabs_end_tab();
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ index_now2=Restore Now
|
||||
index_apply=Apply configurations?
|
||||
index_test=Just show what will be restored?
|
||||
index_jobs=Scheduled Backups
|
||||
index_nostrftime=Warning - some backup jobs use % in their filenames, but strftime substitution is not enabled on the Module Config page.
|
||||
index_nostrftime=Some backup jobs use % in their filenames, but strftime substitution is not enabled on the Module Config page.
|
||||
index_tabsched=Scheduled backups
|
||||
index_tabbackup=Backup now
|
||||
index_tabrestore=Restore now
|
||||
|
||||
@@ -11,7 +11,7 @@ use File::Basename;
|
||||
use File::Find;
|
||||
use JSON::PP;
|
||||
use HTTP::Tiny;
|
||||
use HTML::Entities;
|
||||
eval "use HTML::Entities";
|
||||
use List::MoreUtils qw(any uniq);
|
||||
use Cwd qw(cwd);
|
||||
use Encode qw/encode decode/;
|
||||
@@ -245,7 +245,16 @@ sub main
|
||||
talk('affected', \%opt, \%data);
|
||||
|
||||
# Run in overwrite mode
|
||||
if ($opt{'mode'} eq 'full') {
|
||||
if ($opt{'mode'} eq 'clean') {
|
||||
# # Execute clean
|
||||
talk('clean-pre', \%opt, \%data);
|
||||
if (prompt('next')) {
|
||||
go(\%opt, \%data);
|
||||
}
|
||||
}
|
||||
|
||||
# Run in overwrite mode
|
||||
elsif ($opt{'mode'} eq 'full') {
|
||||
|
||||
# Execute force transcode/translate
|
||||
talk('overwrite-pre', \%opt, \%data);
|
||||
@@ -949,6 +958,7 @@ sub go
|
||||
my $verbose = $opt->{'verbose'} || @{$keys_test};
|
||||
my $mode_sync = $opt->{'mode'} ne 'full';
|
||||
my $mode_transcode = $opt->{'mode'} eq 'transcode';
|
||||
my $mode_clean = $opt->{'mode'} eq 'clean';
|
||||
my $allow_symlinks = $opt->{'allow-symlinks'};
|
||||
my $verbose_silent_mode = $mode_sync && $verbose != 2;
|
||||
|
||||
@@ -965,6 +975,12 @@ sub go
|
||||
|
||||
# Check if there has been something to process, if not print a message
|
||||
my $output;
|
||||
|
||||
# If cleaning called in this mode, throw an error
|
||||
if ($mode_clean) {
|
||||
say RED, "Error: Cleaning can only be performed when the target type is unset!", RESET;
|
||||
exit;
|
||||
}
|
||||
|
||||
# Build targets first
|
||||
talk_log(("Transcoding/translating " . CYAN BOLD, $module, RESET . " module's help .."), $data, 1);
|
||||
@@ -1200,6 +1216,7 @@ sub go
|
||||
# Set message type
|
||||
my $message_type_s1 = 'Transcoding/translating';
|
||||
$message_type_s1 = 'Searching/replacing in' if (@{$values_fix});
|
||||
$message_type_s1 = 'Cleaning in' if ($mode_clean);
|
||||
|
||||
talk_log(("$message_type_s1 " . BLUE BOLD, $module, RESET . " module .."), $data, 1);
|
||||
foreach $language (@{ $data->{'languages_source_list'} }) {
|
||||
@@ -1223,6 +1240,51 @@ sub go
|
||||
my %language;
|
||||
my %language_auto;
|
||||
|
||||
# If in clean mode delete the file and go next
|
||||
if ($mode_clean) {
|
||||
|
||||
# Language files
|
||||
my $cfile = "$mpath/$code";
|
||||
my $cfileauto = "$cfile.auto";
|
||||
unlink($cfile);
|
||||
unlink($cfileauto);
|
||||
|
||||
# Module files
|
||||
foreach ('module', 'config', 'uconfig') {
|
||||
my %mdata = %{$data};
|
||||
$mdata{'type'} = $_;
|
||||
my (undef, undef, $ffile) = source_data($module, \%mdata, $opt);
|
||||
$ffile =~ s/\/$_\//\//;
|
||||
my $cxfile = "$ffile.$code";
|
||||
my $cxfileauto = "$cxfile.auto";
|
||||
unlink($cxfile);
|
||||
unlink($cxfileauto);
|
||||
}
|
||||
|
||||
# Help files
|
||||
my %hdata = %{$data};
|
||||
$hdata{'type'} = 'help';
|
||||
my (undef, $hpath) = source_data($module, \%hdata, $opt);
|
||||
my @hdelete_targets;
|
||||
if (-d $hpath) {
|
||||
find(
|
||||
{
|
||||
wanted => sub {
|
||||
my $found = $File::Find::name;
|
||||
if ($found =~ /\.$code\./) {
|
||||
push(@hdelete_targets, $found);
|
||||
}
|
||||
},
|
||||
},
|
||||
$hpath);
|
||||
unlink(@hdelete_targets);
|
||||
}
|
||||
|
||||
# Go next, don't translate
|
||||
$output++;
|
||||
next;
|
||||
}
|
||||
|
||||
my $message_type_s2 = "Processing";
|
||||
$message_type_s2 = "Testing translations for selected keys with" if (@{$keys_test});
|
||||
|
||||
@@ -1732,6 +1794,10 @@ sub talk
|
||||
say GREEN, "Affected languages" . RESET, DARK . " [$languages_count]" . RESET . ": ", YELLOW BOLD,
|
||||
"" . $languages . "", RESET;
|
||||
}
|
||||
if ($what eq 'clean-pre') {
|
||||
say RED, "Danger! ", RESET, WHITE,
|
||||
"The following operation will delete all files related to the affected lang-\nuage, including machine-translated files in all the mentioned modules listed above.",
|
||||
}
|
||||
if ($what eq 'overwrite-pre') {
|
||||
say RED, "Warning! ", RESET, WHITE,
|
||||
"The following operation will force-translate and overwrite mentioned\nlanguages in all mentioned modules listed above, using ",
|
||||
@@ -1829,9 +1895,13 @@ Test translations for "index_stopmsg,trusted_warning" keys, in Russian and Germa
|
||||
|
||||
- webmin language-manager -m=bind8 -t=ru,de -kt=index_stopmsg,trusted_warning
|
||||
|
||||
Clean build directory by removing all kind of language files except English.
|
||||
|
||||
- webmin language-manager --mode=clean
|
||||
|
||||
=item --mode, -x <sync|full|transcode>
|
||||
|
||||
Mode can be either <sync> or <full> or <transcode>. Default is set to "sync" and will only keep the keys found on template language file, while missing keys in target languages (translations), will be deleted, and newly added keys to template language file, will be translated. Mode "full" is meant to perform full translation, keeping human translated strings and overwriting all machine translations done in the past (not recommended to run). Mode "transcode" is useful to fix human translated language files, which stored in "utf-8" encoding already, while still having "í" or "é" HTML entities.
|
||||
Mode can be either <sync> or <full> or <transcode> or <clean>. Default is set to "sync" and will only keep the keys found on template language file, while missing keys in target languages (translations), will be deleted, and newly added keys to template language file, will be translated. Mode "full" is meant to perform full translation, keeping human translated strings and overwriting all machine translations done in the past (not recommended to run). Mode "transcode" is useful to fix human translated language files, which stored in "utf-8" encoding already, while still having "í" or "é" HTML entities. Mode "clean" is useful to clean build package by removing all kind of language files except source language.
|
||||
|
||||
=item --type, -w <lang|ulang|help|config|uconfig|module>
|
||||
|
||||
@@ -1917,4 +1987,4 @@ Verbosely print processed files and provide detailed output. By detault, verbose
|
||||
|
||||
=head1 LICENSE AND COPYRIGHT
|
||||
|
||||
Copyright 2022 Ilia Rostovtsev <ilia@virtualmin.com>
|
||||
Copyright 2020 Ilia Rostovtsev <ilia@virtualmin.com>
|
||||
|
||||
@@ -65,10 +65,10 @@ our @dnssec_dlv_key = ( 257, 3, 5, '"BEAAAAPHMu/5onzrEE7z1egmhg/WPO0+juoZrW3euWE
|
||||
|
||||
my $rand_flag;
|
||||
if ($gconfig{'os_type'} =~ /-linux$/ &&
|
||||
$config{'force_random'} eq '0' &&
|
||||
-r "/dev/urandom" &&
|
||||
!$config{'force_random'} &&
|
||||
$bind_version &&
|
||||
&compare_version_numbers($bind_version, '9.14') < 0) {
|
||||
$bind_version =~ /^9\./ &&
|
||||
&compare_version_numbers($bind_version, '<', '9.14.2')) {
|
||||
# Version: 9.14.2 deprecated the use of -r option
|
||||
# in favor of using /dev/random [bugs:#5370]
|
||||
$rand_flag = "-r /dev/urandom";
|
||||
@@ -376,9 +376,22 @@ return @rv ? wantarray ? @rv : $rv[0]
|
||||
sub find_value
|
||||
{
|
||||
my @v = &find($_[0], $_[1]);
|
||||
if (!@v) { return undef; }
|
||||
elsif (wantarray) { return map { $_->{'value'} } @v; }
|
||||
else { return $v[0]->{'value'}; }
|
||||
if (!@v) {
|
||||
return undef;
|
||||
}
|
||||
elsif (wantarray) {
|
||||
return map { &extract_value($_) } @v;
|
||||
}
|
||||
else {
|
||||
return &extract_value($v[0]);
|
||||
}
|
||||
}
|
||||
|
||||
sub extract_value
|
||||
{
|
||||
my ($dir) = @_;
|
||||
return defined($dir->{'value'}) ? $dir->{'value'} :
|
||||
defined($dir->{'values'}) && @{$dir->{'values'}} ? $dir->{'values'}->[0] : undef;
|
||||
}
|
||||
|
||||
# base_directory([&config], [no-cache])
|
||||
@@ -500,9 +513,8 @@ for(my $i=0; $i<@oldv || $i<@newv; $i++) {
|
||||
sub recursive_set_value
|
||||
{
|
||||
my ($dir) = @_;
|
||||
if ($dir->{'values'}) {
|
||||
my @v = @{$dir->{'values'}};
|
||||
$dir->{'value'} = @v ? $v[0] : undef;
|
||||
if (!defined($dir->{'value'})) {
|
||||
$dir->{'value'} = &extract_value($dir);
|
||||
}
|
||||
if ($dir->{'type'} && $dir->{'type'} == 1 && $dir->{'members'}) {
|
||||
foreach my $m (@{$dir->{'members'}}) {
|
||||
@@ -3010,7 +3022,7 @@ my %on = map { $_, 1 } @{$_[0]};
|
||||
&remote_error_setup(\&slave_error_handler);
|
||||
my @slaveerrs;
|
||||
foreach my $slave (&list_slave_servers()) {
|
||||
next if (%on && !$on{$slave->{'host'}});
|
||||
next if (%on && !$on{$slave->{'nsname'}} && !$on{$slave->{'host'}});
|
||||
|
||||
# Find the PID file
|
||||
$slave_error = undef;
|
||||
|
||||
@@ -17,6 +17,14 @@ my $dom = $zone->{'name'};
|
||||
&ui_print_header(&zone_subhead($zone), $text{'master_title'}, "",
|
||||
undef, undef, undef, undef, &restart_links($zone));
|
||||
|
||||
my $d = &get_virtualmin_domains($dom);
|
||||
if ($d && $d->{'alias'}) {
|
||||
print &ui_alert_box($text{'master_vminalias'}, 'danger');
|
||||
}
|
||||
elsif ($d) {
|
||||
print &ui_alert_box($text{'master_vmin'}, 'warn');
|
||||
}
|
||||
|
||||
# Find the record types
|
||||
my (@rcodes, @recs);
|
||||
if (!$config{'largezones'}) {
|
||||
|
||||
@@ -147,6 +147,8 @@ master_defttl=Default time-to-live for records
|
||||
master_edefttl='$1' is not a valid default time-to-live for records
|
||||
master_esoagone=No SOA record found!
|
||||
master_einclude=Additional template file does not exist
|
||||
master_vmin=This zone is managed by Virtualmin. Records should be edited using the Virtualmin UI, to ensure they are consistent with other virtual server settings.
|
||||
master_vminalias=This zone is an alias of a Virtualmin domain, which is kept in sync with it's target. Records should never be edited here, as any changes will be overwritten!
|
||||
|
||||
delete_title=Delete Zone
|
||||
delete_mesg=Are you sure you want to delete the zone $1 ? All records and the zone file will be deleted.
|
||||
|
||||
@@ -59,9 +59,9 @@ if ($access{'lang'}) {
|
||||
|
||||
# Old datetime format or a new locale
|
||||
if ($access{'locale'}) {
|
||||
eval "use DateTime; use DateTime::Locale; use DateTime::TimeZone;";
|
||||
&foreign_require('webmin');
|
||||
if (!$@) {
|
||||
eval "use DateTime; use DateTime::Locale; use DateTime::TimeZone;";
|
||||
if (!$@ && $] > 5.011) {
|
||||
my $locales = &list_locales();
|
||||
my %localesrev = reverse %{$locales};
|
||||
my $locale = $locale_auto || $gconfig{'locale'} || &get_default_system_locale();
|
||||
|
||||
@@ -925,7 +925,7 @@ $table .= &ui_columns_row(\@cols, [ "valign=top", "valign=top", "valign=top",
|
||||
"valign=top", "valign=top" ]);
|
||||
$table .= &ui_columns_end();
|
||||
$table .= $text{'edit_ctrl'};
|
||||
$rv .= &ui_table_row(undef, $table, $width);
|
||||
$rv .= &ui_table_row(undef, $table, $width, undef, ['data-schedule-tr']);
|
||||
return $rv;
|
||||
}
|
||||
|
||||
@@ -1209,63 +1209,6 @@ foreach $w (@wds) {
|
||||
$_[0]->{'weekdays'} = join(",", @wds);
|
||||
}
|
||||
|
||||
=head2 create_wrapper(wrapper-path, module, script)
|
||||
|
||||
Creates a wrapper script which calls a script in some module's directory
|
||||
with the proper webmin environment variables set. This should always be used
|
||||
when setting up a cron job, instead of attempting to run a command in the
|
||||
module directory directly.
|
||||
|
||||
The parameters are :
|
||||
|
||||
=item wrapper-path - Full path to the wrapper to create, like /etc/webmin/yourmodule/foo.pl
|
||||
|
||||
=item module - Module containing the real script to call.
|
||||
|
||||
=item script - Program within that module for the wrapper to run.
|
||||
|
||||
=cut
|
||||
sub create_wrapper
|
||||
{
|
||||
local $perl_path = &get_perl_path();
|
||||
&open_tempfile(CMD, ">$_[0]");
|
||||
&print_tempfile(CMD, <<EOF
|
||||
#!$perl_path
|
||||
open(CONF, "<$config_directory/miniserv.conf") || die "Failed to open $config_directory/miniserv.conf : \$!";
|
||||
while(<CONF>) {
|
||||
\$root = \$1 if (/^root=(.*)/);
|
||||
}
|
||||
close(CONF);
|
||||
\$root || die "No root= line found in $config_directory/miniserv.conf";
|
||||
\$ENV{'PERLLIB'} = "\$root";
|
||||
\$ENV{'WEBMIN_CONFIG'} = "$ENV{'WEBMIN_CONFIG'}";
|
||||
\$ENV{'WEBMIN_VAR'} = "$ENV{'WEBMIN_VAR'}";
|
||||
delete(\$ENV{'MINISERV_CONFIG'});
|
||||
EOF
|
||||
);
|
||||
if ($gconfig{'os_type'} eq 'windows') {
|
||||
# On windows, we need to chdir to the drive first, and use system
|
||||
&print_tempfile(CMD, "if (\$root =~ /^([a-z]:)/i) {\n");
|
||||
&print_tempfile(CMD, " chdir(\"\$1\");\n");
|
||||
&print_tempfile(CMD, " }\n");
|
||||
&print_tempfile(CMD, "chdir(\"\$root/$_[1]\");\n");
|
||||
&print_tempfile(CMD, "exit(system(\"\$root/$_[1]/$_[2]\", \@ARGV));\n");
|
||||
}
|
||||
else {
|
||||
# Can use exec on Unix systems
|
||||
if ($_[1]) {
|
||||
&print_tempfile(CMD, "chdir(\"\$root/$_[1]\");\n");
|
||||
&print_tempfile(CMD, "exec(\"\$root/$_[1]/$_[2]\", \@ARGV) || die \"Failed to run \$root/$_[1]/$_[2] : \$!\";\n");
|
||||
}
|
||||
else {
|
||||
&print_tempfile(CMD, "chdir(\"\$root\");\n");
|
||||
&print_tempfile(CMD, "exec(\"\$root/$_[2]\", \@ARGV) || die \"Failed to run \$root/$_[2] : \$!\";\n");
|
||||
}
|
||||
}
|
||||
&close_tempfile(CMD);
|
||||
chmod(0755, $_[0]);
|
||||
}
|
||||
|
||||
=head2 cron_file(&job)
|
||||
|
||||
Returns the file that a cron job is in, or will be in when it is created
|
||||
|
||||
@@ -74,12 +74,12 @@ open(FILE, "<".$_[0]);
|
||||
while($line = <FILE>) {
|
||||
# strip comments
|
||||
$line =~ s/\r|\n//g;
|
||||
$line =~ s/([^\\])\\"/$1\\042/g; # convert escaped quotes to \042
|
||||
$line =~ s/^([^"#]*)#.*$/$1/g;
|
||||
$line =~ s/^([^"]*)\/\/.*$/$1/g;
|
||||
$line =~ s/^([^"]*)\s+#.*$/$1/g; # remove stuff after #, unless
|
||||
$line =~ s/^(.*".*".*)\s+#.*$/$1/g; # it is inside quotes
|
||||
$line =~ s/\\\\/\\134/g; # convert \\ into \134
|
||||
$line =~ s/([^\\])\\"/$1\\042/g; # convert escaped quotes to \042
|
||||
while(1) {
|
||||
if (!$cmode && $line =~ /\/\*/ && $line !~ /\".*\/\*.*\"/) {
|
||||
# start of a C-style comment
|
||||
|
||||
@@ -566,4 +566,15 @@ if ($?) {
|
||||
}
|
||||
}
|
||||
|
||||
# Unblock all IPs in given jail
|
||||
sub unblock_jail
|
||||
{
|
||||
my ($jail) = @_;
|
||||
my $cmd = "$config{'client_cmd'} reload --unban ".quotemeta($jail)." 2>&1 </dev/null";
|
||||
my $out = &backquote_logged($cmd);
|
||||
if ($?) {
|
||||
&error(&text('status_err_unbanjail', &html_escape($jail)) . " : $out");
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
72
fail2ban/jail_blocks.cgi
Normal file
@@ -0,0 +1,72 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Show a status of all active jails
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
no warnings 'redefine';
|
||||
no warnings 'uninitialized';
|
||||
require './fail2ban-lib.pl';
|
||||
our (%in, %text, %config);
|
||||
|
||||
&ReadParse();
|
||||
|
||||
my $jail = $in{'jail'};
|
||||
my $out = &backquote_logged("$config{'client_cmd'} status 2>&1 </dev/null");
|
||||
my ($jail_list) = $out =~ /jail\s+list:\s*(.*)/im;
|
||||
my @jails = split(/,\s*/, $jail_list);
|
||||
&indexof($jail, @jails) > -1 || error($text{'status_err_unknownjail'});
|
||||
|
||||
&ui_print_header("$jail", $text{'status_title3'}, "");
|
||||
my $fh = 'jailinfo';
|
||||
my @jail_blocks;
|
||||
&open_execute_command($fh, "$config{'client_cmd'} get @{[quotemeta($jail)]} banip --with-time 2>&1 </dev/null", 1);
|
||||
while(<$fh>) {
|
||||
if (/^(?<ip>.*?)\s+(?<start>.*?\s+.*?)\s+.*?\s+.*?\s+=\s+(?<end>.*)$/) {
|
||||
my $ip = $+{ip};
|
||||
my $start = $+{start};
|
||||
my $end = $+{end};
|
||||
if ($ip && $start && $end) {
|
||||
push(@jail_blocks, [$ip, $start, $end]);
|
||||
}
|
||||
}
|
||||
}
|
||||
close($fh);
|
||||
|
||||
if (@jail_blocks) {
|
||||
my $popts = \%in;
|
||||
$popts->{'paginations'}->{'form'} = { 'jail' => $jail };
|
||||
my $pagination = &ui_paginations(\@jail_blocks, $popts);
|
||||
my @links = ( &select_all_link("ip"),
|
||||
&select_invert_link("ip"));
|
||||
print $pagination->{'search'}->{'form-data'};
|
||||
print &ui_form_start("unblock_jailed_ip.cgi", "post");
|
||||
print &ui_links_row(\@links);
|
||||
print &ui_columns_start([ "",
|
||||
$text{'status_head_blocks_ip'},
|
||||
$text{'status_head_blocks_stime'},
|
||||
$text{'status_head_blocks_etime'} ]);
|
||||
if (@jail_blocks) {
|
||||
foreach my $r (@jail_blocks) {
|
||||
print &ui_checked_columns_row($r, [ 'width=5' ], "ip", $r->[0]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
print $pagination->{'search'}->{'no-results'};
|
||||
}
|
||||
print &ui_columns_end();
|
||||
print $pagination->{'paginator'}->{'form-data'};
|
||||
print $pagination->{'paginator'}->{'form-scripts'};
|
||||
print &ui_hidden("jail", $jail);
|
||||
print &ui_hidden("return", 1);
|
||||
print $pagination->{'form'};
|
||||
print &ui_links_row(\@links);
|
||||
print &ui_form_end([ [ undef, $text{'status_jail_unblock_ips'} ] ]);
|
||||
print $pagination->{'search'}->{'form'};
|
||||
print $pagination->{'paginator'}->{'form'};
|
||||
}
|
||||
else {
|
||||
print &text('status_jail_noactiveips', $jail);
|
||||
}
|
||||
|
||||
&ui_print_footer("list_status.cgi", $text{'status_return'},
|
||||
"", $text{'index_return'});
|
||||
@@ -170,23 +170,32 @@ manual_efile=Selected file is not part of the Fail2Ban configuration!
|
||||
manual_err=Failed to edit config file
|
||||
manual_edata=No config file contents entered
|
||||
|
||||
status_title=Jails Status And Actions
|
||||
status_title2=Jails Status
|
||||
status_head_jail_name=Jail name
|
||||
status_title=Jails Status
|
||||
status_title3=Jail Blocks
|
||||
status_return=jails status
|
||||
status_head_jail_blocks=Jail blocks
|
||||
status_head_currently_failed=Currently failed
|
||||
status_head_total_failed=Total failed
|
||||
status_head_file_list=File list
|
||||
status_head_currently_banned=Currently banned
|
||||
status_head_total_banned=Total banned
|
||||
status_head_banned_ip_list=Banned IP list
|
||||
status_head_blocks_ip=IP
|
||||
status_head_blocks_stime=Start time
|
||||
status_head_blocks_etime=End time
|
||||
status_rules_plus_more=+ $1 more
|
||||
status_jail_unblock_ip=Remove $1 from banned list
|
||||
status_jail_unblock=Unblock All IPs for Selected Jails
|
||||
status_jail_unblock=Unblock Selected Jails
|
||||
status_jail_unblock_ips=Unblock Selected IP
|
||||
status_jail_noactive=There are no active jails enabled yet.
|
||||
status_jail_noactiveips=There are no blocked entries in jail <tt>$1</tt> found.
|
||||
status_err_set=Failed set action
|
||||
status_err_unblock=Failed to unblock action
|
||||
status_err_nojail=No jails have been selected
|
||||
status_err_noips=No IP has been selected
|
||||
status_err_unban=Cannot un-ban $1 IP address
|
||||
status_err_unbanjail=Cannot un-ban $1 jail
|
||||
status_err_unknownjail=Unknown jail
|
||||
|
||||
syslog_logtarget=Fail2Ban action log
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ no warnings 'uninitialized';
|
||||
require './fail2ban-lib.pl';
|
||||
our (%in, %text, %config);
|
||||
|
||||
&ui_print_header(undef, $text{'status_title2'}, "");
|
||||
&ui_print_header(undef, $text{'status_title'}, "");
|
||||
|
||||
my $out = &backquote_logged("$config{'client_cmd'} status 2>&1 </dev/null");
|
||||
my ($jail_list) = $out =~ /jail\s+list:\s*(.*)/im;
|
||||
@@ -25,13 +25,13 @@ if (@jails) {
|
||||
my $fh = 'cmdjail';
|
||||
my $cmd = "$config{'client_cmd'} status ".quotemeta($jail);
|
||||
my $jcmd = "$cmd 2>&1 </dev/null";
|
||||
my @head = (undef, $text{"status_head_jail_name"});
|
||||
my @body = (&ui_link("edit_jail.cgi?name=".urlize($jail), " ".&html_escape($jail)));
|
||||
my @head = (undef, $text{"status_head_jail_blocks"});
|
||||
my @body = &ui_link("jail_blocks.cgi?jail=".urlize($jail), " ".&html_escape($jail), undef);
|
||||
my $br = '<br>';
|
||||
my $nbsp = ' ';
|
||||
my $ipslimit = sub {
|
||||
my ($ips, $limit) = @_;
|
||||
$limit ||= 15;
|
||||
$limit ||= 10;
|
||||
# Limit sanity check
|
||||
$limit = 1 if ($limit < 1);
|
||||
my $ipscount = () = $ips =~ /$br/g;
|
||||
@@ -39,7 +39,9 @@ if (@jails) {
|
||||
my @ips = split($br, $ips);
|
||||
@ips = @ips[0 .. $limit];
|
||||
$ips = join($br, @ips);
|
||||
$ips .= "<small style='cursor: default;'>$br".&text('status_rules_plus_more', $ipscount-$limit)."</small>";
|
||||
$ips .= "<small style='cursor: default;'>$br".
|
||||
(&ui_link("jail_blocks.cgi?jail=".urlize($jail),
|
||||
" ".&text('status_rules_plus_more', $ipscount-$limit), undef))."</small>";
|
||||
}
|
||||
return $ips;
|
||||
};
|
||||
@@ -57,7 +59,7 @@ if (@jails) {
|
||||
if ($col =~ /banned_ip_list/) {
|
||||
$jips = $val;
|
||||
my @ips = split(/\s+/, $val);
|
||||
@ips = map { "<small $tal><tt><label $lwf>" . &ui_link("unblock_jail.cgi?unblock=1&jips-@{[&urlize($jail)]}=@{[&urlize($_)]}&jail=@{[&urlize($jail)]}", $_, undef,
|
||||
@ips = map { "<small $tal><tt><label $lwf>" . &ui_link("unblock_jailed_ip.cgi?ip=@{[&urlize($_)]}&jail=@{[&urlize($jail)]}", $_, undef,
|
||||
"title=\"@{[&text('status_jail_unblock_ip', "e_escape($_))]}\" onmouseover=\"this.style.textDecoration='line-through'\" onmouseout=\"this.style.textDecoration='none'\""
|
||||
) . "</label></tt></small>" } @ips;
|
||||
$val = "<br>" if ($val);
|
||||
@@ -82,9 +84,6 @@ if (@jails) {
|
||||
if ($head) {
|
||||
print &ui_columns_end();
|
||||
print &ui_links_row(\@links);
|
||||
foreach my $j (@jipsall) {
|
||||
print &ui_hidden("jips-$j->[0]", "$j->[1]");
|
||||
}
|
||||
print &ui_form_end([ [ 'unblock', $text{'status_jail_unblock'} ] ]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Create, update or delete a action
|
||||
# Unblock specific jail
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
@@ -18,13 +18,8 @@ my @jails = split(/\0/, $in{'jail'});
|
||||
# Processes jails actions
|
||||
my @jailsmod;
|
||||
foreach my $jail (@jails) {
|
||||
my @jailips = split(/\s+/, $in{"jips-$jail"});
|
||||
if (@jailips) {
|
||||
foreach my $ip (@jailips) {
|
||||
&unblock_jailed_ip($jail, $ip);
|
||||
push(@jailsmod, $jail);
|
||||
}
|
||||
}
|
||||
&unblock_jail($jail);
|
||||
push(@jailsmod, $jail);
|
||||
}
|
||||
|
||||
# Log and redirect
|
||||
|
||||
29
fail2ban/unblock_jailed_ip.cgi
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Unblock specific IP in jail
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
no warnings 'redefine';
|
||||
no warnings 'uninitialized';
|
||||
require './fail2ban-lib.pl';
|
||||
our (%in, %text, %config);
|
||||
&ReadParse();
|
||||
&error_setup($text{'status_err_set'});
|
||||
|
||||
my $jail = $in{'jail'};
|
||||
my @ips = split(/\0/, $in{'ip'});
|
||||
|
||||
# Error checks
|
||||
$jail || &error($text{'status_err_nojail'});
|
||||
@ips || &error($text{'status_err_noips'});
|
||||
|
||||
# Processes jails actions
|
||||
my @jailips;
|
||||
foreach my $ip (@ips) {
|
||||
&unblock_jailed_ip($jail, $ip);
|
||||
push(@jailips, $ip);
|
||||
}
|
||||
|
||||
# Log and redirect
|
||||
&webmin_log('update', 'jail', $jail) if (@jailips);
|
||||
&redirect($in{'return'} ? &get_referer_relative() : "list_status.cgi");
|
||||
@@ -1 +0,0 @@
|
||||
../mailboxes/xinha
|
||||
|
Before Width: | Height: | Size: 57 B After Width: | Height: | Size: 57 B |
|
Before Width: | Height: | Size: 63 B After Width: | Height: | Size: 63 B |
|
Before Width: | Height: | Size: 69 B After Width: | Height: | Size: 69 B |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
|
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 150 B |
|
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 128 B |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
|
Before Width: | Height: | Size: 57 B After Width: | Height: | Size: 57 B |
|
Before Width: | Height: | Size: 63 B After Width: | Height: | Size: 63 B |
|
Before Width: | Height: | Size: 69 B After Width: | Height: | Size: 69 B |
|
Before Width: | Height: | Size: 76 B After Width: | Height: | Size: 76 B |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 61 B After Width: | Height: | Size: 61 B |
|
Before Width: | Height: | Size: 60 B After Width: | Height: | Size: 60 B |
|
Before Width: | Height: | Size: 60 B After Width: | Height: | Size: 60 B |
|
Before Width: | Height: | Size: 61 B After Width: | Height: | Size: 61 B |
|
Before Width: | Height: | Size: 56 B After Width: | Height: | Size: 56 B |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
|
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
|
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 97 B After Width: | Height: | Size: 97 B |
|
Before Width: | Height: | Size: 50 B After Width: | Height: | Size: 50 B |
|
Before Width: | Height: | Size: 78 B After Width: | Height: | Size: 78 B |
|
Before Width: | Height: | Size: 80 B After Width: | Height: | Size: 80 B |
|
Before Width: | Height: | Size: 57 B After Width: | Height: | Size: 57 B |
|
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
|
Before Width: | Height: | Size: 66 B After Width: | Height: | Size: 66 B |
|
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
|
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
|
Before Width: | Height: | Size: 69 B After Width: | Height: | Size: 69 B |
|
Before Width: | Height: | Size: 55 B After Width: | Height: | Size: 55 B |
|
Before Width: | Height: | Size: 53 B After Width: | Height: | Size: 53 B |
|
Before Width: | Height: | Size: 64 B After Width: | Height: | Size: 64 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 125 B |
|
Before Width: | Height: | Size: 84 B After Width: | Height: | Size: 84 B |
|
Before Width: | Height: | Size: 84 B After Width: | Height: | Size: 84 B |
|
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 151 B |
|
Before Width: | Height: | Size: 72 B After Width: | Height: | Size: 72 B |
|
Before Width: | Height: | Size: 78 B After Width: | Height: | Size: 78 B |
|
Before Width: | Height: | Size: 72 B After Width: | Height: | Size: 72 B |
|
Before Width: | Height: | Size: 76 B After Width: | Height: | Size: 76 B |
|
Before Width: | Height: | Size: 100 B After Width: | Height: | Size: 100 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 117 B After Width: | Height: | Size: 117 B |
|
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
|
Before Width: | Height: | Size: 75 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 128 B |