From 1b224d183ba906c871199079d3ed8d6a6f274d26 Mon Sep 17 00:00:00 2001 From: ReLoia Date: Sat, 11 Apr 2026 23:20:00 +0200 Subject: [PATCH] feat: add initial proxy management functionality and CI configuration --- .gitea/workflows/theplug.yml | 29 +++++++++++++++++++++++++++++ README.md | 7 ++++++- src/utils/proxy/__init__.py | 0 src/utils/proxy/manager.py | 12 ++++++++++++ src/utils/proxy/types.py | 6 ++++++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/theplug.yml create mode 100644 src/utils/proxy/__init__.py create mode 100644 src/utils/proxy/manager.py create mode 100644 src/utils/proxy/types.py diff --git a/.gitea/workflows/theplug.yml b/.gitea/workflows/theplug.yml new file mode 100644 index 0000000..9e348c6 --- /dev/null +++ b/.gitea/workflows/theplug.yml @@ -0,0 +1,29 @@ +name: Build and Push to Registry + +on: [ push ] + +jobs: + build: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Login to Gitea Registry + uses: docker/login-action@v3 + with: + registry: git.reloia.uk + username: reloia + password: ${{ secrets.LOGIN_TOKEN }} + + - name: Build and Push (Shell) + run: | + IMAGE_NAME="git.reloia.uk/reloia/theplug:latest" + + echo "Building $IMAGE_NAME..." + docker build -t "$IMAGE_NAME" . + + echo "Pushing $IMAGE_NAME..." + docker push "$IMAGE_NAME" + diff --git a/README.md b/README.md index 10c4dfc..5388c6f 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,9 @@ docker compose up -d mongodb redis fastapi dev src/main.py ``` -FastAPI docs: `http://localhost:3671/docs` +accedi a FastAPI su: [FastAPI docs](http://localhost:3671/docs) + +## Documentazione per Sviluppo + +[MitMProxy examples](https://docs.mitmproxy.org/stable/addons/examples/) + diff --git a/src/utils/proxy/__init__.py b/src/utils/proxy/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/utils/proxy/manager.py b/src/utils/proxy/manager.py new file mode 100644 index 0000000..21039e7 --- /dev/null +++ b/src/utils/proxy/manager.py @@ -0,0 +1,12 @@ +from typing import Literal + +from utils.proxy.types import ServiceConfig + + +async def create_proxy( + port: int, + name: str, + service: ServiceConfig, + proxy_type: Literal["easy", "manual"] +): + return diff --git a/src/utils/proxy/types.py b/src/utils/proxy/types.py new file mode 100644 index 0000000..a677c3a --- /dev/null +++ b/src/utils/proxy/types.py @@ -0,0 +1,6 @@ +from typing import TypedDict + + +class ServiceConfig(TypedDict): + address: str + port: int