AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
25.07k stars 1.8k forks source link

Custom HTML file for "blocked page" #7280

Open JustLeska opened 3 weeks ago

JustLeska commented 3 weeks ago

Prerequisites

The problem

Hi there,

I would like to request a feature for AdGuard Home that allows users to specify a directory for custom HTML and CSS files, which AdGuard Home can directly serve as the blocked page. This would eliminate the need to set up a custom IP address or external server for hosting the blocked page.

Currently, AdGuard Home allows users to specify a custom IP address for the blocked page. However, I think it would be more convenient if users could simply place their custom HTML and CSS files in a designated directory within AdGuard Home, and AdGuard Home would then serve these files as the blocked page.

Proposed solution

Custom Directory in AdGuard Home: Add a feature where users can upload or place their HTML and CSS files into a specific directory within the AdGuard Home installation (e.g., /custom_blocked_page).

Automatic Serving: When a domain is blocked, AdGuard Home will check for files in this directory and serve them as the custom blocked page instead of requiring an external IP or server.

HTML and CSS Support: The directory would support:

HTML files for the structure of the blocked page. CSS files for custom styling. Optionally, JavaScript files for additional functionality.

Fallback: The user will be able to choose between:

Alternatives considered and additional information

This feature could be made optional for users who prefer the default blocked page or who already use a custom IP address for this purpose. By providing a built-in directory for custom HTML and CSS, AdGuard Home would become more user-friendly and I think this feature will simply my life because I am too lazy to create the webserver myself -_-.

Thank you for considering this feature request!

tjharman commented 3 hours ago

How would a DNS server serve HTML?

Are you proposing that AdGuardHome also integrate a Web Server?

The whole purpose of handing out an IP address as the blocked page is because AdGuardHome isn't a Webserver.

If a DNS client was to ask "What's the IP address of beer.com" and you replied with a lot of HTML it would reject it - it's expecting a DNS response, not a HTML response.

I'm sorry but I don't think your request makes sense, does it? I can't fathom how "Custom HTML/CSS page: Respond with a manually set HTML/CSS page from the /opt/AdGuardHome/CustomPage directory" could be returned in a DNS response.