Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: Escorpiom on November 24, 2011, 07:34:19 pm

Title: Adding exceptions to the Adzapper script.
Post by: Escorpiom on November 24, 2011, 07:34:19 pm
Better to tackle this issue right now before someone else is looking all over...

Today one of my users complained about not being able to see the photos on some website. He said that somewhere else the photos were loading just fine.
After visiting this site:
Code: [Select]
http://www.amarillasinternet.comand conducting a search like "restaurantes", no images were displayed on the right side of the screen.
Opening the foto gallery yielded the same result.
I knew instantly that it was the Adzapper playing up, but adding the sites address to the exception list (Dansguardian) didn't solve anything.

After poking around in my server I found the script here:
Code: [Select]
/usr/bin/adzapper 

A little down the list there are a few lines starting with "PASS", those are the sites that will NOT be zapped so I just maintained the same format and added
amarillasinternet to the list.
After restarting the proxy all was well.
I don't know if this will "stick" after an update. In that case it could be helpful to know how we can create static exception lists.

You have to take care with the cache, sometimes you need to clear the browser cache to have all the stuff come up again.
Hope this eventually saves people from searching all over.

Cheers.
Title: Re: Adding exceptions to the Adzapper script.
Post by: innocenti_jr on November 25, 2011, 08:43:48 am
No, your modifications to /usr/bin/adzapper would get overwritten by a possible update.

Please read:
http://adzapper.sourceforge.net/#pattern-files

In /etc/adzapper.conf you can define custom patterns in files you define via ZAP_POSTMATCH=<file> (and ZAP_PREMATCH) -- this should do the trick.
Title: Re: Adding exceptions to the Adzapper script.
Post by: Javier Amor Garcia on November 25, 2011, 12:43:20 pm
I remember you that this file is overwritten when saving configuration changes, so use a post conf hook as usual.
Title: Re: Adding exceptions to the Adzapper script.
Post by: innocenti_jr on November 25, 2011, 02:55:05 pm
Gotcha!  8)
I decided to use a custom template.
Will $postMatch => '' ever make it to Zentyal's web interface?
Title: Re: Adding exceptions to the Adzapper script.
Post by: Escorpiom on November 26, 2011, 02:20:10 pm
Got it, more or less  :)
Found adzapper.conf where it should be. In that file exist the line "ZAP_POSTMATCH="
So I should give the path to the extra pattern file, seems best to put it in /usr/bin like the main script.
What about the file name? Would any name do?
Like:
Code: [Select]
ZAP_POSTMATCH=/usr/bin/postmatch
Assuming the file would have to be in the same format as the url's in the main script.
Is above correct?

Cheers.
Title: Re: Adding exceptions to the Adzapper script.
Post by: innocenti_jr on November 28, 2011, 11:45:17 am
Yes, any name would do.
But I'd suggest you better put these files to /etc or /usr/local/etc, like:
Code: [Select]
/usr/local/etc/adzapper_postmatch.conf
The fileformat is the one from the main script; e.g. I have the following in /usr/local/etc/adzapper_postmatch.conf:
Code: [Select]
ADJS http://im.banner.t-online.de/addyn/**
ADJS http://bs.serving-sys.com/**
ADJS http://ds.serving-sys.com/**
Title: Re: Adding exceptions to the Adzapper script.
Post by: Escorpiom on November 28, 2011, 12:51:29 pm
Perfect, no more questions about locations, filename or format.
But what about the PASS lines? If the main script first "zaps" the site I've put in postmatch to "unblock" it, it would perhaps get zapped anyway...
The adzapper documentation says that prematch is better left empty, but for the PASS statements it might be necessary to populate that file.

Cheers.
Title: Re: Adding exceptions to the Adzapper script.
Post by: innocenti_jr on November 28, 2011, 01:28:45 pm
Since I personally don't have a need for PASS statements, I assume that things should work, if you put