diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 27f17c6..f05c769 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: Login to Gitea Registry uses: docker/login-action@v3 with: - registry: git.schweitz.net + registry: git.schweitz.internal username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} @@ -23,5 +23,5 @@ jobs: context: . push: true tags: | - git.schweitz.net/jpmschweitzer/core-api:latest - git.schweitz.net/jpmschweitzer/core-api:${{ github.ref_name }} + git.schweitz.internal/jpmschweitzer/core-api:latest + git.schweitz.internal/jpmschweitzer/core-api:${{ github.ref_name }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2a8f1c6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.0.0] - 2024-12-14 + +### Added + +- Initial release of Core Code API service extracted from portainer-core +- Infrastructure management endpoints for Portainer, NPM, and Uptime Kuma +- Web scraping service with content extraction +- DNS management endpoints +- Health check endpoints with diagnostics +- OIDC authentication support via Authentik +- Ollama integration for embeddings +- OpenAPI documentation (Swagger UI and ReDoc) +- Docker containerization with CI/CD workflow diff --git a/Dockerfile b/Dockerfile index 9f16702..dbef23b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application +COPY pyproject.toml . COPY src/ ./src/ COPY static/ ./static/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c20332d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,10 @@ +[project] +name = "core-api" +version = "1.0.0" +description = "Core Code API - Infrastructure management and tools API" +readme = "README.md" +requires-python = ">=3.12" +license = {text = "MIT"} + +[tool.setuptools] +packages = ["src"] diff --git a/src/config.py b/src/config.py index 88f6b33..220de31 100644 --- a/src/config.py +++ b/src/config.py @@ -1,9 +1,25 @@ """ Global configuration for Core Code API """ +import tomllib +from pathlib import Path from pydantic_settings import BaseSettings from functools import lru_cache + +def _get_version_from_pyproject() -> str: + """Load version from pyproject.toml""" + pyproject_path = Path(__file__).parent.parent / "pyproject.toml" + try: + with open(pyproject_path, "rb") as f: + data = tomllib.load(f) + return data.get("project", {}).get("version", "0.0.0") + except FileNotFoundError: + return "0.0.0" + + +__version__ = _get_version_from_pyproject() + # Import infrastructure credentials from gitignored module try: from src.credentials import ( @@ -35,7 +51,7 @@ class Settings(BaseSettings): # Application app_name: str = "Core Code API" - app_version: str = "1.0.0" + app_version: str = __version__ debug: bool = False # Server