feat: 内置 Web 管理面板并移除闭源授权组件 - #1
Merged
Merged
Conversation
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
此 PR 将 Web 管理面板(React 构建产物)直接内置到 Go/Gin 与 Python/Flask 授权服务器中,并同步引入 JWT + REST API 以支持同端口(13337)同时提供授权协议与 Web 管理界面;同时移除闭源授权组件与 VMProtect 相关工程文件,将加壳能力降级为“可选商业组件”,默认开源构建可正常工作。
Changes:
- 在
server_go与server_python中新增/集成 Web 面板静态资源与 REST API(JWT、统计、密钥管理等),并支持YCP_DB_PATH配置数据库路径、增加login_count统计字段。 obfuscator移除闭源Authorization.dll依赖,提供开放授权客户端实现(POST/login),并将 VMProtect SDK/工程文件调整为缺失时自动跳过的可选流程。- 更新 Docker 多阶段构建、docker-compose、部署文档与前端开发代理配置,以配套一体化部署方式。
Reviewed changes
Copilot reviewed 28 out of 41 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| server_python/web/vault.svg | 新增 Web 面板图标资源 |
| server_python/web/index.html | 新增 Web 面板入口 HTML(引用构建产物) |
| server_python/web/assets/index-mKCh-jFT.css | 新增前端构建产物 CSS |
| server_python/Dockerfile | 多阶段构建:编译前端并拷贝到 Python 镜像 |
| server_python/app.py | Flask:JWT/CORS、REST API、SPA 静态文件回退、DB 路径与登录统计 |
| server_go/web/vault.svg | 新增 Web 面板图标资源 |
| server_go/web/index.html | 新增 Web 面板入口 HTML(引用构建产物) |
| server_go/web/assets/index-mKCh-jFT.css | 新增前端构建产物 CSS |
| server_go/main.go | Gin:embed 前端、JWT/CORS、REST API、DB 路径与登录统计、SPA NoRoute |
| server_go/go.mod | 补充 Gin 及其间接依赖声明 |
| server_go/go.sum | 新增/更新 Go 依赖校验信息 |
| server_go/Dockerfile | 多阶段构建:编译前端并嵌入 Go 二进制 |
| obfuscator/src/main/resources/sources/YumeCloud_NativeLibrary.vmp | 删除:VMProtect 工程文件(商业组件) |
| obfuscator/src/main/resources/sources/YumeCloud_NativeLibrary_NoAuth.vmp | 删除:VMProtect 工程文件(商业组件) |
| obfuscator/src/main/resources/sources/VMProtectSDK.h | 替换为开源 no-op 兼容桩头文件 |
| obfuscator/src/main/resources/sources/native_jvm.hpp | 调整接口:使用开放授权客户端函数签名 |
| obfuscator/src/main/resources/sources/native_jvm.cpp | 新增开放授权客户端(HTTP POST /login、多来源密钥、交互输入) |
| obfuscator/src/main/resources/sources/native_jvm_output.cpp | 移除闭源 DLL 字节与注入逻辑占位 |
| obfuscator/src/main/resources/sources/Authorization.h | 删除:闭源授权头文件 |
| obfuscator/src/main/resources/default-config.json | 新增 native.auth_url 默认配置项 |
| obfuscator/src/main/java/com/yumegod/obfuscator/YumeCloudProtection.java | 移除“愚蠢用户”检测;授权 URL 可配置;VMProtect 资源复制改为可选 |
| obfuscator/src/main/java/com/yumegod/obfuscator/utils/Util.java | 新增 copyResourceIfExists() 与 escapeString() |
| obfuscator/src/main/java/com/yumegod/obfuscator/jobf/transformer/Transformer.java | 移除未使用/不再需要的 transformer 引用 |
| obfuscator/src/main/java/com/yumegod/obfuscator/j2c/tasks/Protect.java | VMProtect 缺失时跳过加壳并直接打包原生库 |
| obfuscator/src/main/java/com/yumegod/obfuscator/j2c/tasks/Compile.java | 移除闭源链接;新增 WinSock2;VMProtect lib 按存在性链接 |
| obfuscator/src/main/java/com/yumegod/obfuscator/j2c/source/MainSourceBuilder.java | 生成的 JNI 入口改为调用开放授权客户端;移除闭源 DLL 嵌入 |
| obfuscator/src/main/java/com/yumegod/obfuscator/j2c/source/ClassSourceBuilder.java | 移除 Authorization.h include,保留 VMProtectSDK.h |
| docker-compose.yml | 构建上下文改为仓库根;分别指定 Go/Python Dockerfile |
| DEPLOYMENT.md | 更新结构说明与“Web 面板已内置”的部署访问指引 |
| admin-web/README.md | 更新为“前端源码保留 + 构建产物嵌入服务器”的新定位说明 |
| admin-web/frontend/vite.config.js | 开发代理 /api 目标端口改为 13337 |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+86
to
+93
| c.execute("SELECT value FROM settings WHERE name='jwt_secret'") | ||
| row = c.fetchone() | ||
| if row is None: | ||
| secret = secrets.token_hex(32) | ||
| c.execute("INSERT INTO settings (name, value) VALUES ('jwt_secret', ?)", (secret,)) | ||
| conn.commit() | ||
| else: | ||
| secret = row[0] |
Comment on lines
+315
to
+317
| auth_header = request.headers.get('Authorization', '') | ||
| token = auth_header.replace('Bearer ', '') | ||
| app_name = validate_jwt(token) |
Comment on lines
203
to
207
| for _ in range(amount): | ||
| key, expire_date = generate_key(app_name, days) | ||
| c.execute("INSERT INTO keys (key_id, app_name, expire_date, created_at) VALUES (?, ?, ?, ?)", | ||
| (key, app_name, expire_date, datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))) | ||
| (key, app_name, expire_date, datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'))) | ||
| keys.append(key) |
Comment on lines
+415
to
+420
| var exists int | ||
| err := db.QueryRow("SELECT 1 FROM applications WHERE app_name=?", req.AppName).Scan(&exists) | ||
| if err == nil { | ||
| c.JSON(http.StatusBadRequest, gin.H{"error": "Admin already exists for app: " + req.AppName}) | ||
| return | ||
| } |
Comment on lines
259
to
+263
| var keys []string | ||
| for i := 0; i < amount; i++ { | ||
| keyID, expireDate := generateKey(appName, days) | ||
| _, err := db.Exec("INSERT INTO keys (key_id, app_name, expire_date, created_at) VALUES (?, ?, ?, ?)", | ||
| keyID, appName, expireDate, time.Now().Format("2006-01-02 15:04:05")) | ||
| keyID, appName, expireDate, time.Now().Format(dbTimeLayout)) |
Comment on lines
42
to
45
| if (YumeCloudProtection.auth) { | ||
| includes.append("#include \"Authorization.h\""); | ||
| } | ||
| StringBuilder dllBytes = new StringBuilder(); | ||
| if (YumeCloudProtection.auth) { | ||
| dllBytes.append("unsigned char dllBytes[] = {"); | ||
| InputStream dll = MainSourceBuilder.class.getResourceAsStream("/sources/Authorization.dll"); | ||
| byte[] buffer = new byte[1024]; | ||
| int bytesRead; | ||
| while ((bytesRead = dll.read(buffer)) != -1) { | ||
| for (int j = 0; j < bytesRead; j++) { | ||
| dllBytes.append((int) buffer[j] & 0xFF).append(","); | ||
| } | ||
| } | ||
| dllBytes.append("};").append("\n"); | ||
| dllBytes.append("size_t dllSize = sizeof(dllBytes);").append("\n"); | ||
| authorization = " if (!native_jvm::utils::auth(VMProtectDecryptStringA(\"" + YumeCloudProtection.applicationName | ||
| + "\"), VMProtectDecryptStringA(\"" + YumeCloudProtection.authorizationURL + "login\"))) return JNI_ERR;\n"; | ||
| } |
| request += "Connection: close\r\n\r\n"; | ||
| request += body; | ||
| ok = send(fd, request.c_str(), (int) request.size(), 0) == (int) request.size(); |
Comment on lines
+266
to
+268
| put(&it, sizeof(it)); | ||
| put_word(class_atom); | ||
| put_wstr(title); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
1. Web 管理面板集成
DEPLOYMENT.md和admin-web/README.md,说明部署和访问方式。docker-compose.yml和Dockerfile更新,支持前端多阶段构建并嵌入服务器。/api/init,/api/login,/api/dashboard/stats等)。PREFIX-XXXX-XXXX-XXXX。2. 移除闭源授权组件与开放客户端实现
Authorization.dll、VMProtect SDK二进制及工程文件等闭源商业组件。native_jvm.cpp中实现开放的授权客户端,直接通过 POST/login验证密钥。YCP_LICENSE_KEY、license.key文件或交互式输入获取密钥。obfuscator模块中移除对闭源组件的依赖和引用,包括头文件、链接库和嵌入逻辑。obfuscator/src/main/java/com/yumegod/obfuscator/YumeCloudProtection.java中授权 URL 可配置。3. VMProtect 加壳降级为可选组件
vmp.exe或.vmp工程文件缺失时,自动跳过 VMProtect 加壳,直接打包未加壳的原生库。obfuscator/src/main/resources/sources/VMProtectSDK.h替换为开源 no-op 桩实现,并提供说明。VMProtectSDK64.lib时才链接 VMProtect SDK。4. 功能增强与优化
login_count列,用于统计客户端登录次数,Reset命令可清零。YCP_DB_PATH环境变量配置。obfuscator中“愚蠢用户”检测逻辑。Util.java中的copyResourceIfExists()和escapeString()方法。💡 Technical Highlights