Files
YMhut-box-C-/server/unified-management
QWQLwToo 7745e7a2d4
build-winui / winui (push) Waiting to run
服务端媒体源导入/保存/客户端输出链路修复:支持 snake/camel、subcategories/sources,默认客户端可见,保存后发布兼容 media-types.json。
新增数据库同步 Job API、持久化状态、实时输出、最新任务恢复,以及系统日志聚合接口。
管理端优化:日志中心、运维实时状态框、同步输出自动滚动、仪表盘“输出”列、真实延迟空态、本地 favicon/avatar。
新增 server/unified-management/assets/favicon.ico 和 developer-avatar.png,并接好 /favicon.ico、/admin/favicon.ico、/setup/favicon.ico、/assets/*。
WinUI 随机放映室卡片优先显示子接口原始 Description。
Inno 安装器输出框改为选区末尾 + SendMessage 滚动到底部。
2026-06-29 22:28:58 +08:00
..
2026-06-26 13:28:09 +08:00
2026-06-26 13:28:09 +08:00
2026-06-26 13:28:09 +08:00
2026-06-26 13:28:09 +08:00

YMhut Unified Management

This service unifies the old server/update and server/feedback-mailer projects.

What It Provides

  • Go backend with SQLite by default.
  • Optional MySQL configuration with runtime status and failover hooks.
  • Legacy routes for update-info.json, tool-status.json, media-types.json, modules.json, downloads, and feedback.
  • New client discovery through /api/client/bootstrap.
  • Admin login with default account admin/admin.
  • Login captcha, HttpOnly session cookie, and CSRF checks.
  • In-process media/data source service with scheduled health checks.
  • Vue admin/portal source and Rust WASM helper source.

Run

cd server\unified-management
go mod tidy
go run main.go

The startup preflight prints:

  • the accepted entrypoint: go run main.go
  • the listen address
  • storage, SQLite, legacy JSON, downloads, and frontend dist status

Alternative command entrypoint:

go run .\cmd\unified-management

Tests:

go test ./...

Frontend Build Check

Startup preflight checks both built web apps:

  • web/admin/dist/index.html
  • web/admin/dist/assets
  • web/portal/dist/index.html
  • web/portal/dist/assets

If either frontend is missing, the service still starts, but the preflight log tells you to run the frontend build. Release binaries built with embed_web report that embedded frontend assets are being used instead. Build the local dist files with:

cd server\unified-management\web\admin
npm install
npm run build

cd ..\portal
npm install
npm run build

The Go server serves portal assets from /assets/* and admin assets from /admin/assets/*. Disk dist files are preferred during development; embedded assets are used as the release fallback.

Release Binaries

Build frontend assets and produce merged backend binaries for Windows and Linux. The scripts run npm run build for both web apps and compile Go with -tags embed_web, so the resulting binaries include the admin and portal frontends:

cd server\unified-management
.\scripts\build-release.ps1 -Version 0.1.0

Linux/macOS shell:

cd server/unified-management
VERSION=0.1.0 ./scripts/build-release.sh

Outputs are written to dist-release/:

  • ymhut-unified-management-windows-amd64.exe
  • ymhut-unified-management-linux-amd64
  • ymhut-unified-management-linux-arm64

Default Port

The default listen address is :33550.

Override it with either:

$env:YMHUT_LISTEN=":33551"

or:

$env:PORT="33551"

Environment

  • YMHUT_LISTEN: listen address, default :33550
  • YMHUT_BASE_URL: public endpoint, default https://update.ymhut.cn
  • YMHUT_DB_PROVIDER: sqlite or mysql
  • YMHUT_SQLITE_PATH: SQLite path
  • YMHUT_MYSQL_DSN: MySQL DSN
  • YMHUT_UPDATE_PUBLIC_DIR: legacy update public directory
  • YMHUT_DOWNLOADS_DIR: package download directory
  • YMHUT_SOURCE_CHECK_SECONDS: source health check interval

Frontend

  • web/admin: Vue admin console source
  • web/portal: Vue public portal source
  • web/wasm: Rust WASM helpers

Rust WASM functions:

  • compareVersions
  • normalizeReleaseManifest
  • validateSourceCatalog
  • scoreEndpointHealth
  • mergeLegacyMediaTypes