refactor: reorganize the whole project layout
Build and Push to Registry / build (push) Successful in 8s
Build and Push to Registry / build (push) Successful in 8s
Co-authored-by: gabdevele <[email protected]>
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
from core.security import require_authenticated_user
|
|
||||||
from db.proxy import (
|
from db.proxy import (
|
||||||
create_proxy,
|
create_proxy,
|
||||||
delete_proxy,
|
delete_proxy,
|
||||||
@@ -9,8 +8,10 @@ from db.proxy import (
|
|||||||
list_proxies as list_proxy_documents,
|
list_proxies as list_proxy_documents,
|
||||||
)
|
)
|
||||||
from fastapi import APIRouter, Depends, HTTPException, status
|
from fastapi import APIRouter, Depends, HTTPException, status
|
||||||
|
|
||||||
|
from core.security import require_authenticated_user
|
||||||
from models.proxy import ProxyCreateInput, ProxyUpdateInput
|
from models.proxy import ProxyCreateInput, ProxyUpdateInput
|
||||||
from utils.proxy.validator import ProxyCodeValidationError, validate_proxy_code
|
from services.proxy.validator import ProxyCodeValidationError, validate_proxy_code
|
||||||
|
|
||||||
router = APIRouter(
|
router = APIRouter(
|
||||||
prefix="/proxy",
|
prefix="/proxy",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
from utils.docker.compose import (
|
from integrations.docker.compose import (
|
||||||
find_docker_compose,
|
find_docker_compose,
|
||||||
get_all_services,
|
get_all_services,
|
||||||
get_services,
|
get_services,
|
||||||
get_visible_folders,
|
get_visible_folders,
|
||||||
)
|
)
|
||||||
from utils.docker.editor import change_port
|
from integrations.docker.editor import change_port
|
||||||
from utils.docker.models import DockerService
|
from integrations.docker.models import DockerService
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"DockerService",
|
"DockerService",
|
||||||
@@ -2,8 +2,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from utils.docker.models import DockerService
|
from integrations.docker.models import DockerService
|
||||||
from utils.docker.ports import _get_service_port
|
from integrations.docker.ports import _get_service_port
|
||||||
|
|
||||||
COMPOSE_NAMES = (
|
COMPOSE_NAMES = (
|
||||||
"compose.yml",
|
"compose.yml",
|
||||||
@@ -2,8 +2,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from utils.docker.compose import find_docker_compose
|
from integrations.docker.compose import find_docker_compose
|
||||||
from utils.docker.ports import _get_port_index, _replace_port_in_mapping
|
from integrations.docker.ports import _get_port_index, _replace_port_in_mapping
|
||||||
|
|
||||||
|
|
||||||
def _backup_path_for(compose_path: Path) -> Path:
|
def _backup_path_for(compose_path: Path) -> Path:
|
||||||
@@ -2,9 +2,10 @@ from collections.abc import Mapping
|
|||||||
from datetime import UTC, datetime
|
from datetime import UTC, datetime
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from motor.motor_asyncio import AsyncIOMotorCollection
|
||||||
|
|
||||||
from core.mongodb import get_database
|
from core.mongodb import get_database
|
||||||
from models.auth import AuthUserDocument
|
from models.auth import AuthUserDocument
|
||||||
from motor.motor_asyncio import AsyncIOMotorCollection
|
|
||||||
|
|
||||||
USERS_COLLECTION_NAME = "auth_users"
|
USERS_COLLECTION_NAME = "auth_users"
|
||||||
REVOKED_COLLECTION_NAME = "revoked_tokens"
|
REVOKED_COLLECTION_NAME = "revoked_tokens"
|
||||||
@@ -2,12 +2,13 @@ from collections.abc import Mapping
|
|||||||
from datetime import UTC, datetime
|
from datetime import UTC, datetime
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from motor.motor_asyncio import AsyncIOMotorCollection
|
||||||
|
from pymongo import ReturnDocument
|
||||||
|
|
||||||
from core.mongodb import get_database
|
from core.mongodb import get_database
|
||||||
from models.proxy import ProxyDocument, ProxyUpdateInput
|
from models.proxy import ProxyDocument, ProxyUpdateInput
|
||||||
from models.service import ServiceEndpointDocument
|
from models.service import ServiceEndpointDocument
|
||||||
from motor.motor_asyncio import AsyncIOMotorCollection
|
from services.proxy.types import ServiceConfig
|
||||||
from pymongo import ReturnDocument
|
|
||||||
from utils.proxy.types import ServiceConfig
|
|
||||||
|
|
||||||
COLLECTION_NAME = "proxies"
|
COLLECTION_NAME = "proxies"
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from utils.proxy.types import ServiceConfig
|
from services.proxy.types import ServiceConfig
|
||||||
|
|
||||||
|
|
||||||
async def create_proxy(
|
async def create_proxy(
|
||||||
@@ -3,7 +3,7 @@ import importlib
|
|||||||
from core.security import get_auth_context, require_authenticated_user
|
from core.security import get_auth_context, require_authenticated_user
|
||||||
from models.proxy import ProxyDocument
|
from models.proxy import ProxyDocument
|
||||||
from models.service import ServiceEndpointDocument
|
from models.service import ServiceEndpointDocument
|
||||||
from utils.proxy.validator import ProxyCodeValidationError
|
from services.proxy.validator import ProxyCodeValidationError
|
||||||
|
|
||||||
proxy_router_module = importlib.import_module("api.proxy.router")
|
proxy_router_module = importlib.import_module("api.proxy.router")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user