mirror of
https://github.com/skidoodle/ncore-stats.git
synced 2026-04-27 23:37:36 +02:00
Refactor application structure and enhance logging
- Introduced a Configuration struct to manage application settings. - Created a State struct to encapsulate application state and dependencies. - Replaced log package with logrus for improved logging capabilities. - Implemented graceful shutdown handling for the HTTP server. - Added context management for background tasks. - Updated database initialization to ensure tables are created. - Refactored user management functions to use the new State struct. - Enhanced error handling and logging throughout the application. - Updated README to reflect changes in user addition process.
This commit is contained in:
@@ -70,15 +70,7 @@ A simple Go project to scrape and track profile statistics (rank, upload, downlo
|
||||
|
||||
2. **Add Users using Docker**
|
||||
|
||||
Before starting the service, or to add new users later, run the `--add-user` command inside a temporary container. This ensures the user is added to the database in your persistent volume.
|
||||
|
||||
```bash
|
||||
# Use 'docker compose run' to add users before starting
|
||||
docker compose run --rm ncore-stats --add-user 'Alice,69'
|
||||
docker compose run --rm ncore-stats --add-user 'Bob,420'
|
||||
```
|
||||
|
||||
If the container is already running, you can use `docker exec`:
|
||||
When the container is already running, you can use `docker exec`:
|
||||
```bash
|
||||
# The executable inside the container is named 'ncore-stats'
|
||||
docker exec ncore-stats ./ncore-stats --add-user 'Charlie,1337'
|
||||
|
||||
Reference in New Issue
Block a user