This commit is contained in:
2026-03-23 00:14:44 +01:00
parent 355274b918
commit a4d01e3700
11 changed files with 180 additions and 135 deletions
+41 -86
View File
@@ -1,98 +1,53 @@
# nCore Profile Tracker
# nCore Stats
A simple Go project to scrape and track profile statistics (rank, upload, download, points) on nCore, the largest Hungarian BitTorrent tracker. The stats are stored in a SQLite database and displayed on a basic web interface.
A tracker for nCore profile statistics.
![image](https://github.com/user-attachments/assets/1496548c-0bb4-4f50-aecd-ead79759ceb0)
![nCore Stats Dashboard](https://github.com/user-attachments/assets/1496548c-0bb4-4f50-aecd-ead79759ceb0)
## Features
## Quick Start
- Scrapes and logs profile stats from nCore for multiple users.
- Serves a simple HTML dashboard to display the latest data and historical charts.
- Provides a JSON API to fetch historical profile data.
- Stores all data persistently in a SQLite database.
- Automatically updates data every 24 hours.
1. Create a `.env` file with your credentials:
## Setup
```ini
NICK=your_nick
PASS=your_password
```
1. **Clone the repo:**
2. Save this `compose.yaml`:
```bash
git clone https://github.com/skidoodle/ncore-stats
cd ncore-stats
```
```yaml
services:
ncore-stats:
image: ghcr.io/skidoodle/ncore-stats:latest
container_name: ncore-stats
restart: unless-stopped
user: "1000:1000"
ports:
- "3000:3000"
volumes:
- data:/app/data
configs:
- source: users_config
target: /app/users.txt
environment:
- NICK=${NICK}
- PASS=${PASS}
2. **Create a `.env` file with your nCore credentials:**
configs:
users_config:
content: |
alice:123
bob:456
```ini
NICK=your_nick
PASS=your_password
```
volumes:
data:
```
3. **Add Users to Track**
3. Run `docker compose up -d`.
You can add users via the `--add-user` command-line flag. Run this command for each user you want to track.
### How to get NICK and PASS
The format is a single string: `'DisplayName,ProfileID'`.
```bash
# Example for running from source
go run . --add-user 'Alice,69'
go run . --add-user 'Bob,420'
```
> **How to find a Profile ID?**
> Navigate to a user's profile on nCore. The URL will be `https://ncore.pro/profile.php?id=12345`. The `ProfileID` is the number at the end.
### How to obtain `NICK` and `PASS`
- Open the developer tools in your browser (F12), go to the "Network" tab.
- Log in to nCore using "lower security" mode.
- Find the `login.php` request in the network activity.
- In the response headers, locate the `Set-Cookie` header, which will contain `nick=` and `pass=` values.
- Copy those values and add them to your `.env` file.
## Running with Docker Compose
1. **Create the following `docker-compose.yml` file:**
```yaml
services:
ncore-stats:
image: ghcr.io/skidoodle/ncore-stats:latest
container_name: ncore-stats
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./data:/app/data
environment:
- NICK=${NICK}
- PASS=${PASS}
```
2. **Add Users using Docker**
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'
```
3. **Run the Docker Compose setup:**
Once you have added your users, start the service.
```bash
docker compose up -d
```
4. Open `http://localhost:3000` to view your stats.
### Updating
To pull the latest image and restart the service:
```bash
docker compose pull
docker compose up -d
```
1. Log in to nCore in your browser using **"lower security"** mode.
2. Open Developer Tools (F12) and go to the **Network** tab.
3. Refresh, find any request to `ncore.pro`.
4. Check the **Cookie** request header for `nick=...; pass=...`.