refactor!: 全量改名 —— 仓库 / 目录 / 服务 / 文档 / 站点全部换成 xiaoyin-gateway
老板要求「全改」,所以这次不只是展示名:
仓库
· Gitea Jidekin/api-gateway → Jidekin/xiaoyin-gateway
· GitHub wangjinding/api-gateway → wangjinding/xiaoyin-gateway
· 本地 remote 两个都改了,ls-remote 验证可访问
本机
· /root/dsh/projects/api-gateway → xiaoyin-gateway
· /root/.venvs/api-gateway → xiaoyin-gateway
· supervisor [program:api-gateway] → [program:xiaoyin-gateway]
(reread + update + 重启后 RUNNING,根接口正常返回 小银网关 2.9.16)
引用同步
· security/uptime-check.sh、backup-app-data.sh、backup-restore-drill.sh 的路径
· AGENTS.md、home-network.md(后者已同步思源)
· README / CHANGELOG / docs / Makefile 提示语 / 前端包名 / 站点里的 git clone 地址
有意保留的两处
· 前端备份数据的 kind: 'api-gateway-backup' —— 数据格式标识,改了旧备份认不出来
· frontend/dist 里的同名常量(同上)
This commit is contained in:
1 parent
c1f8882e9a
commit
cc2d7bec5a
8 files changed
+18
-18
No files matched your search
+2
-2
@@ -573,7 +573,7 @@ token 正常(输入 41 / 输出 12 / 推理 12);成员视角只看到自
|
||||
|
||||
- **新增 `scripts/push_gitea.sh`**:与旧推送脚本同一套安全口径(一次性带凭据内嵌 URL;
|
||||
不带密码退出 2 / 工作区不干净退出 3 / 推完核对「远端 = 本地」/ 复查 `.git/config` 无明文;
|
||||
**密码不内置进任何文件**),只是目标换成 `https://git.wangjinding.com/Jidekin/api-gateway.git`。
|
||||
**密码不内置进任何文件**),只是目标换成 `https://git.wangjinding.com/Jidekin/xiaoyin-gateway.git`。
|
||||
- **旧的推送脚本已停用并移除**(不再使用)。
|
||||
- **`README.md`**「版本号与发布纪律 → 发布流程」一节:推送目标改为 `推 Gitea`。
|
||||
- **背景**:旧托管的凭据已实测失效(推送与 `ls-remote` 都回 `Repository Not Found.`);同期老板起了自建 Gitea
|
||||
@@ -2006,4 +2006,4 @@ dict 即使一个模型都没变也是**真值** → 每天无漂移也重写一
|
||||
- 项目此前**不是 git 仓库**:`git init` 建库、设提交身份、首次提交(**91 个源码文件**)。
|
||||
- **`.gitignore` 补充**忽略 `node_modules/`、`frontend/node_modules/`、`frontend/dist/`、`dist/`、`*.egg-info/`、`.DS_Store` —— 否则 `git add -A` 会把 **15342 个 node_modules 文件**塞进仓库。
|
||||
- **推送前安全审计**:确认 `.env`、`data/users.json`、`data/history.json`、`data/feedback.json`、`data/feedback_media/` 全部被忽略、无任何密钥/隐私入库(仅无密钥的 `.env.example` 模板随库)。
|
||||
- **远程**:远端仓库 `Jidekin/api-gateway`,分支 `master`(2026-10-12 起统一为 `main`),首推成功(远端 `HEAD=6cc65ff` 与本地一致)。`origin` 配为不含凭据的干净地址,**凭据不写入 `.git/config`**;后续推送临时带凭据。
|
||||
- **远程**:远端仓库 `Jidekin/xiaoyin-gateway`,分支 `master`(2026-10-12 起统一为 `main`),首推成功(远端 `HEAD=6cc65ff` 与本地一致)。`origin` 配为不含凭据的干净地址,**凭据不写入 `.git/config`**;后续推送临时带凭据。
|
||||
@@ -8,7 +8,7 @@ PORT ?= 8808
|
||||
.PHONY: help install run test lint clean
|
||||
|
||||
help: ## 显示帮助
|
||||
@echo "api-gateway 常用命令:"
|
||||
@echo "小银网关 常用命令:"
|
||||
@echo " make install 安装依赖"
|
||||
@echo " make run 本地启动(端口 $(PORT))"
|
||||
@echo " make test 跑单元测试(不依赖真实上游)"
|
||||
|
||||
@@ -486,7 +486,7 @@ pricing: # 人民币/百万 token,用于估算成本
|
||||
## 启动
|
||||
|
||||
```bash
|
||||
cd api-gateway
|
||||
cd xiaoyin-gateway
|
||||
pip install -r requirements.txt
|
||||
python run.py # 默认读 data/gateway.yaml,端口 8808
|
||||
```
|
||||
@@ -1388,7 +1388,7 @@ VERSION = "2.4.0" # ← 只改这一处
|
||||
后端/代码:supervisorctl restart api-gateway:api-gateway_00
|
||||
→ 真机验证(线上 healthz / 页面 / 接口)
|
||||
→ git commit
|
||||
→ 推 Gitea(scripts/push_gitea.sh,仓库 Jidekin/api-gateway 分支 main)
|
||||
→ 推 Gitea(scripts/push_gitea.sh,仓库 Jidekin/xiaoyin-gateway 分支 main)
|
||||
```
|
||||
|
||||
**「只要上生产就必须推」** 是既有硬性规矩:保持"线上跑着的代码 = 仓库里的代码"。**凡是重启上线(后端
|
||||
@@ -1398,7 +1398,7 @@ restart)或 `npm run build` 覆盖 `frontend/dist` 的代码改动,验证通
|
||||
的顺序取凭据(token 是 2026-10-12 建的 Gitea API token,scope `write:repository`);
|
||||
凭据只一次性内嵌进本次推送 URL,**不写 `.git/config`、也不内置进仓库任何文件**;
|
||||
退出码 2=没凭据 / 3=工作区不干净 / 4=推送后远端≠本地 / 5=`.git/config` 出现明文。
|
||||
仓库 `https://git.wangjinding.com/Jidekin/api-gateway.git`、分支 `main`
|
||||
仓库 `https://git.wangjinding.com/Jidekin/xiaoyin-gateway.git`、分支 `main`
|
||||
(`remote` 名就叫 `gitea`)。**三个项目分支已统一为 `main`**
|
||||
(2026-10-12:api-gateway 原 `master` 改名 `main`,Gitea 默认分支同步改、旧 `master` 分支删除)。
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "api-gateway-web",
|
||||
"name": "xiaoyin-gateway-web",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "api-gateway-web",
|
||||
"name": "xiaoyin-gateway-web",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"dompurify": "^3.4.15",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "api-gateway-web",
|
||||
"name": "xiaoyin-gateway-web",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# 开发/测试依赖(生产不需要)
|
||||
-r requirements.txt
|
||||
pytest>=8.0 # tests/ 有 225 个用例:/root/.venvs/api-gateway/bin/python -m pytest tests/ -q
|
||||
pytest>=8.0 # tests/ 有 225 个用例:/root/.venvs/xiaoyin-gateway/bin/python -m pytest tests/ -q
|
||||
@@ -23,7 +23,7 @@
|
||||
# **绝不写进本仓库任何文件**(仓库是要推到远端的)。
|
||||
set -euo pipefail
|
||||
|
||||
REPO_URL="https://git.wangjinding.com/Jidekin/api-gateway.git"
|
||||
REPO_URL="https://git.wangjinding.com/Jidekin/xiaoyin-gateway.git"
|
||||
USER="Jidekin"
|
||||
TOKEN_FILE="${HOME}/.gitea_token"
|
||||
|
||||
@@ -50,11 +50,11 @@ echo "== 推送 $BRANCH → Gitea($REPO_URL)=="
|
||||
echo " 本地 HEAD = $(git rev-parse --short HEAD)"
|
||||
|
||||
# 一次性内嵌凭据;输出里把凭据打码,避免它进日志/终端回滚缓冲
|
||||
git push "https://${USER}:${CRED}@git.wangjinding.com/Jidekin/api-gateway.git" "${BRANCH}:${BRANCH}" 2>&1 \
|
||||
git push "https://${USER}:${CRED}@git.wangjinding.com/Jidekin/xiaoyin-gateway.git" "${BRANCH}:${BRANCH}" 2>&1 \
|
||||
| sed "s/${CRED}/[CRED]/g"
|
||||
|
||||
# 推完核对:远端 HEAD 必须 = 本地 HEAD;并复查 .git/config 没被塞进明文凭据
|
||||
REMOTE_HEAD="$(git ls-remote "https://${USER}:${CRED}@git.wangjinding.com/Jidekin/api-gateway.git" "refs/heads/${BRANCH}" | awk '{print $1}')"
|
||||
REMOTE_HEAD="$(git ls-remote "https://${USER}:${CRED}@git.wangjinding.com/Jidekin/xiaoyin-gateway.git" "refs/heads/${BRANCH}" | awk '{print $1}')"
|
||||
LOCAL_HEAD="$(git rev-parse HEAD)"
|
||||
if [ "$REMOTE_HEAD" = "$LOCAL_HEAD" ]; then
|
||||
echo "✓ 远端 = 本地(${LOCAL_HEAD:0:7})"
|
||||
|
||||
+5
-5
@@ -256,7 +256,7 @@
|
||||
<a href="#about">关于</a>
|
||||
</nav>
|
||||
<div class="nav-cta">
|
||||
<a class="ghost" href="https://git.wangjinding.com/Jidekin/api-gateway" target="_blank" rel="noopener">源码</a>
|
||||
<a class="ghost" href="https://git.wangjinding.com/Jidekin/xiaoyin-gateway" target="_blank" rel="noopener">源码</a>
|
||||
<a class="btn btn-blue btn-sm" href="#deploy">快速开始</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -386,8 +386,8 @@
|
||||
<div class="grid" style="grid-template-columns:1fr">
|
||||
<div class="card">
|
||||
<h3><span class="ico">⌨</span>从源码跑起来</h3>
|
||||
<pre class="code"><code>git clone https://git.wangjinding.com/Jidekin/api-gateway.git
|
||||
cd api-gateway
|
||||
<pre class="code"><code>git clone https://git.wangjinding.com/Jidekin/xiaoyin-gateway.git
|
||||
cd xiaoyin-gateway
|
||||
pip install -r requirements.txt
|
||||
|
||||
cp .env.example .env <span class="c-com"># 填各家供应商的 token</span>
|
||||
@@ -460,9 +460,9 @@ providers:
|
||||
<div class="wrap">
|
||||
<span>© 2026 小银网关 · <span data-ver>2.9.16</span></span>
|
||||
<span class="sep">·</span>
|
||||
<a href="https://git.wangjinding.com/Jidekin/api-gateway" target="_blank" rel="noopener">Gitea</a>
|
||||
<a href="https://git.wangjinding.com/Jidekin/xiaoyin-gateway" target="_blank" rel="noopener">Gitea</a>
|
||||
<span class="sep">·</span>
|
||||
<a href="https://github.com/wangjinding/api-gateway" target="_blank" rel="noopener">GitHub</a>
|
||||
<a href="https://github.com/wangjinding/xiaoyin-gateway" target="_blank" rel="noopener">GitHub</a>
|
||||
<span class="sep">·</span>
|
||||
<span>MIT License</span>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user