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
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:
1 parent
9097ee699d
commit
9058149576
3136 files changed
+18018
-18004
No files matched your search
@@ -37,9 +37,9 @@ func TestApplyAuthAndTenantDefaults_DisableRegistrationDrivesRegistrationMode(t
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Setenv("DISABLE_REGISTRATION", tc.disable)
|
||||
// Other tenant env vars must not leak between cases.
|
||||
t.Setenv("WEKNORA_TENANT_ENABLE_RBAC", "")
|
||||
t.Setenv("WEKNORA_TENANT_MAX_OWNED_PER_USER", "")
|
||||
t.Setenv("WEKNORA_TENANT_SELF_SERVICE_CREATION_ENABLED", "")
|
||||
t.Setenv("ACADEMY_TENANT_ENABLE_RBAC", "")
|
||||
t.Setenv("ACADEMY_TENANT_MAX_OWNED_PER_USER", "")
|
||||
t.Setenv("ACADEMY_TENANT_SELF_SERVICE_CREATION_ENABLED", "")
|
||||
|
||||
cfg := &Config{Auth: &AuthConfig{RegistrationMode: tc.cfgMode}}
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
@@ -53,7 +53,7 @@ func TestApplyAuthAndTenantDefaults_DisableRegistrationDrivesRegistrationMode(t
|
||||
|
||||
func TestApplyAuthAndTenantDefaults_SelfServiceTenantCreation(t *testing.T) {
|
||||
t.Run("defaults enabled", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_TENANT_SELF_SERVICE_CREATION_ENABLED", "")
|
||||
t.Setenv("ACADEMY_TENANT_SELF_SERVICE_CREATION_ENABLED", "")
|
||||
cfg := &Config{Tenant: &TenantConfig{}}
|
||||
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
@@ -64,7 +64,7 @@ func TestApplyAuthAndTenantDefaults_SelfServiceTenantCreation(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("environment disables yaml default", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_TENANT_SELF_SERVICE_CREATION_ENABLED", "false")
|
||||
t.Setenv("ACADEMY_TENANT_SELF_SERVICE_CREATION_ENABLED", "false")
|
||||
on := true
|
||||
cfg := &Config{Tenant: &TenantConfig{SelfServiceCreationEnabled: &on}}
|
||||
|
||||
@@ -78,7 +78,7 @@ func TestApplyAuthAndTenantDefaults_SelfServiceTenantCreation(t *testing.T) {
|
||||
|
||||
func TestApplyAuthAndTenantDefaults_DefaultTenantMode(t *testing.T) {
|
||||
t.Run("historical default creates a personal tenant", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_AUTH_DEFAULT_TENANT_MODE", "")
|
||||
t.Setenv("ACADEMY_AUTH_DEFAULT_TENANT_MODE", "")
|
||||
cfg := &Config{Auth: &AuthConfig{}}
|
||||
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
@@ -89,7 +89,7 @@ func TestApplyAuthAndTenantDefaults_DefaultTenantMode(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("environment overrides yaml", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_AUTH_DEFAULT_TENANT_MODE", AuthDefaultTenantModeTenantless)
|
||||
t.Setenv("ACADEMY_AUTH_DEFAULT_TENANT_MODE", AuthDefaultTenantModeTenantless)
|
||||
cfg := &Config{Auth: &AuthConfig{DefaultTenantMode: AuthDefaultTenantModeCreatePersonal}}
|
||||
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
@@ -100,7 +100,7 @@ func TestApplyAuthAndTenantDefaults_DefaultTenantMode(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("invalid environment value fails validation", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_AUTH_DEFAULT_TENANT_MODE", "create_magic")
|
||||
t.Setenv("ACADEMY_AUTH_DEFAULT_TENANT_MODE", "create_magic")
|
||||
cfg := &Config{Auth: &AuthConfig{}}
|
||||
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
@@ -113,46 +113,46 @@ func TestApplyAuthAndTenantDefaults_DefaultTenantMode(t *testing.T) {
|
||||
|
||||
// TestApplyAuthAndTenantDefaults_CrossTenantAccess is a regression test for the
|
||||
// env-binding gap: viper.AutomaticEnv has no SetEnvPrefix, so
|
||||
// WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS is never bound to the nested struct
|
||||
// ACADEMY_TENANT_ENABLE_CROSS_TENANT_ACCESS is never bound to the nested struct
|
||||
// automatically. applyAuthAndTenantDefaults must read it explicitly (like RBAC);
|
||||
// without that, only config.yaml's enable_cross_tenant_access would take effect
|
||||
// and the documented env override would be silently ignored.
|
||||
func TestApplyAuthAndTenantDefaults_CrossTenantAccess(t *testing.T) {
|
||||
t.Run("environment true enables cross-tenant access", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS", "true")
|
||||
t.Setenv("ACADEMY_TENANT_ENABLE_CROSS_TENANT_ACCESS", "true")
|
||||
cfg := &Config{Tenant: &TenantConfig{EnableCrossTenantAccess: false}}
|
||||
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
|
||||
if !cfg.Tenant.EnableCrossTenantAccess {
|
||||
t.Fatal("WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS=true should enable cross-tenant access")
|
||||
t.Fatal("ACADEMY_TENANT_ENABLE_CROSS_TENANT_ACCESS=true should enable cross-tenant access")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("environment false overrides yaml true", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS", "false")
|
||||
t.Setenv("ACADEMY_TENANT_ENABLE_CROSS_TENANT_ACCESS", "false")
|
||||
cfg := &Config{Tenant: &TenantConfig{EnableCrossTenantAccess: true}}
|
||||
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
|
||||
if cfg.Tenant.EnableCrossTenantAccess {
|
||||
t.Fatal("WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS=false should disable cross-tenant access")
|
||||
t.Fatal("ACADEMY_TENANT_ENABLE_CROSS_TENANT_ACCESS=false should disable cross-tenant access")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("case-insensitive TRUE also enables", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS", "TRUE")
|
||||
t.Setenv("ACADEMY_TENANT_ENABLE_CROSS_TENANT_ACCESS", "TRUE")
|
||||
cfg := &Config{Tenant: &TenantConfig{EnableCrossTenantAccess: false}}
|
||||
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
|
||||
if !cfg.Tenant.EnableCrossTenantAccess {
|
||||
t.Fatal("WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS=TRUE should enable cross-tenant access (case-insensitive)")
|
||||
t.Fatal("ACADEMY_TENANT_ENABLE_CROSS_TENANT_ACCESS=TRUE should enable cross-tenant access (case-insensitive)")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("unset leaves yaml value untouched", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_TENANT_ENABLE_CROSS_TENANT_ACCESS", "")
|
||||
t.Setenv("ACADEMY_TENANT_ENABLE_CROSS_TENANT_ACCESS", "")
|
||||
cfg := &Config{Tenant: &TenantConfig{EnableCrossTenantAccess: true}}
|
||||
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
@@ -165,23 +165,23 @@ func TestApplyAuthAndTenantDefaults_CrossTenantAccess(t *testing.T) {
|
||||
|
||||
func TestApplyAuthAndTenantDefaults_ComplexPasswordEnabledEnv(t *testing.T) {
|
||||
t.Run("1 enables via ParseBool", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_AUTH_COMPLEX_PASSWORD_ENABLED", "1")
|
||||
t.Setenv("ACADEMY_AUTH_COMPLEX_PASSWORD_ENABLED", "1")
|
||||
cfg := &Config{Auth: &AuthConfig{}}
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
if !cfg.Auth.ComplexPasswordEnabled {
|
||||
t.Fatal("WEKNORA_AUTH_COMPLEX_PASSWORD_ENABLED=1 should enable complex passwords")
|
||||
t.Fatal("ACADEMY_AUTH_COMPLEX_PASSWORD_ENABLED=1 should enable complex passwords")
|
||||
}
|
||||
})
|
||||
t.Run("false disables", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_AUTH_COMPLEX_PASSWORD_ENABLED", "false")
|
||||
t.Setenv("ACADEMY_AUTH_COMPLEX_PASSWORD_ENABLED", "false")
|
||||
cfg := &Config{Auth: &AuthConfig{ComplexPasswordEnabled: true}}
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
if cfg.Auth.ComplexPasswordEnabled {
|
||||
t.Fatal("WEKNORA_AUTH_COMPLEX_PASSWORD_ENABLED=false should disable complex passwords")
|
||||
t.Fatal("ACADEMY_AUTH_COMPLEX_PASSWORD_ENABLED=false should disable complex passwords")
|
||||
}
|
||||
})
|
||||
t.Run("unset leaves yaml", func(t *testing.T) {
|
||||
t.Setenv("WEKNORA_AUTH_COMPLEX_PASSWORD_ENABLED", "")
|
||||
t.Setenv("ACADEMY_AUTH_COMPLEX_PASSWORD_ENABLED", "")
|
||||
cfg := &Config{Auth: &AuthConfig{ComplexPasswordEnabled: true}}
|
||||
applyAuthAndTenantDefaults(cfg)
|
||||
if !cfg.Auth.ComplexPasswordEnabled {
|
||||
|
||||
Reference in new issue
Block a user