Replacing Node-RED with a 10 MB browser editor and a start.sh
说明与用途
Codeshell 用轻量级浏览器编辑器和 start.sh 脚本取代了 Node‑RED,使客户集成能够在隔离容器中运行,并使用持久化 /code 卷,消除了单独的仓库,并简化了服务器断线时的管理。
问题
Custom integrations for each client server had to be written on a server that could be disconnected from the internet, making Node‑RED fragile and requiring manual code editing inside containers.
结果
Codeshell reduced integration development complexity, eliminated the need for per‑client repositories, and ensured code persistence across server disconnects and restarts.
工作流
- 1. Build a Docker image of codeshell (Go backend, Svelte/CodeMirror frontend).
- 2. Run the container with ports 8080 (editor) and 3000 (integration).
- 3. Mount a persistent volume for /code and optional volumes for /root and /opt.
- 4. Edit integration code in the browser editor or via terminal.
- 5. Create or modify start.sh to install runtimes and run the integration.
- 6. Start the container; codeshell supervises start.sh and provides restart/stop controls.
- 7. On each restart, start.sh installs missing dependencies and runs the integration.
- 8. On‑Prem Manager snapshots the /code volume for versioning and backup.
证据
Node‑RED was the default for these integrations before I joined. It is fragile for this kind of work: An async for loop is hard to write. Five API calls with something equivalent to Promise.all is close to rocket science. Debugging is the worst part.
A VS Code‑like editor in the browser, on the server, with the code directory mounted from outside so it survives a restart.
Running one integration is one container: docker run -d --name myapp ... ghcr.io/panth977/code-shell:latest
codeshell supervises the script. Its output shows as a start.sh entry in the terminal panel, next to your own terminals, with Restart and Stop buttons, and its state is in the top bar: running, stopped, exited, waiting or missing.
- 记录日期: 2026-10-25T14:11:18.282Z