Files
MemRelay/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/脚本管理模块要点(scripts).md
T

20 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 脚本管理模块要点(scripts)
type: fact
permalink: main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/脚本管理模块要点-scripts
stable_id: 673b121e-1adf-4613-91db-cf6ce550826c
scope: project
project_id: d5a7f581-c442-4554-87b9-ee723b8b0258
memory_type: fact
status: active
revision: 1
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
created_at: '2026-09-23T15:10:34.019938+00:00'
updated_at: '2026-09-23T15:10:34.020000+00:00'
tags:
- scripts
- module
- docker
---
容器隔离执行:每项目一个工作区 runtime/script_workspaces/u<owner>/p<id>/ bind-mount 到容器 /workspace(bind 的是 Docker daemon 宿主机路径,后端需与 daemon 同主机)。Monaco 在线编辑(内置语言服务:JSON/TS/JS/CSS/HTML 全功能,其余高亮+基础补全;高亮用 Shiki TextMate,web/src/utils/monacoHighlight.ts);xterm 终端(底部分页、自动重连指数退避、注入环境变量、自动激活 /workspace/.venv);手动运行 + APScheduler 定时(interval/cron,图形化规则编辑)。run_script 用 /bin/sh -c 包装并自动激活工作区 .venv(配置命令直接写 python main.py 即可)。网络仅 none(断网)/bridge(接入)两档。系统设置:并发数/工作区配额/运行记录保留(时长 + 按条数 script_run_retention_count,0=不限)、pip/npm/go 源配置(留空联网走公共源)。预设基础镜像:python 3.11/3.12/3.13-slim、node 18/20-slim、golang 1.22、alpine、bash(离线 tar 包导入)。