GithubHelp home page GithubHelp logo

john123951 / adblockplus-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arulrajnet/adblockplus-server

0.0 2.0 0.0 1 MB

Centralized adblock plus for your home / office with privoxy proxy server.

License: MIT License

Nginx 12.44% Shell 87.56%

adblockplus-server's Introduction

Adblock Plus Server

Centralized adblock plus for your home / office. So all kind of advertisement blocked in one place. No need to install extensions in your Desktop, Laptop, Tablet, Smartphone etc.,

Run the below docker in any one of machine in your network.

docker run -d --restart=always --cap-add=NET_ADMIN \
-p 8118:8118 \
--name adblock john123951/adblockplus-server-china:latest

Then add this as proxy server in all other system. For ex 192.168.0.10:8118

Guide to Setup Proxy

Forward Proxy

In that way you have to manually configure proxy in each every client. For examble to set up proxy in below browser.

In this method client must know proxy details.

Alt

Note: There is no gureentee App in your smartphone also follow the proxy which is set in your browser. Refer this Stackoverflow thread

Transparent Proxy

In this client does not aware of proxy is there in between. So you no need to configure proxy in all client.

Alt

In this you have to route traffic from WiFi router to proxy server then reach the internet.

Note : HTTPS traffic can't be routed via proxy. Refer Man in the Middle Attack

How I have used in my Home

In my home I used transparent proxy.

Here is my setup

  • Ubuntu 14.04
  • Internet on Eth0 port (My ISP giving direct fibre connection)
  • WiFi Hotspot in wlan0. Refer setup wifi hotspot ubuntu

Alt

Install Docker

curl -sSL https://get.docker.com/ | sh

Then run privoxy adblock as container

docker run -d --restart=always --cap-add=NET_ADMIN \
    -p 8118:8118 \
    --name adblock arulrajnet/adblockplus-server:latest

Copy the below text and save as file /etc/network/if-up.d/adblockplus-privoxy

#! /bin/bash
# Add iptables rule to NAT port 80 traffic to docker0:8118(Privoxy port). 

set -e

DOCKER0_IP=$(ifconfig docker0 | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')

# IPtables rule
iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j DNAT --to $DOCKER0_IP:8118

Make that as executable

sudo chmod +x /etc/network/if-up.d/adblockplus-privoxy
  • Now restart your machine.
  • Connect to wifi hotspot from your smartphone.
  • all your HTTP ads are blocked without any app / extra settings in your phone.

Roadmap

  • block HTTPS ads
    • DNS lookup
  • PixelServ for blocked pages
  • evaluate squid-cache

Misc

To build this container.

docker build -t $USER/adblockplus-server:latest .

IP Tables

iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j DNAT --to 172.17.0.1:8118

http://serverfault.com/questions/167233/iptables-https-transparent-proxy-with-privoxy

you can't just forward 443 traffic. Because its the MAN IN THE MIDDLE attack. Better use DHCP with auto-detect proxy.

Reference

https://github.com/RMerl/asuswrt-merlin/wiki/How-to-use-Adblock-Plus-filter-subscriptions-to-provide-advertisement-filtering-to-devices

https://github.com/evaryont/bin/blob/master/adblock-to-privoxy

https://github.com/StevenBlack/hosts/blob/master/updateHostsFile.py

License

MIT License.

Author

follow
@arulrajnet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.