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. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    Welcome
    This is Diversion - the Router Ad-Blocker for Asuswrt-Merlin


    AB-Solution is now Diversion

    All install and update info, as well as other useful information is on the Diversion website.

    October 27, 2018
    Diversion 4.0.4 is now available
    See the Diversion website or this post for the change log

    Diversion is free to use under the GNU General Public License version 3 (GPL-3.0).
    If you like Diversion and find it useful, you can help it's further development with a donation.
    Thank you!

    To see the fancy ticks and crosses that Diversion shows during operations, make sure your SSH terminal encoding is set to UTF-8.

    Diversion is interactive. To start the Diversion UI after installation, use
    Code:
    diversion
    For quick operation options without starting the UI, use
    Code:
    diversion help
    to make yourself familiar with the available options.

    Screenshots of Diversion 4.0.3, standard and extended menu (more options o)

    [​IMG]
     
    Last edited: Oct 27, 2018
    Stevens243, lev, CiscoX and 39 others like this.
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    Reserved post
     
    HowIFix likes this.
  4. skeal

    skeal Part of the Furniture

    Joined:
    Apr 30, 2016
    Messages:
    2,008
    Location:
    /etc
    All I can say is thank you sir! You are awesome. Donations on the way!!!
     
  5. M@rco

    [email protected] Very Senior Member

    Joined:
    Dec 23, 2017
    Messages:
    701
    Location:
    /opt
    This is awesome, can't wait to try it. Thank for all your hard work @thelonelycoder!
     
  6. Jack Yaz

    Jack Yaz Very Senior Member

    Joined:
    Apr 20, 2017
    Messages:
    1,245
    Yay new software! Looking good so far - need to merge back some of my jffs scripts though (it did warn me :) )

    EDIT: example, it wiped the services-start file completely! All restored now, now to push some adblocking test goodness
     
    Last edited: Aug 25, 2018
    thelonelycoder likes this.
  7. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    It merges the commonly used scripts around here. Those that amtm supports.
    For all the funky other stuff that some people paste into the jffs/scripts directory I have no patience to merge when coming from AB-Solution 3.11.x.
    Diversion 4.0 can handle it though...
     
  8. Jack Yaz

    Jack Yaz Very Senior Member

    Joined:
    Apr 20, 2017
    Messages:
    1,245
    Makes sense. Installer backed it up to entware usb so all good, I run my own strict backups/changelogs too since I have to dabble :)

    If I need to make changes, does Diversion check for edits like AB-S and re-apply? i.e. anything I should specifically not do to cause conflicts?

    Thanks for the new release :)
     
    Vexira likes this.
  9. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    Diversion uses one-liners to hook itself into the start scripts, for example /jffs/scripts/post-mount:
    Code:
    . /jffs/scripts/post-mount.div # Added by Diversion
    This sources the new /jffs/scripts/post-mount.div that starts Entware, no matter whether that device has a label or changes its name for some reason.

    If something goes haywire, just run d and Re-Install (does this from local files) or Update Diversion (fetches all new files from remote).
    Both ways fix it as all used files are locally stored on your router.

    The Diversion files are at /opt/share/diversion, while the dnsmasq log files are at /opt/var/log
     
  10. Jack Yaz

    Jack Yaz Very Senior Member

    Joined:
    Apr 20, 2017
    Messages:
    1,245
    Cheers!
     
  11. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    Sorry about the minimal Diversion website. For now this old-old AB-Solution website snapshot will have to do.
    You all have what you wanted. And I'm glad Diversion is out.
     
    Evictoria, skeal and Jack Yaz like this.
  12. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    I like the Merriam Webster No. 2 definition of diversion best:
     
    skeal likes this.
  13. Protik

    Protik Senior Member

    Joined:
    Oct 31, 2017
    Messages:
    214
    Location:
    /boot
    Thanks @thelonelycoder for the update.

    Unfortunately, the update did not work for me. I have been using a test version of pixelserv-tls v2.1.3-test.4 for a while. It seems while upgrading 3.11.2, the Diversion installer fails to install pixelserv-tls. The error it shows is:

    Code:
      i  Checking white and blacklists
      ✔  Whitelist
      ✔  Blacklist
      ✔  Wildcard blacklist created
    
      i  Probing for pixelserv-tls
      i  Installing pixelserv-tls
    
    Downloading http://bin.entware.net/armv7sf-k2.6/Packages.gz
    Updated list of available packages in /opt/var/opkg-lists/entware
    Collected errors:
     * opkg_download_pkg: Package pixelserv-tls is not available from any configured src.
     * opkg_install_pkg: Failed to download pixelserv-tls. Perhaps you need to run 'opkg update'?
     * opkg_install_cmd: Cannot install package pixelserv-tls.
    Installing pixelserv-tls (V35.HZ12.Kk-1) to root...
        ____  _                    _
       |  _ \(_)_   _____ _ __ ___(_) ___  _ __
       | | | | \ \ / / _ \ '__/ __| |/ _ \| '_ \
       | |_| | |\ V /  __/ |  \__ \ | (_) | | | |
       |____/|_| \_/ \___|_|  |___/_|\___/|_| |_|
     
     This is Diversion 4.0      coded by thelonelycoder
    ----------------------------------------------------
    
     Welcome to Diversion - the Router Adblocker!
    
     Diversion is not installed on this router...
    ____________________________________________________
    
     [ Error ] pixelserv-tls install failed.
    
     Install it now? [1=Yes e=Exit] 1
    
    
    I tried running the installer again, now it starts the process and does not recognize the earlier Ab-Solution. I guess because during the first attempt, all files were wiped out.
     
  14. jrmwvu04

    jrmwvu04 Senior Member

    Joined:
    Mar 29, 2016
    Messages:
    469
    Location:
    United States
    Congrats @thelonelycoder - I don’t use it, but it is clear a lot of people do. And the screenshots are pretty which I do appreciate.
     
    thelonelycoder likes this.
  15. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    There was no need to re-Install since you used a very recent version.
    Did you port or install new when given the option?
     
  16. Protik

    Protik Senior Member

    Joined:
    Oct 31, 2017
    Messages:
    214
    Location:
    /boot
    I did port. The full stack trace:

    Code:
    [email protected]:/tmp/home/root# /usr/sbin/curl -Os https://diversion.ch/install && sh install
        ____  _                    _
       |  _ \(_)_   _____ _ __ ___(_) ___  _ __
       | | | | \ \ / / _ \ '__/ __| |/ _ \| '_ \
       | |_| | |\ V /  __/ |  \__ \ | (_) | | | |
       |____/|_| \_/ \___|_|  |___/_|\___/|_| |_|
     
     This is Diversion 4.0      coded by thelonelycoder
    ----------------------------------------------------
    
     Welcome to Diversion - the Router Adblocker!
    
     Diversion is not installed on this router...
    ____________________________________________________
    
     Install it now? [1=Yes e=Exit] 1
    
     [ i ] Getting latest installer file
     [ ✔ ] install.div         integrated
    
     [ i ] Checking router
     [ ✔ ] Asuswrt-Merlin
     [ ✔ ] dos2unix
     [ ✔ ] Netstat
     [ ✔ ] Compatible device(s)
     [ ✔ ] Internet
     [ i ] Router check complete
    ____________________________________________________
    
      !  AB-Solution 3.11.2 installation found
         at /tmp/mnt/pdas001/adblocking
    
     1. Port to Diversion 4.0 (highly recommended)
        Keep AB-Solution 3.11.2 settings
     2. Install Diversion 4.0
        Discard AB-Solution 3.11.2 settings
    
     Enter your selection [1=Port 2=New] 1
    
      i  Porting AB-Solution 3.11.2 to Diversion 4.0 Standard
    
      i  Probing for Entware
      ✔  Entware is already installed
    
      ✔  Diversion directory structure created
         at  /opt/share/diversion
    
      i  Stopping AB-Solution 3.11.2
      ✔  Old cron jobs deleted
    
     Checking pixelserv-tls (AB-Solution)...              alive.
     Shutting down pixelserv-tls...              done.
    
      ✔  pixelserv-tls stopped
      ✔  Old start scripts cleaned
      i  AB-Solution 3.11.2 stopped
    
      i  Porting AB-Solution 3.11.2 files and settings
      ✔  White and blacklist ported
      ✔  Shared whitelist ported
      ✔  Blocking file ported
      ✔  Email settings ported
      ✔  Pixelserv switches file ported
      ✔  Client names backup file ported
      ✔  Stats file(s) ported
      ✔  shooter40sw hosts list ported
      ✔  Blocking list settings ported
      ✔  Ad-blocking stats ported
      ✔  Dnsmasq log files ported
      ✔  Communication settings ported
      i  Porting of AB-Solution 3.11.2 complete
    
      i  Installing Diversion 4.0 Standard
    
      i  Getting Diversion Standard files from
         https://diversion.ch/diversion/4.0
      ✔  backup.div          integrated
      ✔  functions.div       integrated
      ✔  install.div         integrated
      ✔  post-conf.div       integrated
      ✔  post-mount.div      integrated
      ✔  rc.func.div         integrated
      ✔  rotate-logs.div     integrated
      ✔  stats.div           integrated
      ✔  S80pixelserv-tls    integrated
      ✔  theme.div           integrated
      ✔  update.div          integrated
      ✔  update-bf.div       integrated
      ✔  update-notification integrated
      ✔  write-config.div    integrated
    
      i  Checking white and blacklists
      ✔  Whitelist
      ✔  Blacklist
      ✔  Wildcard blacklist created
    
      i  Probing for pixelserv-tls
      i  Installing pixelserv-tls
    
    Downloading http://bin.entware.net/armv7sf-k2.6/Packages.gz
    Updated list of available packages in /opt/var/opkg-lists/entware
    Collected errors:
     * opkg_download_pkg: Package pixelserv-tls is not available from any configured src.
     * opkg_install_pkg: Failed to download pixelserv-tls. Perhaps you need to run 'opkg update'?
     * opkg_install_cmd: Cannot install package pixelserv-tls.
    Installing pixelserv-tls (V35.HZ12.Kk-1) to root...
        ____  _                    _
       |  _ \(_)_   _____ _ __ ___(_) ___  _ __
       | | | | \ \ / / _ \ '__/ __| |/ _ \| '_ \
       | |_| | |\ V /  __/ |  \__ \ | (_) | | | |
       |____/|_| \_/ \___|_|  |___/_|\___/|_| |_|
     
     This is Diversion 4.0      coded by thelonelycoder
    ----------------------------------------------------
    
     Welcome to Diversion - the Router Adblocker!
    
     Diversion is not installed on this router...
    ____________________________________________________
    
     [ Error ] pixelserv-tls install failed.
     
  17. Protik

    Protik Senior Member

    Joined:
    Oct 31, 2017
    Messages:
    214
    Location:
    /boot
    There has been a lot going on within pixelserv-tls. As per @kvic 's suggestion a few people have been doing a lot of tinkering to optimize the test versions. I guess it's best not to tinker with pixelser-tls if a test version is running.
     
  18. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    Whats your output of:
    Code:
    opkg list-installed | grep pixelserv-tls
     
  19. Protik

    Protik Senior Member

    Joined:
    Oct 31, 2017
    Messages:
    214
    Location:
    /boot
    I get nothing,

    Code:
    [email protected]:/tmp/home/root# opkg list-installed | grep pixelserv-tls
    [email protected]:/tmp/home/root#
    
     
  20. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    If you have the beta version installed through amtm or @kvic installer then it should have worked.
    I tested that extensively on my ARM and MIPS routers.
     
  21. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,626
    Location:
    Switzerland
    Code:
    opkg list-installed | grep pixelserv
     
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!