Skip to content

📝 docs: Refactor the setup.sh to make deployment much easier #5290

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

Merged
merged 26 commits into from
Feb 3, 2025

Conversation

cy948
Copy link
Contributor

@cy948 cy948 commented Jan 4, 2025

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

  • ♻️ docker-compose/local/.env.*.example
    • 指定MINIO的用户名为admin
    • docker-compose.yml中的变量移动至.env,方便修改
  • 👷 docker-compose/local/docker-compose.yml
    • 在MINIO启动时创建bucket
    • 移除一些与.env重复的变量
    • 移除了对casdoor访问origin的限制
  • 👷 docker-compose/local/setup.sh
    • 不再下载含MINIO配置数据的压缩包,同时删去多余的解压代码
    • 若初始密码修改失败,即用户无sed时,显示默认密码
    • 交互式设计:
      • 让用户选择是否重新生成密钥(如用户无sed,可以跳过该步骤)
      • 让用户选择部署模式模式
        • 域名模式(访问时不带端口)
        • IP模式(访问时携带端口)
        • 本地模式
  • 🔧 docker-compose/local/init_data.json
    • 避免修改密码时将密码明文修改到phone
    • 添加两个域名的URL用于域名部署
    • 分别创建管理员账号和用户账号,管理员admin,用户user,密码一致。
    • 创建一个组织和应用用于用户登录,

📝 补充信息 | Additional Information

  • 本PR旨在去除原脚本中对MINIO初始数据的依赖。因为这既不安全,也不方便进行脚本管理。
  • 移除有两个难点:一是如何创建bucket,二是如何设置bucket的权限。
    • 对于难点一,在 docker compose 启动 entriypoint 添加脚本完成。
    • 对于难点二,计划使用文档辅助实现,这意味着使用公网部署的朋友需要进 MINIO 面板进行手动操作。
  • 最终实现:启动MinIO server 后,使用MinIO Cli添加bucket
  • 🧪 进行多部署模式测试
    • 域名模式(在 cloudflare[含代理] + 宝塔面板[含配置重写])
      • http
      • https
    • IP模式
    • 本地模式
  • PR 未合并时的测试
bash <(curl -fsSL https://raw.githubusercontent.com/cy948/lobe-chat/refactor/minio-pswd/docker-compose/setup.sh) -l zh_CN --url https://raw.githubusercontent.com/cy948/lobe-chat/refactor/minio-pswd

Copy link

vercel bot commented Jan 4, 2025

@cy948 is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

gru-agent bot commented Jan 4, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 945fa45 🚫 Skipped No files need to be tested {"docker-compose/local/.env.example":"target file(docker-compose/local/.env.example) not in work scope \n include: /*.ts,/.tsx,**/.js,/*.jsx \n exclude: node_modules,/.test.ts,**/.test.tsx,/*.spec.ts,/.spec.tsx,**/.d.ts,/*.test.js,/.spec.js","docker-compose/local/.env.zh-CN.example":"target file(docker-compose/local/.env.zh-CN.example) not in work scope \n include: **/.ts,/*.tsx,/.js,**/.jsx \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,/.spec.js","docker-compose/local/docker-compose.yml":"target file(docker-compose/local/docker-compose.yml) not in work scope \n include: **/.ts,/.tsx,**/.js,/*.jsx \n exclude: node_modules,/.test.ts,**/.test.tsx,/*.spec.ts,/.spec.tsx,**/.d.ts,/*.test.js,/.spec.js","docker-compose/local/init_data.json":"target file(docker-compose/local/init_data.json) not in work scope \n include: **/.ts,/*.tsx,/.js,**/.jsx \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,/.spec.js","docker-compose/local/setup.sh":"target file(docker-compose/local/setup.sh) not in work scope \n include: **/.ts,/.tsx,**/.js,/*.jsx \n exclude: node_modules,/.test.ts,**/.test.tsx,/*.spec.ts,/.spec.tsx,**/.d.ts,/*.test.js,/*.spec.js"}

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@lobehubbot
Copy link
Member

👍 @cy948

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@cy948 cy948 changed the title ♻️ Refactor: start minio more gratefully ♻️ Refactor: start minio more gratefully in setup.sh Jan 4, 2025
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 945fa45 to 5f469c0 Compare January 4, 2025 12:15
Copy link

codecov bot commented Jan 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.12%. Comparing base (d8afe47) to head (b9b0b2f).
Report is 59 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5290      +/-   ##
==========================================
- Coverage   92.15%   92.12%   -0.04%     
==========================================
  Files         648      647       -1     
  Lines       57494    57889     +395     
  Branches     2899     4271    +1372     
==========================================
+ Hits        52985    53329     +344     
- Misses       4509     4560      +51     
Flag Coverage Δ
app 92.12% <ø> (-0.04%) ⬇️
server 98.01% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cy948 cy948 marked this pull request as ready for review January 4, 2025 12:36
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 4, 2025
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 9d3a635 to c1d3445 Compare January 27, 2025 03:54
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 27, 2025
@cy948 cy948 marked this pull request as draft January 27, 2025 16:23
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 5887127 to 1225d42 Compare January 27, 2025 16:25
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 47a9b62 to 7d484ec Compare February 1, 2025 15:38
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 7d484ec to f12ac3b Compare February 1, 2025 16:37
@cy948 cy948 force-pushed the refactor/minio-pswd branch from ee7b43e to 1e71167 Compare February 2, 2025 04:58
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 3403aa5 to e13929c Compare February 2, 2025 06:54
@cy948 cy948 marked this pull request as ready for review February 2, 2025 08:52
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Feb 2, 2025
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 6de1a4f to 53f327e Compare February 3, 2025 13:53
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 53f327e to db26a52 Compare February 3, 2025 13:55
@arvinxx arvinxx changed the title ♻️ Refactor: start minio more gratefully in setup.sh ♻️ Refactor: Refactor the setup.sh to make deployment more easily Feb 3, 2025
@cy948 cy948 force-pushed the refactor/minio-pswd branch from 209297b to b9b0b2f Compare February 3, 2025 15:00
@cy948 cy948 force-pushed the refactor/minio-pswd branch from b9b0b2f to a0ec0a8 Compare February 3, 2025 15:37
@arvinxx arvinxx changed the title ♻️ Refactor: Refactor the setup.sh to make deployment more easily ♻️ Refactor: Refactor the setup.sh to make deployment much easier Feb 3, 2025
@arvinxx arvinxx changed the title ♻️ Refactor: Refactor the setup.sh to make deployment much easier 📝 docs: Refactor the setup.sh to make deployment much easier Feb 3, 2025
@arvinxx arvinxx merged commit b63765c into lobehub:main Feb 3, 2025
2 of 5 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @cy948 ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.50.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

ramu-narasinga pushed a commit to ramu-narasinga/lobe-chat that referenced this pull request Feb 17, 2025
…ub#5290)

* 🚧 wip: wip

* ✨ feat: create s3 bucket at start

* 🐛 fix: pswd shown in plain

* ♻️ refactor: remove unpack commands

* 🔨 ci: update script

* 🐛 fix: env files not downloaded

* 🔨 chore: support interact prompts

* 🐛 fix: AUTH_URL

* 🐛 fix: should download first

* 🐛 fix: let casdoor set origin

* 📝 docs: update docs for new setup

* 📝 docs: user non-admin app for lobe

* 👷 chore: remove -f for setup.sh

* 📝 docs: user

* 👷 chore: fix wrong host for casdoor

* 📝 docs: en docs

* 📝 docs: use new script

* ✏️ typo: fix typos

* 🐛 fix: wrong ip setup

* 🐛 fix: protocal generate failed

* 🐛 fix: remove warning

* ♻️ refactor: add warning for ip mode

* 📝 docs: display reverse proxy

* ♻️ refactor: move setup.sh to ../

* ✏️ typo: fix typos

* ♻️ refactor: remove setup.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants