netadm/main.py

46 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import logging
from config import settings, STATIC_DIR
from scripts.сheck_available_ports import start_check
import uvicorn
from fastapi import FastAPI
from fastapi.responses import ORJSONResponse
from starlette.staticfiles import StaticFiles
from web.routers import router as web_router
input_text = """
Info;1001-12:00:17;Сущетвует разрешенная трансляция 37.18.15.119:13081/tcp и это хорошо.
Info;1001-12:00:17;Сущетвует разрешенная трансляция 46.17.253.143:3305/tcp и это хорошо.
Info;1001-12:00:17;Сущетвует разрешенная трансляция 37.18.15.119:18080/tcp и это хорошо.
Error;1001-12:00:17;Сущетвует разрешенная трансляция 188.92.104.110:1554/tcp и это хорошо.
Error;1001-12:00:17;Информация о 46.243.234.23:1555/tcp есть в реестре, но нет в результатах сканирования.
Error;1001-12:00:17;Информация о 46.243.234.23:13081/tcp есть в реестре, но нет в результатах сканирования.
Info;1001-12:00:17;Script finished
"""
main_app = FastAPI(
default_response_class=ORJSONResponse,
docs_url=None,
)
main_app.include_router(web_router)
main_app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
if __name__ == "__main__":
uvicorn.run(
"main:main_app",
host=settings.run.host,
port=settings.run.port,
reload=settings.run.reload,
)