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

+30 -30
View File
@@ -17,26 +17,26 @@ import (
"github.com/google/uuid"
"github.com/redis/go-redis/v9"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/models/limiter"
"github.com/Tencent/WeKnora/internal/sandbox"
"github.com/Tencent/WeKnora/internal/types"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/config"
"academy/internal/logger"
"academy/internal/models/limiter"
"academy/internal/sandbox"
"academy/internal/types"
"academy/internal/types/interfaces"
"academy/internal/utils"
)
// pubsubChannelBase is the Redis channel base for system_settings change
// notifications. Mirrors the convention from approval/gate.go: optional
// suffix WEKNORA_REDIS_NAMESPACE so two deployments sharing one Redis
// suffix ACADEMY_REDIS_NAMESPACE so two deployments sharing one Redis
// instance don't cross-talk.
const pubsubChannelBase = "weknora:system_settings:changed"
const pubsubChannelBase = "academy:system_settings:changed"
// pubsubChannel resolves the effective channel name (with optional
// namespace suffix). Called both at publish time and inside the
// subscriber loop — keep it pure.
func pubsubChannel() string {
if ns := strings.TrimSpace(os.Getenv("WEKNORA_REDIS_NAMESPACE")); ns != "" {
if ns := strings.TrimSpace(os.Getenv("ACADEMY_REDIS_NAMESPACE")); ns != "" {
return pubsubChannelBase + ":" + ns
}
return pubsubChannelBase
@@ -146,7 +146,7 @@ var registry = map[string]settingSpec{
},
"auth.default_tenant_mode": {
Type: "string",
EnvName: "WEKNORA_AUTH_DEFAULT_TENANT_MODE",
EnvName: "ACADEMY_AUTH_DEFAULT_TENANT_MODE",
Default: "create_personal",
Enum: []string{"create_personal", "tenantless"},
Category: "auth",
@@ -155,7 +155,7 @@ var registry = map[string]settingSpec{
},
"auth.complex_password_enabled": {
Type: "bool",
EnvName: "WEKNORA_AUTH_COMPLEX_PASSWORD_ENABLED",
EnvName: "ACADEMY_AUTH_COMPLEX_PASSWORD_ENABLED",
Default: false,
Category: "auth",
Description: "是否启用复杂密码。开启后密码必须包含大小写字母、数字和特殊字符。" +
@@ -170,7 +170,7 @@ var registry = map[string]settingSpec{
// over the auto-join. Read on every OIDC login (finishOIDCLogin).
"auth.oidc_auto_join_shared_space": {
Type: "bool",
EnvName: "WEKNORA_AUTH_OIDC_AUTO_JOIN_SHARED_SPACE",
EnvName: "ACADEMY_AUTH_OIDC_AUTO_JOIN_SHARED_SPACE",
Default: false,
Category: "auth",
Description: "OIDC 用户同源共享空间。开启后,OIDC(如 Casdoor)登录开户的用户自动加入" +
@@ -199,13 +199,13 @@ var registry = map[string]settingSpec{
// tenant.max_owned_per_user caps how many tenants a single non-superuser
// can create (and Own) via self-service POST /tenants. Read on every
// request — UI edits take effect immediately, no restart required. The
// EnvName is the same WEKNORA_TENANT_MAX_OWNED_PER_USER that
// EnvName is the same ACADEMY_TENANT_MAX_OWNED_PER_USER that
// applyAuthAndTenantDefaults parses at boot, so a deployment that
// hasn't created a DB row keeps reading from env exactly as before.
// 0 = use the in-code default (10); negative = disable the cap entirely.
"tenant.max_owned_per_user": {
Type: "int",
EnvName: "WEKNORA_TENANT_MAX_OWNED_PER_USER",
EnvName: "ACADEMY_TENANT_MAX_OWNED_PER_USER",
Default: int64(10),
Category: "tenant",
Description: "每个非超管用户通过自助创建可拥有的最大空间数。每次创建空间时实时读取," +
@@ -213,7 +213,7 @@ var registry = map[string]settingSpec{
},
"tenant.self_service_creation_enabled": {
Type: "bool",
EnvName: "WEKNORA_TENANT_SELF_SERVICE_CREATION_ENABLED",
EnvName: "ACADEMY_TENANT_SELF_SERVICE_CREATION_ENABLED",
Default: true,
Category: "tenant",
Description: "是否允许非超管用户主动创建空间。关闭后,普通用户只能通过邀请加入已有空间;" +
@@ -228,7 +228,7 @@ var registry = map[string]settingSpec{
// 0 or negative = use the in-code default (10 GB).
"tenant.default_storage_quota_gb": {
Type: "int",
EnvName: "WEKNORA_TENANT_DEFAULT_STORAGE_QUOTA_GB",
EnvName: "ACADEMY_TENANT_DEFAULT_STORAGE_QUOTA_GB",
Default: int64(10),
Category: "tenant",
Description: "新建空间时默认分配的存储配额(GB),包含向量、原文、文本、索引等。" +
@@ -241,11 +241,11 @@ var registry = map[string]settingSpec{
// are created explicitly via tenant_api_keys), which is a breaking change
// for integrations that relied on the create response carrying a key.
// Deployments that need the old behaviour set this to true (or the
// WEKNORA_TENANT_AUTO_CREATE_API_KEY env var). Default false keeps the
// ACADEMY_TENANT_AUTO_CREATE_API_KEY env var). Default false keeps the
// current, safer no-implicit-key behaviour. Read at create time only.
"tenant.auto_create_api_key": {
Type: "bool",
EnvName: "WEKNORA_TENANT_AUTO_CREATE_API_KEY",
EnvName: "ACADEMY_TENANT_AUTO_CREATE_API_KEY",
Default: false,
Category: "tenant",
Description: "创建空间时是否自动生成一个全量权限(full_access)的 API Key,并在创建接口的响应中返回其明文 token。" +
@@ -255,7 +255,7 @@ var registry = map[string]settingSpec{
// tenant.auto_accept_invitation: invite = auto-join switch (default false).
"tenant.auto_accept_invitation": {
Type: "bool",
EnvName: "WEKNORA_TENANT_AUTO_ACCEPT_INVITATION",
EnvName: "ACADEMY_TENANT_AUTO_ACCEPT_INVITATION",
Default: false,
Category: "tenant",
Description: "全局开关:开启后,空间管理员通过邮箱邀请已注册用户加入空间时," +
@@ -264,7 +264,7 @@ var registry = map[string]settingSpec{
},
"asynq.core_concurrency": {
Type: "int",
EnvName: "WEKNORA_ASYNQ_CORE_CONCURRENCY",
EnvName: "ACADEMY_ASYNQ_CORE_CONCURRENCY",
Default: int64(types.DefaultCoreWorkerConcurrency),
Category: "worker",
RequiresRestart: true,
@@ -272,7 +272,7 @@ var registry = map[string]settingSpec{
},
"asynq.postprocess_concurrency": {
Type: "int",
EnvName: "WEKNORA_ASYNQ_POSTPROCESS_CONCURRENCY",
EnvName: "ACADEMY_ASYNQ_POSTPROCESS_CONCURRENCY",
Default: int64(types.DefaultPostProcessWorkerConcurrency),
Category: "worker",
RequiresRestart: true,
@@ -280,7 +280,7 @@ var registry = map[string]settingSpec{
},
"asynq.enrichment_concurrency": {
Type: "int",
EnvName: "WEKNORA_ASYNQ_ENRICHMENT_CONCURRENCY",
EnvName: "ACADEMY_ASYNQ_ENRICHMENT_CONCURRENCY",
Default: int64(types.DefaultEnrichmentWorkerConcurrency),
Category: "worker",
RequiresRestart: true,
@@ -288,7 +288,7 @@ var registry = map[string]settingSpec{
},
"asynq.maintenance_concurrency": {
Type: "int",
EnvName: "WEKNORA_ASYNQ_MAINTENANCE_CONCURRENCY",
EnvName: "ACADEMY_ASYNQ_MAINTENANCE_CONCURRENCY",
Default: int64(types.DefaultMaintenanceWorkerConcurrency),
Category: "worker",
RequiresRestart: true,
@@ -296,7 +296,7 @@ var registry = map[string]settingSpec{
},
"asynq.shared_concurrency": {
Type: "int",
EnvName: "WEKNORA_ASYNQ_SHARED_CONCURRENCY",
EnvName: "ACADEMY_ASYNQ_SHARED_CONCURRENCY",
Default: int64(types.DefaultSharedWorkerConcurrency),
Category: "worker",
RequiresRestart: true,
@@ -305,10 +305,10 @@ var registry = map[string]settingSpec{
// asynq.wiki_concurrency is the size of the DEDICATED wiki worker pool,
// separate from the upstream pools. Read once when the wiki asynq server
// starts — changing it in the UI requires a process restart. Mirrors
// WEKNORA_WIKI_ASYNQ_CONCURRENCY (default 8).
// ACADEMY_WIKI_ASYNQ_CONCURRENCY (default 8).
"asynq.wiki_concurrency": {
Type: "int",
EnvName: "WEKNORA_WIKI_ASYNQ_CONCURRENCY",
EnvName: "ACADEMY_WIKI_ASYNQ_CONCURRENCY",
Default: int64(types.DefaultWikiWorkerConcurrency),
Category: "worker",
RequiresRestart: true,
@@ -322,11 +322,11 @@ var registry = map[string]settingSpec{
// limiter governor; a runtime bridge (applyModelMaxConcurrency) pushes UI
// edits into limiter.SetGlobalLimit so no restart is needed. Individual
// models may override this via their own max_concurrency parameter.
// Mirrors WEKNORA_MODEL_MAX_CONCURRENCY (default 32). 0/negative disables
// Mirrors ACADEMY_MODEL_MAX_CONCURRENCY (default 32). 0/negative disables
// the default cap.
"model.max_concurrency": {
Type: "int",
EnvName: "WEKNORA_MODEL_MAX_CONCURRENCY",
EnvName: "ACADEMY_MODEL_MAX_CONCURRENCY",
Default: int64(32),
Category: "worker",
Description: "后台任务(文档入库/富化)对单个模型的默认并发上限,按模型 ID 全副本共享。" +
@@ -573,7 +573,7 @@ func (s *systemSettingService) applySSRFWhitelist(ctx context.Context) {
// Called at preload (initial sync), after Update (this replica's edit), and
// after reload (peer's edit via pubsub).
func (s *systemSettingService) applyModelMaxConcurrency(ctx context.Context) {
limit := int(s.GetInt(ctx, "model.max_concurrency", "WEKNORA_MODEL_MAX_CONCURRENCY", 32))
limit := int(s.GetInt(ctx, "model.max_concurrency", "ACADEMY_MODEL_MAX_CONCURRENCY", 32))
limiter.SetGlobalLimit(limit)
logger.Infof(ctx, "[system_settings] model.max_concurrency applied (limit=%d)", limit)
}