Compare commits

...

15 Commits

Author SHA1 Message Date
Daniel Berteaud
a5825b7f33 Spec file update 2015-03-20 09:41:04 +01:00
Daniel Berteaud
05fab71013 Skip local hosts 2015-03-20 09:24:36 +01:00
Daniel Berteaud
d2fa0188a7 Fix access prop 2015-03-20 09:12:09 +01:00
Daniel Berteaud
de5cc05d5b Mise à jour du fichier spec 2012-10-09 19:30:16 +02:00
Daniel Berteaud
adbf221692 Corrige le template de la page d'index 2012-10-09 19:29:38 +02:00
Daniel Berteaud
28fa6d4e2f mise à jour du fichier spec 2012-10-05 11:37:34 +02:00
Daniel Berteaud
fa7801c08e Prise en compte des vhosts en plus des domaines 2012-10-05 11:36:42 +02:00
Daniel Berteaud
e1a93b6918 Mise à jour du fichier spec 2012-09-04 14:00:54 +02:00
Daniel Berteaud
5c9a0e54e5 Mise à jour de la prop pour auth LL::NG 2012-09-04 14:00:16 +02:00
Daniel Berteaud
f9658822a5 update spec file 2012-05-18 10:55:10 +02:00
Daniel Berteaud
f7e6a93ef5 Report different pages for dokuwiki 2012-05-18 10:54:04 +02:00
Daniel Berteaud
90a1a7dc6d Allow full year view from CGI 2012-05-18 10:50:52 +02:00
Daniel Berteaud
add7a74a13 0.1.1 2012-04-04 10:07:08 +02:00
Daniel Berteaud
af143ab787 fix last commit 2012-04-03 16:03:21 +02:00
Daniel Berteaud
a1ab21c4da Use cgi instead of static 2012-04-03 16:03:07 +02:00
9 changed files with 62 additions and 57 deletions

View File

@ -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");

View File

@ -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

View File

@ -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 ){

View File

@ -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){

View File

@ -1,3 +1,6 @@
AllowFullYearView=3
URLWithQuery=1
URLWithQueryWithOnlyFollowingParameters="id"
ShowSummary=UVPHB
ShowMonthStats=UVPHB
ShowDaysOfMonthStats=VPHB

View File

@ -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) . '"';
}

View File

@ -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";
}
}

View File

@ -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
}
}
}

View File

@ -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";
}
}