-
Notifications
You must be signed in to change notification settings - Fork 4
Move all environment variables to dedicated env files #38
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
base: master
Are you sure you want to change the base?
Conversation
- Created 23 new env files in env-files.sample/ directory - Updated both docker-compose.sample.yml and docker-compose.production.yml to use env_file instead of inline environment variables - Organized environment variables by service and deployment type for easier management - Maintains all existing functionality while improving secret management - Prevents mixing configuration between docker-compose and env files Co-authored-by: Johnson Liang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @MrOrz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request refactors how environment variables are managed within the Docker Compose setup. It aims to centralize environment configurations into dedicated files, improving maintainability and preventing scattered variable definitions across multiple docker-compose files. This change maintains all existing functionality while streamlining the configuration process.
Highlights
- Centralized Environment Variables: All inline environment variables from docker-compose files have been moved to dedicated .env files.
- New .env Files Created: 23 new .env files have been created under env-files.sample/, organized by service and environment, to hold specific configurations.
- Docker Compose Configuration Update: Both docker-compose.production.yml and docker-compose.sample.yml now exclusively use the env_file directive, pointing to the new .env files, enhancing modularity.
- Improved Maintainability: This refactoring significantly improves configuration management by consolidating environment variables, making them easier to track, update, and manage across different environments.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request does a great job of centralizing environment variables into dedicated .env files, which significantly improves configuration management and maintainability. However, there is a critical issue in docker-compose.production.yml where services are pointed to sample environment files, which would break a production deployment. Additionally, all newly created environment files are missing a final newline character, which is a common convention and can cause issues with some tools.
docker-compose.production.yml
Outdated
| gcp-project: <GCP project> | ||
| env_file: | ||
| - ./env-files/line-bot-zh | ||
| - ./env-files.sample/line-bot-zh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using env-files.sample for a production configuration is incorrect. The env-files.sample directory contains placeholder values for development and demonstration. For production, you should use a separate directory (e.g., env-files) with the actual secrets, which is typically not checked into version control. This change from ./env-files/line-bot-zh to ./env-files.sample/line-bot-zh will likely break the service. This applies to all other services in this file as well; they should all point to non-sample env files.
- ./env-files/line-bot-zh| GCS_BUCKET_NAME= | ||
| GCS_IMAGE_FOLDER= | ||
| INTERNET_ARCHIVE_S3_ACCESS_KEY= | ||
| INTERNET_ARCHIVE_S3_SECRET_KEY= No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| INTERNET_ARCHIVE_S3_SECRET_KEY= | ||
| LANGFUSE_PUBLIC_KEY= | ||
| LANGFUSE_SECRET_KEY= | ||
| LANGFUSE_BASEURL=https://langfuse.cofacts.tw No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| INTERNET_ARCHIVE_S3_SECRET_KEY= | ||
| LANGFUSE_PUBLIC_KEY= | ||
| LANGFUSE_SECRET_KEY= | ||
| LANGFUSE_BASEURL=https://langfuse.cofacts.tw No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1 @@ | |||
| TUNNEL_TOKEN=CHANGE_ME No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| PUBLIC_API_URL=https://dev-api.cofacts.tw | ||
| PUBLIC_COLLAB_SERVER_URL=wss://dev-collab.cofacts.tw | ||
| PUBLIC_APP_ID=RUMORS_SITE | ||
| PUBLIC_GA_TRACKING_ID= No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| PUBLIC_API_URL=https://dev-api.cofacts.tw | ||
| PUBLIC_COLLAB_SERVER_URL=wss://dev-collab.cofacts.tw | ||
| PUBLIC_APP_ID=RUMORS_SITE | ||
| PUBLIC_GA_TRACKING_ID= No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| WEB_CONCURRENCY=2 | ||
| PUBLIC_LINE_IFTTT_APPLET_URL=https://ifttt.com/applets/VrzvihCR-cofacts-rss-line | ||
| PUBLIC_TELEGRAM_IFTTT_APPLET_URL=https://ifttt.com/applets/WRuZeP36-cofacts-rss-telegram | ||
| PUBLIC_SLACK_IFTTT_APPLET_URL=https://ifttt.com/applets/H4Sm5LDF-cofacts-rss-slack No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1,3 @@ | |||
| YOUTUBE_API_KEY= | |||
| ROLLBAR_TOKEN= | |||
| ROLLBAR_ENV=production No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| YOUTUBE_API_KEY=CHANGE_ME | ||
| ROLLBAR_TOKEN=CHANGE_ME | ||
| ROLLBAR_ENV=production-cofacts | ||
| ENGINE_API_KEY=CHANGE_ME No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@claude In docker-compose files we should point |
|
Claude finished @MrOrz's task —— View job Fixing docker-compose env_file paths ✅I've successfully updated the docker-compose files to point to Todo List:
Changes Madedocker-compose.production.yml & docker-compose.sample.yml:
README.md:
The docker-compose files now correctly expect users to copy the sample env files to an |
…ample - Update all env_file paths in both docker-compose files from ./env-files.sample/ to ./env-files/ - Fix incorrect line-bot-sample reference to line-bot-zh in docker-compose.sample.yml - Enhance README deploy steps with clearer instructions and example commands for copying env files Co-authored-by: Johnson Liang <[email protected]>
Moves all environment variables from inline environment sections to dedicated env files for better configuration management.
This addresses the issue where having environment variables in both docker-compose files and env files made configuration difficult to manage.
Changes
Fixes #37
🤖 Generated with Claude Code