Skip to content

Admin Service Overview

RTC Agent Admin is an independent management backend service for the RTC Agent platform, providing core management features including admin authentication, user management, system configuration, and observability monitoring.

The Admin service is a separate process from the main RTC Agent Server. They share the database but use different JWT keys and authentication systems:

┌───────────────── ┌─────────────────┐
│ Admin Server │ │ RTC Server │
│ (Port 8081) │ │ (Port 8888) │
│ │ │ │
│ • Admin Auth │ │ • User Auth │
│ • Permissions │ │ • Session Mgmt │
│ • User Mgmt │◄───────►│ • Messaging │
│ • Config │ Shared │ • Script Exec │
│ • Monitoring │ DB │ │
└────────┬────────┘ └─────────────────┘
│
▼
┌────────────┐
│ Admin UI │
│ (SPA) │
└────────────┘

Key Differences:

FeatureAdmin ServerRTC Server
Port80818888
Auth MethodEmail OTPOAuth2 / JWT
JWT KeysIndependent RSA/ECDSA key pairShared JWT Secret
PurposePlatform ManagementUser Service
终端窗口
# Start Admin service
rtc-agent admin serve
# Specify config file
rtc-agent admin serve --config /path/to/admin.yaml
admin-server:
build:
context: .
dockerfile: Dockerfile
command: ["./rtc-agent", "admin", "serve"]
ports:
- "28081:8081"
volumes:
- ./etc/admin.docker.yaml:/app/etc/admin.yaml:ro
- full-admin-server-keys:/app/etc/keys
depends_on:
- migrate
- postgres
- redis

The Admin service uses an independent configuration file etc/admin.yaml:

server:
host: "0.0.0.0"
port: 8081
env: "production" # or "development"
database:
dsn: "postgres://user:pass@localhost:5432/rtc_agent?sslmode=disable"
redis:
addr: "localhost:6379"
password: ""
db: 0
jwt:
algorithm: "RS256"
issuer: "http://localhost:8081"
audience: "http://localhost:8888"
private_key_path: "etc/keys/admin-private.pem"
public_key_path: "etc/keys/admin-public.pem"
access_token_ttl: 3600 # 1 hour
refresh_token_ttl: 604800 # 7 days
security:
rate_limit_per_minute: 100
login_max_attempts: 5
login_lock_duration: 900
cookie_secure: true
email:
smtp_host: "smtp.example.com"
smtp_port: 587
smtp_user: ""
smtp_password: ""
from_address: "admin@example.com"
from_name: "RTC Agent"
otp:
ttl: 300
length: 6
send_cooldown: 60
max_send_per_ip: 5
max_verify_attempts: 5
lock_duration: 900
features:
permission_system: true
password_enabled: false
# Observability service URLs
prometheus_url: "http://localhost:9090"
grafana_url: "http://localhost:3000"
jaeger_url: "http://localhost:16686"
pyroscope_url: "http://localhost:4040"
  • Email OTP login (verification code)
  • JWT Token mechanism (Access Token + Refresh Token)
  • Login protection (Rate Limiting, Account Lockout)
  • Cookie security configuration
  • Casbin RBAC permission system
  • Role management
  • User role assignment
  • Policy synchronization (multi-instance deployment)
  • Admin management (CRUD)
  • RTC user management
  • User details (sessions, messages, devices)
  • User banning
  • Dynamic configuration system
  • Per-user configuration overrides
  • Configuration change audit
  • Optimistic locking mechanism
  • Grafana dashboards (iframe embedding)
  • Prometheus metrics proxy
  • Jaeger distributed tracing
  • Pyroscope profiling
  • Operation audit records
  • Change history tracking

The Admin UI is embedded as a SPA (Single Page Application) static file in the Admin Server. After startup, access via browser:

http://localhost:28081

RTC Agent Admin Interface

The Admin service provides a health check endpoint:

终端窗口
GET /ready
# Normal response
{ "status": "ready" }
# Degraded mode (bootstrap failed)
{ "status": "degraded", "error": "bootstrap failed — default roles may be missing" }