parental-control

[parental-control] (https://dev.iopsys.eu/network/parental-control)

Introduction

  • The parental-control daemon blocks list of URLs for the list of mac addresses passed to it.
  • It uses the libnetfilter-queue along with libnetlink APIs to achieve the requirement.
  • It allows configuring schedules when the blocking will be effective.
  • It is capable of handling more than 1 million URLs as part of the bundle file, which will be explained later.

Project Components

Project consists of following components:

Daemon

  • Monitors traffic and blocks http/https access to configured URLs for the configured schedule (if no schedule is configured, URLs are blocked all the time).
  • It also provides the TR-181 data model object for urlfiltering, internet break, and bedtime schedules.

Lib scripts

  • Lib scripts are triggered on start up of the application and process the UCI for internet break and bedtime options.
  • Internet break: it is the facility to break internet access outside configured schedule completely for configured hosts, using start_time and duration from schedules UCI (it is necessary to provide a schedule here).
  • Bedtime: this facility blocks all internet access inside the configured schedule, and allows for specifying endtime instead of duration and can be configured in parentalcontrol UCI itself. For example, the start_time can be 23:00 and end_time '05:00' (representing next morning).

Bundles

  • These are provided for convenience of the user, in the form of compressed archive of files.
  • Archive (if configured) is part of package files, which contains URLs divided into files on the basis of specific categories, for example: ads, tiktok, porn etc.

Build Instructions

parental-control is written using C programming language and depends on a number of components found in OpenWrt for building and running.

  • libnetfilter-queue
  • libnfnetlink
  • iptables-mod-nfqueue
  • cmph library

Compilation flags


CONFIG_URLFILTER_INCLUDE_BUNDLES

This compile time flag can be set to yes(y), to include default bundles in the firmware.

  • Bundles are files with urls based on a category, example: ads, abuse, tiktok, porn etc.
  • Files are placed in /tmp/urlfilter/default/urlbundles directory.
  • The full path can be provided as input to option download_url.
  • A ubus call default_bundles, has been provided to view list of available bundles.
  • Setting this increases the image size by around 8 MB.

Overview

The URL Filter application allows configuring:

  • Filter Text: URLs that have this text as substring will be blocked.
  • Custom URLs: Manually defined URLs to be filtered. The IP addresses of these is prefetched at start up.
  • Downloadable URL Bundles: Predefined lists of URLs fetched from a specific location. Some predefined bundles are available.
  • Schedule: The filtering will be active only for specified time, if this option is not set, it will be active all the time.

Examples

For examples and details of configuration, please visit quickstart

Description
No description provided
Readme 952 KiB
Languages
C 98.3%
Shell 1.2%
Makefile 0.5%