3.2 KiB
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.htmlweb/admin/dist/assetsweb/portal/dist/index.htmlweb/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.exeymhut-unified-management-linux-amd64ymhut-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:33550YMHUT_BASE_URL: public endpoint, defaulthttps://update.ymhut.cnYMHUT_DB_PROVIDER:sqliteormysqlYMHUT_SQLITE_PATH: SQLite pathYMHUT_MYSQL_DSN: MySQL DSNYMHUT_UPDATE_PUBLIC_DIR: legacy update public directoryYMHUT_DOWNLOADS_DIR: package download directoryYMHUT_SOURCE_CHECK_SECONDS: source health check interval
Frontend
web/admin: Vue admin console sourceweb/portal: Vue public portal sourceweb/wasm: Rust WASM helpers
Rust WASM functions:
compareVersionsnormalizeReleaseManifestvalidateSourceCatalogscoreEndpointHealthmergeLegacyMediaTypes