Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a5825b7f33 | ||
|
05fab71013 | ||
|
d2fa0188a7 | ||
|
de5cc05d5b | ||
|
adbf221692 | ||
|
28fa6d4e2f | ||
|
fa7801c08e | ||
|
e1a93b6918 | ||
|
5c9a0e54e5 | ||
|
f9658822a5 | ||
|
f7e6a93ef5 | ||
|
90a1a7dc6d | ||
|
add7a74a13 | ||
|
af143ab787 | ||
|
a1ab21c4da |
|
@ -2,7 +2,8 @@
|
|||
|
||||
use esmith::Build::CreateLinks qw(:all);
|
||||
|
||||
templates2events("/etc/cron.hourly/awstats", qw(webapps-update bootstrap-console-save domain-create domain-modify domain-delete));
|
||||
templates2events("/usr/share/awstats/wwwroot/index.html", qw(webapps-update bootstrap-console-save domain-create domain-modify domain-delete));
|
||||
safe_symlink("/etc/e-smith/templates-default/template-begin-html", "root/etc/e-smith/templates/usr/share/awstats/wwwroot/index.html/template-begin");
|
||||
|
||||
foreach my $event (qw/webapps-update bootstrap-console-save domain-create domain-modify domain-delete/){
|
||||
event_link("awstats-update", "$event", "80");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
%define version 0.1.0
|
||||
%define version 0.1.6
|
||||
%define release 1
|
||||
%define name ipasserelle-stats
|
||||
|
||||
|
@ -22,6 +22,23 @@ Requires: awstats
|
|||
Génère des statistique de consultation de vos sites web
|
||||
|
||||
%changelog
|
||||
* Fri Mar 20 2015 Daniel Berteaud <daniel@firewall-services.com> 0.1.6-1
|
||||
- Fix access prop
|
||||
- Add a fragment to ignore local hosts when building stats
|
||||
|
||||
* Tue Oct 9 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.5-1
|
||||
- Fix index page template
|
||||
|
||||
* Fri Oct 5 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.4-1
|
||||
- Enable stats for vhosts
|
||||
|
||||
* Tue Sep 4 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.3-1.sme
|
||||
- Update LL::NG auth prop
|
||||
|
||||
* Fri May 18 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.2-1.sme
|
||||
- Allow full year view from CGI
|
||||
- Allow stats per page for dokuwiki
|
||||
|
||||
* Tue Apr 03 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.0-1.sme
|
||||
- initial release
|
||||
|
||||
|
@ -31,14 +48,12 @@ Génère des statistique de consultation de vos sites web
|
|||
|
||||
%build
|
||||
perl createlinks
|
||||
%{__mkdir_p} root/home/e-smith/files/stats/
|
||||
|
||||
%install
|
||||
/bin/rm -rf $RPM_BUILD_ROOT
|
||||
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
|
||||
/bin/rm -f %{name}-%{version}-filelist
|
||||
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
|
||||
--dir /home/e-smith/files/stats/ 'attr(0750,root,www)' \
|
||||
> %{name}-%{version}-filelist
|
||||
|
||||
%files -f %{name}-%{version}-filelist
|
||||
|
|
|
@ -33,14 +33,14 @@ $vhost = $d->get("stats.$domain");
|
|||
|
||||
if (!$vhost){
|
||||
$d->new_record("stats.$domain",{
|
||||
type => 'domain',
|
||||
Content => 'Primary',
|
||||
Description => "Statistiques web",
|
||||
Nameservers => 'internet',
|
||||
TemplatePath => 'WebAppVirtualHost',
|
||||
DocumentRoot => '/home/e-smith/files/stats',
|
||||
LemonLDAP => 'enabled',
|
||||
Removable => 'yes',
|
||||
type => 'domain',
|
||||
Content => 'Primary',
|
||||
Description => "Statistiques web",
|
||||
Nameservers => 'internet',
|
||||
TemplatePath => 'WebAppVirtualHost',
|
||||
DocumentRoot => '/usr/share/awstats/wwwroot',
|
||||
Authentication => 'LemonLDAP',
|
||||
Removable => 'yes',
|
||||
});
|
||||
|
||||
unless ( system("/sbin/e-smith/signal-event", "domain-create", "stats.$domain") == 0 ){
|
||||
|
|
|
@ -16,7 +16,7 @@ if (defined $domain){
|
|||
@domains = $d->get($domain);
|
||||
}
|
||||
else{
|
||||
@domains = ($d->domains);
|
||||
@domains = ($d->domains,$d->get_all_by_prop(type=>'vhost'));
|
||||
}
|
||||
|
||||
foreach my $dom (@domains){
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
AllowFullYearView=3
|
||||
URLWithQuery=1
|
||||
URLWithQueryWithOnlyFollowingParameters="id"
|
||||
ShowSummary=UVPHB
|
||||
ShowMonthStats=UVPHB
|
||||
ShowDaysOfMonthStats=VPHB
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
|
||||
use esmith::NetworksDB;
|
||||
my $n = esmith::NetworksDB->open_ro() || die "couldn't open networks DB\n";
|
||||
my @local = ();
|
||||
foreach my $net ($n->networks){
|
||||
my $key = $net->key;
|
||||
my $mask = $net->prop('Mask');
|
||||
my $prefix = esmith::util::computeLocalNetworkPrefix($key,$mask);
|
||||
$prefix =~ s/\./\\./g;
|
||||
$prefix = 'REGEX[^' . $prefix . ']';
|
||||
push @local, $prefix;
|
||||
}
|
||||
|
||||
$OUT .= 'SkipHosts="' . join(' ', @local) . '"';
|
||||
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
use esmith::DomainsDB;
|
||||
my $d = esmith::DomainsDB->open_ro or die "Couldn't open DomainsDB\n";
|
||||
my $lang = $awstats{'Language'} || 'fr';
|
||||
$OUT .= 'YEAR=$(date +%Y)'."\n";
|
||||
|
||||
foreach my $dom ($d->domains){
|
||||
my $stats = $dom->prop('Stats') || 'disabled';
|
||||
next if ($stats ne 'enabled');
|
||||
my $name = $dom->key;
|
||||
$OUT .= 'mkdir -p /home/e-smith/files/stats/'."$name".'/$YEAR/'."\n";
|
||||
$OUT .= "/usr/share/awstats/tools/awstats_buildstaticpages.pl -config=$name -update -lang=$lang -dir=/home/e-smith/files/stats/$name/\$YEAR/ 2>&1 > /dev/null\n\n";
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@ if ($status ne 'enabled'){
|
|||
$OUT .= "# AWStats is disabled\n";
|
||||
}
|
||||
else{
|
||||
my $allow = ($status eq 'public') ? 'all':"$localAccess $externalSSLAccess";
|
||||
my $allow = ($access eq 'public') ? 'all':"$localAccess $externalSSLAccess";
|
||||
$OUT .=<<"EOF";
|
||||
|
||||
Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
|
||||
|
@ -24,40 +24,13 @@ Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
|
|||
Allow from $allow
|
||||
</Directory>
|
||||
<Directory "/usr/share/awstats/wwwroot/cgi-bin">
|
||||
Deny from all
|
||||
Options +ExecCGI
|
||||
SetHandler cgi-script
|
||||
</Directory>
|
||||
<IfModule mod_env.c>
|
||||
SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
|
||||
</IfModule>
|
||||
|
||||
<Directory /home/e-smith/files/stats>
|
||||
Options None
|
||||
Options +Indexes
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
Allow from $allow
|
||||
SSLRequireSSL on
|
||||
</Directory>
|
||||
|
||||
EOF
|
||||
|
||||
foreach my $dom ($d->domains){
|
||||
my $stats = $dom->prop('Stats') || 'disabled';
|
||||
next unless ($stats eq 'enabled');
|
||||
my $name = $dom->key;
|
||||
my @users = split /[;,]/, ($dom->prop('StatsUsers') || '');
|
||||
foreach my $u (@users){
|
||||
$OUT .= " SetEnvIf Auth-User \"$u\" allow_$name\n";
|
||||
}
|
||||
my $allowfromenv = (scalar @users > 0) ? "allow from env=allow_$name":'';
|
||||
$OUT .=<<"HERE";
|
||||
|
||||
<Directory /home/e-smith/files/stats/$name>
|
||||
DirectoryIndex awstats.$name.html
|
||||
$allowfromenv
|
||||
</Directory>
|
||||
|
||||
HERE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
use esmith::DomainsDB;
|
||||
my $d = esmith::DomainsDB->open_ro or die "Couldn't open DomainsDB\n";
|
||||
foreach my $dom ($d->domains,$d->get_all_by_prop(type=>'vhost')){
|
||||
my $stats = $dom->prop('Stats') || 'disabled';
|
||||
next unless ($stats eq 'enabled');
|
||||
my $name = $dom->key;
|
||||
$OUT .= "<a href=\"https://stats.$DomainName/cgi-bin/awstats.pl?config=$name\">$name</a><p>\n";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user