Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: whitelist #3939

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

kyleaupton
Copy link

This PR adds a whitelist concept so the api will only render things you want it to.

Motivation

I am self-hosting an instance of this project on a VPS that doesn't have much resources. And because of that I would like to ensure that only cards for my username are rendered. Also, I am using my own PAT and would like to limit the number of times it's used against GitHub's api.

This PR adds two new env vars: WHITELIST and GIST_WHITELIST that are comma-separated lists. If someone hits a username based endpoint (/, /pin, /top-langs, and /wakatime), and process.env.WHITELIST has a populated value, then the whitelist will be enforced. Same thing with /gist except the whitelist is gist IDs.

P.S.- I noticed that /wakatime doesn't enforce the blacklist. Not sure if this is intended or not, just wanted to bring it up.

Copy link

vercel bot commented Sep 20, 2024

@kyleaupton is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added stats-card Feature, Enhancement, Fixes related to stats the stats card. repo-card Issues related to the pin/repo card. lang-card Issues related to the language card. wakatime-card Issues related to the wakatime card. gist-card labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gist-card lang-card Issues related to the language card. repo-card Issues related to the pin/repo card. stats-card Feature, Enhancement, Fixes related to stats the stats card. wakatime-card Issues related to the wakatime card.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant