Closed
Add environment variable support to config.py with fallback defaults#2
Conversation
Copilot
AI
changed the title
[WIP] Refactor config.py to use environment variables with default fallbacks
Add environment variable support to config.py with fallback defaults
Jul 3, 2025
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
This PR converts hardcoded configuration values in
config.pyto environment variable-based configuration while maintaining full backward compatibility. Users can now override configuration values using environment variables for secure production deployments.Changes Made
config.pyto useos.environ.get()for all configuration valuesEnvironment Variables Added
FRONTEND_HOSThttp://localhost:3000DATABASE_URLpostgresql+psycopg://user:password@localhost:5432/binxENDPOINTb456c973fcfed7f5383ebbef9b82b425.r2.cloudflarestorage.comACCESS_KEYf962a8292930c0620a7a8166fe62f6cfSECRET_KEYcd2c90643a4f69992e4172eab295a707ea2e4d9c9b30a8283f32dea28faa4dbeBUCKET_NAMEbinxJWT_SECRET_KEYyour-secret-keyUsage Examples
Development (no changes needed)
# Uses built-in defaults - existing workflow unchanged uvicorn app:app --reloadProduction deployment
Docker deployment
Benefits
Testing
This change enables secure production deployments while maintaining the simplicity of the current development workflow.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.