Simple-adblock: fast, lean and fully uci/luci configurable AdBlocking

Just tried version 1.7.0 of stangri's own repo, this one seems to work fine in most regard.
I don't get the "simple-adblock 1.6.3-5 failed to create its data file!" error anymore.

What seems wrong with 1.7.0 is the luci app, since the simple-adblock service is shown as disabled all the time in the luci view of simple-adblock. The button enables and disables the service successfully, but shows it is disabled when it's running correctly via CLI.

Have you also upgraded the luci app?

BTW, which router is this? Sounds like you're hitting either wait timeout or RAM limits.

My issue is that when I enable simple-adblock service, it stops all internet access from working. I cannot reach any web addresses via FQDN or IP. Disabling the service does not fix it, I have to reboot the router before I regain internet access.

I've installed simple-adblock and luci-app-simple-adblock along with the dependencies uclient-fetch, libustream-mbedtls, coreutils-sort and dnsmasq (already installed on OpenWRT by default anyway). When I initially enable the service, it does reply that the service is running with 48k something domains being blocked. The config is pretty simple, so I'm not sure how that could have been botched, but nonetheless it's happening.

Not sure what logs to check for issues. Would like to use the service but as it stands something is preventing anything from being used at all as it comes "out of the box".

I am running OpenWRT 18.06 on a Netgear R7800. The only other service I'm running concurrently besides the default stuff that comes with OpenWRT is YAMon 3.4 package. Doesn't appear to be affected, it and LuCI are the only webpages I can still hit after enabling simple-adblock service.

I have the same problem. After a few minutes internet access is gone.

I managed to track down what the problem is, but I don't know where it comes from.
The problem is that there is an error in the generated file /tmp/dnsmasq.d/simple-adblock and because of this dnsmasq cannot be restarted.

From my logs:

Wed Jun 26 20:26:58 2019 user.notice simple-adblock [2460]: Restarting dnsmasq [βœ“]
Wed Jun 26 20:26:58 2019 user.notice simple-adblock [2460]: service is blocking 48288 domains [βœ“]
Wed Jun 26 20:27:00 2019 daemon.crit dnsmasq[3084]: error at line 36250 of /tmp/dnsmasq.d/simple-adblock
Wed Jun 26 20:27:00 2019 daemon.crit dnsmasq[3084]: FAILED to start up

The offending line contains local=/secret.Ι’oogle.com/, notice the first Ι’ in the domain name.

I hope this helps fixing the problem.

It's one of those malware domains. Apparently the script cannot work with non Latin characters. Until it's fixed you can exclude the feed that imports it from your list.

I also have this problem. The feed that imports that line is "http://someonewhocares.org/hosts/hosts" if anyone is interested. After removing that feed it worked. But if any other feed gets updated with non latin symbols we are screwd.

Also these feeds have 127.0.0.1 as prefix. I thought it was much faster to have 0.0.0.0 as prefix.

I noticed other problem too. I use 5G blue led to notify me if adblock is running. Now when it had problem starting up blue light was litghting as if there was no problem. /etc/init.d/simple-adblock start - LED LIGHTS UP no matter if simple adblock has started or not. /etc/init.d/simple-adblock stop - LED TURNS OFF, but simple-asblock was not running. It's a problem. Users can't rely on led if adblock is running.

@auriuman78, @boteeka, @trendy, @anon20279570
Are you running the simple-adblock from OpenWrt repo or my own repo?

The version in my repo is newer and should have the non-ASCII bug fixed, however if your dnsmasq supports it, you can enable non-ASCII characters.

For the led -- please test with the version from my repo first.

I am running the one found in the official openwrt repos. I'll try your repo tonight.

@stangri any plans to update the main package repo as well? A bug which renders dnsmasq out of service should be fixed in all connected repos ASAP.

I'm away until early July and can't send the pr until then. :worried:

Hi,
trying to install on my openwrt I encounter a problem:
...
[DL] Blocked Domains: mirror1.malwaredomains.com [βœ“]
Sorting combined list busybox: applet not found
[βœ“]
Optimizing combined list busybox: applet not found
[βœ—]
Whitelisting domains [βœ“]
Formatting merged file [βœ—]
Creating DNSMASQ config [βœ“]
Removing temporary files [βœ“]
ERROR: simple-adblock 1.7.0-1 failed to create its data file!

this is after I forced the sort package installed by "opkg --force-overwrite install coreutils-sort", which also gave me an error: "Optimizing combined list Error relocating /usr/bin/sort: explicit_bzero: symbol not found" , then I reverted to the busybox redirection, and I get this error now..

any idea how to make it work?

Which router/OpenWrt is it?

archer c7 v2, using openwrt from: https://github.com/infinitnet/lede-ar71xx-optimized-archer-c7-v2
are there any more logs I can provide to help debug this?

Reflash your router with a current firmware.

That is somebody's private build, updated last time over a year ago in May 2018...
Ancient stuff.
Too much has changed in the c libraries, kernel etc., so that the current downloadable packages are likely incompatible, which warning from opkg you have overriden...
Reflash with current firmware.

Alternatively, try firstboot to reset all packages and settings, and reinstall/reconfigure the router.

Ps.
You have forcibly overwritten the symlink to busybox sort. You might recreate that symlink. Just look at the other busybox symlinks in /bin directory, or /usr/bin for sort. That might restore the sort functionality.

Pps.
Maybe I understood you wrong. Did you already manage to restore sort, and only the adblock script complains?

Hi,

can someone tell me what I need to configure to disable the autostart of simple-adblock after rebooting my OpenWRT device? I want to add simple-adblock to my startup script, that makes sure that DNScrypt is running first.

Would following be correct?

/etc/init.d/simple-adblock disable # Disabling autostart of simple-adblock
/etc/rc.local --> /etc/init.d/simple-adblock start # Running simple-adblock via rc.local

Wouldn't it be more simple to change the adb service start sequence in /etc/rc.d/ ?

I'd start with fine-tuning the boot_delay option to trigger start of simple-adblock on boot when desired, but if you really need to prevent simple-adblock from starting on boot, yes you can do:
/etc/init.d/simple-adblock disable, however before manually starting it, you'd need to run /etc/init.d/simple-adblock enable first.

Thanks, this is what I do now and it's working great.

EDIT: FIXED WITH 1.7.0-1

I faced one issue with the luci app, which tells me that the service is disabled/stopped even if it's enabled and started:

firefox_EY5uuaMyEV
The service should be shown as up and running, when the service was started.
I'm running the latest simple-adblock and luci app from your repo.

Would be great if you can fix this, since I cannot assure that simple-adblock is running via luci. I know it's working, since blacklisted domains aren't resolvable.

This app is really awesome and my favorite adblock solution for OpenWRT, since the feedback via CLI is great and custom sources can be added. Keep up the great work and thank you so much!

Hi stangri,

I added following source with 40.908 entries of unique domains:
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts

Simple-adblock tells me that only 25.000 are getting blocked.
Is something wrong with the list? Won't some lines get interprated?

Best regards