mirror of https://gitlab.com/bashrc2/epicyon
Configuration parameter for enabling cw lists
parent
a6381f5c50
commit
b91c6282c7
|
@ -876,7 +876,7 @@ def brochModeLapses(baseDir: str, lapseDays: int = 7) -> bool:
|
|||
return False
|
||||
|
||||
|
||||
def loadCWLists(baseDir: str, verbose: bool) -> {}:
|
||||
def loadCWLists(baseDir: str, verbose: bool, listsEnabled: str) -> {}:
|
||||
"""Load lists used for content warnings
|
||||
"""
|
||||
if not os.path.isdir(baseDir + '/cwlists'):
|
||||
|
@ -893,6 +893,8 @@ def loadCWLists(baseDir: str, verbose: bool) -> {}:
|
|||
continue
|
||||
if not listJson.get('name'):
|
||||
continue
|
||||
if listJson['name'] not in listsEnabled:
|
||||
continue
|
||||
if not listJson.get('words') and not listJson.get('domains'):
|
||||
continue
|
||||
name = listJson['name']
|
||||
|
|
|
@ -17199,7 +17199,8 @@ def runDaemon(defaultReplyIntervalHours: int,
|
|||
updateBlockedCache(baseDir, httpd.blockedCache,
|
||||
httpd.blockedCacheLastUpdated,
|
||||
httpd.blockedCacheUpdateSecs)
|
||||
httpd.CWlists = loadCWLists(baseDir, True)
|
||||
httpd.listsEnabled = getConfigParam(baseDir, "listsEnabled")
|
||||
httpd.CWlists = loadCWLists(baseDir, True, httpd.listsEnabled)
|
||||
|
||||
# cache to store css files
|
||||
httpd.cssCache = {}
|
||||
|
|
Loading…
Reference in New Issue