mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-04 20:42:59 +00:00
1.6 KiB
1.6 KiB
Admin Login System
This document provides information about the admin login system for the PP Kunovice web application.
Default Admin Credentials
- Username:
admin - Password:
admin123
Important: Change the default password after the first login in a production environment.
Accessing the Admin Panel
- Navigate to
/adminin your web browser - Enter the admin credentials
- After successful login, you'll be redirected to the admin dashboard
API Endpoints
Login
- URL:
/api/login - Method:
POST - Content-Type:
application/json - Request Body:
{ "username": "admin", "password": "admin123" } - Success Response:
- Code: 200 OK
- Content:
{ "token": "jwt.token.here" }
- Error Response:
- Code: 401 Unauthorized
- Content:
{ "error": "Invalid credentials" }
Protected Endpoints
All protected endpoints require a valid JWT token in the Authorization header:
Authorization: Bearer <token>
Environment Variables
JWT_SECRET: Secret key used to sign JWT tokens (default: auto-generated)PORT: Port the server listens on (default: 80)
Security Notes
- Always use HTTPS in production
- Change the default admin password
- Set a strong
JWT_SECRETenvironment variable in production - Consider implementing rate limiting for login attempts
- Keep the server and dependencies up to date
Development
To run the server in development mode:
go run .
The admin interface will be available at http://localhost/admin