This is a modern web terminal server that provides browser-based terminal access with WebSocket support. It's built with Rust using the Actix-Web framework and xterm.js for the frontend.
**Note**: The server must be run from the project root directory, as it expects `./static`, `./templates`, and `./node_modules` to be accessible in the current working directory.
### Command Line Options
```bash
webterm-server --help
```
Options:
-`-p, --port <PORT>` - The port to listen on (default: 8082)
-`-H, --host <HOST>` - The host or IP to listen on (default: localhost)
-`-c, --command <COMMAND>` - The command to execute (default: /bin/sh)
Example:
```bash
cargo run -- --port 8080 --host 0.0.0.0 --command /bin/bash
```
## Production Deployment
### Docker
```bash
# Build the image
docker build -t socktop-webterm:latest .
# Run the container
docker run -d -p 8082:8082 socktop-webterm:latest
```
### Kubernetes/k3s
Automated deployment via Gitea Actions CI/CD:
1. Push to `main` branch
2. Workflow automatically builds arm64 image
3. Image tagged with version from `Cargo.toml`
4. Deployed to k3s cluster with zero-downtime rolling update
See `.gitea/workflows/build-and-deploy.yaml` for the complete workflow.
Manual deployment:
```bash
kubectl apply -f kubernetes/
```
## CI/CD Pipeline
This project includes a complete CI/CD pipeline using Gitea Actions:
- **Automatic builds** on every push to main/master
- **Version tagging** from Cargo.toml
- **Container registry** integration
- **Automated k3s deployment** with rolling updates
- **Zero downtime** deployments
For setup instructions, see:
- [Getting Started Guide](GETTING-STARTED-CI-CD.md)
⚠️ **Warning**: This application provides shell access to anyone who can access the web interface. It is intended for use in controlled environments only. Only run in Run in isolated containers/namespaces.
## Credits
### Original Author
This project is a fork of [webterm](https://github.com/fubarnetes/webterm) originally created by: