profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/0wQ/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

0wQ/AutoApiSecret 1

加密版,应用id/机密不再可见

0wQ/AriaNg 0

AriaNg, a modern web frontend making aria2 easier to use.

0wQ/AriaNg-DailyBuild 0

AriaNg (http://github.com/mayswind/AriaNg) Daily Build

0wQ/BiliBiliTool 0

.Net Core 编写的跨平台的B站(哔哩哔哩)任务工具,通过GitHub Actions实现每日线上自动运行任务:每日自动登录、观看、分享、投币视频,获取每日任务的满额经验,轻松升级Level 6,实现自动领取大会员权益、月底自动为自己充电等功能。

0wQ/bitwarden_rs_dropbox_backup 0

Securely backup your bitwarden_rs data to Dropbox every night at 1AM

0wQ/docker-alpine-nginx-lua 0

Official NGINX Dockerfiles

push eventspencerwooo/onedrive-cf-index

spencerwooo

commit sha 8f74ee9f614380c5f2b4087236c5e3d6acf256c4

remove unused console logs

view details

spencerwooo

commit sha ad7b5981e863962d2900286c044053edc5e54af0

update font options

view details

spencerwooo

commit sha d665793e83eb632a4244f328688cffc8dbbc099e

update commit hash

view details

push time in 17 minutes

push eventspencerwooo/onedrive-cf-index

Mizore

commit sha 27611f992d06f3a262e8caef84de7271ddb91aec

Merge pull request #1 from spencerwooo/master

view details

Mizore

commit sha 9e5bb64951090b4211f550790e403a05b08f2476

feat: add support for path auth

view details

spencerwooo

commit sha 52ce831b79b4ae3baa9e2ed7ed9ba68f51e1f78d

move password to cf workers env var

view details

spencerwooo

commit sha 837b4a01ded084efad539ec58af29a41416bc244

enable private folder

view details

spencerwooo

commit sha 6435764daab221663e7941f46b352c29a877766e

fix security issue

view details

Spencer Woo

commit sha dcaf8c6d2d8ef6581be2bca8eff77f67bf5a5a85

Merge pull request #112 from 0wQ/path-auth feat: add support for path auth

view details

push time in 20 minutes

PR merged spencerwooo/onedrive-cf-index

feat: add support for path auth enhancement todo
+41 -19

0 comment

5 changed files

0wQ

pr closed time in 20 minutes

issue commentspencerwooo/onedrive-cf-index

配置指引的 redirect_uri 有问题

啊这

我的意思是本仓库的 readme 和本仓库的 config/default.js 的 redirect_uri 不一样,可能会对按 readme 部署的不会排障的新用户造成困惑,可能得劳烦阁下改一下

y67h41

comment created time in a day

issue commentspencerwooo/onedrive-cf-index

配置指引的 redirect_uri 有问题

历史遗留问题了 (;´д`)ゞ,主要是我自己是直接用本仓库进行部署的,我最初在巨硬那里设置的 redirect_uri 是 heymind.github.io 那个,但是新版有 CLI 工具之后使用 localhost 应该就是可以的了,总之保证巨硬和这里的 config/default.js 两处的 redirect_uri 一致就应该没有问题。

y67h41

comment created time in a day

issue openedspencerwooo/onedrive-cf-index

配置指引的 redirect_uri 有问题

按照readme的指引配置之后,clouflare报错,在worker的console里报如是错误:

Uncaught (in promise) getAccessToken error "{"error":"invalid_client","error_description":"AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: 'fb1babcf-29a1-4bee-966a-e861a0a4c12e'.\r\nTrace ID: 4035be1b-0f68-45f9-be44-5897bd292500\r\nCorrelation ID: 8ba75d05-e0a7-4867-8c82-d364a6b14dc5\r\nTimestamp: 2021-02-28 05:11:16Z","error_codes":[50011],"timestamp":"2021-02-28 05:11:16Z","trace_id":"4035be1b-0f68-45f9-be44-5897bd292500","correlation_id":"8ba75d05-e0a7-4867-8c82-d364a6b14dc5","error_uri":"https://login.microsoftonline.com/error?code=50011"}"

查代码,发现redirect_uri在src/config/default.js里被设置为https://heymind.github.io/tools/microsoft-graph-api-auth,在巨硬处加上这个redirect_uri后就正常了🤣

所以说readme的指引配置里这一条还是有问题的:

iv. Set Redirect URI (optional) to Web (the multiselect dropdown) and http://localhost (the URL).

在现在的程序运作方式和指引里取得refresh_token的方法下,得设置两个Redirect URI: http://localhost 和 https://heymind.github.io/tools/microsoft-graph-api-auth

created time in a day

PR opened 0wQ/BiliBiliTool

[pull] main from RayWangQvQ:main

See Commits and Changes for more details.


Created by <img src="https://prod.download/pull-18h-svg" valign="bottom"/> pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

+173 -130

0 comment

12 changed files

pr created time in 4 days

issue openedspencerwooo/onedrive-cf-index

MKV格式文件不能在线观看

如题!MKV格式文件不能在线观看!

created time in 4 days

CommitCommentEvent
CommitCommentEvent
CommitCommentEvent

issue closedspencerwooo/onedrive-cf-index

大佬,请问如何修改网站图标!?

大佬,请问如何修改网站图标!?

closed time in 4 days

xwwbest

issue openedspencerwooo/onedrive-cf-index

大佬,请问如何修改网站图标!?

大佬,请问如何修改网站图标!?

created time in 4 days

issue closedspencerwooo/onedrive-cf-index

大佬,https://localhost url地址是填这个还是图上的那个

大佬,https://localhost url地址是填这个还是图上的那个

closed time in 4 days

xwwbest

issue commentspencerwooo/onedrive-cf-index

大佬,https://localhost url地址是填这个还是图上的那个

http://localhost 如果你使用的是新命令行工具获取 token

xwwbest

comment created time in 4 days

issue closedspencerwooo/onedrive-cf-index

大佬,失败了

export async function getAccessToken() { | const timestamp = () => { | return Math.floor(Date.now() / 1000) @ ./src/index.js 4:0-59 55:28-42 57:42-51 ./src/config/default.js 24:19 Module parse failed: Identifier directly after number (24:19) You may need an appropriate loader to handle this file type. | * to get following params: client_id, client_secret, refresh_token & redirect_uri. | */

refresh_token: , | client_id: ', | client_secret: , @ ./src/index.js 1:0-37 31:23-29 50:6-12 50:22-28 56:6-12 57:4-10 65:20-26 66:18-24 69:19-25 69:46-52 84:15-21 84:42-48 85:23-29 85:51-57 85:84-90 129:10-16 129:33-39 129:74-80 141:10-16 144:31-37 Error: webpack returned an error. You may be able to resolve this issue by running npm install.

closed time in 4 days

xwwbest

issue closedspencerwooo/onedrive-cf-index

请问如何更新最新版?

请问如何更新最新版?这里更新,应该怎么更新自己的库

closed time in 4 days

tkfanswind

issue commentspencerwooo/onedrive-cf-index

请问如何更新最新版?

需要手动在自己的 GitHub 仓库发起 pull request 合并来自本仓库的更新内容。Ref: https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository

tkfanswind

comment created time in 4 days

issue openedspencerwooo/onedrive-cf-index

请问如何更新最新版?

请问如何更新最新版?这里更新,应该怎么更新自己的库

created time in 4 days

issue commentspencerwooo/onedrive-cf-index

refresh_token 大于 1KB 导致需要使用 Cloudflare Worker KV 存储来解决的方法

大佬,用你刚刚给的库部署好了。一样的操作,不晓得啥情况。

weiyunkj666

comment created time in 4 days

issue openedspencerwooo/onedrive-cf-index

大佬,https://localhost url地址是填这个还是图上的那个

大佬,https://localhost url地址是填这个还是图上的那个

created time in 4 days

issue commentspencerwooo/onedrive-cf-index

大佬,失败了

需要更多信息

xwwbest

comment created time in 4 days

issue commentspencerwooo/onedrive-cf-index

refresh_token 大于 1KB 导致需要使用 Cloudflare Worker KV 存储来解决的方法

大佬等一下。现在还是不行

有问题开issue,把上面无关commit删一下

weiyunkj666

comment created time in 4 days

issue commentspencerwooo/onedrive-cf-index

refresh_token 大于 1KB 导致需要使用 Cloudflare Worker KV 存储来解决的方法

阿,不知道阿,就按教程搞得

你这完全不懂JavaScript。。 把上面的commit删一下吧

weiyunkj666

comment created time in 4 days

issue commentspencerwooo/onedrive-cf-index

refresh_token 大于 1KB 导致需要使用 Cloudflare Worker KV 存储来解决的方法

import config from '../config/default'

/**

  • Get access token for microsoft graph API endpoints. Refresh token if needed. */ export async function getAccessToken() { const timestamp = () => { return Math.floor(Date.now() / 1000) }

// Fetch access token const data = await BUCKET.get('onedrive', 'json') if (data && data.access_token && timestamp() < data.expire_at) { console.log('Fetched token from storage.') return data.access_token }

// Token expired, refresh access token with Microsoft API. Both international and china-specific API are supported const oneDriveAuthEndpoint = ${config.apiEndpoint.auth}/token

const resp = await fetch(oneDriveAuthEndpoint, { method: 'POST', body: client_id=${config.client_id}&redirect_uri=${config.redirect_uri}&client_secret=${config.client_secret} &refresh_token=${config.refresh_token}&grant_type=refresh_token, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }) if (resp.ok) { console.info('Successfully refreshed access_token.') const data = await resp.json()

// Update expiration time on token refresh
data.expire_at = timestamp() + data.expires_in

await BUCKET.put('onedrive', JSON.stringify(data))
console.info('Successfully updated access_token.')

// Finally, return access token
return data.access_token

} else { // eslint-disable-next-line no-throw-literal throw getAccessToken error ${JSON.stringify(await resp.text())} } }

/**

  • Get & store siteID for finding sharepoint resources
  • @param {string} accessToken token for accessing graph API */ export async function getSiteID(accessToken) { let data = await BUCKET.get('sharepoint', 'json') if (!data) { const resp = await fetch(${config.apiEndpoint.graph}${config.baseResource}?$select=id, { headers: { Authorization: bearer ${accessToken} } }) if (resp.ok) { data = await resp.json() console.log('Got & stored site-id.') await BUCKET.put('sharepoint', JSON.stringify({ id: data.id })) } } return data.id }

// ./src/auth/onedrive.js

// ... export async function getAccessToken() { const timestamp = () => { return Math.floor(Date.now() / 1000) }

const refresh_token = await BUCKET.get('refresh_token')

// 之后所有的 config.refresh_token 都直接改为 refresh_token // ... }

加语句没加,下面删也没删。 你用我库里的吧。。。 onedrive.js

weiyunkj666

comment created time in 4 days

issue commentspencerwooo/onedrive-cf-index

refresh_token 大于 1KB 导致需要使用 Cloudflare Worker KV 存储来解决的方法

import config from '../config/default'

/**

  • Get access token for microsoft graph API endpoints. Refresh token if needed. */ export async function getAccessToken() { const timestamp = () => { return Math.floor(Date.now() / 1000) }

// Fetch access token const data = await BUCKET.get('onedrive', 'json') if (data && data.access_token && timestamp() < data.expire_at) { console.log('Fetched token from storage.') return data.access_token }

// Token expired, refresh access token with Microsoft API. Both international and china-specific API are supported const oneDriveAuthEndpoint = ${config.apiEndpoint.auth}/token

const resp = await fetch(oneDriveAuthEndpoint, { method: 'POST', body: client_id=${config.client_id}&redirect_uri=${config.redirect_uri}&client_secret=${config.client_secret} &refresh_token=${config.refresh_token}&grant_type=refresh_token, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }) if (resp.ok) { console.info('Successfully refreshed access_token.') const data = await resp.json()

// Update expiration time on token refresh
data.expire_at = timestamp() + data.expires_in

await BUCKET.put('onedrive', JSON.stringify(data))
console.info('Successfully updated access_token.')

// Finally, return access token
return data.access_token

} else { // eslint-disable-next-line no-throw-literal throw getAccessToken error ${JSON.stringify(await resp.text())} } }

/**

  • Get & store siteID for finding sharepoint resources
  • @param {string} accessToken token for accessing graph API */ export async function getSiteID(accessToken) { let data = await BUCKET.get('sharepoint', 'json') if (!data) { const resp = await fetch(${config.apiEndpoint.graph}${config.baseResource}?$select=id, { headers: { Authorization: bearer ${accessToken} } }) if (resp.ok) { data = await resp.json() console.log('Got & stored site-id.') await BUCKET.put('sharepoint', JSON.stringify({ id: data.id })) } } return data.id }

// ./src/auth/onedrive.js

// ... export async function getAccessToken() { const timestamp = () => { return Math.floor(Date.now() / 1000) }

const refresh_token = await BUCKET.get('refresh_token')

// 之后所有的 config.refresh_token 都直接改为 refresh_token // ... }

weiyunkj666

comment created time in 4 days

issue commentspencerwooo/onedrive-cf-index

refresh_token 大于 1KB 导致需要使用 Cloudflare Worker KV 存储来解决的方法

./src/auth/onedrive.js 72:22 Module parse failed: Identifier 'getAccessToken' has already been declared (72:22) You may need an appropriate loader to handle this file type. | | // ...

export async function getAccessToken() { | const timestamp = () => { | return Math.floor(Date.now() / 1000) @ ./src/index.js 4:0-59 55:28-42 57:42-51 Error: webpack returned an error. You may be able to resolve this issue by running npm install.

试过了,还是这样

贴一下onedrive.js

weiyunkj666

comment created time in 4 days