mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Update logger blacklist for newsleter/notifier configs
This commit is contained in:
parent
c19cc858bd
commit
44428cc6e5
5 changed files with 33 additions and 14 deletions
|
@ -28,6 +28,7 @@ import traceback
|
|||
|
||||
import plexpy
|
||||
import helpers
|
||||
from plexpy.config import _BLACKLIST_KEYS, _WHITELIST_KEYS
|
||||
|
||||
# These settings are for file logging only
|
||||
FILENAME = "tautulli.log"
|
||||
|
@ -48,6 +49,20 @@ logger_plex_websocket = logging.getLogger("plex_websocket")
|
|||
# Global queue for multiprocessing logging
|
||||
queue = None
|
||||
|
||||
|
||||
def blacklist_config(config):
|
||||
blacklist = set()
|
||||
blacklist_keys = ['HOOK', 'APIKEY', 'KEY', 'PASSWORD', 'TOKEN']
|
||||
|
||||
for key, value in config.iteritems():
|
||||
if isinstance(value, basestring) and len(value.strip()) > 5 and \
|
||||
key.upper() not in _WHITELIST_KEYS and (key.upper() in blacklist_keys or
|
||||
any(bk in key.upper() for bk in _BLACKLIST_KEYS)):
|
||||
blacklist.add(value.strip())
|
||||
|
||||
_BLACKLIST_WORDS.update(blacklist)
|
||||
|
||||
|
||||
class NoThreadFilter(logging.Filter):
|
||||
"""
|
||||
Log filter for the current thread
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue