radius-manager
A modern RADIUS user management system with complete user management features for FreeRADIUS.
1.3K
A modern RADIUS user management system built with CloudWeGo Hertz and Vue 3. Provides complete user authentication, authorization, and management features for FreeRADIUS with a responsive web interface.
The codes are all written by Claude code.
git clone https://github.com/Gaojianli/radius-manager.git
cd radius-manager
make docker-run
Default admin account:
adminadmin123make install
cp .env.example .env
# Edit .env file to set database connection information
docker-compose up -d mysql
# Build frontend
make build-frontend
# Run complete application
make run
# Or start frontend and backend separately for development
make dev-frontend # Start frontend dev server (port 3000)
make dev-backend # Start backend dev server (port 8080)
POST /api/v1/auth/login
Content-Type: application/json
{
"username": "admin",
"password": "admin123"
}
Response:
{
"code": 200,
"expire": "2024-01-02T15:04:05Z",
"token": "eyJhbGciOiJIUzI1NiIs..."
}
POST /api/v1/auth/refresh
Authorization: Bearer <token>
GET /api/v1/user/profile
Authorization: Bearer <token>
PUT /api/v1/user/change-password
Authorization: Bearer <token>
Content-Type: application/json
{
"old_password": "oldpass123",
"new_password": "newpass123"
}
POST /api/v1/admin/users
Authorization: Bearer <admin-token>
Content-Type: application/json
{
"username": "newuser",
"email": "[email protected]",
"password": "password123",
"is_admin": false
}
GET /api/v1/admin/users?page=1&limit=20
Authorization: Bearer <admin-token>
PUT /api/v1/admin/users/{user_id}/ban
Authorization: Bearer <admin-token>
DELETE /api/v1/admin/users/{user_id}
Authorization: Bearer <admin-token>
FreeRADIUS integration uses the standard Authorize β Authenticate two-phase verification process:
Used to check if a user is authorized to authenticate, without password verification.
POST /api/v1/radius/authorize
Content-Type: application/json
{
"username": "testuser"
}
Response:
{
"result": "accept",
"username": "testuser",
"message": "User authorized to authenticate",
"attrs": {
"Auth-Type": "REST",
"User-ID": "testuser",
"User-Role": "user"
}
}
Used to verify user credentials (username and password).
POST /api/v1/radius/auth
Content-Type: application/json
{
"username": "testuser",
"password": "password123"
}
Response:
{
"result": "accept",
"username": "testuser",
"message": "Authentication successful",
"attrs": {
"User-ID": "testuser",
"User-Role": "user",
"Session-Type": "authenticated"
}
}
FreeRADIUS uses a two-phase verification mode to ensure security and performance:
Authorize Phase
Authenticate Phase
| Variable | Default | Description |
|---|---|---|
| DB_HOST | localhost | MySQL host address |
| DB_PORT | 3306 | MySQL port |
| DB_USER | root | MySQL username |
| DB_PASSWORD | - | MySQL password |
| DB_NAME | radius_mgnt | Database name |
| JWT_SECRET | your-secret-key | JWT signing key |
| SERVER_PORT | :8080 | Server port |
radius-manager/
βββ web/ # Vue3 frontend project
β βββ src/
β β βββ components/ # Reusable components
β β βββ views/ # Page components
β β βββ layouts/ # Layout components
β β βββ stores/ # Pinia state management
β β βββ services/ # API services
β β βββ router/ # Router configuration
β βββ package.json
β βββ vite.config.ts
βββ static/ # Static file server
β βββ dist/ # Frontend build output
β βββ static.go # Go embed static files
βββ config/ # Configuration files
βββ controllers/ # Controllers
βββ dao/ # Data access layer
βββ database/ # Database connection
βββ middleware/ # Middlewares
βββ models/ # Data models
βββ routes/ # Route configuration
βββ scripts/ # Build scripts
βββ docker-compose.yml # Docker orchestration
βββ Dockerfile # Container build
βββ Makefile # Build commands
βββ README.md # Project documentation
make help # Show all available commands
make install # Install frontend and backend dependencies
make build # Build entire project
make build-frontend # Build frontend only
make build-backend # Build backend only
make run # Build and run project
make dev-frontend # Start frontend dev server
make dev-backend # Start backend dev server
make clean # Clean build files
make docker-build # Build Docker image
make docker-run # Start with Docker Compose
make test # Run tests
make format # Format code
make lint # Code linting
make build-frontendstatic/dist/ directory has files.env filesudo freeradius -XWe welcome contributions of all kinds! Whether it's bug reports, feature requests, documentation improvements, or code contributions.
git clone https://github.com/YOUR_USERNAME/radius-manager.gitgit checkout -b feature/amazing-feature# Install dependencies
make install
# Start development environment
make dev-frontend # Frontend dev server
make dev-backend # Backend dev server
make format # Format code
make lint # Code linting
make test # Run tests
git add .
git commit -m "β¨ Add amazing feature: feature description"
git push origin feature/amazing-feature
gofmt and golint standardsThanks to all developers who contributed to this project!
This project is licensed under the MIT Licenseβ .
MIT License
Copyright (c) 2024 RADIUS Manager Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
β If this project helps you, please give us a Star!
Happy Coding! π
Content type
Image
Digest
sha256:3aea8d47dβ¦
Size
10.7 MB
Last updated
9 months ago
docker pull gaojianli2333/radius-manager