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
+23
-23
@@ -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 != "" {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
func main() {
|
||||
app := NewApp()
|
||||
_ = wails.Run(&options.App{
|
||||
Title: "WeKnora Lite",
|
||||
Title: "Academy Lite",
|
||||
Bind: []interface{}{app},
|
||||
})
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/localsandbox"
|
||||
"academy/internal/localsandbox"
|
||||
)
|
||||
|
||||
const desktopPrefsFileName = "desktop-prefs.json"
|
||||
@@ -39,7 +39,7 @@ func desktopPrefsDir() (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
dir := filepath.Join(cfg, "WeKnora Lite")
|
||||
dir := filepath.Join(cfg, "Academy Lite")
|
||||
if err := os.MkdirAll(dir, 0o755); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
+10
-10
@@ -6,8 +6,8 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/handler"
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/handler"
|
||||
"academy/internal/utils"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ func TestDesktopSigningKeyKeepsExistingAESHMAC(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
aes := "abcdefghijklmnopqrstuvwxyz123456"
|
||||
t.Setenv("SYSTEM_SIGNING_KEY", "")
|
||||
t.Setenv("JWT_SECRET", "weknora-jwt-secret")
|
||||
t.Setenv("JWT_SECRET", "academy-jwt-secret")
|
||||
t.Setenv("SYSTEM_AES_KEY", aes)
|
||||
require.Equal(t, aes, string(utils.SystemHMACKey()))
|
||||
require.NoError(t, ensureDesktopSigningKeyInDir(dir))
|
||||
@@ -27,7 +27,7 @@ func TestDesktopSigningKeyKeepsExistingAESHMAC(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDesktopLocalFilesDir(t *testing.T) {
|
||||
require.Equal(t, filepath.Join("/Users/dev", ".weknora", "data", "files"), desktopLocalFilesDir("/Users/dev"))
|
||||
require.Equal(t, filepath.Join("/Users/dev", ".academy", "data", "files"), desktopLocalFilesDir("/Users/dev"))
|
||||
}
|
||||
|
||||
func TestUseDesktopFilesDirReplacesDockerDefault(t *testing.T) {
|
||||
@@ -37,19 +37,19 @@ func TestUseDesktopFilesDirReplacesDockerDefault(t *testing.T) {
|
||||
require.False(t, useDesktopFilesDir("/Users/dev/custom-files"))
|
||||
}
|
||||
|
||||
func TestConfigureDesktopFileStorageUsesHomeWeKnora(t *testing.T) {
|
||||
func TestConfigureDesktopFileStorageUsesHomeAcademy(t *testing.T) {
|
||||
home := t.TempDir()
|
||||
t.Setenv("HOME", home)
|
||||
t.Setenv("LOCAL_STORAGE_BASE_DIR", "/data/files")
|
||||
configureDesktopFileStorage("")
|
||||
require.Equal(t, filepath.Join(home, ".weknora", "data", "files"), os.Getenv("LOCAL_STORAGE_BASE_DIR"))
|
||||
require.Equal(t, filepath.Join(home, ".academy", "data", "files"), os.Getenv("LOCAL_STORAGE_BASE_DIR"))
|
||||
info, err := os.Stat(os.Getenv("LOCAL_STORAGE_BASE_DIR"))
|
||||
require.NoError(t, err)
|
||||
require.True(t, info.IsDir())
|
||||
}
|
||||
|
||||
func TestLegacyDesktopFilesDirFollowsTheOldResolution(t *testing.T) {
|
||||
appSupport := "/Users/dev/Library/Application Support/WeKnora"
|
||||
appSupport := "/Users/dev/Library/Application Support/Academy"
|
||||
require.Equal(t, filepath.Join(appSupport, "data", "files"), legacyDesktopFilesDir("", appSupport))
|
||||
require.Equal(t, filepath.Join(appSupport, "data", "files"), legacyDesktopFilesDir("/data/files", appSupport))
|
||||
require.Equal(t, filepath.Join(appSupport, "custom", "files"), legacyDesktopFilesDir("custom/files", appSupport))
|
||||
@@ -59,13 +59,13 @@ func TestConfigureDesktopFileStorageMigratesFromTheBundleDir(t *testing.T) {
|
||||
home := t.TempDir()
|
||||
t.Setenv("HOME", home)
|
||||
t.Setenv("LOCAL_STORAGE_BASE_DIR", "custom/files")
|
||||
old := filepath.Join(home, "Library", "Application Support", "WeKnora", "custom", "files")
|
||||
old := filepath.Join(home, "Library", "Application Support", "Academy", "custom", "files")
|
||||
require.NoError(t, os.MkdirAll(filepath.Join(old, "1"), 0o755))
|
||||
require.NoError(t, os.WriteFile(filepath.Join(old, "1", "a.txt"), []byte("a"), 0o600))
|
||||
|
||||
configureDesktopFileStorage("/Applications/WeKnora.app/Contents/MacOS/WeKnora")
|
||||
configureDesktopFileStorage("/Applications/Academy.app/Contents/MacOS/Academy")
|
||||
|
||||
require.FileExists(t, filepath.Join(home, ".weknora", "data", "files", "1", "a.txt"))
|
||||
require.FileExists(t, filepath.Join(home, ".academy", "data", "files", "1", "a.txt"))
|
||||
}
|
||||
|
||||
func TestEnsureDesktopLiteEditionOverridesDefaultStandard(t *testing.T) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/utils"
|
||||
)
|
||||
|
||||
// ensureDesktopSigningKey persists the desktop signing key and, when no
|
||||
@@ -21,7 +21,7 @@ func ensureDesktopSigningKey() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ensureDesktopSigningKeyInDir(filepath.Join(dir, "WeKnora Lite"))
|
||||
return ensureDesktopSigningKeyInDir(filepath.Join(dir, "Academy Lite"))
|
||||
}
|
||||
|
||||
func ensureDesktopSigningKeyInDir(dir string) error {
|
||||
@@ -74,7 +74,7 @@ func ensureDesktopSigningKeyInDir(dir string) error {
|
||||
// AES key), so sessions get their own persisted secret.
|
||||
func ensureDesktopJWTSecret(dir string, signingKey []byte) error {
|
||||
jwtSecret := strings.TrimSpace(os.Getenv("JWT_SECRET"))
|
||||
if jwtSecret != "" && jwtSecret != "weknora-jwt-secret" && jwtSecret != "CHANGE-ME-jwt-secret" {
|
||||
if jwtSecret != "" && jwtSecret != "academy-jwt-secret" && jwtSecret != "CHANGE-ME-jwt-secret" {
|
||||
return nil
|
||||
}
|
||||
secret := string(signingKey)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/utils"
|
||||
"academy/internal/utils"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ func TestDesktopSigningKeyPersistsWithoutChangingAES(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
t.Setenv("SYSTEM_SIGNING_KEY", "")
|
||||
t.Setenv("JWT_SECRET", "")
|
||||
t.Setenv("SYSTEM_AES_KEY", "weknora-system-aes-key-32bytes!!")
|
||||
t.Setenv("SYSTEM_AES_KEY", "academy-system-aes-key-32bytes!!")
|
||||
require.NoError(t, ensureDesktopSigningKeyInDir(dir))
|
||||
first := string(utils.SystemHMACKey())
|
||||
firstJWT := os.Getenv("JWT_SECRET")
|
||||
@@ -25,7 +25,7 @@ func TestDesktopSigningKeyPersistsWithoutChangingAES(t *testing.T) {
|
||||
require.NoError(t, ensureDesktopSigningKeyInDir(dir))
|
||||
require.Equal(t, first, string(utils.SystemHMACKey()))
|
||||
require.Equal(t, firstJWT, os.Getenv("JWT_SECRET"))
|
||||
require.Equal(t, "weknora-system-aes-key-32bytes!!", os.Getenv("SYSTEM_AES_KEY"))
|
||||
require.Equal(t, "academy-system-aes-key-32bytes!!", os.Getenv("SYSTEM_AES_KEY"))
|
||||
info, err := os.Stat(filepath.Join(dir, "signing.key"))
|
||||
require.NoError(t, err)
|
||||
if runtime.GOOS != "windows" {
|
||||
@@ -37,7 +37,7 @@ func TestDesktopJWTSecretIsNotTheAESKey(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
const aes = "0123456789abcdef0123456789abcdef"
|
||||
t.Setenv("SYSTEM_SIGNING_KEY", "")
|
||||
t.Setenv("JWT_SECRET", "weknora-jwt-secret")
|
||||
t.Setenv("JWT_SECRET", "academy-jwt-secret")
|
||||
t.Setenv("SYSTEM_AES_KEY", aes)
|
||||
|
||||
require.NoError(t, ensureDesktopSigningKeyInDir(dir))
|
||||
|
||||
@@ -13,8 +13,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Tencent/WeKnora/internal/handler"
|
||||
"github.com/Tencent/WeKnora/internal/logger"
|
||||
"academy/internal/handler"
|
||||
"academy/internal/logger"
|
||||
wailsruntime "github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
"golang.org/x/mod/semver"
|
||||
)
|
||||
@@ -57,7 +57,7 @@ func checkUpdate(ctx context.Context, currentVersion string, showUpToDate bool,
|
||||
}
|
||||
|
||||
// Add User-Agent header which is required/recommended by GitHub API
|
||||
req.Header.Set("User-Agent", "WeKnora-Lite-Desktop-App")
|
||||
req.Header.Set("User-Agent", "Academy-Lite-Desktop-App")
|
||||
|
||||
// Add Authorization header if GITHUB_TOKEN is present to increase rate limit
|
||||
if token := os.Getenv("GITHUB_TOKEN"); token != "" {
|
||||
@@ -119,7 +119,7 @@ func checkUpdate(ctx context.Context, currentVersion string, showUpToDate bool,
|
||||
return
|
||||
}
|
||||
|
||||
msg := fmt.Sprintf("A new version of WeKnora Lite is available!\n\nCurrent version: %s\nLatest version: %s\n\nWould you like to download it now?", currentVersion, latestVersion)
|
||||
msg := fmt.Sprintf("A new version of Academy Lite is available!\n\nCurrent version: %s\nLatest version: %s\n\nWould you like to download it now?", currentVersion, latestVersion)
|
||||
choice, _ := wailsruntime.MessageDialog(ctx, wailsruntime.MessageDialogOptions{
|
||||
Type: wailsruntime.InfoDialog,
|
||||
Title: "Update Available",
|
||||
@@ -143,7 +143,7 @@ func checkUpdate(ctx context.Context, currentVersion string, showUpToDate bool,
|
||||
wailsruntime.MessageDialog(ctx, wailsruntime.MessageDialogOptions{
|
||||
Type: wailsruntime.InfoDialog,
|
||||
Title: "Up to Date",
|
||||
Message: fmt.Sprintf("You are using the latest version of WeKnora Lite.\n\nCurrent version: %s", currentVersion),
|
||||
Message: fmt.Sprintf("You are using the latest version of Academy Lite.\n\nCurrent version: %s", currentVersion),
|
||||
Buttons: []string{"OK"},
|
||||
DefaultButton: "OK",
|
||||
})
|
||||
@@ -280,7 +280,7 @@ func downloadAndInstall(ctx context.Context, url string, filename string, curren
|
||||
choice, _ := wailsruntime.MessageDialog(ctx, wailsruntime.MessageDialogOptions{
|
||||
Type: wailsruntime.InfoDialog,
|
||||
Title: "Update Ready",
|
||||
Message: fmt.Sprintf("WeKnora Lite %s has been downloaded successfully.\n\nWould you like to restart and install the new version now?", latestVersion),
|
||||
Message: fmt.Sprintf("Academy Lite %s has been downloaded successfully.\n\nWould you like to restart and install the new version now?", latestVersion),
|
||||
Buttons: []string{"Restart Now", "Later"},
|
||||
DefaultButton: "Restart Now",
|
||||
})
|
||||
@@ -315,7 +315,7 @@ func desktopAboutVersion() string {
|
||||
// applyUpdateAndRestart applies the downloaded update and restarts the application
|
||||
func applyUpdateAndRestart(ctx context.Context, savePath string) {
|
||||
if runtime.GOOS == "windows" {
|
||||
scriptPath := filepath.Join(os.TempDir(), "weknora_update.bat")
|
||||
scriptPath := filepath.Join(os.TempDir(), "academy_update.bat")
|
||||
execPath, err := os.Executable()
|
||||
if err != nil {
|
||||
logger.Warnf(context.Background(), "Failed to get executable path: %v", err)
|
||||
@@ -351,7 +351,7 @@ del "%%~f0"
|
||||
return
|
||||
}
|
||||
|
||||
mountPoint := filepath.Join(os.TempDir(), "WeKnoraUpdateMount")
|
||||
mountPoint := filepath.Join(os.TempDir(), "AcademyUpdateMount")
|
||||
os.MkdirAll(mountPoint, 0755)
|
||||
|
||||
cmdMount := exec.Command("hdiutil", "attach", savePath, "-mountpoint", mountPoint, "-nobrowse", "-quiet")
|
||||
@@ -386,7 +386,7 @@ del "%%~f0"
|
||||
}
|
||||
|
||||
appDir := filepath.Dir(appBundlePath)
|
||||
scriptPath := filepath.Join(os.TempDir(), "weknora_update.sh")
|
||||
scriptPath := filepath.Join(os.TempDir(), "academy_update.sh")
|
||||
scriptContent := fmt.Sprintf(`#!/bin/bash
|
||||
sleep 2
|
||||
if ! (rm -rf "%s" && cp -a "%s" "%s"); then
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
{
|
||||
"$schema": "https://wails.io/schemas/config.v2.json",
|
||||
"name": "WeKnora Lite",
|
||||
"outputfilename": "WeKnora Lite",
|
||||
"name": "Academy Lite",
|
||||
"outputfilename": "Academy Lite",
|
||||
"frontend:dir": "../../frontend",
|
||||
"wailsjsdir": "../../frontend/src",
|
||||
"build:tags": "desktop",
|
||||
"author": {
|
||||
"name": "WeKnora Team",
|
||||
"name": "Academy Team",
|
||||
"email": ""
|
||||
},
|
||||
"info": {
|
||||
"companyName": "Tencent",
|
||||
"productName": "WeKnora Lite",
|
||||
"productName": "Academy Lite",
|
||||
"productVersion": "1.0.0",
|
||||
"copyright": "Copyright 2026 Tencent",
|
||||
"comments": "WeKnora Desktop Edition"
|
||||
"comments": "Academy Desktop Edition"
|
||||
},
|
||||
"mac": {
|
||||
"category": "public.app-category.productivity",
|
||||
|
||||
Reference in new issue
Block a user