Hi All,

In data giovedì 25 aprile 2013 11:59:53, Ferran Jorba ha scritto:
> > On 25/4/2013 12:37 μμ, Ferran Jorba wrote:
> >> but try an index.php or any other missing hit at http://cds.cern.ch.  It
> >> is effectively handled by Invenio.
> > 
> > My point exactly. I see that both my installations and CERN's
> > correctly handle those 'attacks'. I even tried with .php and .py files
> > and there is no exception raised and sent to the admin even if you set
> > CFG_SITE_ADMIN_EMAIL_EXCEPTIONS = 2 in invenio(-local).conf
> 
> To tell you the truth, I wasn't aware of this variable.  I have the
> default value:
> 
>  ## CFG_SITE_ADMIN_EMAIL_EXCEPTIONS -- set this to 0 if you do not want
>  ## to receive any captured exception via email to CFG_SITE_ADMIN_EMAIL
>  ## address.  Captured exceptions will still be available in
>  ## var/log/invenio.err file.  Set this to 1 if you want to receive
>  ## some of the captured exceptions (this depends on the actual place
>  ## where the exception is captured).  Set this to 2 if you want to
>  ## receive all captured exceptions.
>  CFG_SITE_ADMIN_EMAIL_EXCEPTIONS = 1
> 
> > Unless I'm missing something here, I suspect something weird happening
> > only with your installation...
> 
> Watching more carefully (thanks!) my installation, I see that it returns
> a 404 Not found (http://traces.uab.cat/abc), even in the HTTP headers.
> 
> So, now, with a better understanding of what is happening, what I'd like
> is a value for CFG_SITE_ADMIN_EMAIL_EXCEPTIONS that doesn't send me an
> email for a 404 status.
> 
> I'll try to do a local fix and provide it upstream if there is interest.

wait :-) This is already implemented, as Theodoros reported ;-) Just have a 
look in maint-1.1 to:

commit 0aeb9fa7e8a6b6809be5d586bcdcf0e7a9784e05
Author: Samuele Kaplun <samuele.kap...@cern.ch>
Date:   Tue Oct 27 16:48:22 2009 +0100

    WebStyle: configurable alerts for HTTP errors
    
    * When a 404 error is raised, the admin may want to be alerted
      only when there is a known referer for the given URL, so that
      the admin can distinguish between a broken link to the site
      and a user making a typo in the URL location bar.  This patch
      makes this distinction possible by providing a new config variable
      CFG_WEBSTYLE_HTTP_STATUS_ALERT_LIST.

This is the implementation to catch any bad request (so not only the 
/record/123/files/* one).

Isn’t this commit available in your repo and already doing what you are 
looking for?

Cheers!
        Sam

-- 
Samuele Kaplun
Invenio Developer ** <http://invenio-software.org/>
INSPIRE Service Manager ** <http://inspirehep.net/>

Reply via email to