2024-01-31 00:48:20 +00:00
|
|
|
import datetime as dt
|
|
|
|
|
import pickledb
|
2024-03-27 16:49:52 +00:00
|
|
|
from multiprocessing import Value
|
2024-01-31 00:48:20 +00:00
|
|
|
import logging
|
|
|
|
|
from contextvars import ContextVar
|
|
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
|
|
import redis.asyncio as redis
|
|
|
|
|
from xkcdpass import xkcd_password as xp
|
|
|
|
|
|
|
|
|
|
from server.utils.loguru_handler import InterceptHandler
|
|
|
|
|
|
2024-02-07 11:17:07 +00:00
|
|
|
redis_storage = redis.Redis(host="dragonfly", port=6379, db=0)
|
2024-01-31 00:48:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
logging.basicConfig(handlers=[InterceptHandler()], level=0, force=True)
|
|
|
|
|
|
|
|
|
|
url_correlation: ContextVar[Optional[str]] = ContextVar("url_correlation", default="UNKNOWN_URL")
|
|
|
|
|
transponder_code_correlation: ContextVar[Optional[str]] = ContextVar("transponder_code_correlation", default="unknown transponder location... Beep!")
|
|
|
|
|
|
2024-02-07 13:36:46 +00:00
|
|
|
home_page_process = {}
|
|
|
|
|
|
2024-01-31 00:48:20 +00:00
|
|
|
ban_db = pickledb.load('ban_post_list.db', True)
|
|
|
|
|
|
|
|
|
|
START_TIME = dt.datetime.now().strftime("%H-%M-%S")
|
|
|
|
|
WORDS_LIST_FILE = "xkcdpass/static/legac"
|
|
|
|
|
|
2024-03-18 18:33:34 +00:00
|
|
|
xkcd_passwd = xp.generate_wordlist(wordfile=WORDS_LIST_FILE, min_length=5, max_length=8)
|
|
|
|
|
|
2024-03-21 07:35:38 +00:00
|
|
|
maintenance_mode = Value('b', False)
|