master
Bob Mottram 2019-09-09 16:53:23 +01:00
parent 8755d49d7f
commit a90039b57a
2 changed files with 13 additions and 10 deletions

View File

@ -7,6 +7,7 @@ __email__ = "bob@freedombone.net"
__status__ = "Production"
import os
from utils import isEvil
def addGlobalBlock(baseDir: str, \
blockNickname: str,blockDomain: str) -> bool:
@ -116,11 +117,8 @@ def isBlocked(baseDir: str,nickname: str,domain: str, \
blockNickname: str,blockDomain: str) -> bool:
"""Is the given nickname blocked?
"""
# https://www.youtube.com/watch?v=5qw1hcevmdU
evilDomains=['gab.com','gabfed.com','spinster.xyz']
for concentratedEvil in evilDomains:
if blockDomain.endswith(concentratedEvil):
return True
if isEvil(blockDomain):
return True
globalBlockingFilename=baseDir+'/accounts/blocking.txt'
if os.path.isfile(globalBlockingFilename):
if '*@'+blockDomain in open(globalBlockingFilename).read():

View File

@ -20,6 +20,14 @@ def getStatusNumber() -> (str,str):
published=currTime.strftime("%Y-%m-%dT%H:%M:%SZ")
return statusNumber,published
def isEvil(domain: str) -> bool:
# https://www.youtube.com/watch?v=5qw1hcevmdU
evilDomains=['gab.com','gabfed.com','spinster.xyz']
for concentratedEvil in evilDomains:
if domain.endswith(concentratedEvil):
return True
return False
def createPersonDir(nickname: str,domain: str,baseDir: str,dirname: str) -> str:
"""Create a directory for a person
"""
@ -51,11 +59,8 @@ def domainPermitted(domain: str, federationList: []):
return False
def urlPermitted(url: str, federationList: [],capability: str):
# https://www.youtube.com/watch?v=5qw1hcevmdU
evilDomains=['gab.com','gabfed.com','spinster.xyz']
for concentratedEvil in evilDomains:
if url.endswith(concentratedEvil):
return False
if isEvil(url):
return False
if len(federationList)==0:
return True
for domain in federationList: