NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

[Bug] 云同步Webdav 失败

Open RanExoi opened this issue 1 year ago • 24 comments

Bug Description

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

Steps to Reproduce

1

Expected Behavior

1

Screenshots

No response

Deployment Method

  • [ ] Docker
  • [ ] Vercel
  • [ ] Server

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

RanExoi avatar May 22 '24 17:05 RanExoi

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


Title: [Bug] Cloud synchronization of Webdav failed

Issues-translate-bot avatar May 22 '24 17:05 Issues-translate-bot

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

Dean-YZG avatar May 27 '24 05:05 Dean-YZG

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

Issues-translate-bot avatar May 27 '24 05:05 Issues-translate-bot

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

SquirrelJimmy avatar May 28 '24 07:05 SquirrelJimmy

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

Issues-translate-bot avatar May 28 '24 07:05 Issues-translate-bot

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

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

junxian-li-hpc avatar Jun 06 '24 10:06 junxian-li-hpc

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😫

Issues-translate-bot avatar Jun 06 '24 10:06 Issues-translate-bot

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

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

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

ymone avatar Jun 08 '24 00:06 ymone

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/
  1. 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

Issues-translate-bot avatar Jun 08 '24 00:06 Issues-translate-bot

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

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

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

122cygf avatar Jun 14 '24 00:06 122cygf

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.

Issues-translate-bot avatar Jun 14 '24 00:06 Issues-translate-bot

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

junxian-li-hpc avatar Jun 15 '24 08:06 junxian-li-hpc

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.

Issues-translate-bot avatar Jun 15 '24 08:06 Issues-translate-bot

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

ahzmr avatar Aug 04 '24 02:08 ahzmr

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

Issues-translate-bot avatar Aug 04 '24 02:08 Issues-translate-bot

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

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

zhanghaotian2018 avatar Sep 05 '24 03:09 zhanghaotian2018

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

Issues-translate-bot avatar Sep 05 '24 03:09 Issues-translate-bot

有浏览器开发者工具中截取的关于接口请求报错的截图么?目前,出于安全考虑,除了通过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/'
          ...

ahzmr avatar Sep 05 '24 11:09 ahzmr

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/'
          ...

Issues-translate-bot avatar Sep 05 '24 11:09 Issues-translate-bot

加了环境变量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

eric-easyhealth avatar Sep 19 '24 12:09 eric-easyhealth

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

JsonSong89 avatar Sep 20 '24 09:09 JsonSong89

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

JsonSong89 avatar Sep 20 '24 10:09 JsonSong89

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

image

eric-easyhealth avatar Sep 23 '24 03:09 eric-easyhealth

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

busiqiao avatar Sep 25 '24 11:09 busiqiao

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

和你一样,我更新到 2.15.8,也是这个错误,变量白名单也加过了

eons2long avatar Dec 20 '24 13:12 eons2long

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


After updating to v2.15.3, the error is still reported, but the error becomes: s01dztyr r3d

Like you, I updated to 2.15.8 and got the same error. The variable whitelist has also been added.

Issues-translate-bot avatar Dec 20 '24 13:12 Issues-translate-bot