added ability to change banlist file

This commit is contained in:
2025-08-15 00:27:32 +03:00
parent 4c8f908f18
commit 36a76c4af7
3 changed files with 3 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ port=7856
log_file=None
preset_file="preset.html"
banlist_file="banlist.lol"
directory="files/"
read_buffer=16384

View File

@@ -96,7 +96,7 @@ class WebServer:
return
if addr[0] in utils.get_banlist(): # banlist for pidors
if addr[0] in utils.get_banlist(config.banlist_file): # banlist for pidors
await self.log(config.err_msgs[403], addr, file_path)
file_size = os.path.getsize(config.err_files[403])
await self.send_headers(writer, 403, file_size)

View File

@@ -13,5 +13,5 @@ def get_create_time(path: str, format: str="%a %b %e %H:%M:%S %Z %Y") -> str:
return create_datetime.strftime(format)
def get_banlist() -> list:
def get_banlist(path: str) -> list:
return list(set(open("banlist.lol").readlines()))