/[smecontribs]/rpms/smeserver-awstats/contribs10/smeserver-awstats-1.4-bz5925_add_qmail_stats.patch
ViewVC logotype

Contents of /rpms/smeserver-awstats/contribs10/smeserver-awstats-1.4-bz5925_add_qmail_stats.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sun Feb 12 19:07:17 2023 UTC (21 months, 2 weeks ago) by michel
Branch: MAIN
CVS Tags: smeserver-awstats-1_4-8_el7_sme, smeserver-awstats-1_4-7_el7_sme, smeserver-awstats-1_4-10_el7_sme, smeserver-awstats-1_4-9_el7_sme, HEAD
make: « clog » est à jour.

1 diff -urN smeserver-awstats-1.4.old/createlinks smeserver-awstats-1.4/createlinks
2 --- smeserver-awstats-1.4.old/createlinks 2023-02-08 22:03:48.000000000 +0400
3 +++ smeserver-awstats-1.4/createlinks 2023-02-12 22:30:35.985000000 +0400
4 @@ -8,25 +8,23 @@
5
6 panel_link("awstats", 'manager');
7
8 -$event="console-save";
9 -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event );
10 -
11 -$event="remoteaccess-update";
12 -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event );
13 +for my $event (qw( ip-change awstats-update smeserver-awstats-update console-save post-upgrade remoteaccess-update )) {
14 + templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event );
15 + templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf", $event );
16 + templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.mail.conf", $event );
17 +}
18
19 $event="ip-change";
20 -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event );
21 event_link("awstats-run", $event , "04");
22
23 $event="awstats-update";
24 event_link("navigation-conf", $event, "50");
25 -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event );
26 event_link("awstats-run", "awstats-update", "20");
27 +templates2events("/etc/crontab", $event );
28
29
30 $event= "smeserver-awstats-update";
31 event_link("navigation-conf", $event, "50");
32 -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event );
33 templates2events("/etc/crontab", $event );
34 event_link("awstats-upgrade", $event, "02");
35
36 diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/crontab/awstats_email smeserver-awstats-1.4/root/etc/e-smith/templates/etc/crontab/awstats_email
37 --- smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/crontab/awstats_email 1970-01-01 04:00:00.000000000 +0400
38 +++ smeserver-awstats-1.4/root/etc/e-smith/templates/etc/crontab/awstats_email 2023-02-11 22:48:14.000000000 +0400
39 @@ -0,0 +1,6 @@
40 +{
41 + return "# awstats-mail is disabled\n" unless ($AWStats{mailstatus} || 'disabled') eq 'enabled';
42 +
43 + my $cmd="/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.pl";
44 + $OUT .= "45 * * * * root $cmd -update -config=mail >/dev/null\n";
45 +}
46 diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/crontab/awstats_ftp smeserver-awstats-1.4/root/etc/e-smith/templates/etc/crontab/awstats_ftp
47 --- smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/crontab/awstats_ftp 1970-01-01 04:00:00.000000000 +0400
48 +++ smeserver-awstats-1.4/root/etc/e-smith/templates/etc/crontab/awstats_ftp 2023-02-11 23:51:51.000000000 +0400
49 @@ -0,0 +1,7 @@
50 +{
51 + return "# awstats-ftp is disabled\n" unless ($AWStats{ftpstatus} || 'disabled') eq 'enabled';
52 +
53 + my $cmd="/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.pl";
54 + $OUT .= "35 * * * * root $cmd -update -config=ftp >/dev/null\n";
55 +}
56 +
57 diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf/10conf smeserver-awstats-1.4/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf/10conf
58 --- smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf/10conf 1970-01-01 04:00:00.000000000 +0400
59 +++ smeserver-awstats-1.4/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf/10conf 2023-02-12 19:25:16.000000000 +0400
60 @@ -0,0 +1,56 @@
61 +{
62 +# ftp : proftpd
63 + use warnings;
64 + use esmith::ConfigDB;
65 +
66 + my $configDB = esmith::ConfigDB->open or die("can't open Config DB");
67 + my $domain = $configDB->get( 'DomainName' )->value;
68 + my $DNREG = ($domain =~ s|\.|\\.|r);
69 +
70 +$OUT =<<HERE
71 +LogFile="/var/log/xferlog"
72 +LogType=F
73 +LogFormat="%time3 %other %host %bytesd %url %other %other %method %other %logname %other %code %other %other"
74 +LogSeparator="\\s"
75 +NotPageList=""
76 +SiteDomain="ftp.$domain"
77 +HostAliases="localhost 127.0.0.1 REGEX[${DNREG}\$]"
78 +LevelForBrowsersDetection=0
79 +LevelForOSDetection=0
80 +LevelForRefererAnalyze=0
81 +LevelForRobotsDetection=0
82 +LevelForWormsDetection=0
83 +LevelForSearchEnginesDetection=0
84 +UseFramesWhenCGI=0
85 +#DirData="/home/e-smith/awstats"
86 +DirData="/home/e-smith/files/users/admin/home/awstats"
87 +DirCgi="/cgi-bin"
88 +DirIcons="../../awstats"
89 +ShowLinksOnUrl=0
90 +ShowMenu=1
91 +ShowSummary=UVHB
92 +ShowMonthStats=UVHB
93 +ShowDaysOfMonthStats=HB
94 +ShowDaysOfWeekStats=HB
95 +ShowHoursStats=HB
96 +ShowDomainsStats=HB
97 +ShowHostsStats=HBL
98 +ShowAuthenticatedUsers=HBL
99 +ShowRobotsStats=0
100 +ShowEMailSenders=0
101 +ShowEMailReceivers=0
102 +ShowSessionsStats=1
103 +ShowPagesStats=PBEX
104 +ShowFileTypesStats=HB
105 +ShowFileSizesStats=0
106 +ShowBrowsersStats=0
107 +ShowOSStats=0
108 +ShowOriginStats=0
109 +ShowKeyphrasesStats=0
110 +ShowKeywordsStats=0
111 +ShowMiscStats=0
112 +ShowHTTPErrorsStats=0
113 +ShowSMTPErrorsStats=0
114 +
115 +HERE
116 +}
117 diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.mail.conf/10conf smeserver-awstats-1.4/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.mail.conf/10conf
118 --- smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.mail.conf/10conf 1970-01-01 04:00:00.000000000 +0400
119 +++ smeserver-awstats-1.4/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.mail.conf/10conf 2023-02-12 19:25:51.000000000 +0400
120 @@ -0,0 +1,174 @@
121 +{
122 +############################
123 +# Config file for Qmail
124 +############################
125 +use warnings;
126 +use esmith::ConfigDB;
127 +my $configDB = esmith::ConfigDB->open or die("can't open Config DB");
128 +my $domain = $configDB->get( 'DomainName' )->value;
129 +my $DNREG = ($domain =~ s|\.|\\.|r);
130 +
131 +$OUT =<<HERE
132 +#LogFile="/home/e-smith/awstats/qmail-preprocessor.sh|"
133 +LogFile="/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh|"
134 +LogType=M
135 +LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd"
136 +LogSeparator=" "
137 +SiteDomain="mail.$domain"
138 +HostAliases="localhost 127.0.0.1 REGEX[${DNREG}\$]"
139 +DNSLookup=2
140 +#DirData="/home/e-smith/awstats"
141 +DirData="/home/e-smith/files/users/admin/home/awstats"
142 +DirCgi="/cgi-bin"
143 +DirIcons="../../awstats"
144 +UseFramesWhenCGI=0
145 +AllowToUpdateStatsFromBrowser=0
146 +AllowFullYearView=3
147 +EnableLockForUpdate=0
148 +DNSStaticCacheFile="dnscache.txt"
149 +DNSLastUpdateCacheFile="dnscachelastupdate.txt"
150 +SkipDNSLookupFor=""
151 +AllowAccessFromWebToAuthenticatedUsersOnly=0
152 +AllowAccessFromWebToFollowingAuthenticatedUsers=""
153 +AllowAccessFromWebToFollowingIPAddresses=""
154 +CreateDirDataIfNotExists=0
155 +BuildHistoryFormat=text
156 +BuildReportFormat=html
157 +SaveDatabaseFilesWithPermissionsForEveryone=0
158 +PurgeLogFile=0
159 +ArchiveLogRecords=0
160 +KeepBackupOfHistoricFiles=0
161 +DefaultFile="index.html"
162 +SkipHosts=""
163 +SkipUserAgents=""
164 +SkipFiles=""
165 +SkipReferrersBlackList=""
166 +OnlyHosts=""
167 +OnlyUserAgents=""
168 +OnlyFiles=""
169 +NotPageList="css js class gif jpg jpeg png bmp ico swf"
170 +ValidHTTPCodes="200 304"
171 +ValidSMTPCodes="1 250"
172 +AuthenticatedUsersNotCaseSensitive=0
173 +URLNotCaseSensitive=0
174 +URLWithAnchor=0
175 +URLQuerySeparators="?;"
176 +URLWithQuery=0
177 +URLWithQueryWithOnlyFollowingParameters=""
178 +URLWithQueryWithoutFollowingParameters=""
179 +URLReferrerWithQuery=0
180 +WarningMessages=1
181 +ErrorMessages=""
182 +DebugMessages=0
183 +NbOfLinesForCorruptedLog=50
184 +WrapperScript=""
185 +DecodeUA=0
186 +MiscTrackerUrl="/js/awstats_misc_tracker.js"
187 +LevelForBrowsersDetection=2
188 +LevelForOSDetection=2
189 +LevelForRefererAnalyze=2
190 +LevelForRobotsDetection=2
191 +LevelForSearchEnginesDetection=2
192 +LevelForKeywordsDetection=2
193 +LevelForFileTypesDetection=2
194 +LevelForWormsDetection=0
195 +DetailedReportsOnNewWindows=1
196 +Expires=0
197 +MaxRowsInHTMLOutput=1000
198 +Lang="auto"
199 +DirLang="./lang"
200 +ShowMenu=1
201 +ShowSummary=HBM
202 +ShowMonthStats=HBM
203 +ShowDaysOfMonthStats=HBM
204 +ShowDaysOfWeekStats=HBM
205 +ShowHoursStats=HBM
206 +ShowDomainsStats=0
207 +ShowHostsStats=HBL
208 +ShowAuthenticatedUsers=0
209 +ShowRobotsStats=0
210 +ShowWormsStats=0
211 +ShowEMailSenders=HBML
212 +ShowEMailReceivers=HBML
213 +ShowSessionsStats=0
214 +ShowPagesStats=0
215 +ShowFileTypesStats=0
216 +ShowFileSizesStats=0
217 +ShowOSStats=0
218 +ShowBrowsersStats=0
219 +ShowScreenSizeStats=0
220 +ShowOriginStats=0
221 +ShowKeyphrasesStats=0
222 +ShowKeywordsStats=0
223 +ShowMiscStats=0
224 +ShowHTTPErrorsStats=0
225 +ShowSMTPErrorsStats=1
226 +ShowClusterStats=0
227 +AddDataArrayMonthStats=1
228 +AddDataArrayShowDaysOfMonthStats=1
229 +AddDataArrayShowDaysOfWeekStats=1
230 +AddDataArrayShowHoursStats=1
231 +IncludeInternalLinksInOriginSection=0
232 +MaxNbOfDomain = 10
233 +MinHitDomain = 1
234 +MaxNbOfHostsShown = 10
235 +MinHitHost = 1
236 +MaxNbOfLoginShown = 10
237 +MinHitLogin = 1
238 +MaxNbOfRobotShown = 10
239 +MinHitRobot = 1
240 +MaxNbOfPageShown = 10
241 +MinHitFile = 1
242 +MaxNbOfOsShown = 10
243 +MinHitOs = 1
244 +MaxNbOfBrowsersShown = 10
245 +MinHitBrowser = 1
246 +MaxNbOfScreenSizesShown = 5
247 +MinHitScreenSize = 1
248 +MaxNbOfWindowSizesShown = 5
249 +MinHitWindowSize = 1
250 +MaxNbOfRefererShown = 10
251 +MinHitRefer = 1
252 +MaxNbOfKeyphrasesShown = 10
253 +MinHitKeyphrase = 1
254 +MaxNbOfKeywordsShown = 10
255 +MinHitKeyword = 1
256 +MaxNbOfEMailsShown = 20
257 +MinHitEMail = 1
258 +FirstDayOfWeek=1
259 +ShowFlagLinks=""
260 +ShowLinksOnUrl=1
261 +UseHTTPSLinkForUrl=""
262 +MaxLengthOfShownURL=64
263 +HTMLHeadSection=""
264 +HTMLEndSection=""
265 +Logo="awstats_logo6.png"
266 +LogoLink="awstats.pl?config=mail"
267 +BarWidth = 260
268 +BarHeight = 90
269 +StyleSheet=""
270 +color_Background="FFFFFF"
271 +color_TableBGTitle="CCCCDD"
272 +color_TableTitle="000000"
273 +color_TableBG="CCCCDD"
274 +color_TableRowTitle="FFFFFF"
275 +color_TableBGRowTitle="ECECEC"
276 +color_TableBorder="ECECEC"
277 +color_text="000000"
278 +color_textpercent="606060"
279 +color_titletext="000000"
280 +color_weekend="EAEAEA"
281 +color_link="0011BB"
282 +color_hover="605040"
283 +color_u="FFAA66"
284 +color_v="F4F090"
285 +color_p="4477DD"
286 +color_h="66DDEE"
287 +color_k="2EA495"
288 +color_s="8888DD"
289 +color_e="CEC2E8"
290 +color_x="C1B2E2"
291 +ExtraTrackedRowsLimit=500
292 +
293 +HERE
294 +}
295 \ Pas de fin de ligne à la fin du fichier
296 diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/web/functions/awstats smeserver-awstats-1.4/root/etc/e-smith/web/functions/awstats
297 --- smeserver-awstats-1.4.old/root/etc/e-smith/web/functions/awstats 2014-06-16 19:52:35.000000000 +0400
298 +++ smeserver-awstats-1.4/root/etc/e-smith/web/functions/awstats 2023-02-12 21:34:56.000000000 +0400
299 @@ -253,13 +253,22 @@
300 'to configure AWStats.');
301 }
302
303 - if (db_get_prop(\%conf, "AWStats", "status") ne "enabled")
304 - {
305 - print $q->h4 ('AWStats is disabled!');
306 - }
307 - else
308 - {
309 -
310 + if (db_get_prop(\%conf, "AWStats", "status") ne "enabled")
311 + {
312 + print $q->h4 (' AWStats is disabled!');
313 + if ($acctName eq 'admin' and (db_get_prop(\%conf, "AWStats", "mailstatus") || 'disabled') eq 'enabled') {
314 + print "<br>No WEB stats but <b>MAIL stats</b> are available -> ";
315 + print $q->a ({ href => ".awstats/awstats.pl?config=mail&lang=auto" }, 'Here...');
316 + print "<br>";
317 + }
318 + if ($acctName eq 'admin' and (db_get_prop(\%conf, "AWStats", "ftpstatus") || 'disabled') eq 'enabled') {
319 + print "<br>No WEB stats but <b>FTP stats</b> are available -> ";
320 + print $q->a ({ href => ".awstats/awstats.pl?config=ftp&lang=auto" }, 'Here...');
321 + print "<br>";
322 + }
323 + }
324 + else
325 + {
326 print $q->h4 ("List of Domains viewable by $acctName");
327
328 print "Note: A Domain is not shown in the list below until after midnight on the day <br>".
329 @@ -391,6 +400,39 @@
330 }
331 }
332
333 +
334 +
335 +# add to see mail stats
336 + if ($acctName eq 'admin' and (db_get_prop(\%conf, "AWStats", "mailstatus") || 'disabled') eq 'enabled') {
337 + print $q->Tr (esmith::cgi::genSmallCell ($q, "mail"),
338 + esmith::cgi::genSmallCell ($q, "qmail stats"),
339 + esmith::cgi::genSmallCell ($q, " "),
340 + esmith::cgi::genSmallCell ($q,
341 + $q->a ({href => ".awstats/awstats.pl"
342 + . "?config=mail"
343 + . "&lang=" . db_get_prop(\%conf, "AWStats", "Language")},
344 + 'Show...')),
345 + esmith::cgi::genSmallCell ($q,'active'),
346 + esmith::cgi::genSmallCell ($q,' ')
347 + );
348 + }
349 +
350 +
351 +# add to see ftp stats
352 + if ($acctName eq 'admin' and (db_get_prop(\%conf, "AWStats", "ftpstatus") || 'disabled') eq 'enabled') {
353 + print $q->Tr (esmith::cgi::genSmallCell ($q, "ftp"),
354 + esmith::cgi::genSmallCell ($q, "proftpd stats"),
355 + esmith::cgi::genSmallCell ($q, " "),
356 + esmith::cgi::genSmallCell ($q,
357 + $q->a ({href => ".awstats/awstats.pl"
358 + . "?config=ftp"
359 + . "&lang=" . db_get_prop(\%conf, "AWStats", "Language")},
360 + 'Show...')),
361 + esmith::cgi::genSmallCell ($q,'active'),
362 + esmith::cgi::genSmallCell ($q,' ')
363 + );
364 + }
365 +
366 }#awstats is enabled
367 print '</table>';
368
369 diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh smeserver-awstats-1.4/root/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh
370 --- smeserver-awstats-1.4.old/root/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh 1970-01-01 04:00:00.000000000 +0400
371 +++ smeserver-awstats-1.4/root/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh 2023-02-10 23:17:40.000000000 +0400
372 @@ -0,0 +1,14 @@
373 +#!/bin/bash
374 +
375 +# Qmail logfile preprocessor
376 +
377 +/usr/bin/test $(/bin/ls -l /var/log/qmail/*.s 2>/dev/null | grep -v "^l" | wc -l) -eq 0 && /bin/touch /var/log/qmail/awstats_dummy.s
378 +RR=$(/bin/ls -t /var/log/qmail/*.s|/usr/bin/head -n 1)
379 +RR=$(/bin/basename $RR)
380 +/usr/bin/test ! -f /var/log/qmail/.recent-rotated && SRC="/var/log/qmail/*.s" && echo $RR > /var/log/qmail/.recent-rotated
381 +LR=$(/bin/cat /var/log/qmail/.recent-rotated)
382 +echo "RR: $RR LR: $LR"
383 +/usr/bin/test "$LR" != "$RR" && SRC="/var/log/qmail/$RR" && echo $RR > /var/log/qmail/.recent-rotated
384 +/bin/cat $SRC /var/log/qmail/current | /usr/local/bin/tai64nlocal | /usr/bin/perl /usr/share/awstats/tools/maillogconvert.pl standard | /bin/grep -v ' alias-localdelivery-'
385 +/bin/rm -f /var/log/qmail/awstats_dummy.s
386 +

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed