c299ed67d6da16139208a2af3d5d55faff09fd1e
QingLong Panel (Go Implementation)
This is a Go implementation of the popular QingLong Panel, a task management system for automated scripts.
Features
- Task scheduling and management
- RESTful API
- User authentication
- Environment variable management
- Script file management
- Task execution and logging
- Web interface
- Docker support
Project Structure
├── main.go # Application entry point
├── go.mod # Go modules definition
├── go.sum # Go modules checksums
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
├── configs/ # Configuration files
├── internal/
│ ├── controllers/ # HTTP handlers
│ ├── models/ # Data structures
│ ├── services/ # Business logic
│ └── utils/ # Utility functions
├── web/
│ ├── static/ # Static assets (CSS, JS, images)
│ └── templates/ # HTML templates
├── data/ # Data storage
├── logs/ # Log files
└── scripts/ # User scripts
Getting Started
Using Go directly
- Install Go (version 1.21 or higher)
- Clone the repository
- Run
go mod tidyto install dependencies - Run
go run main.goto start the server
Using Docker
- Install Docker and Docker Compose
- Run
docker-compose up -dto start the server
The server will start on port 8080.
API Endpoints
Authentication
POST /api/auth/login- User loginPOST /api/auth/register- User registration
Tasks
GET /api/tasks- Get all tasksPOST /api/tasks- Create a new taskGET /api/tasks/:id- Get a specific taskPUT /api/tasks/:id- Update a specific taskDELETE /api/tasks/:id- Delete a specific task
Task Execution
POST /api/execute/task/:id- Execute a task by IDPOST /api/execute/command- Execute a command directlyGET /api/execute/results- Get last execution results
Environment Variables
GET /api/env- Get all environment variablesPOST /api/env- Create a new environment variableGET /api/env/:id- Get a specific environment variablePUT /api/env/:id- Update a specific environment variableDELETE /api/env/:id- Delete a specific environment variable
Scripts
GET /api/scripts- Get all scriptsPOST /api/scripts- Create a new scriptGET /api/scripts/:id- Get a specific scriptPUT /api/scripts/:id- Update a specific scriptDELETE /api/scripts/:id- Delete a specific script
Web Interface
/- Dashboard/login- Login page/tasks- Task management/scripts- Script management/environments- Environment variable management
Default Admin User
Username: admin
Password: admin123
Configuration
The application can be configured using the configs/config.json file:
{
"server": {
"port": 8080,
"host": "0.0.0.0"
},
"database": {
"type": "sqlite",
"path": "./data/ql.db"
},
"security": {
"jwt_secret": "ql_panel_secret_key",
"password_salt": "ql_panel_salt"
},
"task": {
"default_timeout": 3600,
"log_retention_days": 30
}
}
Docker Support
The application includes Docker support for easy deployment:
- Build the Docker image:
docker build -t baihu . - Run the container:
docker run -p 8080:8080 baihu
Or use Docker Compose:
docker-compose up -d
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Description
Languages
Go
62.8%
TypeScript
30.6%
JavaScript
2.1%
Python
1.9%
Shell
0.8%
Other
1.7%