* feat: support general users view and cancel own tasks
Add a creator attribute to the upload, copy and offline download
tasks, so that a GENERAL task creator can view and cancel them.
BREAKING CHANGE:
1. A new internal package `task` including the struct `TaskWithCreator`
which embeds `tache.Base` is created, and the past dependence on
`tache.Task` will all be transferred to dependence on this package.
2. The API `/admin/task` can now also be accessed via `/task`, and the
old endpoint is retained to ensure compatibility with legacy
automation scripts.
Closes#7398
* fix(deps): update github.com/xhofe/tache to v0.1.3
* feat: support webauthn login
* manually merge
* fix: clear user cache after updating authn
* decrease db size of Authn
* change authn type to text
* simplify code structure
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* 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>
* 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>
* 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>