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

+5 -5
View File
@@ -18,8 +18,8 @@ import (
"unicode/utf8"
"github.com/PuerkitoBio/goquery"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/logger"
"academy/internal/utils"
"github.com/chromedp/chromedp"
"golang.org/x/net/html/charset"
"golang.org/x/text/encoding"
@@ -37,11 +37,11 @@ const (
// The HTTP client, the fetch context, and chromedp all use this value.
// Chromedp's deadline is a child of the fetch context, so the budgets do not add.
//
// WEKNORA_WEB_FETCH_TIMEOUT accepts a Go duration (150s, 3m) or a bare positive
// number of seconds (180), the same pattern as WEKNORA_AGENT_LLM_TIMEOUT.
// ACADEMY_WEB_FETCH_TIMEOUT accepts a Go duration (150s, 3m) or a bare positive
// number of seconds (180), the same pattern as ACADEMY_AGENT_LLM_TIMEOUT.
// Empty, invalid, and non-positive values use defaultPageFetchTimeout.
func PageFetchTimeout() time.Duration {
value := strings.TrimSpace(os.Getenv("WEKNORA_WEB_FETCH_TIMEOUT"))
value := strings.TrimSpace(os.Getenv("ACADEMY_WEB_FETCH_TIMEOUT"))
if value == "" {
return defaultPageFetchTimeout
}
@@ -13,7 +13,7 @@ func TestFetchURLContentBlocksRedirectToLoopback(t *testing.T) {
internalHit := make(chan struct{}, 1)
internal := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
internalHit <- struct{}{}
fmt.Fprint(w, "<html><body>WEKNORA_INTERNAL_CANARY_178193</body></html>")
fmt.Fprint(w, "<html><body>ACADEMY_INTERNAL_CANARY_178193</body></html>")
}))
defer internal.Close()
@@ -28,7 +28,7 @@ func TestFetchURLContentBlocksRedirectToLoopback(t *testing.T) {
got, err := FetchURLContent(context.Background(), attacker.URL+"/entry")
if err == nil {
if strings.Contains(got, "WEKNORA_INTERNAL_CANARY_178193") {
if strings.Contains(got, "ACADEMY_INTERNAL_CANARY_178193") {
t.Fatalf("redirect followed to loopback, got %q", got)
}
t.Fatal("expected redirect to loopback to be blocked")
@@ -133,11 +133,11 @@ func TestFetcherUsesBrowserFallbackForClientRenderedPage(t *testing.T) {
}
func TestNewFetcherKeepsAgentCompatibleTimeout(t *testing.T) {
t.Setenv("WEKNORA_WEB_FETCH_TIMEOUT", "")
t.Setenv("ACADEMY_WEB_FETCH_TIMEOUT", "")
assert.Equal(t, 30*time.Second, NewFetcher().timeout)
assert.Equal(t, PageFetchTimeout(), NewFetcher().timeout)
t.Setenv("WEKNORA_WEB_FETCH_TIMEOUT", "150s")
t.Setenv("ACADEMY_WEB_FETCH_TIMEOUT", "150s")
assert.Equal(t, 150*time.Second, NewFetcher().timeout)
}
@@ -148,7 +148,7 @@ func TestNewPipelineFetcherUsesHTTPOnlyAndLegacyTimeout(t *testing.T) {
}
func TestPipelineFetcherIgnoresWebFetchToolTimeout(t *testing.T) {
t.Setenv("WEKNORA_WEB_FETCH_TIMEOUT", "180")
t.Setenv("ACADEMY_WEB_FETCH_TIMEOUT", "180")
fetcher := NewPipelineFetcher()
assert.Equal(t, 15*time.Second, fetcher.timeout)
assert.Nil(t, fetcher.renderBrowser)
@@ -156,19 +156,19 @@ func TestPipelineFetcherIgnoresWebFetchToolTimeout(t *testing.T) {
}
func TestPageFetchTimeout(t *testing.T) {
t.Setenv("WEKNORA_WEB_FETCH_TIMEOUT", "")
t.Setenv("ACADEMY_WEB_FETCH_TIMEOUT", "")
assert.Equal(t, 30*time.Second, PageFetchTimeout())
t.Setenv("WEKNORA_WEB_FETCH_TIMEOUT", "150s")
t.Setenv("ACADEMY_WEB_FETCH_TIMEOUT", "150s")
assert.Equal(t, 150*time.Second, PageFetchTimeout())
t.Setenv("WEKNORA_WEB_FETCH_TIMEOUT", "3m")
t.Setenv("ACADEMY_WEB_FETCH_TIMEOUT", "3m")
assert.Equal(t, 3*time.Minute, PageFetchTimeout())
t.Setenv("WEKNORA_WEB_FETCH_TIMEOUT", "180")
t.Setenv("ACADEMY_WEB_FETCH_TIMEOUT", "180")
assert.Equal(t, 180*time.Second, PageFetchTimeout())
for _, raw := range []string{"", "0", "-1", "0s", "-5s", "nope", " "} {
t.Run("fallback_"+raw, func(t *testing.T) {
t.Setenv("WEKNORA_WEB_FETCH_TIMEOUT", raw)
t.Setenv("ACADEMY_WEB_FETCH_TIMEOUT", raw)
assert.Equal(t, 30*time.Second, PageFetchTimeout())
})
}
@@ -6,7 +6,7 @@ import (
"net"
"testing"
"github.com/Tencent/WeKnora/internal/utils"
"academy/internal/utils"
)
func whitelistOnly(t *testing.T, whitelist, only string) {