Giter Site home page Giter Site logo

spencerwooo / onedrive-cf-index Goto Github PK

View Code? Open in Web Editor NEW
1.1K 10.0 442.0 1.12 MB

Deprecated, use new project 👇

Home Page: https://github.com/spencerwooo/onedrive-vercel-index

License: MIT License

JavaScript 84.10% CSS 15.90%
onedrive cloudflare-workers cloudflare-worker

onedrive-cf-index's Introduction

onedrive-cf-index Yet another OneDrive index, powered by CloudFlare Workers.

Deprecated

This project is deprecated and will not receive any further updates. Please use the newly refactored - onedrive-vercel-index.

  • Streamlined deployment, no more setting up your custom client id or client secret anymore.
  • Better user experience, cleaner UI, more customisations.
  • Direct raw-file serving, proxied file serving.
  • Permalink copy, proxied download link copy.
  • Full dark mode support, style and website customisations.
  • Basically - All features completely refactored in the new project.

Thank you for all the love and support!


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

Authored and maintained by Spencer Woo.

@Portfolio · @Blog · @GitHub

onedrive-cf-index's People

Contributors

0wq avatar beetcb avatar craigary avatar czbix avatar hezhijie0327 avatar hu3rror avatar kuhahku avatar lizkes avatar lufsx avatar sihuan avatar simonsmh avatar spencerwooo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onedrive-cf-index's Issues

I can't push it with workflow

When I try to use workflow to publish my worker.
I got a mistake:

npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

added 346 packages from 202 contributors and audited 348 packages in 6.633s

5 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Error: webpack returned an error. You may be able to resolve this issue by running npm install.
 ./src/folderView.js 68:51
Module parse failed: Unexpected token (68:51)
You may need an appropriate loader to handle this file type.
|           'div',
|           ['style="min-width: 600px"'],
>           (!isIndex ? item('far fa-folder', '..', `${path}..`) : '') +
|             items
|               .map(i => {
 @ ./src/index.js 7:0-47 123:32-48

I don't know how to solve it. Can anyone help me?

cache功能没有利用

在原版中,小图片,小文件预览都是走缓存的,包括整式缓存和流式缓存。但在这里,所有预览无论如何,走的都是Microsoft Graph Download URL,很慢,希望改成从cloudflare缓存读取

使用KV时遇到的问题

大佬您好,我严格按照您在 #16 中写的步骤,通过POSTMAN获取了refresh_tokenaccess_token

因为获取的refresh_token超出1KiB限制,于是按照您在 #58 中的步骤在Bucket中添加了refresh_token并将值黏贴进去。

随后在./src/auth/onedrive.js中添加了代码、将其他定义了REFRESH_TOKEN的地方删掉
(似乎也只有./src/config/default.js含有REFRESH_TOKEN?)

按照教程完成相关设置后进行wrangler preview,浏览器返回以下错误
Snipaste_2020-12-21_14-13-27

尝试了几次获取不同refresh_token均报同样的错误
也尝试过重新获取code、或删除API令牌重新生成,仍然报同样的错误。

实在不知道应该从哪儿开始解决,求指导……

如何绑定域名

如题,我想知道如何像示例站点那样,将workers.dev域名绑定到自己的域名上,望指导。
另听说workers可自选节点(可能是由于这,所以storage.spencerwooo.com比我的快),那怎么选呢?我按教程绑定了workers,改了A记录。刚改完,可用,第二天又有问题。
请指导我使用香港节点
谢谢

分页功能有问题

已确认是普遍的bug

描述:在safari中,Next Prev按钮无法点击,其它平台上点击有1101未知错误

问题模块:分页

[Bug] 缩略图功能报错

按照 https://github.com/spencerwooo/onedrive-cf-index#all-other-features
链接的 https://github.com/heymind/OneDrive-Index-Cloudflare-Worker#%EF%B8%8F-%E7%BC%A9%E7%95%A5%E5%9B%BE
打开了File.ReadWrite权限,之后重新wrangler publish了一遍,但是缩略图链接打开之后会报错,不显示小图

在.jpg链接后面尝试加上
?thumbnail=mediumSquare
会跳转到 https://graph.microsoft.com/v1.0/me/drive/root:/img/xxxxxxx.jpg:/thumbnails/0/mediumSquare/content
之后打开的页面显示

 {

  "error": {
    "code": "InvalidAuthenticationToken",
    "message": "Access token is empty.",
    "innerError": {
      "date": "2020-10-27T19:52:45",
      "request-id": "4b445a2d-f13b-4d9e-b2d2-ca35d6d5b98d",
      "client-request-id": "4b445a2d-f13b-4d9e-b2d2-ca35d6d5b98d"
    }
  }
}

中转下载与文件预览冲突

如题。

举个例子,我有aaa.jpg 那么它的网络地址应该是

nnn.nnn.workers.dev/aaa.jpg

这时会进入预览界面,而非下载,但这可以接受。

然而,我要中转下载,
输入

nnn.nnn.workers.dev/aaa.jpg?proxied

它还是显示预览界面,这令人生气,希望改一下,谢谢。

预览图片时高度不正常

预览图片时,图片的高度有问题,绝大部分被盖住了,无法完整显示。
而点开查看大图是正常的。

snipaste_20200911_012242

无法获得 `refresh_token`

{"error":"invalid_grant","error_description":"AADSTS70000: The provided value for the 'code' parameter is not valid. The code has expired.\r\nTrace ID: 7da0f588-0389-4720-a1a4-7858b95b5000\r\nCorrelation ID: 397ffa74-99eb-4e86-ba8e-cf91ab3783a5\r\nTimestamp: 2020-09-02 09:11:20Z","error_codes":[70000],"timestamp":"2020-09-02 09:11:20Z","trace_id":"7da0f588-0389-4720-a1a4-7858b95b5000","correlation_id":"397ffa74-99eb-4e86-ba8e-cf91ab3783a5","error_uri":"https://login.microsoftonline.com/error?code=70000

能否自行部署?

我不希望用cf workers来做后端,而是将它放在我的网站空间上,请问该怎么实现?

`itemNotFound` issue that may be related to PR #33

布署完成出现如下错误信息,不知道哪里出问题了?麻烦大佬帮忙看下,谢谢啦!
👷 Your Worker responded with: {"code":"itemNotFound","message":"The resource could not be found.","innerError":{"date":"2020-11-08T06:40:09","request-id":"3129ea8c-f0c2-4dcc-8df8-b83c6753ad4c","client-request-id":"3129ea8c-f0c2-4dcc-8df8-b83c6753ad4c"}}

wrangler preview和wrangler publish的时候报错

preview的时候我可以获取到代码
worker.txt

但是preview和publish到网站上的时候就会报错:
Uncaught SyntaxError: Unexpected token < in JSON at position 1
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 1
Uncaught (in response) SyntaxError: Unexpected token < in JSON at position 1
我看了一下是报的1640行的错,就是这个:
A.respondWith(async function (A) {
我后来发现A其实是网页的html源代码。。。似乎是把开头的里的<弄错了?
但是本身我不太懂这些,请大佬指点一下到底是哪里出了问题。。
我就是按照教程走的,也没有改动之类的,枯了枯了

File extension parsing is case-sensitive

文件预览对文件后缀的大小写敏感!
我的目录下有四个文件。
1.jpg
1.JPG
1.png
1.PNG

我发现只有
1.jpg
1.png
这两项可以预览出来,另外两个后缀是大写的文件就无法预览,虽然他们的图标显示的和小写后缀的文件的图标是一样的,但是我却无法预览他们,只会直接下载。
我一开始以为这个是一个还没有做出来的新功能,接着我发现这其实是一个bug。

中转下载文件大小问题

虽是已知问题,但至少修复一下吧。还等着?proxied 与多线程一起使用呢。现在得不到文件大小,用不了idm多线程

Problem when putting REFRESH_TOKEN

你好!感谢大佬写的这么棒的项目!
不过在我操作过程中发现当我在输入REFRESH_TOKEN的时候提示如下:

C:\Users\Calmpsycho\Documents\onedrive-cf-index-master>wrangler secret put REFRESH_TOKEN
Enter the secret text you'd like assigned to the variable REFRESH_TOKEN on the script named music:
[很长的一串密钥]
 Creating the secret for script name music
Error:  Code 10054: workers.api.error.text_binding_too_large
 Your secret is too large, it must be 1kB or less

提示我密钥超过1kb的限制,看了一下密钥长度为1050到1060字节不等(刷新了好几次),的确超出了限制。
可是我不管怎么修改设置都没办法缩短长度
请问怎么解决呢?谢谢!
(知识匮乏还望大佬包涵)

password?

This is really a good product, but I want to use it not only for public sharing of files, but also for my own use. So I want to know that it is impossible to implement an encryption function to encrypt the user name and user password of the specified folder, so that I can mount my entire directory to this display program.

Ran into an error while attempting to fetch the `access_token`

In the Microsoft Graph API Auth tooling page, when proceeding step 5, I encountered the following message...

{"error":"invalid_request",
"error_description":"AADSTS90023: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type.

As shown, it wants a Single-Page Application; however, the platform we are after is Web...

有打算支持部署到Linux环境的想法吗

很喜欢这个project的外观,但是目前只支持部署到cloudflare上,国内用户访问速度不太理想。如果可以部署到linux上,那么就能解决这个问题。
有打算支持部署到Linux环境的想法吗

Failed to build and publish the project with wrangler

在我登陆之后,我尝试使用发布的命令。

wrangler publish

然后就遇到了这样子的问题。

 ./src/folderView.js 68:51
Module parse failed: Unexpected token (68:51)
You may need an appropriate loader to handle this file type.
|           'div',
|           ['style="min-width: 600px"'],
>           (!isIndex ? item('far fa-folder', '..', `${path}..`) : '') +
|             items
|               .map(i => {
 @ ./src/index.js 7:0-47 123:32-48
Error: webpack returned an error. You may be able to resolve this issue by running npm install.

400 errors in deployment

Built successfully, built project size is 24 KiB. Error: Something went wrong! Status: 400 Bad Request, Details { "result": null, "success": false, "errors": [ { "code": 10021, "message": "Uncaught ReferenceError: REFRESH_TOKEN is not defined\n at line 1\n at line 1 in t\n at line 1\n at line 1\n" } ], "messages": [] }

Please help me. Thank you!

升级之后出现了问题

{"code":"BadRequest","message":"Resource not found for the segment 'root:'.","innerError":{"date":"2020-09-21T12:20:30","request-id":"c4927bbb-97c4-4a6d-8816-22c9bf470cbe","client-request-id":"c4927bbb-97c4-4a6d-8816-22c9bf470cbe"}}

我在升级代码后出现了问题,如果问题在于我的存储库,麻烦帮我看下。

单页只能显示两百项内容

我发现,现在列表中,一页只能显示两百张内容,我知道这是微软API的限制,但是它也支持分页呀,能不能加一个加载分页的功能呢?不然我用来备份手机照片的文件夹就显示不全。
这真的是一个很好的程序,感谢作者,如果能有更多新功能就好了。

请问 GitHub Actions 该如何配置?

看了main.yml,不知道 CF_API_TOKEN 的格式是什么样的?请问需要填哪些信息?REFRESH_TOKEN、CLIENT_SECRET、FIREBASE_TOKEN 这三项值不需要填吗?

Ran into error when trying to fetch an access token

In the Microsoft Graph API tooling page, I was able to fetch a code in step 4, but cannot continue to get an access token, as it returned the following message:

"error":"invalid_request",
"error_description":"AADSTS90023: Cross-origin token redemption is permitted only for the 'Single-Page Application'

As shown, it requires a single-page application; however, the platform is intended to be 'web'.

数据库密钥目前已弃用

数据库密钥目前已弃用,可使用旧版 Firebase 令牌生成器。请使用 Firebase Admin SDK 来更新您的源代码。

Feature requests: more file types, microsoft office docs, password per directory, dedicated password popup

我想知道你接下来准备往程序里面加入什么新的功能?这真的是一个很好的程序,我希望它能够维护下去,并有所新功能。对于新版本,这里是我的一些建议:

  1. 增加更多文件类型的支持,比如 pngavi……这样比较常见的格式。
  2. 对于 docppt 和微软系列的文档,表格,幻灯片文档,是否可以嵌入一些 HTML 代码,使程序可以预览他们,这个应该是可以实现的,因为我在 oneindex 里面已经看到了这个功能的实现。
  3. 可以预览的文件的预加载:我有的时候会想要用这个程序来观看我网盘里面的电影,或者是听音乐,但是由于众所周知的网络原因,这些电影或者是音乐会不定时的暂停下来,来缓存下一部分的内容,这对于特别是听音乐的时候,有很大的影响。我宁愿在播放之前多等待几秒,也希望获得更加流畅的体验。或者是否可以通过 Cloudflare 的缓存功能,将这些文件缓存下来,然后直接读取?
  4. 密码:我测试了,原来作者的密码功能,发现在大部分设备上应该是可以用的。但是在一些性能较弱的,或者是浏览器功能不全的设备(比如 Kindle)上,就会出现一些问题,它的浏览器会显示网页有问题什么的,总之就是无法弹出那个用于验证密码的窗口。我希望您能够写一个页面,专门用来验证验证,通过之后再进入目录。
  5. 分目录加密:如题,我想要将我站点中的一部分内容用于自己使用,一部分的内容共享出去。这就需要分目录加密了。我的设想是读取各个目录下的 .password 文件,文件里面的内容就是这个目录的密码,只有输对了相应的密码才能够访问其中的内容。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.