From: Lionel B. <lio...@bo...> - 2005-01-13 12:37:23
|
Rene Joergensen wrote the following on 01/13/2005 12:59 PM : >>1.5.x won't start until February as I'll be skiing from Saturday until >>then and 1.4.x still has some TODOs. >> >> > >Have you looked at the automatic whitelist updating? Or should i try >writing something using LWP. I guess the most reliable method is >fetching via HTTP and comparing MD5-sums afterwards. Or did you have >something different in mind? > > > I would have used the following : a new entry in sqlgrey.conf like "whitelist_rooturl = http://sqlgrey.bouton.name/whitelists" Then the update script (be it bash using wget, perl using LWP or whatever) will : - create a temporary directory in /tmp with mktemp -d, - fetch two md5 files, (named root_url/<whitelist_file>.md5), with timestamps (wget -N) compare them to the md5 in /etc/sqlgrey/, if one of them is newer (or there's no md5 in /etc/sqlgrey), continue, else abort, - fetch the missing whitelist files, compare md5, if successfull continue, else output an error (lets cron manage the mail handling), - optionnaly (new conf var: update_whitelist_showdiff != 0), show the diffs on the standard output and let cron send it to the admin, - move the whitelists and the *.md5 to /etc/sqlgrey, - send SIGUSR1 to the pid in /var/run/sqlgrey.pid, - cleanup the temp dir. I'll try to find the time to code this before Saturday and release 1.4.3. If people start hammering the poor whitelist server, I'll switch to the clamav way of managing this : use DNS to store a whitelist version. This has been proven quite efficient. Lionel. |