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

feat: 添加注册登录&同步聊天数据 #417

Closed
wants to merge 0 commits into from

Conversation

Kerwin1202
Copy link

开启登录

当 AUTH_SECRET_KEY 不为空则开启登录,否则为空也可以多设备同步聊天。不同设备刷新页面会同步

其他设置看 注释好了

image

image

image

@gitguardian
Copy link

gitguardian bot commented Mar 8, 2023

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
- SMTP credentials 4fe12d9 docker-compose/docker-compose.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@qimo2020
Copy link

qimo2020 commented Mar 9, 2023

这应该另起一个分支!

@Kerwin1202
Copy link
Author

这应该另起一个分支!

就算不启用 默认和现在没区别 唯一就是 docker 打包大了些 但是数据库还是要的

@swuecho
Copy link

swuecho commented Mar 9, 2023

这应该另起一个分支!

就算不启用 默认和现在没区别 唯一就是 docker 打包大了些 但是数据库还是要的

赞! 数据库如果用sqlite 会减少一点部署的麻烦. sqlite 个人使用时足够了

@kilvn
Copy link
Contributor

kilvn commented Mar 9, 2023

这种强制MongoDB的侵入式改动应该不会直接合并到主分支,应该新起一个分支,db应该是可选项,比如mongo、maridb、sqlite,前两个可以传入变量以配置连接参数,这样是比较容易令人接受的

@JeazW
Copy link

JeazW commented Mar 9, 2023

既然有了数据库,还希望能支持保存和恢复回话记录,类似于现在的导入导出功能,只不过现在是保存在访问设备在地。数据库推荐mongo,对json储存比较友好。

@ludashi2020
Copy link

@Kerwin1202
Copy link
Author

这种强制MongoDB的侵入式改动应该不会直接合并到主分支,应该新起一个分支,db应该是可选项,比如mongo、maridb、sqlite,前两个可以传入变量以配置连接参数,这样是比较容易令人接受的

db 应该没有可选一说 加了再可选 会一堆代码判断,但是可以支持sqlite之类的

@Kerwin1202
Copy link
Author

既然有了数据库,还希望能支持保存和恢复回话记录,类似于现在的导入导出功能,只不过现在是保存在访问设备在地。数据库推荐mongo,对json储存比较友好。

每次刷新页面会重新从数据库拉去会话的 所以有 db 导入导出作用就不大(除非你想分享自己的聊天完整给别人

@Kerwin1202
Copy link
Author

收到的验证邮件地址不正确。 是这样的http://127.0.0.1:1002/#/chat/?verifytoken=12122222@qq.com-1678486633533-a286aa4fdb1fc3eda270e592200c692c

docker 部署的话 看看 你的 docker-compose 里的 SITE_DOMAIN 变量设置下

@ludashi2020
Copy link

登录之前能不能显示未登录状态?类似这样QQ截图20230310182925.png

登陆后加个退出登录按钮类似这样
QQ截图20230310182925.png

@ludashi2020
Copy link

登录之前能不能显示未登录状态?类似这样QQ截图20230310182925.png

登陆后加个退出登录按钮类似这样 QQ截图20230310182925.png

https://github.com/gouguoyin/chatgpt-web 大佬修改的只有前端

@Kerwin1202
Copy link
Author

登录之前能不能显示未登录状态?类似这样QQ截图20230310182925.png

登陆后加个退出登录按钮类似这样 QQ截图20230310182925.png

会加的 还有一些其他的优化

@JeazW
Copy link

JeazW commented Mar 11, 2023

既然有了数据库,还希望能支持保存和恢复回话记录,类似于现在的导入导出功能,只不过现在是保存在访问设备在地。数据库推荐mongo,对json储存比较友好。

每次刷新页面会重新从数据库拉去会话的 所以有 db 导入导出作用就不大(除非你想分享自己的聊天完整给别人

当一次聊天觉得当前聊天不错,可以点击保存,于是就把json保存到数据库里,但是这个保存的聊天不需要多设备同步显示到左边的chat列表里。只需要在点击”导入”的时候,可以选择之前保存的聊天记录恢复到聊天框。当接着又聊了新内容,再保存的时候,就更新json。
这个功能和多设备同步聊天有区别,多设备同步只需要左边的chat列表能实现同步就行。而这个可以在保存后,想恢复的时候再恢复,想删除的时候可以删除,当然,想分享的时候也可以分享。
总之有了数据库后,又增加了非常多的可能性,可以实现更复杂的应用逻辑,因此也确实带来了开发难度,对开源社区的大佬们表示由衷的感谢。

@rzarvirov
Copy link

rzarvirov commented Mar 11, 2023

great addition, would be even better to display email / name in the user info screen and as others suggested - have a "log out" function

@LuckyWang6
Copy link
Contributor

现在这个版本还适用吗

@ludashi2020
Copy link

现在这个版本还适用吗

不行。尝试添加后,出现了bug

@Kerwin1202
Copy link
Author

@ludashi2020 @luckywangxi @rzarvirov #589

@LuckyWang6
Copy link
Contributor

哇,明早起来试试

@ludashi2020
Copy link

感谢分享,明早试试

@webwalker
Copy link

AUTH_SECRET_KEY设置不为空,没有出现登录界面

@tzf1003
Copy link

tzf1003 commented Apr 3, 2023

新的bug,关于注册账号时,如果邮件发送后,用户没接收到,则无法重新发送邮件

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.

None yet

10 participants