Files
SmartUp/Makefile
T
liumangmang 6044b00685 feat: 上游 Key 唯一化、分组导入跳过、账号导入平台识别&远端校验&base_url 注入
- 上游 Key 命名改为 {prefix}-{upstream.id}-{safe_group_name}-{group_id}
- 唯一约束 (upstream_id, group_id, managed_prefix) 加 managed_prefix 列
- 上游检测成功时同步 Key 状态,远端已删/分组已删自动清理
- 重复分组导入跳过,目标网站已存在同名分组返回 exists
- 账号导入平台自动识别(auto/manual 模式)
- 全选可导入 Key 按钮 + 目标分组自动匹配
- 导入幂等:已导入过的 Key 校验远端账号,不存在则重建
- 新增同步接口 POST /sync-imported-upstream-keys
- account_exists() 通过拉取账号列表判断,避免 404 误判
- credentials.base_url 注入来源上游地址,避免 401
- 前端导入弹窗自动同步+刷新按钮+并发/优先级设置
- 新增 12 个测试覆盖同步、幂等、远端删除、校验失败路径
2026-05-21 01:16:39 +08:00

36 lines
923 B
Makefile

COMPOSE ?= docker compose
SERVICE ?= smartup
.PHONY: up down build build-nc up-build log restart ps
# 日常启动(不重新构建镜像,启动已有容器)
up:
$(COMPOSE) up -d
@port=$$(grep -E '^SERVER_PORT=' .env 2>/dev/null | tail -n 1 | cut -d= -f2-); \
printf '访问地址:http://localhost:%s\n' "$${port:-8899}"
# 构建镜像(带 BuildKit 缓存)
build:
DOCKER_BUILDKIT=1 $(COMPOSE) build
# 强制重新构建(忽略 Docker 层缓存,npm/pip/apt 下载缓存仍可能复用)
build-nc:
DOCKER_BUILDKIT=1 $(COMPOSE) build --no-cache
# 构建并启动(依赖变更后使用)
up-build:
DOCKER_BUILDKIT=1 $(COMPOSE) up -d --build
@port=$$(grep -E '^SERVER_PORT=' .env 2>/dev/null | tail -n 1 | cut -d= -f2-); \
printf '访问地址:http://localhost:%s\n' "$${port:-8899}"
down:
$(COMPOSE) down
log:
$(COMPOSE) logs -f --tail=200 $(SERVICE)
restart: down up
ps:
$(COMPOSE) ps