mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-09-20 20:56:20 +08:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
e32cebb153 | |||
02031bd835 | |||
7726cb14a0 | |||
23cfe8090b | |||
d89d0a05b4 | |||
14d57ae2ec | |||
d5f4b687bb | |||
bdb880f9f2 | |||
22575a1c61 | |||
890297aa27 |
81
.github/ISSUE_TEMPLATE/00-bug_report_zh.yml
vendored
Normal file
81
.github/ISSUE_TEMPLATE/00-bug_report_zh.yml
vendored
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
name: "错误报告"
|
||||||
|
description: 错误报告 / 问题
|
||||||
|
title: "[BUG] 请修改标题为您遇到的问题"
|
||||||
|
labels: [bug]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
感谢您花时间填写此错误报告。
|
||||||
|
请**务必**确认您的问题无重复,且不是因为您的操作、网络或第三方软件问题。
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: 请确认以下事项
|
||||||
|
description: |
|
||||||
|
您必须勾选以下内容,否则您的问题可能会被直接关闭。
|
||||||
|
或者您可以去[讨论区](https://github.com/OpenListTeam/OpenList/discussions)。
|
||||||
|
options:
|
||||||
|
- label: |
|
||||||
|
我已确认阅读并同意 [AGPL-3.0 第15条](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=15.%20Disclaimer%20of%20Warranty.) 。
|
||||||
|
本程序不提供任何明示或暗示的担保,使用风险由您自行承担。
|
||||||
|
- label: |
|
||||||
|
我已确认阅读并同意 [AGPL-3.0 第16条](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=16.%20Limitation%20of%20Liability.) 。
|
||||||
|
无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。
|
||||||
|
- label: |
|
||||||
|
我确认我的描述清晰,语法礼貌,能帮助开发者快速定位问题,并符合社区规则。
|
||||||
|
- label: |
|
||||||
|
我已确认阅读了[OpenList文档](https://docs.oplist.org)。
|
||||||
|
- label: |
|
||||||
|
我已确认没有重复的问题或讨论。
|
||||||
|
- label: |
|
||||||
|
我已确认是`OpenList`的问题,而不是其他原因(例如 [网络](https://docs.oplist.org/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`依赖`或`操作`)。
|
||||||
|
- label: |
|
||||||
|
我认为此问题必须由`OpenList`处理,而非第三方。
|
||||||
|
- label: |
|
||||||
|
我已确认这个问题在最新版本中没有被修复。
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: OpenList 版本(必填)
|
||||||
|
description: |
|
||||||
|
您使用的是哪个版本的软件?请不要使用`latest`或`master`作为答案。
|
||||||
|
placeholder: v4.xx.xx
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: driver
|
||||||
|
attributes:
|
||||||
|
label: 使用的存储驱动(必填)
|
||||||
|
description: |
|
||||||
|
您使用的是哪个存储驱动?
|
||||||
|
placeholder: "例如: OneDrive"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: bug-description
|
||||||
|
attributes:
|
||||||
|
label: 问题描述(必填)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: config
|
||||||
|
attributes:
|
||||||
|
label: 配置文件内容(必填)
|
||||||
|
description: |
|
||||||
|
请提供您的`OpenList`应用的配置文件,并截图相关存储配置。(可隐藏隐私字段)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: logs
|
||||||
|
attributes:
|
||||||
|
label: 日志(可选)
|
||||||
|
description: |
|
||||||
|
请复制粘贴错误日志,或者截图。(可隐藏隐私字段)
|
||||||
|
- type: textarea
|
||||||
|
id: reproduction
|
||||||
|
attributes:
|
||||||
|
label: 复现链接(可选)
|
||||||
|
description: |
|
||||||
|
请提供能复现此问题的链接。
|
81
.github/ISSUE_TEMPLATE/01-bug_report_en.yml
vendored
Normal file
81
.github/ISSUE_TEMPLATE/01-bug_report_en.yml
vendored
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
name: "Bug Report"
|
||||||
|
description: Bug Report / Issue
|
||||||
|
title: "[BUG] Please modify the title to describe the issue you are facing"
|
||||||
|
labels: [bug]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thank you for taking the time to fill out this bug report.
|
||||||
|
Please **make sure** your issue is not a duplicate and is not caused by your own operation, network, or third-party software.
|
||||||
|
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Please confirm the following
|
||||||
|
description: |
|
||||||
|
You must check all the following, otherwise your issue may be closed directly.
|
||||||
|
Or you can go to the [discussions](https://github.com/OpenListTeam/OpenList/discussions).
|
||||||
|
options:
|
||||||
|
- label: |
|
||||||
|
I have read and agree to [AGPL-3.0 Section 15](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=15.%20Disclaimer%20of%20Warranty.) .
|
||||||
|
The program is provided "as is" without any warranties; you bear all risks of using it.
|
||||||
|
- label: |
|
||||||
|
I have read and agree to [AGPL-3.0 Section 16](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=16.%20Limitation%20of%20Liability.) .
|
||||||
|
The copyright holders and distributors are not liable for any damages resulting from the use or inability to use the program.
|
||||||
|
- label: |
|
||||||
|
I confirm my description is clear, polite, helps developers quickly locate the issue, and complies with community rules.
|
||||||
|
- label: |
|
||||||
|
I have read the [OpenList documentation](https://docs.oplist.org).
|
||||||
|
- label: |
|
||||||
|
I confirm there are no duplicate issues or discussions.
|
||||||
|
- label: |
|
||||||
|
I confirm this is an `OpenList` issue, not caused by other reasons (such as [network](https://docs.oplist.org/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host), dependencies, or operation).
|
||||||
|
- label: |
|
||||||
|
I believe this issue must be handled by `OpenList` and not by a third party.
|
||||||
|
- label: |
|
||||||
|
I confirm this issue is not fixed in the latest version.
|
||||||
|
|
||||||
|
- type: input
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: OpenList Version (required)
|
||||||
|
description: |
|
||||||
|
What version of the software are you using? Please do not use `latest` or `master` as the answer.
|
||||||
|
placeholder: v4.xx.xx
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: driver
|
||||||
|
attributes:
|
||||||
|
label: Storage Driver Used (required)
|
||||||
|
description: |
|
||||||
|
Which storage driver are you using?
|
||||||
|
placeholder: "e.g. OneDrive"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: bug-description
|
||||||
|
attributes:
|
||||||
|
label: Bug Description (required)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: config
|
||||||
|
attributes:
|
||||||
|
label: Configuration File Content (required)
|
||||||
|
description: |
|
||||||
|
Please provide your `OpenList` application's configuration file and a screenshot of the relevant storage configuration. (You may mask sensitive fields)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: logs
|
||||||
|
attributes:
|
||||||
|
label: Logs (optional)
|
||||||
|
description: |
|
||||||
|
Please copy and paste any relevant log output or screenshots. (You may mask sensitive fields)
|
||||||
|
- type: textarea
|
||||||
|
id: reproduction
|
||||||
|
attributes:
|
||||||
|
label: Reproduction Link (optional)
|
||||||
|
description: |
|
||||||
|
Please provide a link to a repo or page that can reproduce this issue.
|
48
.github/ISSUE_TEMPLATE/02-feature_request_zh.yml
vendored
Normal file
48
.github/ISSUE_TEMPLATE/02-feature_request_zh.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
name: "功能请求"
|
||||||
|
description: 功能请求 / 增强
|
||||||
|
title: "[Feature] 请修改标题为您的功能名称"
|
||||||
|
labels: [enhancement]
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: 请确认以下事项
|
||||||
|
description: |
|
||||||
|
您必须勾选以下内容,否则您的问题可能会被直接关闭。
|
||||||
|
或者您可以去[讨论区](https://github.com/OpenListTeam/OpenList/discussions)。
|
||||||
|
options:
|
||||||
|
- label: |
|
||||||
|
我已确认阅读并同意 [AGPL-3.0 第15条](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=15.%20Disclaimer%20of%20Warranty.) 。
|
||||||
|
本程序不提供任何明示或暗示的担保,使用风险由您自行承担。
|
||||||
|
- label: |
|
||||||
|
我已确认阅读并同意 [AGPL-3.0 第16条](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=16.%20Limitation%20of%20Liability.) 。
|
||||||
|
无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。
|
||||||
|
- label: |
|
||||||
|
我确认我的描述清晰,语法礼貌,能帮助开发者快速定位问题,并符合社区规则。
|
||||||
|
- label: |
|
||||||
|
我已确认阅读了[OpenList文档](https://docs.oplist.org)。
|
||||||
|
- label: |
|
||||||
|
我已确认没有重复的问题或讨论。
|
||||||
|
- label: |
|
||||||
|
我认为此问题必须由`OpenList`处理,而非第三方。
|
||||||
|
- label: |
|
||||||
|
我已确认此功能尚未被实现。
|
||||||
|
- label: |
|
||||||
|
我已确认此功能是合理的,且有普遍需求,并非我个人需要。
|
||||||
|
- type: textarea
|
||||||
|
id: feature-description
|
||||||
|
attributes:
|
||||||
|
label: 需求描述
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: suggested-solution
|
||||||
|
attributes:
|
||||||
|
label: 实现思路
|
||||||
|
description: |
|
||||||
|
实现此需求的解决思路。
|
||||||
|
- type: textarea
|
||||||
|
id: additional-context
|
||||||
|
attributes:
|
||||||
|
label: 附加信息
|
||||||
|
description: |
|
||||||
|
相关的任何其他上下文或截图,或者你觉得有帮助的信息
|
48
.github/ISSUE_TEMPLATE/03-feature_request_en.yml
vendored
Normal file
48
.github/ISSUE_TEMPLATE/03-feature_request_en.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
name: "Feature Request"
|
||||||
|
description: Feature Request / Enhancement
|
||||||
|
title: "[Feature] Please change the title to your feature name"
|
||||||
|
labels: [enhancement]
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
attributes:
|
||||||
|
label: Please confirm the following
|
||||||
|
description: |
|
||||||
|
You must check all the following, otherwise your request may be closed directly.
|
||||||
|
Or you can go to the [discussions](https://github.com/OpenListTeam/OpenList/discussions).
|
||||||
|
options:
|
||||||
|
- label: |
|
||||||
|
I have read and agree to [AGPL-3.0 Section 15](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=15.%20Disclaimer%20of%20Warranty.).
|
||||||
|
The program is provided "as is" without any warranties; you bear all risks of using it.
|
||||||
|
- label: |
|
||||||
|
I have read and agree to [AGPL-3.0 Section 16](https://www.gnu.org/licenses/agpl-3.0.txt#:~:text=16.%20Limitation%20of%20Liability.).
|
||||||
|
The copyright holders and distributors are not liable for any damages resulting from the use or inability to use the program.
|
||||||
|
- label: |
|
||||||
|
I confirm my description is clear, polite, helps developers quickly locate the issue, and complies with community rules.
|
||||||
|
- label: |
|
||||||
|
I have read the [OpenList documentation](https://docs.oplist.org).
|
||||||
|
- label: |
|
||||||
|
I confirm there are no duplicate issues or discussions.
|
||||||
|
- label: |
|
||||||
|
I believe this issue must be handled by `OpenList` and not by a third party.
|
||||||
|
- label: |
|
||||||
|
I confirm this feature has not been implemented yet.
|
||||||
|
- label: |
|
||||||
|
I confirm this feature is reasonable and has general demand, not just my personal need.
|
||||||
|
- type: textarea
|
||||||
|
id: feature-description
|
||||||
|
attributes:
|
||||||
|
label: Feature Description
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: suggested-solution
|
||||||
|
attributes:
|
||||||
|
label: Suggested Solution
|
||||||
|
description: |
|
||||||
|
Solution or approach to achieve this feature.
|
||||||
|
- type: textarea
|
||||||
|
id: additional-context
|
||||||
|
attributes:
|
||||||
|
label: Additional Information
|
||||||
|
description: |
|
||||||
|
Any other context or screenshots related to this feature request, or information you find helpful.
|
82
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
82
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,82 +0,0 @@
|
|||||||
name: "Bug report"
|
|
||||||
description: Bug / 错误报告 / 问题
|
|
||||||
title: "[BUG] "
|
|
||||||
labels: [bug]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thanks for taking the time to fill out this bug report, please **confirm that your issue is not a duplicate issue and not because of your operation or version issues**
|
|
||||||
感谢您花时间填写此错误报告,请**务必确认您的issue不是重复的且不是因为您的操作或版本问题**
|
|
||||||
|
|
||||||
- type: checkboxes
|
|
||||||
attributes:
|
|
||||||
label: Please make sure of the following things
|
|
||||||
description: |
|
|
||||||
You must check all the following, otherwise your issue may be closed directly. Or you can go to the [discussions](https://github.com/OpenListTeam/OpenList/discussions)
|
|
||||||
您必须勾选以下所有内容,否则您的issue可能会被直接关闭。或者您可以去[讨论区](https://github.com/OpenListTeam/OpenList/discussions)
|
|
||||||
options:
|
|
||||||
- label: |
|
|
||||||
I have read the [documentation](https://docs.oplist.org).
|
|
||||||
我已经阅读了[文档](https://docs.oplist.org)。
|
|
||||||
- label: |
|
|
||||||
I'm sure there are no duplicate issues or discussions.
|
|
||||||
我确定没有重复的issue或讨论。
|
|
||||||
- label: |
|
|
||||||
I'm sure it's due to `OpenList` and not something else(such as [Network](https://docs.oplist.org/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
|
|
||||||
我确定是`OpenList`的问题,而不是其他原因(例如[网络](https://docs.oplist.org/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host),`依赖`或`操作`)。
|
|
||||||
- label: |
|
|
||||||
I'm sure this issue is not fixed in the latest version.
|
|
||||||
我确定这个问题在最新版本中没有被修复。
|
|
||||||
|
|
||||||
- type: input
|
|
||||||
id: version
|
|
||||||
attributes:
|
|
||||||
label: OpenList Version / OpenList 版本
|
|
||||||
description: |
|
|
||||||
What version of our software are you running? Do not use `latest` or `master` as an answer.
|
|
||||||
您使用的是哪个版本的软件?请不要使用`latest`或`master`作为答案。
|
|
||||||
placeholder: v4.xx.xx
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
id: driver
|
|
||||||
attributes:
|
|
||||||
label: Driver used / 使用的存储驱动
|
|
||||||
description: |
|
|
||||||
What storage driver are you using?
|
|
||||||
您使用的是哪个存储驱动?
|
|
||||||
placeholder: "for example: Onedrive"
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: bug-description
|
|
||||||
attributes:
|
|
||||||
label: Describe the bug / 问题描述
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: reproduction
|
|
||||||
attributes:
|
|
||||||
label: Reproduction / 复现链接
|
|
||||||
description: |
|
|
||||||
Please provide a link to a repo that can reproduce the problem you ran into. Please be aware that your issue may be closed directly if you don't provide it.
|
|
||||||
请提供能复现此问题的链接,请知悉如果不提供它你的issue可能会被直接关闭
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: config
|
|
||||||
attributes:
|
|
||||||
label: Config / 配置
|
|
||||||
description: |
|
|
||||||
Please provide the configuration file of your `OpenList` application and take a screenshot of the relevant storage configuration. (you can mask sensitive fields)
|
|
||||||
请提供您的`OpenList`应用的配置文件,并截图相关存储配置。(可隐藏隐私字段)
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: logs
|
|
||||||
attributes:
|
|
||||||
label: Logs / 日志
|
|
||||||
description: |
|
|
||||||
Please copy and paste any relevant log output.
|
|
||||||
请复制粘贴错误日志,或者截图
|
|
10
.github/ISSUE_TEMPLATE/config.yml
vendored
10
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,8 +1,14 @@
|
|||||||
blank_issues_enabled: true
|
blank_issues_enabled: true
|
||||||
contact_links:
|
contact_links:
|
||||||
|
- name: 问题和讨论
|
||||||
|
url: https://github.com/OpenListTeam/OpenList/discussions
|
||||||
|
about: 讨论、问题、想法等
|
||||||
- name: Questions & Discussions
|
- name: Questions & Discussions
|
||||||
url: https://github.com/OpenListTeam/OpenList/discussions
|
url: https://github.com/OpenListTeam/OpenList/discussions
|
||||||
about: Discuss / 讨论、问题、想法等
|
about: Discuss issues, ideas, etc.
|
||||||
|
- name: 即时聊天
|
||||||
|
url: https://t.me/OpenListTeam
|
||||||
|
about: 与我们聊天
|
||||||
- name: Chat
|
- name: Chat
|
||||||
url: https://t.me/OpenListTeam
|
url: https://t.me/OpenListTeam
|
||||||
about: Chat with us / 与我们聊天
|
about: Chat with us
|
||||||
|
34
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
34
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@ -1,34 +0,0 @@
|
|||||||
name: "Feature request"
|
|
||||||
description: Feature request / 功能请求 / 增强
|
|
||||||
title: "[Feature] "
|
|
||||||
labels: [enhancement]
|
|
||||||
body:
|
|
||||||
- type: checkboxes
|
|
||||||
attributes:
|
|
||||||
label: Please make sure of the following things
|
|
||||||
description: You may select more than one, even select all.
|
|
||||||
options:
|
|
||||||
- label: I have read the [documentation](https://docs.openlist.org).
|
|
||||||
- label: I'm sure there are no duplicate issues or discussions.
|
|
||||||
- label: I'm sure this feature is not implemented.
|
|
||||||
- label: I'm sure it's a reasonable and popular requirement.
|
|
||||||
- type: textarea
|
|
||||||
id: feature-description
|
|
||||||
attributes:
|
|
||||||
label: Description of the feature / 需求描述
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: suggested-solution
|
|
||||||
attributes:
|
|
||||||
label: Suggested solution / 实现思路
|
|
||||||
description: |
|
|
||||||
Solutions to achieve this requirement.
|
|
||||||
实现此需求的解决思路。
|
|
||||||
- type: textarea
|
|
||||||
id: additional-context
|
|
||||||
attributes:
|
|
||||||
label: Additional context / 附件
|
|
||||||
description: |
|
|
||||||
Any other context or screenshots about the feature request here, or information you find helpful.
|
|
||||||
相关的任何其他上下文或截图,或者你觉得有帮助的信息
|
|
40
.github/workflows/trigger-makefile-update.yml
vendored
Normal file
40
.github/workflows/trigger-makefile-update.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
name: Trigger OpenWRT Update
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Release tag to trigger update for'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trigger-makefile-update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Trigger Makefile hash update
|
||||||
|
uses: peter-evans/repository-dispatch@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.EXTERNAL_REPO_TOKEN_LUCI_APP_OPENLIST }}
|
||||||
|
repository: ${{ vars.HOOK_REPO || 'OpenListTeam/luci-app-openlist' }}
|
||||||
|
event-type: update-hashes
|
||||||
|
client-payload: |
|
||||||
|
{
|
||||||
|
"source_repository": "${{ github.repository }}",
|
||||||
|
"release_tag": "${{ inputs.tag || github.ref_name }}",
|
||||||
|
"release_name": "${{ inputs.tag || github.ref_name }}",
|
||||||
|
"release_url": "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ inputs.tag || github.ref_name }}",
|
||||||
|
"triggered_by": "${{ github.actor }}",
|
||||||
|
"trigger_reason": "${{ github.event_name }}"
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Log trigger information
|
||||||
|
run: |
|
||||||
|
echo "🚀 Successfully triggered Makefile hash update"
|
||||||
|
echo "📦 Target repository: OpenListTeam/luci-app-openlist"
|
||||||
|
echo "🏷️ Tag: ${{ inputs.tag || github.ref_name }}"
|
||||||
|
echo "👤 Triggered by: ${{ github.actor }}"
|
||||||
|
echo "📅 Trigger time: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
|
18
build.sh
18
build.sh
@ -4,11 +4,9 @@ builtAt="$(date +'%F %T %z')"
|
|||||||
gitAuthor="The OpenList Projects Contributors <noreply@openlist.team>"
|
gitAuthor="The OpenList Projects Contributors <noreply@openlist.team>"
|
||||||
gitCommit=$(git log --pretty=format:"%h" -1)
|
gitCommit=$(git log --pretty=format:"%h" -1)
|
||||||
|
|
||||||
githubAuthHeader=""
|
githubAuthArgs=""
|
||||||
githubAuthValue=""
|
|
||||||
if [ -n "$GITHUB_TOKEN" ]; then
|
if [ -n "$GITHUB_TOKEN" ]; then
|
||||||
githubAuthHeader="--header"
|
githubAuthArgs="--header \"Authorization: Bearer $GITHUB_TOKEN\""
|
||||||
githubAuthValue="Authorization: Bearer $GITHUB_TOKEN"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "dev" ]; then
|
if [ "$1" = "dev" ]; then
|
||||||
@ -21,7 +19,7 @@ else
|
|||||||
git tag -d beta || true
|
git tag -d beta || true
|
||||||
# Always true if there's no tag
|
# Always true if there's no tag
|
||||||
version=$(git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0")
|
version=$(git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0")
|
||||||
webVersion=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
webVersion=$(eval "curl -fsSL --max-time 2 $githubAuthArgs \"https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest\"" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "backend version: $version"
|
echo "backend version: $version"
|
||||||
@ -37,12 +35,12 @@ ldflags="\
|
|||||||
"
|
"
|
||||||
|
|
||||||
FetchWebDev() {
|
FetchWebDev() {
|
||||||
pre_release_tag=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases | jq -r 'map(select(.prerelease)) | first | .tag_name')
|
pre_release_tag=$(eval "curl -fsSL --max-time 2 $githubAuthArgs https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases" | jq -r 'map(select(.prerelease)) | first | .tag_name')
|
||||||
if [ -z "$pre_release_tag" ] || [ "$pre_release_tag" == "null" ]; then
|
if [ -z "$pre_release_tag" ] || [ "$pre_release_tag" == "null" ]; then
|
||||||
# fall back to latest release
|
# fall back to latest release
|
||||||
pre_release_json=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest")
|
pre_release_json=$(eval "curl -fsSL --max-time 2 $githubAuthArgs -H \"Accept: application/vnd.github.v3+json\" \"https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest\"")
|
||||||
else
|
else
|
||||||
pre_release_json=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/tags/$pre_release_tag")
|
pre_release_json=$(eval "curl -fsSL --max-time 2 $githubAuthArgs -H \"Accept: application/vnd.github.v3+json\" \"https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/tags/$pre_release_tag\"")
|
||||||
fi
|
fi
|
||||||
pre_release_assets=$(echo "$pre_release_json" | jq -r '.assets[].browser_download_url')
|
pre_release_assets=$(echo "$pre_release_json" | jq -r '.assets[].browser_download_url')
|
||||||
pre_release_tar_url=$(echo "$pre_release_assets" | grep "openlist-frontend-dist" | grep "\.tar\.gz$")
|
pre_release_tar_url=$(echo "$pre_release_assets" | grep "openlist-frontend-dist" | grep "\.tar\.gz$")
|
||||||
@ -53,7 +51,7 @@ FetchWebDev() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FetchWebRelease() {
|
FetchWebRelease() {
|
||||||
release_json=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest")
|
release_json=$(eval "curl -fsSL --max-time 2 $githubAuthArgs -H \"Accept: application/vnd.github.v3+json\" \"https://api.github.com/repos/OpenListTeam/OpenList-Frontend/releases/latest\"")
|
||||||
release_assets=$(echo "$release_json" | jq -r '.assets[].browser_download_url')
|
release_assets=$(echo "$release_json" | jq -r '.assets[].browser_download_url')
|
||||||
release_tar_url=$(echo "$release_assets" | grep "openlist-frontend-dist" | grep "\.tar\.gz$")
|
release_tar_url=$(echo "$release_assets" | grep "openlist-frontend-dist" | grep "\.tar\.gz$")
|
||||||
curl -fsSL "$release_tar_url" -o dist.tar.gz
|
curl -fsSL "$release_tar_url" -o dist.tar.gz
|
||||||
@ -254,7 +252,7 @@ BuildReleaseFreeBSD() {
|
|||||||
mkdir -p "build/freebsd"
|
mkdir -p "build/freebsd"
|
||||||
|
|
||||||
# Get latest FreeBSD 14.x release version from GitHub
|
# Get latest FreeBSD 14.x release version from GitHub
|
||||||
freebsd_version=$(curl -fsSL --max-time 2 $githubAuthHeader $githubAuthValue "https://api.github.com/repos/freebsd/freebsd-src/tags" | \
|
freebsd_version=$(eval "curl -fsSL --max-time 2 $githubAuthArgs \"https://api.github.com/repos/freebsd/freebsd-src/tags\"" | \
|
||||||
jq -r '.[].name' | \
|
jq -r '.[].name' | \
|
||||||
grep '^release/14\.' | \
|
grep '^release/14\.' | \
|
||||||
sort -V | \
|
sort -V | \
|
||||||
|
274
drivers/189_tv/driver.go
Normal file
274
drivers/189_tv/driver.go
Normal file
@ -0,0 +1,274 @@
|
|||||||
|
package _189_tv
|
||||||
|
|
||||||
|
import (
|
||||||
|
"container/ring"
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenListTeam/OpenList/drivers/base"
|
||||||
|
"github.com/OpenListTeam/OpenList/internal/driver"
|
||||||
|
"github.com/OpenListTeam/OpenList/internal/errs"
|
||||||
|
"github.com/OpenListTeam/OpenList/internal/model"
|
||||||
|
"github.com/go-resty/resty/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Cloud189TV struct {
|
||||||
|
model.Storage
|
||||||
|
Addition
|
||||||
|
client *resty.Client
|
||||||
|
tokenInfo *AppSessionResp
|
||||||
|
uploadThread int
|
||||||
|
familyTransferFolder *ring.Ring
|
||||||
|
cleanFamilyTransferFile func()
|
||||||
|
storageConfig driver.Config
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Config() driver.Config {
|
||||||
|
if y.storageConfig.Name == "" {
|
||||||
|
y.storageConfig = config
|
||||||
|
}
|
||||||
|
return y.storageConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) GetAddition() driver.Additional {
|
||||||
|
return &y.Addition
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Init(ctx context.Context) (err error) {
|
||||||
|
// 兼容旧上传接口
|
||||||
|
y.storageConfig.NoOverwriteUpload = y.isFamily() && y.Addition.RapidUpload
|
||||||
|
|
||||||
|
// 处理个人云和家庭云参数
|
||||||
|
if y.isFamily() && y.RootFolderID == "-11" {
|
||||||
|
y.RootFolderID = ""
|
||||||
|
}
|
||||||
|
if !y.isFamily() && y.RootFolderID == "" {
|
||||||
|
y.RootFolderID = "-11"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 限制上传线程数
|
||||||
|
y.uploadThread, _ = strconv.Atoi(y.UploadThread)
|
||||||
|
if y.uploadThread < 1 || y.uploadThread > 32 {
|
||||||
|
y.uploadThread, y.UploadThread = 3, "3"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化请求客户端
|
||||||
|
if y.client == nil {
|
||||||
|
y.client = base.NewRestyClient().SetHeaders(
|
||||||
|
map[string]string{
|
||||||
|
"Accept": "application/json;charset=UTF-8",
|
||||||
|
"User-Agent": "EcloudTV/6.5.5 (PJX110; unknown; home02) Android/35",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 避免重复登陆
|
||||||
|
if !y.isLogin() || y.Addition.AccessToken == "" {
|
||||||
|
if err = y.login(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理家庭云ID
|
||||||
|
if y.FamilyID == "" {
|
||||||
|
if y.FamilyID, err = y.getFamilyID(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Drop(ctx context.Context) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
|
||||||
|
return y.getFiles(ctx, dir.GetID(), y.isFamily())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
|
||||||
|
var downloadUrl struct {
|
||||||
|
URL string `json:"fileDownloadUrl"`
|
||||||
|
}
|
||||||
|
|
||||||
|
isFamily := y.isFamily()
|
||||||
|
fullUrl := ApiUrl
|
||||||
|
if isFamily {
|
||||||
|
fullUrl += "/family/file"
|
||||||
|
}
|
||||||
|
fullUrl += "/getFileDownloadUrl.action"
|
||||||
|
|
||||||
|
_, err := y.get(fullUrl, func(r *resty.Request) {
|
||||||
|
r.SetContext(ctx)
|
||||||
|
r.SetQueryParam("fileId", file.GetID())
|
||||||
|
if isFamily {
|
||||||
|
r.SetQueryParams(map[string]string{
|
||||||
|
"familyId": y.FamilyID,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
r.SetQueryParams(map[string]string{
|
||||||
|
"dt": "3",
|
||||||
|
"flag": "1",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, &downloadUrl, isFamily)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重定向获取真实链接
|
||||||
|
downloadUrl.URL = strings.Replace(strings.ReplaceAll(downloadUrl.URL, "&", "&"), "http://", "https://", 1)
|
||||||
|
res, err := base.NoRedirectClient.R().SetContext(ctx).SetDoNotParseResponse(true).Get(downloadUrl.URL)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer res.RawBody().Close()
|
||||||
|
if res.StatusCode() == 302 {
|
||||||
|
downloadUrl.URL = res.Header().Get("location")
|
||||||
|
}
|
||||||
|
|
||||||
|
like := &model.Link{
|
||||||
|
URL: downloadUrl.URL,
|
||||||
|
Header: http.Header{
|
||||||
|
"User-Agent": []string{base.UserAgent},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return like, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error) {
|
||||||
|
isFamily := y.isFamily()
|
||||||
|
fullUrl := ApiUrl
|
||||||
|
if isFamily {
|
||||||
|
fullUrl += "/family/file"
|
||||||
|
}
|
||||||
|
fullUrl += "/createFolder.action"
|
||||||
|
|
||||||
|
var newFolder Cloud189Folder
|
||||||
|
_, err := y.post(fullUrl, func(req *resty.Request) {
|
||||||
|
req.SetContext(ctx)
|
||||||
|
req.SetQueryParams(map[string]string{
|
||||||
|
"folderName": dirName,
|
||||||
|
"relativePath": "",
|
||||||
|
})
|
||||||
|
if isFamily {
|
||||||
|
req.SetQueryParams(map[string]string{
|
||||||
|
"familyId": y.FamilyID,
|
||||||
|
"parentId": parentDir.GetID(),
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
req.SetQueryParams(map[string]string{
|
||||||
|
"parentFolderId": parentDir.GetID(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, &newFolder, isFamily)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &newFolder, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error) {
|
||||||
|
isFamily := y.isFamily()
|
||||||
|
other := map[string]string{"targetFileName": dstDir.GetName()}
|
||||||
|
|
||||||
|
resp, err := y.CreateBatchTask("MOVE", IF(isFamily, y.FamilyID, ""), dstDir.GetID(), other, BatchTaskInfo{
|
||||||
|
FileId: srcObj.GetID(),
|
||||||
|
FileName: srcObj.GetName(),
|
||||||
|
IsFolder: BoolToNumber(srcObj.IsDir()),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err = y.WaitBatchTask("MOVE", resp.TaskID, time.Millisecond*400); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return srcObj, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error) {
|
||||||
|
isFamily := y.isFamily()
|
||||||
|
queryParam := make(map[string]string)
|
||||||
|
fullUrl := ApiUrl
|
||||||
|
method := http.MethodPost
|
||||||
|
if isFamily {
|
||||||
|
fullUrl += "/family/file"
|
||||||
|
method = http.MethodGet
|
||||||
|
queryParam["familyId"] = y.FamilyID
|
||||||
|
}
|
||||||
|
|
||||||
|
var newObj model.Obj
|
||||||
|
switch f := srcObj.(type) {
|
||||||
|
case *Cloud189File:
|
||||||
|
fullUrl += "/renameFile.action"
|
||||||
|
queryParam["fileId"] = srcObj.GetID()
|
||||||
|
queryParam["destFileName"] = newName
|
||||||
|
newObj = &Cloud189File{Icon: f.Icon} // 复用预览
|
||||||
|
case *Cloud189Folder:
|
||||||
|
fullUrl += "/renameFolder.action"
|
||||||
|
queryParam["folderId"] = srcObj.GetID()
|
||||||
|
queryParam["destFolderName"] = newName
|
||||||
|
newObj = &Cloud189Folder{}
|
||||||
|
default:
|
||||||
|
return nil, errs.NotSupport
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := y.request(fullUrl, method, func(req *resty.Request) {
|
||||||
|
req.SetContext(ctx).SetQueryParams(queryParam)
|
||||||
|
}, nil, newObj, isFamily)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return newObj, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
|
||||||
|
isFamily := y.isFamily()
|
||||||
|
other := map[string]string{"targetFileName": dstDir.GetName()}
|
||||||
|
|
||||||
|
resp, err := y.CreateBatchTask("COPY", IF(isFamily, y.FamilyID, ""), dstDir.GetID(), other, BatchTaskInfo{
|
||||||
|
FileId: srcObj.GetID(),
|
||||||
|
FileName: srcObj.GetName(),
|
||||||
|
IsFolder: BoolToNumber(srcObj.IsDir()),
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return y.WaitBatchTask("COPY", resp.TaskID, time.Second)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Remove(ctx context.Context, obj model.Obj) error {
|
||||||
|
isFamily := y.isFamily()
|
||||||
|
|
||||||
|
resp, err := y.CreateBatchTask("DELETE", IF(isFamily, y.FamilyID, ""), "", nil, BatchTaskInfo{
|
||||||
|
FileId: obj.GetID(),
|
||||||
|
FileName: obj.GetName(),
|
||||||
|
IsFolder: BoolToNumber(obj.IsDir()),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// 批量任务数量限制,过快会导致无法删除
|
||||||
|
return y.WaitBatchTask("DELETE", resp.TaskID, time.Millisecond*200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) (newObj model.Obj, err error) {
|
||||||
|
overwrite := true
|
||||||
|
isFamily := y.isFamily()
|
||||||
|
|
||||||
|
// 响应时间长,按需启用
|
||||||
|
if y.Addition.RapidUpload && !stream.IsForceStreamUpload() {
|
||||||
|
if newObj, err := y.RapidUpload(ctx, dstDir, stream, isFamily, overwrite); err == nil {
|
||||||
|
return newObj, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return y.OldUpload(ctx, dstDir, stream, up, isFamily, overwrite)
|
||||||
|
|
||||||
|
}
|
166
drivers/189_tv/help.go
Normal file
166
drivers/189_tv/help.go
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
package _189_tv
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"crypto/hmac"
|
||||||
|
"crypto/sha1"
|
||||||
|
"encoding/hex"
|
||||||
|
"encoding/xml"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func clientSuffix() map[string]string {
|
||||||
|
return map[string]string{
|
||||||
|
"clientType": AndroidTV,
|
||||||
|
"version": TvVersion,
|
||||||
|
"channelId": TvChannelId,
|
||||||
|
"clientSn": "unknown",
|
||||||
|
"model": "PJX110",
|
||||||
|
"osFamily": "Android",
|
||||||
|
"osVersion": "35",
|
||||||
|
"networkAccessMode": "WIFI",
|
||||||
|
"telecomsOperator": "46011",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SessionKeySignatureOfHmac HMAC签名
|
||||||
|
func SessionKeySignatureOfHmac(sessionSecret, sessionKey, operate, fullUrl, dateOfGmt string) string {
|
||||||
|
urlpath := regexp.MustCompile(`://[^/]+((/[^/\s?#]+)*)`).FindStringSubmatch(fullUrl)[1]
|
||||||
|
mac := hmac.New(sha1.New, []byte(sessionSecret))
|
||||||
|
data := fmt.Sprintf("SessionKey=%s&Operate=%s&RequestURI=%s&Date=%s", sessionKey, operate, urlpath, dateOfGmt)
|
||||||
|
mac.Write([]byte(data))
|
||||||
|
return strings.ToUpper(hex.EncodeToString(mac.Sum(nil)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// AppKeySignatureOfHmac HMAC签名
|
||||||
|
func AppKeySignatureOfHmac(sessionSecret, appKey, operate, fullUrl string, timestamp int64) string {
|
||||||
|
urlpath := regexp.MustCompile(`://[^/]+((/[^/\s?#]+)*)`).FindStringSubmatch(fullUrl)[1]
|
||||||
|
mac := hmac.New(sha1.New, []byte(sessionSecret))
|
||||||
|
data := fmt.Sprintf("AppKey=%s&Operate=%s&RequestURI=%s&Timestamp=%d", appKey, operate, urlpath, timestamp)
|
||||||
|
mac.Write([]byte(data))
|
||||||
|
return strings.ToUpper(hex.EncodeToString(mac.Sum(nil)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取http规范的时间
|
||||||
|
func getHttpDateStr() string {
|
||||||
|
return time.Now().UTC().Format(http.TimeFormat)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 时间戳
|
||||||
|
func timestamp() int64 {
|
||||||
|
return time.Now().UTC().UnixNano() / 1e6
|
||||||
|
}
|
||||||
|
|
||||||
|
type Time time.Time
|
||||||
|
|
||||||
|
func (t *Time) UnmarshalJSON(b []byte) error { return t.Unmarshal(b) }
|
||||||
|
func (t *Time) UnmarshalXML(e *xml.Decoder, ee xml.StartElement) error {
|
||||||
|
b, err := e.Token()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if b, ok := b.(xml.CharData); ok {
|
||||||
|
if err = t.Unmarshal(b); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return e.Skip()
|
||||||
|
}
|
||||||
|
func (t *Time) Unmarshal(b []byte) error {
|
||||||
|
bs := strings.Trim(string(b), "\"")
|
||||||
|
var v time.Time
|
||||||
|
var err error
|
||||||
|
for _, f := range []string{"2006-01-02 15:04:05 -07", "Jan 2, 2006 15:04:05 PM -07"} {
|
||||||
|
v, err = time.ParseInLocation(f, bs+" +08", time.Local)
|
||||||
|
if err == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*t = Time(v)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
type String string
|
||||||
|
|
||||||
|
func (t *String) UnmarshalJSON(b []byte) error { return t.Unmarshal(b) }
|
||||||
|
func (t *String) UnmarshalXML(e *xml.Decoder, ee xml.StartElement) error {
|
||||||
|
b, err := e.Token()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if b, ok := b.(xml.CharData); ok {
|
||||||
|
if err = t.Unmarshal(b); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return e.Skip()
|
||||||
|
}
|
||||||
|
func (s *String) Unmarshal(b []byte) error {
|
||||||
|
*s = String(bytes.Trim(b, "\""))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func toFamilyOrderBy(o string) string {
|
||||||
|
switch o {
|
||||||
|
case "filename":
|
||||||
|
return "1"
|
||||||
|
case "filesize":
|
||||||
|
return "2"
|
||||||
|
case "lastOpTime":
|
||||||
|
return "3"
|
||||||
|
default:
|
||||||
|
return "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func toDesc(o string) string {
|
||||||
|
switch o {
|
||||||
|
case "desc":
|
||||||
|
return "true"
|
||||||
|
case "asc":
|
||||||
|
fallthrough
|
||||||
|
default:
|
||||||
|
return "false"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func ParseHttpHeader(str string) map[string]string {
|
||||||
|
header := make(map[string]string)
|
||||||
|
for _, value := range strings.Split(str, "&") {
|
||||||
|
if k, v, found := strings.Cut(value, "="); found {
|
||||||
|
header[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return header
|
||||||
|
}
|
||||||
|
|
||||||
|
func MustString(str string, err error) string {
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|
||||||
|
func BoolToNumber(b bool) int {
|
||||||
|
if b {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func isBool(bs ...bool) bool {
|
||||||
|
for _, b := range bs {
|
||||||
|
if b {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func IF[V any](o bool, t V, f V) V {
|
||||||
|
if o {
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
return f
|
||||||
|
}
|
30
drivers/189_tv/meta.go
Normal file
30
drivers/189_tv/meta.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package _189_tv
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/OpenListTeam/OpenList/internal/driver"
|
||||||
|
"github.com/OpenListTeam/OpenList/internal/op"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Addition struct {
|
||||||
|
driver.RootID
|
||||||
|
AccessToken string `json:"access_token"`
|
||||||
|
TempUuid string
|
||||||
|
OrderBy string `json:"order_by" type:"select" options:"filename,filesize,lastOpTime" default:"filename"`
|
||||||
|
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
|
||||||
|
Type string `json:"type" type:"select" options:"personal,family" default:"personal"`
|
||||||
|
FamilyID string `json:"family_id"`
|
||||||
|
UploadThread string `json:"upload_thread" default:"3" help:"1<=thread<=32"`
|
||||||
|
RapidUpload bool `json:"rapid_upload"`
|
||||||
|
}
|
||||||
|
|
||||||
|
var config = driver.Config{
|
||||||
|
Name: "189CloudTV",
|
||||||
|
DefaultRoot: "-11",
|
||||||
|
CheckStatus: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
op.RegisterDriver(func() driver.Driver {
|
||||||
|
return &Cloud189TV{}
|
||||||
|
})
|
||||||
|
}
|
318
drivers/189_tv/types.go
Normal file
318
drivers/189_tv/types.go
Normal file
@ -0,0 +1,318 @@
|
|||||||
|
package _189_tv
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/xml"
|
||||||
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenListTeam/OpenList/pkg/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 居然有四种返回方式
|
||||||
|
type RespErr struct {
|
||||||
|
ResCode any `json:"res_code"` // int or string
|
||||||
|
ResMessage string `json:"res_message"`
|
||||||
|
|
||||||
|
Error_ string `json:"error"`
|
||||||
|
|
||||||
|
XMLName xml.Name `xml:"error"`
|
||||||
|
Code string `json:"code" xml:"code"`
|
||||||
|
Message string `json:"message" xml:"message"`
|
||||||
|
Msg string `json:"msg"`
|
||||||
|
|
||||||
|
ErrorCode string `json:"errorCode"`
|
||||||
|
ErrorMsg string `json:"errorMsg"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *RespErr) HasError() bool {
|
||||||
|
switch v := e.ResCode.(type) {
|
||||||
|
case int, int64, int32:
|
||||||
|
return v != 0
|
||||||
|
case string:
|
||||||
|
return e.ResCode != ""
|
||||||
|
}
|
||||||
|
return (e.Code != "" && e.Code != "SUCCESS") || e.ErrorCode != "" || e.Error_ != ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *RespErr) Error() string {
|
||||||
|
switch v := e.ResCode.(type) {
|
||||||
|
case int, int64, int32:
|
||||||
|
if v != 0 {
|
||||||
|
return fmt.Sprintf("res_code: %d ,res_msg: %s", v, e.ResMessage)
|
||||||
|
}
|
||||||
|
case string:
|
||||||
|
if e.ResCode != "" {
|
||||||
|
return fmt.Sprintf("res_code: %s ,res_msg: %s", e.ResCode, e.ResMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if e.Code != "" && e.Code != "SUCCESS" {
|
||||||
|
if e.Msg != "" {
|
||||||
|
return fmt.Sprintf("code: %s ,msg: %s", e.Code, e.Msg)
|
||||||
|
}
|
||||||
|
if e.Message != "" {
|
||||||
|
return fmt.Sprintf("code: %s ,msg: %s", e.Code, e.Message)
|
||||||
|
}
|
||||||
|
return "code: " + e.Code
|
||||||
|
}
|
||||||
|
|
||||||
|
if e.ErrorCode != "" {
|
||||||
|
return fmt.Sprintf("err_code: %s ,err_msg: %s", e.ErrorCode, e.ErrorMsg)
|
||||||
|
}
|
||||||
|
|
||||||
|
if e.Error_ != "" {
|
||||||
|
return fmt.Sprintf("error: %s ,message: %s", e.ErrorCode, e.Message)
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// 刷新session返回
|
||||||
|
type UserSessionResp struct {
|
||||||
|
ResCode int `json:"res_code"`
|
||||||
|
ResMessage string `json:"res_message"`
|
||||||
|
|
||||||
|
LoginName string `json:"loginName"`
|
||||||
|
|
||||||
|
KeepAlive int `json:"keepAlive"`
|
||||||
|
GetFileDiffSpan int `json:"getFileDiffSpan"`
|
||||||
|
GetUserInfoSpan int `json:"getUserInfoSpan"`
|
||||||
|
|
||||||
|
// 个人云
|
||||||
|
SessionKey string `json:"sessionKey"`
|
||||||
|
SessionSecret string `json:"sessionSecret"`
|
||||||
|
// 家庭云
|
||||||
|
FamilySessionKey string `json:"familySessionKey"`
|
||||||
|
FamilySessionSecret string `json:"familySessionSecret"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UuidInfoResp struct {
|
||||||
|
Uuid string `json:"uuid"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type E189AccessTokenResp struct {
|
||||||
|
E189AccessToken string `json:"accessToken"`
|
||||||
|
ExpiresIn int64 `json:"expiresIn"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 登录返回
|
||||||
|
type AppSessionResp struct {
|
||||||
|
UserSessionResp
|
||||||
|
|
||||||
|
IsSaveName string `json:"isSaveName"`
|
||||||
|
|
||||||
|
// 会话刷新Token
|
||||||
|
AccessToken string `json:"accessToken"`
|
||||||
|
//Token刷新
|
||||||
|
RefreshToken string `json:"refreshToken"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 家庭云账户
|
||||||
|
type FamilyInfoListResp struct {
|
||||||
|
FamilyInfoResp []FamilyInfoResp `json:"familyInfoResp"`
|
||||||
|
}
|
||||||
|
type FamilyInfoResp struct {
|
||||||
|
Count int `json:"count"`
|
||||||
|
CreateTime string `json:"createTime"`
|
||||||
|
FamilyID int64 `json:"familyId"`
|
||||||
|
RemarkName string `json:"remarkName"`
|
||||||
|
Type int `json:"type"`
|
||||||
|
UseFlag int `json:"useFlag"`
|
||||||
|
UserRole int `json:"userRole"`
|
||||||
|
}
|
||||||
|
|
||||||
|
/*文件部分*/
|
||||||
|
// 文件
|
||||||
|
type Cloud189File struct {
|
||||||
|
ID String `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
|
Md5 string `json:"md5"`
|
||||||
|
|
||||||
|
LastOpTime Time `json:"lastOpTime"`
|
||||||
|
CreateDate Time `json:"createDate"`
|
||||||
|
Icon struct {
|
||||||
|
//iconOption 5
|
||||||
|
SmallUrl string `json:"smallUrl"`
|
||||||
|
LargeUrl string `json:"largeUrl"`
|
||||||
|
|
||||||
|
// iconOption 10
|
||||||
|
Max600 string `json:"max600"`
|
||||||
|
MediumURL string `json:"mediumUrl"`
|
||||||
|
} `json:"icon"`
|
||||||
|
|
||||||
|
// Orientation int64 `json:"orientation"`
|
||||||
|
// FileCata int64 `json:"fileCata"`
|
||||||
|
// MediaType int `json:"mediaType"`
|
||||||
|
// Rev string `json:"rev"`
|
||||||
|
// StarLabel int64 `json:"starLabel"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Cloud189File) CreateTime() time.Time {
|
||||||
|
return time.Time(c.CreateDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Cloud189File) GetHash() utils.HashInfo {
|
||||||
|
return utils.NewHashInfo(utils.MD5, c.Md5)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Cloud189File) GetSize() int64 { return c.Size }
|
||||||
|
func (c *Cloud189File) GetName() string { return c.Name }
|
||||||
|
func (c *Cloud189File) ModTime() time.Time { return time.Time(c.LastOpTime) }
|
||||||
|
func (c *Cloud189File) IsDir() bool { return false }
|
||||||
|
func (c *Cloud189File) GetID() string { return string(c.ID) }
|
||||||
|
func (c *Cloud189File) GetPath() string { return "" }
|
||||||
|
func (c *Cloud189File) Thumb() string { return c.Icon.SmallUrl }
|
||||||
|
|
||||||
|
// 文件夹
|
||||||
|
type Cloud189Folder struct {
|
||||||
|
ID String `json:"id"`
|
||||||
|
ParentID int64 `json:"parentId"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
LastOpTime Time `json:"lastOpTime"`
|
||||||
|
CreateDate Time `json:"createDate"`
|
||||||
|
|
||||||
|
// FileListSize int64 `json:"fileListSize"`
|
||||||
|
// FileCount int64 `json:"fileCount"`
|
||||||
|
// FileCata int64 `json:"fileCata"`
|
||||||
|
// Rev string `json:"rev"`
|
||||||
|
// StarLabel int64 `json:"starLabel"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Cloud189Folder) CreateTime() time.Time {
|
||||||
|
return time.Time(c.CreateDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Cloud189Folder) GetHash() utils.HashInfo {
|
||||||
|
return utils.HashInfo{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Cloud189Folder) GetSize() int64 { return 0 }
|
||||||
|
func (c *Cloud189Folder) GetName() string { return c.Name }
|
||||||
|
func (c *Cloud189Folder) ModTime() time.Time { return time.Time(c.LastOpTime) }
|
||||||
|
func (c *Cloud189Folder) IsDir() bool { return true }
|
||||||
|
func (c *Cloud189Folder) GetID() string { return string(c.ID) }
|
||||||
|
func (c *Cloud189Folder) GetPath() string { return "" }
|
||||||
|
|
||||||
|
type Cloud189FilesResp struct {
|
||||||
|
//ResCode int `json:"res_code"`
|
||||||
|
//ResMessage string `json:"res_message"`
|
||||||
|
FileListAO struct {
|
||||||
|
Count int `json:"count"`
|
||||||
|
FileList []Cloud189File `json:"fileList"`
|
||||||
|
FolderList []Cloud189Folder `json:"folderList"`
|
||||||
|
} `json:"fileListAO"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// TaskInfo 任务信息
|
||||||
|
type BatchTaskInfo struct {
|
||||||
|
// FileId 文件ID
|
||||||
|
FileId string `json:"fileId"`
|
||||||
|
// FileName 文件名
|
||||||
|
FileName string `json:"fileName"`
|
||||||
|
// IsFolder 是否是文件夹,0-否,1-是
|
||||||
|
IsFolder int `json:"isFolder"`
|
||||||
|
// SrcParentId 文件所在父目录ID
|
||||||
|
SrcParentId string `json:"srcParentId,omitempty"`
|
||||||
|
|
||||||
|
/* 冲突管理 */
|
||||||
|
// 1 -> 跳过 2 -> 保留 3 -> 覆盖
|
||||||
|
DealWay int `json:"dealWay,omitempty"`
|
||||||
|
IsConflict int `json:"isConflict,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 上传部分 */
|
||||||
|
type InitMultiUploadResp struct {
|
||||||
|
//Code string `json:"code"`
|
||||||
|
Data struct {
|
||||||
|
UploadType int `json:"uploadType"`
|
||||||
|
UploadHost string `json:"uploadHost"`
|
||||||
|
UploadFileID string `json:"uploadFileId"`
|
||||||
|
FileDataExists int `json:"fileDataExists"`
|
||||||
|
} `json:"data"`
|
||||||
|
}
|
||||||
|
type UploadUrlsResp struct {
|
||||||
|
Code string `json:"code"`
|
||||||
|
Data map[string]UploadUrlsData `json:"uploadUrls"`
|
||||||
|
}
|
||||||
|
type UploadUrlsData struct {
|
||||||
|
RequestURL string `json:"requestURL"`
|
||||||
|
RequestHeader string `json:"requestHeader"`
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 第二种上传方式 */
|
||||||
|
type CreateUploadFileResp struct {
|
||||||
|
// 上传文件请求ID
|
||||||
|
UploadFileId int64 `json:"uploadFileId"`
|
||||||
|
// 上传文件数据的URL路径
|
||||||
|
FileUploadUrl string `json:"fileUploadUrl"`
|
||||||
|
// 上传文件完成后确认路径
|
||||||
|
FileCommitUrl string `json:"fileCommitUrl"`
|
||||||
|
// 文件是否已存在云盘中,0-未存在,1-已存在
|
||||||
|
FileDataExists int `json:"fileDataExists"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetUploadFileStatusResp struct {
|
||||||
|
CreateUploadFileResp
|
||||||
|
|
||||||
|
// 已上传的大小
|
||||||
|
DataSize int64 `json:"dataSize"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *GetUploadFileStatusResp) GetSize() int64 {
|
||||||
|
return r.DataSize + r.Size
|
||||||
|
}
|
||||||
|
|
||||||
|
type CommitMultiUploadFileResp struct {
|
||||||
|
File struct {
|
||||||
|
UserFileID String `json:"userFileId"`
|
||||||
|
FileName string `json:"fileName"`
|
||||||
|
FileSize int64 `json:"fileSize"`
|
||||||
|
FileMd5 string `json:"fileMd5"`
|
||||||
|
CreateDate Time `json:"createDate"`
|
||||||
|
} `json:"file"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OldCommitUploadFileResp struct {
|
||||||
|
XMLName xml.Name `xml:"file"`
|
||||||
|
ID String `xml:"id"`
|
||||||
|
Name string `xml:"name"`
|
||||||
|
Size int64 `xml:"size"`
|
||||||
|
Md5 string `xml:"md5"`
|
||||||
|
CreateDate Time `xml:"createDate"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *OldCommitUploadFileResp) toFile() *Cloud189File {
|
||||||
|
return &Cloud189File{
|
||||||
|
ID: f.ID,
|
||||||
|
Name: f.Name,
|
||||||
|
Size: f.Size,
|
||||||
|
Md5: f.Md5,
|
||||||
|
CreateDate: f.CreateDate,
|
||||||
|
LastOpTime: f.CreateDate,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateBatchTaskResp struct {
|
||||||
|
TaskID string `json:"taskId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BatchTaskStateResp struct {
|
||||||
|
FailedCount int `json:"failedCount"`
|
||||||
|
Process int `json:"process"`
|
||||||
|
SkipCount int `json:"skipCount"`
|
||||||
|
SubTaskCount int `json:"subTaskCount"`
|
||||||
|
SuccessedCount int `json:"successedCount"`
|
||||||
|
SuccessedFileIDList []int64 `json:"successedFileIdList"`
|
||||||
|
TaskID string `json:"taskId"`
|
||||||
|
TaskStatus int `json:"taskStatus"` //1 初始化 2 存在冲突 3 执行中,4 完成
|
||||||
|
}
|
||||||
|
|
||||||
|
type BatchTaskConflictTaskInfoResp struct {
|
||||||
|
SessionKey string `json:"sessionKey"`
|
||||||
|
TargetFolderID int `json:"targetFolderId"`
|
||||||
|
TaskID string `json:"taskId"`
|
||||||
|
TaskInfos []BatchTaskInfo
|
||||||
|
TaskType int `json:"taskType"`
|
||||||
|
}
|
564
drivers/189_tv/utils.go
Normal file
564
drivers/189_tv/utils.go
Normal file
@ -0,0 +1,564 @@
|
|||||||
|
package _189_tv
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/base64"
|
||||||
|
"encoding/xml"
|
||||||
|
"fmt"
|
||||||
|
"github.com/skip2/go-qrcode"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenListTeam/OpenList/drivers/base"
|
||||||
|
"github.com/OpenListTeam/OpenList/internal/driver"
|
||||||
|
"github.com/OpenListTeam/OpenList/internal/model"
|
||||||
|
"github.com/OpenListTeam/OpenList/internal/op"
|
||||||
|
"github.com/OpenListTeam/OpenList/pkg/utils"
|
||||||
|
|
||||||
|
"github.com/go-resty/resty/v2"
|
||||||
|
"github.com/google/uuid"
|
||||||
|
jsoniter "github.com/json-iterator/go"
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
TVAppKey = "600100885"
|
||||||
|
TVAppSignatureSecre = "fe5734c74c2f96a38157f420b32dc995"
|
||||||
|
TvVersion = "6.5.5"
|
||||||
|
AndroidTV = "FAMILY_TV"
|
||||||
|
TvChannelId = "home02"
|
||||||
|
|
||||||
|
ApiUrl = "https://api.cloud.189.cn"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (y *Cloud189TV) SignatureHeader(url, method string, isFamily bool) map[string]string {
|
||||||
|
dateOfGmt := getHttpDateStr()
|
||||||
|
sessionKey := y.tokenInfo.SessionKey
|
||||||
|
sessionSecret := y.tokenInfo.SessionSecret
|
||||||
|
if isFamily {
|
||||||
|
sessionKey = y.tokenInfo.FamilySessionKey
|
||||||
|
sessionSecret = y.tokenInfo.FamilySessionSecret
|
||||||
|
}
|
||||||
|
|
||||||
|
header := map[string]string{
|
||||||
|
"Date": dateOfGmt,
|
||||||
|
"SessionKey": sessionKey,
|
||||||
|
"X-Request-ID": uuid.NewString(),
|
||||||
|
"Signature": SessionKeySignatureOfHmac(sessionSecret, sessionKey, method, url, dateOfGmt),
|
||||||
|
}
|
||||||
|
return header
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) AppKeySignatureHeader(url, method string) map[string]string {
|
||||||
|
tempTime := timestamp()
|
||||||
|
header := map[string]string{
|
||||||
|
"Timestamp": strconv.FormatInt(tempTime, 10),
|
||||||
|
"X-Request-ID": uuid.NewString(),
|
||||||
|
"AppKey": TVAppKey,
|
||||||
|
"AppSignature": AppKeySignatureOfHmac(TVAppSignatureSecre, TVAppKey, method, url, tempTime),
|
||||||
|
}
|
||||||
|
return header
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) request(url, method string, callback base.ReqCallback, params map[string]string, resp interface{}, isFamily ...bool) ([]byte, error) {
|
||||||
|
req := y.client.R().SetQueryParams(clientSuffix())
|
||||||
|
|
||||||
|
if params != nil {
|
||||||
|
req.SetQueryParams(params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Signature
|
||||||
|
req.SetHeaders(y.SignatureHeader(url, method, isBool(isFamily...)))
|
||||||
|
|
||||||
|
var erron RespErr
|
||||||
|
req.SetError(&erron)
|
||||||
|
|
||||||
|
if callback != nil {
|
||||||
|
callback(req)
|
||||||
|
}
|
||||||
|
if resp != nil {
|
||||||
|
req.SetResult(resp)
|
||||||
|
}
|
||||||
|
res, err := req.Execute(method, url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Contains(res.String(), "userSessionBO is null") ||
|
||||||
|
strings.Contains(res.String(), "InvalidSessionKey") {
|
||||||
|
return nil, errors.New("session expired")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理错误
|
||||||
|
if erron.HasError() {
|
||||||
|
return nil, &erron
|
||||||
|
}
|
||||||
|
return res.Body(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) get(url string, callback base.ReqCallback, resp interface{}, isFamily ...bool) ([]byte, error) {
|
||||||
|
return y.request(url, http.MethodGet, callback, nil, resp, isFamily...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) post(url string, callback base.ReqCallback, resp interface{}, isFamily ...bool) ([]byte, error) {
|
||||||
|
return y.request(url, http.MethodPost, callback, nil, resp, isFamily...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) put(ctx context.Context, url string, headers map[string]string, sign bool, file io.Reader, isFamily bool) ([]byte, error) {
|
||||||
|
req, err := http.NewRequestWithContext(ctx, http.MethodPut, url, file)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
query := req.URL.Query()
|
||||||
|
for key, value := range clientSuffix() {
|
||||||
|
query.Add(key, value)
|
||||||
|
}
|
||||||
|
req.URL.RawQuery = query.Encode()
|
||||||
|
|
||||||
|
for key, value := range headers {
|
||||||
|
req.Header.Add(key, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
if sign {
|
||||||
|
for key, value := range y.SignatureHeader(url, http.MethodPut, isFamily) {
|
||||||
|
req.Header.Add(key, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := base.HttpClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
body, err := io.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var erron RespErr
|
||||||
|
jsoniter.Unmarshal(body, &erron)
|
||||||
|
xml.Unmarshal(body, &erron)
|
||||||
|
if erron.HasError() {
|
||||||
|
return nil, &erron
|
||||||
|
}
|
||||||
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
return nil, errors.Errorf("put fail,err:%s", string(body))
|
||||||
|
}
|
||||||
|
return body, nil
|
||||||
|
}
|
||||||
|
func (y *Cloud189TV) getFiles(ctx context.Context, fileId string, isFamily bool) ([]model.Obj, error) {
|
||||||
|
fullUrl := ApiUrl
|
||||||
|
if isFamily {
|
||||||
|
fullUrl += "/family/file"
|
||||||
|
}
|
||||||
|
fullUrl += "/listFiles.action"
|
||||||
|
|
||||||
|
res := make([]model.Obj, 0, 130)
|
||||||
|
for pageNum := 1; ; pageNum++ {
|
||||||
|
var resp Cloud189FilesResp
|
||||||
|
_, err := y.get(fullUrl, func(r *resty.Request) {
|
||||||
|
r.SetContext(ctx)
|
||||||
|
r.SetQueryParams(map[string]string{
|
||||||
|
"folderId": fileId,
|
||||||
|
"fileType": "0",
|
||||||
|
"mediaAttr": "0",
|
||||||
|
"iconOption": "5",
|
||||||
|
"pageNum": fmt.Sprint(pageNum),
|
||||||
|
"pageSize": "130",
|
||||||
|
})
|
||||||
|
if isFamily {
|
||||||
|
r.SetQueryParams(map[string]string{
|
||||||
|
"familyId": y.FamilyID,
|
||||||
|
"orderBy": toFamilyOrderBy(y.OrderBy),
|
||||||
|
"descending": toDesc(y.OrderDirection),
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
r.SetQueryParams(map[string]string{
|
||||||
|
"recursive": "0",
|
||||||
|
"orderBy": y.OrderBy,
|
||||||
|
"descending": toDesc(y.OrderDirection),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, &resp, isFamily)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// 获取完毕跳出
|
||||||
|
if resp.FileListAO.Count == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(resp.FileListAO.FolderList); i++ {
|
||||||
|
res = append(res, &resp.FileListAO.FolderList[i])
|
||||||
|
}
|
||||||
|
for i := 0; i < len(resp.FileListAO.FileList); i++ {
|
||||||
|
res = append(res, &resp.FileListAO.FileList[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) login() (err error) {
|
||||||
|
req := y.client.R().SetQueryParams(clientSuffix())
|
||||||
|
var erron RespErr
|
||||||
|
var tokenInfo AppSessionResp
|
||||||
|
if y.Addition.AccessToken == "" {
|
||||||
|
if y.Addition.TempUuid == "" {
|
||||||
|
// 获取登录参数
|
||||||
|
var uuidInfo UuidInfoResp
|
||||||
|
req.SetResult(&uuidInfo).SetError(&erron)
|
||||||
|
// Signature
|
||||||
|
req.SetHeaders(y.AppKeySignatureHeader(ApiUrl+"/family/manage/getQrCodeUUID.action",
|
||||||
|
http.MethodGet))
|
||||||
|
_, err = req.Execute(http.MethodGet, ApiUrl+"/family/manage/getQrCodeUUID.action")
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if erron.HasError() {
|
||||||
|
return &erron
|
||||||
|
}
|
||||||
|
|
||||||
|
if uuidInfo.Uuid == "" {
|
||||||
|
return errors.New("uuidInfo is empty")
|
||||||
|
}
|
||||||
|
y.Addition.TempUuid = uuidInfo.Uuid
|
||||||
|
op.MustSaveDriverStorage(y)
|
||||||
|
|
||||||
|
// 展示二维码
|
||||||
|
qrTemplate := `<body>
|
||||||
|
<img src="data:image/jpeg;base64,%s"/>
|
||||||
|
<br>Or Click here: <a href="%s">%s</a>
|
||||||
|
</body>`
|
||||||
|
|
||||||
|
// Generate QR code
|
||||||
|
qrCode, err := qrcode.Encode(uuidInfo.Uuid, qrcode.Medium, 256)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to generate QR code: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Encode QR code to base64
|
||||||
|
qrCodeBase64 := base64.StdEncoding.EncodeToString(qrCode)
|
||||||
|
|
||||||
|
// Create the HTML page
|
||||||
|
qrPage := fmt.Sprintf(qrTemplate, qrCodeBase64, uuidInfo.Uuid, uuidInfo.Uuid)
|
||||||
|
return fmt.Errorf("need verify: \n%s", qrPage)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var accessTokenResp E189AccessTokenResp
|
||||||
|
req.SetResult(&accessTokenResp).SetError(&erron)
|
||||||
|
// Signature
|
||||||
|
req.SetHeaders(y.AppKeySignatureHeader(ApiUrl+"/family/manage/qrcodeLoginResult.action",
|
||||||
|
http.MethodGet))
|
||||||
|
req.SetQueryParam("uuid", y.Addition.TempUuid)
|
||||||
|
_, err = req.Execute(http.MethodGet, ApiUrl+"/family/manage/qrcodeLoginResult.action")
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if erron.HasError() {
|
||||||
|
return &erron
|
||||||
|
}
|
||||||
|
if accessTokenResp.E189AccessToken == "" {
|
||||||
|
return errors.New("E189AccessToken is empty")
|
||||||
|
}
|
||||||
|
y.Addition.AccessToken = accessTokenResp.E189AccessToken
|
||||||
|
y.Addition.TempUuid = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取SessionKey 和 SessionSecret
|
||||||
|
reqb := y.client.R().SetQueryParams(clientSuffix())
|
||||||
|
reqb.SetResult(&tokenInfo).SetError(&erron)
|
||||||
|
// Signature
|
||||||
|
reqb.SetHeaders(y.AppKeySignatureHeader(ApiUrl+"/family/manage/loginFamilyMerge.action",
|
||||||
|
http.MethodGet))
|
||||||
|
reqb.SetQueryParam("e189AccessToken", y.Addition.AccessToken)
|
||||||
|
_, err = reqb.Execute(http.MethodGet, ApiUrl+"/family/manage/loginFamilyMerge.action")
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if erron.HasError() {
|
||||||
|
return &erron
|
||||||
|
}
|
||||||
|
|
||||||
|
y.tokenInfo = &tokenInfo
|
||||||
|
op.MustSaveDriverStorage(y)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) RapidUpload(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, isFamily bool, overwrite bool) (model.Obj, error) {
|
||||||
|
fileMd5 := stream.GetHash().GetHash(utils.MD5)
|
||||||
|
if len(fileMd5) < utils.MD5.Width {
|
||||||
|
return nil, errors.New("invalid hash")
|
||||||
|
}
|
||||||
|
|
||||||
|
uploadInfo, err := y.OldUploadCreate(ctx, dstDir.GetID(), fileMd5, stream.GetName(), fmt.Sprint(stream.GetSize()), isFamily)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if uploadInfo.FileDataExists != 1 {
|
||||||
|
return nil, errors.New("rapid upload fail")
|
||||||
|
}
|
||||||
|
|
||||||
|
return y.OldUploadCommit(ctx, uploadInfo.FileCommitUrl, uploadInfo.UploadFileId, isFamily, overwrite)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 旧版本上传,家庭云不支持覆盖
|
||||||
|
func (y *Cloud189TV) OldUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress, isFamily bool, overwrite bool) (model.Obj, error) {
|
||||||
|
tempFile, err := file.CacheFullInTempFile()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
fileMd5, err := utils.HashFile(utils.MD5, tempFile)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建上传会话
|
||||||
|
uploadInfo, err := y.OldUploadCreate(ctx, dstDir.GetID(), fileMd5, file.GetName(), fmt.Sprint(file.GetSize()), isFamily)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 网盘中不存在该文件,开始上传
|
||||||
|
status := GetUploadFileStatusResp{CreateUploadFileResp: *uploadInfo}
|
||||||
|
for status.GetSize() < file.GetSize() && status.FileDataExists != 1 {
|
||||||
|
if utils.IsCanceled(ctx) {
|
||||||
|
return nil, ctx.Err()
|
||||||
|
}
|
||||||
|
|
||||||
|
header := map[string]string{
|
||||||
|
"ResumePolicy": "1",
|
||||||
|
"Expect": "100-continue",
|
||||||
|
}
|
||||||
|
|
||||||
|
if isFamily {
|
||||||
|
header["FamilyId"] = fmt.Sprint(y.FamilyID)
|
||||||
|
header["UploadFileId"] = fmt.Sprint(status.UploadFileId)
|
||||||
|
} else {
|
||||||
|
header["Edrive-UploadFileId"] = fmt.Sprint(status.UploadFileId)
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := y.put(ctx, status.FileUploadUrl, header, true, io.NopCloser(tempFile), isFamily)
|
||||||
|
if err, ok := err.(*RespErr); ok && err.Code != "InputStreamReadError" {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取断点状态
|
||||||
|
fullUrl := ApiUrl + "/getUploadFileStatus.action"
|
||||||
|
if y.isFamily() {
|
||||||
|
fullUrl = ApiUrl + "/family/file/getFamilyFileStatus.action"
|
||||||
|
}
|
||||||
|
_, err = y.get(fullUrl, func(req *resty.Request) {
|
||||||
|
req.SetContext(ctx).SetQueryParams(map[string]string{
|
||||||
|
"uploadFileId": fmt.Sprint(status.UploadFileId),
|
||||||
|
"resumePolicy": "1",
|
||||||
|
})
|
||||||
|
if isFamily {
|
||||||
|
req.SetQueryParam("familyId", fmt.Sprint(y.FamilyID))
|
||||||
|
}
|
||||||
|
}, &status, isFamily)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if _, err := tempFile.Seek(status.GetSize(), io.SeekStart); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
up(float64(status.GetSize()) / float64(file.GetSize()) * 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
return y.OldUploadCommit(ctx, status.FileCommitUrl, status.UploadFileId, isFamily, overwrite)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建上传会话
|
||||||
|
func (y *Cloud189TV) OldUploadCreate(ctx context.Context, parentID string, fileMd5, fileName, fileSize string, isFamily bool) (*CreateUploadFileResp, error) {
|
||||||
|
var uploadInfo CreateUploadFileResp
|
||||||
|
|
||||||
|
fullUrl := ApiUrl + "/createUploadFile.action"
|
||||||
|
if isFamily {
|
||||||
|
fullUrl = ApiUrl + "/family/file/createFamilyFile.action"
|
||||||
|
}
|
||||||
|
_, err := y.post(fullUrl, func(req *resty.Request) {
|
||||||
|
req.SetContext(ctx)
|
||||||
|
if isFamily {
|
||||||
|
req.SetQueryParams(map[string]string{
|
||||||
|
"familyId": y.FamilyID,
|
||||||
|
"parentId": parentID,
|
||||||
|
"fileMd5": fileMd5,
|
||||||
|
"fileName": fileName,
|
||||||
|
"fileSize": fileSize,
|
||||||
|
"resumePolicy": "1",
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
req.SetFormData(map[string]string{
|
||||||
|
"parentFolderId": parentID,
|
||||||
|
"fileName": fileName,
|
||||||
|
"size": fileSize,
|
||||||
|
"md5": fileMd5,
|
||||||
|
"opertype": "3",
|
||||||
|
"flag": "1",
|
||||||
|
"resumePolicy": "1",
|
||||||
|
"isLog": "0",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, &uploadInfo, isFamily)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &uploadInfo, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交上传文件
|
||||||
|
func (y *Cloud189TV) OldUploadCommit(ctx context.Context, fileCommitUrl string, uploadFileID int64, isFamily bool, overwrite bool) (model.Obj, error) {
|
||||||
|
var resp OldCommitUploadFileResp
|
||||||
|
_, err := y.post(fileCommitUrl, func(req *resty.Request) {
|
||||||
|
req.SetContext(ctx)
|
||||||
|
if isFamily {
|
||||||
|
req.SetHeaders(map[string]string{
|
||||||
|
"ResumePolicy": "1",
|
||||||
|
"UploadFileId": fmt.Sprint(uploadFileID),
|
||||||
|
"FamilyId": fmt.Sprint(y.FamilyID),
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
req.SetFormData(map[string]string{
|
||||||
|
"opertype": IF(overwrite, "3", "1"),
|
||||||
|
"resumePolicy": "1",
|
||||||
|
"uploadFileId": fmt.Sprint(uploadFileID),
|
||||||
|
"isLog": "0",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, &resp, isFamily)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return resp.toFile(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) isFamily() bool {
|
||||||
|
return y.Type == "family"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) isLogin() bool {
|
||||||
|
if y.tokenInfo == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
_, err := y.get(ApiUrl+"/getUserInfo.action", nil, nil)
|
||||||
|
return err == nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取家庭云所有用户信息
|
||||||
|
func (y *Cloud189TV) getFamilyInfoList() ([]FamilyInfoResp, error) {
|
||||||
|
var resp FamilyInfoListResp
|
||||||
|
_, err := y.get(ApiUrl+"/family/manage/getFamilyList.action", nil, &resp, true)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return resp.FamilyInfoResp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 抽取家庭云ID
|
||||||
|
func (y *Cloud189TV) getFamilyID() (string, error) {
|
||||||
|
infos, err := y.getFamilyInfoList()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
if len(infos) == 0 {
|
||||||
|
return "", fmt.Errorf("cannot get automatically,please input family_id")
|
||||||
|
}
|
||||||
|
for _, info := range infos {
|
||||||
|
if strings.Contains(y.tokenInfo.LoginName, info.RemarkName) {
|
||||||
|
return fmt.Sprint(info.FamilyID), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fmt.Sprint(infos[0].FamilyID), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (y *Cloud189TV) CreateBatchTask(aType string, familyID string, targetFolderId string, other map[string]string, taskInfos ...BatchTaskInfo) (*CreateBatchTaskResp, error) {
|
||||||
|
var resp CreateBatchTaskResp
|
||||||
|
_, err := y.post(ApiUrl+"/batch/createBatchTask.action", func(req *resty.Request) {
|
||||||
|
req.SetFormData(map[string]string{
|
||||||
|
"type": aType,
|
||||||
|
"taskInfos": MustString(utils.Json.MarshalToString(taskInfos)),
|
||||||
|
})
|
||||||
|
if targetFolderId != "" {
|
||||||
|
req.SetFormData(map[string]string{"targetFolderId": targetFolderId})
|
||||||
|
}
|
||||||
|
if familyID != "" {
|
||||||
|
req.SetFormData(map[string]string{"familyId": familyID})
|
||||||
|
}
|
||||||
|
req.SetFormData(other)
|
||||||
|
}, &resp, familyID != "")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检测任务状态
|
||||||
|
func (y *Cloud189TV) CheckBatchTask(aType string, taskID string) (*BatchTaskStateResp, error) {
|
||||||
|
var resp BatchTaskStateResp
|
||||||
|
_, err := y.post(ApiUrl+"/batch/checkBatchTask.action", func(req *resty.Request) {
|
||||||
|
req.SetFormData(map[string]string{
|
||||||
|
"type": aType,
|
||||||
|
"taskId": taskID,
|
||||||
|
})
|
||||||
|
}, &resp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取冲突的任务信息
|
||||||
|
func (y *Cloud189TV) GetConflictTaskInfo(aType string, taskID string) (*BatchTaskConflictTaskInfoResp, error) {
|
||||||
|
var resp BatchTaskConflictTaskInfoResp
|
||||||
|
_, err := y.post(ApiUrl+"/batch/getConflictTaskInfo.action", func(req *resty.Request) {
|
||||||
|
req.SetFormData(map[string]string{
|
||||||
|
"type": aType,
|
||||||
|
"taskId": taskID,
|
||||||
|
})
|
||||||
|
}, &resp)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理冲突
|
||||||
|
func (y *Cloud189TV) ManageBatchTask(aType string, taskID string, targetFolderId string, taskInfos ...BatchTaskInfo) error {
|
||||||
|
_, err := y.post(ApiUrl+"/batch/manageBatchTask.action", func(req *resty.Request) {
|
||||||
|
req.SetFormData(map[string]string{
|
||||||
|
"targetFolderId": targetFolderId,
|
||||||
|
"type": aType,
|
||||||
|
"taskId": taskID,
|
||||||
|
"taskInfos": MustString(utils.Json.MarshalToString(taskInfos)),
|
||||||
|
})
|
||||||
|
}, nil)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var ErrIsConflict = errors.New("there is a conflict with the target object")
|
||||||
|
|
||||||
|
// 等待任务完成
|
||||||
|
func (y *Cloud189TV) WaitBatchTask(aType string, taskID string, t time.Duration) error {
|
||||||
|
for {
|
||||||
|
state, err := y.CheckBatchTask(aType, taskID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
switch state.TaskStatus {
|
||||||
|
case 2:
|
||||||
|
return ErrIsConflict
|
||||||
|
case 4:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
time.Sleep(t)
|
||||||
|
}
|
||||||
|
}
|
@ -322,7 +322,7 @@ func (y *Cloud189PC) login() (err error) {
|
|||||||
_, err = y.client.R().
|
_, err = y.client.R().
|
||||||
SetResult(&tokenInfo).SetError(&erron).
|
SetResult(&tokenInfo).SetError(&erron).
|
||||||
SetQueryParams(clientSuffix()).
|
SetQueryParams(clientSuffix()).
|
||||||
SetQueryParam("redirectURL", url.QueryEscape(loginresp.ToUrl)).
|
SetQueryParam("redirectURL", loginresp.ToUrl).
|
||||||
Post(API_URL + "/getSessionForPC.action")
|
Post(API_URL + "/getSessionForPC.action")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
_ "github.com/OpenListTeam/OpenList/drivers/123_share"
|
_ "github.com/OpenListTeam/OpenList/drivers/123_share"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/139"
|
_ "github.com/OpenListTeam/OpenList/drivers/139"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/189"
|
_ "github.com/OpenListTeam/OpenList/drivers/189"
|
||||||
|
_ "github.com/OpenListTeam/OpenList/drivers/189_tv"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/189pc"
|
_ "github.com/OpenListTeam/OpenList/drivers/189pc"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/alias"
|
_ "github.com/OpenListTeam/OpenList/drivers/alias"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/aliyundrive"
|
_ "github.com/OpenListTeam/OpenList/drivers/aliyundrive"
|
||||||
@ -18,7 +19,6 @@ import (
|
|||||||
_ "github.com/OpenListTeam/OpenList/drivers/azure_blob"
|
_ "github.com/OpenListTeam/OpenList/drivers/azure_blob"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/baidu_netdisk"
|
_ "github.com/OpenListTeam/OpenList/drivers/baidu_netdisk"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/baidu_photo"
|
_ "github.com/OpenListTeam/OpenList/drivers/baidu_photo"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/baidu_share"
|
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/chaoxing"
|
_ "github.com/OpenListTeam/OpenList/drivers/chaoxing"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/cloudreve"
|
_ "github.com/OpenListTeam/OpenList/drivers/cloudreve"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/cloudreve_v4"
|
_ "github.com/OpenListTeam/OpenList/drivers/cloudreve_v4"
|
||||||
|
@ -1,251 +0,0 @@
|
|||||||
package baidu_share
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"path"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/OpenListTeam/OpenList/internal/driver"
|
|
||||||
"github.com/OpenListTeam/OpenList/internal/errs"
|
|
||||||
"github.com/OpenListTeam/OpenList/internal/model"
|
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
type BaiduShare struct {
|
|
||||||
model.Storage
|
|
||||||
Addition
|
|
||||||
client *resty.Client
|
|
||||||
info struct {
|
|
||||||
Root string
|
|
||||||
Seckey string
|
|
||||||
Shareid string
|
|
||||||
Uk string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Config() driver.Config {
|
|
||||||
return config
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) GetAddition() driver.Additional {
|
|
||||||
return &d.Addition
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Init(ctx context.Context) error {
|
|
||||||
// TODO login / refresh token
|
|
||||||
//op.MustSaveDriverStorage(d)
|
|
||||||
d.client = resty.New().
|
|
||||||
SetBaseURL("https://pan.baidu.com").
|
|
||||||
SetHeader("User-Agent", "netdisk").
|
|
||||||
SetCookie(&http.Cookie{Name: "BDUSS", Value: d.BDUSS}).
|
|
||||||
SetCookie(&http.Cookie{Name: "ndut_fmt"})
|
|
||||||
respJson := struct {
|
|
||||||
Errno int64 `json:"errno"`
|
|
||||||
Data struct {
|
|
||||||
List [1]struct {
|
|
||||||
Path string `json:"path"`
|
|
||||||
} `json:"list"`
|
|
||||||
Uk json.Number `json:"uk"`
|
|
||||||
Shareid json.Number `json:"shareid"`
|
|
||||||
Seckey string `json:"seckey"`
|
|
||||||
} `json:"data"`
|
|
||||||
}{}
|
|
||||||
resp, err := d.client.R().
|
|
||||||
SetBody(url.Values{
|
|
||||||
"pwd": {d.Pwd},
|
|
||||||
"root": {"1"},
|
|
||||||
"shorturl": {d.Surl},
|
|
||||||
}.Encode()).
|
|
||||||
SetResult(&respJson).
|
|
||||||
Post("share/wxlist?channel=weixin&version=2.2.2&clienttype=25&web=1")
|
|
||||||
if err == nil {
|
|
||||||
if resp.IsSuccess() && respJson.Errno == 0 {
|
|
||||||
d.info.Root = path.Dir(respJson.Data.List[0].Path)
|
|
||||||
d.info.Seckey = respJson.Data.Seckey
|
|
||||||
d.info.Shareid = respJson.Data.Shareid.String()
|
|
||||||
d.info.Uk = respJson.Data.Uk.String()
|
|
||||||
} else {
|
|
||||||
err = fmt.Errorf(" %s; %s; ", resp.Status(), resp.Body())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Drop(ctx context.Context) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
|
|
||||||
// TODO return the files list, required
|
|
||||||
reqDir := dir.GetPath()
|
|
||||||
isRoot := "0"
|
|
||||||
if reqDir == d.RootFolderPath {
|
|
||||||
reqDir = path.Join(d.info.Root, reqDir)
|
|
||||||
}
|
|
||||||
if reqDir == d.info.Root {
|
|
||||||
isRoot = "1"
|
|
||||||
}
|
|
||||||
objs := []model.Obj{}
|
|
||||||
var err error
|
|
||||||
var page uint64 = 1
|
|
||||||
more := true
|
|
||||||
for more && err == nil {
|
|
||||||
respJson := struct {
|
|
||||||
Errno int64 `json:"errno"`
|
|
||||||
Data struct {
|
|
||||||
More bool `json:"has_more"`
|
|
||||||
List []struct {
|
|
||||||
Fsid json.Number `json:"fs_id"`
|
|
||||||
Isdir json.Number `json:"isdir"`
|
|
||||||
Path string `json:"path"`
|
|
||||||
Name string `json:"server_filename"`
|
|
||||||
Mtime json.Number `json:"server_mtime"`
|
|
||||||
Size json.Number `json:"size"`
|
|
||||||
} `json:"list"`
|
|
||||||
} `json:"data"`
|
|
||||||
}{}
|
|
||||||
resp, e := d.client.R().
|
|
||||||
SetBody(url.Values{
|
|
||||||
"dir": {reqDir},
|
|
||||||
"num": {"1000"},
|
|
||||||
"order": {"time"},
|
|
||||||
"page": {fmt.Sprint(page)},
|
|
||||||
"pwd": {d.Pwd},
|
|
||||||
"root": {isRoot},
|
|
||||||
"shorturl": {d.Surl},
|
|
||||||
}.Encode()).
|
|
||||||
SetResult(&respJson).
|
|
||||||
Post("share/wxlist?channel=weixin&version=2.2.2&clienttype=25&web=1")
|
|
||||||
err = e
|
|
||||||
if err == nil {
|
|
||||||
if resp.IsSuccess() && respJson.Errno == 0 {
|
|
||||||
page++
|
|
||||||
more = respJson.Data.More
|
|
||||||
for _, v := range respJson.Data.List {
|
|
||||||
size, _ := v.Size.Int64()
|
|
||||||
mtime, _ := v.Mtime.Int64()
|
|
||||||
objs = append(objs, &model.Object{
|
|
||||||
ID: v.Fsid.String(),
|
|
||||||
Path: v.Path,
|
|
||||||
Name: v.Name,
|
|
||||||
Size: size,
|
|
||||||
Modified: time.Unix(mtime, 0),
|
|
||||||
IsFolder: v.Isdir.String() == "1",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err = fmt.Errorf(" %s; %s; ", resp.Status(), resp.Body())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return objs, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
|
|
||||||
// TODO return link of file, required
|
|
||||||
link := model.Link{Header: d.client.Header}
|
|
||||||
sign := ""
|
|
||||||
stamp := ""
|
|
||||||
signJson := struct {
|
|
||||||
Errno int64 `json:"errno"`
|
|
||||||
Data struct {
|
|
||||||
Stamp json.Number `json:"timestamp"`
|
|
||||||
Sign string `json:"sign"`
|
|
||||||
} `json:"data"`
|
|
||||||
}{}
|
|
||||||
resp, err := d.client.R().
|
|
||||||
SetQueryParam("surl", d.Surl).
|
|
||||||
SetResult(&signJson).
|
|
||||||
Get("share/tplconfig?fields=sign,timestamp&channel=chunlei&web=1&app_id=250528&clienttype=0")
|
|
||||||
if err == nil {
|
|
||||||
if resp.IsSuccess() && signJson.Errno == 0 {
|
|
||||||
stamp = signJson.Data.Stamp.String()
|
|
||||||
sign = signJson.Data.Sign
|
|
||||||
} else {
|
|
||||||
err = fmt.Errorf(" %s; %s; ", resp.Status(), resp.Body())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err == nil {
|
|
||||||
respJson := struct {
|
|
||||||
Errno int64 `json:"errno"`
|
|
||||||
List [1]struct {
|
|
||||||
Dlink string `json:"dlink"`
|
|
||||||
} `json:"list"`
|
|
||||||
}{}
|
|
||||||
resp, err = d.client.R().
|
|
||||||
SetQueryParam("sign", sign).
|
|
||||||
SetQueryParam("timestamp", stamp).
|
|
||||||
SetBody(url.Values{
|
|
||||||
"encrypt": {"0"},
|
|
||||||
"extra": {fmt.Sprintf(`{"sekey":"%s"}`, d.info.Seckey)},
|
|
||||||
"fid_list": {fmt.Sprintf("[%s]", file.GetID())},
|
|
||||||
"primaryid": {d.info.Shareid},
|
|
||||||
"product": {"share"},
|
|
||||||
"type": {"nolimit"},
|
|
||||||
"uk": {d.info.Uk},
|
|
||||||
}.Encode()).
|
|
||||||
SetResult(&respJson).
|
|
||||||
Post("api/sharedownload?app_id=250528&channel=chunlei&clienttype=12&web=1")
|
|
||||||
if err == nil {
|
|
||||||
if resp.IsSuccess() && respJson.Errno == 0 && respJson.List[0].Dlink != "" {
|
|
||||||
link.URL = respJson.List[0].Dlink
|
|
||||||
} else {
|
|
||||||
err = fmt.Errorf(" %s; %s; ", resp.Status(), resp.Body())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err == nil {
|
|
||||||
resp, err = d.client.R().
|
|
||||||
SetDoNotParseResponse(true).
|
|
||||||
Get(link.URL)
|
|
||||||
if err == nil {
|
|
||||||
defer resp.RawBody().Close()
|
|
||||||
if resp.IsError() {
|
|
||||||
byt, _ := io.ReadAll(resp.RawBody())
|
|
||||||
err = fmt.Errorf(" %s; %s; ", resp.Status(), byt)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return &link, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
|
|
||||||
// TODO create folder, optional
|
|
||||||
return errs.NotSupport
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
|
|
||||||
// TODO move obj, optional
|
|
||||||
return errs.NotSupport
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Rename(ctx context.Context, srcObj model.Obj, newName string) error {
|
|
||||||
// TODO rename obj, optional
|
|
||||||
return errs.NotSupport
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
|
|
||||||
// TODO copy obj, optional
|
|
||||||
return errs.NotSupport
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Remove(ctx context.Context, obj model.Obj) error {
|
|
||||||
// TODO remove obj, optional
|
|
||||||
return errs.NotSupport
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *BaiduShare) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error {
|
|
||||||
// TODO upload file, optional
|
|
||||||
return errs.NotSupport
|
|
||||||
}
|
|
||||||
|
|
||||||
//func (d *Template) Other(ctx context.Context, args model.OtherArgs) (interface{}, error) {
|
|
||||||
// return nil, errs.NotSupport
|
|
||||||
//}
|
|
||||||
|
|
||||||
var _ driver.Driver = (*BaiduShare)(nil)
|
|
@ -1,37 +0,0 @@
|
|||||||
package baidu_share
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/OpenListTeam/OpenList/internal/driver"
|
|
||||||
"github.com/OpenListTeam/OpenList/internal/op"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Addition struct {
|
|
||||||
// Usually one of two
|
|
||||||
driver.RootPath
|
|
||||||
// driver.RootID
|
|
||||||
// define other
|
|
||||||
// Field string `json:"field" type:"select" required:"true" options:"a,b,c" default:"a"`
|
|
||||||
Surl string `json:"surl"`
|
|
||||||
Pwd string `json:"pwd"`
|
|
||||||
BDUSS string `json:"BDUSS"`
|
|
||||||
}
|
|
||||||
|
|
||||||
var config = driver.Config{
|
|
||||||
Name: "BaiduShare",
|
|
||||||
LocalSort: true,
|
|
||||||
OnlyLocal: false,
|
|
||||||
OnlyProxy: false,
|
|
||||||
NoCache: false,
|
|
||||||
NoUpload: true,
|
|
||||||
NeedMs: false,
|
|
||||||
DefaultRoot: "/",
|
|
||||||
CheckStatus: false,
|
|
||||||
Alert: "",
|
|
||||||
NoOverwriteUpload: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
op.RegisterDriver(func() driver.Driver {
|
|
||||||
return &BaiduShare{}
|
|
||||||
})
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
package baidu_share
|
|
@ -1,3 +0,0 @@
|
|||||||
package baidu_share
|
|
||||||
|
|
||||||
// do others that not defined in Driver interface
|
|
@ -145,7 +145,7 @@ func (d *Doubao) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 生成标准的Content-Disposition
|
// 生成标准的Content-Disposition
|
||||||
contentDisposition := generateContentDisposition(u.Name)
|
contentDisposition := utils.GenerateContentDisposition(u.Name)
|
||||||
|
|
||||||
return &model.Link{
|
return &model.Link{
|
||||||
URL: downloadUrl,
|
URL: downloadUrl,
|
||||||
|
@ -926,36 +926,6 @@ func getSigningKey(secretKey, dateStamp, region, service string) []byte {
|
|||||||
return kSigning
|
return kSigning
|
||||||
}
|
}
|
||||||
|
|
||||||
// generateContentDisposition 生成符合RFC 5987标准的Content-Disposition头部
|
|
||||||
func generateContentDisposition(filename string) string {
|
|
||||||
// 按照RFC 2047进行编码,用于filename部分
|
|
||||||
encodedName := urlEncode(filename)
|
|
||||||
|
|
||||||
// 按照RFC 5987进行编码,用于filename*部分
|
|
||||||
encodedNameRFC5987 := encodeRFC5987(filename)
|
|
||||||
|
|
||||||
return fmt.Sprintf("attachment; filename=\"%s\"; filename*=utf-8''%s",
|
|
||||||
encodedName, encodedNameRFC5987)
|
|
||||||
}
|
|
||||||
|
|
||||||
// encodeRFC5987 按照RFC 5987规范编码字符串,适用于HTTP头部参数中的非ASCII字符
|
|
||||||
func encodeRFC5987(s string) string {
|
|
||||||
var buf strings.Builder
|
|
||||||
for _, r := range []byte(s) {
|
|
||||||
// 根据RFC 5987,只有字母、数字和部分特殊符号可以不编码
|
|
||||||
if (r >= 'a' && r <= 'z') ||
|
|
||||||
(r >= 'A' && r <= 'Z') ||
|
|
||||||
(r >= '0' && r <= '9') ||
|
|
||||||
r == '-' || r == '.' || r == '_' || r == '~' {
|
|
||||||
buf.WriteByte(r)
|
|
||||||
} else {
|
|
||||||
// 其他字符都需要百分号编码
|
|
||||||
fmt.Fprintf(&buf, "%%%02X", r)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return buf.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func randomString() string {
|
func randomString() string {
|
||||||
const charset = "0123456789abcdefghijklmnopqrstuvwxyz"
|
const charset = "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||||
const length = 11 // 11位随机字符串
|
const length = 11 // 11位随机字符串
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/OpenListTeam/OpenList/internal/driver"
|
"github.com/OpenListTeam/OpenList/internal/driver"
|
||||||
"github.com/OpenListTeam/OpenList/internal/errs"
|
"github.com/OpenListTeam/OpenList/internal/errs"
|
||||||
"github.com/OpenListTeam/OpenList/internal/model"
|
"github.com/OpenListTeam/OpenList/internal/model"
|
||||||
|
"github.com/OpenListTeam/OpenList/pkg/utils"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ func (d *DoubaoShare) Link(ctx context.Context, file model.Obj, args model.LinkA
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 生成标准的Content-Disposition
|
// 生成标准的Content-Disposition
|
||||||
contentDisposition := generateContentDisposition(u.Name)
|
contentDisposition := utils.GenerateContentDisposition(u.Name)
|
||||||
|
|
||||||
return &model.Link{
|
return &model.Link{
|
||||||
URL: downloadUrl,
|
URL: downloadUrl,
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
|
||||||
"path"
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@ -707,39 +706,3 @@ func (d *DoubaoShare) listVirtualDirectoryContent(dir model.Obj) ([]model.Obj, e
|
|||||||
|
|
||||||
return objects, nil
|
return objects, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// generateContentDisposition 生成符合RFC 5987标准的Content-Disposition头部
|
|
||||||
func generateContentDisposition(filename string) string {
|
|
||||||
// 按照RFC 2047进行编码,用于filename部分
|
|
||||||
encodedName := urlEncode(filename)
|
|
||||||
|
|
||||||
// 按照RFC 5987进行编码,用于filename*部分
|
|
||||||
encodedNameRFC5987 := encodeRFC5987(filename)
|
|
||||||
|
|
||||||
return fmt.Sprintf("attachment; filename=\"%s\"; filename*=utf-8''%s",
|
|
||||||
encodedName, encodedNameRFC5987)
|
|
||||||
}
|
|
||||||
|
|
||||||
// encodeRFC5987 按照RFC 5987规范编码字符串,适用于HTTP头部参数中的非ASCII字符
|
|
||||||
func encodeRFC5987(s string) string {
|
|
||||||
var buf strings.Builder
|
|
||||||
for _, r := range []byte(s) {
|
|
||||||
// 根据RFC 5987,只有字母、数字和部分特殊符号可以不编码
|
|
||||||
if (r >= 'a' && r <= 'z') ||
|
|
||||||
(r >= 'A' && r <= 'Z') ||
|
|
||||||
(r >= '0' && r <= '9') ||
|
|
||||||
r == '-' || r == '.' || r == '_' || r == '~' {
|
|
||||||
buf.WriteByte(r)
|
|
||||||
} else {
|
|
||||||
// 其他字符都需要百分号编码
|
|
||||||
fmt.Fprintf(&buf, "%%%02X", r)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return buf.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func urlEncode(s string) string {
|
|
||||||
s = url.QueryEscape(s)
|
|
||||||
s = strings.ReplaceAll(s, "+", "%20")
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
@ -34,7 +34,19 @@ func (d *QuarkOpen) GetAddition() driver.Additional {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *QuarkOpen) Init(ctx context.Context) error {
|
func (d *QuarkOpen) Init(ctx context.Context) error {
|
||||||
_, err := d.request(ctx, "/open/v1/user/info", http.MethodGet, nil, nil)
|
var resp UserInfoResp
|
||||||
|
|
||||||
|
_, err := d.request(ctx, "/open/v1/user/info", http.MethodGet, nil, &resp)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.Data.UserID != "" {
|
||||||
|
d.conf.userId = resp.Data.UserID
|
||||||
|
} else {
|
||||||
|
return errors.New("failed to get user ID")
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,6 +173,12 @@ func (d *QuarkOpen) Put(ctx context.Context, dstDir model.Obj, stream model.File
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// 如果预上传已经完成,直接返回--秒传
|
||||||
|
if pre.Data.Finish == true {
|
||||||
|
up(100)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// get part info
|
// get part info
|
||||||
partInfo := d._getPartInfo(stream, pre.Data.PartSize)
|
partInfo := d._getPartInfo(stream, pre.Data.PartSize)
|
||||||
// get upload url info
|
// get upload url info
|
||||||
|
@ -18,8 +18,9 @@ type Addition struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Conf struct {
|
type Conf struct {
|
||||||
ua string
|
ua string
|
||||||
api string
|
api string
|
||||||
|
userId string
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
package quark_open
|
package quark_open
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/OpenListTeam/OpenList/internal/model"
|
"github.com/OpenListTeam/OpenList/internal/model"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Resp struct {
|
type Resp struct {
|
||||||
@ -17,6 +16,17 @@ type CommonRsp struct {
|
|||||||
ReqID string `json:"req_id"`
|
ReqID string `json:"req_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UserInfo struct {
|
||||||
|
UserID string `json:"user_id"`
|
||||||
|
Nickname string `json:"nickname"`
|
||||||
|
AvatarURL string `json:"avatar_url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UserInfoResp struct {
|
||||||
|
CommonRsp
|
||||||
|
Data UserInfo `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
type RefreshTokenOnlineAPIResp struct {
|
type RefreshTokenOnlineAPIResp struct {
|
||||||
RefreshToken string `json:"refresh_token"`
|
RefreshToken string `json:"refresh_token"`
|
||||||
AccessToken string `json:"access_token"`
|
AccessToken string `json:"access_token"`
|
||||||
@ -38,13 +48,17 @@ type File struct {
|
|||||||
UpdatedAt int64 `json:"updated_at"`
|
UpdatedAt int64 `json:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func fileToObj(f File) *model.Object {
|
func fileToObj(f File) *model.ObjThumb {
|
||||||
return &model.Object{
|
return &model.ObjThumb{
|
||||||
ID: f.Fid,
|
Object: model.Object{
|
||||||
Name: f.FileName,
|
ID: f.Fid,
|
||||||
Size: f.Size,
|
Name: f.FileName,
|
||||||
Modified: time.UnixMilli(f.UpdatedAt),
|
Size: f.Size,
|
||||||
IsFolder: f.FileType == "0",
|
Modified: time.UnixMilli(f.UpdatedAt),
|
||||||
|
IsFolder: f.FileType == "0",
|
||||||
|
Ctime: time.UnixMilli(f.CreatedAt),
|
||||||
|
},
|
||||||
|
Thumbnail: model.Thumbnail{Thumbnail: f.ThumbnailURL},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,14 +2,18 @@ package quark_open
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/md5"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/OpenListTeam/OpenList/pkg/http_range"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/OpenListTeam/OpenList/drivers/base"
|
"github.com/OpenListTeam/OpenList/drivers/base"
|
||||||
@ -19,9 +23,21 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (d *QuarkOpen) request(ctx context.Context, pathname string, method string, callback base.ReqCallback, resp interface{}) ([]byte, error) {
|
func (d *QuarkOpen) request(ctx context.Context, pathname string, method string, callback base.ReqCallback, resp interface{}, manualSign ...*ManualSign) ([]byte, error) {
|
||||||
u := d.conf.api + pathname
|
u := d.conf.api + pathname
|
||||||
tm, token, reqID := d.generateReqSign(method, pathname, d.Addition.SignKey)
|
|
||||||
|
var tm, token, reqID string
|
||||||
|
|
||||||
|
// 检查是否手动传入签名参数
|
||||||
|
if len(manualSign) > 0 && manualSign[0] != nil {
|
||||||
|
tm = manualSign[0].Tm
|
||||||
|
token = manualSign[0].Token
|
||||||
|
reqID = manualSign[0].ReqID
|
||||||
|
} else {
|
||||||
|
// 自动生成签名参数
|
||||||
|
tm, token, reqID = d.generateReqSign(method, pathname, d.Addition.SignKey)
|
||||||
|
}
|
||||||
|
|
||||||
req := base.RestyClient.R()
|
req := base.RestyClient.R()
|
||||||
req.SetContext(ctx)
|
req.SetContext(ctx)
|
||||||
req.SetHeaders(map[string]string{
|
req.SetHeaders(map[string]string{
|
||||||
@ -48,7 +64,7 @@ func (d *QuarkOpen) request(ctx context.Context, pathname string, method string,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// 判断 是否需要 刷新 access_token
|
// 判断 是否需要 刷新 access_token
|
||||||
if e.Status == -1 && (e.Errno == 11001 || e.Errno == 14001) {
|
if e.Status == -1 && (e.Errno == 11001 || (e.Errno == 14001 && strings.Contains(e.ErrorInfo, "access_token"))) {
|
||||||
// token 过期
|
// token 过期
|
||||||
err = d.refreshToken()
|
err = d.refreshToken()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -106,10 +122,25 @@ func (d *QuarkOpen) GetFiles(ctx context.Context, parent string) ([]File, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *QuarkOpen) upPre(ctx context.Context, file model.FileStreamer, parentId, md5, sha1 string) (UpPreResp, error) {
|
func (d *QuarkOpen) upPre(ctx context.Context, file model.FileStreamer, parentId, md5, sha1 string) (UpPreResp, error) {
|
||||||
|
// 获取当前时间
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
// 获取文件大小
|
||||||
|
fileSize := file.GetSize()
|
||||||
|
|
||||||
|
// 手动生成 x-pan-token
|
||||||
|
httpMethod := "POST"
|
||||||
|
apiPath := "/open/v1/file/upload_pre"
|
||||||
|
tm, xPanToken, reqID := d.generateReqSign(httpMethod, apiPath, d.Addition.SignKey)
|
||||||
|
|
||||||
|
// 生成proof相关字段,传入 x-pan-token
|
||||||
|
proofVersion, proofSeed1, proofSeed2, proofCode1, proofCode2, err := d.generateProof(file, xPanToken)
|
||||||
|
if err != nil {
|
||||||
|
return UpPreResp{}, fmt.Errorf("failed to generate proof: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
data := base.Json{
|
data := base.Json{
|
||||||
"file_name": file.GetName(),
|
"file_name": file.GetName(),
|
||||||
"size": file.GetSize(),
|
"size": fileSize,
|
||||||
"format_type": file.GetMimetype(),
|
"format_type": file.GetMimetype(),
|
||||||
"md5": md5,
|
"md5": md5,
|
||||||
"sha1": sha1,
|
"sha1": sha1,
|
||||||
@ -117,15 +148,141 @@ func (d *QuarkOpen) upPre(ctx context.Context, file model.FileStreamer, parentId
|
|||||||
"l_updated_at": now.UnixMilli(),
|
"l_updated_at": now.UnixMilli(),
|
||||||
"pdir_fid": parentId,
|
"pdir_fid": parentId,
|
||||||
"same_path_reuse": true,
|
"same_path_reuse": true,
|
||||||
|
"proof_version": proofVersion,
|
||||||
|
"proof_seed1": proofSeed1,
|
||||||
|
"proof_seed2": proofSeed2,
|
||||||
|
"proof_code1": proofCode1,
|
||||||
|
"proof_code2": proofCode2,
|
||||||
}
|
}
|
||||||
|
|
||||||
var resp UpPreResp
|
var resp UpPreResp
|
||||||
_, err := d.request(ctx, "/open/v1/file/upload_pre", http.MethodPost, func(req *resty.Request) {
|
|
||||||
|
// 使用手动生成的签名参数
|
||||||
|
manualSign := &ManualSign{
|
||||||
|
Tm: tm,
|
||||||
|
Token: xPanToken,
|
||||||
|
ReqID: reqID,
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = d.request(ctx, "/open/v1/file/upload_pre", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(data)
|
req.SetBody(data)
|
||||||
}, &resp)
|
}, &resp, manualSign)
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// generateProof 生成夸克云盘文件上传的proof验证信息
|
||||||
|
func (d *QuarkOpen) generateProof(file model.FileStreamer, xPanToken string) (proofVersion, proofSeed1, proofSeed2, proofCode1, proofCode2 string, err error) {
|
||||||
|
// 获取文件大小
|
||||||
|
fileSize := file.GetSize()
|
||||||
|
// 设置proof_version (固定为"v1")
|
||||||
|
proofVersion = "v1"
|
||||||
|
// 生成proof_seed1 - 算法: md5(userid+x-pan-token)
|
||||||
|
proofSeed1 = d.generateProofSeed1(xPanToken)
|
||||||
|
// 生成proof_seed2 - 算法: md5(fileSize)
|
||||||
|
proofSeed2 = d.generateProofSeed2(fileSize)
|
||||||
|
// 生成proof_code1和proof_code2
|
||||||
|
proofCode1, err = d.generateProofCode(file, proofSeed1, fileSize)
|
||||||
|
if err != nil {
|
||||||
|
return "", "", "", "", "", fmt.Errorf("failed to generate proof_code1: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
proofCode2, err = d.generateProofCode(file, proofSeed2, fileSize)
|
||||||
|
if err != nil {
|
||||||
|
return "", "", "", "", "", fmt.Errorf("failed to generate proof_code2: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return proofVersion, proofSeed1, proofSeed2, proofCode1, proofCode2, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// generateProofSeed1 生成proof_seed1,基于 userId、x-pan-token
|
||||||
|
func (d *QuarkOpen) generateProofSeed1(xPanToken string) string {
|
||||||
|
concatString := d.conf.userId + xPanToken
|
||||||
|
md5Hash := md5.Sum([]byte(concatString))
|
||||||
|
return hex.EncodeToString(md5Hash[:])
|
||||||
|
}
|
||||||
|
|
||||||
|
// generateProofSeed2 生成proof_seed2,基于 fileSize
|
||||||
|
func (d *QuarkOpen) generateProofSeed2(fileSize int64) string {
|
||||||
|
md5Hash := md5.Sum([]byte(strconv.FormatInt(fileSize, 10)))
|
||||||
|
return hex.EncodeToString(md5Hash[:])
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProofRange struct {
|
||||||
|
Start int64
|
||||||
|
End int64
|
||||||
|
}
|
||||||
|
|
||||||
|
// generateProofCode 根据proof_seed和文件大小生成proof_code
|
||||||
|
func (d *QuarkOpen) generateProofCode(file model.FileStreamer, proofSeed string, fileSize int64) (string, error) {
|
||||||
|
// 获取读取范围
|
||||||
|
proofRange, err := d.getProofRange(proofSeed, fileSize)
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("failed to get proof range: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算需要读取的长度
|
||||||
|
length := proofRange.End - proofRange.Start
|
||||||
|
if length == 0 {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用FileStreamer的RangeRead方法读取特定范围的数据
|
||||||
|
reader, err := file.RangeRead(http_range.Range{
|
||||||
|
Start: proofRange.Start,
|
||||||
|
Length: length,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("failed to range read: %w", err)
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if closer, ok := reader.(io.Closer); ok {
|
||||||
|
closer.Close()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// 读取数据
|
||||||
|
buf := make([]byte, length)
|
||||||
|
n, err := io.ReadFull(reader, buf)
|
||||||
|
if errors.Is(err, io.ErrUnexpectedEOF) {
|
||||||
|
return "", fmt.Errorf("can't read data, expected=%d, got=%d", length, n)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("failed to read data: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Base64编码
|
||||||
|
return base64.StdEncoding.EncodeToString(buf), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// getProofRange 根据proof_seed和文件大小计算需要读取的文件范围
|
||||||
|
func (d *QuarkOpen) getProofRange(proofSeed string, fileSize int64) (*ProofRange, error) {
|
||||||
|
if fileSize == 0 {
|
||||||
|
return &ProofRange{}, nil
|
||||||
|
}
|
||||||
|
// 对 proofSeed 进行 MD5 处理,取前16个字符
|
||||||
|
md5Hash := md5.Sum([]byte(proofSeed))
|
||||||
|
tmpStr := hex.EncodeToString(md5Hash[:])[:16]
|
||||||
|
// 转为 uint64
|
||||||
|
tmpInt, err := strconv.ParseUint(tmpStr, 16, 64)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to parse hex string: %w", err)
|
||||||
|
}
|
||||||
|
// 计算索引位置
|
||||||
|
index := tmpInt % uint64(fileSize)
|
||||||
|
|
||||||
|
pr := &ProofRange{
|
||||||
|
Start: int64(index),
|
||||||
|
End: int64(index) + 8,
|
||||||
|
}
|
||||||
|
// 确保 End 不超过文件大小
|
||||||
|
if pr.End > fileSize {
|
||||||
|
pr.End = fileSize
|
||||||
|
}
|
||||||
|
|
||||||
|
return pr, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (d *QuarkOpen) _getPartInfo(stream model.FileStreamer, partSize int64) []base.Json {
|
func (d *QuarkOpen) _getPartInfo(stream model.FileStreamer, partSize int64) []base.Json {
|
||||||
// 计算分片信息
|
// 计算分片信息
|
||||||
partInfo := make([]base.Json, 0)
|
partInfo := make([]base.Json, 0)
|
||||||
@ -239,6 +396,13 @@ func (d *QuarkOpen) upFinish(ctx context.Context, pre UpPreResp, partInfo []base
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ManualSign 用于手动签名URL的结构体
|
||||||
|
type ManualSign struct {
|
||||||
|
Tm string
|
||||||
|
Token string
|
||||||
|
ReqID string
|
||||||
|
}
|
||||||
|
|
||||||
func (d *QuarkOpen) generateReqSign(method string, pathname string, signKey string) (string, string, string) {
|
func (d *QuarkOpen) generateReqSign(method string, pathname string, signKey string) (string, string, string) {
|
||||||
// 生成时间戳 (13位毫秒级)
|
// 生成时间戳 (13位毫秒级)
|
||||||
timestamp := strconv.FormatInt(time.Now().UnixNano()/int64(time.Millisecond), 10)
|
timestamp := strconv.FormatInt(time.Now().UnixNano()/int64(time.Millisecond), 10)
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/OpenListTeam/OpenList/internal/model"
|
"github.com/OpenListTeam/OpenList/internal/model"
|
||||||
"github.com/OpenListTeam/OpenList/internal/stream"
|
"github.com/OpenListTeam/OpenList/internal/stream"
|
||||||
"github.com/OpenListTeam/OpenList/pkg/cron"
|
"github.com/OpenListTeam/OpenList/pkg/cron"
|
||||||
|
"github.com/OpenListTeam/OpenList/pkg/utils"
|
||||||
"github.com/OpenListTeam/OpenList/server/common"
|
"github.com/OpenListTeam/OpenList/server/common"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
"github.com/aws/aws-sdk-go/service/s3"
|
"github.com/aws/aws-sdk-go/service/s3"
|
||||||
@ -81,19 +82,21 @@ func (d *S3) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]mo
|
|||||||
|
|
||||||
func (d *S3) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
|
func (d *S3) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
|
||||||
path := getKey(file.GetPath(), false)
|
path := getKey(file.GetPath(), false)
|
||||||
filename := stdpath.Base(path)
|
fileName := stdpath.Base(path)
|
||||||
disposition := fmt.Sprintf(`attachment; filename*=UTF-8''%s`, url.PathEscape(filename))
|
|
||||||
if d.AddFilenameToDisposition {
|
|
||||||
disposition = fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, filename, url.PathEscape(filename))
|
|
||||||
}
|
|
||||||
input := &s3.GetObjectInput{
|
input := &s3.GetObjectInput{
|
||||||
Bucket: &d.Bucket,
|
Bucket: &d.Bucket,
|
||||||
Key: &path,
|
Key: &path,
|
||||||
//ResponseContentDisposition: &disposition,
|
//ResponseContentDisposition: &disposition,
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.CustomHost == "" {
|
if d.CustomHost == "" {
|
||||||
|
disposition := fmt.Sprintf(`attachment; filename*=UTF-8''%s`, url.PathEscape(fileName))
|
||||||
|
if d.AddFilenameToDisposition {
|
||||||
|
disposition = utils.GenerateContentDisposition(fileName)
|
||||||
|
}
|
||||||
input.ResponseContentDisposition = &disposition
|
input.ResponseContentDisposition = &disposition
|
||||||
}
|
}
|
||||||
|
|
||||||
req, _ := d.linkClient.GetObjectRequest(input)
|
req, _ := d.linkClient.GetObjectRequest(input)
|
||||||
var link model.Link
|
var link model.Link
|
||||||
var err error
|
var err error
|
||||||
@ -108,7 +111,7 @@ func (d *S3) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*mo
|
|||||||
link.URL = strings.Replace(link.URL, "/"+d.Bucket, "", 1)
|
link.URL = strings.Replace(link.URL, "/"+d.Bucket, "", 1)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if common.ShouldProxy(d, filename) {
|
if common.ShouldProxy(d, fileName) {
|
||||||
err = req.Sign()
|
err = req.Sign()
|
||||||
link.URL = req.HTTPRequest.URL.String()
|
link.URL = req.HTTPRequest.URL.String()
|
||||||
link.Header = req.HTTPRequest.Header
|
link.Header = req.HTTPRequest.Header
|
||||||
|
10
go.mod
10
go.mod
@ -46,7 +46,6 @@ require (
|
|||||||
github.com/maruel/natural v1.1.1
|
github.com/maruel/natural v1.1.1
|
||||||
github.com/meilisearch/meilisearch-go v0.27.2
|
github.com/meilisearch/meilisearch-go v0.27.2
|
||||||
github.com/mholt/archives v0.1.0
|
github.com/mholt/archives v0.1.0
|
||||||
github.com/minio/sio v0.4.0
|
|
||||||
github.com/natefinch/lumberjack v2.0.0+incompatible
|
github.com/natefinch/lumberjack v2.0.0+incompatible
|
||||||
github.com/ncw/swift/v2 v2.0.3
|
github.com/ncw/swift/v2 v2.0.3
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
@ -80,7 +79,11 @@ require (
|
|||||||
gorm.io/gorm v1.25.11
|
gorm.io/gorm v1.25.11
|
||||||
)
|
)
|
||||||
|
|
||||||
require github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
|
require (
|
||||||
|
cloud.google.com/go/compute/metadata v0.7.0 // indirect
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
|
||||||
|
github.com/google/go-cmp v0.7.0 // indirect
|
||||||
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/STARRY-S/zip v0.2.1 // indirect
|
github.com/STARRY-S/zip v0.2.1 // indirect
|
||||||
@ -106,7 +109,6 @@ require (
|
|||||||
github.com/ipfs/boxo v0.12.0 // indirect
|
github.com/ipfs/boxo v0.12.0 // indirect
|
||||||
github.com/jackc/puddle/v2 v2.2.1 // indirect
|
github.com/jackc/puddle/v2 v2.2.1 // indirect
|
||||||
github.com/klauspost/pgzip v1.2.6 // indirect
|
github.com/klauspost/pgzip v1.2.6 // indirect
|
||||||
github.com/kr/text v0.2.0 // indirect
|
|
||||||
github.com/matoous/go-nanoid/v2 v2.1.0 // indirect
|
github.com/matoous/go-nanoid/v2 v2.1.0 // indirect
|
||||||
github.com/microcosm-cc/bluemonday v1.0.27
|
github.com/microcosm-cc/bluemonday v1.0.27
|
||||||
github.com/nwaples/rardecode/v2 v2.0.0-beta.4.0.20241112120701-034e449c6e78
|
github.com/nwaples/rardecode/v2 v2.0.0-beta.4.0.20241112120701-034e449c6e78
|
||||||
@ -249,7 +251,7 @@ require (
|
|||||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||||
go.etcd.io/bbolt v1.3.8 // indirect
|
go.etcd.io/bbolt v1.3.8 // indirect
|
||||||
golang.org/x/arch v0.8.0 // indirect
|
golang.org/x/arch v0.8.0 // indirect
|
||||||
golang.org/x/sync v0.12.0
|
golang.org/x/sync v0.12.0 // indirect
|
||||||
golang.org/x/sys v0.33.0 // indirect
|
golang.org/x/sys v0.33.0 // indirect
|
||||||
golang.org/x/term v0.32.0 // indirect
|
golang.org/x/term v0.32.0 // indirect
|
||||||
golang.org/x/text v0.23.0
|
golang.org/x/text v0.23.0
|
||||||
|
56
go.sum
56
go.sum
@ -7,12 +7,10 @@ cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTj
|
|||||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||||
cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y=
|
|
||||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||||
cloud.google.com/go/compute v1.23.4 h1:EBT9Nw4q3zyE7G45Wvv3MzolIrCJEuHys5muLY0wvAw=
|
cloud.google.com/go/compute/metadata v0.7.0 h1:PBWF+iiAerVNe8UCHxdOt6eHLVc3ydFeOCw78U8ytSU=
|
||||||
cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
|
cloud.google.com/go/compute/metadata v0.7.0/go.mod h1:j5MvL9PprKL39t166CoB1uVHfQMs4tFQZZcKwksXUjo=
|
||||||
cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
|
|
||||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||||
@ -21,23 +19,25 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
|
|||||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ=
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ=
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0 h1:PiSrjRPpkQNjrM8H0WwKMnZUdu1RGMtd/LdGKUrOo+c=
|
||||||
|
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0/go.mod h1:oDrbWx4ewMylP7xHivfgixbfGBT6APAwsSoHRKotnIc=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0 h1:UXT0o77lXQrikd1kgwIPQOUect7EoR/+sbP4wQKdzxM=
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0 h1:UXT0o77lXQrikd1kgwIPQOUect7EoR/+sbP4wQKdzxM=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0/go.mod h1:cTvi54pg19DoT07ekoeMgE/taAwNtCShVeZqA+Iv2xI=
|
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0/go.mod h1:cTvi54pg19DoT07ekoeMgE/taAwNtCShVeZqA+Iv2xI=
|
||||||
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 h1:kYRSnvJju5gYVyhkij+RTJ/VR6QIUaCfWeaFm2ycsjQ=
|
||||||
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
|
||||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd h1:nzE1YQBdx1bq9IlZinHa+HVffy+NmVRoKr+wHN8fpLE=
|
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd h1:nzE1YQBdx1bq9IlZinHa+HVffy+NmVRoKr+wHN8fpLE=
|
||||||
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd/go.mod h1:C8yoIfvESpM3GD07OCHU7fqI7lhwyZ2Td1rbNbTAhnc=
|
github.com/Max-Sum/base32768 v0.0.0-20230304063302-18e6ce5945fd/go.mod h1:C8yoIfvESpM3GD07OCHU7fqI7lhwyZ2Td1rbNbTAhnc=
|
||||||
github.com/OpenListTeam/gofakes3 v0.0.7 h1:0cDGI7fLBrqumhCBto9T3ZYCL71AyGZ1l+xxJgjqe8s=
|
|
||||||
github.com/OpenListTeam/gofakes3 v0.0.7/go.mod h1:6IyGtYGIX29fLvtXo+XZhtwX2P33KVYYj8uTgAHSu58=
|
|
||||||
github.com/OpenListTeam/gofakes3 v0.1.0 h1:QVWIaso208bNc9L2gNZrkPiluAIg9jemZRxWPh4AVdY=
|
github.com/OpenListTeam/gofakes3 v0.1.0 h1:QVWIaso208bNc9L2gNZrkPiluAIg9jemZRxWPh4AVdY=
|
||||||
github.com/OpenListTeam/gofakes3 v0.1.0/go.mod h1:mWMoLOLBX5qZFe1IQHsGXD4iTmIC7nFxxeTxpYvUu6Q=
|
github.com/OpenListTeam/gofakes3 v0.1.0/go.mod h1:mWMoLOLBX5qZFe1IQHsGXD4iTmIC7nFxxeTxpYvUu6Q=
|
||||||
github.com/OpenListTeam/sftpd-openlist v1.0.1 h1:j4S3iPFOpnXCUKRPS7uCT4mF2VCl34GyqvH6lqwnkUU=
|
github.com/OpenListTeam/sftpd-openlist v1.0.1 h1:j4S3iPFOpnXCUKRPS7uCT4mF2VCl34GyqvH6lqwnkUU=
|
||||||
github.com/OpenListTeam/sftpd-openlist v1.0.1/go.mod h1:uO/wKnbvbdq3rBLmClMTZXuCnw7XW4wlAq4dZe91a40=
|
github.com/OpenListTeam/sftpd-openlist v1.0.1/go.mod h1:uO/wKnbvbdq3rBLmClMTZXuCnw7XW4wlAq4dZe91a40=
|
||||||
github.com/OpenListTeam/times v0.0.0-20240721124654-efa0c7d3ad92 h1:pIEI87zhv8ZzQcu65rTL7kqirrs8dR6HDiXrqWat2Fk=
|
|
||||||
github.com/OpenListTeam/times v0.0.0-20240721124654-efa0c7d3ad92/go.mod h1:oPJwGY3sLmGgcJamGumz//0A35f4BwQRacyqLNcJTOU=
|
|
||||||
github.com/OpenListTeam/times v0.1.0 h1:qknxw+qj5CYKgXAwydA102UEpPcpU8TYNGRmwRyPYpg=
|
github.com/OpenListTeam/times v0.1.0 h1:qknxw+qj5CYKgXAwydA102UEpPcpU8TYNGRmwRyPYpg=
|
||||||
github.com/OpenListTeam/times v0.1.0/go.mod h1:Jx7qen5NCYzKk2w14YuvU48YYMcPa1P9a+EJePC15Pc=
|
github.com/OpenListTeam/times v0.1.0/go.mod h1:Jx7qen5NCYzKk2w14YuvU48YYMcPa1P9a+EJePC15Pc=
|
||||||
github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78=
|
github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78=
|
||||||
@ -174,7 +174,6 @@ github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03V
|
|||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 h1:HVTnpeuvF6Owjd5mniCL8DEXo7uYXdQEmOP4FJbV5tg=
|
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 h1:HVTnpeuvF6Owjd5mniCL8DEXo7uYXdQEmOP4FJbV5tg=
|
||||||
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE=
|
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
@ -200,11 +199,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
|
|||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
|
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
|
||||||
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
|
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
|
||||||
github.com/fclairamb/ftpserverlib v0.26.0/go.mod h1:XMm3NdvCvmBtoAVK86oERDVmoYo0GTNS5gdds4f9lpM=
|
|
||||||
github.com/fclairamb/ftpserverlib v0.26.1-0.20250611192536-99cb646d0bbe h1:7hWzlndXJKF95RsWQ80bZmdPiBhoTIzedrp/VDGons8=
|
github.com/fclairamb/ftpserverlib v0.26.1-0.20250611192536-99cb646d0bbe h1:7hWzlndXJKF95RsWQ80bZmdPiBhoTIzedrp/VDGons8=
|
||||||
github.com/fclairamb/ftpserverlib v0.26.1-0.20250611192536-99cb646d0bbe/go.mod h1:xaDvN9bHSdKbmM1oXkqpyyYM39S89uR2blbq571Zb00=
|
github.com/fclairamb/ftpserverlib v0.26.1-0.20250611192536-99cb646d0bbe/go.mod h1:xaDvN9bHSdKbmM1oXkqpyyYM39S89uR2blbq571Zb00=
|
||||||
github.com/fclairamb/go-log v0.5.0 h1:Gz9wSamEaA6lta4IU2cjJc2xSq5sV5VYSB5w/SUHhVc=
|
|
||||||
github.com/fclairamb/go-log v0.5.0/go.mod h1:XoRO1dYezpsGmLLkZE9I+sHqpqY65p8JA+Vqblb7k40=
|
|
||||||
github.com/fclairamb/go-log v0.6.0 h1:1V7BJ75P2PvanLHRyGBBFjncB6d4AgEmu+BPWKbMkaU=
|
github.com/fclairamb/go-log v0.6.0 h1:1V7BJ75P2PvanLHRyGBBFjncB6d4AgEmu+BPWKbMkaU=
|
||||||
github.com/fclairamb/go-log v0.6.0/go.mod h1:cyXxOw4aJwO6lrZb8GRELSw+sxO6wwkLJdsjY5xYCWA=
|
github.com/fclairamb/go-log v0.6.0/go.mod h1:cyXxOw4aJwO6lrZb8GRELSw+sxO6wwkLJdsjY5xYCWA=
|
||||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||||
@ -232,9 +228,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9
|
|||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
|
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
|
||||||
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
|
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
|
||||||
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
|
|
||||||
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
|
||||||
github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
|
github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
|
||||||
|
github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
||||||
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
|
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
|
||||||
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
||||||
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||||
@ -262,7 +257,6 @@ github.com/go-webauthn/x v0.1.12/go.mod h1:XlRcGkNH8PT45TfeJYc6gqpOtiOendHhVmnOx
|
|||||||
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
|
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
|
||||||
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||||
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
|
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
|
||||||
@ -298,8 +292,9 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
github.com/google/go-tpm v0.9.1 h1:0pGc4X//bAlmZzMKf8iz6IsDo1nYTbYJ6FZN/rg4zdM=
|
github.com/google/go-tpm v0.9.1 h1:0pGc4X//bAlmZzMKf8iz6IsDo1nYTbYJ6FZN/rg4zdM=
|
||||||
github.com/google/go-tpm v0.9.1/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY=
|
github.com/google/go-tpm v0.9.1/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
@ -321,7 +316,6 @@ github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUh
|
|||||||
github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc=
|
github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc=
|
||||||
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
|
github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8=
|
||||||
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
|
github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0=
|
||||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
|
||||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
@ -383,7 +377,6 @@ github.com/jzelinskie/whirlpool v0.0.0-20201016144138-0675e54bb004/go.mod h1:KmH
|
|||||||
github.com/kdomanski/iso9660 v0.4.0 h1:BPKKdcINz3m0MdjIMwS0wx1nofsOjxOq8TOr45WGHFg=
|
github.com/kdomanski/iso9660 v0.4.0 h1:BPKKdcINz3m0MdjIMwS0wx1nofsOjxOq8TOr45WGHFg=
|
||||||
github.com/kdomanski/iso9660 v0.4.0/go.mod h1:OxUSupHsO9ceI8lBLPJKWBTphLemjrCQY8LPXM7qSzU=
|
github.com/kdomanski/iso9660 v0.4.0/go.mod h1:OxUSupHsO9ceI8lBLPJKWBTphLemjrCQY8LPXM7qSzU=
|
||||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||||
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
|
||||||
@ -406,6 +399,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||||
|
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||||
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||||
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||||
github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=
|
github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=
|
||||||
@ -425,11 +420,8 @@ github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
|
|||||||
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
|
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
|
||||||
github.com/matoous/go-nanoid/v2 v2.1.0 h1:P64+dmq21hhWdtvZfEAofnvJULaRR1Yib0+PnU669bE=
|
github.com/matoous/go-nanoid/v2 v2.1.0 h1:P64+dmq21hhWdtvZfEAofnvJULaRR1Yib0+PnU669bE=
|
||||||
github.com/matoous/go-nanoid/v2 v2.1.0/go.mod h1:KlbGNQ+FhrUNIHUxZdL63t7tl4LaPkZNpUULS8H4uVM=
|
github.com/matoous/go-nanoid/v2 v2.1.0/go.mod h1:KlbGNQ+FhrUNIHUxZdL63t7tl4LaPkZNpUULS8H4uVM=
|
||||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
|
||||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
|
||||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
|
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
|
||||||
@ -446,8 +438,6 @@ github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwX
|
|||||||
github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA=
|
github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA=
|
||||||
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
|
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
|
||||||
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
|
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
|
||||||
github.com/minio/sio v0.4.0 h1:u4SWVEm5lXSqU42ZWawV0D9I5AZ5YMmo2RXpEQ/kRhc=
|
|
||||||
github.com/minio/sio v0.4.0/go.mod h1:oBSjJeGbBdRMZZwna07sX9EFzZy+ywu5aofRiV1g79I=
|
|
||||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||||
@ -500,6 +490,8 @@ github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6
|
|||||||
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
|
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
|
||||||
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
|
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
|
||||||
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||||
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
|
||||||
|
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
@ -563,8 +555,6 @@ github.com/sorairolake/lzip-go v0.3.5/go.mod h1:N0KYq5iWrMXI0ZEXKXaS9hCyOjZUQdBD
|
|||||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||||
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
|
||||||
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
|
|
||||||
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
|
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
|
||||||
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
|
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
|
||||||
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
|
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
|
||||||
@ -634,8 +624,6 @@ github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZ
|
|||||||
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
||||||
github.com/yeka/zip v0.0.0-20231116150916-03d6312748a9 h1:K8gF0eekWPEX+57l30ixxzGhHH/qscI3JCnuhbN6V4M=
|
github.com/yeka/zip v0.0.0-20231116150916-03d6312748a9 h1:K8gF0eekWPEX+57l30ixxzGhHH/qscI3JCnuhbN6V4M=
|
||||||
github.com/yeka/zip v0.0.0-20231116150916-03d6312748a9/go.mod h1:9BnoKCcgJ/+SLhfAXj15352hTOuVmG5Gzo8xNRINfqI=
|
github.com/yeka/zip v0.0.0-20231116150916-03d6312748a9/go.mod h1:9BnoKCcgJ/+SLhfAXj15352hTOuVmG5Gzo8xNRINfqI=
|
||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
|
||||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic=
|
github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic=
|
||||||
github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
|
||||||
@ -713,7 +701,6 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG
|
|||||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
@ -732,8 +719,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
|
|||||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
|
||||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
@ -749,8 +734,6 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
|||||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||||
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
|
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
|
||||||
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
|
|
||||||
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
|
||||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
@ -766,7 +749,6 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
|
|||||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||||
@ -800,7 +782,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
@ -813,8 +794,6 @@ golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|||||||
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
|
||||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
|
||||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||||
@ -829,8 +808,6 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
|||||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||||
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
|
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
|
||||||
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
|
|
||||||
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
|
|
||||||
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
|
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
|
||||||
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
|
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
|
||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
@ -882,8 +859,6 @@ golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapK
|
|||||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
|
||||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||||
@ -893,7 +868,6 @@ golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ
|
|||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
||||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
|
@ -619,6 +619,9 @@ type Buf struct {
|
|||||||
ctx context.Context
|
ctx context.Context
|
||||||
off int
|
off int
|
||||||
rw sync.Mutex
|
rw sync.Mutex
|
||||||
|
|
||||||
|
readSignal chan struct{}
|
||||||
|
readPending bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBuf is a buffer that can have 1 read & 1 write at the same time.
|
// NewBuf is a buffer that can have 1 read & 1 write at the same time.
|
||||||
@ -628,9 +631,16 @@ func NewBuf(ctx context.Context, maxSize int) *Buf {
|
|||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
buffer: bytes.NewBuffer(make([]byte, 0, maxSize)),
|
buffer: bytes.NewBuffer(make([]byte, 0, maxSize)),
|
||||||
size: maxSize,
|
size: maxSize,
|
||||||
|
|
||||||
|
readSignal: make(chan struct{}, 1),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (br *Buf) Reset(size int) {
|
func (br *Buf) Reset(size int) {
|
||||||
|
br.rw.Lock()
|
||||||
|
defer br.rw.Unlock()
|
||||||
|
if br.buffer == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
br.buffer.Reset()
|
br.buffer.Reset()
|
||||||
br.size = size
|
br.size = size
|
||||||
br.off = 0
|
br.off = 0
|
||||||
@ -646,27 +656,34 @@ func (br *Buf) Read(p []byte) (n int, err error) {
|
|||||||
if br.off >= br.size {
|
if br.off >= br.size {
|
||||||
return 0, io.EOF
|
return 0, io.EOF
|
||||||
}
|
}
|
||||||
br.rw.Lock()
|
for {
|
||||||
n, err = br.buffer.Read(p)
|
br.rw.Lock()
|
||||||
br.rw.Unlock()
|
if br.buffer != nil {
|
||||||
if err == nil {
|
n, err = br.buffer.Read(p)
|
||||||
br.off += n
|
} else {
|
||||||
return n, err
|
err = io.ErrClosedPipe
|
||||||
}
|
}
|
||||||
if err != io.EOF {
|
br.rw.Unlock()
|
||||||
return n, err
|
if err != nil && err != io.EOF {
|
||||||
}
|
return
|
||||||
if n != 0 {
|
}
|
||||||
br.off += n
|
if n > 0 {
|
||||||
return n, nil
|
br.off += n
|
||||||
}
|
return n, nil
|
||||||
// n==0, err==io.EOF
|
}
|
||||||
// wait for new write for 200ms
|
br.rw.Lock()
|
||||||
select {
|
br.readPending = true
|
||||||
case <-br.ctx.Done():
|
br.rw.Unlock()
|
||||||
return 0, br.ctx.Err()
|
// n==0, err==io.EOF
|
||||||
case <-time.After(time.Millisecond * 200):
|
select {
|
||||||
return 0, nil
|
case <-br.ctx.Done():
|
||||||
|
return 0, br.ctx.Err()
|
||||||
|
case _, ok := <-br.readSignal:
|
||||||
|
if !ok {
|
||||||
|
return 0, io.ErrClosedPipe
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -676,10 +693,23 @@ func (br *Buf) Write(p []byte) (n int, err error) {
|
|||||||
}
|
}
|
||||||
br.rw.Lock()
|
br.rw.Lock()
|
||||||
defer br.rw.Unlock()
|
defer br.rw.Unlock()
|
||||||
|
if br.buffer == nil {
|
||||||
|
return 0, io.ErrClosedPipe
|
||||||
|
}
|
||||||
n, err = br.buffer.Write(p)
|
n, err = br.buffer.Write(p)
|
||||||
|
if br.readPending {
|
||||||
|
br.readPending = false
|
||||||
|
select {
|
||||||
|
case br.readSignal <- struct{}{}:
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (br *Buf) Close() {
|
func (br *Buf) Close() {
|
||||||
|
br.rw.Lock()
|
||||||
|
defer br.rw.Unlock()
|
||||||
br.buffer = nil
|
br.buffer = nil
|
||||||
|
close(br.readSignal)
|
||||||
}
|
}
|
||||||
|
43
pkg/utils/http.go
Normal file
43
pkg/utils/http.go
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GenerateContentDisposition 生成符合RFC 5987标准的Content-Disposition头部
|
||||||
|
func GenerateContentDisposition(fileName string) string {
|
||||||
|
// 按照RFC 2047进行编码,用于filename部分
|
||||||
|
encodedName := urlEncode(fileName)
|
||||||
|
|
||||||
|
// 按照RFC 5987进行编码,用于filename*部分
|
||||||
|
encodedNameRFC5987 := encodeRFC5987(fileName)
|
||||||
|
|
||||||
|
return fmt.Sprintf("attachment; filename=\"%s\"; filename*=utf-8''%s",
|
||||||
|
encodedName, encodedNameRFC5987)
|
||||||
|
}
|
||||||
|
|
||||||
|
// encodeRFC5987 按照RFC 5987规范编码字符串,适用于HTTP头部参数中的非ASCII字符
|
||||||
|
func encodeRFC5987(s string) string {
|
||||||
|
var buf strings.Builder
|
||||||
|
for _, r := range []byte(s) {
|
||||||
|
// 根据RFC 5987,只有字母、数字和部分特殊符号可以不编码
|
||||||
|
if (r >= 'a' && r <= 'z') ||
|
||||||
|
(r >= 'A' && r <= 'Z') ||
|
||||||
|
(r >= '0' && r <= '9') ||
|
||||||
|
r == '-' || r == '.' || r == '_' || r == '~' {
|
||||||
|
buf.WriteByte(r)
|
||||||
|
} else {
|
||||||
|
// 其他字符都需要百分号编码
|
||||||
|
fmt.Fprintf(&buf, "%%%02X", r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return buf.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
func urlEncode(s string) string {
|
||||||
|
s = url.QueryEscape(s)
|
||||||
|
s = strings.ReplaceAll(s, "+", "%20")
|
||||||
|
return s
|
||||||
|
}
|
@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -93,7 +92,7 @@ func Proxy(w http.ResponseWriter, r *http.Request, link *model.Link, file model.
|
|||||||
}
|
}
|
||||||
func attachHeader(w http.ResponseWriter, file model.Obj) {
|
func attachHeader(w http.ResponseWriter, file model.Obj) {
|
||||||
fileName := file.GetName()
|
fileName := file.GetName()
|
||||||
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, fileName, url.PathEscape(fileName)))
|
w.Header().Set("Content-Disposition", utils.GenerateContentDisposition(fileName))
|
||||||
w.Header().Set("Content-Type", utils.GetMimeType(fileName))
|
w.Header().Set("Content-Type", utils.GetMimeType(fileName))
|
||||||
w.Header().Set("Etag", GetEtag(file))
|
w.Header().Set("Etag", GetEtag(file))
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package handles
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
|
||||||
stdpath "path"
|
stdpath "path"
|
||||||
|
|
||||||
"github.com/OpenListTeam/OpenList/internal/task"
|
"github.com/OpenListTeam/OpenList/internal/task"
|
||||||
@ -392,11 +391,11 @@ func ArchiveInternalExtract(c *gin.Context) {
|
|||||||
"Referrer-Policy": "no-referrer",
|
"Referrer-Policy": "no-referrer",
|
||||||
"Cache-Control": "max-age=0, no-cache, no-store, must-revalidate",
|
"Cache-Control": "max-age=0, no-cache, no-store, must-revalidate",
|
||||||
}
|
}
|
||||||
filename := stdpath.Base(innerPath)
|
fileName := stdpath.Base(innerPath)
|
||||||
headers["Content-Disposition"] = fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, filename, url.PathEscape(filename))
|
headers["Content-Disposition"] = utils.GenerateContentDisposition(fileName)
|
||||||
contentType := c.Request.Header.Get("Content-Type")
|
contentType := c.Request.Header.Get("Content-Type")
|
||||||
if contentType == "" {
|
if contentType == "" {
|
||||||
contentType = utils.GetMimeType(filename)
|
contentType = utils.GetMimeType(fileName)
|
||||||
}
|
}
|
||||||
c.DataFromReader(200, size, contentType, rc, headers)
|
c.DataFromReader(200, size, contentType, rc, headers)
|
||||||
}
|
}
|
||||||
|
@ -213,8 +213,9 @@ func (b *s3Backend) GetObject(ctx context.Context, bucketName, objectName string
|
|||||||
}
|
}
|
||||||
|
|
||||||
meta := map[string]string{
|
meta := map[string]string{
|
||||||
"Last-Modified": node.ModTime().Format(timeFormat),
|
"Last-Modified": node.ModTime().Format(timeFormat),
|
||||||
"Content-Type": utils.GetMimeType(fp),
|
"Content-Disposition": utils.GenerateContentDisposition(file.GetName()),
|
||||||
|
"Content-Type": utils.GetMimeType(fp),
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := b.meta.Load(fp); ok {
|
if val, ok := b.meta.Load(fp); ok {
|
||||||
@ -328,7 +329,7 @@ func (b *s3Backend) PutObject(
|
|||||||
func (b *s3Backend) DeleteMulti(ctx context.Context, bucketName string, objects ...string) (result gofakes3.MultiDeleteResult, rerr error) {
|
func (b *s3Backend) DeleteMulti(ctx context.Context, bucketName string, objects ...string) (result gofakes3.MultiDeleteResult, rerr error) {
|
||||||
for _, object := range objects {
|
for _, object := range objects {
|
||||||
if err := b.deleteObject(ctx, bucketName, object); err != nil {
|
if err := b.deleteObject(ctx, bucketName, object); err != nil {
|
||||||
utils.Log.Errorf("serve s3", "delete object failed: %v", err)
|
log.Errorf("delete object failed: %v", err)
|
||||||
result.Error = append(result.Error, gofakes3.ErrorResult{
|
result.Error = append(result.Error, gofakes3.ErrorResult{
|
||||||
Code: gofakes3.ErrInternal,
|
Code: gofakes3.ErrInternal,
|
||||||
Message: gofakes3.ErrInternal.Message(),
|
Message: gofakes3.ErrInternal.Message(),
|
||||||
|
Reference in New Issue
Block a user