Note: I was using the FTL-branch but switched to v4.0 to see if that would resolve the issue - it did not.
Actual Behaviour:
Adding a regex value to the blacklist causes both the pi-hole and pi-hole-FTL services to stop functioning entirely.
ex.
*analytics* or ads.*
through the Web GUI.
Debug Token:
It will not upload while these settings are in place unfortunately. I have a local copy of the log if someone could point me to the most convenient place for them to view it!
*analytics* isn't valid. The leading * has nothing to quantify, and it's not matching what you may think. Without the invalid leading *, analytics* would mean match the characters a followed by n ... followed by c and ending with zero or more s chars.
Try https://regex101.com and use some of your regex values and you'll see the errors that they produce and what they actually match against.
You are completely right - I took those from a blocklist and assumed they were valid regex expressions.
That said, if an invalid string is entered, the services do stop functioning entirely. Perhaps a check within pi-hole to determine if the regex string is valid before adding it to the list would be a viable solution?
Thanks for the input. We can see about validating regex, it's such a fickle beast it becomes more of an issue to validate. We could check for a pass/fail condition with the regex string and at least return an invalid message. But parsing the validity and reporting to users what exactly is invalid would be quite the undertaking when there are so many other projects and tools to give you a better experience with testing and creating the regex values and strings. We'll take a look though and see what provides the best user experience.
I believe a pass/fail would be more than enough to alert users that they are doing something incorrectly, as nothing appears wrong until the device is rebooted or those services are restarted. Thank you for your time!
If this is the case, it is a bug. FTL does ignore invalid regex filters and print a warning in its log file. Try again with the invalid string you had before and post the last messages in /var/log/pihole-FTL.log.
You may also want to try to enable the regex debugging mode (it is only available in the most recent beta version).
PS You are right, we have a bug in the error logging routine. It will be fixed in