forked from indymedia/epicyon
Tidying
parent
8755d49d7f
commit
a90039b57a
|
@ -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():
|
||||
|
|
15
utils.py
15
utils.py
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue