vladkens / ghstats

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

Filter by owner #5

Closed modem7 closed 1 month ago

modem7 commented 1 month ago

Heya,

Would it be possible to have an env var so we can limit which owners we could watch?

e.g. REPO_OWNER=modem7,vladkens

That way it'd only show the owners that we want (especially useful for owners who have a lot of public repos).

I guess this request is similar to #1 .

vladkens commented 1 month ago

Hi, @modem7.

Can you elaborate on how exactly you want to filter? Eg:

1) Remove statistics collection for certain repositories 2) Remove some repositories from the public list (but keep data collection) 3) Collect / show only certain repositories (include) 4) Remove only certain repositories (exclude) 5) Something else?

Right now ghstats is done as a private service, so we need to think about how to set this up properly.

I also have repositories that I don't care about / belong to organizations. I've done for now just collecting data so not to lose it.

modem7 commented 1 month ago

@vladkens Heya,

My thinking is 3 (but I suspect that the logical progression of that would be owner and/or repo option. E.g. every public repo by modem7 and/or include xyz repo by another owner).

My thought process is as follows:

I've got co-maintainer on a lot of other repos bar mine, and I'm not overly interested in long term stats for them, nor for others to see those in my own private ghstats.

vladkens commented 1 month ago

Released in v0.3.0

modem7 commented 1 month ago

Heya,

Thanks for this!

I'm trying to implement, but doesn't seem to be playing ball.

  ghstats:
    image: ghcr.io/vladkens/ghstats:latest
    # image: ghstats:test
    container_name: GHStats
    environment:
      - GITHUB_TOKEN=$GHSTATS_GITHUB_TOKEN
      - GHS_FILTER=modem7/*

image

modem7 commented 1 month ago

Also tried:

  ghstats:
    image: ghcr.io/vladkens/ghstats:latest
    # image: ghstats:test
    container_name: GHStats
    environment:
      - GITHUB_TOKEN=$GHSTATS_GITHUB_TOKEN
      - GHS_FILTER=modem7/*,!borgmatic-collective/*,!petersem/*,!willfarrell/*

But still getting: image

vladkens commented 1 month ago

@modem7 fixed in v0.3.1.

modem7 commented 1 month ago

@modem7 fixed in v0.3.1.

Works great, thank you!