From 94a48bef6e62543f5976605ab2a6e5f9da84fd82 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 11 Sep 2026 16:36:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E7=BD=B2=E6=8C=81=E4=B9=85=E5=8C=96?= =?UTF-8?q?=20deploy/=EF=BC=9A=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84=20+=20?= =?UTF-8?q?=E7=A9=BA=20domains.json=20+=20=E8=84=B1=E6=95=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .gitignore 由整体排除 deploy/ 改为精确排除真实凭据(users.json/llm-upstreams.json) 与 36MB 内置凭据镜像包(*.tar.gz),保留模板与空 domains.json 可入库 - 新增 users.json.example / llm-upstreams.json.example(占位符,部署时填真实凭据) - 红线:admin 口令哈希/API Key、上游真 Key、镜像包 仍只进镜像/本地,不入库 --- .gitignore | 7 +++++-- deploy/data-seed/domains.json | 1 + deploy/data-seed/llm-upstreams.json.example | 7 +++++++ deploy/data-seed/users.json.example | 14 ++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 deploy/data-seed/domains.json create mode 100644 deploy/data-seed/llm-upstreams.json.example create mode 100644 deploy/data-seed/users.json.example diff --git a/.gitignore b/.gitignore index ed84900..56609dd 100644 --- a/.gitignore +++ b/.gitignore @@ -50,5 +50,8 @@ conf/tls/**/*.cer conf/tls/**/*.crt conf/tls/**/*.pem -# 种子数据含 API Key 与上游真 Key,只进镜像不入库 -deploy/ +# 部署种子数据:真实凭据与镜像只进镜像/本地,不入库;模板(.example)与空 domains.json 可入库 +# users.json 含 admin 口令哈希 + API Key;llm-upstreams.json 含上游厂商真 Key;tar.gz 是内置凭据的镜像包 +deploy/data-seed/users.json +deploy/data-seed/llm-upstreams.json +deploy/*.tar.gz diff --git a/deploy/data-seed/domains.json b/deploy/data-seed/domains.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/deploy/data-seed/domains.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/deploy/data-seed/llm-upstreams.json.example b/deploy/data-seed/llm-upstreams.json.example new file mode 100644 index 0000000..6297262 --- /dev/null +++ b/deploy/data-seed/llm-upstreams.json.example @@ -0,0 +1,7 @@ +{ + "deepseek": { + "base": "https://api.deepseek.com/v1", + "auth": "Bearer <上游厂商真实 API Key,部署时填写,网关会原样转发到上游>", + "enabled": true + } +} diff --git a/deploy/data-seed/users.json.example b/deploy/data-seed/users.json.example new file mode 100644 index 0000000..32695b7 --- /dev/null +++ b/deploy/data-seed/users.json.example @@ -0,0 +1,14 @@ +{ + "admin": { + "username": "admin", + "role": "admin", + "salt": "<随机32位hex,部署时用 openssl rand -hex 16 生成>", + "pwd_hash": "", + "api_key": "", + "allowed_models": [], + "llm_rpm": 60, + "llm_daily": 0, + "temp_grant_until": 0, + "created_at": 0 + } +}