https://github.com/keyruu/sirberus
🐶 A single control plane for systemd and container.
https://github.com/keyruu/sirberus
Last synced: 28 days ago
JSON representation
🐶 A single control plane for systemd and container.
- Host: GitHub
- URL: https://github.com/keyruu/sirberus
- Owner: Keyruu
- License: agpl-3.0
- Created: 2025-02-17T16:54:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-12T19:38:07.000Z (10 months ago)
- Last Synced: 2026-03-05T14:14:09.097Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.77 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Sirberus
> [!CAUTION]
> **⚠️ EXPERIMENTAL SOFTWARE - DO NOT EXPOSE TO UNTRUSTED NETWORKS**
>
> 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
1. Clone the repository:
```bash
git clone https://github.com/yourusername/sirberus.git
cd sirberus
```
2. Install backend dependencies:
```bash
go mod download
```
3. Install frontend dependencies:
```bash
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.
1. Build the frontend:
```bash
cd web
pnpm build
cd ..
```
2. Start the backend server:
```bash
go run cmd/app/main.go
```
For frontend development with hot reload:
```bash
cd web
pnpm dev
```
## Building
1. Build the frontend (required before building the backend):
```bash
cd web
pnpm build
cd ..
```
2. Build the backend:
```bash
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 services
- `GET /api/systemd/services/:name` - Get details of a specific service
- `GET /api/systemd/services/:name/stream` - Stream service status updates
- `GET /api/systemd/services/:name/logs` - Stream service logs
- `POST /api/systemd/services/:name/start` - Start a service
- `POST /api/systemd/services/:name/stop` - Stop a service
- `POST /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](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
```bash
# 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.