diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 4d26a8d..b86aee7 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -28,5 +28,5 @@ jobs: context: . push: true tags: gitea.ext.ben.io/${{ gitea.repository }}:latest - secrets: | - "ssh_key=${{ secrets.SSH_KEY }}" + build-args: | + GITEA_TOKEN=${{ secrets.CR_PAT }} diff --git a/Dockerfile b/Dockerfile index 9aaf12f..38bc0c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,20 +4,21 @@ ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy WORKDIR /app -# Enable SSH for git dependencies +# Install git for dependency installation RUN apt-get update && apt-get install -y --no-install-recommends \ git \ - ssh-client \ && rm -rf /var/lib/apt/lists/* -# Add gitea.ext.ben.io to known hosts -RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan git.local.ben.io >> ~/.ssh/known_hosts +# Use Gitea PAT for private dependencies if provided +ARG GITEA_TOKEN +RUN if [ -n "$GITEA_TOKEN" ]; then \ + git config --global url."https://b3nw:${GITEA_TOKEN}@gitea.ext.ben.io/".insteadOf "https://gitea.ext.ben.io/"; \ + fi # Install dependencies RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ --mount=type=bind,source=uv.lock,target=uv.lock \ - --mount=type=secret,id=ssh_key,target=/root/.ssh/id_rsa \ uv sync --frozen --no-install-project --no-dev # Copy the rest of the application @@ -25,7 +26,6 @@ COPY . /app # Install the project RUN --mount=type=cache,target=/root/.cache/uv \ - --mount=type=secret,id=ssh_key,target=/root/.ssh/id_rsa \ uv sync --frozen --no-dev FROM python:3.12-slim-bookworm diff --git a/pyproject.toml b/pyproject.toml index 0885564..b6ba13b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ dependencies = [ "fastmcp>=0.4.1", "starlette>=0.41.0", "uvicorn>=0.32.0", - "schwab-scraper @ git+ssh://gitea@git.local.ben.io/b3nw/schwab-scraper.git", + "schwab-scraper @ git+https://gitea.ext.ben.io/b3nw/schwab-scraper.git", ] [build-system] diff --git a/uv.lock b/uv.lock index 146de8d..c44605c 100644 --- a/uv.lock +++ b/uv.lock @@ -1697,7 +1697,7 @@ dependencies = [ requires-dist = [ { name = "fastmcp", specifier = ">=0.4.1" }, { name = "mcp", specifier = ">=1.2.0" }, - { name = "schwab-scraper", git = "ssh://git.local.ben.io/b3nw/schwab-scraper.git" }, + { name = "schwab-scraper", git = "https://gitea.ext.ben.io/b3nw/schwab-scraper.git" }, { name = "starlette", specifier = ">=0.41.0" }, { name = "uvicorn", specifier = ">=0.32.0" }, ] @@ -1705,7 +1705,7 @@ requires-dist = [ [[package]] name = "schwab-scraper" version = "0.6.16" -source = { git = "ssh://git.local.ben.io/b3nw/schwab-scraper.git#f1680aec7e26d4ec0ba71890b2f585bec0aeb13d" } +source = { git = "https://gitea.ext.ben.io/b3nw/schwab-scraper.git#f1680aec7e26d4ec0ba71890b2f585bec0aeb13d" } dependencies = [ { name = "aiohttp" }, { name = "greenlet" },