vladkens / ghstats

🤩📈 Self-hosted dashboard for tracking GitHub repos traffic history longer than 14 days.
MIT License
113 stars 1 forks source link

Add repos or configuration #1

Open rothgar opened 1 month ago

rothgar commented 1 month ago

I haven't found any docs or examples on how to add repos to watch. I'm still looking for it but opening an issue to add docs/examples later.

vladkens commented 1 month ago

@rothgar Hi. Current version of this program monitors all owned repos, so there is no special configuration.

If you need something special - I can add it.

rothgar commented 1 month ago

Mine isn't loading any repos so maybe my token isn't working

image

I'm part of a few different organizations and have various degrees of permissions to the repos. It would be nice if I could explicitly list the repos I want to track.

rothgar commented 1 month ago

Realized the api updates are failing so my token must not have the proper permissions. I'll try again.

ruanbekker commented 1 month ago

Hey @rothgar , I am getting the same response. Did you manage to resolve it?

rothgar commented 1 month ago

I tried again with a couple different API keys (new and classic) and never got it to load repos. I was going to try again with a key that has more permissions but haven't yet.

ruanbekker commented 1 month ago

Interesting, it seems like that app isn't using the token. I've been running it for about 4 hours, and the app logs:

ghstats-github-stats-6ffd96c86b-qb9v4 github-stats 2024-08-10T18:20:59.584630Z  INFO request: finished processing request latency=0 ms status=200 method=GET uri=/ version=HTTP/1.1

I double checked the environment inside the pod:

env | grep TOKEN
GITHUB_TOKEN=ghp_mv..........

And I noticed that github says the token was not used:

image
vladkens commented 1 month ago

Hi, @rothgar @ruanbekker

How do you run the app? I have tried different ways, even recreated the token according to instructions in the readme file and it succeeds every time for me.

For examplw launch command:

docker run -e GITHUB_TOKEN=ghp_123 -p 8080:8080 -v ./data:/app/data --name ghstats ghcr.io/vladkens/ghstats:latest

Initial logs:

2024-08-11-11T20:11:25.729315Z INFO db_path: ./data/ghstats.db
2024-08-11-11T20:11:25.742995Z INFO update_deltas took 791.261µs
2024-08-11-11T20:12:03.312666Z INFO update_metrics took 37.569416944s
2024-08-11T20:12:03.316439Z INFO update_deltas took 3.759095ms
2024-08-11-11T20:12:03.316605Z INFO Job creator created
2024-08-11T20:12:03.316652Z INFO listening on 0.0.0.0.0:8080

On a fresh database (when no repo is found) app always tries to load initial stats.