本提交为 dsh_mcn_workshop 仓库的首个提交(旧仓 dsh_MCNProject 已停用), 完整固化 C:/Users/Administrator/.dsh 当前磁盘状态。 1) 临时数据清理:移出 sessions/(81M)、logs/、skill-backup-20260906/(14M)、 scripts/__pycache__、storages/workspace.json.bak —— 合计 94M(.dsh 162M → 68M) 2) 凭据脱敏:.credentials.yaml(含明文 DEEPSEEK_API_KEY)移出 git 跟踪并加入 .gitignore;mcn-data-insight/scripts/setup_redfox_key.py 中真实 key 示例改为占位符 3) .gitignore 增补 logs/、skill-backup-*/ 规则 4) 技能结构以当前磁盘状态为准:skills/ = mcn-short-video / impeccable / taste-skill / dsh-multi-user-migration;旧技能目录(mcn-dou-analysis、storyboard-prompt、 short-video-script、browser-harness、mcn-data-insight)与 profiles/web/node_modules/dsh-vision-router 本地已不存在,本提交记为删除
43 lines
1.8 KiB
Batchfile
43 lines
1.8 KiB
Batchfile
@echo off
|
|
title DSH-Guard-3080
|
|
echo ==========================================
|
|
echo DSH Web 自动重启守护
|
|
echo 端口 3080 web profile
|
|
echo 服务在运行则等待;被终止/崩溃后自动重启
|
|
echo 关闭本窗口 = 停止守护
|
|
echo 重启历史: %~dp0logs\dsh-restart.log
|
|
echo 退出留痕: %~dp0logs\guard-exit.log
|
|
echo ==========================================
|
|
set DSH_PORT=3080
|
|
set npm_config_registry=https://registry.npmmirror.com
|
|
set NODE_OPTIONS=
|
|
set LOGDIR=%~dp0logs
|
|
if not exist "%LOGDIR%" mkdir "%LOGDIR%"
|
|
|
|
rem ===== 防重复(guard-check.ps1 只统计 自动重启DSH.bat 守护窗口,其他入口不误判) =====
|
|
set GUARD_N=0
|
|
for /f %%p in ('powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0guard-check.ps1"') do set GUARD_N=%%p
|
|
if "%GUARD_N%"=="" set GUARD_N=0
|
|
if %GUARD_N% gtr 1 (
|
|
echo [%date% %time%] GUARD-DUP 已有守护窗口在运行(%GUARD_N% 个),本窗口自动退出 >> "%LOGDIR%\guard-exit.log"
|
|
echo [%date% %time%] 已有守护窗口在运行(%GUARD_N% 个),本窗口自动退出。
|
|
timeout /t 5 /nobreak >nul
|
|
exit /b 0
|
|
)
|
|
echo [%date% %time%] GUARD-START 守护启动(同名窗口 %GUARD_N% 个) >> "%LOGDIR%\guard-exit.log"
|
|
|
|
:loop
|
|
netstat -ano | findstr /r /c:":3080 .*LISTENING" >nul 2>&1
|
|
if not errorlevel 1 (
|
|
echo [%date% %time%] 服务已在运行,5 秒后重新检测...
|
|
timeout /t 5 /nobreak >nul
|
|
goto loop
|
|
)
|
|
echo [%date% %time%] 启动 DSH web (端口 %DSH_PORT%) ...
|
|
echo [%date% %time%] START dsh web --port %DSH_PORT% --no-open >> "%LOGDIR%\dsh-restart.log"
|
|
rem 分离启动:DSH 在独立控制台窗口(DSH-Runner)运行,守护只监视端口;
|
|
rem kill DSH 不会连坐守护窗口;启动后等待 45 秒再检测,避免重复拉起。
|
|
start "DSH-Runner" /min cmd /c "npx -y @deepseek-ai/[email protected] web --port %DSH_PORT% --no-open >> %LOGDIR%\dsh-restart.log 2>&1"
|
|
echo [%date% %time%] DSH-RUNNER 已分离启动,45 秒后重新检测端口 >> "%LOGDIR%\dsh-restart.log"
|
|
timeout /t 45 /nobreak >nul
|
|
goto loop |