1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Diversion - the Router Ad-Blocker

Discussion in 'Asuswrt-Merlin' started by thelonelycoder, Aug 25, 2018.

  1. Xentrk

    Xentrk Part of the Furniture

    Joined:
    Jul 21, 2016
    Messages:
    2,752
    Location:
    The Land of Smiles
    Congratulations @thelonelycoder on the release of Diversion!!

    I still plan to implement this OpenVPN Accept DNS setting conflict check with ABS in my project that I am working on. I will need to update the AB-Solution reference to Diversion.

    upload_2018-8-26_20-30-55.png
     
    thelonelycoder and skeal like this.
  2. Martineau

    Martineau Part of the Furniture

    Joined:
    Jul 8, 2012
    Messages:
    2,870
    Location:
    UK
    YES

    OK, so what about this file name '/jffs/scripts/$Test_script.sh' - no spaces but a '$' sign!! :eek: how careless of me.:oops:

    Are you going to comment that this is extremely unusual and no-one should ever, ever include it in a file name on the router?:p

    Whilst not being a proficient coder like your good self, this hack works for me;)
    Code:
        list_files(){
            for file in "${1}/"$2*; do
                if [ -f "$file" ]; then
                    printf "%4s %s\\n" "$i." "${file#$1/}"
                    #eval "fileSel$i=$file"              # Martineau Fix 1 of 1 - Allow $ and spaces in file names
                    eval "fileSel$i=\"$(echo -e "$file" | sed 's/\$/\\\$/' )\""
                    ######################################################################################
                    i=$((i+1))
                else
                    echo "     (no file(s) found)"
                fi
            done
        }
    
    Indeed, although never having used 'sf' before, waiting for my 419 files to scroll up the screen twice was tedious...:(

    Perhaps in a future version you might tweak the list_files() function, and optionally display them on screen horizontally?
    e.g.
    Code:
    …<snip>
    
    228. install                          229. installer                      230. installer.bak                  231. ip-ranges.json               
    232. justdomains                    233. ledsoff.sh                     234. ledson.sh                      235. modprobe.sh                  
    236. nat-start                      237. openvpn-event                  238. openvpnclient1.postconf        239. openvpnclient2.postconf      
    240. openvpnclient3.postconf        241. openvpnclient4.postconf        242. openvpnclient5.postconf        243. openvpnserver1.postconf      
    244. openvpnserver2.postconf        245. post-mount                     246. post-mount.div                 247. pptpd.postconf               
    248. pre-mount                      249. qos.sh                         250. rrdtool_test1.sh               251. rrdtool_test2.sh             
    252. services-stop                  253. smb.postconf                   254. spamdb_db.rrd                  255. speedtest.sh                 
    256. syslog-move.sh                 257. tcpdump.sh                     258. test00.sh                      259. test000.sh                   
    260. test1.sh                       261. test3.sh                       262. test4.sh                       263. test5.sh                     
    264. test77.sh                      265. test8.sh                       266. test888.sh                     267. test900.sh                   
    268. test99.sh                      269. test999.sh                     270. test_getopt.sh                 271. update-notification          
    272. updown.sh                      273. updown.sh_384.7alpha1-g43c4482aa   274. vlan_rules.sh                  275. vpnc-ip-up                   
    276. vpnclient-down                 277. vpnclient1-down                278. vpnclient1-route-up            279. vpnclient1-up                
    280. vpnclient2-down                281. vpnclient2-route-up            282. vpnclient2-up                  283. vpnclient3-down              
    284. vpnclient3-up                  285. vpnclient4-down                286. vpnclient4-route-up            287. vpnclient4-up                
    288. vpnclient5-down                289. vpnclient5-route-up            290. vpnclient5-up                  291. vpnclientX-xxxx-xxx_Template.sh  
    292. vpnroute-pre-down.sh           293. vpnrouting.sh                  294. vpnserver1-down                295. vpnserver1-route-up          
    296. vpnserver1-up                  297. vpnserver2-down                298. vpnserver2-route-up            299. vpnserver2-up                
    300. vsftpd.postconf                301. wan-start                      302. wan-thruput.rrd                303. ya-malware-block.sh
    
    <snip>
     
  3. martinr

    martinr Part of the Furniture

    Joined:
    Nov 27, 2014
    Messages:
    2,420
    Location:
    Manchester, United Kingdom

    Yes, I do have that local variable, thanks to you. But it was only for the installation. Afterwards I switched thr server on and all’s well. Recovering from a couple of days of problems caused by dnscrypt, it’s quite likely this was a hiccup of my own making.
     
  4. eclp

    eclp Senior Member

    Joined:
    May 15, 2016
    Messages:
    303
    Thanks for the update!

    After this update I cannot call pixelserv /servstats anymore.
    How can I fix the problem?
    Code:
    opkg list-installed | grep pixelserv-tls
    Code:
    pixelserv-tls - 2.1.1-1
    Code:
    uuuuuuuuuuuuuuuuuser: Failed to start pixelserv-tls from /opt/bin/diversion.
    pixelserv-tls[24564]: pixelserv-tls 2.1.1 (compiled: May 12 2018 06:33:51) options: <none>
    pixelserv-tls[24564]: Listening on :*:443
    pixelserv-tls[24564]: Abort: Address already in use - :*:80
    It's done.
    (reinstalled the update)

    :)
     
    Last edited: Aug 26, 2018
  5. miniterror

    miniterror Regular Contributor

    Joined:
    Sep 13, 2014
    Messages:
    56
    Is there a minimum version of John his fork needed for this to work?
    Today i reveretd back to version 16 of his fork.
    I cant get AB-Solution to work anymore and when trying to start this nothing happens.

    When taking out the s i see the following error coming out.

    [email protected]:/tmp/home/root# curl -O https://diversion.ch/install && sh install
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (77) error setting certificate verify locations:
    CAfile: /etc/ssl/certs/ca-certificates.crt
    CApath: none

    [email protected]:/tmp/home/root#
     
  6. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,464
    Location:
    Switzerland
    ;) Until now, no one complained about the file listing.
    Thanks, will check it.
    Good idea. Or just limit to certain files.
     
  7. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,464
    Location:
    Switzerland
    This suggests that pixelserv-tls was disabled. Next time check this in ep.
     
    eclp likes this.
  8. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,464
    Location:
    Switzerland
    The Diversion website runs on https only. Try just to download the install file with
    Code:
    curl -O https://diversion.ch/install
    Then
    Code:
    cat install
    which shows the file which has text like "# Diversion is free to use under the GNU General Public License version 3 (GPL-3.0)"

    I tested with 30E2 and 33E7. No problems whatsoever. Make sure your internet is up.
     
  9. PDinDetroit

    PDinDetroit Regular Contributor

    Joined:
    Dec 14, 2017
    Messages:
    72
    Install was going fine until "Waiting for Skynet..." kept looping and displayed that Skynet required an update. The loop of install for Diversion would start again. I opened another putty session and did a "Forced Update" for Skynet, which did find the update and installed it. This allowed Diversion to complete the install.

    Diversion and overall performance seems a tisch better, but that is probably the Placebo Effect and/or "Oh, new shiny" taking over for a few.
     
  10. john9527

    john9527 Part of the Furniture

    Joined:
    Mar 28, 2014
    Messages:
    6,133
    Location:
    United States
    Version 17 will probably get you past this error (it added the ca-bundle for curl), but why are you using a release that is over 2.5 years old? A lot of security holes fixed since then.
     
    skeal and thelonelycoder like this.
  11. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,464
    Location:
    Switzerland
    Skynet must have taken a long while for the update or it did not properly delete the skylock file when done.
    Hence the timeout when Diversion wanted to modify AB4 specific lines to Diversion.
    The next Skynet update will have the Diversion code as soon as @Adamm has time to do it.
     
    PDinDetroit likes this.
  12. k_ipman

    k_ipman New Around Here

    Joined:
    Aug 26, 2018
    Messages:
    2
    Works fine for me when I upgraded from AB-Solution.
    One noob question though, are this entries for white-listing SNBForum? I thought just the website url needs to be added to whitelist. Do I need to add a website url to whitelist or their ad serving url's?

    1: ad2.netshelter.net
    2: assets.omidoo.com
    3: flashtalking.com
    4: servedby.flashtalking.com
    5: tgdaily.com
    6: tgdaily.net
    7: vma.tgdaily.com
    8: vma.tgdaily.net
    9: z-na.amazon-adsystem.com
     
    Makaveli likes this.
  13. Here's the answer to your question:

    and the ones by default in the whitelist are there indeed to generate some income for SNBforums.com.
     
    k_ipman likes this.
  14. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,464
    Location:
    Switzerland
    Yes, those are for this very website, to support it.

    Diversion and AB-Solution block domains to block ads. Whitelisting www.snbforums.com does not automatically whitelist domains that are served in the html source code that your browser sees. Your list are such domains in the source code.
     
    skeal and k_ipman like this.
  15. miniterror

    miniterror Regular Contributor

    Joined:
    Sep 13, 2014
    Messages:
    56
    Doesnt work either, as John mentioned the version i am using now doesnt have the CA certificates, hence the HTTPS sites not working for curl.
    Thanks for your speedy reply.
     
  16. sentinelvdx

    sentinelvdx Very Senior Member

    Joined:
    Sep 23, 2014
    Messages:
    566
    Location:
    Buenos Aires - Argentina
    Migration from ABS 3 to Diversion was just perfectly seamless.
    AMTM updated
    AB4 updated
    How do I check if pixelserv-tls is up to date?


    Sent from S.G. S9+ Duos
     
  17. Clark Griswald

    Clark Griswald Senior Member

    Joined:
    Sep 21, 2015
    Messages:
    239
    Location:
    Northern California, USA
    You should see the version of pixelserv located on the Diversion main gui page (post #1).
    v2.1.1 was an option to install during the Diversion setup. After the install, I simply ssh'd the test.4 code and updated. You could check which version is loaded by looking at the pixelserv stat page.
     
    Last edited: Aug 26, 2018
  18. Ubimo

    Ubimo Regular Contributor

    Joined:
    Aug 6, 2016
    Messages:
    176
    Thanks for diversion.
    I chose Large blocking file, now facebook does not load correctly, I see only text on page, no design or pics. Which domain do I have to whitelist besides facebook.com and fbcdn.net?
    Edit:
    I think I figured it out with the help of logging. :)
     
  19. skeal

    skeal Part of the Furniture

    Joined:
    Apr 30, 2016
    Messages:
    3,836
    Location:
    Riderville, SK
    That is not going to work. Back your settings down. Don't use such a restrictive blocking file try standard (2) and add the + and try that to start with.
     
    nodnarb91 likes this.
  20. ScottW

    ScottW Regular Contributor

    Joined:
    Feb 7, 2013
    Messages:
    167
    Location:
    NorthWest US
    Updated from Ab-solution to Diversion, using automatic port of old settings. That went well, everything was working fine! THANKS @thelonelycoder!

    But then... I decided to update pixelserv-tls from "2.0.1 RC4" to the "2.1.1" release on entware.

    Now pixelserv won't run. Diversion menu correctly shows v2.1.1 now, and same IP I have always used (192.168.1.252, outside of dhcp range). Diversion declares success in starting pixelserv, but pixelserv isn't running and this is in system log:
    ...
    Aug 26 15:44:43 admin: Started pixelserv-tls from /opt/bin/diversion.
    Aug 26 22:44:43 pixelserv-tls[21376]: pixelserv-tls 2.1.1 (compiled: May 12 2018 06:33:51) options: <none>
    Aug 26 22:44:43 pixelserv-tls[21376]: Listening on :*:443
    Aug 26 22:44:43 pixelserv-tls[21376]: Abort: Address already in use - :*:80
    Aug 26 15:44:44 rc_service: service 21375:notify_rc restart_dnsmasq
    ...

    The time zone difference makes me think pixelserv isn't getting correct options passed.

    Where did I go wrong, and how do I fix it?

    ******** EDIT --- PROBLEM RESOLVED *********
    I resolved the problem by just running the Diversion installer again. I think the problem was with the /opt/etc/init.d/S80pixelserv-tls file. When I installed the newer pixelserv-tls after installing Diversion, the pixelserv-tls install created a default version of that file with no parameters. During the reinstallation of Diversion, that default file was replaced with a Diversion-supplied script that uses correct parameters from Diversion's settings. Everything starts/runs correctly now!
     
    Last edited: Aug 27, 2018
    skeal likes this.