Vapor is a comprehensive Linux system management platform inspired by Cockpit designed to simplify server administration through a modern web interface. With its clean and intuitive design, Vapor brings together traditional system administration tools with container orchestration and Kubernetes management capabilities.
- System Management
- User management (Linux system users)
- Network configuration (interfaces, bridges, bonds, VLANs)
- Storage management (disks, LVM, iSCSI, BTRFS, multipath)
- System monitoring and metrics
- Container Orchestration
- Docker container management
- CRI-compatible runtime support (containerd, CRI-O)
- Container images management
- Resumable image uploads
- Virtualization (KVM/Libvirt)
- VM creation with enhanced API
- PCI device passthrough support
- Storage pool management
- Template-based VM creation
- VNC/SPICE console access
- Backup and snapshot management
- Kubernetes Integration
- Cluster management
- Workload deployment
- Helm chart management
- Node and storage management
- Ansible Automation
- Playbook execution with parameter support
- Ad-hoc commands
- Dynamic inventory generation
- Real-time output streaming
- Execution history tracking in SQLite
- Advanced Features
- WebSocket-based terminal access (per-user sessions)
- Real-time log streaming
- Resumable file uploads (TUS protocol)
- JWT authentication with refresh tokens
- SSH key authentication support
- Go 1.21 or higher
- Linux operating system (primary target)
- Root privileges for system operations
- systemd for log management
The application requires the following system utilities to be installed on Linux:
-
Core utilities (usually pre-installed):
mount
,umount
- For filesystem mounting operationslsblk
- For listing block devicesuseradd
,usermod
,userdel
- For user managementansible
- For otomation tasks
-
Filesystem tools (install based on your needs):
e2fsprogs
- For ext2/ext3/ext4 filesystem support (provides mkfs.ext2, mkfs.ext3, mkfs.ext4)xfsprogs
- For XFS filesystem support (provides mkfs.xfs)btrfs-progs
- For Btrfs filesystem support (provides mkfs.btrfs)
-
System logging:
systemd
- For journalctl log management
-
Advanced storage management (optional):
lvm2
- For LVM (Logical Volume Manager) supportopen-iscsi
oriscsi-initiator-utils
- For iSCSI supportmultipath-tools
ordevice-mapper-multipath
- For multipath support
Ubuntu/Debian:
sudo apt-get update
sudo apt-get install -y util-linux e2fsprogs xfsprogs btrfs-progs systemd lvm2 open-iscsi multipath-tools
RHEL/CentOS/Fedora:
sudo yum install -y util-linux e2fsprogs xfsprogs btrfs-progs systemd lvm2 iscsi-initiator-utils device-mapper-multipath
# or for newer versions:
sudo dnf install -y util-linux e2fsprogs xfsprogs btrfs-progs systemd lvm2 iscsi-initiator-utils device-mapper-multipath
Arch Linux:
sudo pacman -S util-linux e2fsprogs xfsprogs btrfs-progs systemd lvm2 open-iscsi multipath-tools
Alpine Linux:
sudo apk add util-linux e2fsprogs xfsprogs btrfs-progs lvm2 open-iscsi multipath-tools
- Linux x86_64: Primary platform with full functionality
This application is Linux-only and will not run on macOS, Windows, or other operating systems. The application enforces this requirement at startup and will exit with an error if run on non-Linux systems.
The application must be built on a Linux system or cross-compiled for Linux:
# Build for Linux x86_64 (native or cross-compilation)
make build-linux
# Clone the repository
git clone https://github.com/awanio/vapor.git
cd vapor
# Install dependencies
make install-deps
# Build production binary
make build
# Build development binary
make build-dev
# Build specifically for Linux x86_64 (cross-compilation)
make build-linux
# Run tests
make test
For a complete development environment with all dependencies, use the provided Docker Compose setup:
# Quick start using Make commands
make dev-up # Start development environment
make dev-ps # Check container status
make dev-exec # Access container shell
make dev-logs # View logs
make dev-down # Stop environment
make dev-help # Show all dev commands
# Or navigate to development folder for direct control
cd development
./compose.sh up -d
The development environment includes:
- Full Linux system with systemd
- Docker-in-Docker for container management
- K3s for Kubernetes testing
- iSCSI target for storage testing
- All required system utilities pre-installed
See development/README.md for detailed setup instructions.
# Build for Linux x86_64
make build-linux
# Copy binary and deploy script to Linux server
scp bin/system-api-linux-amd64 deploy.sh user@server:/tmp/
# On the Linux server, run deployment script
sudo bash /tmp/deploy.sh
# Copy binary to system location
sudo cp bin/system-api /usr/local/bin/
# Copy systemd unit file
sudo cp system-api.service /etc/systemd/system/
# Reload systemd and start service
sudo systemctl daemon-reload
sudo systemctl enable system-api
sudo systemctl start system-api
The application can be configured using environment variables:
VAPOR_JWT_SECRET
: Secret key for JWT token signing (required for production)VAPOR_PORT
: Server address and port (default::7770
)
The complete OpenAPI 3.1.0 specification is available in openapi.yaml
.
The API uses Linux system user authentication:
- Any valid Linux user can authenticate with their system credentials
- The API uses the system's authentication mechanism (via
su
command) - User must exist in
/etc/passwd
- All authenticated users receive the "admin" role by default
The application includes an embedded web UI that is served from the root path (/
). When you build the binary, any files in the web/dist
directory are automatically embedded into the executable, creating a single self-contained binary.
- Place your web UI build artifacts in the
web/dist
directory - Run
make build
- this will automatically embed the web assets - The resulting binary will serve both the API and web UI
- Single Page Application (SPA) support with client-side routing
- Automatically serves
index.html
for unknown routes (SPA fallback) - Static assets are served from the embedded filesystem
- No external web server required
Once the server is running, you can access:
- Web UI:
http://localhost:8080/
- API endpoints:
http://localhost:8080/api/v1/*
- WebSocket endpoints:
ws://localhost:8080/api/v1/ws/*
- OpenAPI docs:
http://localhost:8080/docs
The API provides WebSocket-based terminal access at /api/v1/ws/terminal
. Key features:
- User-based sessions: Terminal sessions run as the authenticated Linux user
- Security: Requires valid JWT authentication before establishing terminal session
- Audit logging: All terminal sessions are logged with username and session details
- User permissions: Each user operates within their own Linux permissions
- Connect to
ws://localhost:8080/api/v1/ws/terminal
- Send authentication message:
{ "type": "auth", "payload": { "token": "your-jwt-token" } }
- After successful auth, send subscribe message with terminal size:
{ "type": "subscribe", "payload": { "rows": 24, "cols": 80 } }
- Send input:
{ "type": "input", "data": "ls -la\n" }
- Resize terminal:
{ "type": "resize", "rows": 40, "cols": 120 }
/api/v1/ws/metrics
- Real-time system metrics/api/v1/ws/logs
- Real-time log streaming
make dev
# Run all tests
make test
# Run tests with coverage
make test-coverage
make fmt
make lint
- Authentication: Uses Linux system authentication - ensure strong user passwords.
- Privileges: The service requires root privileges for system operations.
- JWT Secret: Always use a strong, randomly generated secret in production.
- HTTPS: Use HTTPS in production environments.
- Network: Bind to localhost only or use proper firewall rules.
- Terminal Access: The WebSocket terminal feature provides full shell access as the authenticated user:
- Users get their own shell sessions with their Linux permissions
- All terminal sessions are logged for audit purposes
- Ensure proper authentication and network security when exposing this feature
Please see CONTRIBUTING.md for guidelines on setting up your environment, coding standards, commit sign-off (DCO), and the PR process.
Participation in this project is governed by our CODE_OF_CONDUCT.md.
Please report vulnerabilities privately as described in our SECURITY.md.
This project is licensed under the Apache License 2.0 — see the LICENSE file for details. Where required, third-party attributions are listed in the NOTICE file.
- Inspired by the Cockpit Project
- Built with Gin Web Framework
- Uses gopsutil for system metrics
- netlink for network management
- Ansible for automation tasks