Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 36 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,42 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme

GitHub Readme Stats provides several environment variables that can be used to customize the behavior of your self-hosted instance. These include:

* `CACHE_SECONDS`: Sets the cache duration in seconds for the generated cards. This variable takes precedence over the default cache timings for the public instance. You can also set it to `0` to disable caching completely. If this variable is not set, the default cache duration is 24 hours (86,400 seconds).
* `WHITELIST`: A comma-separated list of GitHub usernames that are allowed to access your instance. If this variable is not set, all usernames are allowed.
* `GIST_WHITELIST`: A comma-separated list of GitHub gist IDs that are allowed to be accessed on your instance. If this variable is not set, all gist IDs are allowed.
* `EXCLUDE_REPO`: A comma-separated list of repositories that will be excluded from stats and top languages cards on your instance. This allows repository exclusion without exposing repository names in public URLs. This enhances privacy for self-hosted instances that include private repositories in stats cards.
* `FETCH_MULTI_PAGE_STARS`: When set to `true`, this enables fetching all starred repositories for accurate star counts, especially for users with more than 100 repositories. This may increase response times and API points usage, so it is disabled on the public instance.
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Supported values</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>CACHE_SECONDS</code></td>
<td>Sets the cache duration in seconds for the generated cards. This variable takes precedence over the default cache timings for the public instance. If this variable is not set, the default cache duration is 24 hours (86,400 seconds).</td>
<td>Any positive integer or <code>0</code> to disable caching</td>
</tr>
<tr>
<td><code>WHITELIST</code></td>
<td>A comma-separated list of GitHub usernames that are allowed to access your instance. If this variable is not set, all usernames are allowed.</td>
<td>Comma-separated GitHub usernames</td>
</tr>
<tr>
<td><code>GIST_WHITELIST</code></td>
<td>A comma-separated list of GitHub Gist IDs that are allowed to be accessed on your instance. If this variable is not set, all Gist IDs are allowed.</td>
<td>Comma-separated GitHub Gist IDs</td>
</tr>
<tr>
<td><code>EXCLUDE_REPO</code></td>
<td>A comma-separated list of repositories that will be excluded from stats and top languages cards on your instance. This allows repository exclusion without exposing repository names in public URLs. This enhances privacy for self-hosted instances that include private repositories in stats cards.</td>
<td>Comma-separated repository names</td>
</tr>
<tr>
<td><code>FETCH_MULTI_PAGE_STARS</code></td>
<td>Enables fetching all starred repositories for accurate star counts, especially for users with more than 100 repositories. This may increase response times and API points usage, so it is disabled on the public instance.</td>
<td><code>true</code> or <code>false</code></td>
</tr>
</tbody>
</table>

See [the Vercel documentation](https://vercel.com/docs/concepts/projects/environment-variables) on adding these environment variables to your Vercel instance.

Expand Down
1 change: 1 addition & 0 deletions src/cards/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const LONG_LOCALES = [
"fr",
"hu",
"id",
"ja",
"ml",
"my",
"nl",
Expand Down
4 changes: 3 additions & 1 deletion src/common/I18n.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

const FALLBACK_LOCALE = "en";

/**
Expand All @@ -9,7 +11,7 @@ class I18n {
*
* @param {Object} options Options.
* @param {string=} options.locale Locale.
* @param {Object} options.translations Translations.
* @param {any} options.translations Translations.
*/
constructor({ locale, translations }) {
this.locale = locale || FALLBACK_LOCALE;
Expand Down
2 changes: 2 additions & 0 deletions src/common/envs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

const whitelist = process.env.WHITELIST
? process.env.WHITELIST.split(",")
: undefined;
Expand Down
2 changes: 2 additions & 0 deletions src/common/http.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

import axios from "axios";

/**
Expand Down
2 changes: 2 additions & 0 deletions src/common/icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.