Admin Guide
User management, audit logs, remote commands, and billing management.
This page covers features available only to administrators (Admin role).
User Management
ServerBee supports multiple users with two roles:
| Role | Permissions |
|---|---|
| Admin | Full management: users, server config, alert rules, notifications, audit logs, etc. |
| Member | Read-only: view Dashboard, server details, Ping results |
Managing Users
Go to Settings → Users:
- Create user: Enter username, password, and role
- Edit role: Change a user's role (Admin/Member)
- Delete user: Remove a user account (cannot delete the last Admin)
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/users | GET | List all users |
/api/users | POST | Create a user |
/api/users/{id} | GET | Get user details |
/api/users/{id} | PUT | Update user role |
/api/users/{id} | DELETE | Delete a user |
Audit Logs
ServerBee automatically records audit logs for critical operations, helping administrators track security events.
Recorded Events
- User login (success/failure)
- Password changes
- 2FA enable/disable
- Terminal connect/disconnect
- Capability denial events
Viewing Audit Logs
Go to Settings → Audit Logs:
- Browse all audit records (paginated)
- View user, action type, details, IP address, and timestamp
API Endpoint
GET /api/audit-logs?limit=50&offset=0Returns a paginated audit log list. Each entry contains:
{
"id": 1,
"user_id": "user-uuid",
"action": "login",
"detail": "Login successful",
"ip": "192.168.1.100",
"created_at": "2026-03-14T10:30:00Z"
}Audit logs are retained for 180 days by default (configurable via retention.audit_logs_days).
Remote Commands
Administrators can dispatch commands to online servers and retrieve execution results.
Usage
- Go to Settings → Tasks
- Enter the command to execute
- Select target servers (multi-select supported)
- Click Execute
Execution Flow
- Server creates a Task record
- Sends the command to each target agent via WebSocket
- Agent executes the command, reports stdout/stderr and exit_code
- Results are stored in the
task_resultstable
Limitations
- Command execution timeout: 300 seconds
- Requires
execcapability (CAP_EXEC) on target servers - Servers without CAP_EXEC receive a synthetic result:
exit_code = -2, message: "Capability disabled" - Only Admin role can create tasks
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/tasks | POST | Create and dispatch a command |
/api/tasks/{id} | GET | Get task details |
/api/tasks/{id}/results | GET | Get execution results |
Request body for creating a task:
{
"command": "uptime",
"server_ids": ["server-id-1", "server-id-2"],
"timeout": 60
}Billing Information
Administrators can record billing details for each server to track VPS costs and expiration dates.
Managing Billing Info
- Go to server detail page → click Edit
- Fill in the "Billing" section:
| Field | Description |
|---|---|
price | Price amount |
billing_cycle | Billing cycle (monthly/quarterly/yearly, etc.) |
currency | Currency unit (CNY/USD, etc.) |
expired_at | Expiration date |
traffic_limit | Traffic limit in bytes |
Expiration Alerts
Create an expiration alert rule to receive notifications before a server expires:
- Go to Settings → Alerts
- Create a new rule with metric type expiration
- Set the threshold to the number of days before expiration (e.g., 7 for 7-day advance notice)
- Link a notification group
Traffic Alerts
Use transfer_in_cycle / transfer_out_cycle / transfer_all_cycle alert types to monitor cumulative traffic within the current billing cycle. See Alerts for details.