diff --git a/live-platform/config/defaults/services/neko.json b/live-platform/config/defaults/services/neko.json new file mode 100644 index 0000000..42b75ec --- /dev/null +++ b/live-platform/config/defaults/services/neko.json @@ -0,0 +1,12 @@ +{ + "id": "neko", + "layer": "infra", + "enabled": true, + "manager": "systemd", + "ports": { "http": 9200 }, + "env": { + "ENABLE_NEKO": "1", + "NEKO_HTTP_PORT": "9200", + "NEKO_PROFILE_HOST_DIR": "/opt/live-modules/neko-profile" + } +} diff --git a/src/control_plane.py b/src/control_plane.py index 93d1892..b1c7ba9 100644 --- a/src/control_plane.py +++ b/src/control_plane.py @@ -89,6 +89,12 @@ SERVICE_SPECS: tuple[ServiceSpec, ...] = ( "Browser ADB control (ws-scrcpy stack; clone URL configurable in system-stack.env)", ), ServiceSpec("chromium", "Chromium 浏览器", "browser", "本机 Chromium + 持久化配置 + Remote DevTools(非 Docker)"), + ServiceSpec( + "neko", + "Neko 浏览器 (Docker)", + "browser", + "Docker 内嵌 Chromium 桌面(官方 ghcr.io/m1k1o/neko/chromium);远程开 YouTube Studio 等;ENABLE_NEKO=1 时安装", + ), ServiceSpec( "android_gateway", "Android Gateway", @@ -566,10 +572,11 @@ def recent_pm2_log_lines(max_lines: int = 14) -> list[str]: async def stack_stream_probes() -> dict[str, Any]: - """本机 SRS HTTP 端口探测(供 live.local 验收)。""" + """本机 SRS / Neko HTTP 端口探测(供 live.local 验收)。""" env = load_stack_env() srs_p = int(env.get("SRS_HTTP_PORT", "8080") or 8080) srs_api_p = int(env.get("SRS_API_PORT", "1985") or 1985) + neko_p = int(env.get("NEKO_HTTP_PORT", "9200") or 9200) loop = asyncio.get_event_loop() def run_srs() -> dict[str, Any]: @@ -589,8 +596,16 @@ async def stack_stream_probes() -> dict[str, Any]: "api_ok": api_ok, } - srs_d = await loop.run_in_executor(None, run_srs) - return {"srs": srs_d} + def run_neko() -> dict[str, Any]: + tcp = _probe_tcp_port("127.0.0.1", neko_p) + http = _probe_http_get(f"http://127.0.0.1:{neko_p}/", timeout=2.5) + return {"port": neko_p, "tcp": tcp, "http": http} + + srs_d, neko_d = await asyncio.gather( + loop.run_in_executor(None, run_srs), + loop.run_in_executor(None, run_neko), + ) + return {"srs": srs_d, "neko": neko_d} def stack_summary() -> dict: @@ -606,6 +621,7 @@ def stack_summary() -> dict: srs_api = env.get("SRS_API_PORT", "1985") android_panel = env.get("ANDROID_PANEL_PORT", "5000") chrome_dbg = env.get("BROWSER_REMOTE_DEBUG_PORT", "9222") + neko_port = env.get("NEKO_HTTP_PORT", "9200") ql: dict[str, str] = { "control_plane": f"http://{mdns_host}:{web_port}", "webtty": f"http://{mdns_host}:{webtty}", @@ -615,6 +631,7 @@ def stack_summary() -> dict: "srs_api": f"http://{mdns_host}:{srs_api}/api/v1/versions", "ws_scrcpy": f"http://{mdns_host}:{android_panel}", "chromium_remote_debug": f"http://{mdns_host}:{chrome_dbg}", + "neko_browser": f"http://{mdns_host}:{neko_port}", } return { "hostname": hostname, @@ -627,6 +644,18 @@ def stack_summary() -> dict: "dashboard_url": f"http://{mdns_host}" if homepage_port in {"80", ""} else f"http://{mdns_host}:{homepage_port}", "control_url": f"http://{mdns_host}:{web_port}", "stack_env_present": STACK_ENV.is_file(), + "neko_login": { + "user_login": "live", + "user_password": env.get("NEKO_USER_PASS", "12345678"), + "admin_login": "admin", + "admin_password": env.get("NEKO_ADMIN_PASS", "12345678"), + "note_zh": ( + "Neko 为 multiuser 模式:「显示昵称」可任意填写(如 live);「密码」必须与 NEKO_USER_PASS / NEKO_ADMIN_PASS " + "完全一致(默认 12345678)。不要把 live/12345678 填进同一格。密码错误时会一直卡在连接中。" + " WebRTC 需 NEKO_WEBRTC_NAT1TO1 为板子局域网 IP,并放行 UDP 端口段。" + " 本仓库 compose 仅启用 Chromium 镜像,不包含 Firefox。" + ), + }, "quick_links": ql, } diff --git a/web-console/components/console/LiveConsoleWorkspace.tsx b/web-console/components/console/LiveConsoleWorkspace.tsx index b7cbc7b..903c33e 100644 --- a/web-console/components/console/LiveConsoleWorkspace.tsx +++ b/web-console/components/console/LiveConsoleWorkspace.tsx @@ -870,8 +870,8 @@ export function LiveConsoleWorkspace({ embeddedShellCrash = false, portalLang }:

{tr( - "ShellCrash 负责代理上网;本机 FFmpeg 处理推流或 HDMI;Chromium 负责浏览器侧;开发板通过 USB 双头线 ADB 控制 AOSP。各模块独立,可分别启停。", - "ShellCrash for egress; FFmpeg for stream or HDMI; Chromium for browser; USB ADB to AOSP. Modules are isolated.", + "ShellCrash 负责代理上网;本机 FFmpeg 处理推流或 HDMI;Neko(Docker Chromium)或本机 Chromium 负责浏览器侧;开发板通过 USB 双头线 ADB 控制 AOSP。各模块独立,可分别启停。", + "ShellCrash for egress; FFmpeg for stream or HDMI; Neko (Docker Chromium) or host Chromium for browser; USB ADB to AOSP. Modules are isolated.", )}

@@ -971,8 +971,8 @@ export function LiveConsoleWorkspace({ embeddedShellCrash = false, portalLang }:
  • {tr( - "「直播业务」里启停 PM2 脚本(抖音→YouTube、HDMI 等);「系统服务」看 ShellCrash、SRS、ws-scrcpy 等是否在跑。", - "Use Live ops for PM2 scripts; Services for ShellCrash, SRS, ws-scrcpy, etc.", + "「直播业务」里启停 PM2 脚本(抖音→YouTube、HDMI 等);「系统服务」看 ShellCrash、SRS、ws-scrcpy、Neko 等是否在跑。", + "Use Live ops for PM2 scripts; Services for ShellCrash, SRS, ws-scrcpy, Neko, etc.", )}
  • @@ -995,8 +995,8 @@ export function LiveConsoleWorkspace({ embeddedShellCrash = false, portalLang }:

    {tr("🛰️ 流媒体与桌面入口", "Streaming & desktop")}

    {tr( - "ws-scrcpy:浏览器里控安卓;Chromium:本机+油猴+RemoteDebug。", - "ws-scrcpy: browser ADB; Chromium: host+Tampermonkey+9222.", + "ws-scrcpy:浏览器里控安卓;Chromium:本机+油猴+RemoteDebug;Neko:Docker 里跑 Chromium 桌面(非 Firefox 版)。", + "ws-scrcpy: browser ADB; Chromium: host+Tampermonkey+9222; Neko: Chromium desktop in Docker (not the Firefox image).", )}

    @@ -1028,6 +1028,11 @@ export function LiveConsoleWorkspace({ embeddedShellCrash = false, portalLang }: 🧪 {tr("Chromium RemoteDebug (9222)", "Chromium RemoteDebug")} ) : null} + {qlNorm.neko_browser ? ( + + 🐱 Neko / {tr("Docker Chromium 桌面", "Docker Chromium desktop")} + + ) : null} {qlNorm.webtty ? ( ⌨️ WebTTY @@ -1496,8 +1501,8 @@ export function LiveConsoleWorkspace({ embeddedShellCrash = false, portalLang }:

    {tr( - "内嵌若黑屏:多为 WebSocket 未连上或服务未启动。请先确认「系统服务」里 android_panel 在线,并尝试新标签打开。", - "Black iframe: often WebSocket or service down. Check android_panel in Services, try opening in a new tab.", + "内嵌若黑屏:多为 WebSocket 未连上或服务未启动。请先确认「系统服务」里 android_panel 在线,并尝试新标签打开;Neko(Chromium)在 ENABLE_NEKO=1 且容器运行后一般为 9200 端口。", + "Black iframe: often WebSocket or service down. Check android_panel in Services, try opening in a new tab; Neko Chromium is often :9200 when ENABLE_NEKO=1 and the container is up.", )}