diff --git a/.gitignore b/.gitignore index 150e301..d744af3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,47 +1,47 @@ -# Byte-compiled / optimized / DLL files +# 字节码、优化文件和 DLL 文件 __pycache__/ *.py[cod] *$py.class -# C extensions +# C 扩展 *.so -# Distribution / packaging +# 分发与打包 build/ dist/ eggs/ *.egg-info/ .eggs/ -# Installer logs +# 安装程序日志 pip-log.txt pip-delete-this-directory.txt -# Unit test / coverage reports +# 单元测试与覆盖率报告 .pytest_cache/ coverage/ .coverage htmlcov/ -# Virtual environments +# 虚拟环境 venv/ env/ .venv/ ENV/ env.bak/ -# IDE/editor files +# IDE 与编辑器文件 .vscode/ .idea/ *.sublime-workspace *.sublime-project .github/prompts/* -# OS files +# 操作系统文件 .DS_Store Thumbs.db -# Logs and local runtime files +# 日志与本地运行时文件 *.log *.pid @@ -49,13 +49,13 @@ Thumbs.db *.manifest *.spec -# Local settings and secrets +# 本地设置与敏感信息 local_settings.py secrets.yml *.pem *.key -# Data files +# 数据文件 *.sqlite3 *.db data/plugin_media/ @@ -64,34 +64,34 @@ data/skill_packages/ # Jupyter .ipynb_checkpoints -# Node / frontend +# Node 与前端 node_modules/ npm-debug.log frontend/node_modules/ frontend/dist/ -# Frontend build output (generated by `npm run build`) +# 前端构建产物(由 `npm run build` 生成) src/plugin_market_backend/static/assets/ src/plugin_market_backend/static/font-licenses/ src/plugin_market_backend/static/index.html -# Coverage and reports +# 覆盖率与报告 reports/ -# Ignore compiled binaries +# 忽略已编译的二进制文件 *.exe *.dll *.so -# Ignore temporary files +# 忽略临时文件 *.tmp ~* -# Ignore build artifacts from poetry/uv if any +# 忽略 poetry/uv 可能生成的构建产物 .venv/ poetry.lock -# Project-specific +# 项目专用规则 /.pytest_cache/ /test/__pycache__/ diff --git a/BACKEND_API.md b/BACKEND_API.md index b05c763..9a5a3a2 100644 --- a/BACKEND_API.md +++ b/BACKEND_API.md @@ -70,7 +70,7 @@ Authorization: Bearer { "error": { "code": "ERROR_CODE", - "message": "Human readable message", + "message": "可供用户阅读的错误消息", "details": {} } } diff --git a/Dockerfile b/Dockerfile index 14c1df6..98616b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Stage 1: Build frontend +# 第一阶段:构建前端 FROM node:22-slim AS frontend-build WORKDIR /frontend @@ -9,7 +9,7 @@ RUN npm ci COPY frontend/ ./ RUN npm run build -# Stage 2: Python backend +# 第二阶段:Python 后端 FROM python:3.12-slim WORKDIR /app @@ -20,7 +20,7 @@ COPY pyproject.toml uv.lock README.md alembic.ini ./ COPY migrations ./migrations COPY src ./src -# Copy frontend build output into backend static directory +# 将前端构建产物复制到后端静态文件目录 COPY --from=frontend-build /src/plugin_market_backend/static/ ./src/plugin_market_backend/static/ RUN uv sync --frozen --no-dev diff --git a/README.md b/README.md index 3856f43..4a18e33 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ docker compose up --build - `postgres` 仅在 Docker 网络内暴露,不直接开放到公网。 - `api` 仅绑定宿主机 `127.0.0.1:8787`,用于给 Nginx、Caddy 等反向代理转发。 -- 反向代理再把公网域名,例如 `https://market.mofox-sama.com`,转发到 `http://127.0.0.1:8787`。 +- 反向代理再把公网域名,例如 `https://market.mofox.chat`,转发到 `http://127.0.0.1:8787`。 Skill 存储说明: @@ -94,8 +94,8 @@ docker compose logs -f api 如果你要通过域名访问服务,至少需要: -- 将 `market.mofox-sama.com` 的 DNS A 记录指向部署服务器公网 IP。 -- 将 `PLUGIN_MARKET_GITHUB_OAUTH_REDIRECT_URI` 改为 `https://market.mofox-sama.com/api/v1/auth/github/callback`。 +- 将 `market.mofox.chat` 的 DNS A 记录指向部署服务器公网 IP。 +- 将 `PLUGIN_MARKET_GITHUB_OAUTH_REDIRECT_URI` 改为 `https://market.mofox.chat/api/v1/auth/github/callback`。 - 在反向代理中把域名转发到 `127.0.0.1:8787`。 Nginx 反代示例: @@ -103,16 +103,16 @@ Nginx 反代示例: ```nginx server { listen 80; - server_name market.mofox-sama.com; + server_name market.mofox.chat; return 301 https://$host$request_uri; } server { listen 443 ssl http2; - server_name market.mofox-sama.com; + server_name market.mofox.chat; - ssl_certificate /etc/letsencrypt/live/market.mofox-sama.com/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/market.mofox-sama.com/privkey.pem; + ssl_certificate /etc/letsencrypt/live/market.mofox.chat/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/market.mofox.chat/privkey.pem; location / { proxy_pass http://127.0.0.1:8787; @@ -153,13 +153,18 @@ PLUGIN_MARKET_DATABASE_URL=postgresql+asyncpg://plugin_market:plugin_market@post 公共查询接口不需要认证。 -浏览器用户只能通过 GitHub OAuth 登录。创建 GitHub OAuth App 时,callback URL 设置为: +浏览器用户只能通过 GitHub OAuth 登录。生产环境创建 GitHub OAuth App 时设置为: + +- Homepage URL:`https://market.mofox.chat` +- Authorization callback URL:`https://market.mofox.chat/api/v1/auth/github/callback` + +本地开发时可将 `PLUGIN_MARKET_GITHUB_OAUTH_REDIRECT_URI` 改为: ```text http://127.0.0.1:8787/api/v1/auth/github/callback ``` -生产环境应改成你的公网域名,并把管理员 GitHub 登录名写入 `PLUGIN_MARKET_ADMIN_GITHUB_LOGINS`。 +并把管理员 GitHub 登录名写入 `PLUGIN_MARKET_ADMIN_GITHUB_LOGINS`。 作者侧接口使用: diff --git a/frontend/index.html b/frontend/index.html index 378b3a3..2fc4595 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -16,10 +16,10 @@ })(); diff --git a/frontend/src/components/AppIcon.vue b/frontend/src/components/AppIcon.vue index b76a9d2..b9c00fc 100644 --- a/frontend/src/components/AppIcon.vue +++ b/frontend/src/components/AppIcon.vue @@ -1,7 +1,7 @@