It is a serverless program using GitHub page as frontend and using Cloudflare as backend to list your OneDrive files and folders.
I did a quick testing and used it to list my own OneDrive files and folders. Here are some features I like:
1. Fast - listing files and folders is super fast.
2. You can assign it to only show a specific folder.
3. You can add a password on any assigned folder
4. It can preview txt file, photos, audios and videos. (only those popular formats)
5. No need a server (VPS). (You only need a Github account and a Cloudflare account)
Here are all steps we can follow:
Backend - Cloudflare Workers
Create a WorkersCreate a workers and paste following contents from https://raw.githubusercontent.com/vcheckzen/FODI/master/back-end-cf/index.js
Only things you will need to change later are following two:
- EXPOSE_PATH= ""
- ONEDRIVE_REFRESHTOKEN = ""
* EXPOSE_PATH:One Drive folder name which you would like to list. If it is whole folder, you can keep it as is. Else, you need to put it as /music, /video , this kind of format.
* ONEDRIVE_REFRESHTOKEN: refresh_token which you will get it later. It will be used to log into your OneDrive account.
Fetch Refresh_Token
Click this address
New link to get code: https://logi.im/fodi/get-code/. Unfortunately it is only valid for three months. After that, you will get a white screen page from your OneIndex page. You will need to regenerate code and copy them into your Cloudflare workers. This regeneration code step can be finished by Github action. (Please refer this link: https://github.com/spencerwooo/onedrive-cf-index/blob/main/.github/workflows/main.yml)
You will need to log into your OneDrive and authorize SCF to access your OneDrive.
You might get an error page once you clicked link. But keep clicking to the link: Get a refresh token
You will re-direct to a O365 login page. Login in with your O365 account which you want to access its one drive. Accept the premission request frm one_scf.
Eventually, you will be re-direct to a message page with a refresh_token in a textbox, as shown below.
FrontEnd - Github Page
Fork FODI project into your Github repository.Edit the front_end page , change SCF_GATEWAY to your workers address, which is https://onedrive.51sec.workers.dev
Publish this page. You are good to go. The web page url will be something like: https://51sec.github.io/FODI/front-end/
Add Password for a specific folder
在某个文件夹下添加 .password
文件,里面写入密码,即可加密该文件夹。注意文件必须以 UTF8NoBOM
编码,且密码前后不能有空格或空行,Windows 下可通过以下方式生成:
在待加密文件夹下按住
Shift
键的同时,鼠标右击文件夹空白处,选择 在此处打开 Powershell 窗口(S)
,接着执行以下命令,其中 1234
便是密码。
copy
-
'1234' | Out-File -FilePath .password -Encoding ascii -NoNewline
YouTube video:
References
- FODI,一款 OneDrive 秒级列表程序
- 利用 CloudFlare Workers 等平台零成本运行 Google Drive、OneDrive 文件列表清单程序
- FODI搭建Cloudflare后端及Netlify前端教程
- Build a Serverless Bookmark Website Use Cloudflare Worker
- Fast OneDrive Index - A Serverless OneDrive Index Setup
- Using Cloudflare Workers to Deploy A Free Google Drive Directory Indexer in 5 Minutes
- Set Up CloudFlare Workers to Use Your Own Domain
- Build a Reverse Proxy Using Cloudflare Workers
- Cloudflare Workers Usage Collection
No comments:
Post a Comment