Sirberus
Caution
Sirberus is experimental software that provides extensive control over systemd services and Docker/Podman containers. This service grants significant system-level privileges and should NEVER be exposed to public networks or untrusted users. Only run this on trusted, isolated networks or localhost. Improper exposure could lead to complete system compromise.
Overview
Sirberus is a unified control plane for managing systemd services and containers. It provides a single, intuitive interface for controlling and monitoring your system services and containerized applications.
Features
-
Service Management
- Start, stop, enable, and disable systemd services
- View service status and logs
- Monitor service health
- Manage service configuration
-
Container Control
- Start and stop containers
- Execute commands inside containers
- View container logs and status
- Monitor container health
- Manage container lifecycle
Project Structure
โโโ app # Application core
โโโ cmd # Command-line entry points
โโโ internal
โ โโโ api # API implementations
โ โโโ container # Container management
โ โโโ frontend # Frontend service
โ โโโ systemd # Systemd integration
โ โโโ types # Shared type definitions
โโโ web # Frontend application
Prerequisites
- Go 1.23 or higher
- Node.js and pnpm
- Docker or Podman (for container management)
Installation
-
Clone the repository:
git clone https://github.com/yourusername/sirberus.git cd sirberus -
Install backend dependencies:
go mod download
-
Install frontend dependencies:
cd web pnpm install
Configuration
Environment Variables
Sirberus can be configured using the following environment variables:
| Variable | Description | Default |
|---|---|---|
DOCKER_HOST |
Docker/Podman socket URL | Auto-detected (unix:///var/run/docker.sock, unix:///run/podman/podman.sock, or unix:///run/user/1000/podman/podman.sock) |
Development
Important: The backend serves the built frontend files, so you must build the frontend first before starting the backend.
-
Build the frontend:
cd web pnpm build cd ..
-
Start the backend server:
go run cmd/app/main.go
For frontend development with hot reload:
cd web
pnpm devBuilding
-
Build the frontend (required before building the backend):
cd web pnpm build cd ..
-
Build the backend:
go build -o sirberus cmd/app/main.go
API Endpoints
Sirberus provides a RESTful API for managing systemd services and containers.
Systemd Services
GET /api/systemd/services- List all systemd servicesGET /api/systemd/services/:name- Get details of a specific serviceGET /api/systemd/services/:name/stream- Stream service status updatesGET /api/systemd/services/:name/logs- Stream service logsPOST /api/systemd/services/:name/start- Start a servicePOST /api/systemd/services/:name/stop- Stop a servicePOST /api/systemd/services/:name/restart- Restart a service
Containers
GET /api/container/containers- List all containers
License
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
Testing
Systemd Tests
The systemd package includes tests that use the actual system instead of mocks. These tests interact with real systemd services.
Requirements:
- Linux operating system with systemd
- Root privileges (sudo) for most tests
- Go 1.23 or later
# Run as root to enable all tests
sudo go test -v ./internal/systemd/...
# Run without root (some tests will be skipped)
go test -v ./internal/systemd/...Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
