{"id":766,"date":"2013-12-27T23:10:10","date_gmt":"2013-12-27T22:10:10","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=766"},"modified":"2013-12-30T18:22:39","modified_gmt":"2013-12-30T17:22:39","slug":"ds210j-and-squid","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=766","title":{"rendered":"Synology DS210j and SQUID"},"content":{"rendered":"<p>For a while, I was (very) upset with ads on my tablets (android and ipad).<br \/>\nAnd unlike browsers on my windows (firefox or chrome) I could not find something like adblock for ipad.<\/p>\n<p>Therefore I decided to setup a squid on my synology ds210j and to setup an adblock like in squid.<br \/>\nAnd success, no more nasty popups, quicker web sites, etc \ud83d\ude42<\/p>\n<p>the steps:<\/p>\n<p>-install ipkg (see <a href=\"http:\/\/korben.info\/installer-ipkg-sur-synology.html\">here <\/a>for an how to, in french sorry).<br \/>\n-install squid : ipkg install squid<br \/>\n-customize squid.conf<br \/>\n-use a list of domain you wish to block (i used a list from this <a href=\"http:\/\/pgl.yoyo.org\/as\/\" target=\"_blank\">site<\/a>)<\/p>\n<p>my list of blocked domains : <a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2013\/12\/denied_domains.txt\">denied_domains<\/a><\/p>\n<p>my squid.conf<br \/>\n<code><br \/>\nnegative_dns_ttl 10 second<br \/>\nconnect_timeout 60 second<br \/>\nread_timeout 60 second<br \/>\nrequest_timeout 60 second<br \/>\ncache_dir ufs \/opt\/var\/squid\/cache 512 16 256<br \/>\ncache_access_log \/opt\/var\/squid\/logs\/access.log<br \/>\ncache_log \/opt\/var\/squid\/logs\/debug<br \/>\ncache_store_log \/opt\/var\/squid\/logs\/storage<br \/>\nacl all src all<br \/>\nacl manager proto cache_object<br \/>\nacl localhost         src         127.0.0.1\/32<br \/>\nacl to_localhost     dst         127.0.0.0\/8 0.0.0.0\/32<\/p>\n<p>acl localnet src 192.168.1.0\/24<\/p>\n<p>#on which ports do we allow connections using the proxy<br \/>\nacl SSL_ports port 443        # https<br \/>\nacl Safe_ports port 80        # http<br \/>\nacl Safe_ports port 21        # ftp<br \/>\nacl Safe_ports port 443        # https<br \/>\nacl purge method PURGE<br \/>\nacl CONNECT method CONNECT<br \/>\n#acl url_ads url_regex \"\/opt\/etc\/squid\/denied_ads.txt\"<br \/>\nacl denied_domains dstdomain \"\/opt\/etc\/squid\/denied_domains.txt\"<\/p>\n<p>#http_access deny url_ads<br \/>\nhttp_access deny denied_domains<br \/>\nhttp_access allow localnet<br \/>\nhttp_access allow manager localhost<br \/>\nhttp_access deny manager<br \/>\nhttp_access deny !Safe_ports<br \/>\nhttp_access deny CONNECT !SSL_ports<br \/>\nhttp_access allow localhost<br \/>\nhttp_access deny all<br \/>\nmiss_access allow all<\/p>\n<p>http_port 8080<\/p>\n<p>via off<br \/>\nforwarded_for off<br \/>\nheader_access From deny all<br \/>\nheader_access Server deny all<br \/>\nheader_access WWW-Authenticate deny all<br \/>\nheader_access Link deny all<br \/>\nheader_access Cache-Control deny all<br \/>\nheader_access Proxy-Connection deny all<br \/>\nheader_access X-Cache deny all<br \/>\nheader_access X-Cache-Lookup deny all<br \/>\nheader_access Via deny all<br \/>\nheader_access Forwarded-For deny all<br \/>\nheader_access X-Forwarded-For deny all<br \/>\nheader_access Pragma deny all<br \/>\nheader_access Keep-Alive deny all<br \/>\n<\/code><\/p>\n<p>note : you can use the dns_nameservers directive in squid.conf to use specific dns servers (i use opendns).<br \/>\nnote : you can set a vpn client on your synology and your proxy will then use a different network (i use vyrvpn from giganews)<br \/>\nnote : you can tweak your dhcp server to set the proxy for your clients automatically (see <a href=\"http:\/\/www.ingmarverheij.com\/configuring-proxy-server-on-a-synology-nas\/\" target=\"_blank\">here<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a while, I was (very) upset with ads on my tablets (android and ipad). And unlike browsers on my windows (firefox or chrome) I could not find something like adblock for ipad. Therefore I decided to setup a squid on my synology ds210j and to setup an adblock like in squid. And success, no <a href='https:\/\/labalec.fr\/erwan\/?p=766' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-766","post","type-post","status-publish","format-standard","hentry","category-synology","category-36-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=766"}],"version-history":[{"count":4,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/766\/revisions"}],"predecessor-version":[{"id":771,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/766\/revisions\/771"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}