hectorm / hblock

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

White list #92

Closed Elimelech closed 2 years ago

Elimelech commented 2 years ago

It would be great to make a whitelist where you could upload domains on which ads would not be blocked at all.

hectorm commented 2 years ago

Currently hBlock supports a whitelist via the --allowlist option, but I'm not interested in maintaining any public whitelist or blacklist myself as that would be too time consuming. I prefer to leave that task delegated to the list maintainers that hBlock uses, which are already doing a wonderful job.

If you are interested in a community whitelist I suggest you take a look at this project: anudeepND/whitelist.

You can place this file in /etc/hblock/allow.list to make use of that whitelist.

Elimelech commented 2 years ago

I do not have such folders? /etc/hblock/

hectorm commented 2 years ago

hBlock does not create these files by default but uses them if they exist, you can create them.

Elimelech commented 2 years ago

I created this folder and file, but nothing has changed. I added a site that I want so that nothing is blocked there nothing changed. How to be?

hectorm commented 2 years ago

I assume you ran hBlock again after creating this file.

On the other hand, in this file by default you must add the exact domain you want to unblock, i.e. adding example.com does not unblock all subdomains like a.example.com.

With the --regex option you can enable support for regular expressions in the whitelist, in that case you can add ^\(.*example\.com$ to unblock example.com and all its subdomains.

Elimelech commented 2 years ago

Maybe I need to install the program itself like this? - pkg install hblock

(I have freeBSD)

Now I have a program for this instruction: curl -o / tmp / hblock 'https://raw.githubusercontent.com/hectorm/hblock/v3.3.1/hblock' \ && echo 'd93effa9a068b82f7d4d97fdcae7a320c6f7a3ae910af8234bca870f33ec55e1 / tmp / hblock' | shasum -c \ && sudo mv / tmp / hblock / usr / local / bin / hblock \ && sudo chown 0: 0 / usr / local / bin / hblock \ && sudo chmod 755 / usr / local / bin / hblock

hectorm commented 2 years ago

You can install hBlock manually with that command or install it from the FreeBSD ports (although the latest version is not currently in the ports, but the whitelist feature works anyway).

Please tell me what version of hBlock you are using, the contents of the /etc/hblock/allow.list file and the hBlock command you are running.

Elimelech commented 2 years ago

I am executing the command:

hblock

hectorm commented 2 years ago

Please answer the other questions so that I can help you, I assume you are using hBlock 3.3.1 from your previous message.

Elimelech commented 2 years ago

Yes, i have hBlock 3.3.1

Elimelech commented 2 years ago

allow.list:

0.client-channel.google.com 1drv.com 2.android.pool.ntp.org akamaihd.net akamaitechnologies.com akamaized.net amazonaws.com android.clients.google.com api.ipify.org api.rlje.net app-api.ted.com appleid.apple.com apps.skype.com appsbackup-pa.clients6.google.com appsbackup-pa.googleapis.com apt.sonarr.tv aspnetcdn.com attestation.xboxlive.com ax.phobos.apple.com.edgesuite.net brightcove.net c.s-microsoft.com cdn.cloudflare.net cdn.embedly.com cdn.optimizely.com cdn.vidible.tv cdn2.optimizely.com cdn3.optimizely.com cdnjs.cloudflare.com cert.mgt.xboxlive.com clientconfig.passport.net clients1.google.com clients2.google.com clients3.google.com clients4.google.com clients5.google.com clients6.google.com cpms.spop10.ams.plex.bz cpms35.spop10.ams.plex.bz cse.google.com ctldl.windowsupdate.com d2c8v52ll5s99u.cloudfront.net d2gatte9o95jao.cloudfront.net dashboard.plex.tv dataplicity.com def-vef.xboxlive.com delivery.vidible.tv dev.virtualearth.net device.auth.xboxlive.com display.ugc.bazaarvoice.com displaycatalog.mp.microsoft.com dl.delivery.mp.microsoft.com dl.dropbox.com dl.dropboxusercontent.com dns.msftncsi.com download.sonarr.tv drift.com driftt.com dynupdate.no-ip.com ecn.dev.virtualearth.net edge.api.brightcove.com eds.xboxlive.com fonts.gstatic.com forums.sonarr.tv g.live.com geo-prod.do.dsp.mp.microsoft.com geo3.ggpht.com giphy.com github.com github.io googleapis.com gravatar.com gstatic.com help.ui.xboxlive.com hls.ted.com i.ytimg.com i1.ytimg.com imagesak.secureserver.net img.vidible.tv imgix.net imgs.xkcd.com instantmessaging-pa.googleapis.com intercom.io jquery.com jsdelivr.net keystone.mwbsys.com lastfm-img2.akamaized.net licensing.xboxlive.com live.com login.live.com login.microsoftonline.com manifest.googlevideo.com meta-db-worker02.pop.ric.plex.bz meta.plex.bz meta.plex.tv microsoftonline.com msftncsi.com my.plexapp.com nexusrules.officeapps.live.com npr-news.streaming.adswizz.com nine.plugins.plexapp.com no-ip.com node.plexapp.com notify.xboxlive.com ns1.dropbox.com ns2.dropbox.com o1.email.plex.tv o2.sg0.plex.tv ocsp.apple.com office.com office.net office365.com officeclient.microsoft.com om.cbsi.com onedrive.live.com outlook.live.com outlook.office365.com placehold.it placeholdit.imgix.net players.brightcove.net pricelist.skype.com products.office.com proxy.plex.bz proxy.plex.tv proxy02.pop.ord.plex.bz pubsub.plex.bz pubsub.plex.tv raw.githubusercontent.com redirector.googlevideo.com res.cloudinary.com s.gateway.messenger.live.com s.marketwatch.com s.youtube.com s.ytimg.com s1.wp.com s2.youtube.com s3.amazonaws.com sa.symcb.com secure.avangate.com secure.brightcove.com secure.surveymonkey.com services.sonarr.tv skyhook.sonarr.tv spclient.wg.spotify.com ssl.p.jwpcdn.com staging.plex.tv status.plex.tv t.co t0.ssl.ak.dynamic.tiles.virtualearth.net t0.ssl.ak.tiles.virtualearth.net tawk.to tedcdn.com themoviedb.com thetvdb.com tinyurl.com title.auth.xboxlive.com title.mgt.xboxlive.com traffic.libsyn.com tvdb2.plex.tv tvthemes.plexapp.com twimg.com ui.skype.com video-stats.l.google.com videos.vidible.tv widget-cdn.rpxnow.com win10.ipv6.microsoft.com wp.com ws.audioscrobbler.com www.dataplicity.com www.googleapis.com www.msftncsi.com www.no-ip.com www.youtube-nocookie.com xbox.ipv6.microsoft.com xboxexperiencesprod.experimentation.xboxlive.com xflight.xboxlive.com xkms.xboxlive.com xsts.auth.xboxlive.com youtu.be youtube-nocookie.com yt3.ggpht.com zee.cws.conviva.com pings.conviva.com cws.conviva.com livepassdl.conviva.com gfwsl.geforce.com appspot-preview.l.google.com vidtech.cbsinteractive.com continuum.dds.microsoft.com connectivitycheck.gstatic.com connectivitycheck.android.com www.msftconnecttest.com meirbruk.net teplo-faq.net

hectorm commented 2 years ago

With that allow.list file those domains should not be blocked if you run hBlock with the default options. Could you tell me an example of a domain that is being blocked but is included in that list? Also attach the complete hBlock console output.

Make sure that the user running hBlock has permission to read the /etc/hblock/allow.list file.

Elimelech commented 2 years ago

Launched with the inclusion: hblock --allowlist /etc/hblock/allow.list

Here's the output: [INFO] Applying Denilist [INFO] Clear blacklist [INFO] Applying permission list [INFO] Sort blacklist [INFO] Applying format template [INFO] 202138 blocked domains!

You have read rights. but for some reason everything is blocked on the teplo-faq.net website !?

hectorm commented 2 years ago

That hBlock output is strange, it looks like the version you are using has some modifications.

Elimelech commented 2 years ago

[INFO] Applying denylist [INFO] Sanitizing blocklist [INFO] Applying allowlist [INFO] Sorting blocklist [INFO] Applying format template [INFO] 202138 blocked domains!

Elimelech commented 2 years ago

I have not changed anything, downloaded from your site

Elimelech commented 2 years ago

For some reason allowlist doesn't work

hectorm commented 2 years ago

The last console output you sent does match with what hBlock should print, the one you passed previously does not, that's why I asked if you made any changes.

Does this command give any result?

grep -F 'teplo-faq.net' /etc/hosts

The teplo-faq.net domain is not blocked by default by hBlock, are you using other sources than the default ones?

Elimelech commented 2 years ago

The output your command (grep -F 'teplo-faq.net' /etc/hosts) doesn't show anything.

hectorm commented 2 years ago

In that case that domain is not being blocked by hBlock. What kind of problem do you have with the teplo-faq.net website?

Elimelech commented 2 years ago

Yes, but why is ads being blocked on this site then? He's on the white list!

Elimelech commented 2 years ago

I want ads to be on this site, and not to block the site itself

hectorm commented 2 years ago

That's because the ads are being served from a domain other than teplo-faq.net, from what I see they are:

And those domains are indeed being blocked by hBlock by default. If you add them to the allowlist you should see the ads, but keep in mind that you will also see ads on other sites that serve them from those domains.

Elimelech commented 2 years ago

I understood it. And what is selectively somehow impossible sites?

hectorm commented 2 years ago

Correct, the system /etc/hosts file cannot unblock a domain for a specific website. It simply associates a domain to an IP address.

Elimelech commented 2 years ago

And how to update the block lists. just run the hblock command again?

hectorm commented 2 years ago

That's it, you should create a cron to automate it.

Elimelech commented 2 years ago

Is this how it will work? -

hectorm commented 2 years ago

If your machine is not running all the time I recommend using anacron.

Elimelech commented 2 years ago

Thanks!