What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Status
Not open for further replies.
you got it half right you need to be running pixelserv on port 80 and 443 and the webui on 8443
 
sry see that now been busy debuging my other script but more to chew off then this one.
 
Hi guys, I have one question regarding router-based adblockers in general, not for ublockr in particular. What is the benefit to use a router-based solution vs browser addons like AdBlock installed on LAN devices? I understand that if I have a lot of PCs in LAN, the router-based solution may reduce the traffic significantly , but what about a typical home LAN with 2-3 PCs and 3-5 mobile phones/tablets?
 
The benefit is to not have to care about the adblockers on your devices.
If you use @swetoast's or mine exclusively, there is no need to have another adblocker installed within your LAN. And if you use a VPN, not even outside it.
Mine even provides some nice stats if you enable it.

Thanks! Yes, I understand, but I am still thinking if it is feasible for 1 PC, 2 laptops, and 3 mobile phones ... The browser-based adblockers can be easily on-demand managed by PC/phone users if needed. BTW, how the router-based adblockers affect the router's CPU load? I am with RT-N66U, which is not the most powerful one comparing with ARM routers.
 
Minor tweaks and fixes published on gitlab for ublockr since no major bugreports are coming in :) for those that use my script

also considering adding auto update on this project so that it downloads a new version on demand with a switch like --update

let me know if there is any interest in this :)
 
Code:
ublockr -update
Performing self-update... Please wait...
OCTAL mode set:777
Inserting update process...
Update complete..
ublockr: Reading ublockr config....


ublockr: updating adblock lists.
/opt/var/cache/ublockr/ip.part                    [        <=>                                                                                       ] 362.52K   257KB/s    in 1.4s   
/opt/var/cache/ublockr/ip.part                100%[=================================================================================================>] 488.54K   346KB/s    in 1.4s   
/opt/var/cache/ublockr/ip.part                    [ <=>                                                                                              ]  21.84K  --.-KB/s    in 0.04s   
/opt/var/cache/ublockr/ip.part                100%[=================================================================================================>]   1.75M   842KB/s    in 2.1s   
/opt/var/cache/ublockr/ip.part                100%[=================================================================================================>]  38.10K   121KB/s    in 0.3s   
/opt/var/cache/ublockr/ip.part                    [  <=>                                                                                             ]  11.33K  52.5KB/s    in 0.2s   
/opt/var/cache/ublockr/ip.part                    [       <=>                                                                                        ] 383.89K   312KB/s    in 1.2s   
/opt/var/cache/ublockr/ip.part                100%[=================================================================================================>]   1.66K  --.-KB/s    in 0s     
/opt/var/cache/ublockr/no.part                100%[=================================================================================================>]      66  --.-KB/s    in 0s     
/opt/var/cache/ublockr/no.part                100%[=================================================================================================>] 117.10K  --.-KB/s    in 0.1s   
/opt/var/cache/ublockr/no.part                100%[=================================================================================================>]  83.80K   175KB/s    in 0.5s   
/opt/var/cache/ublockr/no.part                100%[=================================================================================================>] 300.02K   296KB/s    in 1.0s   
/opt/var/cache/ublockr/no.part                100%[=================================================================================================>]      66  --.-KB/s    in 0s     
/opt/var/cache/ublockr/no.part                100%[=================================================================================================>]     149  --.-KB/s    in 0s     

ublockr: ipv4_hosts is present in /jffs/configs/dnsmasq.conf.add
ublockr: ipv6_hosts is present in /jffs/configs/dnsmasq.conf.add

Done.
ublockr: reloaded dnsmasq to read in new hosts
ublockr: updated ipv4 adblock lists, 93131 ads sites blocked
ublockr: updated ipv6 adblock lists, 94848 ads sites blocked

So its working gonna push an update once im done reviewing the code thats added :) its very important that the file is named ublockr cause thats the file it looks for when updates.
 
Last edited:
Revision 2 pushed

changelog
  • added selfupdate using -update
  • new dependacy: coreutils-stat
note: very important that the blocker has the name ublockr or else update wont work!
 
The update feature works great - thank you for that...

I ran into another issues: I configured my own ad-blocker list (I basically just added the yoyo list) and I found out that duplicates won't be removed. I think it's not a bug within ublockr since the same thing happens when I run via command line:
Code:
sort -u /opt/var/cache/ublockr/ipv4_hosts
.

Does anyone have an idea? Thanks!


Edit: seems I got it to work with editing the ublockr code:
Code:
whitelist () {
if [ -f $path/whitelist.filter ]; then echo; else wget -q $wlfilter -O $path/whitelist.filter; fi
if [[ -r $path/whitelist.filter ]];then
    awk -F':' '{print $1}' $path/whitelist.filter | while read -r line; do echo "$pix_v4    $line"; done > $path/whitelist_v4.part
    grep -F -x -v -f $path/whitelist_v4.part $path/ipv4.part | sort -u > $path/ipv4_hosts
    if [ "$(cat /proc/net/if_inet6 | wc -l)" -gt "0" ]; then
       awk -F':' '{print $1}' $path/whitelist.filter | while read -r line; do echo "$pix_v6    $line"; done > $path/whitelist_v6.part
       grep -F -x -v -f $path/whitelist_v6.part $path/ipv6.part | sort -u > $path/ipv6_hosts
    fi; fi
}

@swetoast could you add something like this in the original code, or isn't it worth it?
 
Last edited:
gonna review it tomorrow, been a busy day and if its good im gonna merge it :) and put you down as a contributor :)
 
revision 3 is up

changelog:
  • sort after whitelisting (tnx @mrchow)
  • minor fix if dnsmasq.conf.add is missing it creates it instead of giving error message
 
Last edited:
update to revision 4 use
Code:
ublockr -update
to update then
Code:
ublockr -version
to verify that you got the latest revision

Changelog:
  • online checker
  • better ipv6 handling
 
so in an effort to provide better support ive made a little debugging tool that helps me help you :)

https://gitlab.com/swe_toast/debugtool/raw/master/debugtool.sh

it checks for dependencies and path for my scripts and then lets you review and transmit em so that you can post it to me the logs looks like this

Code:
Router Model:

ASUSWRT-Merlin RT-AC56U 380.66-alpha2 Mon Mar  6 18:13:45 UTC 2017

Entware requierment for uBlockr
/opt/bin/opkg
wget - 1.18-2
grep - 2.26-1
pixelserv-tls - V35.HZ12.Ki-1
ca-certificates - 20161130
coreutils-stat - 8.23-2

Locating uBlockr Paths
/tmp/mnt/Main/entware/etc/ublockr.cfg
/tmp/mnt/Main/entware/bin/ublockr
/tmp/mnt/Main/entware/var/cache/ublockr
/tmp/mnt/Main/entware/var/cache/ublockr/no.list
/tmp/mnt/Main/entware/var/cache/ublockr/whitelist.filter
/tmp/mnt/Main/entware/var/cache/ublockr/ipv4_hosts
/tmp/mnt/Main/entware/var/cache/ublockr/ip.list

Locating Malware-Filter Paths
/jffs/malware-filter.list
/tmp/mnt/Main/entware/bin/malware-filter

Detecting Ipset version on router
ipset v6.29, protocol version: 6

Locating Malware-Filter Paths
/jffs/privacy-filter.list
/tmp/mnt/Main/entware/bin/privacy-filter

Detecting Ipset version on router
ipset v6.29, protocol version: 6

then it prints out a address for the log
https://clbin.com/dMy4P

im gonna work on it pretty hard cause this helps me see what differences there are in your envoirment and allows me to improve upon my scripts.
 
please update install script, fault a "

original: echo "cru a ublockr "0 0 * * * /opt/bin/ublockr" >> /jffs/scripts/services-start
Fixed: echo "cru a ublockr "0 0 * * * /opt/bin/ublockr"" >> /jffs/scripts/services-start
 
Status
Not open for further replies.

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top