AdGuard Block Page

A custom AdGuard Home blocking page that notifies users when a domain has been blocked and gives them a Tetris game to pass the time.

Features

  • Displays the blocked domain name to the user
  • Retro terminal aesthetic
  • Fully playable Tetris game embedded in the page
  • Leaderboard to track high scores

Stack

  • Python / Flask
  • SQLite (leaderboard scores)
  • Apache with mod_wsgi

Setup

Prerequisites

  • Python 3
  • Apache with mod_wsgi
  • AdGuard Home configured to redirect blocked domains to this page

Installation

sudo mkdir -p /opt/flaskapp
sudo python3 -m venv /opt/flaskapp/venv
sudo /opt/flaskapp/venv/bin/pip install flask

Copy files:

sudo cp app.py /opt/flaskapp/
sudo cp app.wsgi /opt/flaskapp/
sudo cp -r templates /opt/flaskapp/

Apache Configuration

Add a WSGIScriptAlias in your Apache config pointing to app.wsgi:

WSGIScriptAlias /blocked /opt/flaskapp/app.wsgi

<Directory /opt/flaskapp>
    WSGIProcessGroup flaskapp
    WSGIApplicationGroup %{GLOBAL}
    Require all granted
</Directory>

AdGuard Home Configuration

In AdGuard Home, set the Custom blocking page URL to:

http://192.168.1.189/blocked?domain=%DOMAIN%

Project Structure

flaskapp/
├── app.py            # Flask app
├── app.wsgi          # Apache mod_wsgi entry point
└── templates/
    └── blocked.html  # Blocking page with Tetris
S
Description
No description provided
Readme 36 KiB
Languages
HTML 95.5%
Python 4.5%