Commit Graph

16 Commits (main)

Author SHA1 Message Date
BaiYi 112363031a
feat: add fine-grained control for link signing (#3924)
* Determine whether the URL requires Sign

* Add File and Mem based KV

NOT TESTED: TokenKV Function

* Change Token KV func to common func.

Add File based KV func

* Remove KV, Remove Token

I found that the original Sign function is enough to complete the link signature, and only need to add simple configuration items to meet the requirements.

* Add IsStorageSigned func to judge if Signing is enabled in the storage settings.

It should be working now.

* Add a SIGN button to the management panel.

* Add enable_sign to the basic storage struct.

Can enable sign for every driver now.

Bug: When sign enabled, in download page, Copy link doesn't contain a sign.

(Not done yet)

* Fix a bug from commit 8f6c25f.

Response of fsread function does not contain sign.

* Optimize code and follow advices.

- Add back public/dist/README.md

- Enable sign when DownProxyUrl is enabled

- Merge needSign() to isEncrypt() in fsread.go

* simplify code

---------

Co-authored-by: Andy Hsu <i@nn.ci>
2023-03-24 22:44:33 +08:00
foxxorcat 6024e8d832
refactor: split the db package hook and cache to the op package (#2747)
* refactor:separate the setting method from the db package to the op package and add the cache

* refactor:separate the meta method from the db package to the op package

* fix:setting not load database data

* refactor:separate the user method from the db package to the op package

* refactor:remove user JoinPath error

* fix:op package user cache

* refactor:fs package list method

* fix:tile virtual paths (close #2743)

* Revert "refactor:remove user JoinPath error"

This reverts commit 4e20daaf9e.

* clean path directly may lead to unknown behavior

* fix: The path of the meta passed in must be prefix of reqPath

* chore: rename all virtualPath to mountPath

* fix: `getStoragesByPath` and `GetStorageVirtualFilesByPath`

is_sub_path:

/a/b isn't subpath of /a/bc

* fix: don't save setting if hook error

Co-authored-by: Noah Hsu <i@nn.ci>
2022-12-18 19:51:20 +08:00
foxxorcat fb64f00640
refactor: obj name mapping and internal path processing (#2733)
* refactor:Prepare to remove the get interface

* feat:add obj Unwarp interface

* refactor:obj name mapping and program internal path processing

* chore: fix typo

* feat: unwrap get

* fix: no use op.Get to get parent id

* fix: set the path uniformly

Co-authored-by: Noah Hsu <i@nn.ci>
2022-12-17 19:49:05 +08:00
Noah Hsu ff0bcfef8a feat: optional sign all files 2022-11-30 22:10:07 +08:00
Gerhard Tan 00de9bf16d
fix!: sign with the raw path instead of filename (#2258) 2022-11-11 16:24:25 +08:00
Noah Hsu 6aedd0f425 fix: trim slash suffix of sign 2022-09-11 19:39:24 +08:00
Noah Hsu 778cee4cdf fix: download sign check 2022-09-04 18:29:41 +08:00
Noah Hsu b51e664543 chore: go fmt 2022-08-03 14:26:59 +08:00
Noah Hsu 35b04ffa9c feat: add readme field to list resp 2022-06-30 15:41:58 +08:00
Noah Hsu 96380a50da feat: file proxy handle 2022-06-28 21:58:46 +08:00
Noah Hsu b76060570e refactor: init v3 2022-06-06 16:28:37 +08:00
微凉 b472c2ee18 🔒 not allowed delete root folder 2022-01-13 21:23:27 +08:00
微凉 8e7b2c5837 api proxy 2021-12-19 17:10:20 +08:00
微凉 190c8001a5 🚧 support proxy url 2021-12-08 10:33:26 +08:00
微凉 985b81826f 🎇 support add another alist 2021-12-07 20:16:34 +08:00
微凉 03580fd76c 🎨 Improve the code structure 2021-12-07 15:56:43 +08:00