Commit Graph

44 Commits (6aaf5975c6651df36329860ab5be5a2a058396d7)

Author SHA1 Message Date
KirCute_ECT 64ceb5afb6
feat: support general users view and cancel own tasks (#7416 close #7398)
* 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
2024-11-01 23:32:26 +08:00
Andy Hsu 3d51845f57 feat: invalidate old token after changing the password (close #5515) 2023-11-13 15:22:42 +08:00
itsHenry 1aa024ed6b
feat: support webauthn login (#4945)
* 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>
2023-08-14 22:54:38 +08:00
Andy Hsu 7d20a01dba feat!: support listen to the unix (close #4671)
Starting from this commit, the HTTP server related config all move to the scheme
2023-07-04 17:56:02 +08:00
BoYanZh f646d2a699 feat!: listen to both http & https (#4536)
Co-authored-by: Andy Hsu <i@nn.ci>
2023-06-11 18:17:37 +08:00
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
Andy Hsu 3d3f23ec9e fix: upload check if disable sub folder (close #3741) 2023-03-07 14:13:39 +08:00
NewbieOrange d484219c48
fix(security): compare auth token in constant time (#3740 close #3739) 2023-03-06 23:41:06 +08:00
Andy Hsu 3d0065bdcf feat!: allow disable user (close #3241)
From this commit, the guest user will be disabled by default
2023-02-04 11:44:17 +08:00
BoYanZh e2bcca2fbd
feat: static files for embed viewers (#2739) 2022-12-19 13:34:06 +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
BoYanZh 7947ff1ae4
feat: limit max connection count (#2701) 2022-12-14 10:33:58 +08:00
BoYanZh a2e8e96c71
feat: respond static file on loading storages (#2686) 2022-12-12 20:17:58 +08:00
Noah Hsu ff0bcfef8a feat: optional sign all files 2022-11-30 22:10:07 +08:00
Noah Hsu b5bf5f4325 fix: check if the req path is relative path (close #2531) 2022-11-30 21:38:00 +08:00
Noah Hsu ddcba93eea
feat: multiple search indexes (#2514)
* refactor: abstract search interface

* wip: ~

* fix cycle import

* objs update hook

* wip: ~

* Delete search/none

* auto update index while cache changed

* db searcher

TODO: bleve init issue

cannot open index, metadata missing

* fix size type

why float64??

* fix typo

* fix nil pointer using

* api adapt ui

* bleve: fix clear & change struct
2022-11-28 13:45:25 +08:00
Noah Hsu 85e1350af8 fix: check password while upload (close #2444) 2022-11-22 16:14:01 +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 a24dfddc2a feat: add 189cloud driver 2022-09-06 14:39:21 +08:00
Noah Hsu 778cee4cdf fix: download sign check 2022-09-04 18:29:41 +08:00
Noah Hsu 0fdfd1f2c2 feat: load storages while starting 2022-08-11 21:32:33 +08:00
Noah Hsu b51e664543 chore: go fmt 2022-08-03 14:26:59 +08:00
Noah Hsu 826e4807dc chore: add current user log 2022-07-23 21:33:53 +08:00
Noah Hsu 35b04ffa9c feat: add readme field to list resp 2022-06-30 15:41:58 +08:00
Noah Hsu d24e51bc86 chore: user permissions 2022-06-29 18:03:12 +08:00
Noah Hsu a09a1b814b chore: change permission check 2022-06-29 17:08:31 +08:00
Noah Hsu 40548926e6 feat: fs link api 2022-06-29 16:08:55 +08:00
Noah Hsu 96380a50da feat: file proxy handle 2022-06-28 21:58:46 +08:00
Noah Hsu d1efec4539 chore: common err resp log 2022-06-28 18:12:53 +08:00
Noah Hsu 5dbf5db4ff feat: token and reset 2022-06-28 14:18:10 +08:00
Noah Hsu f01a81ee9c chore: settings util 2022-06-27 17:25:19 +08:00
Noah Hsu 6b9bca893b chore: change whether print log 2022-06-26 19:20:19 +08:00
Noah Hsu c67f128f15 chore: move server package to root 2022-06-26 19:10:14 +08:00
Noah Hsu b76060570e refactor: init v3 2022-06-06 16:28:37 +08:00
微凉 a2c7ff3262 ✏️ Invalid Token 2022-01-26 16:27:38 +08:00
微凉 1640a52789 cancel hide file for admin #343 2022-01-14 18:00:47 +08:00
微凉 b472c2ee18 🔒 not allowed delete root folder 2022-01-13 21:23:27 +08:00
微凉 ef5cad1bf0 🎇 Pagination #257 2022-01-04 21:21: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