Changeset 1497

Show
Ignore:
Timestamp:
06/05/08 18:30:56 (7 months ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r1496 r1497  
    112008-06-05  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/rule_geoip.h, cherokee/rule_geoip.c, 
     4        cherokee/Makefile.am, configure.in: Added a new GeoIP rule module. 
     5        It checks the origin IP with the GeoIP library. 
     6 
     7        * qa/167-RuleGeoIP.py, qa/Makefile.am: Added a new QA test to 
     8        ensure that rule_geoip actually works. 
    29 
    310        * qa/061-PAM1.py, qa/062-PAM2.py (Test.Precondition): Updated to 
  • cherokee/trunk/TODO

    r1493 r1497  
    55----- 
    66[ ] Mime encodings separated from mime types 
    7 [ ] Chuncked encoding 
     7[x] Chuncked encoding 
     8[x] GeoIP rule 
    89 
    9100.9.0 
     
    1617Later 
    1718----- 
    18 [ ] X-Sendfile 
     19[x] X-Sendfile 
    1920[ ] WSGI handler 
    2021[ ] Upload progress module 
  • cherokee/trunk/cherokee/Makefile.am

    r1478 r1497  
    157157 
    158158# 
     159# Rule geoip 
     160# 
     161rule_geoip = \ 
     162rule_geoip.c \ 
     163rule_geoip.h 
     164 
     165libplugin_geoip_la_LDFLAGS = $(module_ldflags)   
     166libplugin_geoip_la_SOURCES = $(rule_geoip) 
     167libplugin_geoip_la_LIBADD  = -lGeoIP 
     168 
     169if STATIC_RULE_HEADER 
     170static_rule_geoip_src = $(rule_geoip) 
     171static_rule_geoip_lib = -lGeoIP 
     172else 
     173dynamic_rule_geoip_lib = libplugin_geoip.la 
     174endif 
     175 
     176 
     177# 
    159178# Rule not 
    160179# 
     
    770789$(static_validator_pam_lib) \ 
    771790$(static_validator_ldap_lib)  \ 
     791$(static_rule_geoip_lib)  \ 
    772792$(static_validator_htpasswd_lib) \ 
    773793$(static_validator_mysql_lib) \ 
     
    933953$(static_rule_request_src) \ 
    934954$(static_rule_header_src) \ 
     955$(static_rule_geoip_src) \ 
    935956$(static_rule_not_src) \ 
    936957$(static_rule_and_src) \ 
     
    10821103$(dynamic_rule_request_lib) \ 
    10831104$(dynamic_rule_header_lib) \ 
     1105$(dynamic_rule_geoip_lib) \ 
    10841106$(dynamic_rule_not_lib) \ 
    10851107$(dynamic_rule_and_lib) \ 
  • cherokee/trunk/configure.in

    r1493 r1497  
    10831083 
    10841084dnl 
     1085dnl GeoIP library 
     1086dnl 
     1087AC_ARG_WITH([geoip], 
     1088        AC_HELP_STRING([--with-geoip=@<:@ARG@:>@], 
     1089            [use the GeoIP library @<:@default=yes@:>@, optionally specify path to dev libs] 
     1090        ), 
     1091        [ 
     1092        if test "$withval" = "no"; then 
     1093            want_geoip="no" 
     1094        elif test "$withval" = "yes"; then 
     1095            want_geoip="yes" 
     1096        else 
     1097            want_geoip="yes" 
     1098            GEOIP_CONFIG="$withval" 
     1099        fi 
     1100        ], 
     1101        [want_geoip="yes"] 
     1102) 
     1103 
     1104if test "$want_geoip" = "yes"; then 
     1105   AC_CHECK_LIB(GeoIP, GeoIP_new, have_geoip_lib=yes, have_geoip_lib=no)  
     1106   AC_CHECK_HEADERS(GeoIP.h, have_geoip_include=yes, have_geoip_include=no)  
     1107fi 
     1108 
     1109have_geoip="no" 
     1110if test "$have_geoip_lib $have_geoip_include" = "yes yes"; then 
     1111   have_geoip="yes" 
     1112fi 
     1113 
     1114AM_CONDITIONAL(HAVE_GEOIP, test $have_geoip = "yes") 
     1115 
     1116 
     1117dnl 
    10851118dnl Python's docutils 
    10861119dnl  
     
    11681201           [use_static_module="$use_static_module $enableval "],[]) 
    11691202 
    1170 modules="error_redir server_info file admin dirlist fcgi fastcgi scgi redir common nn cgi phpcgi proxy mirror gzip ncsa combined w3c pam ldap mysql htpasswd plain htdigest round_robin directory extensions request header not and or" 
     1203modules="error_redir server_info file admin dirlist fcgi fastcgi scgi redir common nn cgi phpcgi proxy mirror gzip ncsa combined w3c pam ldap mysql htpasswd plain htdigest round_robin directory extensions request header geoip not and or" 
    11711204 
    11721205# Remove modules that will not be compiles 
     
    11801213if test "x$have_mysql" != "xyes"; then 
    11811214        modules=`echo $modules | sed s/mysql//` 
     1215fi 
     1216if test "x$have_geoip" != "xyes"; then 
     1217        modules=`echo $modules | sed s/geoip//` 
    11821218fi 
    11831219if test "$use_crypt" != "yes"; then 
     
    12451281AM_CONDITIONAL(STATIC_RULE_REQUEST,           grep request        $conf_h >/dev/null) 
    12461282AM_CONDITIONAL(STATIC_RULE_HEADER,            grep header         $conf_h >/dev/null) 
     1283AM_CONDITIONAL(STATIC_RULE_GEOIP,             grep geoip          $conf_h >/dev/null) 
    12471284# These must be at the end 
    12481285AM_CONDITIONAL(STATIC_RULE_NOT,               grep _not_          $conf_h >/dev/null) 
     
    13111348echo "LDAP                  $have_ldap" 
    13121349echo "MySQL                 $have_mysql" 
     1350echo "GeoIP                 $have_geoip" 
    13131351echo "crypt support         $crypt_type" 
    13141352if test "x$is_beta" = "xyes"; then 
  • cherokee/trunk/qa/Makefile.am

    r1480 r1497  
    171171164-RuleOr1.py \ 
    172172165-RuleOr2.py \ 
    173 166-xsendfile1.py 
     173166-xsendfile1.py \ 
     174167-RuleGeoIP.py 
    174175 
    175176test: