This repository has been archived by the owner on Jul 26, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Put part of the config in the Vercel Environment Variable, which simplifies the deployment process #1048
Open
iRedScarf
wants to merge
95
commits into
spencerwooo:main
Choose a base branch
from
iRedScarf:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
And hide the text title of the icon in the upper right corner of the page (Navbar)
Someone is attempting to deploy a commit to a Personal Account owned by @spencerwooo on Vercel. @spencerwooo first needs to authorize it. |
Hide the values of clientId and clientSecret displayed in the first step of OAuth authentication, and only display the first 6 characters and the last 6 characters.
Update step-1.tsx
使用getAccessToken函数验证是否已通过OAuth认证,若是则返回主页,否则进行正常进行OAuth认证。
Set `userPrincipalName`, `baseDirectory`, `clientId`, `clientSecre` with non-`NEXT_PUBLIC_`-prefixed environment variables.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
把配置和文件分离后的好处是,在Vercel中修改环境变量的值再重新部署,就可以方便地修改页面的title、分享目录之类的设置了(直接把Vercel的环境变量简单当成后台管理面板了)。
修改后部署步骤如下(E5开发者帐号):
clientId
和clientSceret
,并设置OneDrive的API权限user.read
、files.read.all
和offline_access
;README.md
中的一键部署按钮 (现在这个按钮是clone我的fork仓库的,供测试使用);title
、userPrincipalName
、baseDirectory
、clientId
和clientSceret
,点部署;Redis数据库
,再到Upstash Integrations新建一个关联,把刚部署好的OneDrive-Vercel-Index
关联上Redis数据库
;这是我的Demo:onedrive-index-iredscarf.vercel.app
Linked Issues
Respond #530
Additional context
site.config
中的title
和baseDirectory
设置了默认值,但在Vercel部署时的环境变量值是必填项,所以还是得填这些信息(其中baseDirectory
的格式依然是/文件夹名
,没有测试过没有/
会怎样);site.config
中的其他设置没有进行调整,例如需要设密码的目录、联系Email等;