From 7973bb487acad9269ef298030ffdf38b7951ea9f Mon Sep 17 00:00:00 2001 From: ESnark <31977180+ESnark@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:23:38 +0900 Subject: [PATCH 1/2] fix: escape % characters in DATABASE for Alembic config Signed-off-by: ESnark <31977180+ESnark@users.noreply.github.com> --- mcpgateway/alembic/env.py | 4 +++- mcpgateway/bootstrap_db.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mcpgateway/alembic/env.py b/mcpgateway/alembic/env.py index 4788fa76b..00d3a9f0d 100644 --- a/mcpgateway/alembic/env.py +++ b/mcpgateway/alembic/env.py @@ -165,9 +165,11 @@ def _modify_metadata_for_mariadb(): # my_important_option = config.get_main_option("my_important_option") # ... etc. +# Escape '%' characters in URL to avoid configparser interpolation errors +# (e.g., URL-encoded passwords like %40 for '@') config.set_main_option( "sqlalchemy.url", - settings.database_url, + settings.database_url.replace("%", "%%"), ) diff --git a/mcpgateway/bootstrap_db.py b/mcpgateway/bootstrap_db.py index de58d9c61..38a4a1227 100644 --- a/mcpgateway/bootstrap_db.py +++ b/mcpgateway/bootstrap_db.py @@ -257,7 +257,10 @@ async def main() -> None: with engine.begin() as conn: cfg.attributes["connection"] = conn - cfg.set_main_option("sqlalchemy.url", settings.database_url) + # Escape '%' characters in URL to avoid configparser interpolation errors + # (e.g., URL-encoded passwords like %40 for '@') + escaped_url = settings.database_url.replace("%", "%%") + cfg.set_main_option("sqlalchemy.url", escaped_url) insp = inspect(conn) From 70a9676b0986c674b4a9fed6a476823286c1c389 Mon Sep 17 00:00:00 2001 From: Mihai Criveti Date: Fri, 12 Dec 2025 17:11:21 +0000 Subject: [PATCH 2/2] chore: ignore .venv and uv.lock in nested plugin directories Add comprehensive ignore patterns for .venv and uv.lock files in nested directories, particularly plugins/external/opa/. Updated: - .gitignore: Added **/.venv and **/uv.lock patterns - .dockerignore: Added **/.venv and **/uv.lock patterns - MANIFEST.in: Added prune rules and global-exclude patterns - plugins/external/opa/.gitignore: Created for local ignores Signed-off-by: Mihai Criveti --- .dockerignore | 7 +++++++ .gitignore | 9 +++++++++ MANIFEST.in | 9 +++++++-- plugins/external/opa/.gitignore | 20 ++++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 plugins/external/opa/.gitignore diff --git a/.dockerignore b/.dockerignore index 171519f3e..6e9108ce9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -109,6 +109,9 @@ cython_debug/ #---------------------------------------------------------------------- .env .venv +.venv/ +**/.venv +**/.venv/ env/ venv/ ENV/ @@ -123,6 +126,10 @@ pdm.lock .pdm.toml .pdm-python +# uv +uv.lock +**/uv.lock + #---------------------------------------------------------------------- # 5. Package managers and dependencies #---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index bcc35cf9d..359ca3d6f 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,16 @@ logs/ reports/ corpus/ tests/fuzz/fuzzers/results/ + +# Virtual environments (including nested) +.venv/ .venv +**/.venv/ +**/.venv + +# uv lock files (including nested) +uv.lock +**/uv.lock mcp.db public/ ica_integrations_host.sbom.json diff --git a/MANIFEST.in b/MANIFEST.in index c1e0a957a..ff69c078f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -133,11 +133,15 @@ prune .ruff_cache prune .mypy_cache prune htmlcov -# Virtual environments +# Virtual environments (including nested in plugins) prune venv prune .venv prune env prune node_modules +prune plugins/external/opa/.venv +prune plugins/external/llmguard/.venv +prune plugins/external/cedar/.venv +global-exclude **/.venv/* # Environment files (security sensitive!) exclude .env @@ -150,8 +154,9 @@ exclude *.db exclude *.sqlite exclude *.log -# Lock files +# Lock files (including nested in plugins) exclude uv.lock +global-exclude **/uv.lock # Coverage data exclude .coverage diff --git a/plugins/external/opa/.gitignore b/plugins/external/opa/.gitignore new file mode 100644 index 000000000..ea9213a0c --- /dev/null +++ b/plugins/external/opa/.gitignore @@ -0,0 +1,20 @@ +# Virtual environment +.venv/ +.venv + +# uv lock file +uv.lock + +# Coverage data +.coverage +.coverage.* +htmlcov/ + +# Build artifacts +*.egg-info/ +dist/ +build/ + +# Python cache +__pycache__/ +*.py[cod]