[kde-services-devel] r510 - in trunk/commitfilter: . rules web
josef at new.kstuff.org
josef at new.kstuff.org
Sun Apr 19 17:02:26 CEST 2009
Author: josef
Date: 2009-04-19 17:02:25 +0200 (Sun, 19 Apr 2009)
New Revision: 510
Added:
trunk/commitfilter/rules/cia2eximfilter.rb
trunk/commitfilter/rules/commitfilter-cia
trunk/commitfilter/rules/commitfilter-cia.sql
trunk/commitfilter/web/cia.inc
Modified:
trunk/commitfilter/ChangeLog
trunk/commitfilter/NEWS
trunk/commitfilter/TODO
trunk/commitfilter/commitfilter
trunk/commitfilter/commitfilter.conf-dist
trunk/commitfilter/rules/cia2eximfilter
trunk/commitfilter/setup.txt
trunk/commitfilter/web/func.my.inc
trunk/commitfilter/web/htconf-dist
trunk/commitfilter/web/index.php
trunk/commitfilter/web/my.inc
Log:
- full integration of CIA rule import into the commitfilter web frontend and backend application
Modified: trunk/commitfilter/ChangeLog
===================================================================
--- trunk/commitfilter/ChangeLog 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/ChangeLog 2009-04-19 15:02:25 UTC (rev 510)
@@ -1,6 +1,182 @@
------------------------------------------------------------------------
-r362 | josef | 2007-06-20 09:03:04 +0200 (Mi, 20 Jun 2007) | 6 lines
+r463 | josef | 2008-05-15 12:41:16 +0200 (Do, 15. Mai 2008) | 3 lines
Geänderte Pfade:
+ M /trunk/commitfilter/web/help.inc
+
+- missing word, reported by Jerry Amundson
+
+
+------------------------------------------------------------------------
+r462 | josef | 2008-05-12 20:41:24 +0200 (Mo, 12. Mai 2008) | 3 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/web/help.inc
+ M /trunk/commitfilter/web/help.inc.de
+
+- link to kde-commits hook script to see which addresses receive copies by default
+
+
+------------------------------------------------------------------------
+r458 | josef | 2008-05-07 09:34:57 +0200 (Mi, 07. Mai 2008) | 3 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/commitfilter
+
+- fix huge bounce backlogs by disabling author and regex rules too instead of just directory rules
+
+
+------------------------------------------------------------------------
+r409 | josef | 2008-02-07 17:33:40 +0100 (Do, 07. Feb 2008) | 3 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/web/changes.inc
+
+- finally some news again
+
+
+------------------------------------------------------------------------
+r408 | josef | 2008-02-07 17:25:45 +0100 (Do, 07. Feb 2008) | 3 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/web/design/html.top
+
+- add hin to favicon
+
+
+------------------------------------------------------------------------
+r407 | josef | 2008-02-07 17:22:03 +0100 (Do, 07. Feb 2008) | 3 lines
+Geänderte Pfade:
+ D /trunk/commitfilter/favicon.ico
+ A /trunk/commitfilter/web/favicon.ico (von /trunk/commitfilter/favicon.ico:406)
+
+- oops, wrong directory
+
+
+------------------------------------------------------------------------
+r406 | josef | 2008-02-07 17:21:12 +0100 (Do, 07. Feb 2008) | 3 lines
+Geänderte Pfade:
+ A /trunk/commitfilter/favicon.ico
+
+- favicon as requested by dexter
+
+
+------------------------------------------------------------------------
+r396 | josef | 2007-12-09 00:12:36 +0100 (So, 09. Dez 2007) | 3 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/web/design/html.bottom
+
+- fix commitfilter project URL
+
+
+------------------------------------------------------------------------
+r388 | josef | 2007-12-08 21:25:09 +0100 (Sa, 08. Dez 2007) | 3 lines
+Geänderte Pfade:
+ A /trunk/commitfilter/web/.htaccess
+
+- make sure we have short open tags disabled
+
+
+------------------------------------------------------------------------
+r377 | josef | 2007-07-03 14:31:53 +0200 (Di, 03. Jul 2007) | 5 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/web/add.inc
+ M /trunk/commitfilter/web/htconf-dist
+
+- introduce the split between generic and KDE-specific features
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r376 | josef | 2007-07-03 14:19:22 +0200 (Di, 03. Jul 2007) | 5 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/TODO
+
+- pino reported a bug
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r369 | josef | 2007-06-20 10:56:50 +0200 (Mi, 20. Jun 2007) | 5 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/commitfilter
+
+- typo which prevented correct generation
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r368 | josef | 2007-06-20 10:55:04 +0200 (Mi, 20. Jun 2007) | 5 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/web/changes.inc
+
+- document the changes
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r367 | josef | 2007-06-20 10:46:51 +0200 (Mi, 20. Jun 2007) | 5 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/web/func.my.inc
+
+- improved quoting of accidentally inserted line breaks
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r366 | josef | 2007-06-20 10:33:11 +0200 (Mi, 20. Jun 2007) | 5 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/commitfilter
+
+- prevent injection attacks by always quoting the "/" character for the cmd test
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r365 | josef | 2007-06-20 10:30:08 +0200 (Mi, 20. Jun 2007) | 5 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/TODO
+
+- some status updates on TODO file
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r364 | josef | 2007-06-20 10:21:35 +0200 (Mi, 20. Jun 2007) | 5 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/commitfilter
+ M /trunk/commitfilter/web/addregex.inc
+
+- do not break if regexps are invalid
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r363 | josef | 2007-06-20 10:06:13 +0200 (Mi, 20. Jun 2007) | 6 lines
+Geänderte Pfade:
+ M /trunk/commitfilter/ChangeLog
+ M /trunk/commitfilter/NEWS
+ M /trunk/commitfilter/commitfilter
+ M /trunk/commitfilter/commitfilter.sql
+ A /trunk/commitfilter/web/addregex.inc
+ M /trunk/commitfilter/web/func.my.inc
+ M /trunk/commitfilter/web/index.php
+ M /trunk/commitfilter/web/list.inc
+ M /trunk/commitfilter/web/my.inc
+ M /trunk/commitfilter/web/my.inc.de
+
+- initial support for regular expressions (FIXME: can cause heavy filter file breakage!)
+- changelog update and fixes to NEWS file
+
+[commit from josef at nada]
+
+
+------------------------------------------------------------------------
+r362 | josef | 2007-06-20 09:03:04 +0200 (Mi, 20. Jun 2007) | 6 lines
+Geänderte Pfade:
A /trunk/commitfilter/NEWS
M /trunk/commitfilter/commitfilter-cleanup
M /trunk/commitfilter/commitfilter.sql
@@ -13,7 +189,7 @@
------------------------------------------------------------------------
-r357 | josef | 2007-05-09 19:19:02 +0200 (Mi, 09 Mai 2007) | 4 lines
+r357 | josef | 2007-05-09 19:19:02 +0200 (Mi, 09. Mai 2007) | 4 lines
Geänderte Pfade:
M /trunk/commitfilter/web/addwebcvs.inc
M /trunk/commitfilter/web/index.php
@@ -24,7 +200,7 @@
------------------------------------------------------------------------
-r355 | josef | 2007-04-02 09:30:08 +0200 (Mo, 02 Apr 2007) | 3 lines
+r355 | josef | 2007-04-02 09:30:08 +0200 (Mo, 02. Apr 2007) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/commitfilter
@@ -32,7 +208,7 @@
------------------------------------------------------------------------
-r340 | josef | 2007-02-19 17:04:23 +0100 (Mo, 19 Feb 2007) | 3 lines
+r340 | josef | 2007-02-19 17:04:23 +0100 (Mo, 19. Feb 2007) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/TODO
M /trunk/commitfilter/web/changes.inc
@@ -41,7 +217,7 @@
------------------------------------------------------------------------
-r339 | josef | 2007-02-19 16:45:59 +0100 (Mo, 19 Feb 2007) | 4 lines
+r339 | josef | 2007-02-19 16:45:59 +0100 (Mo, 19. Feb 2007) | 4 lines
Geänderte Pfade:
M /trunk/commitfilter/TODO
M /trunk/commitfilter/setup.txt
@@ -51,7 +227,7 @@
------------------------------------------------------------------------
-r338 | josef | 2007-02-19 16:38:59 +0100 (Mo, 19 Feb 2007) | 7 lines
+r338 | josef | 2007-02-19 16:38:59 +0100 (Mo, 19. Feb 2007) | 7 lines
Geänderte Pfade:
M /trunk/commitfilter/commitfilter
M /trunk/commitfilter/commitfilter-cleanup
@@ -65,7 +241,7 @@
------------------------------------------------------------------------
-r337 | josef | 2007-02-19 16:37:05 +0100 (Mo, 19 Feb 2007) | 4 lines
+r337 | josef | 2007-02-19 16:37:05 +0100 (Mo, 19. Feb 2007) | 4 lines
Geänderte Pfade:
M /trunk/commitfilter/web/changes.inc
M /trunk/commitfilter/web/index.php
@@ -75,7 +251,7 @@
------------------------------------------------------------------------
-r336 | josef | 2007-02-19 16:21:13 +0100 (Mo, 19 Feb 2007) | 5 lines
+r336 | josef | 2007-02-19 16:21:13 +0100 (Mo, 19. Feb 2007) | 5 lines
Geänderte Pfade:
A /trunk/commitfilter/ChangeLog
@@ -85,7 +261,7 @@
------------------------------------------------------------------------
-r321 | josef | 2007-02-01 09:57:49 +0100 (Do, 01 Feb 2007) | 5 lines
+r321 | josef | 2007-02-01 09:57:49 +0100 (Do, 01. Feb 2007) | 5 lines
Geänderte Pfade:
M /trunk/commitfilter/setup.txt
@@ -95,7 +271,7 @@
------------------------------------------------------------------------
-r311 | josef | 2006-12-15 08:24:42 +0100 (Fr, 15 Dez 2006) | 4 lines
+r311 | josef | 2006-12-15 08:24:42 +0100 (Fr, 15. Dez 2006) | 4 lines
Geänderte Pfade:
A /trunk/commitfilter/commitfilter-cleanup
M /trunk/commitfilter/commitfilter-msg
@@ -105,7 +281,7 @@
------------------------------------------------------------------------
-r308 | josef | 2006-12-01 13:06:58 +0100 (Fr, 01 Dez 2006) | 3 lines
+r308 | josef | 2006-12-01 13:06:58 +0100 (Fr, 01. Dez 2006) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/web/detail.inc
@@ -113,7 +289,7 @@
------------------------------------------------------------------------
-r307 | josef | 2006-11-23 18:31:39 +0100 (Do, 23 Nov 2006) | 3 lines
+r307 | josef | 2006-11-23 18:31:39 +0100 (Do, 23. Nov 2006) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/web/view.inc
@@ -121,7 +297,7 @@
------------------------------------------------------------------------
-r306 | josef | 2006-11-23 16:36:51 +0100 (Do, 23 Nov 2006) | 3 lines
+r306 | josef | 2006-11-23 16:36:51 +0100 (Do, 23. Nov 2006) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/web/addwebcvs.inc
@@ -129,7 +305,7 @@
------------------------------------------------------------------------
-r305 | josef | 2006-11-23 16:34:14 +0100 (Do, 23 Nov 2006) | 4 lines
+r305 | josef | 2006-11-23 16:34:14 +0100 (Do, 23. Nov 2006) | 4 lines
Geänderte Pfade:
M /trunk/commitfilter/web/add.inc
M /trunk/commitfilter/web/addwebcvs.inc
@@ -146,7 +322,7 @@
------------------------------------------------------------------------
-r304 | josef | 2006-11-23 15:42:19 +0100 (Do, 23 Nov 2006) | 3 lines
+r304 | josef | 2006-11-23 15:42:19 +0100 (Do, 23. Nov 2006) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/setup.txt
@@ -154,7 +330,7 @@
------------------------------------------------------------------------
-r302 | josef | 2006-11-23 15:33:12 +0100 (Do, 23 Nov 2006) | 3 lines
+r302 | josef | 2006-11-23 15:33:12 +0100 (Do, 23. Nov 2006) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/commitfilter
A /trunk/commitfilter/web (von /trunk/kstuff/commitfilter:301)
@@ -164,7 +340,7 @@
------------------------------------------------------------------------
-r298 | josef | 2006-11-23 14:38:13 +0100 (Do, 23 Nov 2006) | 3 lines
+r298 | josef | 2006-11-23 14:38:13 +0100 (Do, 23. Nov 2006) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/README
M /trunk/commitfilter/commitfilter.conf-dist
@@ -174,7 +350,7 @@
------------------------------------------------------------------------
-r297 | josef | 2006-11-23 14:11:19 +0100 (Do, 23 Nov 2006) | 3 lines
+r297 | josef | 2006-11-23 14:11:19 +0100 (Do, 23. Nov 2006) | 3 lines
Geänderte Pfade:
M /trunk/commitfilter/commitfilter
M /trunk/commitfilter/commitfilter-msg
@@ -185,7 +361,7 @@
------------------------------------------------------------------------
-r296 | commitfilter | 2006-11-23 13:41:53 +0100 (Do, 23 Nov 2006) | 5 lines
+r296 | commitfilter | 2006-11-23 13:41:53 +0100 (Do, 23. Nov 2006) | 5 lines
Geänderte Pfade:
A /trunk/commitfilter/commitfilter-msg (von /trunk/commitfilter/commitfilter-msg.pl:294)
D /trunk/commitfilter/commitfilter-msg.pl
@@ -197,7 +373,7 @@
------------------------------------------------------------------------
-r295 | commitfilter | 2006-11-23 13:28:29 +0100 (Do, 23 Nov 2006) | 4 lines
+r295 | commitfilter | 2006-11-23 13:28:29 +0100 (Do, 23. Nov 2006) | 4 lines
Geänderte Pfade:
A /trunk/commitfilter/commitfilter (von /trunk/commitfilter/commitfilter.pl:294)
A /trunk/commitfilter/commitfilter.conf-dist
@@ -208,7 +384,7 @@
------------------------------------------------------------------------
-r294 | commitfilter | 2006-11-23 12:03:19 +0100 (Do, 23 Nov 2006) | 3 lines
+r294 | commitfilter | 2006-11-23 12:03:19 +0100 (Do, 23. Nov 2006) | 3 lines
Geänderte Pfade:
A /trunk/commitfilter (von /trunk/cvsfilter:292)
D /trunk/cvsfilter
@@ -217,21 +393,21 @@
------------------------------------------------------------------------
-r290 | josef | 2006-08-14 10:07:49 +0200 (Mo, 14 Aug 2006) | 2 lines
+r290 | josef | 2006-08-14 10:07:49 +0200 (Mo, 14. Aug 2006) | 2 lines
Geänderte Pfade:
A /trunk/cvsfilter/TODO
- items to work on for Commitfilter
------------------------------------------------------------------------
-r277 | josef | 2006-02-10 18:13:03 +0100 (Fr, 10 Feb 2006) | 2 lines
+r277 | josef | 2006-02-10 18:13:03 +0100 (Fr, 10. Feb 2006) | 2 lines
Geänderte Pfade:
A /trunk/cvsfilter/COPYING
- licence file
------------------------------------------------------------------------
-r276 | josef | 2006-02-10 18:10:24 +0100 (Fr, 10 Feb 2006) | 2 lines
+r276 | josef | 2006-02-10 18:10:24 +0100 (Fr, 10. Feb 2006) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/README
A /trunk/cvsfilter/setup.txt
@@ -239,21 +415,21 @@
- documentation!
------------------------------------------------------------------------
-r275 | josef | 2006-02-10 17:50:14 +0100 (Fr, 10 Feb 2006) | 2 lines
+r275 | josef | 2006-02-10 17:50:14 +0100 (Fr, 10. Feb 2006) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/commitfilter.sh
- much better wrapper script with documentation
------------------------------------------------------------------------
-r253 | josef | 2005-11-04 08:50:14 +0100 (Fr, 04 Nov 2005) | 2 lines
+r253 | josef | 2005-11-04 08:50:14 +0100 (Fr, 04. Nov 2005) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/commitfilter.pl
- forgot the $ sign
------------------------------------------------------------------------
-r201 | josef | 2005-07-19 12:16:57 +0200 (Di, 19 Jul 2005) | 3 lines
+r201 | josef | 2005-07-19 12:16:57 +0200 (Di, 19. Jul 2005) | 3 lines
Geänderte Pfade:
M /trunk/cvsfilter/commitfilter.pl
@@ -261,7 +437,7 @@
- s/administrativia/administrivia/ :-)
------------------------------------------------------------------------
-r162 | josef | 2005-06-02 22:02:07 +0200 (Do, 02 Jun 2005) | 2 lines
+r162 | josef | 2005-06-02 22:02:07 +0200 (Do, 02. Jun 2005) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/README
A /trunk/cvsfilter/commitfilter-msg.pl
@@ -275,35 +451,35 @@
- CVSfilter is now known as Commitfilter!
------------------------------------------------------------------------
-r152 | josef | 2005-05-27 23:00:50 +0200 (Fr, 27 Mai 2005) | 2 lines
+r152 | josef | 2005-05-27 23:00:50 +0200 (Fr, 27. Mai 2005) | 2 lines
Geänderte Pfade:
A /trunk/cvsfilter/commitfilter.pl
- commitfilter replaces cvsfilter
------------------------------------------------------------------------
-r151 | josef | 2005-05-27 22:37:04 +0200 (Fr, 27 Mai 2005) | 2 lines
+r151 | josef | 2005-05-27 22:37:04 +0200 (Fr, 27. Mai 2005) | 2 lines
Geänderte Pfade:
A /trunk/cvsfilter/cvsfilter-msg.pl
- backup of nice helper tool for commitfilter
------------------------------------------------------------------------
-r84 | josef | 2004-11-10 14:19:51 +0100 (Mi, 10 Nov 2004) | 2 lines
+r84 | josef | 2004-11-10 14:19:51 +0100 (Mi, 10. Nov 2004) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/cvsfilter.sql
- SQL table for message storing
------------------------------------------------------------------------
-r77 | josef | 2004-11-10 01:02:52 +0100 (Mi, 10 Nov 2004) | 2 lines
+r77 | josef | 2004-11-10 01:02:52 +0100 (Mi, 10. Nov 2004) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/cvsfilter.pl
- branch wildcards
------------------------------------------------------------------------
-r74 | josef | 2004-11-09 22:45:31 +0100 (Di, 09 Nov 2004) | 2 lines
+r74 | josef | 2004-11-09 22:45:31 +0100 (Di, 09. Nov 2004) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/cvsfilter.pl
M /trunk/cvsfilter/cvsfilter.sql
@@ -316,28 +492,28 @@
- support for filter-by-author
------------------------------------------------------------------------
-r69 | josef | 2004-10-24 14:13:58 +0200 (So, 24 Okt 2004) | 2 lines
+r69 | josef | 2004-10-24 14:13:58 +0200 (So, 24. Okt 2004) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/cvsfilter.pl
- let list administrativia solely depend on whether admin email is set
------------------------------------------------------------------------
-r64 | josef | 2004-10-14 12:56:33 +0200 (Do, 14 Okt 2004) | 2 lines
+r64 | josef | 2004-10-14 12:56:33 +0200 (Do, 14. Okt 2004) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/cvsfilter.pl
- fixed forward file generation
------------------------------------------------------------------------
-r55 | josef | 2004-10-12 19:08:56 +0200 (Di, 12 Okt 2004) | 2 lines
+r55 | josef | 2004-10-12 19:08:56 +0200 (Di, 12. Okt 2004) | 2 lines
Geänderte Pfade:
M /trunk/cvsfilter/cvsfilter.pl
- head is now HEAD :)
------------------------------------------------------------------------
-r53 | josef | 2004-10-07 00:53:03 +0200 (Do, 07 Okt 2004) | 3 lines
+r53 | josef | 2004-10-07 00:53:03 +0200 (Do, 07. Okt 2004) | 3 lines
Geänderte Pfade:
M /trunk/cvsfilter/README
M /trunk/cvsfilter/cvsfilter.pl
@@ -347,7 +523,7 @@
- use X-Commit-Directories for better matches
------------------------------------------------------------------------
-r5 | josef | 2004-05-12 22:14:55 +0200 (Mi, 12 Mai 2004) | 2 lines
+r5 | josef | 2004-05-12 22:14:55 +0200 (Mi, 12. Mai 2004) | 2 lines
Geänderte Pfade:
A /trunk/cvsfilter
A /trunk/cvsfilter/README
Modified: trunk/commitfilter/NEWS
===================================================================
--- trunk/commitfilter/NEWS 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/NEWS 2009-04-19 15:02:25 UTC (rev 510)
@@ -1,8 +1,9 @@
-??.??.2007: Version 0.9.2
+??.??.2009: Version 0.9.2
-------------------------
* Easier maintenance by processing bounces and allowing disabling accounts.
* KDE-specific updates for WebSVN and mail subjects.
* Support for full regular expression filtering.
+* Ability to import CIA filtering rules.
23.11.2006: Version 0.9.1
-------------------------
Modified: trunk/commitfilter/TODO
===================================================================
--- trunk/commitfilter/TODO 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/TODO 2009-04-19 15:02:25 UTC (rev 510)
@@ -13,5 +13,6 @@
(invalid?) [allen winter] escaping of directory names (e.g. kdepim-3.5.5+)
(fixed) [pino] it's possible to add a path multiple times, should be forbidden
[josef] extra check on config file, e.g. exim4 -bf
+ [josef] check format of mail addresses, at least full qualification
[shaun] possibility to rename or remove accounts
Modified: trunk/commitfilter/commitfilter
===================================================================
--- trunk/commitfilter/commitfilter 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/commitfilter 2009-04-19 15:02:25 UTC (rev 510)
@@ -1,7 +1,7 @@
#!/usr/bin/perl
#
# Generating a forward file from commitfilter options
-# Copyright (C) 2003 - 2007 Josef Spillner <josef at kstuff.org>
+# Copyright (C) 2003 - 2009 Josef Spillner <josef at kstuff.org>
# Pusblished under GNU GPL conditions.
# Modules to use
@@ -49,8 +49,8 @@
# Loading of configuration file
-use vars qw($dbhost $dbname $dbuser $dbpass);
-use vars qw($adminemail $bounceemail $debug $savecopies);
+use vars qw($dbhost $dbname $dbuser $dbpass $dbport);
+use vars qw($adminemail $bounceemail $debug $savecopies $ciarules);
eval{require $opt_config};
if($@){
print "Configuration file $opt_config not found or invalid.\n";
@@ -64,7 +64,7 @@
# Real work starts here...
-my $conn = DBI->connect("DBI:Pg:host=$dbhost;dbname=$dbname;user=$dbuser;password=$dbpass");
+my $conn = DBI->connect("DBI:Pg:host=$dbhost;dbname=$dbname;user=$dbuser;password=$dbpass;port=$dbport");
$conn || die DBI::errstr;
my ($email, $path, $options, $branches, $author, $cond, $regex);
@@ -202,6 +202,13 @@
}
}
+if($ciarules){
+ my $rules = `commitfilter-cia`;
+ print "\n";
+ print $rules;
+ print "\n";
+}
+
if($savecopies){
print "if error_message then\n";
print "\tsave commitfilter-errors.mbox\n";
Modified: trunk/commitfilter/commitfilter.conf-dist
===================================================================
--- trunk/commitfilter/commitfilter.conf-dist 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/commitfilter.conf-dist 2009-04-19 15:02:25 UTC (rev 510)
@@ -20,6 +20,9 @@
# if > 0, disable account if that many bounces have been received
$autodisablebounces = 0;
+# consider CIA rules
+$ciarules = 0;
+
# end of configuration file
1;
Modified: trunk/commitfilter/rules/cia2eximfilter
===================================================================
--- trunk/commitfilter/rules/cia2eximfilter 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/rules/cia2eximfilter 2009-04-19 15:02:25 UTC (rev 510)
@@ -1,113 +1,8 @@
#!/usr/bin/env ruby
-#load 'hpricot.rb'
+require 'cia2eximfilter'
require 'hpricot'
-class CIA2Exim
- def convert(doc)
- case doc.root.name
- when "or":
- str = convert_or([doc.root])
- when "and":
- str = convert_and([doc.root])
- when "not":
- str = convert_not([doc.root])
- else
- str = convert_match([doc.root])
- end
- return str[0]
- end
-
- def convert_or(items)
- if items.length == 0 then return [] end
- exitems_or = []
- items.each do |item|
- exitems = []
- exitems += convert_or(item/"/or")
- exitems += convert_and(item/"/and")
- exitems += convert_not(item/"/not")
- exitems += convert_match(item/"/match")
-
- exitem_or = ""
- exitems.each do |exitem|
- if exitem_or != ""
- exitem_or += " or "
- end
- exitem_or += "#{exitem}"
- end
- if exitems.length > 1
- exitem_or = "(" + exitem_or + ")"
- end
- exitems_or << exitem_or
- end
- return exitems_or
- end
-
- def convert_and(items)
- if items.length == 0 then return [] end
- exitems_and = []
- items.each do |item|
- exitems = []
- exitems += convert_or(item/"/or")
- exitems += convert_and(item/"/and")
- exitems += convert_not(item/"/not")
- exitems += convert_match(item/"/match")
-
- exitem_and = ""
- exitems.each do |exitem|
- if exitem_and != ""
- exitem_and += " and "
- end
- exitem_and += "#{exitem}"
- end
- if exitems.length > 1
- exitem_and = "(" + exitem_and + ")"
- end
- exitems_and << exitem_and
- end
- return exitems_and
- end
-
- def convert_not(items)
- if items.length == 0 then return [] end
- exitems = []
- items.each do |item|
- exitems += convert_or(item/"/or")
- exitems += convert_and(item/"/and")
- exitems += convert_not(item/"/not")
- exitems += convert_match(item/"/match")
- end
- exitems_not = []
- exitems.each do |exitem|
- #exitems_not << "not#{exitem}"
- exitems_not << exitem.gsub(/contains/, "does not contain")
- end
- return exitems_not
- end
-
- def convert_match(items)
- exitems = []
- items.each do |item|
- path = item.attributes["path"]
- match = (item/"text()").to_s.strip.gsub(/\\/, "\\\\\\\\").gsub(/"/, "\\\"")
- case path
- when "author":
- #exitems << "(author = '#{match}')"
- exitems << "($header_from: contains \"#{match}\")"
- when "url":
- #exitems << "(url = '#{match}')"
- exitems << "($header_x-commit-directories: contains \"#{match}\")"
- #when "project":
- # exitems << "(project = '#{match}')"
- else
- #raise "BLARGH #{path}"
- # ignore...
- end
- end
- return exitems
- end
-end
-
rulefile = ARGV[0]
if not rulefile
rulefile = "example.xml"
Copied: trunk/commitfilter/rules/cia2eximfilter.rb (from rev 509, trunk/commitfilter/rules/cia2eximfilter)
===================================================================
--- trunk/commitfilter/rules/cia2eximfilter.rb (rev 0)
+++ trunk/commitfilter/rules/cia2eximfilter.rb 2009-04-19 15:02:25 UTC (rev 510)
@@ -0,0 +1,109 @@
+#!/usr/bin/env ruby
+
+require 'hpricot'
+
+class CIA2Exim
+ def convert(doc)
+ case doc.root.name
+ when "or":
+ str = convert_or([doc.root])
+ when "and":
+ str = convert_and([doc.root])
+ when "not":
+ str = convert_not([doc.root])
+ else
+ str = convert_match([doc.root])
+ end
+ return str[0]
+ end
+
+ def convert_or(items)
+ if items.length == 0 then return [] end
+ exitems_or = []
+ items.each do |item|
+ exitems = []
+ exitems += convert_or(item/"/or")
+ exitems += convert_and(item/"/and")
+ exitems += convert_not(item/"/not")
+ exitems += convert_match(item/"/match")
+
+ exitem_or = ""
+ exitems.each do |exitem|
+ if exitem_or != ""
+ exitem_or += " or "
+ end
+ exitem_or += "#{exitem}"
+ end
+ if exitems.length > 1
+ exitem_or = "(" + exitem_or + ")"
+ end
+ exitems_or << exitem_or
+ end
+ return exitems_or
+ end
+
+ def convert_and(items)
+ if items.length == 0 then return [] end
+ exitems_and = []
+ items.each do |item|
+ exitems = []
+ exitems += convert_or(item/"/or")
+ exitems += convert_and(item/"/and")
+ exitems += convert_not(item/"/not")
+ exitems += convert_match(item/"/match")
+
+ exitem_and = ""
+ exitems.each do |exitem|
+ if exitem_and != ""
+ exitem_and += " and "
+ end
+ exitem_and += "#{exitem}"
+ end
+ if exitems.length > 1
+ exitem_and = "(" + exitem_and + ")"
+ end
+ exitems_and << exitem_and
+ end
+ return exitems_and
+ end
+
+ def convert_not(items)
+ if items.length == 0 then return [] end
+ exitems = []
+ items.each do |item|
+ exitems += convert_or(item/"/or")
+ exitems += convert_and(item/"/and")
+ exitems += convert_not(item/"/not")
+ exitems += convert_match(item/"/match")
+ end
+ exitems_not = []
+ exitems.each do |exitem|
+ #exitems_not << "not#{exitem}"
+ exitems_not << exitem.gsub(/contains/, "does not contain")
+ end
+ return exitems_not
+ end
+
+ def convert_match(items)
+ exitems = []
+ items.each do |item|
+ path = item.attributes["path"]
+ match = (item/"text()").to_s.strip.gsub(/\\/, "\\\\\\\\").gsub(/"/, "\\\"")
+ case path
+ when "author":
+ #exitems << "(author = '#{match}')"
+ exitems << "($header_from: contains \"#{match}\")"
+ when "url":
+ #exitems << "(url = '#{match}')"
+ exitems << "($header_x-commit-directories: contains \"#{match}\")"
+ #when "project":
+ # exitems << "(project = '#{match}')"
+ else
+ #raise "BLARGH #{path}"
+ # ignore...
+ end
+ end
+ return exitems
+ end
+end
+
Copied: trunk/commitfilter/rules/commitfilter-cia (from rev 509, trunk/commitfilter/rules/cia2eximfilter)
===================================================================
--- trunk/commitfilter/rules/commitfilter-cia (rev 0)
+++ trunk/commitfilter/rules/commitfilter-cia 2009-04-19 15:02:25 UTC (rev 510)
@@ -0,0 +1,48 @@
+#!/usr/bin/env ruby
+
+require 'cia2eximfilter'
+require 'hpricot'
+require 'dbi'
+
+conf = {}
+conf["dbhost"] = "localhost"
+conf["dbport"] = "5432"
+
+a = open("/etc/commitfilter.conf")
+while not a.eof?
+ line = a.readline
+ if line =~ /\$(\w+).?=.?"?([^"]+)"?;/
+ conf[$1] = $2
+ end
+end
+a.close
+
+if conf["ciarules"] != "1"
+ exit 0
+end
+
+begin
+ conn = DBI.connect("DBI:Pg:host=#{conf['dbhost']};port=#{conf['dbport']};dbname=#{conf['dbname']}", conf["dbuser"], conf["dbpass"])
+rescue => e
+ puts e
+ exit 1
+end
+
+q = conn.execute("SELECT c.username, c.rule, u.email FROM ciarules AS c, users AS u WHERE u.username = c.username AND u.email <> '' AND (u.disabled IS NULL OR u.disabled <> 1)")
+q.fetch do |row|
+ puts "# " + row["username"] + ": CIA"
+ rule = row["rule"]
+ email = row["email"]
+
+ doc = Hpricot.XML(rule)
+
+ c2e = CIA2Exim.new
+ str = c2e.convert(doc)
+ puts "if(" + str + ")"
+ puts "then"
+ puts "\tdeliver #{email} errors_to #{conf['bounceemail']}"
+ puts "endif"
+end
+
+conn.disconnect
+
Added: trunk/commitfilter/rules/commitfilter-cia.sql
===================================================================
--- trunk/commitfilter/rules/commitfilter-cia.sql (rev 0)
+++ trunk/commitfilter/rules/commitfilter-cia.sql 2009-04-19 15:02:25 UTC (rev 510)
@@ -0,0 +1,5 @@
+CREATE TABLE "ciarules" (
+ "username" character varying(256),
+ "rule" character varying(16384)
+);
+
Modified: trunk/commitfilter/setup.txt
===================================================================
--- trunk/commitfilter/setup.txt 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/setup.txt 2009-04-19 15:02:25 UTC (rev 510)
@@ -178,6 +178,18 @@
What commitfilter-cleanup does in addition is finding bouncing mail addresses
and disabling them.
+Advanced topic: CIA rule import
+-------------------------------
+
+CIA (http://cia.vc) defines an XML-based language to express commit filtering
+rules. Commitfilter can import these rules through an extension written in Ruby.
+Install the script rules/commitfilter-cia into the $PATH and
+rules/cia2eximfilter.rb into the Ruby path (e.g. /usr/lib/ruby/1.8).
+
+Afterwards, extend the database with rules/commitfilter-cia.sql. Finally,
+switch on $ciarules in /etc/commitfilter.conf.
+The web interface will automatically offer storing a CIA rule per user.
+
Suggestions:
------------
Added: trunk/commitfilter/web/cia.inc
===================================================================
--- trunk/commitfilter/web/cia.inc (rev 0)
+++ trunk/commitfilter/web/cia.inc 2009-04-19 15:02:25 UTC (rev 510)
@@ -0,0 +1,28 @@
+<?php table_start(); ?>
+
+<?php
+
+echo "CIA filter import<br>\n";
+
+?>
+
+<?php table_stop(); ?>
+
+<?php table_start(); ?>
+
+<form action='index.php' method='post'>
+Please insert the XML rule. Only author and url matches will be considered.
+<br>
+<textarea name='ciarules' cols="80" rows="20">
+<?php
+$res = pg_exec($id, "SELECT * FROM ciarules WHERE username = '$username'");
+if(pg_numrows($res) == 1) :
+ echo pg_result($res, 0, "rule");
+endif;
+?>
+</textarea>
+<br>
+<input type='submit' name='submitcia' value='Save'>
+</form>
+
+<?php table_stop(); ?>
Modified: trunk/commitfilter/web/func.my.inc
===================================================================
--- trunk/commitfilter/web/func.my.inc 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/web/func.my.inc 2009-04-19 15:02:25 UTC (rev 510)
@@ -68,6 +68,21 @@
table_stop();
}
+function editciarules($username, $ciarules)
+{
+ global $id;
+
+ pg_exec($id, "DELETE FROM ciarules WHERE username = '$username'");
+
+ pg_exec($id, "INSERT INTO ciarules " .
+ "(username, rule) VALUES " .
+ "('$username', '$ciarules')");
+
+ table_start();
+ echo "Successfully edited CIA filtering rules.";
+ table_stop();
+}
+
$add = $_GET['add'];
$delete = $_GET['delete'];
$deleteauthor = $_GET['deleteauthor'];
@@ -81,6 +96,8 @@
$authoradd_name = $_POST['authoradd_name'];
$submitregex = $_POST['submitregex'];
$regexadd_regex = $_POST['regexadd_regex'];
+$submitcia = $_POST['submitcia'];
+$ciarules = $_POST['ciarules'];
$conf_email = $_POST['conf_email'];
$conf_news = $_POST['conf_news'];
@@ -114,6 +131,12 @@
addentry($username, $manualadd_dir);
endif;
+if ($submitcia) :
+ if ($conf_cia) :
+ editciarules($username, $ciarules);
+ endif;
+endif;
+
if ($submitauthor) :
$orig = "";
while ($orig != $authoradd_name)
Modified: trunk/commitfilter/web/htconf-dist
===================================================================
--- trunk/commitfilter/web/htconf-dist 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/web/htconf-dist 2009-04-19 15:02:25 UTC (rev 510)
@@ -4,6 +4,7 @@
$conf_name = "commitfilter";
$conf_user = "xxxxx";
$conf_pass = "xxxxx";
+$conf_port = 5432;
# Repository for local CVS/SVN checkout, if any
$conf_repodir = "/home/kstuff/kdesvn";
@@ -19,4 +20,7 @@
# Is this Commitfilter instance running on commitfilter.kde.org?
$conf_kdespecific = 1;
+
+# Allow import of CIA filtering rules
+$conf_cia = 0;
?>
Modified: trunk/commitfilter/web/index.php
===================================================================
--- trunk/commitfilter/web/index.php 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/web/index.php 2009-04-19 15:02:25 UTC (rev 510)
@@ -27,7 +27,7 @@
$conf_design = "design";
endif;
-$id = @pg_connect("host=$conf_host dbname=$conf_name user=$conf_user password=$conf_pass");
+$id = @pg_connect("host=$conf_host dbname=$conf_name user=$conf_user password=$conf_pass port=$conf_port");
//if (($username) && ($password)) :
// setcookie("cookie");
Modified: trunk/commitfilter/web/my.inc
===================================================================
--- trunk/commitfilter/web/my.inc 2009-04-19 13:05:26 UTC (rev 509)
+++ trunk/commitfilter/web/my.inc 2009-04-19 15:02:25 UTC (rev 510)
@@ -25,6 +25,9 @@
<a href='index.php?page=add'>Add filter (by module)</a><br>
<a href='index.php?page=addauthor'>Add filter (by author)</a><br>
<a href='index.php?page=addregex'>Add filter (by regex)</a><br>
+<?php if ($conf_cia) : ?>
+<a href='index.php?page=cia'>Import CIA filter (by rule language)</a><br>
+<?php endif; ?>
<a href='index.php?page=conf'>Configuration</a><br>
<a href='index.php?page=help'>Help, news, stats, about...</a><br>
<a href='index.php?page=logout'>Logout</a><br>
More information about the kde-services-devel
mailing list