mirror of https://gitlab.com/bashrc2/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,10 +117,7 @@ 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):
|
||||
if isEvil(blockDomain):
|
||||
return True
|
||||
globalBlockingFilename=baseDir+'/accounts/blocking.txt'
|
||||
if os.path.isfile(globalBlockingFilename):
|
||||
|
|
13
utils.py
13
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,10 +59,7 @@ 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):
|
||||
if isEvil(url):
|
||||
return False
|
||||
if len(federationList)==0:
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue