initial commit of file from CVS for smeserver-webfilter on Sat Sep 7 16:44:31 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 16:44:31 +10:00
parent d8b207fd9e
commit 4e92e4ef80
87 changed files with 9052 additions and 2 deletions

438
additional/CHANGELOG.git Normal file
View File

@@ -0,0 +1,438 @@
commit f765c91ecd3af5e838b0a3a11af302d17d301e21
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Thu Nov 19 16:28:55 2015 +0100
Add pt-br localization (thanks to Jáder Marasca)
commit 3ff42533f5200e16fc814094fd5b1fe7c42670b9
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri May 15 17:45:41 2015 +0200
Spec file update
commit 4b0e6d7a191f441821a982404c3a46667b90a825
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri May 15 17:14:02 2015 +0200
Add Danish translation (by Jan B Thygesen)
commit 83fcefb6d6c0528a58fe013ce197a96f67a67157
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Jun 25 15:30:27 2014 +0200
Spec file update
commit 8d5e6d24903b942125fa8e3c04926f04d28925b6
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Jun 25 15:27:41 2014 +0200
Pre-create log files
commit 3eb9fd0a2e4f24b7f6d9bc775584b1212b51793a
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Jun 25 15:22:06 2014 +0200
Define HOME so the daily cleanup works on EL6
commit ec3df04a57cecd5ea0713e230cf1fc4a0110df3b
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Nov 12 14:12:41 2013 +0100
update spec file
commit c2a95cff667fe039e3c191ed7997925c89c2cfb7
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Nov 12 14:10:57 2013 +0100
Adapt perl lib path for EL6
commit ff6bfd88ae783762f0641c26871bd8d1ca680e03
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Sep 6 16:06:33 2013 +0200
update spec file
commit 1cc3b47a6aede90da14e926b1d793c19fec7a908
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Sep 6 15:56:42 2013 +0200
Correctly handle more than two unrestricted IP or network
commit 0c5ac607b72887bf1f8218c720d786504bc38c02
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Jan 23 10:31:34 2013 +0100
update spec file
commit eff4e670174ab1a9391a820419ad4fd770c0ee16
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Jan 23 10:29:56 2013 +0100
Add possibility to log on a remote MySQL server
commit cf41aa916993001812872b0f0d6674285d379764
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Oct 31 15:03:44 2012 +0100
Update spec file
commit 13450a711488332e7d5d527c8e9367abf910a0b0
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Oct 24 18:53:04 2012 +0200
Don't rotate tables, just purge old entries
commit 1b27d300888c20dec4483c528b87fcc67dd2b377
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Oct 24 12:05:21 2012 +0200
Update spec file
commit bc8f445f61b1bd6c911471a7b4a6562827005d25
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Oct 24 12:04:20 2012 +0200
Handle unsupported request method message in squid logs
commit 922f2eb8e94be3f0666824ff4ff7c79dcb29c02a
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Oct 24 09:55:51 2012 +0200
Update spec file
commit 1582092fc8a38e3a10a4fbf98eaaf270661082f6
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Oct 24 09:40:28 2012 +0200
Add it locale (thanks to Nicola Tiana <Sistemi@chester-perry.it>)
commit 7e39d13b1e203ddef867532d8bc3410210f55164
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 22 19:12:39 2012 +0200
Update spec file
commit 36118ffd45176134625b73c588ce24270fd77420
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 22 19:03:16 2012 +0200
Save de lexicon file as UTF-8
commit 2a6d71fa53088616beb2ae95b0aad57cc02b6ea9
Merge: 9c92240 18e494d
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 22 18:27:22 2012 +0200
Merge branch 'master' of main:/home/e-smith/files/shares/dev/files/smeserver-webfilter
commit 9c9224031dc7582c6d8092c0b36424c92c1a4ec1
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 22 18:16:35 2012 +0200
Add de locale (Thanks to Daniel Schiffer <danielschiffer@freenet.de>)
commit 18e494df4a10695d98af86d84eb9c82181f9dbfc
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Oct 19 17:52:15 2012 +0200
Update spec file
commit 8b9ee5129e8c979f3e29cab2b6147d6df8bf3da8
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Oct 19 17:02:37 2012 +0200
Properly escape domain names
commit 83237122d03c749dab8d5ebae37445cb1e889e32
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Oct 19 17:00:33 2012 +0200
Fix processing of CONNECT blocked by squidGuard
commit 81ab643abcb286f9ee3b6c34534fe2eaf2a6b8d3
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Oct 19 12:45:48 2012 +0200
Update spec file
commit e2a0579907daca888b140b790eb1fb3a83c24b3e
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Oct 19 12:45:03 2012 +0200
Use larger varchar for URL and domain names
commit 07c198493a6ca2736de19dbbaacf46e960b32b5d
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Thu Oct 18 22:49:44 2012 +0200
Update spec file
commit 0b4f245f61ceee0ae7c40a7b665efb2cb80598b1
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Thu Oct 18 22:04:36 2012 +0200
Add missing dbuser option to squid-db-logd script
commit b1b3ba70c6776c41987fad3c290369615e24bdea
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Thu Oct 18 22:03:16 2012 +0200
Log stderr to stdout in run script
commit fcbba0f55d3d7481b66d791e149d3775c6d24e3b
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Thu Oct 18 21:25:04 2012 +0200
Optimize INSERT by preparing once execute many times
commit ce0c7ec3b25c771a6b34ceaecb4401428c9f4183
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Oct 17 12:16:32 2012 +0200
Update spec file
commit 8c4fe7bf9989e74594d1020026070a47cb4a88d8
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Oct 17 10:48:49 2012 +0200
Fix processing of CONNECT lines
commit bcf26f204e2fd24ed3fa466cd29b49eb3b83fd7a
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Sun Oct 14 23:00:46 2012 +0200
Mise à jour du ichier spec
commit 385fff0567e22b1a4e86d11b7747a782bf8c21b7
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Sun Oct 14 22:59:54 2012 +0200
Ignorer les requêtes de stats de squidclient
commit bde87b05efa57ac53a4bc744c299005dca77a1b3
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Oct 12 14:24:57 2012 +0200
Mise à jour du fichier spec
commit 2147ede5b174687368fe3a6306fcdf151762081e
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Oct 9 13:51:40 2012 +0200
Ajout d'une colonne indépendante pour la domaine (utile pour les stats)
commit 98b39de52c4c2b09e688e48f25376583ac56b0a3
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Oct 9 13:17:37 2012 +0200
fonction mysql_escape
commit 1763c66b7c47b5f7ff2b49006f5a46640181a90f
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 8 21:04:08 2012 +0200
Ajout d'un script pour la rotation/compression des logs MySQL
commit 65a8f571794c8fede13ae52f3a85c9afc7d0f45e
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 8 20:55:32 2012 +0200
Chomp hostname
commit 9d339e6557214f10ddcc8afefcd62d8523f96cbc
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 8 16:02:25 2012 +0200
Ajustement des tailles de données dans la base squid_log
commit 6c15f56964b1a25f61fbeb81ebd410579d014ffb
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 8 15:56:23 2012 +0200
Échapement des entrées pour MySQL
commit 9cc388baaad15ec758b767668f7d008fe01984bb
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 8 15:54:10 2012 +0200
Corrige l'arrêt du process si squid n'est pas activé
commit 7526d511affce35b1c7dbcbfb6ebf6e99713022a
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Oct 8 15:53:51 2012 +0200
Lance le processus en tant qu'utilisateur squid (pas besoin des droits root)
commit 4deffc7f2f0bd034c944d8e6674231e0a0b1cc30
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Sun Oct 7 19:50:07 2012 +0200
Ajout du démon Squid Database Logging Daemon
commit 4ec65fd89617edfa1c9eff6bb242910400a55c29
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Sun Oct 7 17:56:28 2012 +0200
Log toutes les catégories dans un fichier unique
commit e1f8cd42181b72df622eb7e67d03d4ebfebe8d65
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Sun Oct 7 16:40:21 2012 +0200
Mise à jour du fichier spec
commit 89285d4015ed7c8acb36c196912b6aad1af0dc66
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Sun Oct 7 16:39:34 2012 +0200
Maquer les catégories désactivées du panel
commit 7fd3bba11393ee82430b13d63478ccbfc78649bc
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Sep 11 10:44:43 2012 +0200
Mise à jour du fichier spec
commit a36b59ba9811a003d9b719272542349116fb5c9b
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Sep 11 10:30:17 2012 +0200
Support whitelist pour squidclamav
commit e7a84ee87c285d794d3d7fef85450b3ba65e065d
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Aug 27 17:48:16 2012 +0200
Mise à jour du fichier spec
commit b9747662cbfaeab0560abd64c80fdc1686e7c0dd
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Aug 27 17:47:36 2012 +0200
Correction de la locale FR (label filtrage av)
commit 43fc6641a40104a713ea4a230cea3ea718ceeca4
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Aug 27 17:46:38 2012 +0200
Mise à jour du fichier spec
commit f41d426fdbf49b8226030eb2ccf4b651ac524eac
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Fri Jul 6 11:04:55 2012 +0200
Plus de process de filtrage
commit db41f0a8b853dac68312c455ec890de477be4fb8
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Apr 18 13:25:13 2012 +0200
update spec file
commit 8a021e53e0aba986f0ca00adf476cc2d38efd023
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Apr 18 13:24:34 2012 +0200
Log cron job to /dev/null
commit 03b045bdd53913cdf0e2384419539efa171d2e6b
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Wed Apr 18 13:23:42 2012 +0200
quiet rsync command
commit e68d0c05c8361d0322be6e28bf2aed238a72a745
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Apr 17 10:52:25 2012 +0200
Add logrotate file for squidclamav
commit 8ba0d1bdf35e29139739696c603d20569b9598a1
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Apr 17 10:50:30 2012 +0200
Fix templates and status report
commit e8ddbdb1400875304a5c36f2984e8916c17805d2
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Apr 17 10:03:35 2012 +0200
Initial squidclamav support
commit a5046b92fd935bb00708cea1c1e697d41fb68ef4
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Apr 17 09:41:18 2012 +0200
Remove havp
commit c924f6cbd1e8d3c609d36beeed718f22e8626fce
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 19:33:53 2012 +0200
umount scan image when shuting down
commit 44b4a8e8163f57ece9a7d61781222ddc1ca82999
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 19:28:05 2012 +0200
Fix dd command
commit d53cc83183836698fbb744820a1237541d3e0ad9
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 19:00:11 2012 +0200
make havp supervised again
commit e6162b3311ac8d80c28827608fae71e5b447c9c3
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 17:40:05 2012 +0200
put havp in front of squid
commit dd34d2a331903b45529a6ae9eacfbf0d69bfd687
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 16:20:07 2012 +0200
Allow to use a external parent proxy
commit 39d5ecf3a99cfbc95df4b039a26b43330795909d
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 15:31:24 2012 +0200
daemonize havp
commit 348d3d622b0e5c015ebb36bce49bf0ed5f00684f
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 15:02:11 2012 +0200
Syntax error in action script
commit a36f746f0b123a4c3577627702fa7e320d3c5b2f
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 14:51:53 2012 +0200
Simplified panel with merged domains and urls wbl
commit 01b37191386d99ebc67f8d0f7f567f3a2650a212
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Mon Apr 16 10:12:59 2012 +0200
initial havp support
commit 814b0d48fa1dff56f892256961e73cce3fe8b552
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Apr 3 18:34:25 2012 +0200
Fix log files ownership
commit 2d343286e62ef289f219e70fc02a5c095cbcb3b5
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Mar 27 11:23:17 2012 +0200
add .log suffix to log files
commit 3e658313bc64496a3f6ea436206905e7746a735c
Author: Daniel Berteaud <daniel@firewall-services.com>
Date: Tue Mar 27 10:32:36 2012 +0200
Initial commit

View File

@@ -0,0 +1,154 @@
%define version 0.2.15
%define release 1
%define name smeserver-webfilter
Summary: web filtering proxy for SME Server
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Epoch: 9
License: GPL
Group: Networking/Daemons
Source: %{name}-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArchitectures: noarch
BuildRequires: e-smith-devtools
Requires: squidGuard >= 1.4
Requires: squidclamav
Requires: perl(File::Tail)
Requires: perl(Getopt::Long)
Requires: perl(DBI)
Requires: perl(URI)
Obsoletes: smeserver-squidguard
Provides: smeserver-squidguard
%description
Web proxy filtering based on squidguard and squidclamav
%changelog
* Fri May 15 2015 Daniel Berteaud <daniel@firewall-services.com> 0.2.15-1
- Add Danish localization (by Jan B Thygesen)
* Wed Jun 25 2014 Daniel Berteaud <daniel@firewall-services.com> 0.2.14-1
- fix cleanup cronjob on EL6
- Pre-create log files to prevent warnings
* Tue Nov 12 2013 Daniel Berteaud <daniel@firewall-services.com> 0.2.13-1
- New branch for SME9
* Fri Sep 6 2013 Daniel Berteaud <daniel@firewall-services.com> 0.2.12-1
- Correctly handle more than two unrestricted IP or network
* Wed Jan 23 2013 Daniel Berteaud <daniel@firewall-services.com> 0.2.11-1
- It's now possible to log on a remote MySQL server
* Wed Oct 24 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.10-1
- Don't rotate tables, just purge old entries
* Wed Oct 24 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.9-1
- Handle error:unsupported-request-method in squid logs
* Wed Oct 24 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.8-1
- Add it locale for the panel, thanks to Nicola Tiana <Sistemi@chester-perry.it>
* Mon Oct 22 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.7-1
- Use UTF-8 for de locale file
* Mon Oct 22 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.6-1
- Add de locale to the panel, thanks to Daniel Schiffer <danielschiffer@freenet.de>
* Fri Oct 19 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.5-1
- Fix processing of denied CONNECT in squidGuard logs
- Properly escape domain names
* Fri Oct 19 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.4-1
- Use larger varchar for URL and domain names
* Thu Oct 18 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.3-1
- Optimize database inserts
- Log stderr to stdout in squid-db-logd run script
- Add missing dbuser option in squid-db-logd
* Wed Oct 17 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.2-1
- Fix processing CONNECT lines
* Sun Oct 14 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.1-1
- Ignore stats requests from squidclient
* Sun Oct 7 2012 Daniel Berteaud <daniel@firewall-services.com> 0.2.0-1
- Include Squid Database Logging Daemon (squid-db-logd)
* Sun Oct 7 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.4-1
- Fix hidding disabled caegories
* Tue Sep 11 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.3-1
- Add whitelists to squidclamav
* Mon Aug 27 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.2-1
- Fix en-us locale (label AV Filtering)
* Fri Jul 6 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.1-1
- Spawn more redirect children
* Mon Apr 16 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.0-1
- Rename to smeserver-webfilter
- Add AV filtering with squidclamav
- Simplified panel
- Log cron job to dev null
- Use quiet rsync arg
* Tue Apr 03 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.2-1
- Fix ownership of log files
* Tue Mar 27 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.1-1
- Add .log suffix to log files
* Tue Mar 27 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.0-1
- Move to git
* Tue Feb 21 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1-1
- initial release
%prep
%setup -q -n %{name}-%{version}
%build
%{__mkdir_p} root/var/log/squid-db-logd
perl createlinks
%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 /var/squidGuard/blacklists 'attr(0750,squid,squid)' \
--dir /var/log/squid-db-logd 'attr(0770,smelog,smelog)' \
--file /usr/bin/squid-db-logd 'attr(0755,root,root)' \
--file /var/service/squid-db-logd/run 'attr(0755,root,root)' \
--file /var/service/squid-db-logd/log/run 'attr(0755,root,root)' \
--file /var/squidGuard/blacklists/black/domains 'attr(0640,squid,squid) %config(noreplace)' \
--file /var/squidGuard/blacklists/black/urls 'attr(0640,squid,squid) %config(noreplace)' \
--file /var/squidGuard/blacklists/white/domains 'attr(0640,squid,squid) %config(noreplace)' \
--file /var/squidGuard/blacklists/white/urls 'attr(0640,squid,squid) %config(noreplace)' \
--file /etc/cron.daily/squid-db-cleanup 'attr(0755,root,root)' \
--file /var/log/squidGuard/deny.log 'attr(0640,squid,squid) %config(noreplace)' \
--file /var/log/squidGuard/white.log 'attr(0640,squid,squid) %config(noreplace)' \
--file /var/log/squidGuard/squidGuard.log 'attr(0640,squid,squid) %config(noreplace)' \
> %{name}-%{version}-filelist
echo "%doc CHANGELOG.git" >> %{name}-%{version}-filelist
echo "%doc squid_log.sql" >> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%clean
rm -rf $RPM_BUILD_ROOT
%post
%preun

44
additional/squid_log.sql Normal file
View File

@@ -0,0 +1,44 @@
-- Table to store squid access logs
CREATE TABLE access_log (
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
proxy_host VARCHAR(30),
timestamp DECIMAL(15,3),
date_day DATE, -- set by trigger
date_time TIME, -- set by trigger
response_time INTEGER,
client_ip CHAR(15),
squid_status VARCHAR(30),
http_status VARCHAR(10),
reply_size INTEGER,
request_method VARCHAR(15),
url VARCHAR(600),
domain VARCHAR(60),
username VARCHAR(30),
squid_connect VARCHAR(20),
server_ip CHAR(15),
mime_type VARCHAR(50)
) ENGINE=MYISAM;
-- trigger that extracts the date value from the timestamp column
-- and stores it in the date_day and date_time columns
-- this allows fast calculation of per-day aggregate values
DELIMITER //
CREATE TRIGGER extract_date_bi BEFORE INSERT ON access_log FOR EACH ROW
BEGIN
SET NEW.date_day = DATE(FROM_UNIXTIME(NEW.timestamp));
SET NEW.date_time = TIME(FROM_UNIXTIME(NEW.timestamp));
END; //
CREATE TABLE deny_log (
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
proxy_host VARCHAR(30),
date_day DATE,
date_time TIME,
category VARCHAR(40),
client_ip CHAR(15),
url VARCHAR(600),
domain VARCHAR(60),
username VARCHAR(30)
) ENGINE=MYISAM;