Struct
MalcontentWebFilter
unstable since: 0.14.0
Description [src]
struct MctWebFilter {
/* No available fields */
}
MctWebFilter is an opaque, immutable structure which
contains a snapshot of the web filter settings for a user at a given time.
This includes whether web access is being filtered, and the filter lists which are being applied — for example, the domains to block or allow.
Typically, web filter settings can only be changed by the administrator, and are read-only for non-administrative users. The precise policy is set using polkit.
To construct a new MctWebFilter, use
MctWebFilterBuilder.
Filter format
A web filter contains various high-level options about web filter, such as whether to block domains by default or to allow them by default; and whether to force popular websites to use their ‘safe search’ variants (for example, Google Safe Search or YouTube Restricted Mode).
A web filter can contain zero or more filter lists, as well as custom filter entries. Each list or entry will block or allow the hostnames it lists.
The intention is that the user uses one or more subject-specific filter lists sourced online, such as those from EasyList. Custom filter entries can then be used to add a small number of additional filters to customise the generic filter lists.
Each filter list is a mapping from an ID to a URI which contains the list. The ID is needed so user interfaces can consistently refer to the same list in the UI even if its URI changes over time. IDs must be non-empty UTF-8 strings.
The filter list downloaded from the URI must be a list of hostnames,
separated by newlines (\n). Comments start with # and continue to the
next newline (\n). Each entry in the list must be a plain hostname — globs,
wildcards and regexps are not supported. Hostnames do not have to have a
trailing dot (.) as in DNS records.
This is essentially the same format as /etc/hosts, as malcontent is
designed to consume general purpose filter lists produced for use in
/etc/hosts.
Custom filter entries must follow the same format: they must be a plain hostname — globs, wildcards and regexps are not supported.
Available since: 0.14.0
Functions
mct_web_filter_deserialize
Deserialize a set of web filters previously serialized with
mct_web_filter_serialize().
unstable since: 0.14.0
Instance methods
mct_web_filter_get_block_lists
Gets the block lists configured on the filter.
unstable since: 0.14.0
mct_web_filter_get_custom_allow_list
Gets the custom allow list configured on the filter.
unstable since: 0.14.0
mct_web_filter_get_custom_block_list
Gets the custom block list configured on the filter.
unstable since: 0.14.0
mct_web_filter_get_force_safe_search
Gets the safe search preference for the filter.
unstable since: 0.14.0
mct_web_filter_get_user_id
Get the user ID of the user this MctWebFilter is for.
unstable since: 0.14.0
mct_web_filter_is_enabled
Check whether any web filtering is enabled and is going to impose at least one restriction on the user.
unstable since: 0.14.0
mct_web_filter_ref
Increment the reference count of filter, and return the same pointer to it.
unstable since: 0.14.0
mct_web_filter_serialize
Build a GVariant which contains the web filter from filter, in
an opaque variant format.
unstable since: 0.14.0
mct_web_filter_unref
Decrement the reference count of filter. If the reference count reaches
zero, free the filter and all its resources.
unstable since: 0.14.0