-
Notifications
You must be signed in to change notification settings - Fork 61k
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
Merge upstream #6263
Merge upstream #6263
Conversation
Someone is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe pull request primarily removes certain UI elements from the auth and settings interfaces by commenting out the corresponding components. In the Changes
Poem
π Recent review detailsConfiguration used: CodeRabbit UI π Files selected for processing (1)
π§ Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 1
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (3)
app/components/auth.tsx
(2 hunks)app/components/settings.tsx
(1 hunks)app/constant.ts
(1 hunks)
β Files skipped from review due to trivial changes (2)
- app/components/settings.tsx
- app/components/auth.tsx
π§° Additional context used
πͺ Gitleaks (8.21.2)
app/constant.ts
819-819: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
820-820: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
app/constant.ts
Outdated
export const SAAS_CHAT_URL = `/#/?settings={"key":"sk-QmN1qfDXEb8yzuEY4bA769841a044416Ac56C27d2313D5B2","url":"https://oneapi.181918.xyz"}`; | ||
export const SAAS_CHAT_UTM_URL = `/#/?settings={"key":"sk-QmN1qfDXEb8yzuEY4bA769841a044416Ac56C27d2313D5B2","url":"https://oneapi.181918.xyz"}`; |
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.
π οΈ Refactor suggestion
Critical: Remove hardcoded API key from source code.
The code exposes a sensitive API key directly in the source code, which poses a significant security risk. Additionally, both URLs are identical, making one of them redundant.
- Move the API key to environment variables:
-export const SAAS_CHAT_URL = `/#/?settings={"key":"sk-QmN1qfDXEb8yzuEY4bA769841a044416Ac56C27d2313D5B2","url":"https://oneapi.181918.xyz"}`;
-export const SAAS_CHAT_UTM_URL = `/#/?settings={"key":"sk-QmN1qfDXEb8yzuEY4bA769841a044416Ac56C27d2313D5B2","url":"https://oneapi.181918.xyz"}`;
+export const SAAS_CHAT_URL = `/#/?settings={"key":"${process.env.NEXT_PUBLIC_API_KEY}","url":"${process.env.NEXT_PUBLIC_API_URL}"}`;
+export const SAAS_CHAT_UTM_URL = `${SAAS_CHAT_URL}?utm=github`;
- Add these environment variables to your
.env
file:
NEXT_PUBLIC_API_KEY=your-api-key
NEXT_PUBLIC_API_URL=https://oneapi.181918.xyz
- Update
.gitignore
to exclude the.env
file:
.env
.env.local
Please:
- Rotate (change) the exposed API key immediately as it's now compromised.
- Consider using a secret management service for production environments.
- Review access logs for any unauthorized usage of the exposed key.
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export const SAAS_CHAT_URL = `/#/?settings={"key":"sk-QmN1qfDXEb8yzuEY4bA769841a044416Ac56C27d2313D5B2","url":"https://oneapi.181918.xyz"}`; | |
export const SAAS_CHAT_UTM_URL = `/#/?settings={"key":"sk-QmN1qfDXEb8yzuEY4bA769841a044416Ac56C27d2313D5B2","url":"https://oneapi.181918.xyz"}`; | |
export const SAAS_CHAT_URL = `/#/?settings={"key":"${process.env.NEXT_PUBLIC_API_KEY}","url":"${process.env.NEXT_PUBLIC_API_URL}"}`; | |
export const SAAS_CHAT_UTM_URL = `${SAAS_CHAT_URL}?utm=github`; |
π§° Tools
πͺ Gitleaks (8.21.2)
819-819: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
820-820: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
π» εζ΄η±»ε | Change Type
π εζ΄θ―΄ζ | Description of Change
π θ‘₯ε δΏ‘ζ― | Additional Information
Summary by CodeRabbit
These changes streamline the interface and ensure enhanced connectivity with the chat service.