hblock icon indicating copy to clipboard operation
hblock copied to clipboard

How to add blocklist like * .tar.gz

Open Elimelech opened this issue 2 years ago • 4 comments

Hi! How to download files like archives, for example: dsi.ut-capitole.fr/blacklists/download/phishing.tar.gz

Elimelech avatar Jan 10 '22 20:01 Elimelech

Currently hBlock only supports plain text lists, adding support for compressed lists is not a priority for me right now, but I leave this issue open in case I implement it in the future.

hectorm avatar Jan 11 '22 19:01 hectorm

#!/bin/sh

I wrote a simple script:

export DISPLAY=:0.0;

su luba -c "notify-send 'Attention!' 'update deny.list'"; sleep 3 cd /tmp mkdir /hblock curl -o /tmp/hblock/phishing.tar.gz 'http://dsi.ut-capitole.fr/blacklists/download/phishing.tar.gz' ; cd /tmp/hblock/ tar -xvzf /tmp/hblock/phishing.tar.gz ; mv -f /tmp/hblock/phishing/domains /etc/hblock/deny.list; chmod 644 /etc/hblock/deny.list;

Elimelech avatar Jan 11 '22 21:01 Elimelech

Based on your use case you can also make this one-liner:

curl -fsSL 'https://dsi.ut-capitole.fr/blacklists/download/phishing.tar.gz' | tar -xzO 'phishing/domains' | hblock -D-

hectorm avatar Jan 14 '22 16:01 hectorm

https://dsi.ut-capitole.fr/blacklists

I am not a coder, so excuse my question here, but do help if you can pls.

  1. The above line, how does it get implemented/added/appended in the final hblock output?
  2. The site: https://dsi.ut-capitole.fr/blacklists/ has several nice blocklists, and I would like to add these to my list.
  3. Any idea also of how to get it to download daily and update the actual hosts output via a cron job? (download, extract, and proper the data from the tar-folder into the output file)

I know these maybe a bit extra questions, but they are nice to add. Also, I have these on a shared hosting, so I do not have root access, but I am able to run hblock via cron daily. :)

vdbhb59 avatar Apr 05 '23 03:04 vdbhb59