Site Tools


advanced-adblock

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
advanced-adblock [2022/06/11 13:52] rs232advanced-adblock [2023/01/06 17:18] rs232
Line 1: Line 1:
-====== Adblock ======+====== Adblock v2 ====== 
 + 
 +As an evolution of the original adblock script, v2 comes with a rich feature-set and improved interaction capabilities. 
 + 
 +===== Functionality ===== 
 + 
 +Adblock can accept different format of lists (always plain text) extracting the domains from files in different layout (v1 required the "0.0.0.0 domain.com" format). checkList(), checkRam(), safeDnsmasqRestart() are routines to assure lists can be handled by the router (in terms of capacity) and other secondary issues are spotted like syntax errors, etc. Adblock is essentially self-diagnosing self-caring the most common issues. The script can be operated via command line and the best startin point is adblock help which produces the following output. adblock status is another way to monitor the script behaviour without using the GUI. 
 + 
 +==== Logging ==== 
 + 
 +The new GUI allows you to set up the maximum loglevel to be generated by the script. In an attempt to make the log messages more intuitive/meaningful emoji are occasionally used. The supported error levels are 0,3,4,5,6,7. While on 7 additional debugging files are produced by the script and saved in /tmp 
 + 
 +==== Filter-file size limit ==== 
 + 
 +It's calculated automatically by the router and given a best practice acceptable limit to enable/download lists keeping an eye on the amount of data we're asking the router to handle. The limit can be adjusted manually if needed but it *might* become a source of instability if resources are tight. There are too many models or router to test this individually so a common sense 10% of Installed RAM has been picked up as the default value. 
 + 
 +Custom path - It is now possible to specify an option filesystem path where the script can store the files. Defining the path changes the way the script works and enables some additional functionality. This essentially allows to store lists, their http headers and the actual compiled blockfile on external storage (e.g. USB) offloading demand on the RAM and allowing for information to survive a reboot. This is particularly functional when the script is re-run (manually or automatically) and there are no updated lists, in this case the execution is cut short to save time/resources. When custom path is defined adblock will first download all the headers of the enabled lists only, then it'll compare them with the stored one locally and a decision if a full run is needed or not. For completeness a second check is also performed on the content of the nvram variables so this should read, if the config wasn't changed and no updated lists are available, then don't update and carry on running. 
 + 
 +==== Black lists ==== 
 + 
 +The well know table where lists are defined now also accepts a new format called list-of-lists, this essentially consists in feeding the script with a URL where a list of additional URL can be found instead of the traditional blocklist we already know. To be mentioned list-of-lists is an excellent way to save NVRAM space however is comes with some minor limitation e.g. the verification of the lists to decide if they need to be downloaded or less is not performed. So essentially this is either: 
 + 
 +''URL |--> list'' or ''URL |--> list-of-lists-file |--> URL |--> list                             |--> URL |--> List                             |--> URL |--> List                             |--> URL |--> List'' The script handles the EOL of files in an automatic way and converts it internally if needed. 
 + 
 +==== Custom blacklisting ==== 
 + 
 +Here a range of syntax are accepted - standard domain (one per line) - a path to a file where the domains are defined (e.g. /mnt/sda1/blacklist.txt) - a domain prepended with a + e.g. +example.com will blacklist the domain but also prune any subdomain found in the configuration/blockfile - list-of-lists too ??? 
 + 
 +==== Whitelisting ==== 
 + 
 +- standard domain (one per line) - a path to a file where the domains are defined (e.g. /mnt/sda1/whitelist.txt) - a domain prepended with a % will make it "strict" whitelisting. This means that the domain itself is to be resolved normally where any defined subdomain is to be blocked instead. - list-of-lists too ??? 
 + 
 +==== Troubleshooting ==== 
 + 
 +The GUI integration with adblock provides already some crucial details to understand if the script is operating correctly or not. 
 + 
 +====== Adblock v1 ======
  
 The Adblock menu contains settings to configure FreshTomato's built-in ad blocker. The page is divided into sections. These sections include: Adblock Settings, Blacklist URL, Blacklist Custom and Whitelist. The Adblock menu contains settings to configure FreshTomato's built-in ad blocker. The page is divided into sections. These sections include: Adblock Settings, Blacklist URL, Blacklist Custom and Whitelist.
Line 6: Line 42:
  If only elements are blocked, it's likely the page will load without error -- uncluttered.  If only elements are blocked, it's likely the page will load without error -- uncluttered.
 )) ))
- 
  
 For Adblock to work properly, client devices **must be configured** to use FreshTomato's IP address (dnsmasq) as their DNS server. This can be done either by static IP configuration (on the device itself) or through FreshTomato's DHCP Service. For the latter method you would first enable DHCP under Basic/[[network|Network]]. To enable the actual DNS server, select "Use internal DNS" under Advanced/[[dhcp_dns|DHCP/DNS]]. These two steps are mandatory, as clients bypassing FreshTomato's DNS server will not have their ads blocked. For Adblock to work properly, client devices **must be configured** to use FreshTomato's IP address (dnsmasq) as their DNS server. This can be done either by static IP configuration (on the device itself) or through FreshTomato's DHCP Service. For the latter method you would first enable DHCP under Basic/[[network|Network]]. To enable the actual DNS server, select "Use internal DNS" under Advanced/[[dhcp_dns|DHCP/DNS]]. These two steps are mandatory, as clients bypassing FreshTomato's DNS server will not have their ads blocked.
Line 17: Line 52:
  
 Warning: FreshTomato's built-in Adblock function is separate from the ad blocking scripts seen on the Web pasted into FreshTomato's custom script window. If you also use one of those, and enable FreshTomato's built-in ad blocker, conflicts and problems may happen. Choose and enable //one// but not both at the same time. Warning: FreshTomato's built-in Adblock function is separate from the ad blocking scripts seen on the Web pasted into FreshTomato's custom script window. If you also use one of those, and enable FreshTomato's built-in ad blocker, conflicts and problems may happen. Choose and enable //one// but not both at the same time.
- 
  
 ===== Adblock Settings ===== ===== Adblock Settings =====
Line 48: Line 82:
  
 An Autoupdate function will launch randomly every day between 2:00AM and 2:59 to download the most up-to-date Blacklists from the URLs in the list. An Autoupdate function will launch randomly every day between 2:00AM and 2:59 to download the most up-to-date Blacklists from the URLs in the list.
- 
  
 ===== Custom Blacklist ===== ===== Custom Blacklist =====
Line 72: Line 105:
 There are a few sites available out there that allow you to test the effectiveness of your adblock configuration, when doing so please make sure you don't have any adblock/script-block plugin enabled on your browser. Some examples of adblock testing sites: There are a few sites available out there that allow you to test the effectiveness of your adblock configuration, when doing so please make sure you don't have any adblock/script-block plugin enabled on your browser. Some examples of adblock testing sites:
  
-  * https://d3ward.github.io/toolz/adblock.html +  * [[https://d3ward.github.io/toolz/adblock.html]] 
-  * https://adblock-tester.com/+  * [[https://adblock-tester.com/]]
  
 **Adblock doesn't work with DoH and other Encrypted DNS lookups** **Adblock doesn't work with DoH and other Encrypted DNS lookups**
Line 81: Line 114:
 As mentioned earlier, enabling the "DoH Server" List may remedy this problem. As mentioned earlier, enabling the "DoH Server" List may remedy this problem.
  
-**IOS**+**IOS for paid iCloud service only**
  
 On the "client autonomy" topic it is to be noted that IOS devices have some settings that can potentially interfere with the adblock operations. The option "Limit Address Tracking" can be disabled on a WLAN basis as per image here below: On the "client autonomy" topic it is to be noted that IOS devices have some settings that can potentially interfere with the adblock operations. The option "Limit Address Tracking" can be disabled on a WLAN basis as per image here below:
Line 87: Line 120:
 {{:pasted:20220611-134207.png}} {{:pasted:20220611-134207.png}}
  
-or to have this disabled globally look for "Private Relay" which is btw only available for paid iCloud service only+or to have this disabled globally look for "Private Relay" 
 + 
 +{{:pasted:20220611-144641.png}} 
 + 
 +Considering you might connect to different WLANs with your mobile/handset/laptop at different sites/locations it does somehow make more sense to disable it on a WLAN basis regardless, leaving it off specifically where your connection is provided by FreshTomato with adblock running. Once again, these two options above are only available if you are a paid iCloud customer.
  
-{{:pasted:20220611-134340.png}} 
  
-Considering you might connect to different WLANs with your mobile/handset/laptop at different sites/locations it does somehow make more sense to disable it on a WLAN basis regardless, leaving it off specifically where your connection is provided by FreshTomato with adblock running. 
advanced-adblock.txt · Last modified: 2023/08/13 17:03 by hogwild