Adblock support thread

@hnyman Thanks, works perfectly! :relaxed:

I installed it yesterday and it works very nicely. But what I'm missing from v 1.5 is

  • /etc/init.d/adblock query
  • statistics in the LuCi app.

Also logread -e "adblock" shows:

Tue Dec 20 09:44:39 2016 daemon.err[8591]: udhcpc: started, v1.25.1
Tue Dec 20 09:44:39 2016 daemon.err[8591]: udhcpc: sending discover
Tue Dec 20 09:44:44 2016 daemon.err[8591]: udhcpc: no lease, failing
Tue Dec 20 09:44:48 2016 user.notice adblock-[1.9.99-pre1] info : status ::: block lists with overall 155759 domains loaded (LEDE Reboot SNAPSHOT r2535-720b992)

which suggests that starting the service is an error. Maybe this should be also a user.notice?

Adblock2 was simplified a lot, statistics being one of the victims. The LuCI app has been simplified accordingly.

Do you really need this feature? :wink:
At the end it's a simple grep in dnsmaq block list directory ...

Regarding statistics you will get some basic figures with a simple ubus call (in 2.0 release, not in 1.99.x and not in LuCI):
ubus call service list '{"name":"adblock_stats"}' | jsonfilter -e '@.*.instances.stats.env' This will output the overall domain count and the last runtime as JSON, i.e. { "blocked_domains": "136159", "last_rundate": "18.12.2016 20:49:03" }

This "error" comes up during a simple dnsmasq restart - currently I can't reproduce this error and it seems that it makes no harm ... by now, please ignore it. :slight_smile:

@hnyman, at the risk of sounding stupid, how do I install this file?

[quote="mojolacerator, post:25, topic:507"]
how do I install this file?
[/quote]It is an .ipk file, so you download it to the router (if necessary, via your PC) and
then you install it with opkg install luci-app-adblockxxxx.ipk

But both adblock2 and the corresponding luci-app-adblock have been committed to the source repo today, so the next buildbot run will produce normal snapshot packages for downloading via opkg. (EDIT: luci-app-adblock_git-16.355.42251 or newer will have the adblock2 support)


I noticed that dnsmasq will spam the syslog with the new adblock 2.0 as it tries to log each address it sees as "local". There is a limit of 30 servers before dnsmasq stops listing domains. But for me it gets repeated four times during the boot process. So quite much log spam like

Tue Dec 20 18:40:19 2016 dnsmasq[3224]: using local addresses only for domain
Tue Dec 20 18:40:19 2016 dnsmasq[3224]: using local addresses only for domain
Tue Dec 20 18:40:19 2016 dnsmasq[3224]: using local addresses only for domain

The amount of servers listed is limited to 30 since this dnsmasq commit:;a=commitdiff;h=b97026035ecc870ea0f12f537b214237cf3d0af6;hp=69cbf78bb676e493f0a4cd6dc7ffec0fcafafed5

That number is controlled by SERVERS_LOGGED defined in src/config.h

I wonder if devs would react positively to a PR changing that limit to 10 or 15 via a LEDE patch. I consider doing that for my own build.

unfortunately this is the normal dnsmasq logging behaviour whenever you define '--local', '--server' or '--address' without upstream server ip addresses - anyway it's only a cosmetic issue.

@htmt @Konstruktionist
Please could you change the following line in '/etc/init.d/dnsmasq' and see if the above error disappear:


udhcpc -n -q -s /bin/true -t 1 -i "$ifname" >&- && rv=1 || rv=0


udhcpc -q -s /bin/true -t 1 -i "$ifname" >&- && rv=1 || rv=0

Unfortunately this seems to kill the dhcp server (had to log in with fixed IP etc.).
The line "udhcpc: no lease, failing" isn't showing up after each "udchpc: sending discover", but I teminated (CTRL-C) the command "/etc/init.d/adblock restart" after the third "udchpc: sending discover".

OK, thanks for testing anyway.

To mute dnsmasq output at all, I've sent a PR to LEDE source to make it configurable via UCI, see here.

1 Like

adblock 2.0.2 is now in trunk, with the following fixes:

fixed a dnsmasq restart issue (udhcpc error)
fixed a long standing corner case bug in "disabled" state (does not remove active block lists!)
fixed dnsmasq check if multiple instances are present
bring back query function on highly demand

the dnsmasq log-facility option is now supported in LEDE trunk. To mute dnsmasq via uci config, please add the following option to /etc/config/dhcp:

option logfacility '/dev/null'

Merry Christmas!

Thanks @dibdot, 2.02 running nice, and the system log is nice and clean :grinning:

a small client side tweak for all firefox users to get rid of "Server not found" messages from ad related https sites:

  1. install "stylish" addon
  2. add a new style "net error adblock"

@-moz-document url-prefix('about:neterror?e=dnsNotFound') {
         :root {
               --in-content-page-background: none !important;
          body {
               display: none !important;

youtube before:

youtube after:

Have fun! :sunglasses:

1 Like

@dibdot, I like your suggestion for Firefox users to use that simple Stylish script to cosmetically remove the HTTPS server and DNS related error messages, Dirk. I did not realize initially that it only affected secure ad related sites, so I am thankful that you have clarified that for me. I've been running (literally all) 1.x and now 2.x releases with great success and upgrade with each minor revision. I am thankful for your effort and work with the community.

One brief question, do you know if there is a similar Stylish type of script that would work for Chromium users to cosmetically remove those same https server errors? I am not a programmer myself, so unfortunately that stuff is beyond my knowledge. Thank you for your time.

No, to my knowledge trapping in chrome is not possible, and the HTML for the error pages gets built at runtime from compiled resources. See here

@dibdot Upon trying to upgrade to Adblock 2.1.5 from earlier today, I receive multiple "libssp" errors. This is something that I am not familiar with and have not seen before with previous installations of Adblock package. I looked for quite some time through the LEDE repos and also over at OpenWrt for any type of "libssp" package and was unable to find any. Are you familiar with this issue?

/tmp$ opkg install ./*adblock*.ipk
Upgrading adblock on root from 2.1.2-1 to 2.1.5-1...
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for adblock:
 * 	libssp * 
 * opkg_install_cmd: Cannot install package adblock.

This isn't really an issue with adblock itself, but rather caused by a couple of build-system/ buildbot issues which happened over the last couple of days. While those are supposed to be fixed now, it might take a little (~24h-48h) until the fixed versions actually appear on the mirrors.