Skip to content
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

Closed
wants to merge 36 commits into from
Closed

Merge upstream #6263

wants to merge 36 commits into from

Conversation

iam2r
Copy link

@iam2r iam2r commented Feb 19, 2025

πŸ’» ε˜ζ›΄η±»εž‹ | Change Type

  • feat
  • fix
  • refactor
  • perf
  • style
  • test
  • docs
  • ci
  • chore
  • build

πŸ”€ ε˜ζ›΄θ―΄ζ˜Ž | Description of Change

πŸ“ θ‘₯充俑息 | Additional Information

Summary by CodeRabbit

  • UI Changes
    • Removed the promotional banner and tip button from the authentication screen.
    • Removed the SaaS start option from the settings view.
  • Configuration Updates
    • Updated chat service links to a new settings format for improved integration.

These changes streamline the interface and ensure enhanced connectivity with the chat service.

xxx and others added 30 commits November 10, 2024 11:50
Copy link

vercel bot commented Feb 19, 2025

Someone is attempting to deploy a commit to the NextChat Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Feb 19, 2025

Walkthrough

The pull request primarily removes certain UI elements from the auth and settings interfaces by commenting out the corresponding components. In the AuthPage, the <TopBanner> and an IconButton for SaaS tips are commented out, and in the Settings component, the saasStartComponent is similarly disabled. Additionally, the chat service URL constants in the constants file have been updated from static URLs to strings that include a JSON settings object. No new logic or public API changes were introduced.

Changes

File(s) Change Summary
app/components/auth.tsx
app/components/settings.tsx
Commented out UI components: in auth.tsx, the <TopBanner> and IconButton for SaaS tips are disabled; in settings.tsx, the saasStartComponent is commented out.
app/constant.ts Updated SAAS_CHAT_URL and SAAS_CHAT_UTM_URL constants to include a JSON settings object in the URL query string instead of static URLs.

Poem

Oh, I'm a rabbit in the codeyard so bright,
Hopping through changes in the gentle moonlight.
Old banners and buttons now softly asleep,
New JSON URLs make my heart leap!
With a carrot of code and paws so fleet,
I cheer these updates β€” oh, what a treat!
πŸ₯•πŸ‡ Happy coding, onward we beat!


πŸ“œ Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 8809563 and 6c9dfc7.

πŸ“’ Files selected for processing (1)
  • app/constant.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/constant.ts

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?

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between b966107 and 8809563.

πŸ“’ 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
Comment on lines 819 to 820
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"}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

⚠️ Potential issue

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.

  1. 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`;
  1. Add these environment variables to your .env file:
NEXT_PUBLIC_API_KEY=your-api-key
NEXT_PUBLIC_API_URL=https://oneapi.181918.xyz
  1. Update .gitignore to exclude the .env file:
.env
.env.local

Please:

  1. Rotate (change) the exposed API key immediately as it's now compromised.
  2. Consider using a secret management service for production environments.
  3. 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.

Suggested change
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)

@iam2r iam2r closed this Feb 19, 2025
@iam2r iam2r deleted the merge-upstream branch February 19, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants