Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.216.68
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
uvicorn /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
_handlers
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
lifespan
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
loops
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
middleware
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
protocols
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
supervisors
[ DIR ]
drwxr-xr-x
2024-08-30 00:22
__init__.py
147
B
-rw-r--r--
2021-08-14 02:02
__main__.py
62
B
-rw-r--r--
2021-08-14 02:02
_types.py
423
B
-rw-r--r--
2021-08-14 02:02
config.py
20.15
KB
-rw-r--r--
2021-08-14 02:02
importer.py
1.14
KB
-rw-r--r--
2021-08-14 02:02
logging.py
4.08
KB
-rw-r--r--
2021-08-14 02:02
main.py
11.46
KB
-rw-r--r--
2021-08-14 02:02
server.py
10.88
KB
-rw-r--r--
2021-08-14 02:02
subprocess.py
2.35
KB
-rw-r--r--
2021-08-14 02:02
workers.py
3.11
KB
-rw-r--r--
2021-08-14 02:02
Save
Rename
import http import logging import sys from copy import copy from typing import Optional import click TRACE_LOG_LEVEL = 5 class ColourizedFormatter(logging.Formatter): """ A custom log formatter class that: * Outputs the LOG_LEVEL with an appropriate color. * If a log call includes an `extras={"color_message": ...}` it will be used for formatting the output, instead of the plain text message. """ level_name_colors = { TRACE_LOG_LEVEL: lambda level_name: click.style(str(level_name), fg="blue"), logging.DEBUG: lambda level_name: click.style(str(level_name), fg="cyan"), logging.INFO: lambda level_name: click.style(str(level_name), fg="green"), logging.WARNING: lambda level_name: click.style(str(level_name), fg="yellow"), logging.ERROR: lambda level_name: click.style(str(level_name), fg="red"), logging.CRITICAL: lambda level_name: click.style( str(level_name), fg="bright_red" ), } def __init__( self, fmt: Optional[str] = None, datefmt: Optional[str] = None, style: str = "%", use_colors: Optional[bool] = None, ): if use_colors in (True, False): self.use_colors = use_colors else: self.use_colors = sys.stdout.isatty() super().__init__(fmt=fmt, datefmt=datefmt, style=style) def color_level_name(self, level_name: str, level_no: int) -> str: def default(level_name: str) -> str: return str(level_name) # pragma: no cover func = self.level_name_colors.get(level_no, default) return func(level_name) def should_use_colors(self) -> bool: return True # pragma: no cover def formatMessage(self, record: logging.LogRecord) -> str: recordcopy = copy(record) levelname = recordcopy.levelname seperator = " " * (8 - len(recordcopy.levelname)) if self.use_colors: levelname = self.color_level_name(levelname, recordcopy.levelno) if "color_message" in recordcopy.__dict__: recordcopy.msg = recordcopy.__dict__["color_message"] recordcopy.__dict__["message"] = recordcopy.getMessage() recordcopy.__dict__["levelprefix"] = levelname + ":" + seperator return super().formatMessage(recordcopy) class DefaultFormatter(ColourizedFormatter): def should_use_colors(self) -> bool: return sys.stderr.isatty() # pragma: no cover class AccessFormatter(ColourizedFormatter): status_code_colours = { 1: lambda code: click.style(str(code), fg="bright_white"), 2: lambda code: click.style(str(code), fg="green"), 3: lambda code: click.style(str(code), fg="yellow"), 4: lambda code: click.style(str(code), fg="red"), 5: lambda code: click.style(str(code), fg="bright_red"), } def get_status_code(self, status_code: int) -> str: try: status_phrase = http.HTTPStatus(status_code).phrase except ValueError: status_phrase = "" status_and_phrase = "%s %s" % (status_code, status_phrase) if self.use_colors: def default(code: int) -> str: return status_and_phrase # pragma: no cover func = self.status_code_colours.get(status_code // 100, default) return func(status_and_phrase) return status_and_phrase def formatMessage(self, record: logging.LogRecord) -> str: recordcopy = copy(record) ( client_addr, method, full_path, http_version, status_code, ) = recordcopy.args status_code = self.get_status_code(int(status_code)) request_line = "%s %s HTTP/%s" % (method, full_path, http_version) if self.use_colors: request_line = click.style(request_line, bold=True) recordcopy.__dict__.update( { "client_addr": client_addr, "request_line": request_line, "status_code": status_code, } ) return super().formatMessage(recordcopy)