cubercsl / onedrive-vercel-index

Yet another-another OneDrive index, powered by Vercel and Next.js

Home Page:https://drive.spencerwoo.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onedrive-vercel-index

OneDrive public directory listing, powered by Vercel and Next.js

Next.js Next.js Vercel GitHub Discussions

Discussion

Please go to our discussion forum for general questions and FAQs, issues are for bug reports and bug reports only. Feature requests may or may not be ignored, as I (@spencerwooo) am the only one maintaining the project, so I only prioritise features that I use.

Of course, I accept sponsors and donations :3

Demo

Live demo at Spencer's OneDrive.

demo

Features

File previewImage previewVideo and audio
PDF, EPUB, markdown, code, plain textAlso in gallery modemp4, mp3, ..., play online or with IINA, PotPlayer...
Office previewREADME.md previewPagination
docx, pptx, xlsx, ...Also renders code blocks, images with relative links, ...For folders with 200 or more items
Protected foldersMulti-file download... and more!
Password protected routes and files, details down hereCompress and download multiple files or folders, details down herePermalink copy, direct raw-file serving, dark mode, customisations...

More importantly, it's pretty (●'◡'●)

Deployment

No time to write deployment documentation! Here are some quick hints, play around with caution! (I promise detailed docs are on the way.)

  • Fork the project to your own account, as you will be maintaining your custom version of this project with your own configurations.
  • Change configuration file config/api.json and config/site.json according to your configs.
  • Define environment variables inside Vercel: REFRESH_TOKEN, ACCESS_TOKEN, CLIENT_SECRET.
  • Deploy inside Vercel, profit.

The authentication tokens and variables are the same as what you configured in the onedrive-cf-index project. Detailed documentations can also be found there (for now). This project is at its early stages, for discussions please, please, please post to the discussion forum.

These may interest you ...

Password protected folders

Password.Protected.Route.mp4

You can now specify a .password under a folder, declare the directory's absolute path, to password-protect the route and all files inside.

  • Declare protected route inside config/site.json under protectedRoutes, for instance:

    "protectedRoutes": [
      "/🌞 Private folder/u-need-a-password",
      "/🥟 Some test files/Protected route"
    ],
    
  • Add .password file under the root protected folder, redeploy your project on Vercel. Profit.

However, there are some caveats:

  • Function is not entirely reliable and may be largely vulnerable to all kinds of threats. DO NOT use for protecting sensitive information.
  • Protected files cannot be shared through ?raw=true url parameters.

Discussion #66.

Multi-file and folder download

Multi-file.Download.mp4

We use JSZip to download all files in-browser and compress them into file blobs, which are then downloaded to your device as a zip file. This is extremely useful if a series of small files are to be downloaded, but it could be time consuming if used for bulk-downloading a few large files.

Folders are traversed and recursively fetched into the compressed zip. Multiple files or folders can be selected and downloaded side-by-side.

PR #177 and #169.

OneDrive as your website's image storage

Yes, it can be used as an image (or any kind of file) online storage, where the raw file link is exported and can be embedded into your blog or other websites. Images, videos, songs, PDFs..., you name it.

[nyan cat](https://drive.spencerwoo.com/api?path=/%F0%9F%A5%9F%20Some%20test%20files/nyancat.gif&raw=true)

nyan cat

Server-less?

Yes! Completely free with no backend server what-so-ever.


onedrive-vercel-index ©Spencer Woo. Released under the MIT License.

Authored and maintained by Spencer Woo.

@Portfolio · @Blog · @GitHub

About

Yet another-another OneDrive index, powered by Vercel and Next.js

https://drive.spencerwoo.com/

License:MIT License


Languages

Language:TypeScript 74.9%Language:CSS 23.6%Language:JavaScript 1.5%