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

[Question] 部署到本地,浏览器报跨域错误 #23

Open
ccdanpian opened this issue Jan 6, 2024 · 5 comments
Open

[Question] 部署到本地,浏览器报跨域错误 #23

ccdanpian opened this issue Jan 6, 2024 · 5 comments
Labels
😇 Help Wanted Need help | 需要帮助 Inactive No response in 30 days | 超过 30 天未活跃

Comments

@ccdanpian
Copy link

ccdanpian commented Jan 6, 2024

🧐 问题描述 | Proposed Solution

  1. 部署步骤
    git clone
    npm i
    npm run dev
  2. 安装,选择manifest-dev.json安装。
  3. 报错信息(部署到本地docker服务器或者vercel,都是一样的报错信息)
    image
    image
    image

📝 补充信息 | Additional Information

No response

@ccdanpian ccdanpian added the 😇 Help Wanted Need help | 需要帮助 label Jan 6, 2024
@lobehubbot
Copy link
Member

👀 @ccdanpian
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@ccdanpian ccdanpian changed the title [Question] 部署到本地,报跨域错误 [Question] 部署到本地,浏览器报跨域错误 Jan 6, 2024
@ccdanpian
Copy link
Author

很奇怪,上周试过一次还是可以的,不知道为啥忽然报错了。

@ccdanpian
Copy link
Author

ccdanpian commented Jan 6, 2024

另外,请问能出个指导文档吗?
比如插件列表、插件网关、API都部署在vercel上或者某个服务器上。
之前文档中说的是只有在本地的时候,API中的manifest.json才加网关;否则不加网关地址,那么此时网关地址应该如何获取? 是在其他地方配置的吗?

我是想做一个日历的API,可以在lobchat里语义输入todo或者记事,自动同步到群辉的日历上去。我想第一步只支持自己的群辉,下一步再看看能接其他日历吗。

@ccdanpian
Copy link
Author

ccdanpian commented Jan 7, 2024

终于通了。

做了如下配置措施:

  1. fork一个插件市场,把clothes加进去,并且部署到vercel;
  2. 本地lobechat加插件市场的环境变量,指向'1'里面的插件市场地址.
  3. 在github的codespace里部署一个chat-plugin-template,manifest里去掉gateway;

运行bun dev

  1. 在vercel里面部署chat-plugins-gateway,环境变量指向'1'里面的插件市场地址;

不过,没有明白:既没有在<插件市场>,也没有在里配置gateway,这个自己部署的gateway到底是如何工作的。

另外还经常报网关错误:
image

@arvinxx
Copy link
Contributor

arvinxx commented Jan 11, 2024

抱歉,我没订阅这个仓库的issue,这个 miss 了。几个问题一个一个解答:

很奇怪,上周试过一次还是可以的,不知道为啥忽然报错了。

这个应该是我的问题,在 #24 修复了。

另外,请问能出个指导文档吗?

具体需要什么方面的说明文档?私有化部署吗?

之前文档中说的是只有在本地的时候,API中的manifest.json才加网关;否则不加网关地址,那么此时网关地址应该如何获取?是在其他地方配置的吗?

插件 manifest 不加网关的时候,会直接走 LobeChat 的网关: https://github.com/lobehub/lobe-chat/blob/main/src/app/api/plugin/gateway/route.ts#L10 ,因此不需要你额外部署一个网关。

插件的本地网关只是为了解决服务端跨域调用到本地开发环境的问题。如果你的插件服务不在本地,直接可以通过服务调用到,那么就不需要配置本地网关。

我是想做一个日历的API,可以在lobchat里语义输入todo或者记事,自动同步到群辉的日历上去。我想第一步只支持自己的群辉,下一步再看看能接其他日历

那我理解你只需要部署一个自己的日历插件服务,然后这个服务有对应托管 manifest.json 就好了。安装插件的时候直接安装你的托管地址的 manifest.json。

比如你的日历插件服务托管地址是 abc.com。安装自定义插件时填 abc.com/manifest.json 即可。

@lobehubbot lobehubbot added the Inactive No response in 30 days | 超过 30 天未活跃 label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😇 Help Wanted Need help | 需要帮助 Inactive No response in 30 days | 超过 30 天未活跃
Projects
None yet
Development

No branches or pull requests

3 participants