In the world of DevOps, the distance between a web dashboard and the terminal can feel like a chasm. Often, we find ourselves manually SSH-ing into servers to trigger deployment scripts, restart services, or check container health. Bash Runner was born out of a desire to bridge this gap—securely, efficiently, and in real-time.
Bash Runner is a hybrid orchestration engine that allows you to execute remote shell commands and deployment scripts through a secure web interface.
The Hybrid Challenge: REST vs. WebSockets
When building an orchestration tool, you face a dilemma. REST is great for simple, "set-and-forget" commands. You send a request, the server executes, and you get a response. However, for long-running scripts (like building a Docker image), a standard HTTP request might timeout, and you lose visibility into the progress.
WebSockets provide the real-time stream we need, but they are often more complex to implement for simple integrations.
In Bash Runner, I implemented a Hybrid Endpoint architecture. A single interface handles both:
- Direct HTTP Requests: For quick triggers like
restart-nginx. - Persistent WebSocket Connections: For streaming stdout/stderr of long-running deployment pipelines directly to a web-based terminal.
Architecture: The Command Registry
Security is paramount when you're exposing a shell to the web. You can't just allow a user to run rm -rf /.
Bash Runner uses a Strict Command Registry system. Every executable command must be pre-defined in a configuration file. The web API only accepts s, never raw shell strings.
