Commit Graph

310 Commits

Author SHA1 Message Date
Bobby
2a8901a903
fix: ipv6 support for chunked uploads 2023-04-09 04:13:29 +07:00
Bobby
96689278f1
refactor: defer reject uploads after consume
always store incoming uploads to disk first before deciding whether to
reject and delete them depending on configured rejects/limits

doing this is more stable/reliable than attempting to immediately
reject the incoming connections, at least if we want to respond with
actual error messages
2022-10-16 11:08:53 +07:00
Bobby
066998991c
fix: url uploads content-type parsing 2022-10-06 04:24:28 +07:00
Bobby
10c2618ef6
feat: filter uploads by mime types 2022-10-06 03:36:34 +07:00
Bobby
30db27e524
fix: uploadController.js missing Constants module 2022-10-06 03:36:22 +07:00
Bobby
ff58054158
fix: type-is uploads filtering
also improved its parsing logic
2022-10-06 03:26:19 +07:00
Bobby
e7c91b8ad0
refactor: upload's stripTags if-logic 2022-10-06 02:44:54 +07:00
Bobby
cd2baba0d6
feat: ScannerManager 2022-10-06 02:42:36 +07:00
Bobby
95e5956313
feat: ConfigManager 2022-10-06 02:39:51 +07:00
Bobby
a49842a932
fix: size attribute of uploads with stripped tags
it'd previously always keep size attribute before the tags stripping
2022-10-04 05:42:00 +07:00
Bobby
9467132f1f
feat: use fs-jetpack in uploadController.js 2022-10-04 05:30:48 +07:00
Bobby
afd81c965d
chore: comment out onHold debug messages
seem stable enough
but just comment out if needed in the future
2022-10-04 05:12:21 +07:00
Bobby
fcdbf2d475
feat: better url uploads error status 2022-09-28 11:37:57 +07:00
Bobby
d364034738
fix: improve url uploads input check 2022-09-28 11:37:29 +07:00
Bobby
7e28c26d41
fix: improve multiple uploads Promise handling 2022-09-28 11:03:29 +07:00
Bobby
e64cfa89cf
feat: send more data in upload API response 2022-09-28 10:33:47 +07:00
Bobby
0b46f43bfa
chore: console log multipart early resolve 2022-09-28 10:32:45 +07:00
Bobby
b3a2c93642
feat: improve flow of storing files to db
API respond now have new prop "repeated" to signify that the files were
already previously uploaded
2022-09-28 10:16:00 +07:00
Bobby
81c94a40d5
feat: defaults mime-type to octet-stream 2022-09-28 10:14:57 +07:00
Bobby
c1bb2f5015
refactor: logic improvements 2022-09-28 10:14:08 +07:00
Bobby
aebeb8e045
feat: filter uploads using relative time duration
added a new production dependency parse-duration@~1.0.2

read filters help popup in dashboard for usage example
2022-09-24 09:54:49 +07:00
Bobby
216ba12b3e
feat: filter uploads with unix timestamp dates 2022-09-24 08:38:43 +07:00
Bobby
a44af208aa
feat: click on table headers to sort uploads
fairly robust logic, with auto toggling of asc or desc sort direction
2022-09-24 08:09:27 +07:00
Bobby
a646d6731a
fix: possible upload stream starting early 2022-09-24 06:41:31 +07:00
Bobby
c47d3f5437
feat: better upload.onHold debugging messages
expose util.inspect via utils when on dev mode
2022-09-24 06:33:58 +07:00
Bobby
47727f3ca8
feat: allow specifying api token in nojs uploader 2022-09-21 08:03:28 +07:00
Bobby
cc5625fabf
fix: url upload fetch timeout failsafe 2022-09-14 06:04:18 +07:00
Bobby
93dc820368
feat: fetch() with AbortController for timeout
to be used with URL uploads

please consult the comments in the source files

this adds new dependency abort-controller
2022-09-14 01:33:31 +07:00
Bobby
3df67f87be
feat: timeout url uploads to 10s
uwebsockets.js has a 10s timeout of no communication between client and
server, for it to simply drop the connection

there's no point waiting any further at that point since we can't reply
to client anymore
2022-08-24 04:37:13 +07:00
Bobby
6ad8ed7ae6
fix: only accept files upload with files[] field
was always supposed to only accept said field, but i forgot to include
the logic during migration from expressjs to hyper-express
2022-08-24 04:17:07 +07:00
Bobby Wibowo
0d05da40b0
fix: fallback deletion url to relative path
if homeDomain is not configured via config file or env var

the deletion url is a frontend page, so it cannot simply assume it's on
the same domain as uploaded files
2022-08-19 09:29:11 +07:00
Bobby Wibowo
edf7c091e4
feat: wrap upload db insert within transaction 2022-08-09 16:57:55 +07:00
Bobby Wibowo
253042e24e
fix: improve filtering uploads by album ids
database logic and dashboard display
2022-08-08 06:08:40 +07:00
Bobby Wibowo
b21fa66e59
fix: possible event listeners memory leak 2022-08-05 00:54:44 +07:00
Bobby Wibowo
3e0aa1361d
fix: detect uploads timed out by uwebsockets 2022-08-04 22:08:40 +07:00
Bobby Wibowo
7381cac0e9
chore: indents and comments 2022-08-04 21:59:50 +07:00
Bobby Wibowo
d7d6a29123
feat: cleaned up routes init
asserting auth and JSON body will now be done via route-specific
mini middlewares (authController's requireUser or optionalUser)
2022-08-04 21:59:06 +07:00
Bobby Wibowo
2351528a42
fix: redundant logic 2022-08-03 17:31:49 +07:00
Bobby Wibowo
46c8867223
fix: internally prepend chunksData UUID with IP
even less chance for a collision to occur
2022-08-03 17:28:42 +07:00
Bobby Wibowo
0ebefe083a
refactor: removed clamscan passthrough support
unfortunately it simply was not reliable enough

and maintaining it is simply adding more complexity to the codes

moreover it was only possible to passthrough regular non-chunked uploads
2022-08-02 16:19:57 +07:00
Bobby Wibowo
164cadd8b9
feat: increased regular users' max sort keys to 2
possible use case, sorting by albumid, then size

moderators and above still have no limits
2022-08-01 15:21:23 +07:00
Bobby Wibowo
ac38b6f06e
feat: if sort uploads by album id, sort null last
also improved indenting on some lines of codes
2022-08-01 15:20:14 +07:00
Bobby Wibowo
285e79c5a7
feat: configurable uploads/albums/users per page
please check sample.config.js for new options

if missing from config, defaults to 25 per page (old defaults)
2022-07-31 15:51:32 +07:00
Bobby
b7dcf30578
feat: console logs for identifiers on debug only 2022-07-30 08:35:26 +07:00
Bobby Wibowo
8782a004d6
chore: uploadController.js 2022-07-29 10:17:17 +07:00
Bobby Wibowo
8748dcefb0
feat: parse content-disposition on url uploads 2022-07-29 10:15:11 +07:00
Bobby Wibowo
fae28f9aa2
feat: deprecate uploads.cacheFileIdentifiers conf
maintaining it is an unnecessary complexity
it's a feature that doesn't scale too well anyways

also renamed "queryDbForFileCollisions" to
"queryDatabaseForIdentifierMatch"
and updated config description accordingly

this should also now properly free the internal onHold Set
2022-07-29 09:14:55 +07:00
Bobby Wibowo
03eff45e8c
refactor: uploadController.js
some logic improvements
2022-07-28 13:26:15 +07:00
Bobby
301cf3377d
fix: set upload name utf8 encoding via busboy conf
instead of converting from the default latin1 using Buffer

changing busboy config was not possible with express + multer,
so i did not notice it's instead possible with hyper-express
2022-07-28 10:19:28 +07:00
Bobby Wibowo
ec4d54573a
fix: errors thrown when url uploads get rejected 2022-07-25 07:32:39 +07:00