[PR #47] [MERGED] Shell module #45

Closed
opened 2026-06-06 22:10:48 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/vxcontrol/soldr-modules/pull/47
Author: @jnovikov
Created: 2/12/2023
Status: Merged
Merged: 5/24/2023
Merged by: @asdek

Base: masterHead: shell_module


📝 Commits (3)

  • 9640b65 Shell: Implemented module.
  • afda356 Shell: add tests, config, fixes issues.
  • faa553a Shell: remove comments and debug prints.

📊 Changes

37 files changed (+2159 additions, -0 deletions)

View changed files

📝 Dockerfile (+1 -0)
📝 config.json (+37 -0)
shell/1.0.0/bmodule/main.vue (+183 -0)
shell/1.0.0/bmodule/xterm.css (+192 -0)
shell/1.0.0/bmodule/xterm.js (+1 -0)
shell/1.0.0/cmodule/args.json (+4 -0)
shell/1.0.0/cmodule/clibs/windows/386/sys/winpty-agent.exe (+0 -0)
shell/1.0.0/cmodule/clibs/windows/386/sys/winpty.dll (+0 -0)
shell/1.0.0/cmodule/clibs/windows/amd64/sys/winpty-agent.exe (+0 -0)
shell/1.0.0/cmodule/clibs/windows/amd64/sys/winpty.dll (+0 -0)
shell/1.0.0/cmodule/engines/acts_engine.lua (+295 -0)
shell/1.0.0/cmodule/engines/base_engine.lua (+330 -0)
shell/1.0.0/cmodule/main.lua (+72 -0)
shell/1.0.0/cmodule/ptys/pty.lua (+34 -0)
shell/1.0.0/cmodule/ptys/unixpty.lua (+259 -0)
shell/1.0.0/cmodule/ptys/winpty.lua (+266 -0)
shell/1.0.0/config/action_config_schema.json (+68 -0)
shell/1.0.0/config/changelog.json (+14 -0)
shell/1.0.0/config/config_schema.json (+6 -0)
shell/1.0.0/config/current_action_config.json (+10 -0)

...and 17 more files

📄 Description

Introduce shell module.

This PR introduces new module that allow to spawn interactive shell.
Module supports actions for starting and stopping shells. Module supports multiple shells spawned on single agent.

Implementation details:

  • Module uses minified version of xterm.js library to emulate client-side terminal. This library is distributed under MIT license.
  • Client side part of the module implemented using pseudo terminals:
  • Windows: WinPTY library is used. Library is distributed under MIT license. Module uses DLL + Agent binary downloaded from WinPTY releases page.
  • MacOS: BSD functions to spawn PTTY are used.
  • Linux: raw system calls are used because BSD functions are not available without installing special headers.

How to test the Change

You can import module and try to interact with the spawned shell.

Changelog Entry

Added - New "shell" module. Module that allows to spawn interactive shell on agents.

Checklist:

  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/vxcontrol/soldr-modules/pull/47 **Author:** [@jnovikov](https://github.com/jnovikov) **Created:** 2/12/2023 **Status:** ✅ Merged **Merged:** 5/24/2023 **Merged by:** [@asdek](https://github.com/asdek) **Base:** `master` ← **Head:** `shell_module` --- ### 📝 Commits (3) - [`9640b65`](https://github.com/vxcontrol/soldr-modules/commit/9640b655ffd8eba65a5773b4c652389987da8217) Shell: Implemented module. - [`afda356`](https://github.com/vxcontrol/soldr-modules/commit/afda35651c8a8b4224ccf687469b4438de70dea3) Shell: add tests, config, fixes issues. - [`faa553a`](https://github.com/vxcontrol/soldr-modules/commit/faa553a3104247c8876e46088b2573a485d8e5ef) Shell: remove comments and debug prints. ### 📊 Changes **37 files changed** (+2159 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+1 -0) 📝 `config.json` (+37 -0) ➕ `shell/1.0.0/bmodule/main.vue` (+183 -0) ➕ `shell/1.0.0/bmodule/xterm.css` (+192 -0) ➕ `shell/1.0.0/bmodule/xterm.js` (+1 -0) ➕ `shell/1.0.0/cmodule/args.json` (+4 -0) ➕ `shell/1.0.0/cmodule/clibs/windows/386/sys/winpty-agent.exe` (+0 -0) ➕ `shell/1.0.0/cmodule/clibs/windows/386/sys/winpty.dll` (+0 -0) ➕ `shell/1.0.0/cmodule/clibs/windows/amd64/sys/winpty-agent.exe` (+0 -0) ➕ `shell/1.0.0/cmodule/clibs/windows/amd64/sys/winpty.dll` (+0 -0) ➕ `shell/1.0.0/cmodule/engines/acts_engine.lua` (+295 -0) ➕ `shell/1.0.0/cmodule/engines/base_engine.lua` (+330 -0) ➕ `shell/1.0.0/cmodule/main.lua` (+72 -0) ➕ `shell/1.0.0/cmodule/ptys/pty.lua` (+34 -0) ➕ `shell/1.0.0/cmodule/ptys/unixpty.lua` (+259 -0) ➕ `shell/1.0.0/cmodule/ptys/winpty.lua` (+266 -0) ➕ `shell/1.0.0/config/action_config_schema.json` (+68 -0) ➕ `shell/1.0.0/config/changelog.json` (+14 -0) ➕ `shell/1.0.0/config/config_schema.json` (+6 -0) ➕ `shell/1.0.0/config/current_action_config.json` (+10 -0) _...and 17 more files_ </details> ### 📄 Description ### Introduce shell module. This PR introduces new module that allow to spawn interactive shell. Module supports actions for starting and stopping shells. Module supports multiple shells spawned on single agent. Implementation details: - Module uses minified version of [xterm.js](https://github.com/xtermjs/xterm.js) library to emulate client-side terminal. This library is distributed under MIT license. - Client side part of the module implemented using pseudo terminals: - Windows: [WinPTY](https://github.com/rprichard/winpty) library is used. Library is distributed under MIT license. Module uses DLL + Agent binary downloaded from WinPTY releases page. - MacOS: BSD functions to spawn PTTY are used. - Linux: raw system calls are used because BSD functions are not available without installing special headers. ### How to test the Change You can import module and try to interact with the spawned shell. ### Changelog Entry > Added - New "shell" module. Module that allows to spawn interactive shell on agents. ### Checklist: - [x] I have updated the documentation accordingly. - [x] I have added tests to cover my change. - [x] All new and existing tests pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-06 22:10:48 -04:00
yindo closed this issue 2026-06-06 22:10:48 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/soldr-modules#45