mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-07-18 17:38:07 +08:00
chore: update project meta (#51)
* chore: update project meta (partial) * chore: update README * chore: update pdf preview * revert: use old hash * chore: update logo file url
This commit is contained in:
21
README.md
21
README.md
@ -1,6 +1,6 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img width="100px" alt="logo" src="https://raw.githubusercontent.com/OpenListTeam/Logo/main/OpenList.svg"/></a>
|
<img width="100px" alt="logo" src="https://raw.githubusercontent.com/OpenListTeam/Logo/main/OpenList.svg"/></a>
|
||||||
<p><em>🗂️A file list program that supports multiple storages, powered by Gin and Solidjs, fork from alist.</em></p>
|
<p><em>🗂️A file list program that supports multiple storages, powered by Gin and SolidJS, fork of AList.</em></p>
|
||||||
<div>
|
<div>
|
||||||
<a href="https://goreportcard.com/report/github.com/OpenListTeam/OpenList/v3">
|
<a href="https://goreportcard.com/report/github.com/OpenListTeam/OpenList/v3">
|
||||||
<img src="https://goreportcard.com/badge/github.com/OpenListTeam/OpenList/v3" alt="latest version" />
|
<img src="https://goreportcard.com/badge/github.com/OpenListTeam/OpenList/v3" alt="latest version" />
|
||||||
@ -28,16 +28,14 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
>
|
|
||||||
> **THIS IS A FORK VERSION !!!**
|
|
||||||
>
|
>
|
||||||
> We sincerely thank the original author [xhofe/alist](https://github.com/xhofe/alist) for his substantial prior contributions.
|
> Drop-in replacement for AList with long-term governance, no hidden risks, and full transparency, built to defend open source against trust-based attacks.
|
||||||
>
|
>
|
||||||
> This fork is not yet stable. A large number of external links point to unaudited content, posing a supply chain attack risk, including related documentation websites, etc. Do not trust!
|
> We sincerely thank the author [Xhofe](https://github.com/Xhofe) of the original project [AlistGo/alist](https://github.com/AlistGo/alist) and all other contributors.
|
||||||
>
|
>
|
||||||
> Currently, only links confirmed to be outside the original author's control (such as `alistgo.com`) have been removed, The detailed migration progress of the project can be viewed in the [OpenList Migration Summary](https://github.com/OpenListTeam/OpenList/issues/6).
|
> This fork is not yet stable, specific migration progress can be viewed in [OpenList Migration Work Summary](https://github.com/OpenListTeam/OpenList/issues/6).
|
||||||
|
|
||||||
English | [中文](./README_cn.md) | [日本語](./README_ja.md) | [Contributing](./CONTRIBUTING.md) | [CODE_OF_CONDUCT](./CODE_OF_CONDUCT.md)
|
English | [中文](./README_cn.md) | [日本語](./README_ja.md) | [Contributing](./CONTRIBUTING.md) | [CODE OF CONDUCT](./CODE_OF_CONDUCT.md)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@ -97,15 +95,15 @@ English | [中文](./README_cn.md) | [日本語](./README_ja.md) | [Contributing
|
|||||||
|
|
||||||
## Document
|
## Document
|
||||||
|
|
||||||
<https://openlistteam.github.io/docs/> (temporally)
|
<https://docs.openlist.team>
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
N/A
|
N/A (to be rebuilt)
|
||||||
|
|
||||||
## Discussion
|
## Discussion
|
||||||
|
|
||||||
Please go to our [discussion forum](https://github.com/OpenListTeam/OpenList/discussions) for general questions, **issues are for bug reports and feature requests only.**
|
Please refer to [*Discussions*](https://github.com/OpenListTeam/OpenList/discussions) for raising general questions, ***Issues* is for bug reports and feature requests only.**
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
@ -118,6 +116,7 @@ Thanks goes to these wonderful people:
|
|||||||
The `OpenList` is open-source software licensed under the AGPL-3.0 license.
|
The `OpenList` is open-source software licensed under the AGPL-3.0 license.
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
|
||||||
- This program is a free and open source project. It is designed to share files on the network disk, which is convenient for downloading and learning Golang. Please abide by relevant laws and regulations when using it, and do not abuse it;
|
- This program is a free and open source project. It is designed to share files on the network disk, which is convenient for downloading and learning Golang. Please abide by relevant laws and regulations when using it, and do not abuse it;
|
||||||
- This program is implemented by calling the official sdk/interface, without destroying the official interface behavior;
|
- This program is implemented by calling the official sdk/interface, without destroying the official interface behavior;
|
||||||
- This program only does 302 redirect/traffic forwarding, and does not intercept, store, or tamper with any user data;
|
- This program only does 302 redirect/traffic forwarding, and does not intercept, store, or tamper with any user data;
|
||||||
@ -126,4 +125,4 @@ The `OpenList` is open-source software licensed under the AGPL-3.0 license.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
> [@GitHub](https://github.com/OpenListTeam) · [@Temporary TelegramGroup]( https://t.me/OpenListTeam)
|
> [@GitHub](https://github.com/OpenListTeam) · [Telegram Group](https://t.me/OpenListTeam)
|
||||||
|
23
README_cn.md
23
README_cn.md
@ -1,6 +1,6 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img width="100px" alt="logo" src="https://raw.githubusercontent.com/OpenListTeam/Logo/main/OpenList.svg"/></a>
|
<img width="100px" alt="logo" src="https://raw.githubusercontent.com/OpenListTeam/Logo/main/OpenList.svg"/></a>
|
||||||
<p><em>🗂一个支持多存储的文件列表程序,使用 Gin 和 Solidjs,基于 alist 项目 fork 开发</em></p>
|
<p><em>🗂一个支持多存储的文件列表程序,使用 Gin 和 SolidJS,基于 AList 项目 fork 开发</em></p>
|
||||||
<div>
|
<div>
|
||||||
<a href="https://goreportcard.com/report/github.com/OpenListTeam/OpenList/v3">
|
<a href="https://goreportcard.com/report/github.com/OpenListTeam/OpenList/v3">
|
||||||
<img src="https://goreportcard.com/badge/github.com/OpenListTeam/OpenList/v3" alt="latest version" />
|
<img src="https://goreportcard.com/badge/github.com/OpenListTeam/OpenList/v3" alt="latest version" />
|
||||||
@ -29,15 +29,13 @@
|
|||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
>
|
>
|
||||||
> **这是FORK版本!!!**
|
> 一个更可信、可持续的 AList 开源替代方案,防范未来可能的闭源、黑箱或不可信变更。
|
||||||
>
|
>
|
||||||
> 我们诚挚地感谢原作者 [xhofe/alist](https://github.com/xhofe/alist) 为原项目做出的重大贡献。
|
> 我们诚挚地感谢原项目 [AlistGo/alist](https://github.com/AlistGo/alist) 的作者 [Xhofe](https://github.com/Xhofe) 以及其他所有贡献者。
|
||||||
>
|
>
|
||||||
> 本 Fork 尚未稳定, 大量外部链接指向的内容尚未得到审计, 存在投毒风险, 含相关文档网站等. 切勿盲目信任!
|
> 本 Fork 尚未稳定, 具体迁移进度可在 [OpenList 迁移工作总结](https://github.com/OpenListTeam/OpenList/issues/6) 中查看。
|
||||||
>
|
|
||||||
> 当前仅移除了被确认超出原作者控制范围的外部链接(如`alistgo.com`),项目具体迁移进度可在[OpenList 迁移工作总结](https://github.com/OpenListTeam/OpenList/issues/6)中查看
|
|
||||||
|
|
||||||
[English](./README.md) | 中文 | [日本語](./README_ja.md) | [Contributing](./CONTRIBUTING.md) | [CODE_OF_CONDUCT](./CODE_OF_CONDUCT.md)
|
[English](./README.md) | 中文 | [日本語](./README_ja.md) | [Contributing](./CONTRIBUTING.md) | [CODE OF CONDUCT](./CODE_OF_CONDUCT.md)
|
||||||
|
|
||||||
## 功能
|
## 功能
|
||||||
|
|
||||||
@ -95,15 +93,15 @@
|
|||||||
|
|
||||||
## 文档
|
## 文档
|
||||||
|
|
||||||
<https://openlistteam.github.io/docs/> (临时)
|
<https://docs.openlist.team>
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
N/A
|
N/A(重建中)
|
||||||
|
|
||||||
## 讨论
|
## 讨论
|
||||||
|
|
||||||
一般问题请到[讨论论坛](https://github.com/OpenListTeam/OpenList/discussions) ,**issue仅针对错误报告和功能请求。**
|
一般问题请到 [*Discussions*](https://github.com/OpenListTeam/OpenList/discussions) 讨论,***Issues* 仅针对错误报告和功能请求。**
|
||||||
|
|
||||||
## 贡献者
|
## 贡献者
|
||||||
|
|
||||||
@ -113,9 +111,10 @@ N/A
|
|||||||
|
|
||||||
## 许可
|
## 许可
|
||||||
|
|
||||||
`OpenList` 是在 AGPL-3.0 许可下许可的开源软件。
|
`OpenList` 是按 AGPL-3.0 许可证许可的开源软件。
|
||||||
|
|
||||||
## 免责声明
|
## 免责声明
|
||||||
|
|
||||||
- 本程序为免费开源项目,旨在分享网盘文件,方便下载以及学习golang,使用时请遵守相关法律法规,请勿滥用;
|
- 本程序为免费开源项目,旨在分享网盘文件,方便下载以及学习golang,使用时请遵守相关法律法规,请勿滥用;
|
||||||
- 本程序通过调用官方sdk/接口实现,无破坏官方接口行为;
|
- 本程序通过调用官方sdk/接口实现,无破坏官方接口行为;
|
||||||
- 本程序仅做302重定向/流量转发,不拦截、存储、篡改任何用户数据;
|
- 本程序仅做302重定向/流量转发,不拦截、存储、篡改任何用户数据;
|
||||||
@ -124,4 +123,4 @@ N/A
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
> [@GitHub](https://github.com/OpenListTeam) · [@Telegram 交流群]( https://t.me/OpenListTeam)
|
> [@GitHub](https://github.com/OpenListTeam) · [Telegram 交流群](https://t.me/OpenListTeam)
|
||||||
|
31
README_ja.md
31
README_ja.md
@ -1,6 +1,6 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img width="100px" alt="logo" src="https://raw.githubusercontent.com/OpenListTeam/Logo/main/OpenList.svg"/></a>
|
<img width="100px" alt="logo" src="https://raw.githubusercontent.com/OpenListTeam/Logo/main/OpenList.svg"/></a>
|
||||||
<p><em>🗂複数のストレージをサポートするファイルリストプログラムで、Gin と Solidjs を使用し、alist プロジェクトをフォークして開発されました。</em></p>
|
<p><em>🗂複数のストレージをサポートするファイルリストプログラムで、Gin と SolidJS を使用し、AList プロジェクトをフォークして開発されました。</em></p>
|
||||||
<div>
|
<div>
|
||||||
<a href="https://goreportcard.com/report/github.com/OpenListTeam/OpenList/v3">
|
<a href="https://goreportcard.com/report/github.com/OpenListTeam/OpenList/v3">
|
||||||
<img src="https://goreportcard.com/badge/github.com/OpenListTeam/OpenList/v3" alt="latest version" />
|
<img src="https://goreportcard.com/badge/github.com/OpenListTeam/OpenList/v3" alt="latest version" />
|
||||||
@ -28,16 +28,14 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
>
|
>
|
||||||
> **これはフォーク版です!!!**
|
> より信頼性が高く、持続可能なAListのオープンソース代替案で、将来起こりうる非公開化、ブラックボックス化、または信頼できない変更から保護します。
|
||||||
>
|
>
|
||||||
> オリジナルの著者 [xhofe/alist](https://github.com/xhofe/alist) による多大な貢献に、心より感謝申し上げます。
|
> 元のプロジェクト [AlistGo/alist](https://github.com/AlistGo/alist) の作者 [Xhofe](https://github.com/Xhofe) および他のすべての貢献者に心から感謝いたします。
|
||||||
>
|
>
|
||||||
> 本フォークはまだ安定していません。多数の外部リンクが未検証のコンテンツを指しており、ドキュメントサイトなどを含め、サプライチェーン攻撃のリスクがあります。信頼しないでください!
|
> このForkはまだ安定していません。具体的な移行の進捗状況は [OpenList 移行作業のまとめ](https://github.com/OpenListTeam/OpenList/issues/6) でご確認いただけます。
|
||||||
>
|
|
||||||
> 現時点では、オリジナル作者の管理下にないことが確認されているリンク(例:`alistgo.com`)のみ削除されています,本プロジェクトの具体的な移行進捗状況は、[OpenList 移行作業報告書](https://github.com/OpenListTeam/OpenList/issues/6)でご確認いただけます。
|
|
||||||
|
|
||||||
[English](./README.md) | [中文](./README_cn.md) | 日本語 | [Contributing](./CONTRIBUTING.md) | [CODE_OF_CONDUCT](./CODE_OF_CONDUCT.md)
|
[English](./README.md) | [中文](./README_cn.md) | 日本語 | [Contributing](./CONTRIBUTING.md) | [CODE OF CONDUCT](./CODE_OF_CONDUCT.md)
|
||||||
|
|
||||||
## 特徴
|
## 特徴
|
||||||
|
|
||||||
@ -96,17 +94,15 @@
|
|||||||
|
|
||||||
## ドキュメント
|
## ドキュメント
|
||||||
|
|
||||||
<https://openlistteam.github.io/docs/> (temporally)
|
<https://docs.openlist.team>
|
||||||
再構築中
|
|
||||||
|
|
||||||
## デモ
|
## デモ
|
||||||
|
|
||||||
N/A
|
N/A (再構築中)
|
||||||
再構築中
|
|
||||||
|
|
||||||
## ディスカッション
|
## ディスカッション
|
||||||
|
|
||||||
一般的なご質問は[ディスカッションフォーラム](https://github.com/OpenListTeam/OpenList/discussions)をご利用ください。**問題はバグレポートと機能リクエストのみです。**
|
一般的なご質問は [*Discussions*](https://github.com/OpenListTeam/OpenList/discussions) をご利用ください。***Issues* はバグ報告と機能リクエストに限定されています。**
|
||||||
|
|
||||||
## コントリビューター
|
## コントリビューター
|
||||||
|
|
||||||
@ -116,9 +112,10 @@ N/A
|
|||||||
|
|
||||||
## ライセンス
|
## ライセンス
|
||||||
|
|
||||||
`OpenList` は AGPL-3.0 ライセンスの下でライセンスされたオープンソースソフトウェアです。
|
「`OpenList`」は AGPL-3.0 ライセンスの下で公開されているオープンソースソフトウェアです。
|
||||||
|
|
||||||
## 免責事項
|
## 免責事項
|
||||||
|
|
||||||
- このプログラムはフリーでオープンソースのプロジェクトです。ネットワークディスク上でファイルを共有するように設計されており、golang のダウンロードや学習に便利です。利用にあたっては関連法規を遵守し、悪用しないようお願いします;
|
- このプログラムはフリーでオープンソースのプロジェクトです。ネットワークディスク上でファイルを共有するように設計されており、golang のダウンロードや学習に便利です。利用にあたっては関連法規を遵守し、悪用しないようお願いします;
|
||||||
- このプログラムは、公式インターフェースの動作を破壊することなく、公式 sdk/インターフェースを呼び出すことで実装されています;
|
- このプログラムは、公式インターフェースの動作を破壊することなく、公式 sdk/インターフェースを呼び出すことで実装されています;
|
||||||
- このプログラムは、302リダイレクト/トラフィック転送のみを行い、いかなるユーザーデータも傍受、保存、改ざんしません;
|
- このプログラムは、302リダイレクト/トラフィック転送のみを行い、いかなるユーザーデータも傍受、保存、改ざんしません;
|
||||||
@ -127,4 +124,4 @@ N/A
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
> [@GitHub](https://github.com/OpenListTeam) · [@Temporary TelegramGroup]( https://t.me/OpenListTeam)
|
> [@GitHub](https://github.com/OpenListTeam) · [Telegram Group](https://t.me/OpenListTeam)
|
||||||
|
@ -236,8 +236,8 @@ func init() {
|
|||||||
// serverCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
// serverCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
}
|
}
|
||||||
|
|
||||||
// OutAlistInit 暴露用于外部启动server的函数
|
// OutOpenListInit 暴露用于外部启动server的函数
|
||||||
func OutAlistInit() {
|
func OutOpenListInit() {
|
||||||
var (
|
var (
|
||||||
cmd *cobra.Command
|
cmd *cobra.Command
|
||||||
args []string
|
args []string
|
||||||
|
@ -12,7 +12,6 @@ import (
|
|||||||
_ "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/alist_v2"
|
_ "github.com/OpenListTeam/OpenList/drivers/alist_v2"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/alist_v3"
|
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/aliyundrive"
|
_ "github.com/OpenListTeam/OpenList/drivers/aliyundrive"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/aliyundrive_open"
|
_ "github.com/OpenListTeam/OpenList/drivers/aliyundrive_open"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/aliyundrive_share"
|
_ "github.com/OpenListTeam/OpenList/drivers/aliyundrive_share"
|
||||||
@ -48,6 +47,7 @@ import (
|
|||||||
_ "github.com/OpenListTeam/OpenList/drivers/onedrive"
|
_ "github.com/OpenListTeam/OpenList/drivers/onedrive"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/onedrive_app"
|
_ "github.com/OpenListTeam/OpenList/drivers/onedrive_app"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/onedrive_sharelink"
|
_ "github.com/OpenListTeam/OpenList/drivers/onedrive_sharelink"
|
||||||
|
_ "github.com/OpenListTeam/OpenList/drivers/openlist"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/pikpak"
|
_ "github.com/OpenListTeam/OpenList/drivers/pikpak"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/pikpak_share"
|
_ "github.com/OpenListTeam/OpenList/drivers/pikpak_share"
|
||||||
_ "github.com/OpenListTeam/OpenList/drivers/quark_uc"
|
_ "github.com/OpenListTeam/OpenList/drivers/quark_uc"
|
||||||
|
@ -13,7 +13,7 @@ type Addition struct {
|
|||||||
RefreshToken string `json:"refresh_token" required:"true"`
|
RefreshToken string `json:"refresh_token" required:"true"`
|
||||||
driver.RootPath
|
driver.RootPath
|
||||||
|
|
||||||
OauthTokenURL string `json:"oauth_token_url" default:"https://api.example.com/alist/dropbox/token"` // TODO: Replace this with a community hosted api endpoint
|
OauthTokenURL string `json:"oauth_token_url" default:"https://api.example.com/alist/dropbox/token"` // TODO: replace
|
||||||
ClientID string `json:"client_id" required:"false" help:"Keep it empty if you don't have one"`
|
ClientID string `json:"client_id" required:"false" help:"Keep it empty if you don't have one"`
|
||||||
ClientSecret string `json:"client_secret" required:"false" help:"Keep it empty if you don't have one"`
|
ClientSecret string `json:"client_secret" required:"false" help:"Keep it empty if you don't have one"`
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
type Addition struct {
|
type Addition struct {
|
||||||
driver.RootID
|
driver.RootID
|
||||||
RepoStructure string `json:"repo_structure" type:"text" required:"true" default:"OpenListTeam/OpenList-Frontend" help:"structure:[path:]org/repo"`
|
RepoStructure string `json:"repo_structure" type:"text" required:"true" default:"OpenListTeam/OpenList" help:"structure:[path:]org/repo"`
|
||||||
ShowReadme bool `json:"show_readme" type:"bool" default:"true" help:"show README、LICENSE file"`
|
ShowReadme bool `json:"show_readme" type:"bool" default:"true" help:"show README、LICENSE file"`
|
||||||
Token string `json:"token" type:"string" required:"false" help:"GitHub token, if you want to access private repositories or increase the rate limit"`
|
Token string `json:"token" type:"string" required:"false" help:"GitHub token, if you want to access private repositories or increase the rate limit"`
|
||||||
ShowAllVersion bool `json:"show_all_version" type:"bool" default:"false" help:"show all versions"`
|
ShowAllVersion bool `json:"show_all_version" type:"bool" default:"false" help:"show all versions"`
|
||||||
|
@ -12,7 +12,7 @@ type Addition struct {
|
|||||||
RefreshToken string `json:"refresh_token" required:"true" help:"login type is refresh_token,this is required"`
|
RefreshToken string `json:"refresh_token" required:"true" help:"login type is refresh_token,this is required"`
|
||||||
UploadThread string `json:"upload_thread" default:"3" help:"1 <= thread <= 32"`
|
UploadThread string `json:"upload_thread" default:"3" help:"1 <= thread <= 32"`
|
||||||
|
|
||||||
AppID string `json:"app_id" required:"true" default:"alist/10001"`
|
AppID string `json:"app_id" required:"true" default:"openlist/10001"`
|
||||||
AppVersion string `json:"app_version" required:"true" default:"1.0.0"`
|
AppVersion string `json:"app_version" required:"true" default:"1.0.0"`
|
||||||
AppSecret string `json:"app_secret" required:"true" default:"bR4SJwOkvnG5WvVJ"`
|
AppSecret string `json:"app_secret" required:"true" default:"bR4SJwOkvnG5WvVJ"`
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ func readDir(dirname string) ([]fs.FileInfo, error) {
|
|||||||
|
|
||||||
func (d *Local) getThumb(file model.Obj) (*bytes.Buffer, *string, error) {
|
func (d *Local) getThumb(file model.Obj) (*bytes.Buffer, *string, error) {
|
||||||
fullPath := file.GetPath()
|
fullPath := file.GetPath()
|
||||||
thumbPrefix := "alist_thumb_"
|
thumbPrefix := "openlist_thumb_"
|
||||||
thumbName := thumbPrefix + utils.GetMD5EncodeStr(fullPath) + ".png"
|
thumbName := thumbPrefix + utils.GetMD5EncodeStr(fullPath) + ".png"
|
||||||
if d.ThumbCacheFolder != "" {
|
if d.ThumbCacheFolder != "" {
|
||||||
// skip if the file is a thumbnail
|
// skip if the file is a thumbnail
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package alist_v3
|
package openlist
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -20,20 +20,20 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AListV3 struct {
|
type OpenList struct {
|
||||||
model.Storage
|
model.Storage
|
||||||
Addition
|
Addition
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Config() driver.Config {
|
func (d *OpenList) Config() driver.Config {
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) GetAddition() driver.Additional {
|
func (d *OpenList) GetAddition() driver.Additional {
|
||||||
return &d.Addition
|
return &d.Addition
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Init(ctx context.Context) error {
|
func (d *OpenList) Init(ctx context.Context) error {
|
||||||
d.Addition.Address = strings.TrimSuffix(d.Addition.Address, "/")
|
d.Addition.Address = strings.TrimSuffix(d.Addition.Address, "/")
|
||||||
var resp common.Resp[MeResp]
|
var resp common.Resp[MeResp]
|
||||||
_, _, err := d.request("/me", http.MethodGet, func(req *resty.Request) {
|
_, _, err := d.request("/me", http.MethodGet, func(req *resty.Request) {
|
||||||
@ -70,11 +70,11 @@ func (d *AListV3) Init(ctx context.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Drop(ctx context.Context) error {
|
func (d *OpenList) Drop(ctx context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
|
func (d *OpenList) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error) {
|
||||||
var resp common.Resp[FsListResp]
|
var resp common.Resp[FsListResp]
|
||||||
_, _, err := d.request("/fs/list", http.MethodPost, func(req *resty.Request) {
|
_, _, err := d.request("/fs/list", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetResult(&resp).SetBody(ListReq{
|
req.SetResult(&resp).SetBody(ListReq{
|
||||||
@ -108,7 +108,7 @@ func (d *AListV3) List(ctx context.Context, dir model.Obj, args model.ListArgs)
|
|||||||
return files, nil
|
return files, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
|
func (d *OpenList) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
|
||||||
var resp common.Resp[FsGetResp]
|
var resp common.Resp[FsGetResp]
|
||||||
// if PassUAToUpsteam is true, then pass the user-agent to the upstream
|
// if PassUAToUpsteam is true, then pass the user-agent to the upstream
|
||||||
userAgent := base.UserAgent
|
userAgent := base.UserAgent
|
||||||
@ -132,7 +132,7 @@ func (d *AListV3) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
|
func (d *OpenList) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
|
||||||
_, _, err := d.request("/fs/mkdir", http.MethodPost, func(req *resty.Request) {
|
_, _, err := d.request("/fs/mkdir", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(MkdirOrLinkReq{
|
req.SetBody(MkdirOrLinkReq{
|
||||||
Path: path.Join(parentDir.GetPath(), dirName),
|
Path: path.Join(parentDir.GetPath(), dirName),
|
||||||
@ -141,7 +141,7 @@ func (d *AListV3) MakeDir(ctx context.Context, parentDir model.Obj, dirName stri
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
|
func (d *OpenList) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
|
||||||
_, _, err := d.request("/fs/move", http.MethodPost, func(req *resty.Request) {
|
_, _, err := d.request("/fs/move", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(MoveCopyReq{
|
req.SetBody(MoveCopyReq{
|
||||||
SrcDir: path.Dir(srcObj.GetPath()),
|
SrcDir: path.Dir(srcObj.GetPath()),
|
||||||
@ -152,7 +152,7 @@ func (d *AListV3) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Rename(ctx context.Context, srcObj model.Obj, newName string) error {
|
func (d *OpenList) Rename(ctx context.Context, srcObj model.Obj, newName string) error {
|
||||||
_, _, err := d.request("/fs/rename", http.MethodPost, func(req *resty.Request) {
|
_, _, err := d.request("/fs/rename", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(RenameReq{
|
req.SetBody(RenameReq{
|
||||||
Path: srcObj.GetPath(),
|
Path: srcObj.GetPath(),
|
||||||
@ -162,7 +162,7 @@ func (d *AListV3) Rename(ctx context.Context, srcObj model.Obj, newName string)
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
|
func (d *OpenList) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
|
||||||
_, _, err := d.request("/fs/copy", http.MethodPost, func(req *resty.Request) {
|
_, _, err := d.request("/fs/copy", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(MoveCopyReq{
|
req.SetBody(MoveCopyReq{
|
||||||
SrcDir: path.Dir(srcObj.GetPath()),
|
SrcDir: path.Dir(srcObj.GetPath()),
|
||||||
@ -173,7 +173,7 @@ func (d *AListV3) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Remove(ctx context.Context, obj model.Obj) error {
|
func (d *OpenList) Remove(ctx context.Context, obj model.Obj) error {
|
||||||
_, _, err := d.request("/fs/remove", http.MethodPost, func(req *resty.Request) {
|
_, _, err := d.request("/fs/remove", http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(RemoveReq{
|
req.SetBody(RemoveReq{
|
||||||
Dir: path.Dir(obj.GetPath()),
|
Dir: path.Dir(obj.GetPath()),
|
||||||
@ -183,7 +183,7 @@ func (d *AListV3) Remove(ctx context.Context, obj model.Obj) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Put(ctx context.Context, dstDir model.Obj, s model.FileStreamer, up driver.UpdateProgress) error {
|
func (d *OpenList) Put(ctx context.Context, dstDir model.Obj, s model.FileStreamer, up driver.UpdateProgress) error {
|
||||||
reader := driver.NewLimitedUploadStream(ctx, &driver.ReaderUpdatingProgress{
|
reader := driver.NewLimitedUploadStream(ctx, &driver.ReaderUpdatingProgress{
|
||||||
Reader: s,
|
Reader: s,
|
||||||
UpdateProgress: up,
|
UpdateProgress: up,
|
||||||
@ -217,7 +217,7 @@ func (d *AListV3) Put(ctx context.Context, dstDir model.Obj, s model.FileStreame
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
log.Debugf("[alist_v3] response body: %s", string(bytes))
|
log.Debugf("[openlist] response body: %s", string(bytes))
|
||||||
if res.StatusCode >= 400 {
|
if res.StatusCode >= 400 {
|
||||||
return fmt.Errorf("request failed, status: %s", res.Status)
|
return fmt.Errorf("request failed, status: %s", res.Status)
|
||||||
}
|
}
|
||||||
@ -234,7 +234,7 @@ func (d *AListV3) Put(ctx context.Context, dstDir model.Obj, s model.FileStreame
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) GetArchiveMeta(ctx context.Context, obj model.Obj, args model.ArchiveArgs) (model.ArchiveMeta, error) {
|
func (d *OpenList) GetArchiveMeta(ctx context.Context, obj model.Obj, args model.ArchiveArgs) (model.ArchiveMeta, error) {
|
||||||
if !d.ForwardArchiveReq {
|
if !d.ForwardArchiveReq {
|
||||||
return nil, errs.NotImplement
|
return nil, errs.NotImplement
|
||||||
}
|
}
|
||||||
@ -267,7 +267,7 @@ func (d *AListV3) GetArchiveMeta(ctx context.Context, obj model.Obj, args model.
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) ListArchive(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) ([]model.Obj, error) {
|
func (d *OpenList) ListArchive(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) ([]model.Obj, error) {
|
||||||
if !d.ForwardArchiveReq {
|
if !d.ForwardArchiveReq {
|
||||||
return nil, errs.NotImplement
|
return nil, errs.NotImplement
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ func (d *AListV3) ListArchive(ctx context.Context, obj model.Obj, args model.Arc
|
|||||||
return files, nil
|
return files, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) Extract(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) (*model.Link, error) {
|
func (d *OpenList) Extract(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) (*model.Link, error) {
|
||||||
if !d.ForwardArchiveReq {
|
if !d.ForwardArchiveReq {
|
||||||
return nil, errs.NotSupport
|
return nil, errs.NotSupport
|
||||||
}
|
}
|
||||||
@ -336,7 +336,7 @@ func (d *AListV3) Extract(ctx context.Context, obj model.Obj, args model.Archive
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, args model.ArchiveDecompressArgs) error {
|
func (d *OpenList) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, args model.ArchiveDecompressArgs) error {
|
||||||
if !d.ForwardArchiveReq {
|
if !d.ForwardArchiveReq {
|
||||||
return errs.NotImplement
|
return errs.NotImplement
|
||||||
}
|
}
|
||||||
@ -359,4 +359,4 @@ func (d *AListV3) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Ob
|
|||||||
// return nil, errs.NotSupport
|
// return nil, errs.NotSupport
|
||||||
//}
|
//}
|
||||||
|
|
||||||
var _ driver.Driver = (*AListV3)(nil)
|
var _ driver.Driver = (*OpenList)(nil)
|
@ -1,4 +1,4 @@
|
|||||||
package alist_v3
|
package openlist
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenListTeam/OpenList/internal/driver"
|
"github.com/OpenListTeam/OpenList/internal/driver"
|
||||||
@ -17,7 +17,7 @@ type Addition struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var config = driver.Config{
|
var config = driver.Config{
|
||||||
Name: "AList V3",
|
Name: "OpenList",
|
||||||
LocalSort: true,
|
LocalSort: true,
|
||||||
DefaultRoot: "/",
|
DefaultRoot: "/",
|
||||||
CheckStatus: true,
|
CheckStatus: true,
|
||||||
@ -26,6 +26,6 @@ var config = driver.Config{
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
op.RegisterDriver(func() driver.Driver {
|
op.RegisterDriver(func() driver.Driver {
|
||||||
return &AListV3{}
|
return &OpenList{}
|
||||||
})
|
})
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package alist_v3
|
package openlist
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
@ -1,4 +1,4 @@
|
|||||||
package alist_v3
|
package openlist
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -12,7 +12,7 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (d *AListV3) login() error {
|
func (d *OpenList) login() error {
|
||||||
if d.Username == "" {
|
if d.Username == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ func (d *AListV3) login() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *AListV3) request(api, method string, callback base.ReqCallback, retry ...bool) ([]byte, int, error) {
|
func (d *OpenList) request(api, method string, callback base.ReqCallback, retry ...bool) ([]byte, int, error) {
|
||||||
url := d.Address + "/api" + api
|
url := d.Address + "/api" + api
|
||||||
req := base.RestyClient.R()
|
req := base.RestyClient.R()
|
||||||
req.SetHeader("Authorization", d.Token)
|
req.SetHeader("Authorization", d.Token)
|
||||||
@ -46,7 +46,7 @@ func (d *AListV3) request(api, method string, callback base.ReqCallback, retry .
|
|||||||
}
|
}
|
||||||
return nil, code, err
|
return nil, code, err
|
||||||
}
|
}
|
||||||
log.Debugf("[alist_v3] response body: %s", res.String())
|
log.Debugf("[openlist] response body: %s", res.String())
|
||||||
if res.StatusCode() >= 400 {
|
if res.StatusCode() >= 400 {
|
||||||
return nil, res.StatusCode(), fmt.Errorf("request failed, status: %s", res.Status())
|
return nil, res.StatusCode(), fmt.Errorf("request failed, status: %s", res.Status())
|
||||||
}
|
}
|
@ -42,7 +42,7 @@ func (d *S3) GetAddition() driver.Additional {
|
|||||||
|
|
||||||
func (d *S3) Init(ctx context.Context) error {
|
func (d *S3) Init(ctx context.Context) error {
|
||||||
if d.Region == "" {
|
if d.Region == "" {
|
||||||
d.Region = "alist"
|
d.Region = "openlist"
|
||||||
}
|
}
|
||||||
if d.config.Name == "Doge" {
|
if d.config.Name == "Doge" {
|
||||||
// 多吉云每次临时生成的秘钥有效期为 2h,所以这里设置为 118 分钟重新生成一次
|
// 多吉云每次临时生成的秘钥有效期为 2h,所以这里设置为 118 分钟重新生成一次
|
||||||
|
@ -69,7 +69,7 @@ func getKey(path string, dir bool) string {
|
|||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
var defaultPlaceholderName = ".alist"
|
var defaultPlaceholderName = ".openlist"
|
||||||
|
|
||||||
func getPlaceholderName(placeholder string) string {
|
func getPlaceholderName(placeholder string) string {
|
||||||
if placeholder == "" {
|
if placeholder == "" {
|
||||||
|
@ -88,7 +88,7 @@ func InitConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func confFromEnv() {
|
func confFromEnv() {
|
||||||
prefix := "ALIST_"
|
prefix := "OPENLIST_"
|
||||||
if flags.NoPrefix {
|
if flags.NoPrefix {
|
||||||
prefix = ""
|
prefix = ""
|
||||||
}
|
}
|
||||||
|
@ -120,17 +120,17 @@ func InitialSettings() []model.SettingItem {
|
|||||||
{Key: conf.ProxyIgnoreHeaders, Value: "authorization,referer", Type: conf.TypeText, Group: model.PREVIEW, Flag: model.PRIVATE},
|
{Key: conf.ProxyIgnoreHeaders, Value: "authorization,referer", Type: conf.TypeText, Group: model.PREVIEW, Flag: model.PRIVATE},
|
||||||
{Key: "external_previews", Value: `{}`, Type: conf.TypeText, Group: model.PREVIEW},
|
{Key: "external_previews", Value: `{}`, Type: conf.TypeText, Group: model.PREVIEW},
|
||||||
{Key: "iframe_previews", Value: `{
|
{Key: "iframe_previews", Value: `{
|
||||||
"doc,docx,xls,xlsx,ppt,pptx": {
|
"doc,docx,xls,xlsx,ppt,pptx": {
|
||||||
"Microsoft":"https://view.officeapps.live.com/op/view.aspx?src=$e_url",
|
"Microsoft":"https://view.officeapps.live.com/op/view.aspx?src=$e_url",
|
||||||
"Google":"https://docs.google.com/gview?url=$e_url&embedded=true"
|
"Google":"https://docs.google.com/gview?url=$e_url&embedded=true"
|
||||||
},
|
},
|
||||||
"pdf": {
|
"pdf": {
|
||||||
"PDF.js":"https://alist-org.github.io/pdf.js/web/viewer.html?file=$e_url"
|
"PDF.js":https://mozilla.github.io/pdf.js/web/viewer.html?url=$e_url"
|
||||||
},
|
},
|
||||||
"epub": {
|
// "epub": {
|
||||||
"EPUB.js":"https://alist-org.github.io/static/epub.js/viewer.html?url=$e_url"
|
// "EPUB.js":"https://alist-org.github.io/static/epub.js/viewer.html?url=$e_url"
|
||||||
}
|
// }
|
||||||
}`, Type: conf.TypeText, Group: model.PREVIEW},
|
}`, Type: conf.TypeText, Group: model.PREVIEW},
|
||||||
// {Key: conf.OfficeViewers, Value: `{
|
// {Key: conf.OfficeViewers, Value: `{
|
||||||
// "Microsoft":"https://view.officeapps.live.com/op/view.aspx?src=$url",
|
// "Microsoft":"https://view.officeapps.live.com/op/view.aspx?src=$url",
|
||||||
// "Google":"https://docs.google.com/gview?url=$url&embedded=true",
|
// "Google":"https://docs.google.com/gview?url=$url&embedded=true",
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
func initUser() {
|
func initUser() {
|
||||||
admin, err := op.GetAdmin()
|
admin, err := op.GetAdmin()
|
||||||
adminPassword := random.String(8)
|
adminPassword := random.String(8)
|
||||||
envpass := os.Getenv("ALIST_ADMIN_PASSWORD")
|
envpass := os.Getenv("OPENLIST_ADMIN_PASSWORD")
|
||||||
if flags.Dev {
|
if flags.Dev {
|
||||||
adminPassword = "admin"
|
adminPassword = "admin"
|
||||||
} else if len(envpass) > 0 {
|
} else if len(envpass) > 0 {
|
||||||
|
@ -527,7 +527,7 @@ func Put(ctx context.Context, storage driver.Driver, dstDirPath string, file mod
|
|||||||
// if file exist and size = 0, delete it
|
// if file exist and size = 0, delete it
|
||||||
dstDirPath = utils.FixAndCleanPath(dstDirPath)
|
dstDirPath = utils.FixAndCleanPath(dstDirPath)
|
||||||
dstPath := stdpath.Join(dstDirPath, file.GetName())
|
dstPath := stdpath.Join(dstDirPath, file.GetName())
|
||||||
tempName := file.GetName() + ".alist_to_delete"
|
tempName := file.GetName() + ".openlist_to_delete"
|
||||||
tempPath := stdpath.Join(dstDirPath, tempName)
|
tempPath := stdpath.Join(dstDirPath, tempName)
|
||||||
fi, err := GetUnwrap(ctx, storage, dstPath)
|
fi, err := GetUnwrap(ctx, storage, dstPath)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -23,7 +23,7 @@ func init() {
|
|||||||
Host: conf.Conf.Meilisearch.Host,
|
Host: conf.Conf.Meilisearch.Host,
|
||||||
APIKey: conf.Conf.Meilisearch.APIKey,
|
APIKey: conf.Conf.Meilisearch.APIKey,
|
||||||
}),
|
}),
|
||||||
IndexUid: conf.Conf.Meilisearch.IndexPrefix + "alist",
|
IndexUid: conf.Conf.Meilisearch.IndexPrefix + "openlist",
|
||||||
FilterableAttributes: []string{"parent", "is_dir", "name"},
|
FilterableAttributes: []string{"parent", "is_dir", "name"},
|
||||||
SearchableAttributes: []string{"name"},
|
SearchableAttributes: []string{"name"},
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ package search
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/OpenListTeam/OpenList/drivers/alist_v3"
|
|
||||||
"github.com/OpenListTeam/OpenList/drivers/base"
|
"github.com/OpenListTeam/OpenList/drivers/base"
|
||||||
|
"github.com/OpenListTeam/OpenList/drivers/openlist"
|
||||||
"github.com/OpenListTeam/OpenList/internal/conf"
|
"github.com/OpenListTeam/OpenList/internal/conf"
|
||||||
"github.com/OpenListTeam/OpenList/internal/driver"
|
"github.com/OpenListTeam/OpenList/internal/driver"
|
||||||
"github.com/OpenListTeam/OpenList/internal/model"
|
"github.com/OpenListTeam/OpenList/internal/model"
|
||||||
@ -41,12 +41,12 @@ func WriteProgress(progress *model.IndexProgress) {
|
|||||||
func updateIgnorePaths(customIgnorePaths string) {
|
func updateIgnorePaths(customIgnorePaths string) {
|
||||||
storages := op.GetAllStorages()
|
storages := op.GetAllStorages()
|
||||||
ignorePaths := make([]string, 0)
|
ignorePaths := make([]string, 0)
|
||||||
var skipDrivers = []string{"AList V2", "AList V3", "Virtual"}
|
var skipDrivers = []string{"AList V2", "OpenList", "Virtual"}
|
||||||
v3Visited := make(map[string]bool)
|
v3Visited := make(map[string]bool)
|
||||||
for _, storage := range storages {
|
for _, storage := range storages {
|
||||||
if utils.SliceContains(skipDrivers, storage.Config().Name) {
|
if utils.SliceContains(skipDrivers, storage.Config().Name) {
|
||||||
if storage.Config().Name == "AList V3" {
|
if storage.Config().Name == "OpenList" {
|
||||||
addition := storage.GetAddition().(*alist_v3.Addition)
|
addition := storage.GetAddition().(*openlist.Addition)
|
||||||
allowIndexed, visited := v3Visited[addition.Address]
|
allowIndexed, visited := v3Visited[addition.Address]
|
||||||
if !visited {
|
if !visited {
|
||||||
url := addition.Address + "/api/public/settings"
|
url := addition.Address + "/api/public/settings"
|
||||||
@ -87,7 +87,7 @@ func init() {
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
op.RegisterStorageHook(func(typ string, storage driver.Driver) {
|
op.RegisterStorageHook(func(typ string, storage driver.Driver) {
|
||||||
var skipDrivers = []string{"AList V2", "AList V3", "Virtual"}
|
var skipDrivers = []string{"AList V2", "OpenList", "Virtual"}
|
||||||
if utils.SliceContains(skipDrivers, storage.Config().Name) {
|
if utils.SliceContains(skipDrivers, storage.Config().Name) {
|
||||||
updateIgnorePaths(setting.GetStr(conf.IgnorePaths))
|
updateIgnorePaths(setting.GetStr(conf.IgnorePaths))
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ func (c *client) AddFromLink(link string, savePath string, id string) error {
|
|||||||
}
|
}
|
||||||
addField("urls", link)
|
addField("urls", link)
|
||||||
addField("savepath", savePath)
|
addField("savepath", savePath)
|
||||||
addField("tags", "alist-"+id)
|
addField("tags", "openlist-"+id)
|
||||||
addField("autoTMM", "false")
|
addField("autoTMM", "false")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -250,7 +250,7 @@ type InfoNotFoundError struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i InfoNotFoundError) Error() string {
|
func (i InfoNotFoundError) Error() string {
|
||||||
return "there should be exactly one task with tag \"alist-" + i.Id + "\""
|
return "there should be exactly one task with tag \"openlist-" + i.Id + "\""
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewInfoNotFoundError(id string) InfoNotFoundError {
|
func NewInfoNotFoundError(id string) InfoNotFoundError {
|
||||||
@ -266,7 +266,7 @@ func (c *client) GetInfo(id string) (TorrentInfo, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
v := url.Values{}
|
v := url.Values{}
|
||||||
v.Set("tag", "alist-"+id)
|
v.Set("tag", "openlist-"+id)
|
||||||
response, err := c.post("/api/v2/torrents/info", v)
|
response, err := c.post("/api/v2/torrents/info", v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return TorrentInfo{}, err
|
return TorrentInfo{}, err
|
||||||
@ -354,7 +354,7 @@ func (c *client) Delete(id string, deleteFiles bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
v = url.Values{}
|
v = url.Values{}
|
||||||
v.Set("tags", "alist-"+id)
|
v.Set("tags", "openlist-"+id)
|
||||||
response, err = c.post("/api/v2/torrents/deleteTags", v)
|
response, err = c.post("/api/v2/torrents/deleteTags", v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -27,7 +27,7 @@ func String(n int) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Token() string {
|
func Token() string {
|
||||||
return "alist-" + uuid.NewString() + String(64)
|
return "openlist-" + uuid.NewString() + String(64)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RangeInt64(left, right int64) int64 {
|
func RangeInt64(left, right int64) int64 {
|
||||||
|
@ -136,7 +136,7 @@ func Generate2FA(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
key, err := totp.Generate(totp.GenerateOpts{
|
key, err := totp.Generate(totp.GenerateOpts{
|
||||||
Issuer: "Alist",
|
Issuer: "OpenList",
|
||||||
AccountName: user.Username,
|
AccountName: user.Username,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -65,7 +65,7 @@ func UpdateIndex() {
|
|||||||
mainColor := setting.GetStr(conf.MainColor)
|
mainColor := setting.GetStr(conf.MainColor)
|
||||||
conf.ManageHtml = conf.RawIndexHtml
|
conf.ManageHtml = conf.RawIndexHtml
|
||||||
replaceMap1 := map[string]string{
|
replaceMap1 := map[string]string{
|
||||||
"https://cdn.oplist.org/gh/OpenListTeam/Logo@main/OpenList.svg": favicon,
|
"https://cdn.oplist.org/gh/OpenListTeam/Logo@main/logo.svg": favicon,
|
||||||
"Loading...": title,
|
"Loading...": title,
|
||||||
"main_color: undefined": fmt.Sprintf("main_color: '%s'", mainColor),
|
"main_color: undefined": fmt.Sprintf("main_color: '%s'", mainColor),
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ func WebDAVAuth(c *gin.Context) {
|
|||||||
c.Next()
|
c.Next()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.Writer.Header()["WWW-Authenticate"] = []string{`Basic realm="alist"`}
|
c.Writer.Header()["WWW-Authenticate"] = []string{`Basic realm="openlist"`}
|
||||||
c.Status(http.StatusUnauthorized)
|
c.Status(http.StatusUnauthorized)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user