refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s

- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名)
- 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块)
- docreader proto 描述符采用等长替换,保持序列化字节布局有效
- Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像
- 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
This commit is contained in:
runny committed 2026-11-13 20:52:51 +08:00
1 parent 9097ee699d
commit 9058149576
3136 files changed
+18018 -18004

No files matched your search

+15 -15
View File
@@ -12,13 +12,13 @@ import (
"github.com/gin-gonic/gin"
"github.com/golang-jwt/jwt/v5"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/errors"
"github.com/Tencent/WeKnora/internal/handler/dto"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
secutils "github.com/Tencent/WeKnora/internal/utils"
"academy/internal/config"
"academy/internal/errors"
"academy/internal/handler/dto"
"academy/internal/logger"
"academy/internal/types"
"academy/internal/types/interfaces"
secutils "academy/internal/utils"
)
// TenantHandler implements HTTP request handlers for tenant management
@@ -192,7 +192,7 @@ const (
const defaultMaxOwnedTenantsPerUser = 10
// resolveMaxOwnedTenantsPerUser returns the current cap, walking the
// 3-tier resolver: system_settings DB row > WEKNORA_TENANT_MAX_OWNED_PER_USER
// 3-tier resolver: system_settings DB row > ACADEMY_TENANT_MAX_OWNED_PER_USER
// env > config.Tenant.MaxOwnedPerUser (yaml) > defaultMaxOwnedTenantsPerUser.
// We pre-compute the cfg-derived fallback so the SystemSettingService
// receives a single int64 default — its 3-tier resolver layers DB and
@@ -205,7 +205,7 @@ func (h *TenantHandler) resolveMaxOwnedTenantsPerUser(ctx context.Context) int {
return int(h.systemSettingSvc.GetInt(
ctx,
"tenant.max_owned_per_user",
"WEKNORA_TENANT_MAX_OWNED_PER_USER",
"ACADEMY_TENANT_MAX_OWNED_PER_USER",
fallback,
))
}
@@ -215,7 +215,7 @@ func (h *TenantHandler) resolveMaxOwnedTenantsPerUser(ctx context.Context) int {
// @Description 创建新的空间。任意已登录用户均可调用以建立自己的新工作区,
// @Description 调用方会被自动设为该空间的 Owner。跨空间超管仍可像以前一样
// @Description 通过本接口创建任意空间。
// @Description 当 tenant.auto_create_api_key(或 WEKNORA_TENANT_AUTO_CREATE_API_KEY)
// @Description 当 tenant.auto_create_api_key(或 ACADEMY_TENANT_AUTO_CREATE_API_KEY)
// @Description 开启时,会自动创建一个 full_access API Key,并在响应体的 data.api_key 字段返回其明文 token。
// @Tags 空间管理
// @Accept json
@@ -335,7 +335,7 @@ func (h *TenantHandler) CreateTenant(c *gin.Context) {
gb := h.systemSettingSvc.GetInt(
ctx,
"tenant.default_storage_quota_gb",
"WEKNORA_TENANT_DEFAULT_STORAGE_QUOTA_GB",
"ACADEMY_TENANT_DEFAULT_STORAGE_QUOTA_GB",
10,
)
if gb <= 0 {
@@ -460,7 +460,7 @@ func (h *TenantHandler) CreateTenant(c *gin.Context) {
// Optional legacy compatibility: mint a full-access API key on tenant
// creation and return its plaintext token, gated by the
// tenant.auto_create_api_key setting (env WEKNORA_TENANT_AUTO_CREATE_API_KEY).
// tenant.auto_create_api_key setting (env ACADEMY_TENANT_AUTO_CREATE_API_KEY).
// Default off — modern deployments create keys explicitly via
// tenant_api_keys. Failing to create the convenience key must NOT fail
// the whole tenant creation (the tenant is fully usable without a key);
@@ -514,7 +514,7 @@ func tenantWithAPIKey(tenant *types.Tenant, token string) (map[string]any, error
// autoCreateTenantAPIKey resolves whether tenant creation should also mint a
// full-access API key (legacy compatibility). 3-tier resolver:
// system_settings DB row > WEKNORA_TENANT_AUTO_CREATE_API_KEY env > false.
// system_settings DB row > ACADEMY_TENANT_AUTO_CREATE_API_KEY env > false.
func (h *TenantHandler) autoCreateTenantAPIKey(ctx context.Context) bool {
if h.systemSettingSvc == nil {
return false
@@ -522,7 +522,7 @@ func (h *TenantHandler) autoCreateTenantAPIKey(ctx context.Context) bool {
return h.systemSettingSvc.GetBool(
ctx,
"tenant.auto_create_api_key",
"WEKNORA_TENANT_AUTO_CREATE_API_KEY",
"ACADEMY_TENANT_AUTO_CREATE_API_KEY",
false,
)
}
@@ -1064,7 +1064,7 @@ func (h *TenantHandler) CreateAPIPrincipalTestToken(c *gin.Context) {
token, err := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
"sub": externalUserID,
"tenant_id": strconv.FormatUint(id, 10),
"aud": "weknora",
"aud": "academy",
"iat": now.Unix(),
"exp": expiresAt.Unix(),
}).SignedString([]byte(secret))