From b1afadd1296c8d48fcece077be75b017bfdd2c8b Mon Sep 17 00:00:00 2001 From: Hantong Chen <70561268+cxw620@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:29:45 +0800 Subject: [PATCH] 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 --- README.md | 21 ++++++------- README_cn.md | 23 +++++++------- README_ja.md | 31 +++++++++--------- cmd/server.go | 4 +-- drivers/all.go | 2 +- drivers/dropbox/meta.go | 2 +- drivers/github_releases/meta.go | 2 +- drivers/halalcloud/meta.go | 2 +- drivers/local/util.go | 2 +- drivers/{alist_v3 => openlist}/driver.go | 40 ++++++++++++------------ drivers/{alist_v3 => openlist}/meta.go | 6 ++-- drivers/{alist_v3 => openlist}/types.go | 2 +- drivers/{alist_v3 => openlist}/util.go | 8 ++--- drivers/s3/driver.go | 2 +- drivers/s3/util.go | 2 +- internal/bootstrap/config.go | 2 +- internal/bootstrap/data/setting.go | 22 ++++++------- internal/bootstrap/data/user.go | 2 +- internal/op/fs.go | 2 +- internal/search/meilisearch/init.go | 2 +- internal/search/util.go | 10 +++--- pkg/qbittorrent/client.go | 8 ++--- pkg/utils/random/random.go | 2 +- server/handles/auth.go | 2 +- server/static/static.go | 2 +- server/webdav.go | 2 +- 26 files changed, 100 insertions(+), 105 deletions(-) rename drivers/{alist_v3 => openlist}/driver.go (84%) rename drivers/{alist_v3 => openlist}/meta.go (91%) rename drivers/{alist_v3 => openlist}/types.go (99%) rename drivers/{alist_v3 => openlist}/util.go (86%) diff --git a/README.md b/README.md index c2df40c7..75410909 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
logo -

🗂️A file list program that supports multiple storages, powered by Gin and Solidjs, fork from alist.

+

🗂️A file list program that supports multiple storages, powered by Gin and SolidJS, fork of AList.

latest version @@ -28,16 +28,14 @@ --- > [!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 @@ -97,15 +95,15 @@ English | [中文](./README_cn.md) | [日本語](./README_ja.md) | [Contributing ## Document - (temporally) + ## Demo -N/A +N/A (to be rebuilt) ## 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 @@ -118,6 +116,7 @@ Thanks goes to these wonderful people: The `OpenList` is open-source software licensed under the AGPL-3.0 license. ## 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 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; @@ -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) diff --git a/README_cn.md b/README_cn.md index e559e702..dba3e6fb 100644 --- a/README_cn.md +++ b/README_cn.md @@ -1,6 +1,6 @@
logo -

🗂一个支持多存储的文件列表程序,使用 Gin 和 Solidjs,基于 alist 项目 fork 开发

+

🗂一个支持多存储的文件列表程序,使用 Gin 和 SolidJS,基于 AList 项目 fork 开发

latest version @@ -29,15 +29,13 @@ > [!IMPORTANT] > -> **这是FORK版本!!!** +> 一个更可信、可持续的 AList 开源替代方案,防范未来可能的闭源、黑箱或不可信变更。 > -> 我们诚挚地感谢原作者 [xhofe/alist](https://github.com/xhofe/alist) 为原项目做出的重大贡献。 +> 我们诚挚地感谢原项目 [AlistGo/alist](https://github.com/AlistGo/alist) 的作者 [Xhofe](https://github.com/Xhofe) 以及其他所有贡献者。 > -> 本 Fork 尚未稳定, 大量外部链接指向的内容尚未得到审计, 存在投毒风险, 含相关文档网站等. 切勿盲目信任! -> -> 当前仅移除了被确认超出原作者控制范围的外部链接(如`alistgo.com`),项目具体迁移进度可在[OpenList 迁移工作总结](https://github.com/OpenListTeam/OpenList/issues/6)中查看 +> 本 Fork 尚未稳定, 具体迁移进度可在 [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 @@ ## 文档 - (临时) + ## 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,使用时请遵守相关法律法规,请勿滥用; - 本程序通过调用官方sdk/接口实现,无破坏官方接口行为; - 本程序仅做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) diff --git a/README_ja.md b/README_ja.md index 44cecb80..f5c3a3d1 100644 --- a/README_ja.md +++ b/README_ja.md @@ -1,6 +1,6 @@
logo -

🗂複数のストレージをサポートするファイルリストプログラムで、Gin と Solidjs を使用し、alist プロジェクトをフォークして開発されました。

+

🗂複数のストレージをサポートするファイルリストプログラムで、Gin と SolidJS を使用し、AList プロジェクトをフォークして開発されました。

latest version @@ -28,16 +28,14 @@ --- > [!IMPORTANT] -> -> **これはフォーク版です!!!** -> -> オリジナルの著者 [xhofe/alist](https://github.com/xhofe/alist) による多大な貢献に、心より感謝申し上げます。 -> -> 本フォークはまだ安定していません。多数の外部リンクが未検証のコンテンツを指しており、ドキュメントサイトなどを含め、サプライチェーン攻撃のリスクがあります。信頼しないでください! -> -> 現時点では、オリジナル作者の管理下にないことが確認されているリンク(例:`alistgo.com`)のみ削除されています,本プロジェクトの具体的な移行進捗状況は、[OpenList 移行作業報告書](https://github.com/OpenListTeam/OpenList/issues/6)でご確認いただけます。 +> +> より信頼性が高く、持続可能なAListのオープンソース代替案で、将来起こりうる非公開化、ブラックボックス化、または信頼できない変更から保護します。 +> +> 元のプロジェクト [AlistGo/alist](https://github.com/AlistGo/alist) の作者 [Xhofe](https://github.com/Xhofe) および他のすべての貢献者に心から感謝いたします。 +> +> このForkはまだ安定していません。具体的な移行の進捗状況は [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 @@ ## ドキュメント - (temporally) -再構築中 + ## デモ -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 のダウンロードや学習に便利です。利用にあたっては関連法規を遵守し、悪用しないようお願いします; - このプログラムは、公式インターフェースの動作を破壊することなく、公式 sdk/インターフェースを呼び出すことで実装されています; - このプログラムは、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) diff --git a/cmd/server.go b/cmd/server.go index ef107b64..15fd37a9 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -236,8 +236,8 @@ func init() { // serverCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } -// OutAlistInit 暴露用于外部启动server的函数 -func OutAlistInit() { +// OutOpenListInit 暴露用于外部启动server的函数 +func OutOpenListInit() { var ( cmd *cobra.Command args []string diff --git a/drivers/all.go b/drivers/all.go index 54cd7d3a..66980217 100644 --- a/drivers/all.go +++ b/drivers/all.go @@ -12,7 +12,6 @@ import ( _ "github.com/OpenListTeam/OpenList/drivers/189pc" _ "github.com/OpenListTeam/OpenList/drivers/alias" _ "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_open" _ "github.com/OpenListTeam/OpenList/drivers/aliyundrive_share" @@ -48,6 +47,7 @@ import ( _ "github.com/OpenListTeam/OpenList/drivers/onedrive" _ "github.com/OpenListTeam/OpenList/drivers/onedrive_app" _ "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_share" _ "github.com/OpenListTeam/OpenList/drivers/quark_uc" diff --git a/drivers/dropbox/meta.go b/drivers/dropbox/meta.go index c1a50acd..3e9fbab3 100644 --- a/drivers/dropbox/meta.go +++ b/drivers/dropbox/meta.go @@ -13,7 +13,7 @@ type Addition struct { RefreshToken string `json:"refresh_token" required:"true"` 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"` ClientSecret string `json:"client_secret" required:"false" help:"Keep it empty if you don't have one"` diff --git a/drivers/github_releases/meta.go b/drivers/github_releases/meta.go index 7d8ad0f6..ea555c73 100644 --- a/drivers/github_releases/meta.go +++ b/drivers/github_releases/meta.go @@ -7,7 +7,7 @@ import ( type Addition struct { 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"` 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"` diff --git a/drivers/halalcloud/meta.go b/drivers/halalcloud/meta.go index d8fe25a0..5baff537 100644 --- a/drivers/halalcloud/meta.go +++ b/drivers/halalcloud/meta.go @@ -12,7 +12,7 @@ type Addition struct { 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"` - 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"` AppSecret string `json:"app_secret" required:"true" default:"bR4SJwOkvnG5WvVJ"` } diff --git a/drivers/local/util.go b/drivers/local/util.go index 33dda6a9..9ed0fc12 100644 --- a/drivers/local/util.go +++ b/drivers/local/util.go @@ -105,7 +105,7 @@ func readDir(dirname string) ([]fs.FileInfo, error) { func (d *Local) getThumb(file model.Obj) (*bytes.Buffer, *string, error) { fullPath := file.GetPath() - thumbPrefix := "alist_thumb_" + thumbPrefix := "openlist_thumb_" thumbName := thumbPrefix + utils.GetMD5EncodeStr(fullPath) + ".png" if d.ThumbCacheFolder != "" { // skip if the file is a thumbnail diff --git a/drivers/alist_v3/driver.go b/drivers/openlist/driver.go similarity index 84% rename from drivers/alist_v3/driver.go rename to drivers/openlist/driver.go index c43e8200..f958158b 100644 --- a/drivers/alist_v3/driver.go +++ b/drivers/openlist/driver.go @@ -1,4 +1,4 @@ -package alist_v3 +package openlist import ( "context" @@ -20,20 +20,20 @@ import ( log "github.com/sirupsen/logrus" ) -type AListV3 struct { +type OpenList struct { model.Storage Addition } -func (d *AListV3) Config() driver.Config { +func (d *OpenList) Config() driver.Config { return config } -func (d *AListV3) GetAddition() driver.Additional { +func (d *OpenList) GetAddition() driver.Additional { 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, "/") var resp common.Resp[MeResp] _, _, err := d.request("/me", http.MethodGet, func(req *resty.Request) { @@ -70,11 +70,11 @@ func (d *AListV3) Init(ctx context.Context) error { return err } -func (d *AListV3) Drop(ctx context.Context) error { +func (d *OpenList) Drop(ctx context.Context) error { 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] _, _, err := d.request("/fs/list", http.MethodPost, func(req *resty.Request) { 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 } -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] // if PassUAToUpsteam is true, then pass the user-agent to the upstream userAgent := base.UserAgent @@ -132,7 +132,7 @@ func (d *AListV3) Link(ctx context.Context, file model.Obj, args model.LinkArgs) }, 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) { req.SetBody(MkdirOrLinkReq{ Path: path.Join(parentDir.GetPath(), dirName), @@ -141,7 +141,7 @@ func (d *AListV3) MakeDir(ctx context.Context, parentDir model.Obj, dirName stri 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) { req.SetBody(MoveCopyReq{ SrcDir: path.Dir(srcObj.GetPath()), @@ -152,7 +152,7 @@ func (d *AListV3) Move(ctx context.Context, srcObj, dstDir model.Obj) error { 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) { req.SetBody(RenameReq{ Path: srcObj.GetPath(), @@ -162,7 +162,7 @@ func (d *AListV3) Rename(ctx context.Context, srcObj model.Obj, newName string) 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) { req.SetBody(MoveCopyReq{ SrcDir: path.Dir(srcObj.GetPath()), @@ -173,7 +173,7 @@ func (d *AListV3) Copy(ctx context.Context, srcObj, dstDir model.Obj) error { 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) { req.SetBody(RemoveReq{ Dir: path.Dir(obj.GetPath()), @@ -183,7 +183,7 @@ func (d *AListV3) Remove(ctx context.Context, obj model.Obj) error { 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: s, UpdateProgress: up, @@ -217,7 +217,7 @@ func (d *AListV3) Put(ctx context.Context, dstDir model.Obj, s model.FileStreame if err != nil { return err } - log.Debugf("[alist_v3] response body: %s", string(bytes)) + log.Debugf("[openlist] response body: %s", string(bytes)) if res.StatusCode >= 400 { 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 } -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 { return nil, errs.NotImplement } @@ -267,7 +267,7 @@ func (d *AListV3) GetArchiveMeta(ctx context.Context, obj model.Obj, args model. }, 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 { return nil, errs.NotImplement } @@ -311,7 +311,7 @@ func (d *AListV3) ListArchive(ctx context.Context, obj model.Obj, args model.Arc 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 { return nil, errs.NotSupport } @@ -336,7 +336,7 @@ func (d *AListV3) Extract(ctx context.Context, obj model.Obj, args model.Archive }, 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 { return errs.NotImplement } @@ -359,4 +359,4 @@ func (d *AListV3) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Ob // return nil, errs.NotSupport //} -var _ driver.Driver = (*AListV3)(nil) +var _ driver.Driver = (*OpenList)(nil) diff --git a/drivers/alist_v3/meta.go b/drivers/openlist/meta.go similarity index 91% rename from drivers/alist_v3/meta.go rename to drivers/openlist/meta.go index a6f6aeda..1a9b22e0 100644 --- a/drivers/alist_v3/meta.go +++ b/drivers/openlist/meta.go @@ -1,4 +1,4 @@ -package alist_v3 +package openlist import ( "github.com/OpenListTeam/OpenList/internal/driver" @@ -17,7 +17,7 @@ type Addition struct { } var config = driver.Config{ - Name: "AList V3", + Name: "OpenList", LocalSort: true, DefaultRoot: "/", CheckStatus: true, @@ -26,6 +26,6 @@ var config = driver.Config{ func init() { op.RegisterDriver(func() driver.Driver { - return &AListV3{} + return &OpenList{} }) } diff --git a/drivers/alist_v3/types.go b/drivers/openlist/types.go similarity index 99% rename from drivers/alist_v3/types.go rename to drivers/openlist/types.go index 9db22f47..eeb9ddb3 100644 --- a/drivers/alist_v3/types.go +++ b/drivers/openlist/types.go @@ -1,4 +1,4 @@ -package alist_v3 +package openlist import ( "time" diff --git a/drivers/alist_v3/util.go b/drivers/openlist/util.go similarity index 86% rename from drivers/alist_v3/util.go rename to drivers/openlist/util.go index b37158f9..eceeaacf 100644 --- a/drivers/alist_v3/util.go +++ b/drivers/openlist/util.go @@ -1,4 +1,4 @@ -package alist_v3 +package openlist import ( "fmt" @@ -12,7 +12,7 @@ import ( log "github.com/sirupsen/logrus" ) -func (d *AListV3) login() error { +func (d *OpenList) login() error { if d.Username == "" { return nil } @@ -31,7 +31,7 @@ func (d *AListV3) login() error { 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 req := base.RestyClient.R() req.SetHeader("Authorization", d.Token) @@ -46,7 +46,7 @@ func (d *AListV3) request(api, method string, callback base.ReqCallback, retry . } 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 { return nil, res.StatusCode(), fmt.Errorf("request failed, status: %s", res.Status()) } diff --git a/drivers/s3/driver.go b/drivers/s3/driver.go index 9749f1e2..29db4494 100644 --- a/drivers/s3/driver.go +++ b/drivers/s3/driver.go @@ -42,7 +42,7 @@ func (d *S3) GetAddition() driver.Additional { func (d *S3) Init(ctx context.Context) error { if d.Region == "" { - d.Region = "alist" + d.Region = "openlist" } if d.config.Name == "Doge" { // 多吉云每次临时生成的秘钥有效期为 2h,所以这里设置为 118 分钟重新生成一次 diff --git a/drivers/s3/util.go b/drivers/s3/util.go index 2f8d9001..6ed846e7 100644 --- a/drivers/s3/util.go +++ b/drivers/s3/util.go @@ -69,7 +69,7 @@ func getKey(path string, dir bool) string { return path } -var defaultPlaceholderName = ".alist" +var defaultPlaceholderName = ".openlist" func getPlaceholderName(placeholder string) string { if placeholder == "" { diff --git a/internal/bootstrap/config.go b/internal/bootstrap/config.go index 2db61d56..38c8bb54 100644 --- a/internal/bootstrap/config.go +++ b/internal/bootstrap/config.go @@ -88,7 +88,7 @@ func InitConfig() { } func confFromEnv() { - prefix := "ALIST_" + prefix := "OPENLIST_" if flags.NoPrefix { prefix = "" } diff --git a/internal/bootstrap/data/setting.go b/internal/bootstrap/data/setting.go index 7090726d..03d7219b 100644 --- a/internal/bootstrap/data/setting.go +++ b/internal/bootstrap/data/setting.go @@ -120,17 +120,17 @@ func InitialSettings() []model.SettingItem { {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: "iframe_previews", Value: `{ - "doc,docx,xls,xlsx,ppt,pptx": { - "Microsoft":"https://view.officeapps.live.com/op/view.aspx?src=$e_url", - "Google":"https://docs.google.com/gview?url=$e_url&embedded=true" - }, - "pdf": { - "PDF.js":"https://alist-org.github.io/pdf.js/web/viewer.html?file=$e_url" - }, - "epub": { - "EPUB.js":"https://alist-org.github.io/static/epub.js/viewer.html?url=$e_url" - } -}`, Type: conf.TypeText, Group: model.PREVIEW}, + "doc,docx,xls,xlsx,ppt,pptx": { + "Microsoft":"https://view.officeapps.live.com/op/view.aspx?src=$e_url", + "Google":"https://docs.google.com/gview?url=$e_url&embedded=true" + }, + "pdf": { + "PDF.js":https://mozilla.github.io/pdf.js/web/viewer.html?url=$e_url" + }, + // "epub": { + // "EPUB.js":"https://alist-org.github.io/static/epub.js/viewer.html?url=$e_url" + // } + }`, Type: conf.TypeText, Group: model.PREVIEW}, // {Key: conf.OfficeViewers, Value: `{ // "Microsoft":"https://view.officeapps.live.com/op/view.aspx?src=$url", // "Google":"https://docs.google.com/gview?url=$url&embedded=true", diff --git a/internal/bootstrap/data/user.go b/internal/bootstrap/data/user.go index 0a2c4490..71097f1c 100644 --- a/internal/bootstrap/data/user.go +++ b/internal/bootstrap/data/user.go @@ -16,7 +16,7 @@ import ( func initUser() { admin, err := op.GetAdmin() adminPassword := random.String(8) - envpass := os.Getenv("ALIST_ADMIN_PASSWORD") + envpass := os.Getenv("OPENLIST_ADMIN_PASSWORD") if flags.Dev { adminPassword = "admin" } else if len(envpass) > 0 { diff --git a/internal/op/fs.go b/internal/op/fs.go index e2fb1fd3..d566f9d2 100644 --- a/internal/op/fs.go +++ b/internal/op/fs.go @@ -527,7 +527,7 @@ func Put(ctx context.Context, storage driver.Driver, dstDirPath string, file mod // if file exist and size = 0, delete it dstDirPath = utils.FixAndCleanPath(dstDirPath) dstPath := stdpath.Join(dstDirPath, file.GetName()) - tempName := file.GetName() + ".alist_to_delete" + tempName := file.GetName() + ".openlist_to_delete" tempPath := stdpath.Join(dstDirPath, tempName) fi, err := GetUnwrap(ctx, storage, dstPath) if err == nil { diff --git a/internal/search/meilisearch/init.go b/internal/search/meilisearch/init.go index a8ccd331..4e46c2bb 100644 --- a/internal/search/meilisearch/init.go +++ b/internal/search/meilisearch/init.go @@ -23,7 +23,7 @@ func init() { Host: conf.Conf.Meilisearch.Host, APIKey: conf.Conf.Meilisearch.APIKey, }), - IndexUid: conf.Conf.Meilisearch.IndexPrefix + "alist", + IndexUid: conf.Conf.Meilisearch.IndexPrefix + "openlist", FilterableAttributes: []string{"parent", "is_dir", "name"}, SearchableAttributes: []string{"name"}, } diff --git a/internal/search/util.go b/internal/search/util.go index f0aef279..76cf03d1 100644 --- a/internal/search/util.go +++ b/internal/search/util.go @@ -3,8 +3,8 @@ package search import ( "strings" - "github.com/OpenListTeam/OpenList/drivers/alist_v3" "github.com/OpenListTeam/OpenList/drivers/base" + "github.com/OpenListTeam/OpenList/drivers/openlist" "github.com/OpenListTeam/OpenList/internal/conf" "github.com/OpenListTeam/OpenList/internal/driver" "github.com/OpenListTeam/OpenList/internal/model" @@ -41,12 +41,12 @@ func WriteProgress(progress *model.IndexProgress) { func updateIgnorePaths(customIgnorePaths string) { storages := op.GetAllStorages() ignorePaths := make([]string, 0) - var skipDrivers = []string{"AList V2", "AList V3", "Virtual"} + var skipDrivers = []string{"AList V2", "OpenList", "Virtual"} v3Visited := make(map[string]bool) for _, storage := range storages { if utils.SliceContains(skipDrivers, storage.Config().Name) { - if storage.Config().Name == "AList V3" { - addition := storage.GetAddition().(*alist_v3.Addition) + if storage.Config().Name == "OpenList" { + addition := storage.GetAddition().(*openlist.Addition) allowIndexed, visited := v3Visited[addition.Address] if !visited { url := addition.Address + "/api/public/settings" @@ -87,7 +87,7 @@ func init() { return nil }) 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) { updateIgnorePaths(setting.GetStr(conf.IgnorePaths)) } diff --git a/pkg/qbittorrent/client.go b/pkg/qbittorrent/client.go index 7fb8c686..46cd55b9 100644 --- a/pkg/qbittorrent/client.go +++ b/pkg/qbittorrent/client.go @@ -134,7 +134,7 @@ func (c *client) AddFromLink(link string, savePath string, id string) error { } addField("urls", link) addField("savepath", savePath) - addField("tags", "alist-"+id) + addField("tags", "openlist-"+id) addField("autoTMM", "false") if err != nil { return err @@ -250,7 +250,7 @@ type InfoNotFoundError struct { } 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 { @@ -266,7 +266,7 @@ func (c *client) GetInfo(id string) (TorrentInfo, error) { } v := url.Values{} - v.Set("tag", "alist-"+id) + v.Set("tag", "openlist-"+id) response, err := c.post("/api/v2/torrents/info", v) if err != nil { return TorrentInfo{}, err @@ -354,7 +354,7 @@ func (c *client) Delete(id string, deleteFiles bool) error { } v = url.Values{} - v.Set("tags", "alist-"+id) + v.Set("tags", "openlist-"+id) response, err = c.post("/api/v2/torrents/deleteTags", v) if err != nil { return err diff --git a/pkg/utils/random/random.go b/pkg/utils/random/random.go index c3f3dd48..4908c3dc 100644 --- a/pkg/utils/random/random.go +++ b/pkg/utils/random/random.go @@ -27,7 +27,7 @@ func String(n int) string { } func Token() string { - return "alist-" + uuid.NewString() + String(64) + return "openlist-" + uuid.NewString() + String(64) } func RangeInt64(left, right int64) int64 { diff --git a/server/handles/auth.go b/server/handles/auth.go index 00a12702..a16b024c 100644 --- a/server/handles/auth.go +++ b/server/handles/auth.go @@ -136,7 +136,7 @@ func Generate2FA(c *gin.Context) { return } key, err := totp.Generate(totp.GenerateOpts{ - Issuer: "Alist", + Issuer: "OpenList", AccountName: user.Username, }) if err != nil { diff --git a/server/static/static.go b/server/static/static.go index 723305b6..1f454c80 100644 --- a/server/static/static.go +++ b/server/static/static.go @@ -65,7 +65,7 @@ func UpdateIndex() { mainColor := setting.GetStr(conf.MainColor) conf.ManageHtml = conf.RawIndexHtml 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, "main_color: undefined": fmt.Sprintf("main_color: '%s'", mainColor), } diff --git a/server/webdav.go b/server/webdav.go index 666a5690..5dd3e86e 100644 --- a/server/webdav.go +++ b/server/webdav.go @@ -77,7 +77,7 @@ func WebDAVAuth(c *gin.Context) { c.Next() return } - c.Writer.Header()["WWW-Authenticate"] = []string{`Basic realm="alist"`} + c.Writer.Header()["WWW-Authenticate"] = []string{`Basic realm="openlist"`} c.Status(http.StatusUnauthorized) c.Abort() return