[prev] [next] [up]

Filters

Filter Configuration File

The filter configuration file is a regular text file. The name of the file is defined by the filter_file parameter of the main configuration file. Each filter is represented by a block of lines in a name = value format. Individual filters are separated with one or more empty lines.

Filters may be editted using Foxy web-based Filter Editor, or just any text editor. Foxy automatically reloads configuration when it notices that the file has been changed by another program (the same holds true for other configuration files).

Parameters Common To All Filters

type = filter_class_name
name = filter_instance_name
enabled = boolean
users = user_name_list
exclude_users = user_name_list
time = time_spec
include = url_pattern
exclude = url_pattern

See also Using content category names in URL sets.

Filter Classes

Animation Filter – Removes looping from GIF images.
Blacklist – Blocks access to the specified pages.
Comment Signature Filter – Removes HTML code blocks enclosed in comments containing specific text.
Content Filter – Blocks access to undesirable content using dictionaries.
Cookie Filter – Removes cookies or converts them to session cookies.
Exe Filter – Blocks HTTP downloads of executable files.
External Filter – Runs external filtering scripts.
File Type Filter – Blocks downloads of certain file formats.
Form Filler – Automatic form filling.
Image Filter – Removes images by source or by size.
Media Grabber – Allows to grab and save streaming video, audio, etc.
Popup Filter – Kills popups.
Request Header Filter – Allows to modify HTTP request headers.
Script Filter – Removes script and applets.
Script Signature Filter – Removes scripts that contain one of the filter's search strings.
Search Engine Filter – Optimizes search results pages of major search engines.
Shortcut Filter – Substitutes request URLs.
Tag Filter – Deletes HTML elements or changes element attributes.
Text Signature Filter – Removes HTML elements conataining text that matches one of the search strings.

type

Format:

type = filter_class_name

Internal filter class name. Do not modify. Filters of unknown types will be silently ignored when the filter configuration file is loaded. This parameter must be first in the block of lines representing a filter. Valid values: Animation Filter, Blacklist, Comment Signature Filter, etc. See filter classes. Please note, that type names are case-sensitive.

name

Format:

name = filter_instance_name

Unique filter name. Must not be empty. When a filter is created/renamed using proxy web interface uniqueness and non-emptiness are guaranteed. If you edit the filter configuration file manually, it's your responsibility.

enabled

Format:

enabled = boolean

The true value is assumed by default. May be set to false to disable the filter.

users

Format:

users = user1, user2, user3...

The users parameter defines the names of the users for which the filter will be active. A comma-delimited list of user names may be specified as a value. If empty (or missing), the filter will be active for all users. User names must match those defined in the main configuration file. IP addresses may be used instead of names if user authentication is not required.

exclude_users

Format:

exclude_users = user1, user2, user3...

If the users parameter is empty (which means “all users”), the exclude_users parameter may be used to list exceptions.

time

Format:

time = time_spec

Specifies when the filter is active. May specify time intervals, days of week, or both. When empty, the filter is always active.

The specification contains a semicolon-delimited list of elements. Each element defines days, times, or both. In the latter case days are specified first, thean a colon, then times.

Days are specified with a comma-delimited list of days of week or day of week intervals. A day of week is specified by a three-letter acronim or full name. A day of week interval consists of two day names delimited with a dash.

Times are specified with a comma-delimited list of time intervals. A time interval is start time and end time delimited with a dash. Time is spesified in hh:mm 24-hour format.

EBNF grammar for time specifications:

temespec ::= element { “;” element }
element ::= days [ “:” times ] | times
days ::= day_interval { “,” day_interval }
day_interval ::= day [ “-” day ]
day ::= “sun” | “mon” | ... | “sat”   |   “sunday” | “monday” | ... | “saturday”
times ::= time_interval { “,” time_interval }
time_interval ::= time [ “-” time ]
time ::= hours [ “:” minutes ]

See a quick guide to notation.

Examples:

time = 9:00-18:00
Active (does the filtering) from 9:00 to 18:00. Before 9:00 and after 18:00 the filter is inactive (no filtering).
time = Monday-Friday
Active Monday to Friday, no filtering on week-ends.
time = mon-fri: 9:00-18:00; sat-sun: 17:00-23:00
Active Monday to Friday from 9:00 to 18:00. On week-ends active from 17:00 to 23:00.

include, exclude

Format:

include = url_pattern
exclude = url_pattern

These two parameters define a set of URLs to apply filtering to.

The include lines list URL patterns (one per line) that define a set of pages that will be filtered.

The exclude lines define a set of exceptions, that is pages that will not be filtered.

The filter will be applied to a page if that page's URL

Example:

Apply filtering to all pages except those in three exception domains (and their subdomains):

include = *
exclude = canadiantire.ca
exclude = bestbuy.ca
exclude = futureshop.ca

Using content category names in URL sets

As of version 1.6.6 content category names may be used as include/exclude parameter values (as well as src_include/src_exclude for some filters). A category name must be specified exactly as defined by one of the category parameters in categories.cfg and preceded by an “@” sign.

Example:

type = Blacklist
name = Block Bad Pictures
enabled = true
include = @Adult
include = @Scum

See also URL patterns.


[prev] [next] [up]