ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
72.55k stars 57.62k forks source link

[Bug] Docker部署时API Key和BaseURL预设绕过登陆验证 #4825

Closed samni728 closed 3 weeks ago

samni728 commented 3 weeks ago

Bug Description

在使用Docker部署ChatGPT-Next-Web项目时,我遇到了一个bug。当我配置了code时,用户在打开项目时会被提示要求输入登录密码,用户输入密码后才能导入相应的baseurl和apikey以实现WebChat的功能。 WechatIMG176 WechatIMG177

Steps to Reproduce

  1. 使用Docker部署ChatGPT-Next-Web项目。
    1. 配置code,使得用户在访问项目时需要登录。
    2. 用户尝试使用预设URL访问项目,例如:https://xxx.xxx.com/#/?settings={“key”:“DFxxxxARaa0cKZpO39Xmgk8xxx”,“url”:“https://xxx.xxx.xxx”}
    3. 用户通过上述URL直接进行对话,绕过了登录验证。

Expected Behavior

用户在任何情况下都需要先通过登录验证,然后才能使用apikey和baseurl进行对话。

Screenshots

No response

Deployment Method

Desktop OS

macOS Sonoma 14.3.1

Desktop Browser

chrome

Desktop Browser Version

Version 14.1

Smartphone Device

N/A

Smartphone OS

N/A

Smartphone Browser

N/A

Smartphone Browser Version

N/A

Additional Logs

N/A

Issues-translate-bot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] API Key and BaseURL are preset to bypass login verification during Docker deployment

Kosette commented 3 weeks ago

code只针对自带的gpt服务,不禁止使用自己的apikey和服务做转发,如果你不想别人用你的转发,设置hide_user_api_key环境变量,完全禁止输入

Issues-translate-bot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


The code is only for the built-in gpt service. It is not prohibited to use your own apikey and service for forwarding. If you don't want others to use your forwarding, set the hide_user_api_key environment variable to completely prohibit input.