libredirect / browser_extension

A browser extension that redirects popular sites to alternative privacy friendly frontends
https://libredirect.github.io
GNU General Public License v3.0
3.28k stars 121 forks source link

Add label for sites using Cloudflare #99

Closed davidcollini closed 2 years ago

davidcollini commented 2 years ago

Is there a way to automatically detect if a frontend uses Cloudflare and disable ones that do

davidcollini commented 2 years ago

This should be a setting in general that's off by default

ManeraKai commented 2 years ago

You don't want support for Cloudflare? Why?

davidcollini commented 2 years ago

Lemme explain my problem a bit more, sites that use cloudflare sometimes block Tor connections completely, and I have auto redirect of offline instances on, but I'm stuck on a page that doesn't work unless I change the instance

ManeraKai commented 2 years ago

For example of a url or details about a request?

davidcollini commented 2 years ago

Any way to fix that problem would be fine

ManeraKai commented 2 years ago

Why though?

davidcollini commented 2 years ago
Screen Shot 2022-03-09 at 21 21 19
davidcollini commented 2 years ago

This is a whoogle instance

ManeraKai commented 2 years ago

Does this setting help Auto Redirect of offline instances? It's in the generals tab.

davidcollini commented 2 years ago

It does not, it should detect that even when the cloudflare server is up, the main website has to be up aswell

davidcollini commented 2 years ago

Even pressing update instances in settings doesn't fix it

ManeraKai commented 2 years ago

I think it detects that the page is offline but can't redirect as it has no url so you'll think it didn't detect it.

davidcollini commented 2 years ago

But shouldn't the site go away when pressing Update instances

ManeraKai commented 2 years ago

oh you're right, the url hasn't changed. Is that instance in your custom list in the extension?

davidcollini commented 2 years ago

It's not, it's a default

ManeraKai commented 2 years ago

Add to the custom instances so it can detect that it's one of your instances.

davidcollini commented 2 years ago

Add to the custom instances so it can detect that it's one of your instances.

Why should I be adding it to custom instances and what do you mean that it's one of my instances

ManeraKai commented 2 years ago

How will LibRedirect know that this is a SearX instance otherwise? It should be in the list to declare that this is one of the SearX instances. If it became offline, LibRedirect will know that this offline site is in fact one of my SearX instances so I should redirect to another online instance.

davidcollini commented 2 years ago
Screen Shot 2022-03-09 at 22 25 45

This instance was already listed as a Whoogle instance, so I shouldn't need to add it to my instances

ManeraKai commented 2 years ago

oh sorry, was looking at the SearX list instead of whoogle's. my bad

ManeraKai commented 2 years ago

I didn't get the cloudflare error until I added a search query, but it did auto redirect fine from it. This is from the last version 1.5.0

whatbh commented 2 years ago

I see this issue is about Cloudflare downtime, but I also have a small opinion on Cloudflare that I think I should say it out, despite not relating to the downtime.

I see Libredirect currently has no option with Cloudflare, so I'm not sure if this will burden @ManeraKai with too much work, but how about adding a label to indicate which instance is on Cloudflare so that people can make up their mind (Take Piped for example, mint.lgbt is hosted on Ovh while the rest are on Cloudflare)

ManeraKai commented 2 years ago

@whatbh I may add this feature, but I should finish the other issues first 👍

whatbh commented 2 years ago

Cool! Take your time. Thanks a lot.

Maybe in the meantime I can help to filter the host in the following list. I dunno, hope it helps.

List of instances and hosting facilities [Click to expand] invidious https://yewtu.be [Oracle Svenska Ab] https://invidious.snopyta.org [Hetzner Online Gmbh] https://vid.puffyan.us [Ovh Sas] https://invidious.kavin.rocks [Cloudflare Inc] ⭐️ https://invidio.xamh.de [No CDN. Probably self-hosted] https://inv.riverside.rocks [Avaya Inc] https://invidious-us.kavin.rocks [Cloudflare Inc] ⭐️ https://invidious.osi.kr [No CDN. Probably self-hosted] https://tube.cthd.icu [Serbia Broadband - Srpske Kablovske Mreze] https://invidious.flokinet.to [Flokinet Ltd] https://yt.artemislena.eu [Deutsche Telekom Ag] https://invidious.weblibre.org [Zglobalhost Ltda] https://youtube.076.ne.jp [Gmo Cloud K.k] https://invidious.privacy.gd [Data Room, Inc] https://invidious.esmailelbob.xyz [Ovh Hosting] https://invidious.namazso.eu [Enzu Inc] nitter https://nitter.net [Henkel Ag & Co Kgaa] https://nitter.42l.fr [No CDN. Probably self-hosted] https://nitter.pussthecat.org [Mts] https://nitter.nixnet.services [Celestica International] https://nitter.fdn.fr [Association Gitoyen] https://nitter.1d4.us [Ovh Hosting] https://nitter.kavin.rocks [Oracle Public Cloud] https://nitter.unixfox.eu [Oracle Public Cloud] https://nitter.domain.glass [Cloudflare] https://nitter.eu [Hetzner Online Gmbh] https://nitter.namazso.eu [Enzu Inc] https://nitter.actionsack.com [Cloudflare Inc] ⭐️ https://birdsite.xanny.family [Cloudflare Inc] ⭐️ https://nitter.hu [Atw Internet Kft] https://twitr.gq [Cloudflare Inc] ⭐️ https://nitter.moomoo.me [Cloudflare Inc] ⭐️ https://nittereu.moomoo.me [Cloudflare Inc] ⭐️ https://bird.trom.tf [Arapahoe School District #6] https://nitter.it [Nexinto Gmbh] https://twitter.censors.us [Ovh Sas] https://nitter.grimneko.de [Hetzner Online Gmbh] https://nitter.alefvanoon.xyz [Cloudflare Inc] ⭐️ https://n.hyperborea.cloud [Bell Canada] https://nitter.ca [Linode] https://twitter.076.ne.jp [Gmo Cloud K.k] https://nitter.mstdn.social [Dow Jones & Co] https://nitter.fly.dev [Momax Network S.r.l] https://notabird.site [Cloudflare Inc] ⭐️ https://nitter.weiler.rocks [Netcup Gmbh] https://nitter.silkky.cloud [Cloudflare Inc] ⭐️ https://nitter.sethforprivacy.com [Hetzner Online Gmbh] https://nttr.stream [Colocrossing] https://nitter.cutelab.space [Eastex Telephone Cooperative, Inc] https://nitter.nl [Liteserver Holding B.v] https://nitter.mint.lgbt [Ovh Hosting] https://nitter.bus-hit.me [Oracle Public Cloud] https://fuckthesacklers.network [Cloudflare Inc] ⭐️ https://nitter.govt.land [Cloudflare Inc] ⭐️ https://nitter.datatunnel.xyz [Celestica International] https://nitter.esmailelbob.xyz [Ovh Hosting] https://tw.artemislena.eu [Deutsche Telekom Ag] https://de.nttr.stream [Nexinto Gmbh] https://nitter.winscloud.net [Cloudflare Inc] ⭐️ https://nitter.tiekoetter.com [Mike Kaldig] https://nitter.spaceint.fr [Brutele Sc] https://twtr.bch.bar [Cloudflare Inc] ⭐️ https://nitter.exonip.de [Boulder Valley School District] https://nitter.mastodon.pro [Oracle Public Cloud] https://nitter.notraxx.ch [University Of Winnipeg] bibliogram https://bibliogram.art [Prometeus Di Daniela Agro] https://bibliogram.snopyta.org [Hetzner Online Gmbh] https://bibliogram.pussthecat.org [Mts] https://bibliogram.1d4.us [Ovh Hosting] https://insta.trom.tf [Arapahoe School District #6] https://bib.riverside.rocks [Avaya Inc] https://bibliogram.esmailelbob.xyz [Ovh Hosting] https://insta.tromdienste.de [Boulder Valley School District] https://bib.actionsack.com [Cloudflare Inc] ⭐️ https://biblio.alefvanoon.xyz [Cloudflare Inc] ⭐️ teddit https://teddit.net [Hetzner Online Gmbh] https://teddit.ggc-project.de [Hetzner Online Gmbh] https://teddit.kavin.rocks [Cloudflare Inc] ⭐️ https://teddit.zaggy.nl [No CDN. Probably self-hosted] https://teddit.namazso.eu [Enzu Inc] https://teddit.tinfoil-hat.net [Boulder Valley School District] https://teddit.domain.glass [Cloudflare] https://snoo.ioens.is [No CDN. Probably self-hosted] https://teddit.httpjames.space [Asiatech Dsl Broadband Services] https://teddit.alefvanoon.xyz [Cloudflare Inc] ⭐️ https://incogsnoo.com [No CDN. Probably self-hosted] https://teddit.pussthecat.org [Mts] https://reddit.lol [E - Vision Internet] https://teddit.sethforprivacy.com [Hetzner Online Gmbh] https://teddit.totaldarkness.net [Saginaw Valley State University] https://teddit.adminforge.de [Hetzner Online Gmbh] https://teddit.bus-hit.me [Oracle Public Cloud] wikiless https://wikiless.org [Critical Path] https://wikiless.alefvanoon.xyz [Cloudflare Inc] ⭐️ https://wikiless.sethforprivacy.com [Hetzner Online Gmbh] https://wiki.604kph.xyz [Cloudflare Inc] ⭐️ scribe https://scribe.rip [Greenhost Bv] https://scribe.nixnet.services [Celestica International] https://scribe.citizen4.eu [Phu Hajdamowicz Miroslaw Hajdamowicz] https://scribe.bus-hit.me [Oracle Public Cloud] simplyTranslate https://simplytranslate.org [Vocus] https://st.alefvanoon.xyz [Cloudflare Inc] ⭐️ https://translate.josias.dev [Frontier Communications Of America, Inc] https://translate.namazso.eu [Enzu Inc] https://translate.riverside.rocks [Avaya Inc] https://translate.bus-hit.me [Oracle Public Cloud] https://simplytranslate.pussthecat.org [Mts] https://translate.northboot.xyz [Netcup Gmbh] https://translate.tiekoetter.com [Mike Kaldig] lingva https://lingva.ml [Carolina Internet, Ltd] https://translate.alefvanoon.xyz [Carolina Internet, Ltd] https://translate.igna.rocks [Amazon.com] https://lingva.pussthecat.org [Mts] https://translate.datatunnel.xyz [Celestica International] https://lingva.esmailelbob.xyz [Ovh Hosting] https://translate.plausibility.cloud [Hetzner Online Gmbh] searx https://anon.sx [No CDN. Probably self-hosted] https://darmarit.org/searx [Netcup Gmbh] https://dynabyte.ca [Mts Inc] https://engo.mint.lgbt [Ovh Hosting] https://jsearch.pw [Choopa, Llc] https://nibblehole.com [Softplus Entwicklungen Gmbh] https://northboot.xyz [E - Vision Internet] https://paulgo.io [Ovh Sas] https://procurx.pt [No CDN. Probably self-hosted] https://s.zhaocloud.net [Ovh Sas] https://search.antonkling.se [Routelabel V.o.f] https://search.asynchronousexchange.com [1&1 Internet Se] https://search.bus-hit.me [Oracle Public Cloud] https://search.disroot.org [Serverius Holding B.v] https://search.ethibox.fr [Online S.a.s] https://search.jpope.org [Qwest Communications Company, Llc] https://search.mdosch.de [No CDN. Probably self-hosted] https://search.neet.works [Frantech Solutions] https://search.ononoki.org [Colocrossing] https://search.snopyta.org [Hetzner Online Gmbh] https://search.st8.at [Rh - Tec Business Gmbh] https://search.stinpriza.org [Hetzner Online Gmbh] https://search.trom.tf [Arapahoe School District #6] https://search.zdechov.net [Internext 2000, S.r.o] https://search.zzls.xyz [Zam Ltda] https://searx-private-search.de [Mike Kaldig] https://searx.bar [Oracle Public Cloud] https://searx.be [Oracle Public Cloud] https://searx.bissisoft.com [Linode, Llc] https://searx.divided-by-zero.eu [Contabo Gmbh] https://searx.dresden.network [No CDN. Probably self-hosted] https://searx.ebnar.xyz [Hetzner Online Gmbh] https://searx.esmailelbob.xyz [Ovh Hosting] https://searx.everdot.org [Telia Company Ab] https://searx.fmac.xyz [Exoscale Open Cloud Gv] https://searx.fossencdi.org [Keyweb Ag Ip Network] https://searx.gnous.eu [Hivane] https://searx.gnu.style [Dansk Kabel Tv] https://searx.hardwired.link [Netcup Gmbh] https://searx.josie.lol [Cloudflare Inc] ⭐️ https://searx.lavatech.top [Cloudflare Inc] ⭐️ https://searx.mastodontech.de [No CDN. Probably self-hosted] https://searx.mha.fi [Oracle Public Cloud] https://searx.mxchange.org [Host Europe Gmbh] https://searx.nakhan.net [Ovh Sas] https://searx.netzspielplatz.de [Hetzner Online Gmbh] https://searx.nevrlands.de [Netcup Gmbh] https://searx.ninja [Linode, Llc] https://searx.nixnet.services [Celestica International] https://searx.openhoofd.nl [Zeelandnet Bv] https://searx.operationtulip.com [Bahnhof Ab] https://searx.org [Cloudflare Inc] ⭐️ https://searx.prvcy.eu [Hetzner Online Gmbh] https://searx.pwoss.org [No CDN. Probably self-hosted] https://searx.rasp.fr [Free Sas] https://searx.roughs.ru [Cloudflare Inc] ⭐️ https://searx.ru [Hetzner Online Gmbh] https://searx.run [Cloudflare Inc] ⭐️ https://searx.sadblog.xyz [Choopa, Llc] https://searx.semipvt.com [Ovh Sas] https://searx.slash-dev.de [Host Europe Gmbh] https://searx.solusar.de [Bsb Service Virtual Dedicated Server Hosting] https://searx.sp-codes.de [1&1 Versatel Deutschland Gmbh] https://searx.stuehieyr.com [Alabanza, Inc] https://searx.theanonymouse.xyz [Hetzner Online Gmbh] https://searx.thegreenwebfoundation.org [Hetzner Online Gmbh] https://searx.tiekoetter.com [Mike Kaldig] https://searx.tk [Cloudflare Inc] ⭐️ https://searx.tux.land [Yellow Transportation] https://searx.tuxcloud.net [Master Internet S.r.o] https://searx.tyil.nl [Critical Path] https://searx.webheberg.info [Ovh Sas] https://searx.xkek.net [E - Vision Internet] https://searx.xyz [Hostus] https://searx.zapashcanon.fr [Main Ikoula Backbone Network] https://searx.zecircle.xyz [Critical Path] https://searxng.zackptg5.com [Shock Hosting Llc] https://serx.cf [Colocrossing] https://spot.ecloud.global [National Science Center Foundation] https://suche.dasnetzundich.de [Critical Path] https://suche.tromdienste.de [Boulder Valley School District] https://suche.uferwerk.org [Hetzner Online Gmbh] https://swag.pw [Linode, Llc] https://sx.catgirl.cloud [Hetzner Online Gmbh] https://timdor.noip.me/searx [At&t Services, Inc] https://trovu.komun.org [Contabo Gmbh] https://www.gruble.de [Hetzner Online Gmbh] https://www.webrats.xyz [Oracle Corporation] https://searx.roflcopter.fr [Institute Of Rhythmology Of Evdokiya Marchenko] whoogle https://gowogle.voring.me [Ministre Des Forests, Govt Of Quebec] https://s.alefvanoon.xyz [Cloudflare Inc] ⭐️ https://search.albony.xyz [Cloudflare Inc] ⭐️ https://search.garudalinux.org [Alabanza, Inc] https://search.sethforprivacy.com [Hetzner Online Gmbh] https://whoogle.fossho.st [Legaco Networks B.v] https://whooglesearch.net [Ginernet S.l] https://www.whooglesearch.ml [Google Cloud] https://whoogle.dcs0.hu [Liberty Global Operations B.v] https://whoogle.esmailelbob.xyz [Ovh Hosting] rimgo https://i.bcow.xyz [Hewlett - Packard Company] https://rimgo.bcow.xyz [At&t Internet Services] https://rimgo.pussthecat.org [Mts] https://img.riverside.rocks [Avaya Inc] https://rimgo.totaldarkness.net [Saginaw Valley State University] https://rimgo.bus-hit.me [Oracle Public Cloud]
scraper.py ```python #use API provided by myip.ms import requests, json res=requests.get('https://raw.githubusercontent.com/libredirect/libredirect/master/src/instances/data.json') text=json.loads(res.text) for item in text: print(item) for elem in text[item]['normal']: hexed=''.join(hex(ord(char))[2:] for char in elem) infoRes=requests.get('https://plugin.myip.ms/hex_'+hexed) if infoRes.text != "No Data" and infoRes.text != "Invalid Domain Name": infoText=json.loads(infoRes.text) if infoText['hosting'] == '': print(elem+' [No CDN. Probably self-hosted]') elif infoText['hosting'] == 'Cloudflare Inc': print(elem+' ['+infoText['hosting']+'] ⭐️') else: print(elem+' ['+infoText['hosting']+']') ```
ManeraKai commented 2 years ago

Keep this open or open a new issue that has Cloudflare instances declaration feature.

Elaborendum commented 2 years ago

Is the first reported issue still present, or should the extension now redirect offline Cloudflare instances to a working instance and I should open a new issue about it not doing so on my end?

ManeraKai commented 2 years ago

What's the instance that it's not redirecting?

Elaborendum commented 2 years ago

So far, teddit.kavin.rocks. The extension sometimes redirects to it and just leaves it there.

ManeraKai commented 2 years ago

I was trying to strict this automatic function as because of previous issues. I stricted it to just 503 504 status codes. I'll add 502 too.

ManeraKai commented 2 years ago

The only lists that add a declaration that if the instance is using cloud flare or not are bibliogram, libreddit.

ManeraKai commented 2 years ago

Though I found this website: https://cloudflare.hellafast.digital/

ManeraKai commented 2 years ago

Made this script: is_cloudflare.py

import socket
import subprocess

def isCloudflare(url):
    x = urlparse(url)
    ip = socket.gethostbyname(x.hostname)
    r = requests.get('https://www.cloudflare.com/ips-v4')
    myList = r.text.split('\n')

    for i in myList:
        out = subprocess.run(["sh", "./src/instances/get_possible_ips.sh", i], capture_output=True, text=True)
        if ip in out.stdout.splitlines():
            return True

    return False

print(isCloudflare('https://bib.actionsack.com'))

possible_ips.sh

nmap -sL -n $1 | awk '/Nmap scan report/{print $NF}'
ManeraKai commented 2 years ago

And it's working! image