forked from aleksey200505/lightsquid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lightsquid.cfg
174 lines (136 loc) · 4.83 KB
/
lightsquid.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#
# LightSquid Project (c) 2004-2008 Sergey Erokhin aka ESL
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# detail see in gnugpl.txt
# -------------------- GLOBAL VARIABLES ---------------------------
#path to additional `cfg` files
$cfgpath ="/var/www/html/lightsquid";
#path to `tpl` folder
$tplpath ="/var/www/html/lightsquid/tpl";
#path to `lang` folder
$langpath ="/var/www/html/lightsquid/lang";
#path to `report` folder
$reportpath ="/var/www/html/lightsquid/report";
#path to access.log
$logpath ="/var/log/squid";
#path to `ip2name` folder
$ip2namepath ="/var/www/html/lightsquid/ip2name";
#path to `lockfile` ;-)
$lockpath =$reportpath;
#if lockfile older $maxlocktime second, remove old lock file.
$maxlocktime = 30*60;
#if 1 - lightparser generate some statistic
$debug = 0;
#if 1 - lightparser generate skip details, 2 ..., 3 ..., ....
$debug2 = 0;
# -------------------- LightParser VARIABLES ---------------------------
#squid log type
#if native squid format (default squid, see in doc) - must be 0
#if EmulateHttpdLog ON - set 1
#digit - for speed optimization
#try it set to 1 if parser generate warning
#
#see also month2dec below !!!!
#
$squidlogtype = 0;
#if you want skip some sites from stat, example our local www server
#WARNING !!!, don't leave this variable empty !!!
#example, if you want skip LOCAL site, put it here
#WARNING2
#use '' instead of "" !!!!!!!!!!!
#$skipurl = 'zdd\.com|192\.168\.1\.|cnn\.com';
$skipurl = 'zzz\.zzz';
#define sobroutine file for convertion from IP into name
#if you want skip some ip from log - return "SKIP THIS IP" ;-)
#detail see in ip2name folder,
$ip2name="simple";
#use for convert from Text to Dec convertion if EmualteHttpdLog format !!!!
#fix it if need
%month2dec = ( Jan => 1, Feb => 2, Mar => 3, Apr => 4, May => 5,Jun => 6,
Jul => 7, Aug => 8, Sep => 9, Oct => 10, Nov => 11,Dec => 12);
# -------------------- Common (Parser & Web) VARIABLES ----------------------
#create & use time report statistic (logsize = logsize*2) ;-))
$timereport = 1;
# -------------------- WEB VARIABLES ----------------------------------------
#language
#see `lang` folder (avaible: bg,eng,fr,hu,it,pt_br,ru,sp)
$lang ="eng";
#html template name
#see template folder `tpl/$templatename/`
$templatename ="base";
#$templatename ="ric";
#$templatename ="base.css";
#define type of decimal output
#fine 123456789 -> 123,456,789
#class 123456789 -> 117.7 G
$DecOutType="class";
# define delimiter for thousands (in `fine` mode)
# = " " -> 12 345 678
# = "," -> 12,345,678
# = "" -> 12345678
$decdelimiter = " ";
#if you dont need Group mode, do =0
$showgrouplink = 1;
#if not zero, groups look like "01. Group1", if zero - "Group1"
$showgroupid = 1;
#if you dont need oversize report , do =0
$showoversizelink = 1;
#show how many data user send to internet
$showputpost = 0;
#if putpost higer this variable (in percent), highlight it
$putpostwarninglevel =15;
#use or not .realname files
#.realname contain pair userid -> Full User Name
$userealname = 1;
#if url size exceed $bigfilelimit - add this file into report
$bigfilelimit = 2*1024*1024;
#user maximum size per day limit (oversize)
$perusertrafficlimit = 10*1024*1024;
# weekend display mode
# both - select sunday & monday
# monday - only monday
$weekendmode="both";
#how many site show in TopSites report
$topsiteslimit = 500;
#how many site show in user time report
$usertimelimit = 200;
#if you want user traffic GRAPHIC report, set it in 1
#WARNING !!!, need libgd, GD.PM & other external modules !!!
#please run check-setup.pl for check library !!!!
$graphreport = 1;
#higest value on graph report
# for user month report (0.05*(...) = 50mb)
$graphmaxuser=0.05*(1024*1024*1024);
# for all user month report (1.05*(...) = 1 Gb)
$graphmaxall =0.80*(1024*1024*1024);
#color scheme for GRAPHICs, avaible "orange","blue","green","yellow","brown","red"
$barcolor="orange";
#-------------------------------------------------------------------------- Group support
#
sub CreateGroupFile($) {
my $path=shift;
open Fi,"<$cfgpath/group.cfg";
open Fo,">$path/.group";
while (<Fi>) {
print Fo $_;
}
close Fo;
close Fi;
}
#-------------------------------------------------------------------------- RealName support
#
sub CreateRealnameFile($) {
my $path=shift;
open Fi,"<$cfgpath/realname.cfg";
open Fo,">$path/.realname";
while (<Fi>) {
print Fo $_;
}
close Fo;
close Fi;
}