Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Put part of the config in the Vercel Environment Variable, which simplifies the deployment process #1048

Open
wants to merge 95 commits into
base: main
Choose a base branch
from

Conversation

iRedScarf
Copy link

@iRedScarf iRedScarf commented Jun 22, 2023

Description

  1. api.configclientIdclientSceret放在了环境变量中进行设置;
  2. site.configuserPrincipalNametitlebaseDirectory放在了环境变量中进行设置;
  3. README.md中增加了一件部署按钮;
  4. 把导航栏右边的Github和Email图标的标题文字隐藏掉了(因为觉得字多了会有点挤)。

把配置和文件分离后的好处是,在Vercel中修改环境变量的值再重新部署,就可以方便地修改页面的title、分享目录之类的设置了(直接把Vercel的环境变量简单当成后台管理面板了)。

修改后部署步骤如下(E5开发者帐号):

  1. 在Microsoft AD注册clientIdclientSceret,并设置OneDrive的API权限user.readfiles.read.alloffline_access
  2. 点击README.md中的一键部署按钮 Deploy with Vercel (现在这个按钮是clone我的fork仓库的,供测试使用);
  3. 跳转到Vercel部署页面,填写titleuserPrincipalNamebaseDirectoryclientIdclientSceret,点部署;
  4. 首次部署成功后,到Upstash新建一个Redis数据库,再到Upstash Integrations新建一个关联,把刚部署好的OneDrive-Vercel-Index关联上Redis数据库
  5. 再把刚部署的项目重新部署一次;
  6. 第二次部署成功后就可以访问页面进行OAuth认证了。

这是我的Demo:onedrive-index-iredscarf.vercel.app

Linked Issues

Respond #530

Additional context

  1. 虽然site.config中的titlebaseDirectory设置了默认值,但在Vercel部署时的环境变量值是必填项,所以还是得填这些信息(其中baseDirectory的格式依然是/文件夹名,没有测试过没有/会怎样);
  2. site.config中的其他设置没有进行调整,例如需要设密码的目录、联系Email等;
  3. 其实把需要加密的文件夹和密码也放在环境变量中,也可以方便修改(得空再研究下好了)。

我,红领巾! added 5 commits June 22, 2023 14:48
And hide the text title of the icon in the upper right corner of the page (Navbar)
@vercel
Copy link

vercel bot commented Jun 22, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @spencerwooo on Vercel.

@spencerwooo first needs to authorize it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants