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

    skeal Part of the Furniture

    Joined:
    Apr 30, 2016
    Messages:
    3,923
    Location:
    Riderville, SK
    Observation: Hey @thelonelycoder, is my memory usage down because this version uses less, or is it a placebo indication?
     
  2. dugaduga

    dugaduga Senior Member

    Joined:
    May 12, 2018
    Messages:
    278
    Tried porting, it hung while porting settings, and messed up the internet connection; was unable to connect to the net to re-install ab-solution or diversion. Had to back up from an outdated 2 month old jffs backup! make sure you back up your jffs before running the port! I thought about it but failed to do so thinking everything would go smoothly.
     
  3. tomsk

    tomsk Very Senior Member

    Joined:
    Sep 3, 2016
    Messages:
    777
    Ported AB to Diversion with no issues ... Shooters blacklist converted to custom and + settings intact. thanks for the extra dnsmasq logging :)

    [​IMG]
     
  4. dugaduga

    dugaduga Senior Member

    Joined:
    May 12, 2018
    Messages:
    278
    I backed up my buggered jffs folder before restoring an outdated one, what files should I merge from the old one to keep the most recent backup functional?

    got this far:

    ✔ pixelserv-tls stopped
    ✔ Old start scripts cleaned
     
    Last edited: Aug 26, 2018
  5. Same here unfortunately. All outgoing queries were blocked and it hung on 'Porting all settings....' (or something alike) all night. Decided to start fresh with a different USB drive. If there's anything I can supply to troubleshoot this, let me know.
     
    Last edited by a moderator: Aug 26, 2018
  6. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    It should return to amtm.
    I'll take it from there. For now this only option will have to do.
    The Diversion code has not a single line in common with the AB-Solution code. It was a lot of work and I had to cut corners here and there to get where I am now. Features will be simpler to add in Diversion than in the AB-Solution code.
     
  7. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    I can't replicate your problem with pixelserv-tls. My best guess is you run a very old Entware version on your router.
    Try to update opkg to the new Entware repo (formerly known as Entware-NG).
    All installations I did with beta versions of pixelserv-tls installed run as smooth as I intended through the Diversion installer.

    If you manage to install Diversion, just copy over your saved files in /diversion/list to /opt/share/diversion/list.
    Only copy these: blacklist, whitelist and maybe hostslist (with the ported hosts lists from AB3).
    The ps switches file goes into /opt/share/diversion/.conf
     
    Protik likes this.
  8. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    All install, reinstall and update operations in Diversion write a log file to /opt/share/diversion/log, it can be viewed in sf.
    If you have a backup of that directory from the failed update it might help track it down.
     
  9. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    Right after 'Old start scripts cleaned' Diversion restarts Dnsmasq to unload entries in dnsmasq.conf.
    You may have some exotic entries in /jffs/scripts/dnsmasq.postconf that prevent Dnsmasq from restarting.
     
  10. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    Placebo or you use a smaller blocking file.
     
    skeal likes this.
  11. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    You're welcome. Good to know the extra coding for log-queries=extra was worth the time.
     
  12. Okay. First I have to get to things up and running again (Diversion installed fine btw, using a clean install on another thumb drive). I'll get the log file from the old drive when done.
     
    thelonelycoder likes this.
  13. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    The contents of your /jffs/scripts/ directory before the update would also be of interest. Backups are stored in a folder called /old-jffs_scripts on the device.
     
  14. dugaduga

    dugaduga Senior Member

    Joined:
    May 12, 2018
    Messages:
    278
    Nevermind I manually went through each file and copied them. So I tried updating again, it hangs while porting settings and blocklists... zero cpu use as well. Didn't wait longer than 10 minutes for completion. How long should this take? Was hoping to keep the stats, but if necessary hopefully a clean install will be fine last restort..

    @thelonelycoder I noticed Diversion removes all custom lines from /scripts/dnsmasq.postconf settings. Why is that? Is diversion trying to connect to the internet immediately after that during the porting phase? How can I install Diversion with these custom dnsmasq settings? Should I input them manually again and restart dnsmasq manually while it says 'porting'? The internet connectivity issue persists after reboot.
     
    Last edited: Aug 26, 2018
  15. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    Post your entries in that file. If it catches a certain string it will remove it and port commonly used script entries back into a new file, along with the source link for the Diversion directives.
     
  16. dugaduga

    dugaduga Senior Member

    Joined:
    May 12, 2018
    Messages:
    278
    Updated previous post, i see the folders under /opt/share/diversion but all are empty. Would it not be better if the installer only removed entries related to absolution? Also, because connectivity issues persist on reboot, I'm confused; it should be fine with a default postconf. something i'll have to look further into when no body is using the connection, I can see if I can get dnsmasq running manually;

    it is important to know if Diversion connects to the internet immediately after attempting to restart dnsmasq.

    Code:
    #!/bin/sh
    
    [ -x /jffs/dnscrypt/manager ] && /jffs/dnscrypt/manager dnsmasq
    
    # DO NOT EDIT this part of the file #
    # generated by AB-Solution 3.11
    if [ -d "/tmp/mnt/psda1" ];then
        source /tmp/mnt/psda1/adblocking/scripts/ab_dnsmasq_postconf.sh
        logger "AB-Solution linked ab_dnsmasq_postconf.sh via $0"
    fi
    # end of DO NOT EDIT #
    
    ###########################################################
    ####   Block PTR on localhost, allow PTR for clients   ####
    ###########################################################
    
    CONFIG=$1
    source /usr/sbin/helper.sh
    sed -i '$a\ ' $CONFIG
    sed -i '$a\###############################################' $CONFIG
    sed -i '$a\#Block PTR on localhost, allow PTR for clients#' $CONFIG
    sed -i '$a\###############################################' $CONFIG
    sed -i '$a\ ' $CONFIG
    sed -i '$a\####################################' $CONFIG
    sed -i '$a\#May Speed up Browsing Considerably#' $CONFIG
    sed -i '$a\####################################' $CONFIG
    sed -i '$a\ ' $CONFIG
    
    #pc_append "server=/in-addr.arpa/" $CONFIG
    #pc_append "server=/ip6.arpa/" $CONFIG
    #pc_append "server=/168.192.in-addr.arpa/" $CONFIG
    #(seems to boot somewhat faster with this not blocked, ntp didn't take as long either)
    #pc_append "server=/127.in-addr.arpa/" $CONFIG
    #(was error in pixelserv with this disabled, + NTP issues)
    #pc_append "server=/255.in-addr.arpa/" $CONFIG
    #pc_append "server=/0.in-addr.arpa/" $CONFIG
    pc_append "address=/telem/192.168.50.2" $CONFIG
    pc_append "address=/lytics/192.168.50.2" $CONFIG
    #pc_append "dnssec-check-unsigned" $CONFIG
    
    #pc_append "local=/in-addr.arpa/" $CONFIG
    #pc_delete "dnssec-no-timecheck" $CONFIG
    #pc_append "server=/168.192.in-addr.arpa/#" $CONFIG
    sed -i '$a\#Experimental, Disable all Arpa: https://www.iana.org/domains/arpa' $CONFIG
    pc_append "server=/arpa/" $CONFIG
    pc_append "bogus-priv" $CONFIG
    pc_append "bogus-nxdomain=64.94.110.11" $CONFIG
    #pc_append "server=/192.168.50.52.in-addr.arpa/#" $CONFIG 
     
    Last edited: Aug 26, 2018
  17. dugaduga

    dugaduga Senior Member

    Joined:
    May 12, 2018
    Messages:
    278
    Also your install script replaces

    Code:
    #!/bin/sh
    sh /jffs/scripts/firewall save # Skynet Firewall Addition
    
    # DO NOT EDIT this part of the file #
    # generated by AB-Solution 3.11
    /opt/etc/init.d/rc.unslung stop
    # end of DO NOT EDIT #
    
    [ -x /jffs/dnscrypt/manager ] && /jffs/dnscrypt/manager services-stop
    
    with

    Code:
    #!/bin/sh
    sh /jffs/scripts/firewall save # Skynet Firewall Addition
    
    under services-stop

    while similar code is successfully maintained in wan-start with absolution entries removed. This is all the code that is left.

    Code:
    #!/bin/sh
    [ -x /jffs/dnscrypt/manager ] && /jffs/dnscrypt/manager wan-start
    
    original wan-start code:

    Code:
    #!/bin/sh
    
    [ -x /jffs/dnscrypt/manager ] && /jffs/dnscrypt/manager wan-start
    
    # DO NOT EDIT this part of the file #
    # generated by AB-Solution 3.11
    psState=on
    if [ $psState == "on" ];then
        ifconfig br0:pixelserv 192.168.50.2 up
        logger "AB-Solution created br0:pixelserv 192.168.50.2 via $0"
    fi
    # end of DO NOT EDIT #
    
     
    Last edited: Aug 26, 2018
  18. XIII

    XIII Very Senior Member

    Joined:
    Feb 27, 2014
    Messages:
    1,146
    Congratulations with this release!

    Looking forward to play with it later today.
     
    dugaduga likes this.
  19. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    6,983
    Location:
    Switzerland
    I have to break with the old AB-Solution code in jffs to conform to the new standard. The time is now and I am unable to come up with code that would remove AB code in jffs selectively. There is just too much of it and in non-consistent form there.
    I have to move on. You will have to do the same.

    The new jffs standard Diversion and Skynet use was discussed here:
    https://www.snbforums.com/threads/t...tion-for-better-environment-management.39176/
     
    dugaduga likes this.
  20. dugaduga

    dugaduga Senior Member

    Joined:
    May 12, 2018
    Messages:
    278
    Understandable. Re-importing the code manually is really not a big deal. Just curious why it hangs while porting, does it get stuck trying connect to the internet immediately after restarting dnsmasq during the porting phase?