geerlingguy / internet-pi

Raspberry Pi config for all things Internet.
MIT License
4.29k stars 448 forks source link

Allow easy customization of adlists.list file #492

Closed geerlingguy closed 1 year ago

geerlingguy commented 1 year ago

I have been meaning to add this in at some point so it's easy to configure out of the box... but basically, the /etc/pihole/adlists.list file controls what ad lists Pi hole uses. There's also a custom.list to configure DNS... maybe I'll add that in a future issue.

But basically, add a variable like pihole_adlists and have it be a list with one adlist URL per line.

If the variable is not empty, write the contents line by line to a file named adlists.list inside the pi-hole/etc-pihole directory.

geerlingguy commented 1 year ago

Huh... well, after a good deal of work and testing, apparently in Pihole 5 and later, the adlists are stored in the gravity database itself, and the adlists.list file on disk (in /etc/pihole/adlists.list) is just an artifact of an old installation.

Who knew?

It doesn't seem like there's a simple way to programmatically alter the adlist outside of maybe an API request somehow?

geerlingguy commented 1 year ago

Still pushed one minor change to make working with relative-path config dirs easier.