Adblock support thread

Thanks for your report. Please install "luci-lib-jsonc" manually. I've added an appropriate dependency with this Pull Request.

1 Like

On my router it doesn't start up on boot.
In the "Startup" menu in LuCI it is Enabled.
I also tried to add /etc/init.d/adblock start command to startup script, didn't work.
Also tried to adjust trigger delay and disable trigerring, doesn't help.
It only starts manually by hitting Apply button in LuCI config page.

LEDE Snapshot r3973
adblock: 2.6.0

Which router? Without defined trigger interface you will disable autostart at all.
Please post your adblock config (only the global part) and the output of "ubus list".

@dibdot I had great success with 2.6.0-1, as with all of your builds for adblock. However, with 2.6.0-2, adblock is failing to start for the first time I've experienced adblock failing to start. I've tried many things to get adblock running but no luck.

  • all default adblock settings (fresh config files as well)
  • LEDE 17.01.0
  • adb json file remains empty
  • no logging showing for adblock in system log
  • Archer C7 v2

I have reverted to 2.6.0-1 for now and everything is working great again (default settings). Please let me know if there is anything that I can do to help troubleshoot the 2.6.0-2 release.

In 2.6.0-2 I have to change the start priority ... please do the following:

Install 2.6.0-2 again via opkg install ... and wait until installation/adblock run has been finished.
Then call /etc/init.d/adblock disable (this should remove the old "@S90adblock" entry in /etc/rc.d and finally call /etc/init.d/adblock enable (this should create the new "@S50adblock" entry in the above directory.

Hope this helps.

@dibdot Your suggestion worked perfectly. Thanks Dirk.

@dibdot Thanks for this great work!

I have a directory where I place config files for other purpose and I use /etc/dnsmasq.conf to include it. It seems Adblock doesn't respect /etc/dnsmasq.conf so would you please provide an option to include another directory or merge the files of that directory into /tmp/dnsmasq.d?

Also, if I manually restart dnsmasq via Luci, will that disable Adblock since the default config file is /etc/dnsmasq.conf?

adblock didn't change any dns backend configuration, at the end of the adblock processing the dns backend will be restarted (e.g. /etc/init.d/dnsmasq restart) to get the new blocklists - that's all.

no, as long as /tmp/dnsmasq.d/ contains the block lists.

BTW, main (uci) configuration file for dnsmasq is located in /etc/config/dhcp.

@didot Thank you for the explanation.

I'm not familiar with shell programing but it seems /etc/init.d/dnsmasq will produce a temp config file with the name dnsmasq.conf.cfgxxxxx at /tmp/etc then use that file to start the daemon.

The content of that temp config file includes:

# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
......
conf-dir=/tmp/dnsmasq.d

Obviously the later "conf-dir" setting overrides my "conf-dir" setting in /etc/dnsmasq.conf.

Would you please consider to provide an option for a user defined "conf-dir" with a use defined extension then copy all files with that extension under that directory to /tmp/dnsmasq.d ? This should solve the problem.

It's already implemented! :relaxed:

To change the default configuration directory of dnsmasq add the following entry to /etc/config/dhcp, e.g.:

option confdir '/tmp/dnsmasq.d2'

Furthermore tell adblock to use this directory for block lists, change /etc/config/adblock accordingly, e.g.:

option adb_dnsdir '/tmp/dnsmasq.d2'

Restart both services afterwards ...

Wonderful!

Is it safe if I set the default config directory to somewhere like /etc/dnsmasq.d ? Will any adblock.sh functions remove my files under that directory? Will my files be searched when using the adblock query function? In other words, is there anything I need to be careful to not interfere with adblock?

I'm not a filesystem guru, but /etc is normally mapped to routers flash memory ... I would avoid unnecessary flash writes where possible.

Prefix for all adblock related files is by default "adb_list"* ... as long as you use another prefix you should be on the safe side.

yes, should work

You are right. I'm moving my files to /tmp also.

There are many duplicate items among different blocklist sources. Is it a good idea to combine selected blocklist into one file then remove duplicate items? It may save some memory.

it's already implemented, but adblock enables overall sort/duplicate removal only on devices with > 64MB RAM, this prevents sort related kernel dumps.

Could you make this configurable instead of doing a hard limit, please? [EDIT]Had a look at your code. If you don't want to make it configurable you might want to count in free swap space as a router with < 64 MB RAM but free swap will handle the sorting[/EDIT]

Also I see you have special rules for romania (rolist) and russia (ruadlist). Could you please add more, for example delist:

config source 'delist'
        option enabled '1'
        option adb_src 'https://easylist-downloads.adblockplus.org/easylistgermany+easylist.txt'
        option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
        option adb_src_desc 'focus on german ads plus generic easylist additions, weekly updates, approx. X entries'
1 Like

adblock update 2.6.1 is now in trunk. I've added two "force" options ... both are disabled by default.

3 Likes

Which DNS resolver would be used without that force option?

1 Like

The one configured at the host making the query, either via DHCP or via fixed settings. (usually that is already the local DNS server in the router.)

This "force local" uses firewall to hijack the DNS calls that would be going outside LAN and redirects them to the router's own DNS server. So, it prevents users/devices bypassing your own DNS server at the router. E.g. if you want to enforce a DNS blocklist etc.

1 Like

I upgraded to the latest version. Unfortunately the service doesn't come up after a "/etc/init.d/adblock restart" or a system reboot. No logfile entries or status reports.

opkg didn't refresh the new start priority of the init script. To solve this issue, please follow these steps ...

https://forum.openwrt.org/t/adblock-2-x-support-thread/507/86?u=dibdot