ChatGPTNextWeb / ChatGPT-Next-Web

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

[Bug] 云同步Webdav 失败 #4764

Open RanExoi opened 4 months ago

RanExoi commented 4 months ago

Bug Description

地址正常公网可以打开 但Webdav云同步检查可用性不通过 不知道是怎么回事

Steps to Reproduce

1

Expected Behavior

1

Screenshots

No response

Deployment Method

Desktop OS

No response

Desktop Browser

No response

Desktop Browser Version

No response

Smartphone Device

No response

Smartphone OS

No response

Smartphone Browser

No response

Smartphone Browser Version

No response

Additional Logs

No response

Issues-translate-bot commented 4 months ago

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


Title: [Bug] Cloud synchronization of Webdav failed

Dean-YZG commented 4 months ago

有浏览器开发者工具中截取的关于接口请求报错的截图么?目前,出于安全考虑,除了通过env var 配置的webdev endpoint之外,仅支持几个公开可信的服务提供商

Issues-translate-bot commented 4 months ago

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


Are there any screenshots of interface request errors taken from the browser developer tools? Currently, due to security concerns, only a few publicly trusted service providers are supported in addition to the webdev endpoint configured via env var

SquirrelJimmy commented 4 months ago

webdav有坑,无论是否是浏览器,代理必须勾选上,代理的URL就是当前你访问的域名,app;里面代理可以写你部署的域名后者ip,在你的云存储设置webdav的根目录下,新建文件夹chatgpt-next-web,文件夹里新建 backup.json 文件,不用管检查,直接同步即可,太坑了

Issues-translate-bot commented 4 months ago

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


Webdav has pitfalls. Regardless of whether it is a browser or not, the proxy must be checked. The URL of the proxy is the domain name you are currently visiting. In the root directory of your cloud storage settings webdav, create a new folder `chatgpt-next-web

junxian-li-hpc commented 3 months ago

webdav有坑,无论是否是浏览器,代理必须勾选上,代理的URL就是当前你访问的域名,app;里面代理可以写你部署的域名后者ip,在你的云存储设置webdav的根目录下,新建文件夹chatgpt-next-web,文件夹里新建 backup.json 文件,不用管检查,直接同步即可,太坑了

朋友,可以看下你的配置吗,代理URL还是不知道怎么填写😫

Issues-translate-bot commented 3 months ago

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


Webdav has pitfalls. Regardless of whether it is a browser or not, the proxy must be checked. The URL of the proxy is the domain name and app you are currently visiting. The proxy can write the domain name and IP of your deployment. Set the root of webdav in your cloud storage. Directory, create a new folder chatgpt-next-web, and create a backup.json file in the folder. Don’t bother checking, just synchronize directly. It’s too confusing.

Friend, can you take a look at your configuration? I still don’t know how to fill in the proxy URL😫

ymone commented 3 months ago

试了下,以下两项都需要满足才能成功:

  1. 部署的时候需要把 webdav 的 endpoint 添加到白名单
    environment:
      - WHITE_WEBDEV_ENDPOINTS=https://webdav.example.com/
  2. 在 webdav 的 endpoint 的地址下面,必须要已有如下文件结构,json文件也必须存在:
    endpoint/
    └── chatgpt-next-web
    └── backup.json

其中第一点是程序安全设计 第二点应该是一个BUG

Issues-translate-bot commented 3 months ago

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


After giving it a try, the following two items need to be met to succeed:

  1. When deploying, you need to add the endpoint of webdav to the whitelist.
    environment:
    - WHITE_WEBDEV_ENDPOINTS=https://webdav.example.com/
  2. Under the address of the endpoint of webdav, the following file structure must exist, and the json file must also exist:
    endpoint/
    └── chatgpt-next-web
    └── backup.json

The first point is program security design The second point should be a BUG

122cygf commented 3 months ago

webdav有坑,无论是否是浏览器,代理必须勾选上,代理的URL就是当前你访问的域名,app;里面代理可以写你部署的域名后者ip,在你的云存储设置webdav的根目录下,新建文件夹chatgpt-next-web,文件夹里新建 backup.json 文件,不用管检查,直接同步即可,太坑了

朋友,可以看下你的配置吗,代理URL还是不知道怎么填写😫

我的代理地址不填,但必须勾上代理,检查可用性不需要管他,能同步成功就行,其他都是和上面那位一样的

Issues-translate-bot commented 3 months ago

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


Webdav has pitfalls. Regardless of whether it is a browser or not, the proxy must be checked. The URL of the proxy is the domain name and app you are currently visiting. The proxy can write the domain name and IP of your deployment. Set webdav in your cloud storage. In the root directory, create a new folder chatgpt-next-web, and create a new backup.json file in the folder. You don’t need to check it, just synchronize it directly. It’s too confusing.

Friends, can you take a look at your configuration? I still don’t know how to fill in the proxy URL😫

My proxy address is not filled in, but the proxy must be checked. You don’t need to worry about it to check the availability. As long as the synchronization is successful, everything else is the same as the one above.

junxian-li-hpc commented 3 months ago

我用的main分支自己部署了,可以同步成功,用的 teracloud,没用坚果云试过

Issues-translate-bot commented 3 months ago

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


I deployed the main branch myself, and it can be synchronized successfully. I used teracloud, but I haven’t tried it with Nut Cloud.

ahzmr commented 1 month ago

本身的同步是有两个问题,一是检查走代理会400异常;二是如果webdav中刚开始没有文件404时,会同步失败。我这边修复了一版,我自己用很正常,你们可以试试。见 #5174

Issues-translate-bot commented 1 month ago

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


The synchronization itself has two problems. One is that when checking the proxy, a 400 exception will occur; the other is that if there is no file in webdav at the beginning and a 404 error occurs, the synchronization will fail. I have fixed a version here and it works fine for me. You can try it. See #5174

zhanghaotian2018 commented 3 weeks ago

有浏览器开发者工具中截取的关于接口请求报错的截图么?目前,出于安全考虑,除了通过env var 配置的webdev endpoint之外,仅支持几个公开可信的服务提供商

您 env var 配置 在哪个目录哪个文件。谢谢

Issues-translate-bot commented 3 weeks ago

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


Are there any screenshots of interface request errors taken from the browser developer tools? Currently, due to security concerns, only a few publicly trusted service providers are supported in addition to the webdev endpoint configured via env var

Your env var configuration is in which directory and which file. Thanks

ahzmr commented 3 weeks ago

有浏览器开发者工具中截取的关于接口请求报错的截图么?目前,出于安全考虑,除了通过env var 配置的webdev endpoint之外,仅支持几个公开可信的服务提供商

您 env var 配置 在哪个目录哪个文件。谢谢

通过环境变量配置:WHITE_WEBDEV_ENDPOINTS,我是用docker compose启动的。 比如我的配置文件为:

# cat docker-compose.yml
version: '3.3'

services:
    ahzmr-chatgpt-next-web:
        build: ./src
        image: ahzmr/chatgpt-next-web
        restart: always
        container_name: ahzmr-chatgpt-next-web
        ports:
            - '19086:3000'
        environment:
          TZ: 'Asia/Shanghai'
          WHITE_WEBDEV_ENDPOINTS: 'https://domain/lc/sync/'
          ...
Issues-translate-bot commented 3 weeks ago

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


Are there any screenshots of interface request errors taken from the browser developer tools? Currently, due to security concerns, only a few publicly trusted service providers are supported in addition to the webdev endpoint configured via env var

Your env var configuration is in which directory and which file. Thanks

Configured through environment variables: WHITE_WEBDEV_ENDPOINTS, I started it with docker compose. For example, my configuration file is:

cat docker-compose.yml
version: '3.3'

services:
    ahzmr-chatgpt-next-web:
        build: ./src
        image: ahzmr/chatgpt-next-web
        restart: always
        container_name: ahzmr-chatgpt-next-web
        ports:
            - '19086:3000'
        environment:
          TZ: 'Asia/Shanghai'
          WHITE_WEBDEV_ENDPOINTS: 'https://domain/lc/sync/'
          ...
eric-easyhealth commented 1 week ago

加了环境变量WHITE_WEBDEV_ENDPOINTS, 错误码变了,但是还是有错。。

[WebDav] get key = webdav_share 504 8069-585fe05109d5b99c.js:1 [Sync] SyntaxError: Unexpected token 'A', "An error o"... is not valid JSON

image
JsonSong89 commented 1 week ago

为什么是 WHITE_WEBDEV_ENDPOINTS 不应该是 WHITE_WEBDAV_ENDPOINTS 吗?

JsonSong89 commented 1 week ago

image 我说呢 大家注意下版本吧

eric-easyhealth commented 1 week ago

@JsonSong89 感谢指出,的确是有拼写错误,已经修正。但是还是出错,打了一些日志出来,发现还是 504, EDGE_FUNCTION_INVOCATION_TIMEOUT

image
busiqiao commented 1 week ago

更新到v2.15.3之后,依旧报错,但是错误变成了:

s01dztyr r3d