Skip to content

feat(filtering): add time-windowed filtering support to custom filtering rules#8380

Open
hossihub wants to merge 1 commit into
AdguardTeam:masterfrom
hossihub:master
Open

feat(filtering): add time-windowed filtering support to custom filtering rules#8380
hossihub wants to merge 1 commit into
AdguardTeam:masterfrom
hossihub:master

Conversation

@hossihub

Copy link
Copy Markdown

This change enables users to apply time-based constraints to custom

filtering rules via new syntax modifiers: $start, $end

  • Added support for $start='HH:mm' and $end='HH:mm' in rule strings.

  • Implemented logic to handle standard windows and cross-midnight intervals.

  • Integrated time-check into the DNS filtering pipeline (matchHost).

  • Leverages the existing global timezone settings for consistency.

  • Added a 'now' function hook in DNSFilter for deterministic unit testing. Syntax

  • ||example.com^$start='09:00'$end='18:00' (Active during work hours)

  • @@||example.com^$start='22:00'$end='04:00' (Active during night hours)

This change enables users to apply time-based constraints to custom

filtering rules via new syntax modifiers: $start, $end, and $tz.
   - Added support for `$start='HH:mm'` and `$end='HH:mm'` in rule
     strings.
   - Implemented logic to handle standard windows and cross-midnight
     intervals.
   - Integrated time-check into the DNS filtering pipeline (matchHost).

   - Leverages the existing global timezone settings for consistency.

   - Added a 'now' function hook in DNSFilter for deterministic unit
     testing.
     Syntax
   - ||example.com^$start='09:00'$end='18:00' (Active during work hours)

   - @@||example.com^$start='22:00'$end='04:00' (Active during night
     hours)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant