Skip to content

github token pool from community #5

Closed

Description

@pi0

Currently, deployment uses one personal token of mine. Using a token pool from the community, we shall load balance requests.

Using limited GitHub tokens, they will be only and only possible to be used for public repo queries.

Some concerns:

  • How we can fairly load the balance
  • How to collect and store them (email?)
  • How to validate them regularly for expiration

Activity

  1. pinned this issue on Nov 10, 2022
  2. SukkaW commented on Sep 1, 2024

    @SukkaW
    Member

    Here is some thoughts:

    • We need to implement an in-memory token pool that does load-balance.
      • The pool should record the quota left from the request header
      • We need to use a response middleware for that
      • The response middleware should also read the status code, when 429 is seen, set the token quota to 0

    Also, per GitHub's ToS:

    One person or legal entity may maintain no more than one free Account (if you choose to control a machine account as well, that's fine, but it can only be used for running a machine).

    I have my personal bot account @SukkaBot and I can share a PAT of that account.

  3. pi0 commented on Sep 2, 2024

    @pi0
    MemberAuthor

    Thanks for the inputs dear @SukkaW and willing to donate PAT (i think we can use fine-ganed ones nowadays btw).

    Running this server for ~2 years now we barely hit the limit of API usage with the current caching strategy so it is not a high priority.

    What i like to start btw would be to have a (cached) healthcheck endpoint that tells if the token is currently rate limited or not. We can also potentially write rate limit errors to a new KV namespace so we first gain better insights.

  4. ota-meshi commented on May 25, 2025

    @ota-meshi

    It's just sharing, the mechanism used by shields.io may be of help.
    https://shields.io/blog/token-pool
    But, I don't know the specific internal mechanisms...

  5. SukkaW commented on May 25, 2025

    @SukkaW
    Member

    It's just sharing, the mechanism used by shields.io may be of help. https://shields.io/blog/token-pool But, I don't know the specific internal mechanisms...

    It is basically a GitHub OAuth App (you don't need a full GitHub App to get the token). Under the hood, the backend will generate gho_ prefixed tokens for registered users. Those gho_ tokens can be used to request the GitHub API, and in fact, it is a common practice for those "GitHub Stats" websites/apps to circumvent the rate limit.

  6. pi0 commented on Mar 18, 2026

    @pi0
    MemberAuthor

    We found a way to use gh app tokens!

    Only need donating installations, install app => gives 5k/hour more capacity to ungh!

    https://github.com/apps/ungh-app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions