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

+23 -23
View File
@@ -27,14 +27,14 @@ import (
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/options/mac"
"github.com/Tencent/WeKnora/internal/config"
"github.com/Tencent/WeKnora/internal/container"
"github.com/Tencent/WeKnora/internal/handler"
"github.com/Tencent/WeKnora/internal/handler/session"
"github.com/Tencent/WeKnora/internal/logger"
"github.com/Tencent/WeKnora/internal/runtime"
"github.com/Tencent/WeKnora/internal/stream"
"github.com/Tencent/WeKnora/internal/types/interfaces"
"academy/internal/config"
"academy/internal/container"
"academy/internal/handler"
"academy/internal/handler/session"
"academy/internal/logger"
"academy/internal/runtime"
"academy/internal/stream"
"academy/internal/types/interfaces"
"github.com/joho/godotenv"
wailsruntime "github.com/wailsapp/wails/v2/pkg/runtime"
)
@@ -176,9 +176,9 @@ window.open=function(url){
})();`
// wailsThemeSyncJS:与 index.html 首屏一致,在 DomReady 再跑一遍,覆盖 Ctrl+R 后 runtime 就绪时机
const wailsThemeSyncJS = `(function(){try{var t=localStorage.getItem('WeKnora_theme')||'light';if(t==='system')t=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';var bg=t==='dark'?'#181818':'#eee';document.documentElement.setAttribute('theme-mode',t);document.documentElement.style.background=bg;document.documentElement.style.minHeight='100%';document.documentElement.style.colorScheme=t==='dark'?'dark':'light';if(document.body){document.body.style.background=bg;document.body.style.minHeight='100%';}var w=window.runtime;if(!w)return;if(t==='dark'){if(w.WindowSetDarkTheme)w.WindowSetDarkTheme();if(w.WindowSetBackgroundColour)w.WindowSetBackgroundColour(24,24,24,255);}else{if(w.WindowSetLightTheme)w.WindowSetLightTheme();if(w.WindowSetBackgroundColour)w.WindowSetBackgroundColour(238,238,238,255);}}catch(e){}})()`
const wailsThemeSyncJS = `(function(){try{var t=localStorage.getItem('Academy_theme')||'light';if(t==='system')t=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';var bg=t==='dark'?'#181818':'#eee';document.documentElement.setAttribute('theme-mode',t);document.documentElement.style.background=bg;document.documentElement.style.minHeight='100%';document.documentElement.style.colorScheme=t==='dark'?'dark':'light';if(document.body){document.body.style.background=bg;document.body.style.minHeight='100%';}var w=window.runtime;if(!w)return;if(t==='dark'){if(w.WindowSetDarkTheme)w.WindowSetDarkTheme();if(w.WindowSetBackgroundColour)w.WindowSetBackgroundColour(24,24,24,255);}else{if(w.WindowSetLightTheme)w.WindowSetLightTheme();if(w.WindowSetBackgroundColour)w.WindowSetBackgroundColour(238,238,238,255);}}catch(e){}})()`
const weknoraGitHubRepoURL = "https://github.com/Tencent/WeKnora"
const academyGitHubRepoURL = "https://academy"
// ensureDesktopLiteEdition marks this process as Lite. cmd/desktop is the
// Lite app; packaged builds also inject this via ldflags. wails dev often
@@ -253,7 +253,7 @@ func main() {
panic(fmt.Sprintf("wire desktop project dirs: %v", err))
}
// Initialize the WeKnora App struct
// Initialize the Academy App struct
app := NewApp()
setupBytes := make([]byte, 32)
if _, err := rand.Read(setupBytes); err != nil {
@@ -352,15 +352,15 @@ func main() {
// Create application with options
// macOS app menu
AppMenu := menu.NewMenu()
FileMenu := AppMenu.AddSubmenu("WeKnora Lite")
FileMenu.AddText("About WeKnora", keys.CmdOrCtrl("i"), func(_ *menu.CallbackData) {
FileMenu := AppMenu.AddSubmenu("Academy Lite")
FileMenu.AddText("About Academy", keys.CmdOrCtrl("i"), func(_ *menu.CallbackData) {
if app.ctx == nil {
return
}
choice, err := wailsruntime.MessageDialog(app.ctx, wailsruntime.MessageDialogOptions{
Type: wailsruntime.InfoDialog,
Title: "WeKnora Lite",
Message: fmt.Sprintf("WeKnora Lite — Desktop Edition\n\nA RAG framework for document understanding and semantic Q&A over complex, heterogeneous content.\n\nVersion %s\n© 2026 Tencent\n\nGitHub:\n%s", desktopAboutVersion(), weknoraGitHubRepoURL),
Title: "Academy Lite",
Message: fmt.Sprintf("Academy Lite — Desktop Edition\n\nA RAG framework for document understanding and semantic Q&A over complex, heterogeneous content.\n\nVersion %s\n© 2026 Tencent\n\nGitHub:\n%s", desktopAboutVersion(), academyGitHubRepoURL),
Buttons: []string{"Open GitHub", "OK"},
DefaultButton: "OK",
})
@@ -369,7 +369,7 @@ func main() {
return
}
if choice == "Open GitHub" {
wailsruntime.BrowserOpenURL(app.ctx, weknoraGitHubRepoURL)
wailsruntime.BrowserOpenURL(app.ctx, academyGitHubRepoURL)
}
})
FileMenu.AddText("Check for Updates...", nil, func(_ *menu.CallbackData) {
@@ -400,7 +400,7 @@ func main() {
// Start Wails application
// We use a Reverse Proxy to seamlessly proxy Wails' frontend to our Go backend
err := wails.Run(&options.App{
Title: "WeKnora Lite",
Title: "Academy Lite",
Width: 1280,
Height: 800,
DisableResize: false,
@@ -416,11 +416,11 @@ func main() {
// 注入真实 API 根路径(与 window.location.origin 不同);无 Go 绑定时仍可显示。
if u := strings.TrimSpace(app.backendURL); u != "" {
apiRoot := strings.TrimRight(u, "/") + "/api/v1"
inject := fmt.Sprintf(`try{window.__WEKNORA_API_BASE__=%s}catch(e){}`, strconv.Quote(apiRoot))
inject := fmt.Sprintf(`try{window.__ACADEMY_API_BASE__=%s}catch(e){}`, strconv.Quote(apiRoot))
wailsruntime.WindowExecJS(ctx, inject)
}
if lan := strings.TrimSpace(app.apiLanBaseURL); lan != "" {
injectLan := fmt.Sprintf(`try{window.__WEKNORA_API_LAN_BASE__=%s}catch(e){}`, strconv.Quote(lan))
injectLan := fmt.Sprintf(`try{window.__ACADEMY_API_LAN_BASE__=%s}catch(e){}`, strconv.Quote(lan))
wailsruntime.WindowExecJS(ctx, injectLan)
}
},
@@ -455,7 +455,7 @@ func configureDesktopStorage(execPath string) {
targetDataDir := filepath.Join(appSupportDir, "data")
migrateLegacyDesktopData(legacyResourcesDir, targetDataDir)
dbPath := resolveDesktopDataPath(os.Getenv("DB_PATH"), filepath.Join("data", "weknora.db"), appSupportDir)
dbPath := resolveDesktopDataPath(os.Getenv("DB_PATH"), filepath.Join("data", "academy.db"), appSupportDir)
if err := os.MkdirAll(filepath.Dir(dbPath), 0o755); err != nil {
logger.Warnf(context.Background(), "Failed to create desktop DB directory %s: %v", filepath.Dir(dbPath), err)
@@ -464,7 +464,7 @@ func configureDesktopStorage(execPath string) {
_ = os.Setenv("DB_PATH", dbPath)
}
// configureDesktopFileStorage points Lite file uploads at ~/.weknora/data/files.
// configureDesktopFileStorage points Lite file uploads at ~/.academy/data/files.
// wails dev is not always inside a packaged .app, so this runs for every
// desktop process. An explicit absolute directory is kept; the Docker default
// /data/files is not writable on macOS and is replaced. Uploads move over from
@@ -491,7 +491,7 @@ func configureDesktopFileStorage(execPath string) {
}
func desktopLocalFilesDir(home string) string {
return filepath.Join(home, ".weknora", "data", "files")
return filepath.Join(home, ".academy", "data", "files")
}
func useDesktopFilesDir(raw string) bool {
@@ -546,7 +546,7 @@ func defaultMacAppSupportDir(execPath string) (string, error) {
return "", err
}
appName := "WeKnora Lite"
appName := "Academy Lite"
if idx := strings.Index(execPath, ".app/Contents/MacOS"); idx >= 0 {
bundleName := filepath.Base(execPath[:idx+4])
if trimmed := strings.TrimSuffix(bundleName, ".app"); trimmed != "" {