Skip to content

Flask app for catching web requests and recording them, used for custom Blocking Mode with Adguard Home

License

Notifications You must be signed in to change notification settings

ghostersk/catchall-webbrowsing

Repository files navigation

catchall-webbrowsing for Adguard Home

Flask app for catching web requests and recording them I have created this app to redirect all blocked DNS queries from Adguard Home, to the ip of docker container. The app will record what website was used, and it will also return information the website was blocked.

  • default Adguard Home behaviour is to return non existent response, if you do not pay attention, you may miss that it was your DNS filter. It will listen on port 80 and 443, 443 port need certificate, i have added script to create certificate with CA signing. If you need, you can add the CA certificate to trusted certificates for easier use ( will work only on the IP, unless you make it for all hostnames)

EDIT: There is an issue when the website tries to go to https, as it has infinit posibilities for domain names, you would need certificate for all of them trusted on your devices. At this time, I do not see option how to fix this. Idea was to convert HTTPS to HTTP on initial contact but that does not work. #1

The application is started by using startup.sh

#!/bin/bash
pip install -r requirements.txt

export FLASK_RUN_EXTRA_FILES="startup.sh"
export FLASK_DEBUG=True
export FLASK_RUN_HOST="0.0.0.0"
export FLASK_RUN_PORT=80

flask run & python app.py

This will first run the app on port 80 and all interfaces and last command it will run on the port 443 as per the app.py code

This app is using Interactive Bootstrap 5 DataTables for easier data lookup. Screenshot_20240518_203638

List all blocked attempts

Screenshot_20240518_190418

You can deploy it with docker-compose, as per the docker-compose.yml example I am using static IP address of the catchall container to send all blocked queries there from Adguard Home in DNS Settings: Screenshot_20240329_125519

On end to make sure you do not have to confirm invalid SSL certificate, I have added custom domain (in app.py update the webblocker_host , what can be set to anything and then you just need to use for example Nginx Proxy to point the url with valid SSL or with HTTP only to the ip where this Catchall is running. image

About

Flask app for catching web requests and recording them, used for custom Blocking Mode with Adguard Home

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages