Press "Enter" to skip to content

Fast OneDrive Index – A Serverless OneDrive Index Setup

0

In my previous post ‘Using Cloudflare Workers to Deploy A Free Google Drive Directory Indexer in 5 Minutes‘, I showed a GitHub project GDINDEX. In this post, I am going to show another similar project, but it is for OneDrive – FODI (Fast OneDrive Index) at Github.

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 Workers
    Create 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 https://service-36wivxsc-1256127833.ap-hongkong.apigateway.myqcloud.com/release/scf_onedrive_filelistor

    You will need to log into your OneDrive and authorize SCF to access your OneDrive.  Eventually, you will be re-direct to a message page with a refresh_token in a textbox, as shown below.

    Now you can copy this whole refresh_token into your Workers. Save and deploy your workers with a customized name. Write down the workers url , such as https://onedrive.51sec.workers.dev. It will be added into front_end page.

      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

        References

        Leave a Reply

        %d bloggers like this: