https://github.com/chickendrop89/adguardhome-pauser
A daemon that pauses protection if specified websites are accessed
https://github.com/chickendrop89/adguardhome-pauser
adblock adguard adguardhome dns dns-server linux python
Last synced: 7 months ago
JSON representation
A daemon that pauses protection if specified websites are accessed
- Host: GitHub
- URL: https://github.com/chickendrop89/adguardhome-pauser
- Owner: chickendrop89
- License: gpl-3.0
- Created: 2025-01-25T11:39:21.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-01-31T13:10:59.000Z (10 months ago)
- Last Synced: 2025-03-31T02:17:37.930Z (8 months ago)
- Topics: adblock, adguard, adguardhome, dns, dns-server, linux, python
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# adguardhome-pauser
A daemon that pauses protection if specified websites are accessed.
# What is the point
Some media websites may refuse to load content if advertising-related domains are blocked.
This project aims to temporarily disable AdGuardHome protection for the client/network
when the user-specified domains with anti-adblock javascript/measures are queried.
This functionality is most effective on websites that do not immediately display an anti-adblock popup
but do so after a user selects some content (e.g., unnamed movie websites 🏴☠️).
# Running the daemon:
Clone the repositroy, and then install requirements:
```shell
pip install -r requirements.txt
```
Open your editor of choice, and edit `config.yaml`:
```shell
nano config.yaml
```
AdGuard credentials need to be exported as environment variables.
You can either do this, or prefix the daemon script with them.
```shell
export ADGUARD_USERNAME=
export ADGUARD_PASSWORD=
```
Run the daemon:
```shell
python ./daemon.py
```
#### Help, the daemon doesn't catch my queries!
- Try to tune the `query`-related variables.
- It's best to start with increasing the `query:limit`,
and reducing the `query:interval` until you find the ideal values.
#### Format of the "pausers" file
- The parser expects every website to be on it's own line.
- Wildcards are not supported, refer to `pause:subdomains` instead.
- Regex is not supported.
# Testing the daemon
Best way to test this daemon is using DNS lookup tools.
```shell
# Linux
dig @
# Windows
nslookup
```
Example:
```shell
# Linux
dig @localhost example.com
# Windows
nslookup example.com localhost
```
Then just observe if the daemon catched the query in the command line.
# Limitations
If the domain is accessed frequently and the client/server has an extremely high TTL, or if there is client-side caching, the query may not go through AdGuardHome at all, preventing the daemon from detecting and acting on it.