Skip to content

Commit a00d674

Browse files
committed
Merge remote-tracking branch 'openlist/main'
2 parents a6fee65 + 648079a commit a00d674

130 files changed

Lines changed: 1361 additions & 1042 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,34 @@
2020
- [CODE OF CONDUCT](./CODE_OF_CONDUCT.md)
2121
- [LICENSE](./LICENSE)
2222

23+
## Disclaimer
24+
25+
OpenList is an open-source project independently maintained by the OpenList Team, following the AGPL-3.0 license and committed to maintaining complete code openness and modification transparency.
26+
27+
We have noticed the emergence of some third-party projects in the community with names similar to this project, such as OpenListApp/OpenListApp, as well as some paid proprietary software using the same or similar naming. To avoid user confusion, we hereby declare:
28+
29+
- OpenList has no official association with any third-party derivative projects.
30+
31+
- All software, code, and services of this project are maintained by the OpenList Team and are freely available on GitHub.
32+
33+
- Project documentation and API services primarily rely on charitable resources provided by Cloudflare. There are currently no paid plans or commercial deployments, and the use of existing features does not involve any costs.
34+
35+
We respect the community's rights to free use and derivative development, but we also strongly urge downstream projects:
36+
37+
- Should not use the "OpenList" name for impersonation promotion or commercial gain;
38+
39+
- Must not distribute OpenList-based code in a closed-source manner or violate AGPL license terms.
40+
41+
To better maintain healthy ecosystem development, we recommend:
42+
43+
- Clearly indicate the project source and choose appropriate open-source licenses in accordance with the open-source spirit;
44+
45+
- If involving commercial use, please avoid using "OpenList" or any confusing naming as the project name;
46+
47+
- If you need to use materials located under OpenListTeam/Logo, you may modify and use them under compliance with the agreement.
48+
49+
Thank you for your support and understanding of the OpenList project.
50+
2351
## Features
2452

2553
- [x] Multiple storages

README_cn.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,34 @@
2020
- [行为准则](./CODE_OF_CONDUCT.md)
2121
- [许可证](./LICENSE)
2222

23+
## 免责声明
24+
25+
OpenList 是一个由 OpenList 团队独立维护的开源项目,遵循 AGPL-3.0 许可证,致力于保持完整的代码开放性和修改透明性。
26+
27+
我们注意到社区中出现了一些与本项目名称相似的第三方项目,如 OpenListApp/OpenListApp,以及部分采用相同或近似命名的收费专有软件。为避免用户误解,现声明如下:
28+
29+
- OpenList 与任何第三方衍生项目无官方关联。
30+
31+
- 本项目的全部软件、代码与服务由 OpenList 团队维护,可在 GitHub 免费获取。
32+
33+
- 项目文档与 API 服务均主要依托于 Cloudflare 提供的公益资源,目前无任何收费计划或商业部署,现有功能使用不涉及任何支出。
34+
35+
我们尊重社区的自由使用与衍生开发权利,但也强烈呼吁下游项目:
36+
37+
- 不应以“OpenList”名义进行冒名宣传或获取商业利益;
38+
39+
- 不得将基于 OpenList 的代码进行闭源分发或违反 AGPL 许可证条款。
40+
41+
为了更好地维护生态健康发展,我们建议:
42+
43+
- 明确注明项目来源,并以符合开源精神的方式选择适当的开源许可证;
44+
45+
- 如涉及商业用途,请避免使用“OpenList”或任何会产生混淆的方式作为项目名称;
46+
47+
- 若需使用本项目位于 OpenListTeam/Logo 下的素材,可在遵守协议的前提下进行修改后使用。
48+
49+
感谢您对 OpenList 项目的支持与理解。
50+
2351
## 功能
2452

2553
- [x] 多种存储

README_ja.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,34 @@
2020
- [行動規範](./CODE_OF_CONDUCT.md)
2121
- [ライセンス](./LICENSE)
2222

23+
## 免責事項
24+
25+
OpenListは、OpenListチームが独立して維持するオープンソースプロジェクトであり、AGPL-3.0ライセンスに従い、完全なコードの開放性と変更の透明性を維持することに専念しています。
26+
27+
コミュニティ内で、OpenListApp/OpenListAppなど、本プロジェクトと類似した名称を持つサードパーティプロジェクトや、同一または類似した命名を採用する有料専有ソフトウェアが出現していることを確認しています。ユーザーの誤解を避けるため、以下のように宣言いたします:
28+
29+
- OpenListは、いかなるサードパーティ派生プロジェクトとも公式な関連性はありません。
30+
31+
- 本プロジェクトのすべてのソフトウェア、コード、サービスはOpenListチームによって維持され、GitHubで無料で取得できます。
32+
33+
- プロジェクトドキュメントとAPIサービスは主にCloudflareが提供する公益リソースに依存しており、現在有料プランや商業展開はなく、既存機能の使用に費用は発生しません。
34+
35+
私たちはコミュニティの自由な使用と派生開発の権利を尊重しますが、下流プロジェクトに強く呼びかけます:
36+
37+
- 「OpenList」の名前で偽装宣伝や商業利益を得るべきではありません;
38+
39+
- OpenListベースのコードをクローズドソースで配布したり、AGPLライセンス条項に違反してはいけません。
40+
41+
エコシステムの健全な発展をより良く維持するため、以下を推奨します:
42+
43+
- プロジェクトの出典を明確に示し、オープンソース精神に合致する適切なオープンソースライセンスを選択する;
44+
45+
- 商業用途が関わる場合は、「OpenList」や混乱を招く可能性のある名前をプロジェクト名として使用することを避ける;
46+
47+
- OpenListTeam/Logo下の素材を使用する必要がある場合は、協定を遵守した上で修正して使用できます。
48+
49+
OpenListプロジェクトへのご支援とご理解をありがとうございます。
50+
2351
## 特徴
2452

2553
- [x] 複数ストレージ

README_nl.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,34 @@
2020
- [Gedragscode](./CODE_OF_CONDUCT.md)
2121
- [Licentie](./LICENSE)
2222

23+
## Disclaimer
24+
25+
OpenList is een open-source project dat onafhankelijk wordt onderhouden door het OpenList Team, volgend op de AGPL-3.0 licentie en toegewijd aan het behouden van volledige code openheid en transparantie van wijzigingen.
26+
27+
We hebben gemerkt dat er in de gemeenschap enkele derde partij projecten zijn verschenen met namen vergelijkbaar met dit project, zoals OpenListApp/OpenListApp, evenals enkele betaalde eigendomssoftware die dezelfde of soortgelijke naamgeving gebruikt. Om verwarring bij gebruikers te voorkomen, verklaren we hierbij:
28+
29+
- OpenList heeft geen officiële associatie met enige derde partij afgeleide projecten.
30+
31+
- Alle software, code en diensten van dit project worden onderhouden door het OpenList Team en zijn gratis beschikbaar op GitHub.
32+
33+
- Projectdocumentatie en API diensten zijn voornamelijk afhankelijk van liefdadigheidsbronnen verstrekt door Cloudflare. Er zijn momenteel geen betaalplannen of commerciële implementaties, en het gebruik van bestaande functies brengt geen kosten met zich mee.
34+
35+
We respecteren de rechten van de gemeenschap voor vrij gebruik en afgeleide ontwikkeling, maar we roepen downstream projecten ook ten zeerste op:
36+
37+
- Mogen niet de "OpenList" naam gebruiken voor namaakpromotie of commercieel gewin;
38+
39+
- Mogen OpenList-gebaseerde code niet distribueren op een closed-source manier of AGPL licentievoorwaarden schenden.
40+
41+
Om een gezonde ecosysteemontwikkeling beter te onderhouden, bevelen we aan:
42+
43+
- Duidelijk de projectbron aangeven en passende open-source licenties kiezen in overeenstemming met de open-source geest;
44+
45+
- Bij commercieel gebruik, vermijd het gebruik van "OpenList" of enige verwarrende naamgeving als projectnaam;
46+
47+
- Als u materialen onder OpenListTeam/Logo moet gebruiken, kunt u deze wijzigen en gebruiken onder naleving van de overeenkomst.
48+
49+
Dank u voor uw ondersteuning en begrip
50+
2351
## Functies
2452

2553
- [x] Meerdere opslagmogelijkheden

build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ BuildDev() {
121121
xgo -targets=windows/amd64,darwin/amd64,darwin/arm64 -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
122122
mv "$appName"-* dist
123123
cd dist
124-
cp ./"$appName"-windows-amd64.exe ./"$appName"-windows-amd64-upx.exe
125-
upx -9 ./"$appName"-windows-amd64-upx.exe
124+
# cp ./"$appName"-windows-amd64.exe ./"$appName"-windows-amd64-upx.exe
125+
# upx -9 ./"$appName"-windows-amd64-upx.exe
126126
find . -type f -print0 | xargs -0 md5sum >md5.txt
127127
cat md5.txt
128128
}
@@ -188,9 +188,9 @@ BuildRelease() {
188188
BuildWinArm64 ./build/"$appName"-windows-arm64.exe
189189
xgo -out "$appName" -ldflags="$ldflags" -tags=jsoniter .
190190
# why? Because some target platforms seem to have issues with upx compression
191-
upx -9 ./"$appName"-linux-amd64
192-
cp ./"$appName"-windows-amd64.exe ./"$appName"-windows-amd64-upx.exe
193-
upx -9 ./"$appName"-windows-amd64-upx.exe
191+
# upx -9 ./"$appName"-linux-amd64
192+
# cp ./"$appName"-windows-amd64.exe ./"$appName"-windows-amd64-upx.exe
193+
# upx -9 ./"$appName"-windows-amd64-upx.exe
194194
mv "$appName"-* build
195195
}
196196

drivers/115/meta.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ var config = driver.Config{
1818
Name: "115 Cloud",
1919
DefaultRoot: "0",
2020
// OnlyProxy: true,
21-
// OnlyLocal: true,
2221
// NoOverwriteUpload: true,
2322
}
2423

drivers/115_open/meta.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,14 @@ type Addition struct {
1111
// define other
1212
OrderBy string `json:"order_by" type:"select" options:"file_name,file_size,user_utime,file_type"`
1313
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc"`
14-
LimitRate float64 `json:"limit_rate" type:"float" default:"1" help:"limit all api request rate ([limit]r/1s)"`
14+
LimitRate float64 `json:"limit_rate" type:"float" default:"1" help:"limit all api request rate ([limit]r/1s)"`
1515
AccessToken string `json:"access_token" required:"true"`
1616
RefreshToken string `json:"refresh_token" required:"true"`
1717
}
1818

1919
var config = driver.Config{
20-
Name: "115 Open",
21-
LocalSort: false,
22-
OnlyLocal: false,
23-
OnlyProxy: false,
24-
NoCache: false,
25-
NoUpload: false,
26-
NeedMs: false,
27-
DefaultRoot: "0",
28-
CheckStatus: false,
29-
Alert: "",
30-
NoOverwriteUpload: false,
20+
Name: "115 Open",
21+
DefaultRoot: "0",
3122
}
3223

3324
func init() {

drivers/115_share/meta.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ type Addition struct {
1919
var config = driver.Config{
2020
Name: "115 Share",
2121
DefaultRoot: "0",
22-
// OnlyProxy: true,
23-
// OnlyLocal: true,
24-
CheckStatus: false,
25-
Alert: "",
26-
NoOverwriteUpload: true,
27-
NoUpload: true,
22+
NoUpload: true,
2823
}
2924

3025
func init() {

drivers/123_share/meta.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,10 @@ type Addition struct {
1515
}
1616

1717
var config = driver.Config{
18-
Name: "123PanShare",
19-
LocalSort: true,
20-
OnlyLocal: false,
21-
OnlyProxy: false,
22-
NoCache: false,
23-
NoUpload: true,
24-
NeedMs: false,
25-
DefaultRoot: "0",
26-
CheckStatus: false,
27-
Alert: "",
28-
NoOverwriteUpload: false,
18+
Name: "123PanShare",
19+
LocalSort: true,
20+
NoUpload: true,
21+
DefaultRoot: "0",
2922
}
3023

3124
func init() {

drivers/alias/driver.go

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package alias
33
import (
44
"context"
55
"errors"
6+
"fmt"
67
"io"
78
stdpath "path"
89
"strings"
@@ -11,8 +12,10 @@ import (
1112
"github.com/OpenListTeam/OpenList/v4/internal/errs"
1213
"github.com/OpenListTeam/OpenList/v4/internal/fs"
1314
"github.com/OpenListTeam/OpenList/v4/internal/model"
15+
"github.com/OpenListTeam/OpenList/v4/internal/sign"
1416
"github.com/OpenListTeam/OpenList/v4/internal/stream"
1517
"github.com/OpenListTeam/OpenList/v4/pkg/utils"
18+
"github.com/OpenListTeam/OpenList/v4/server/common"
1619
)
1720

1821
type Alias struct {
@@ -111,21 +114,43 @@ func (d *Alias) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (
111114
return nil, errs.ObjectNotFound
112115
}
113116
for _, dst := range dsts {
114-
link, err := d.link(ctx, dst, sub, args)
115-
if err == nil {
116-
link.Expiration = nil // 去除非必要缓存,d.link里op.Lin有缓存
117-
if !args.Redirect && len(link.URL) > 0 {
118-
// 正常情况下 多并发 仅支持返回URL的驱动
119-
// alias套娃alias 可以让crypt、mega等驱动(不返回URL的) 支持并发
120-
if d.DownloadConcurrency > 0 {
121-
link.Concurrency = d.DownloadConcurrency
122-
}
123-
if d.DownloadPartSize > 0 {
124-
link.PartSize = d.DownloadPartSize * utils.KB
117+
reqPath := stdpath.Join(dst, sub)
118+
link, file, err := d.link(ctx, reqPath, args)
119+
if err != nil {
120+
continue
121+
}
122+
var resultLink *model.Link
123+
if link != nil {
124+
resultLink = &model.Link{
125+
URL: link.URL,
126+
Header: link.Header,
127+
RangeReader: link.RangeReader,
128+
SyncClosers: utils.NewSyncClosers(link),
129+
}
130+
if link.MFile != nil {
131+
resultLink.RangeReader = &model.FileRangeReader{
132+
RangeReaderIF: stream.GetRangeReaderFromMFile(file.GetSize(), link.MFile),
125133
}
126134
}
127-
return link, nil
135+
136+
} else {
137+
resultLink = &model.Link{
138+
URL: fmt.Sprintf("%s/p%s?sign=%s",
139+
common.GetApiUrl(ctx),
140+
utils.EncodePath(reqPath, true),
141+
sign.Sign(reqPath)),
142+
}
143+
144+
}
145+
if !args.Redirect {
146+
if d.DownloadConcurrency > 0 {
147+
resultLink.Concurrency = d.DownloadConcurrency
148+
}
149+
if d.DownloadPartSize > 0 {
150+
resultLink.PartSize = d.DownloadPartSize * utils.KB
151+
}
128152
}
153+
return resultLink, nil
129154
}
130155
return nil, errs.ObjectNotFound
131156
}
@@ -251,9 +276,13 @@ func (d *Alias) Put(ctx context.Context, dstDir model.Obj, s model.FileStreamer,
251276
reqPath, err := d.getReqPath(ctx, dstDir, true)
252277
if err == nil {
253278
if len(reqPath) == 1 {
254-
return fs.PutDirectly(ctx, *reqPath[0], s)
279+
return fs.PutDirectly(ctx, *reqPath[0], &stream.FileStream{
280+
Obj: s,
281+
Mimetype: s.GetMimetype(),
282+
WebPutAsTask: s.NeedStore(),
283+
Reader: s,
284+
})
255285
} else {
256-
defer s.Close()
257286
file, err := s.CacheFullInTempFile()
258287
if err != nil {
259288
return err
@@ -338,14 +367,6 @@ func (d *Alias) Extract(ctx context.Context, obj model.Obj, args model.ArchiveIn
338367
for _, dst := range dsts {
339368
link, err := d.extract(ctx, dst, sub, args)
340369
if err == nil {
341-
if !args.Redirect && len(link.URL) > 0 {
342-
if d.DownloadConcurrency > 0 {
343-
link.Concurrency = d.DownloadConcurrency
344-
}
345-
if d.DownloadPartSize > 0 {
346-
link.PartSize = d.DownloadPartSize * utils.KB
347-
}
348-
}
349370
return link, nil
350371
}
351372
}

0 commit comments

Comments
 (0)