AdguardTeam / AdGuardHome

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

Unable to add local file as a list #2366

Open hoshsadiq opened 3 years ago

hoshsadiq commented 3 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Issue Details

Expected Behavior

Create a block list in any location (in this case /tmp/block-my-hosts.txt) Add the file path through the UI using an absolute path It should be accepted

Actual Behavior

Error: control/filtering/add_url | Invalid URL or file path | 400

Additional Information

The issue seems to be here, however, looking at isValidUrl, it seems the only thing that can go wrong is when the file does not exist, but I've confirmed the it definitely does:

$ ls -la /tmp/block-my-hosts.txt
-rw-r--r-- 1 adguardhome adguardhome 0 Nov 28 09:49 /tmp/block-my-hosts.txt
RiverKy commented 3 years ago

Maybe you can try to run a web server like Nginx to serve the list file as a HTTP webpage.