-
Notifications
You must be signed in to change notification settings - Fork 0
Codespace automatic broccoli gw7q4r9rwgxfvxwr #1
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: main
Are you sure you want to change the base?
Codespace automatic broccoli gw7q4r9rwgxfvxwr #1
Conversation
Reviewer's Guide by SourceryThis PR implements several infrastructure and configuration changes, including the addition of GitHub Actions workflows for CI/CD, i18n configuration setup, and development environment configurations. It also updates the Vapi public key in the application. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @Nate-Mina - I've reviewed your changes and found some issues that need to be addressed.
Blocking issues:
- Avoid hardcoding API keys in source code (link)
Overall Comments:
- The API key should not be hardcoded in the source code. Please move it to environment variables or a secrets management system to prevent potential security issues.
- The .github/workflows/main.yml file contains unused template content and is redundant with node.js.yml. Consider removing main.yml and keeping only the clean node.js.yml workflow.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🔴 Security: 1 blocking issue
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| // Put your Vapi Public Key below. | ||
| const vapi = new Vapi("0000XXXX-XXXX-XXXX-XXXX-XXXXXXXX0000"); | ||
| const vapi = new Vapi("dfa463f4-e58f-4a60-a31c-3b684bd31f51"); |
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.
🚨 issue (security): Avoid hardcoding API keys in source code
API keys should be loaded from environment variables or a secure configuration system. This key should be rotated immediately as it has been exposed in version control.
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.
how load API keys from environment variables
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.
To load API keys from environment variables in a Node.js application, you can follow these steps:
-
Create a
.envfile: In the root of your project, create a file named.env. This file will store your environment variables. Add your API key to this file like so:VAPI_PUBLIC_KEY=dfa463f4-e58f-4a60-a31c-3b684bd31f51 -
Install the
dotenvpackage: This package will help you load environment variables from the.envfile intoprocess.env. You can install it using npm:npm install dotenv -
Load the environment variables in your application: At the top of your entry file (e.g.,
index.jsorApp.jsx), add the following line to load the environment variables:require('dotenv').config();
-
Access the API key in your code: You can now access the API key using
process.env:const vapi = new Vapi(process.env.VAPI_PUBLIC_KEY);
-
Ensure
.envis in your.gitignore: To prevent the.envfile from being committed to version control, make sure it is listed in your.gitignorefile.
By following these steps, you can securely manage your API keys without hardcoding them in your source code. Let me know if you need further assistance!
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.
🚨 issue (security): Avoid hardcoding API keys in source code
API keys should be loaded from environment variables or a secure configuration system. This key should be rotated immediately as it has been exposed in version control.
HOW do i do that
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.
It looks like you might have missed my previous response, so let me guide you through the process again on how to load API keys from environment variables:
-
Create a
.envfile: In the root directory of your project, create a file named.env. This file will store your environment variables. Add your API key to this file like this:VAPI_PUBLIC_KEY=dfa463f4-e58f-4a60-a31c-3b684bd31f51 -
Install the
dotenvpackage: This package helps load environment variables from the.envfile intoprocess.env. You can install it using npm:npm install dotenv -
Load the environment variables in your application: At the top of your entry file (e.g.,
index.jsorApp.jsx), add the following line to load the environment variables:require('dotenv').config();
-
Access the API key in your code: You can now access the API key using
process.env:const vapi = new Vapi(process.env.VAPI_PUBLIC_KEY);
-
Ensure
.envis in your.gitignore: To prevent the.envfile from being committed to version control, make sure it is listed in your.gitignorefile.
By following these steps, you can securely manage your API keys without hardcoding them in your source code. If you have any more questions or need further clarification, feel free to ask!
Summary by Sourcery
Update Vapi public key, add Node.js CI workflow, and introduce i18n configuration.
New Features:
CI: