Unchecked Authentication Requiring instances by default #248

This commit is contained in:
ManeraKai 2022-05-15 20:27:28 +03:00
parent ab44fd04ff
commit 754c52983a
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
5 changed files with 23 additions and 10 deletions

View File

@ -18,7 +18,7 @@ function getRandomInstance(instances) {
let cloudflareList = [];
async function initCloudflareList() {
return new Promise(resolve => {
fetch('/instances/cloudflare.json').then(response => response.text()).then(data => {
fetch('/instances/blocklist').then(response => response.text()).then(data => {
cloudflareList = JSON.parse(data);
resolve();
})

View File

@ -9,6 +9,7 @@
"https://piped.mha.fi",
"https://send.silkky.cloud",
"https://nhanh.cloud",
"https://nitter.nixnet.services",
"https://nitter.domain.glass",
"https://birdsite.xanny.family",
"https://nitter.moomoo.me",

View File

@ -2,7 +2,6 @@
"invidious": {
"normal": [
"https://yewtu.be",
"https://vid.puffyan.us",
"https://invidious.snopyta.org",
"https://invidious.kavin.rocks",
"https://inv.riverside.rocks",
@ -19,7 +18,8 @@
"https://invidious.weblibre.org",
"https://invidious.esmailelbob.xyz",
"https://youtube.076.ne.jp",
"https://invidious.namazso.eu"
"https://invidious.namazso.eu",
"https://vid.puffyan.us"
],
"tor": [
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
@ -376,7 +376,6 @@
"https://searx.nixnet.services",
"https://searx.openhoofd.nl",
"https://searx.org",
"https://searx.ppeb.me",
"https://searx.pwoss.org",
"https://searx.rasp.fr",
"https://searx.ru",
@ -444,6 +443,7 @@
"https://searx.mha.fi",
"https://searx.namejeff.xyz",
"https://searx.orion-hub.fr",
"https://searx.ppeb.me",
"https://searx.prvcy.eu",
"https://searx.sev.monster",
"https://searx.tiekoetter.com",

View File

@ -67,6 +67,16 @@ def is_cloudflare(url):
return False
def is_authenticate(url):
try:
r = requests.get(url, timeout=5)
if 'www-authenticate' in r.headers:
return True
except:
return False
return False
def invidious():
r = requests.get('https://api.invidious.io/instances.json')
rJson = json.loads(r.text)
@ -366,7 +376,7 @@ searx_searxng()
whoogle()
rimgo()
cloudflareMightyList = []
blocklist = []
for k1, v1 in mightyList.items():
if type(mightyList[k1]) is dict:
for k2, v2 in mightyList[k1].items():
@ -376,7 +386,9 @@ for k1, v1 in mightyList.items():
# print("removed " + instance)
# else:
if not instance.endswith('.onion') and not instance.endswith('.i2p') and is_cloudflare(instance):
cloudflareMightyList.append(instance)
blocklist.append(instance)
if not instance.endswith('.onion') and not instance.endswith('.i2p') and is_authenticate(instance):
blocklist.append(instance)
peertube()
@ -387,9 +399,9 @@ with open('./src/instances/data.json', 'w') as outfile:
outfile.write(json_object)
print(Fore.BLUE + 'wrote ' + Style.RESET_ALL + 'instances/data.json')
json_object = json.dumps(cloudflareMightyList, ensure_ascii=False, indent=2)
with open('./src/instances/cloudflare.json', 'w') as outfile:
json_object = json.dumps(blocklist, ensure_ascii=False, indent=2)
with open('./src/instances/blocklist.json', 'w') as outfile:
outfile.write(json_object)
print(Fore.BLUE + 'wrote ' + Style.RESET_ALL + 'instances/cloudflare.json')
print(Fore.BLUE + 'wrote ' + Style.RESET_ALL + 'instances/blocklist')
# print(json_object)

View File

@ -22,7 +22,7 @@ window.browser = window.browser || window.chrome;
browser.runtime.onInstalled.addListener(async details => {
if (details.reason == 'install') {
fetch('/instances/cloudflare.json').then(response => response.text()).then(async data => {
fetch('/instances/blocklist.json').then(response => response.text()).then(async data => {
await browser.storage.local.set({ cloudflareList: JSON.parse(data) })
youtubeHelper.initDefaults();
youtubeMusicHelper.initDefaults();