Skip to content

Self-hosted web panel for managing Hysteria 2 proxy servers. Features HTTP authentication, auto node setup via SSH, server groups, load balancing, traffic stats, and multi-format subscriptions (Clash, Sing-box, Shadowrocket).

License

Notifications You must be signed in to change notification settings

ClickDevTech/CELERITY-panel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

54 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CΒ³ CELERITY

⚑ Fast. Simple. Long-lasting.

English | Русский

License: MIT Docker Pulls Docker Image Size Node.js Hysteria

CΒ³ CELERITY by Click Connect β€” modern web panel for managing Hysteria 2 proxy servers with centralized HTTP authentication, one-click node setup, and flexible user-to-server group mapping.

⚑ Quick Start

1. Install Docker (if not installed):

curl -fsSL https://get.docker.com | sh

2. Deploy panel (Docker Hub):

mkdir hysteria-panel && cd hysteria-panel

# Download required files
curl -O https://raw.githubusercontent.com/ClickDevTech/hysteria-panel/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/ClickDevTech/hysteria-panel/main/docker.env.example

cp docker.env.example .env
nano .env  # Set your domain, email, and secrets
docker compose up -d

Alternative: Build from source

git clone https://github.com/ClickDevTech/hysteria-panel.git
cd hysteria-panel
cp docker.env.example .env
nano .env  # Set your domain, email, and secrets
docker compose up -d

3. Open https://your-domain/panel

Required .env variables:

PANEL_DOMAIN=panel.example.com
ACME_EMAIL=[email protected]
ENCRYPTION_KEY=your32characterkey  # openssl rand -hex 16
SESSION_SECRET=yoursessionsecret   # openssl rand -hex 32
MONGO_PASSWORD=yourmongopassword   # openssl rand -hex 16

✨ Features

  • πŸ–₯ Web Panel β€” Full UI for managing nodes and users
  • πŸ” HTTP Auth β€” Centralized client verification via API
  • πŸš€ Auto Node Setup β€” Install Hysteria, certs, port hopping in one click
  • πŸ‘₯ Server Groups β€” Flexible user-to-node mapping
  • βš–οΈ Load Balancing β€” Distribute users by server load
  • πŸ“Š Statistics β€” Online users, traffic, server status
  • πŸ“± Subscriptions β€” Auto-format for Clash, Sing-box, Shadowrocket
  • πŸ”„ Backup/Restore β€” Automatic database backups
  • πŸ’» SSH Terminal β€” Direct node access from browser

πŸ— Architecture

                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚     CLIENTS     β”‚
                              β”‚ Clash, Sing-box β”‚
                              β”‚   Shadowrocket  β”‚
                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                          hysteria2://user:pass@host
                                       β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β–Ό                        β–Ό                        β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚   Node          β”‚      β”‚      Node CH    β”‚      β”‚      Node DE    β”‚
     β”‚   Hysteria 2    β”‚      β”‚   Hysteria 2    β”‚      β”‚   Hysteria 2    β”‚
     β”‚   :443 + hop    β”‚      β”‚   :443 + hop    β”‚      β”‚   :443 + hop    β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚                        β”‚                        β”‚
              β”‚    POST /api/auth      β”‚                        β”‚
              β”‚    GET /online         β”‚                        β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β–Ό
                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                          β”‚    HYSTERIA PANEL      β”‚
                          β”‚                        β”‚
                          β”‚  β€’ Web UI (/panel)     β”‚
                          β”‚  β€’ HTTP Auth API       β”‚
                          β”‚  β€’ Subscriptions       β”‚
                          β”‚  β€’ SSH Terminal        β”‚
                          β”‚  β€’ Stats Collector     β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                                      β–Ό
                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                          β”‚       MongoDB          β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

How Authentication Works

  1. Client connects to Hysteria node with userId:password
  2. Node sends POST /api/auth to the panel
  3. Panel checks: user exists, enabled, device/traffic limits
  4. Returns { "ok": true, "id": "userId" } or { "ok": false }

Server Groups

Instead of rigid "plans", use flexible groups:

  • Create group (e.g., "Europe", "Premium")
  • Assign nodes to group
  • Assign users to group
  • User gets only nodes from their groups in subscription

πŸ“– API Reference

Authentication (for nodes)

POST /api/auth

Validates user on node connection.

// Request
{ "addr": "1.2.3.4:12345", "auth": "userId:password" }

// Response (success)
{ "ok": true, "id": "userId" }

// Response (error)
{ "ok": false }

Subscriptions

GET /api/files/:token

Universal subscription endpoint. Auto-detects format by User-Agent.

User-Agent Format
shadowrocket Base64 URI list
clash, stash, surge Clash YAML
hiddify, sing-box Sing-box JSON
Browser HTML page
Other Plain URI list

Query params: ?format=clash, ?format=singbox, ?format=uri

Users

Method Endpoint Description
GET /api/users List users
GET /api/users/:userId Get user
POST /api/users Create user
PUT /api/users/:userId Update user
DELETE /api/users/:userId Delete user
POST /api/users/:userId/enable Enable user
POST /api/users/:userId/disable Disable user

Nodes

Method Endpoint Description
GET /api/nodes List nodes
GET /api/nodes/:id Get node
POST /api/nodes Create node
PUT /api/nodes/:id Update node
DELETE /api/nodes/:id Delete node
GET /api/nodes/:id/config Get node config (YAML)
POST /api/nodes/:id/update-config Push config via SSH

Sync

Method Endpoint Description
POST /api/sync Sync all nodes

πŸ”§ Node Setup

Automatic (Recommended)

  1. Add node in panel (IP, SSH credentials)
  2. Click "βš™οΈ Auto Setup"
  3. Panel will automatically:
    • Install Hysteria 2
    • Configure ACME certificates
    • Set up port hopping
    • Open firewall ports
    • Start service

Manual

# Install Hysteria
bash <(curl -fsSL https://get.hy2.sh/)

# Create config /etc/hysteria/config.yaml
listen: :443

acme:
  domains: [your-domain.com]
  email: [email protected]

auth:
  type: http
  http:
    url: https://panel.example.com/api/auth
    insecure: false

trafficStats:
  listen: :9999
  secret: your_secret

masquerade:
  type: proxy
  proxy:
    url: https://www.google.com
    rewriteHost: true
# Start
systemctl enable --now hysteria-server

# Port hopping
iptables -t nat -A PREROUTING -p udp --dport 20000:50000 -j REDIRECT --to-port 443

πŸ“Š Data Models

User

Field Type Description
userId String Unique ID (e.g., Telegram ID)
subscriptionToken String URL token for subscription
enabled Boolean User active status
groups [ObjectId] Server groups
trafficLimit Number Traffic limit in bytes (0 = unlimited)
maxDevices Number Device limit (0 = group limit, -1 = unlimited)
expireAt Date Expiration date

Node

Field Type Description
name String Display name
ip String IP address
domain String Domain for SNI/ACME
port Number Main port (443)
portRange String Port hopping range
groups [ObjectId] Server groups
maxOnlineUsers Number Max online for load balancing
status String online/offline/error

ServerGroup

Field Type Description
name String Group name
color String UI color (#hex)
maxDevices Number Device limit for group

βš–οΈ Load Balancing

Configure in Settings:

  • Enable balancing β€” Sort nodes by current load
  • Hide overloaded β€” Exclude nodes at capacity

Algorithm:

  1. Get user's nodes from groups
  2. Sort by load % (online/max)
  3. Filter overloaded if enabled
  4. Fall back to rankingCoefficient

πŸ”’ Device Limits

Limit simultaneous connections per user.

Priority:

  1. User's personal limit (maxDevices > 0)
  2. Minimum limit from user's groups
  3. -1 = unlimited

On each POST /api/auth:

  1. Query /online from all nodes
  2. Count sessions for userId
  3. Reject if >= maxDevices

πŸ’Ύ Backups

  • Auto backups β€” Configure in Settings
  • Manual backup β€” Dashboard button, auto-downloads
  • Restore β€” Upload .tar.gz archive

🐳 Docker Compose

version: '3.8'

services:
  mongo:
    image: mongo:7
    restart: always
    volumes:
      - mongo_data:/data/db
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-hysteria}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}

  backend:
    image: clickdevtech/hysteria-panel:latest  # or build: . for development
    restart: always
    depends_on:
      - mongo
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./logs:/app/logs
      - ./greenlock.d:/app/greenlock.d
      - ./backups:/app/backups
    env_file:
      - .env

volumes:
  mongo_data:

πŸ“ Environment Variables

Variable Required Description
PANEL_DOMAIN βœ… Panel domain
ACME_EMAIL βœ… Let's Encrypt email
ENCRYPTION_KEY βœ… SSH encryption key (32 chars)
SESSION_SECRET βœ… Session secret
MONGO_PASSWORD βœ… MongoDB password
MONGO_USER ❌ MongoDB user (default: hysteria)
PANEL_IP_WHITELIST ❌ IP whitelist for panel
SYNC_INTERVAL ❌ Sync interval in minutes (default: 2)

🀝 Contributing

Pull requests welcome!


πŸ“„ License

MIT

About

Self-hosted web panel for managing Hysteria 2 proxy servers. Features HTTP authentication, auto node setup via SSH, server groups, load balancing, traffic stats, and multi-format subscriptions (Clash, Sing-box, Shadowrocket).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •