ljnljn2005 / dsh-octopus-launch

목록에 있음

DSH 插件:dsh 启动时自动后台拉起外部程序(默认场景为 octopus LLM 网关),幂等去重、detached 后台运行

main모델 소스 보기

설치

npx -y @deepseek-ai/dsh plugin --profile web add github:ljnljn2005/dsh-octopus-launch

이 설치 명령은 GitHub 저장소 주소에서 생성된 확인되지 않은 시작점입니다.

README

유지 관리자가 작성한 문서 스냅샷입니다.

GitHub에서 보기 ↗
커밋 d1765cc동기화 2026. 8. 18.

dsh-octopus-launch

DSH(DeepSeek Harness)插件:dsh 启动时自动在后台拉起外部程序,默认配置用于拉起 Linux 版 octopus LLM 网关(/mnt/d/Programs/octopus/octopus start)。

特性

特性说明
幂等pgrep 检测目标进程,已在运行则跳过,绝不重复拉起
防并发启动前二次检测,两个 dsh 同时启动时基本只会拉起一次
后台运行detached + setsid,dsh 进程退出后目标进程继续存活
工作目录自动设为二进制所在目录(octopus 用相对路径 ./data/config.json
启动日志输出到 <二进制目录>/<二进制名>.dsh.log,便于排障
失败隔离任何失败只记日志,绝不影响 dsh 主流程

安装

dsh plugin --profile web add github:ljnljn2005/dsh-octopus-launch
dsh plugin --profile headless add github:ljnljn2005/dsh-octopus-launch   # 可选

profile 的 cordis.patch.yml 中启用(binaryPath 必填,按你的环境填写):

- insert:
    - id: octopus-launch
      name: 'dsh-octopus-launch'
      config:
        binaryPath: '/mnt/d/Programs/octopus/octopus'
        args:
          - start

配置项

字段类型默认说明
binaryPathstring必填要拉起的可执行文件绝对路径(按自己环境填)
argsstring[]["start"]启动参数
detectCommandstringpgrep -x <二进制名>检测进程是否已运行的命令
logFilestring<二进制目录>/<名>.dsh.log启动日志输出文件
autoStartbooleantrue是否在 dsh 启动时自动拉起
confirmDelayMsnumber1500启动后等待确认的毫秒数;0 = 不确认
recheckDelayMsnumber300启动前二次检测间隔(毫秒)

数据库手动清理(可选)

octopus 会把每次转发的完整请求体存入 data/data.dbrelay_logs 表,长期运行可能涨到十几 GB。仓库内附带安全清理脚本 cleanup.sh重建策略,非 DELETE+VACUUM——后者在大库上中断会导致 SQLite 文件损坏),放在 octopus 目录下执行即可:

cd /mnt/d/Programs/octopus
./cleanup.sh              # 默认:清空 relay_logs,保留 1 个备份
./cleanup.sh --keep=3     # 保留最近 3 个备份
RESTART=0 ./cleanup.sh    # 清理后不重启 octopus

执行流程:停止 octopus → 原库 mv 备份为 data/data.db.bak.<时间戳>(零风险回退点)→ 复制完整 schema + 全部配置/统计表数据(relay_logs 建空表)→ PRAGMA integrity_check 验证 → 失败自动回滚 → 新库就位 → 重启。配置数据(渠道/API Key/价格)永远保留,只有转发日志被清空。

本地测试

node test/test.mjs

/bin/sleep 复制成的假二进制模拟常驻服务,验证后台拉起、幂等去重、进程确认。

프로젝트 파일 및 신호

표시된 항목은 디렉터리 스냅샷에서 감지된 공개 저장소 신호입니다.

테스트감지됨

저장소 정보

언어
JavaScript
라이선스
MIT
마지막 업데이트
2026. 8. 16. 오후 2:35

신중하게 설치하기

소스 코드, 권한, 수명 주기 스크립트, 의존성 및 네트워크 접근을 검토하고 신뢰하지 않는 플러그인은 격리 환경에서 테스트하세요.