hectorm / hblock

Improve your security and privacy by blocking ads, tracking and malware domains.
https://hblock.molinero.dev
MIT License
1.54k stars 100 forks source link

How to add blocklist like * .tar.gz #94

Open Elimelech opened 2 years ago

Elimelech commented 2 years ago

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

hectorm commented 2 years ago

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.

Elimelech commented 2 years ago

!/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;

hectorm commented 2 years ago

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-
vdbhb59 commented 1 year ago
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. :)