feat: add dotenv support for environment configuration#131
Merged
Sing-Li merged 1 commit intoRocketChat:masterfrom Mar 26, 2026
Merged
feat: add dotenv support for environment configuration#131Sing-Li merged 1 commit intoRocketChat:masterfrom
Sing-Li merged 1 commit intoRocketChat:masterfrom
Conversation
Sing-Li
requested changes
Mar 26, 2026
Member
Sing-Li
left a comment
There was a problem hiding this comment.
Please remove anything that is not related to dotenv support. We don't need it on this PR.
- Add dotenv to load static/secret config from .env file - Move AUTH_TOKEN, ORGANIZATION, ADMIN_PASSWORD, SERVER_PORT, and URL settings from config.json to environment variables - Keep dynamic runtime values (contributors, delay, startDate, includedRepositories) in config.json for admin panel modification - Add .env.example template with all supported variables - Add path overrides (CONFIG_PATH, DATA_PATH, etc.) for flexibility - Update config-example.json to contain only dynamic values - Add .env to .gitignore - Update documentation (README, AGENTS.md, GEMINI.md)
422b03a to
4a26dbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add dotenv support to load static/secret configuration from
.envfiles, as discussed in #128.This is a standalone env support PR — no test code or other refactors are mixed in.
What changed
Static config →
.env(via dotenv)Secrets and environment-specific settings are now loaded from a
.envfile:AUTH_TOKEN— GitHub personal access tokenORGANIZATION— GitHub org nameORGANIZATION_HOMEPAGE— org homepage URLORGANIZATION_GITHUB_URL— org GitHub URLADMIN_PASSWORD— admin panel passwordSERVER_PORT— backend API port (default: 62050)Dynamic config →
config.json(unchanged)Runtime values that the admin panel modifies stay in
config.json:delay,contributors,startDate,includedRepositoriesTest isolation support
CONFIG_PATH,DATA_PATH,LOG_PATH,ADMINDATA_PATH,DATA_BASE_PATH,CONFIG_BACKUP_PATH— tests can point these at fixture filesLEADERBOARD_SKIP_REFRESH=1— disables therefresh.jschild process spawn so tests can start the server without hitting the GitHub APImodule.exports = { server }— allows tests to import the server programmaticallyNew files
src/server/.env.example— template with all supported env varsUpdated files
src/server/app.js— dotenv loading, env vars for static config, path overrides, skip-refresh guard, server exportsrc/server/refresh.js— dotenv loading, env vars for paths and organizationsrc/server/util/API.js— usesprocess.env.AUTH_TOKENdirectly,startDatepassed as parametersrc/server/config-example.json— stripped of static fields (only dynamic values remain)src/server/package.json— addeddotenvdependency.gitignore— added.envAGENTS.md,README.md,GEMINI.md— updated setup instructions and config referenceSetup (after this PR)
Related PRs