server

command module
v0.0.0-...-f0a2dc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

README ΒΆ

PPanel Server

License Go Version Go Report Card Docker CI/CD

PPanel is a pure, professional, and perfect open-source proxy panel tool, designed for learning and practical use.

English | δΈ­ζ–‡ | Report Bug | Request Feature

πŸ“‹ Overview

PPanel Server is the backend component of the PPanel project, providing robust APIs and core functionality for managing proxy services. Built with Go, it emphasizes performance, security, and scalability.

Key Features
  • Multi-Protocol Support: Supports Shadowsocks, V2Ray, Trojan, and more.
  • Privacy First: No user logs are collected, ensuring privacy and security.
  • Minimalist Design: Simple yet powerful, with complete business logic.
  • User Management: Full authentication and authorization system.
  • Subscription System: Manage user subscriptions and service provisioning.
  • Payment Integration: Supports multiple payment gateways.
  • Order Management: Track and process user orders.
  • Ticket System: Built-in customer support and issue tracking.
  • Node Management: Monitor and control server nodes.
  • API Framework: Comprehensive RESTful APIs for frontend integration.

πŸš€ Quick Start

Prerequisites
  • Go: 1.21 or higher
  • Docker: Optional, for containerized deployment
  • Git: For cloning the repository
Installation from Source
  1. Clone the repository:

    git clone https://github.com/Js41313/ppanel-server.git
    cd ppanel-server
    
  2. Install dependencies:

    go mod download
    
  3. Generate code:

    chmod +x script/generate.sh
    ./script/generate.sh
    
  4. Build the project:

    make linux-amd64
    
  5. Run the server:

    ./ppanel-server-linux-amd64 run --config etc/ppanel.yaml
    
🐳 Docker Deployment
  1. Build the Docker image:

    docker buildx build --platform linux/amd64 -t ppanel-server:latest .
    
  2. Run the container:

    docker run --rm -p 8080:8080 -v $(pwd)/etc:/app/etc ppanel-server:latest
    
  3. Use Docker Compose (create docker-compose.yml):

    version: '3.8'
    services:
      ppanel-server:
        image: ppanel-server:latest
        ports:
          - "8080:8080"
        volumes:
          - ./etc:/app/etc
        environment:
          - TZ=Asia/Shanghai
    

    Run:

    docker-compose up -d
    
  4. Pull from Docker Hub (after CI/CD publishes):

    docker pull yourusername/ppanel-server:latest
    docker run --rm -p 8080:8080 yourusername/ppanel-server:latest
    

πŸ“– API Documentation

Explore the full API documentation:

The documentation covers all endpoints, request/response formats, and authentication details.

Project Description Link
PPanel Web Frontend for PPanel GitHub
PPanel User Web User interface for PPanel Preview
PPanel Admin Web Admin interface for PPanel Preview

🌐 Official Website

Visit ppanel.dev for more details.

πŸ› Architecture

Architecture Diagram

πŸ“ Directory Structure

.
β”œβ”€β”€ apis/             # API definition files
β”œβ”€β”€ cmd/              # Application entry point
β”œβ”€β”€ doc/              # Documentation
β”œβ”€β”€ etc/              # Configuration files (e.g., ppanel.yaml)
β”œβ”€β”€ generate/         # Code generation tools
β”œβ”€β”€ initialize/       # System initialization
β”œβ”€β”€ internal/         # Internal modules
β”‚   β”œβ”€β”€ config/       # Configuration parsing
β”‚   β”œβ”€β”€ handler/      # HTTP handlers
β”‚   β”œβ”€β”€ middleware/   # HTTP middleware
β”‚   β”œβ”€β”€ logic/        # Business logic
β”‚   β”œβ”€β”€ model/        # Data models
β”‚   β”œβ”€β”€ svc/          # Service layer
β”‚   └── types/        # Type definitions
β”œβ”€β”€ pkg/              # Utility code
β”œβ”€β”€ queue/            # Queue services
β”œβ”€β”€ scheduler/        # Scheduled tasks
β”œβ”€β”€ script/           # Build scripts
β”œβ”€β”€ go.mod            # Go module definition
β”œβ”€β”€ Makefile          # Build automation
└── Dockerfile        # Docker configuration

πŸ’» Development

Format API Files
goctl api format --dir apis/user.api
Add a New API
  1. Create a new API file in apis/.
  2. Import it in apis/ppanel.api.
  3. Regenerate code:
    ./script/generate.sh
    
Build for Multiple Platforms

Use the Makefile to build for various platforms (e.g., Linux, Windows, macOS):

make all  # Builds linux-amd64, darwin-amd64, windows-amd64
make linux-arm64  # Build for specific platform

Supported platforms include:

  • Linux: 386, amd64, arm64, armv5-v7, mips, riscv64, loong64, etc.
  • Windows: 386, amd64, arm64, armv7
  • macOS: amd64, arm64
  • FreeBSD: amd64, arm64

🀝 Contributing

Contributions are welcome! Please follow the Contribution Guidelines for bug fixes, features, or documentation improvements.

✨ Special Thanks

A huge thank you to the following outstanding open-source projects that have provided invaluable support for this project's development! πŸš€

Project Description Project Description
Gin
Gin
Gin Stars
High-performance Go Web framework
Gorm
Gorm
Gorm Stars
Powerful Go ORM framework
Asynq
Asynq
Asynq Stars
Asynchronous task queue for Go
Go-Swagger
Go-Swagger
Go-Swagger Stars
Comprehensive Go Swagger toolkit
Go-Zero
Go-Zero
Go-Zero Stars
Go microservices framework (this project's API generator is built on Go-Zero)

πŸŽ‰ Salute to Open Source: Thank you to the open-source community for making development simpler and more efficient! Please give these projects a ⭐ to support the open-source movement!

πŸ“„ License

This project is licensed under the GPL-3.0 License.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
svc
pkg
aes
deduction
Package deduction provides functionality for calculating remaining amounts in subscription billing systems, supporting various time units and traffic-based calculations.
Package deduction provides functionality for calculating remaining amounts in subscription billing systems, supporting various time units and traffic-based calculations.
fs
ip
jwt
md5
orm
sms
logic/order
Package orderLogic provides order processing logic for handling various types of orders including subscription purchases, renewals, traffic resets, and balance recharges.
Package orderLogic provides order processing logic for handling various types of orders including subscription purchases, renewals, traffic resets, and balance recharges.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL