bind: Add option to block ads
This PR add DNS-based ad blocking, based on the instructions at https://charlieharvey.org.uk/page/adblocking_with_bind_apache.
When enabled, it fetches a list of ad servers from pgl.yoyo.org. Later we may want to offer several lists that the user can choose from, and allow the list to be download over Tor.
Merge request reports
Activity
173 179 conf_file.close() 174 180 175 181 182 def set_adblock(choice): 183 """Enable or disable ad blocking.""" 184 data = [line.strip() for line in open(CONFIG_FILE, 'r')] 185 if choice == 'true': 186 # serve a single pixel gif for blocked domains 187 action_utils.webserver_enable('adblock-plinth') 188 189 # fetch ad server list Created by: JosephKiranBabu
Instead of using a single list, how about using a list aggregated from a lot of sources, like in this Github repo. https://github.com/StevenBlack/hosts
The list at pgl.yoyo.org has 2324 entries while the aggregated one has close to 40,000 entries. See the sample list here. https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
173 179 conf_file.close() 174 180 175 181 182 def set_adblock(choice): 183 """Enable or disable ad blocking.""" 184 data = [line.strip() for line in open(CONFIG_FILE, 'r')] 185 if choice == 'true': 186 # serve a single pixel gif for blocked domains 187 action_utils.webserver_enable('adblock-plinth') 188 189 # fetch ad server list Created by: Skjold
Adblock2Privoxy can perform element blocking with CSS using standard Adblock lists through Privoxy and Apache and has a .deb package available. Not sure yet how to integrate it, though.