Feat: White-label web UI branding for subpath deployments

When the web remote desktop is mounted under another domain's subpath
(YAMA_WEB_BASE_PATH non-empty), read the product title from
YAMA_WEB_BRAND_NAME, substitute it for the SimpleRemoter titles and
PWA manifest name, and strip the security notice and website links.
The brand name is JSON- and HTML-escaped so operator input can't
produce malformed output. Served from the domain root, the official
SimpleRemoter branding is left unchanged.

Co-Authored-By: deepseek-v4-pro
This commit is contained in:
yuanyuanxianganddeepseek-v4-pro committed 2026-10-15 19:43:58 +02:00
1 parent 77b688c981
commit 4ff965a2b4
3 files changed
+127 -12

No files matched your search

+9
View File
@@ -998,6 +998,14 @@ func main() {
if basePath != "" {
log.Info("Serving web UI under base path %q (subpath deployment)", basePath)
}
// White-label title: when the web UI is mounted under another domain
// (basePath != ""), replace the SimpleRemoter branding with this name.
// YAMA_WEB_BRAND_NAME is human-editable; empty falls back to the base
// path's last segment (e.g. "/remoter" → "Remoter").
brandName := strings.TrimSpace(os.Getenv("YAMA_WEB_BRAND_NAME"))
if brandName != "" {
log.Info("White-label web UI title %q (YAMA_WEB_BRAND_NAME)", brandName)
}
// SSO: an optional detector bridges an already-authenticated portal
// session into a YAMA web session via /sso — but only for portal
// administrators. Any other portal role (viewer, unknown) still has to
@@ -1017,6 +1025,7 @@ func main() {
LoginUserLimit: wsauth.NewRateLimiter(5, 15*time.Minute),
TrustForwardedFor: trustProxy,
BasePath: basePath,
BrandName: brandName,
SSO: ssoDetector,
}