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
This project was originally forked from [webterm](https://github.com/fubarnetes/webterm) by Fabian Freyer. I chose this as a base because other projects were way too complex. His project was simple and easy to understand, but it was not well maintained. I have updated it to modern packages and heavily customized it to display a working demo for socktop.