10 Commits
Author SHA1 Message Date
austnv 895182c211 update env
Build and Deploy Backend / build-and-deploy (push) Successful in 54s
2026-07-03 19:07:07 +03:00
austnv f1d51722aa update uv lock 2026-07-03 19:01:22 +03:00
austnv da5a15237e update dependencies
Build and Deploy Backend / build-and-deploy (push) Successful in 5m2s
2026-07-03 18:51:48 +03:00
austnv c1a7f237ab v0.7.9 2026-06-26 13:34:20 +03:00
austnv 3aa1f582e3 fix: .hex -> str()
Build and Deploy Backend / build-and-deploy (push) Successful in 55s
2026-06-26 13:26:58 +03:00
austnv 006c6487f6 v0.7.8
Build and Deploy Backend / build-and-deploy (push) Successful in 1m10s
2026-06-26 13:23:30 +03:00
austnv 6a4999f48f fix: UUID -> str (.hex property) 2026-06-26 13:22:39 +03:00
austnv 2096e8eb52 fix: remove cache
Build and Deploy Backend / build-and-deploy (push) Successful in 1m9s
2026-06-26 13:17:45 +03:00
austnv f8b765dd99 fix build
Build and Deploy Backend / build-and-deploy (push) Failing after 2m1s
2026-06-26 13:13:37 +03:00
austnv 076d255656 fix build 2026-06-26 13:13:17 +03:00
6 changed files with 34 additions and 25 deletions
+1
View File
@@ -1 +1,2 @@
REMNAWAVE_URL=https://panel.example.com
REMNAWAVE_API_TOKEN=your-token-from-remnawave-panel
+14 -12
View File
@@ -26,17 +26,20 @@ jobs:
username: ${{ gitea.repository_owner }}
password: ${{ secrets.ACCESS_TOKEN }}
- name: Set repository name to lowercase
id: repo
# Преобразуем имена в нижний регистр и собираем метаданные
- name: Prepare metadata
id: meta
run: |
OWNER=$(echo "${{ gitea.repository_owner }}" | tr '[:upper:]' '[:lower:]')
REPO=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]')
echo "owner=$OWNER" >> $GITHUB_OUTPUT
echo "repo=$REPO" >> $GITHUB_OUTPUT
echo "full_repo=$OWNER/$REPO" >> $GITHUB_OUTPUT
# Также сохраняем полный путь к образу
echo "image=git.uvpn.shop/$OWNER/$REPO" >> $GITHUB_OUTPUT
echo "source=https://git.uvpn.shop/${{ gitea.repository }}" >> $GITHUB_OUTPUT
# Формируем дату
echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
@@ -44,14 +47,13 @@ jobs:
context: .
push: true
tags: |
${{ steps.repo.outputs.image }}:latest
${{ steps.repo.outputs.image }}:${{ gitea.ref_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
${{ steps.meta.outputs.image }}:latest
${{ steps.meta.outputs.image }}:${{ gitea.ref_name }}
build-args: |
BUILD_VERSION=${{ gitea.ref_name }}
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
BUILD_DATE=${{ steps.meta.outputs.build_date }}
VCS_REF=${{ github.sha }}
GITEA_REPOSITORY=${{ steps.meta.outputs.source }}
- name: Create Gitea Release via API
run: |
@@ -62,7 +64,7 @@ jobs:
{
"tag_name": "${{ gitea.ref_name }}",
"name": "Release ${{ gitea.ref_name }}",
"body": "## Релиз ${{ gitea.ref_name }}\n\n📝 ${TAG_MESSAGE_ESCAPED}\n\n---\n\n**🏷️ Тег:** \`${{ gitea.ref_name }}\`\n**👤 Автор:** @${{ gitea.actor }}\n**📦 Образ:** \`${{ steps.repo.outputs.image }}:${{ gitea.ref_name }}\`\n\n✅ Автоматически собрано и развёрнуто",
"body": "## Релиз ${{ gitea.ref_name }}\n\n📝 ${TAG_MESSAGE_ESCAPED}\n\n---\n\n**🏷️ Тег:** \`${{ gitea.ref_name }}\`\n**👤 Автор:** @${{ gitea.actor }}\n**📦 Образ:** \`${{ steps.meta.outputs.image }}:${{ gitea.ref_name }}\`\n\n✅ Автоматически собрано и развёрнуто",
"draft": false,
"prerelease": false
}
@@ -103,7 +105,7 @@ jobs:
echo "${{ secrets.ACCESS_TOKEN }}" | docker login git.uvpn.shop -u ${{ gitea.repository_owner }} --password-stdin
# Используем образ с правильным именем в нижнем регистре
export IMAGE_NAME="git.uvpn.shop/uvpn/backend"
export IMAGE_NAME="${{ steps.meta.outputs.image }}"
docker compose pull
docker compose down || true
+10 -3
View File
@@ -6,6 +6,7 @@ WORKDIR /app
ARG BUILD_VERSION=unknown
ARG BUILD_DATE=unknown
ARG VCS_REF=unknown
ARG GITEA_REPOSITORY=unknown
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
@@ -15,13 +16,19 @@ RUN --mount=type=cache,target=/root/.cache/uv \
FROM python:3.12-alpine
WORKDIR /app
# Аргументы должны быть объявлены в каждом этапе
ARG BUILD_VERSION=unknown
ARG BUILD_DATE=unknown
ARG VCS_REF=unknown
ARG GITEA_REPOSITORY=unknown
# Метки для образа
LABEL org.opencontainers.image.title="uVPN Backend"
LABEL org.opencontainers.image.description="uVPN Shop Backend Service"
LABEL org.opencontainers.image.title="UVPN Backend"
LABEL org.opencontainers.image.description="UVPN Shop Backend Service"
LABEL org.opencontainers.image.version="${BUILD_VERSION}"
LABEL org.opencontainers.image.created="${BUILD_DATE}"
LABEL org.opencontainers.image.revision="${VCS_REF}"
LABEL org.opencontainers.image.source="https://git.uvpn.shop/${{ gitea.repository }}"
LABEL org.opencontainers.image.source="${GITEA_REPOSITORY}"
LABEL org.opencontainers.image.licenses="MIT"
COPY --from=builder /app/.venv /app/.venv
+2 -2
View File
@@ -1,6 +1,6 @@
[project]
name = "uvpn-backend"
version = "0.7.7"
version = "0.7.11"
description = "FastAPI backend with Docker for uvpn.shop"
readme = "README.md"
requires-python = ">=3.12"
@@ -10,7 +10,7 @@ dependencies = [
"bs4>=0.0.2",
"fastapi>=0.136.3",
"httpx>=0.27.2",
"remnawave>=2.7.1",
"remnawave>=2.8.0",
"uvicorn>=0.49.0",
]
+2 -2
View File
@@ -10,7 +10,7 @@ import re
logging.basicConfig(level=logging.INFO)
router = APIRouter(prefix='/api/v1', tags=['hosts'])
remnawave = RemnawaveSDK(base_url='http://remnawave:3000', token=getenv('REMNAWAVE_API_TOKEN'))
remnawave = RemnawaveSDK(base_url=getenv('REMNAWAVE_URL'), token=getenv('REMNAWAVE_API_TOKEN'))
def clean_host_name(name):
@@ -42,7 +42,7 @@ async def get_nodes():
'name': clean_host_name(host.remark),
'address': host.address,
'port': host.port,
'country_code': (await remnawave.nodes.get_one_node(uuid=host.nodes[0])).country_code
'country_code': (await remnawave.nodes.get_one_node(uuid=str(host.nodes[0]))).country_code
}
for host in hosts.root if not host.is_disabled and not host.is_hidden
Generated
+5 -6
View File
@@ -838,19 +838,18 @@ wheels = [
[[package]]
name = "remnawave"
version = "2.7.1"
version = "2.8.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "cryptography" },
{ name = "httpx" },
{ name = "orjson" },
{ name = "pydantic", extra = ["email"] },
{ name = "pydantic-core" },
{ name = "rapid-api-client" },
]
sdist = { url = "https://files.pythonhosted.org/packages/74/76/71115ed546d909a37d2a349aec01cc9aeb70e9186b8e4977f084f045c5b0/remnawave-2.7.1.tar.gz", hash = "sha256:0e3477925b8681dc69fe1874862e4508aed2f66311a6ab437bf06ba57a63754d", size = 59840, upload-time = "2026-04-03T15:08:31.85Z" }
sdist = { url = "https://files.pythonhosted.org/packages/25/f2/70034a719685a46dadc6e3f77122f991bda7f29af8b80ef5c176f8d525c0/remnawave-2.8.0.tar.gz", hash = "sha256:e1bafd65f77d0352eda96acc061d4275bb3b3d77db89a9549ed5e66849538c0e", size = 64513, upload-time = "2026-07-02T00:49:54.078Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/8d/f2/dcb5a041549eb10b8ed9c94e5953c95a62846746916c956d92e9b41734c6/remnawave-2.7.1-py3-none-any.whl", hash = "sha256:73b93fbe4b4454189e50d51266f089ca292d608e286cf92c0b3d1d9bc9201f7b", size = 92191, upload-time = "2026-04-03T15:08:30.323Z" },
{ url = "https://files.pythonhosted.org/packages/fc/14/fccb15c25833c2e5a950a1faf721089611dc33b0c0767903034885726f01/remnawave-2.8.0-py3-none-any.whl", hash = "sha256:ca9d004cdf32b2a0504442f809f0c6dabe9bfb8857dd1f00e3ecca3998502f02", size = 98173, upload-time = "2026-07-02T00:49:52.464Z" },
]
[[package]]
@@ -1104,7 +1103,7 @@ wheels = [
[[package]]
name = "uvpn-backend"
version = "0.3.0"
version = "0.7.10"
source = { virtual = "." }
dependencies = [
{ name = "aiofiles" },
@@ -1128,7 +1127,7 @@ requires-dist = [
{ name = "bs4", specifier = ">=0.0.2" },
{ name = "fastapi", specifier = ">=0.136.3" },
{ name = "httpx", specifier = ">=0.27.2" },
{ name = "remnawave", specifier = ">=2.7.1" },
{ name = "remnawave", specifier = ">=2.8.0" },
{ name = "uvicorn", specifier = ">=0.49.0" },
]