From d71a6f48865c00319f38de41c651bb50a5c8a39c Mon Sep 17 00:00:00 2001 From: dongsk Date: Wed, 2 Sep 2026 17:36:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E5=90=8E=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 28 ++++++++++++++++++++++++++++ .gitignore | 2 ++ scripts/seed.py | 1 - 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c90f594 --- /dev/null +++ b/.env.example @@ -0,0 +1,28 @@ +# ============================================================ +# MCP Auth 鉴权管理后台 — 环境变量示例 +# 复制为 .env 后按需修改;.env 不会被 git 跟踪 +# ============================================================ + +# ── 后端(backend/docker-compose.yml / 本地 uvicorn)── +# PostgreSQL(mcp_auth 库,先执行 scripts/seed.py 初始化) +AUTH_DB_HOST=10.100.154.100 +AUTH_DB_PORT=5432 +AUTH_DB_USER=postgres +AUTH_DB_PASSWORD=digiwin +AUTH_DB_NAME=mcp_auth +# 鼎捷云 IAM +IAM_BASE_URL=https://iam.digiwincloud.com.cn +IAM_APP_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.xxx +# IAM token 校验结果 Redis 缓存秒数 +IAM_CACHE_TTL=30 +# Redis(缓存 IAM 校验结果) +REDIS_HOST=10.100.154.100 +REDIS_PORT=6379 +REDIS_DB=0 +REDIS_PASSWORD=digiwin +# 外层反向代理路径前缀(直连时留空) +ROOT_PATH=/mcp-auth-api + +# ── 前端(frontend/docker-compose.yml)── +# 后端 API 地址(nginx 反代目标) +BACKEND_URL=https://mcp-auth-admin.digiwincloud.com.cn/mcp-auth-api diff --git a/.gitignore b/.gitignore index 0062c13..51b9aaa 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,8 @@ node_modules/ dist/ # Vite 缓存 .vite/ +# TypeScript 增量构建缓存 +*.tsbuildinfo # npm/pnpm/yarn 锁文件按需保留;如需忽略锁文件取消下行注释 # package-lock.json # pnpm-lock.yaml diff --git a/scripts/seed.py b/scripts/seed.py index ac5a748..2d32772 100644 --- a/scripts/seed.py +++ b/scripts/seed.py @@ -19,7 +19,6 @@ import asyncpg INIT_SQL_PATH = Path(__file__).resolve().parent.parent / "sql" / "init.sql" - async def main() -> None: parser = argparse.ArgumentParser(description="初始化 mcp_auth 库并建表") parser.add_argument("--host", default=os.getenv("MCP_AUTH_DB_HOST", "127.0.0.1"))